1
0
mirror of https://gitea.tendokyu.moe/Dniel97/segatools.git synced 2024-11-27 22:40:48 +01:00

switched uint8_t -> bool in input, no pressure sense

This commit is contained in:
Hay1tsme 2022-01-09 12:30:31 -05:00
parent 1bc2fc141b
commit c91ef4005a
3 changed files with 11 additions and 11 deletions

View File

@ -36,7 +36,7 @@ static HRESULT touch_handle_get_unit_board_ver(const struct touch_req *req);
static HRESULT touch_handle_mystery1(const struct touch_req *req);
static HRESULT touch_handle_mystery2(const struct touch_req *req);
static HRESULT touch_handle_start_auto_scan(const struct touch_req *req);
static void touch_res_auto_scan(const uint8_t *state);
static void touch_res_auto_scan(const bool *state);
uint8_t input_frame_count_0 = 0x7b;
uint8_t input_frame_count_1 = 0x7b;
@ -409,18 +409,18 @@ static HRESULT touch_handle_start_auto_scan(const struct touch_req *req)
return hr;
}
static void touch_res_auto_scan(const uint8_t *state)
static void touch_res_auto_scan(const bool *state)
{
struct touch_input_frame frame0;
//struct touch_input_frame frame1;
uint8_t data1[24] = { 0 };
uint8_t data[24] = { 0 };
uint8_t data2[9] = { 0x0d, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00 };
frame0.cmd = 0x81;
frame0.count = input_frame_count_0++;
input_frame_count_0 %= 0x7f;
// for now return no data
memcpy(frame0.data1, data1, sizeof(data1));
memcpy(frame0.data1, data, sizeof(data));
memcpy(frame0.data2, data2, sizeof(data2));
frame0.checksum = 0;
frame0.checksum = calc_checksum(&frame0, sizeof(frame0));

View File

@ -89,21 +89,21 @@ void mercury_io_touch_start(mercury_io_touch_callback_t callback)
static unsigned int __stdcall mercury_io_touch_thread_proc(void *ctx)
{
mercury_io_touch_callback_t callback;
uint8_t pressure[240];
bool cellPressed[240];
size_t i;
callback = ctx;
while (!mercury_io_touch_stop_flag) {
for (i = 0 ; i < _countof(pressure) ; i++) {
if (GetAsyncKeyState(mercury_io_cfg.vk_cell[i]) & 0x8000) {
pressure[i] = 128;
for (i = 0 ; i < _countof(cellPressed) ; i++) {
if (GetAsyncKeyState(mercury_io_cfg.vk_cell[i])) {
cellPressed[i] = true;
} else {
pressure[i] = 0;
cellPressed[i] = false;
}
}
callback(pressure);
callback(cellPressed);
Sleep(1);
}

View File

@ -14,7 +14,7 @@ enum {
MERCURY_IO_GAMEBTN_VOL_DOWN = 0x02,
};
typedef void (*mercury_io_touch_callback_t)(const uint8_t *state);
typedef void (*mercury_io_touch_callback_t)(const bool *state);
/* Get the version of the Wacca IO API that this DLL supports. This
function should return a positive 16-bit integer, where the high byte is
the major version and the low byte is the minor version (as defined by the