mirror of
https://gitea.tendokyu.moe/Dniel97/segatools.git
synced 2024-11-24 05:20:10 +01:00
Merge pull request 'Add configurable debug logging' (#22) from Bottersnike/segatools:develop into develop
Reviewed-on: https://gitea.tendokyu.moe/Dniel97/segatools/pulls/22
This commit is contained in:
commit
ccb655a12b
3
.gitignore
vendored
3
.gitignore
vendored
@ -18,3 +18,6 @@ build/
|
|||||||
|
|
||||||
# External dependencies
|
# External dependencies
|
||||||
subprojects/capnhook
|
subprojects/capnhook
|
||||||
|
|
||||||
|
# For enabling debug logging on local builds
|
||||||
|
MesonLocalOptions.mk
|
||||||
|
9
Makefile
9
Makefile
@ -11,6 +11,11 @@ DOC_DIR := doc
|
|||||||
|
|
||||||
DIST_DIR := dist
|
DIST_DIR := dist
|
||||||
|
|
||||||
|
# Add "-D[option]=[value]" here as necessary
|
||||||
|
MESON_OPTIONS :=
|
||||||
|
# For options that shouldn't be committed
|
||||||
|
-include MesonLocalOptions.mk
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# Targets
|
# Targets
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
@ -19,9 +24,9 @@ include Package.mk
|
|||||||
|
|
||||||
.PHONY: build # Build the project
|
.PHONY: build # Build the project
|
||||||
build:
|
build:
|
||||||
$(V)meson --cross cross-mingw-32.txt $(BUILD_DIR_32)
|
$(V)meson setup $(MESON_OPTIONS) --cross cross-mingw-32.txt $(BUILD_DIR_32)
|
||||||
$(V)ninja -C $(BUILD_DIR_32)
|
$(V)ninja -C $(BUILD_DIR_32)
|
||||||
$(V)meson --cross cross-mingw-64.txt $(BUILD_DIR_64)
|
$(V)meson setup $(MESON_OPTIONS) --cross cross-mingw-64.txt $(BUILD_DIR_64)
|
||||||
$(V)ninja -C $(BUILD_DIR_64)
|
$(V)ninja -C $(BUILD_DIR_64)
|
||||||
|
|
||||||
.PHONY: dist # Build and create a zip distribution package
|
.PHONY: dist # Build and create a zip distribution package
|
||||||
|
@ -185,14 +185,14 @@ static HRESULT jvs_ioctl_sense(struct irp *irp)
|
|||||||
|
|
||||||
static HRESULT jvs_ioctl_transact(struct irp *irp)
|
static HRESULT jvs_ioctl_transact(struct irp *irp)
|
||||||
{
|
{
|
||||||
#if 0
|
#if defined(LOG_JVS)
|
||||||
dprintf("\nJVS Port: Outbound frame:\n");
|
dprintf("\nJVS Port: Outbound frame:\n");
|
||||||
dump_const_iobuf(&irp->write);
|
dump_const_iobuf(&irp->write);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
jvs_bus_transact(jvs_root, irp->write.bytes, irp->write.nbytes, &irp->read);
|
jvs_bus_transact(jvs_root, irp->write.bytes, irp->write.nbytes, &irp->read);
|
||||||
|
|
||||||
#if 0
|
#if defined(LOG_JVS)
|
||||||
dprintf("JVS Port: Inbound frame:\n");
|
dprintf("JVS Port: Inbound frame:\n");
|
||||||
dump_iobuf(&irp->read);
|
dump_iobuf(&irp->read);
|
||||||
dprintf("\n");
|
dprintf("\n");
|
||||||
|
@ -230,7 +230,7 @@ static HRESULT io3_cmd(
|
|||||||
|
|
||||||
case JVS_CMD_READ_ANALOGS:
|
case JVS_CMD_READ_ANALOGS:
|
||||||
return io3_cmd_read_analogs(io3, req, resp);
|
return io3_cmd_read_analogs(io3, req, resp);
|
||||||
|
|
||||||
case JVS_CMD_READ_ROTARYS:
|
case JVS_CMD_READ_ROTARYS:
|
||||||
return io3_cmd_read_rotarys(io3, req, resp);
|
return io3_cmd_read_rotarys(io3, req, resp);
|
||||||
|
|
||||||
@ -390,7 +390,7 @@ static HRESULT io3_cmd_read_switches(
|
|||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if defined(LOG_IO3)
|
||||||
dprintf("JVS I/O: Read switches, np=%i, bpp=%i\n",
|
dprintf("JVS I/O: Read switches, np=%i, bpp=%i\n",
|
||||||
req.num_players,
|
req.num_players,
|
||||||
req.bytes_per_player);
|
req.bytes_per_player);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
SEGA 837-15093-XX LED Controller Board emulator
|
SEGA 837-15093-XX LED Controller Board emulator
|
||||||
|
|
||||||
Supported variants:
|
Supported variants:
|
||||||
|
|
||||||
837-15093
|
837-15093
|
||||||
@ -106,7 +106,7 @@ static uint8_t led15093_host_adr = 1;
|
|||||||
static io_led_init_t led_init;
|
static io_led_init_t led_init;
|
||||||
static io_led_set_leds_t set_leds;
|
static io_led_set_leds_t set_leds;
|
||||||
|
|
||||||
HRESULT led15093_hook_init(const struct led15093_config *cfg, io_led_init_t _led_init,
|
HRESULT led15093_hook_init(const struct led15093_config *cfg, io_led_init_t _led_init,
|
||||||
io_led_set_leds_t _set_leds, unsigned int first_port, unsigned int num_boards, uint8_t board_adr, uint8_t host_adr)
|
io_led_set_leds_t _set_leds, unsigned int first_port, unsigned int num_boards, uint8_t board_adr, uint8_t host_adr)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -236,12 +236,12 @@ static HRESULT led15093_handle_irp_locked(int board, struct irp *irp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (irp->op == IRP_OP_OPEN) {
|
if (irp->op == IRP_OP_OPEN) {
|
||||||
dprintf("LED 15093: Starting backend DLL\n");
|
dprintf("LED 15093: Starting backend DLL\n");
|
||||||
// int res = led_init();
|
// int res = led_init();
|
||||||
hr = led_init();
|
hr = led_init();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (res != 0) {
|
if (res != 0) {
|
||||||
dprintf("LED 15093: Backend error, LED board disconnected: "
|
dprintf("LED 15093: Backend error, LED board disconnected: "
|
||||||
@ -267,7 +267,7 @@ static HRESULT led15093_handle_irp_locked(int board, struct irp *irp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
#if 0
|
#if defined(LOG_LED15093)
|
||||||
dprintf("TX Buffer:\n");
|
dprintf("TX Buffer:\n");
|
||||||
dump_iobuf(&boarduart->written);
|
dump_iobuf(&boarduart->written);
|
||||||
#endif
|
#endif
|
||||||
@ -294,7 +294,7 @@ static HRESULT led15093_handle_irp_locked(int board, struct irp *irp)
|
|||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if defined(LOG_LED15093)
|
||||||
dprintf("Deframe Buffer:\n");
|
dprintf("Deframe Buffer:\n");
|
||||||
dump_iobuf(&req_iobuf);
|
dump_iobuf(&req_iobuf);
|
||||||
#endif
|
#endif
|
||||||
@ -717,7 +717,7 @@ static HRESULT led15093_req_set_imm_led(int board, const struct led15093_req_set
|
|||||||
resp.status = v->status_code;
|
resp.status = v->status_code;
|
||||||
if (req->cmd == LED_15093_CMD_SET_IMM_LED) {
|
if (req->cmd == LED_15093_CMD_SET_IMM_LED) {
|
||||||
resp.cmd = LED_15093_CMD_SET_IMM_LED;
|
resp.cmd = LED_15093_CMD_SET_IMM_LED;
|
||||||
}
|
}
|
||||||
// else {
|
// else {
|
||||||
// resp.cmd = LED_15093_CMD_SET_IMM_LED_LEGACY;
|
// resp.cmd = LED_15093_CMD_SET_IMM_LED_LEGACY;
|
||||||
// }
|
// }
|
||||||
|
@ -420,7 +420,7 @@ static HRESULT sg_nfc_cmd_felica_encap(
|
|||||||
f_res.nbytes = sizeof(res->payload);
|
f_res.nbytes = sizeof(res->payload);
|
||||||
f_res.pos = 1;
|
f_res.pos = 1;
|
||||||
|
|
||||||
#if 0
|
#if defined(LOG_NFC)
|
||||||
dprintf("FELICA OUTBOUND:\n");
|
dprintf("FELICA OUTBOUND:\n");
|
||||||
dump_const_iobuf(&f_req);
|
dump_const_iobuf(&f_req);
|
||||||
#endif
|
#endif
|
||||||
@ -434,7 +434,7 @@ static HRESULT sg_nfc_cmd_felica_encap(
|
|||||||
sg_res_init(&res->res, &req->req, f_res.pos);
|
sg_res_init(&res->res, &req->req, f_res.pos);
|
||||||
res->payload[0] = f_res.pos;
|
res->payload[0] = f_res.pos;
|
||||||
|
|
||||||
#if 0
|
#if defined(LOG_NFC)
|
||||||
dprintf("FELICA INBOUND:\n");
|
dprintf("FELICA INBOUND:\n");
|
||||||
dump_iobuf(&f_res);
|
dump_iobuf(&f_res);
|
||||||
#endif
|
#endif
|
||||||
|
@ -115,14 +115,14 @@ static HRESULT sg_reader_handle_irp_locked(struct irp *irp)
|
|||||||
{
|
{
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
#if 0
|
#if defined(LOG_NFC)
|
||||||
if (irp->op == IRP_OP_WRITE) {
|
if (irp->op == IRP_OP_WRITE) {
|
||||||
dprintf("WRITE:\n");
|
dprintf("WRITE:\n");
|
||||||
dump_const_iobuf(&irp->write);
|
dump_const_iobuf(&irp->write);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if defined(LOG_NFC)
|
||||||
if (irp->op == IRP_OP_READ) {
|
if (irp->op == IRP_OP_READ) {
|
||||||
dprintf("READ:\n");
|
dprintf("READ:\n");
|
||||||
dump_iobuf(&sg_reader_uart.readable);
|
dump_iobuf(&sg_reader_uart.readable);
|
||||||
|
@ -78,7 +78,7 @@ static HRESULT controlbd_frame_decode(struct controlbd_req_any *req, struct iobu
|
|||||||
uint8_t checksum_pos = src->pos - 1;
|
uint8_t checksum_pos = src->pos - 1;
|
||||||
uint8_t calculated_checksum = 0;
|
uint8_t calculated_checksum = 0;
|
||||||
uint8_t checksum = 0;
|
uint8_t checksum = 0;
|
||||||
|
|
||||||
if (src->pos < 6) {
|
if (src->pos < 6) {
|
||||||
dprintf("Control Board: Decode Error, request too short (pos is 0x%08X)\n", (int)src->pos);
|
dprintf("Control Board: Decode Error, request too short (pos is 0x%08X)\n", (int)src->pos);
|
||||||
return SEC_E_BUFFER_TOO_SMALL;
|
return SEC_E_BUFFER_TOO_SMALL;
|
||||||
@ -137,7 +137,7 @@ static HRESULT controlbd_handle_irp_locked(struct irp *irp)
|
|||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (controlbd_uart.written.bytes[0] == 0xE0) {
|
if (controlbd_uart.written.bytes[0] == 0xE0) {
|
||||||
#if 0
|
#if defined(LOG_CAROL_CONTROL_BD)
|
||||||
dprintf("Control Board: TX Buffer:\n");
|
dprintf("Control Board: TX Buffer:\n");
|
||||||
dump_iobuf(&controlbd_uart.written);
|
dump_iobuf(&controlbd_uart.written);
|
||||||
#endif
|
#endif
|
||||||
@ -147,12 +147,12 @@ static HRESULT controlbd_handle_irp_locked(struct irp *irp)
|
|||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
hr = controlbd_req_dispatch(&req);
|
hr = controlbd_req_dispatch(&req);
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
dprintf("Control Board: Dispatch Error: 0X%X\n", (int) hr);
|
dprintf("Control Board: Dispatch Error: 0X%X\n", (int) hr);
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
#if 0
|
#if defined(LOG_CAROL_CONTROL_BD)
|
||||||
dprintf("Control Board: RX Buffer:\n");
|
dprintf("Control Board: RX Buffer:\n");
|
||||||
dump_iobuf(&controlbd_uart.readable);
|
dump_iobuf(&controlbd_uart.readable);
|
||||||
#endif
|
#endif
|
||||||
@ -206,7 +206,7 @@ static HRESULT controlbd_req_dispatch(const struct controlbd_req_any *req)
|
|||||||
case CONTROLBD_CMD_FIRM_SUM:
|
case CONTROLBD_CMD_FIRM_SUM:
|
||||||
return controlbd_req_firmware_checksum();
|
return controlbd_req_firmware_checksum();
|
||||||
|
|
||||||
case CONTROLBD_CMD_TIMEOUT:
|
case CONTROLBD_CMD_TIMEOUT:
|
||||||
dprintf("Control Board: Acknowledge Timeout\n");
|
dprintf("Control Board: Acknowledge Timeout\n");
|
||||||
return controlbd_req_ack_any(req->hdr.cmd);
|
return controlbd_req_ack_any(req->hdr.cmd);
|
||||||
|
|
||||||
@ -278,7 +278,7 @@ static HRESULT controlbd_req_get_board_info(void)
|
|||||||
resp.rev = 0x90;
|
resp.rev = 0x90;
|
||||||
resp.bfr_size = 0x0001;
|
resp.bfr_size = 0x0001;
|
||||||
resp.ack = 1;
|
resp.ack = 1;
|
||||||
|
|
||||||
strcpy_s(resp.bd_no, sizeof(resp.bd_no), "15312 ");
|
strcpy_s(resp.bd_no, sizeof(resp.bd_no), "15312 ");
|
||||||
strcpy_s(resp.chip_no, sizeof(resp.chip_no), "6699 ");
|
strcpy_s(resp.chip_no, sizeof(resp.chip_no), "6699 ");
|
||||||
resp.chip_no[5] = 0xFF;
|
resp.chip_no[5] = 0xFF;
|
||||||
@ -317,7 +317,7 @@ static HRESULT controlbd_req_polling(const struct controlbd_req_any *req)
|
|||||||
resp.unk7 = 3;
|
resp.unk7 = 3;
|
||||||
resp.unk8 = 1;
|
resp.unk8 = 1;
|
||||||
resp.unk9 = 1;
|
resp.unk9 = 1;
|
||||||
|
|
||||||
resp.btns_pressed = 0; // bit 1 is pen button, bit 2 is dodge
|
resp.btns_pressed = 0; // bit 1 is pen button, bit 2 is dodge
|
||||||
resp.coord_x = 0x0;
|
resp.coord_x = 0x0;
|
||||||
resp.coord_y = 0x0;
|
resp.coord_y = 0x0;
|
||||||
|
@ -94,7 +94,7 @@ static HRESULT ledbd_handle_irp_locked(struct irp *irp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
#if 0
|
#if defined(LOG_CAROL_LED_BD)
|
||||||
dprintf("LED Board: TX Buffer:\n");
|
dprintf("LED Board: TX Buffer:\n");
|
||||||
dump_iobuf(&ledbd_uart.written);
|
dump_iobuf(&ledbd_uart.written);
|
||||||
#endif
|
#endif
|
||||||
@ -165,4 +165,4 @@ static HRESULT ledbd_req_unkF0(uint8_t cmd)
|
|||||||
iobuf_write(&ledbd_uart.readable, resp, 16);
|
iobuf_write(&ledbd_uart.readable, resp, 16);
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ HRESULT touch_hook_init(const struct touch_config *cfg)
|
|||||||
if (!cfg->enable) {
|
if (!cfg->enable) {
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
InitializeCriticalSection(&touch_lock);
|
InitializeCriticalSection(&touch_lock);
|
||||||
|
|
||||||
uart_init(&touch_uart, 1);
|
uart_init(&touch_uart, 1);
|
||||||
@ -112,7 +112,7 @@ static HRESULT touch_handle_irp_locked(struct irp *irp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
#if 0
|
#if defined(LOG_CAROL_TOUCH)
|
||||||
dprintf("Touchscreen: TX Buffer:\n");
|
dprintf("Touchscreen: TX Buffer:\n");
|
||||||
dump_iobuf(&touch_uart.written);
|
dump_iobuf(&touch_uart.written);
|
||||||
#endif
|
#endif
|
||||||
@ -188,7 +188,7 @@ static void touch_scan_auto(const bool is_pressed, const uint16_t mouse_x, const
|
|||||||
resp.touches[0].touch_id = 1;
|
resp.touches[0].touch_id = 1;
|
||||||
tmp_x = mouse_x & 0x7FFF;
|
tmp_x = mouse_x & 0x7FFF;
|
||||||
tmp_y = mouse_y & 0x7FFF;
|
tmp_y = mouse_y & 0x7FFF;
|
||||||
|
|
||||||
resp.touches[0].x1 = tmp_x & 0x7F;
|
resp.touches[0].x1 = tmp_x & 0x7F;
|
||||||
resp.touches[0].x2 = (tmp_x >> 7) & 0x7F;
|
resp.touches[0].x2 = (tmp_x >> 7) & 0x7F;
|
||||||
resp.touches[0].y1 = tmp_y & 0x7F;
|
resp.touches[0].y1 = tmp_y & 0x7F;
|
||||||
@ -201,7 +201,7 @@ static void touch_scan_auto(const bool is_pressed, const uint16_t mouse_x, const
|
|||||||
dprintf("Touch: Mouse down! x %02X %02X y: %02X %02X\n", resp.touches[0].x1, resp.touches[0].x2, resp.touches[0].y1, resp.touches[0].y2);
|
dprintf("Touch: Mouse down! x %02X %02X y: %02X %02X\n", resp.touches[0].x1, resp.touches[0].x2, resp.touches[0].y1, resp.touches[0].y2);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
last_x1 = resp.touches[0].x1;
|
last_x1 = resp.touches[0].x1;
|
||||||
last_x2 = resp.touches[0].x2;
|
last_x2 = resp.touches[0].x2;
|
||||||
last_y1 = resp.touches[0].y1;
|
last_y1 = resp.touches[0].y1;
|
||||||
@ -220,7 +220,7 @@ static void touch_scan_auto(const bool is_pressed, const uint16_t mouse_x, const
|
|||||||
iobuf_write(&touch_uart.readable, &resp, sizeof(resp));
|
iobuf_write(&touch_uart.readable, &resp, sizeof(resp));
|
||||||
LeaveCriticalSection(&touch_lock);
|
LeaveCriticalSection(&touch_lock);
|
||||||
|
|
||||||
#if 0
|
#if defined(LOG_CAROL_TOUCH)
|
||||||
dprintf("Touch: RX Buffer: (pos %08x)\n", (uint32_t)touch_uart.readable.pos);
|
dprintf("Touch: RX Buffer: (pos %08x)\n", (uint32_t)touch_uart.readable.pos);
|
||||||
dump_iobuf(&touch_uart.readable);
|
dump_iobuf(&touch_uart.readable);
|
||||||
#endif
|
#endif
|
||||||
|
@ -98,7 +98,7 @@ static HRESULT slider_handle_irp_locked(struct irp *irp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
#if 0
|
#if defined(LOG_CHUNI_SLIDER)
|
||||||
dprintf("TX Buffer:\n");
|
dprintf("TX Buffer:\n");
|
||||||
dump_iobuf(&slider_uart.written);
|
dump_iobuf(&slider_uart.written);
|
||||||
#endif
|
#endif
|
||||||
@ -117,7 +117,7 @@ static HRESULT slider_handle_irp_locked(struct irp *irp)
|
|||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if defined(LOG_CHUNI_SLIDER)
|
||||||
dprintf("Deframe Buffer:\n");
|
dprintf("Deframe Buffer:\n");
|
||||||
dump_iobuf(&req_iobuf);
|
dump_iobuf(&req_iobuf);
|
||||||
#endif
|
#endif
|
||||||
|
@ -98,7 +98,7 @@ static HRESULT slider_handle_irp_locked(struct irp *irp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
#if 0
|
#if defined(LOG_CHUSAN_SLIDER)
|
||||||
dprintf("TX Buffer:\n");
|
dprintf("TX Buffer:\n");
|
||||||
dump_iobuf(&slider_uart.written);
|
dump_iobuf(&slider_uart.written);
|
||||||
#endif
|
#endif
|
||||||
@ -117,7 +117,7 @@ static HRESULT slider_handle_irp_locked(struct irp *irp)
|
|||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if defined(LOG_CHUSAN_SLIDER)
|
||||||
dprintf("Deframe Buffer:\n");
|
dprintf("Deframe Buffer:\n");
|
||||||
dump_iobuf(&req_iobuf);
|
dump_iobuf(&req_iobuf);
|
||||||
#endif
|
#endif
|
||||||
|
@ -99,7 +99,7 @@ static HRESULT slider_handle_irp_locked(struct irp *irp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
#if 0
|
#if defined(LOG_DIVA_SLIDER)
|
||||||
dprintf("TX Buffer:\n");
|
dprintf("TX Buffer:\n");
|
||||||
dump_iobuf(&slider_uart.written);
|
dump_iobuf(&slider_uart.written);
|
||||||
#endif
|
#endif
|
||||||
@ -118,7 +118,7 @@ static HRESULT slider_handle_irp_locked(struct irp *irp)
|
|||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if defined(LOG_DIVA_SLIDER)
|
||||||
dprintf("Deframe Buffer:\n");
|
dprintf("Deframe Buffer:\n");
|
||||||
dump_iobuf(&req_iobuf);
|
dump_iobuf(&req_iobuf);
|
||||||
#endif
|
#endif
|
||||||
|
@ -46,7 +46,7 @@ void jvs_crack_request(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if defined(LOG_JVS)
|
||||||
dprintf("Decoded request:\n");
|
dprintf("Decoded request:\n");
|
||||||
dump_iobuf(&decode);
|
dump_iobuf(&decode);
|
||||||
#endif
|
#endif
|
||||||
@ -96,7 +96,7 @@ void jvs_crack_request(
|
|||||||
resp_bytes[2] = 0x01; /* Status: Success */
|
resp_bytes[2] = 0x01; /* Status: Success */
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if defined(LOG_JVS)
|
||||||
dprintf("Encoding response:\n");
|
dprintf("Encoding response:\n");
|
||||||
dump_iobuf(&encode);
|
dump_iobuf(&encode);
|
||||||
#endif
|
#endif
|
||||||
|
@ -130,7 +130,7 @@ static HRESULT touch0_handle_irp_locked(struct irp *irp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
#if 0
|
#if defined(LOG_MERCURY_SLIDER)
|
||||||
dprintf("TX0 Buffer:\n");
|
dprintf("TX0 Buffer:\n");
|
||||||
dump_iobuf(&touch0_uart.written);
|
dump_iobuf(&touch0_uart.written);
|
||||||
#endif
|
#endif
|
||||||
@ -177,7 +177,7 @@ static HRESULT touch1_handle_irp_locked(struct irp *irp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
#if 0
|
#if defined(LOG_MERCURY_SLIDER)
|
||||||
dprintf("TX1 Buffer:\n");
|
dprintf("TX1 Buffer:\n");
|
||||||
dump_iobuf(&touch1_uart.written);
|
dump_iobuf(&touch1_uart.written);
|
||||||
#endif
|
#endif
|
||||||
@ -305,11 +305,11 @@ static HRESULT touch_handle_get_unit_board_ver(const struct touch_req *req)
|
|||||||
resp.cmd = 0xa8;
|
resp.cmd = 0xa8;
|
||||||
resp.checksum = 0;
|
resp.checksum = 0;
|
||||||
|
|
||||||
if (req->side == 0) {
|
if (req->side == 0) {
|
||||||
resp.version[6] = 'R';
|
resp.version[6] = 'R';
|
||||||
resp.checksum = calc_checksum(&resp, sizeof(resp));
|
resp.checksum = calc_checksum(&resp, sizeof(resp));
|
||||||
|
|
||||||
#if 0
|
#if defined(LOG_MERCURY_SLIDER)
|
||||||
for (int i = 0; i < sizeof(resp.version); i++) {
|
for (int i = 0; i < sizeof(resp.version); i++) {
|
||||||
dprintf("0x%02x ", resp.version[i]);
|
dprintf("0x%02x ", resp.version[i]);
|
||||||
}
|
}
|
||||||
@ -322,7 +322,7 @@ static HRESULT touch_handle_get_unit_board_ver(const struct touch_req *req)
|
|||||||
resp.version[6] = 'L';
|
resp.version[6] = 'L';
|
||||||
resp.checksum = calc_checksum(&resp, sizeof(resp));
|
resp.checksum = calc_checksum(&resp, sizeof(resp));
|
||||||
|
|
||||||
#if 0
|
#if defined(LOG_MERCURY_SLIDER)
|
||||||
for (int i = 0; i < sizeof(resp.version); i++) {
|
for (int i = 0; i < sizeof(resp.version); i++) {
|
||||||
dprintf("0x%02x ", resp.version[i]);
|
dprintf("0x%02x ", resp.version[i]);
|
||||||
}
|
}
|
||||||
@ -370,7 +370,7 @@ static HRESULT touch_handle_mystery2(const struct touch_req *req)
|
|||||||
|
|
||||||
if (req->side == 0) {
|
if (req->side == 0) {
|
||||||
hr = iobuf_write(&touch0_uart.readable, &resp, sizeof(resp));
|
hr = iobuf_write(&touch0_uart.readable, &resp, sizeof(resp));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
hr = iobuf_write(&touch1_uart.readable, &resp, sizeof(resp));
|
hr = iobuf_write(&touch1_uart.readable, &resp, sizeof(resp));
|
||||||
}
|
}
|
||||||
@ -388,7 +388,7 @@ static HRESULT touch_handle_start_auto_scan(const struct touch_req *req)
|
|||||||
|
|
||||||
dprintf("Wacca Touch%d: Start Auto", req->side);
|
dprintf("Wacca Touch%d: Start Auto", req->side);
|
||||||
|
|
||||||
#if 0
|
#if defined(LOG_MERCURY_SLIDER)
|
||||||
for (int i = 0; i < req->data_length; i++)
|
for (int i = 0; i < req->data_length; i++)
|
||||||
dprintf("0x%02x ", req->data[i]);
|
dprintf("0x%02x ", req->data[i]);
|
||||||
#endif
|
#endif
|
||||||
@ -451,13 +451,13 @@ static void touch_res_auto_scan(const bool *state)
|
|||||||
counter++;
|
counter++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(frame0.data1, dataR, sizeof(dataR));
|
memcpy(frame0.data1, dataR, sizeof(dataR));
|
||||||
memcpy(frame0.data2, data2, sizeof(data2));
|
memcpy(frame0.data2, data2, sizeof(data2));
|
||||||
|
|
||||||
memcpy(frame1.data1, dataL, sizeof(dataL));
|
memcpy(frame1.data1, dataL, sizeof(dataL));
|
||||||
memcpy(frame1.data2, data2, sizeof(data2));
|
memcpy(frame1.data2, data2, sizeof(data2));
|
||||||
|
|
||||||
frame0.checksum = 0;
|
frame0.checksum = 0;
|
||||||
frame0.checksum = calc_checksum(&frame0, sizeof(frame0));
|
frame0.checksum = calc_checksum(&frame0, sizeof(frame0));
|
||||||
|
|
||||||
|
37
meson.build
37
meson.build
@ -39,6 +39,43 @@ if cc.get_id() != 'msvc'
|
|||||||
)
|
)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if get_option('log_all') or get_option('log_jvs')
|
||||||
|
add_project_arguments('-DLOG_JVS', language: 'c')
|
||||||
|
endif
|
||||||
|
if get_option('log_all') or get_option('log_io3')
|
||||||
|
add_project_arguments('-DLOG_IO3', language: 'c')
|
||||||
|
endif
|
||||||
|
if get_option('log_all') or get_option('log_led15093')
|
||||||
|
add_project_arguments('-DLOG_LED15093', language: 'c')
|
||||||
|
endif
|
||||||
|
if get_option('log_all') or get_option('log_nfc')
|
||||||
|
add_project_arguments('-DLOG_NFC', language: 'c')
|
||||||
|
endif
|
||||||
|
if get_option('log_all') or get_option('log_carol_control_bd')
|
||||||
|
add_project_arguments('-DLOG_CAROL_CONTROL_BD', language: 'c')
|
||||||
|
endif
|
||||||
|
if get_option('log_all') or get_option('log_carol_led_bd')
|
||||||
|
add_project_arguments('-DLOG_CAROL_LED_BD', language: 'c')
|
||||||
|
endif
|
||||||
|
if get_option('log_all') or get_option('log_carol_touch')
|
||||||
|
add_project_arguments('-DLOG_CAROL_TOUCH', language: 'c')
|
||||||
|
endif
|
||||||
|
if get_option('log_all') or get_option('log_chuni_slider')
|
||||||
|
add_project_arguments('-DLOG_CHUNI_SLIDER', language: 'c')
|
||||||
|
endif
|
||||||
|
if get_option('log_all') or get_option('log_chusan_slider')
|
||||||
|
add_project_arguments('-DLOG_CHUSAN_SLIDER', language: 'c')
|
||||||
|
endif
|
||||||
|
if get_option('log_all') or get_option('log_diva_slider')
|
||||||
|
add_project_arguments('-DLOG_DIVA_SLIDER', language: 'c')
|
||||||
|
endif
|
||||||
|
if get_option('log_all') or get_option('log_mercury_slider')
|
||||||
|
add_project_arguments('-DLOG_MERCURY_SLIDER', language: 'c')
|
||||||
|
endif
|
||||||
|
if get_option('log_all') or get_option('log_clock')
|
||||||
|
add_project_arguments('-DLOG_CLOCK', language: 'c')
|
||||||
|
endif
|
||||||
|
|
||||||
shlwapi_lib = cc.find_library('shlwapi')
|
shlwapi_lib = cc.find_library('shlwapi')
|
||||||
dinput8_lib = cc.find_library('dinput8')
|
dinput8_lib = cc.find_library('dinput8')
|
||||||
dxguid_lib = cc.find_library('dxguid')
|
dxguid_lib = cc.find_library('dxguid')
|
||||||
|
65
meson_options.txt
Normal file
65
meson_options.txt
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
option('log_all',
|
||||||
|
type : 'boolean',
|
||||||
|
value : false,
|
||||||
|
description : 'Enables all of the subsequent debug logging options'
|
||||||
|
)
|
||||||
|
option('log_jvs',
|
||||||
|
type : 'boolean',
|
||||||
|
value : false,
|
||||||
|
description : 'Enable debug logging for JVS'
|
||||||
|
)
|
||||||
|
option('log_io3',
|
||||||
|
type : 'boolean',
|
||||||
|
value : false,
|
||||||
|
description : 'Enable debug logging for JVS'
|
||||||
|
)
|
||||||
|
option('log_led15093',
|
||||||
|
type : 'boolean',
|
||||||
|
value : false,
|
||||||
|
description : 'Enable debug logging for the 15093 LED board emulation'
|
||||||
|
)
|
||||||
|
option('log_nfc',
|
||||||
|
type : 'boolean',
|
||||||
|
value : false,
|
||||||
|
description : 'Enable debug logging for NFC'
|
||||||
|
)
|
||||||
|
option('log_carol_control_bd',
|
||||||
|
type : 'boolean',
|
||||||
|
value : false,
|
||||||
|
description : 'Enable debug logging for the Carlo Control Board'
|
||||||
|
)
|
||||||
|
option('log_carol_led_bd',
|
||||||
|
type : 'boolean',
|
||||||
|
value : false,
|
||||||
|
description : 'Enable debug logging for the Carlo LED Board'
|
||||||
|
)
|
||||||
|
option('log_carol_touch',
|
||||||
|
type : 'boolean',
|
||||||
|
value : false,
|
||||||
|
description : 'Enable debug logging for the Carlo Touchscreen'
|
||||||
|
)
|
||||||
|
option('log_chuni_slider',
|
||||||
|
type : 'boolean',
|
||||||
|
value : false,
|
||||||
|
description : 'Enable debug logging for the Chunithm Slider'
|
||||||
|
)
|
||||||
|
option('log_chusan_slider',
|
||||||
|
type : 'boolean',
|
||||||
|
value : false,
|
||||||
|
description : 'Enable debug logging for the Chusan Slider'
|
||||||
|
)
|
||||||
|
option('log_diva_slider',
|
||||||
|
type : 'boolean',
|
||||||
|
value : false,
|
||||||
|
description : 'Enable debug logging for the Diva Slider'
|
||||||
|
)
|
||||||
|
option('log_mercury_slider',
|
||||||
|
type : 'boolean',
|
||||||
|
value : false,
|
||||||
|
description : 'Enable debug logging for the WACCA Slider'
|
||||||
|
)
|
||||||
|
option('log_clock',
|
||||||
|
type : 'boolean',
|
||||||
|
value : false,
|
||||||
|
description : 'Enable debug logging for clock APIs'
|
||||||
|
)
|
@ -158,7 +158,7 @@ static BOOL WINAPI my_GetSystemTime(SYSTEMTIME *out)
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if defined(LOG_CLOCK)
|
||||||
static int last_second;
|
static int last_second;
|
||||||
|
|
||||||
if (out->wSecond != last_second) {
|
if (out->wSecond != last_second) {
|
||||||
|
Loading…
Reference in New Issue
Block a user