From bd8dc18b30fc8f4a09b30015d46996fd0c985906 Mon Sep 17 00:00:00 2001 From: icex2 Date: Tue, 11 Aug 2020 22:05:46 +0200 Subject: [PATCH 1/3] iidxio-ezusb: Support coin mech input --- src/main/iidxio-ezusb/iidxio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/iidxio-ezusb/iidxio.c b/src/main/iidxio-ezusb/iidxio.c index 3852582..0a74a29 100644 --- a/src/main/iidxio-ezusb/iidxio.c +++ b/src/main/iidxio-ezusb/iidxio.c @@ -192,7 +192,8 @@ uint8_t iidx_io_ep2_get_slider(uint8_t slider_no) uint8_t iidx_io_ep2_get_sys(void) { - return ((~iidx_io_ezusb_read_packet.inverted_pad) >> 28) & 0x03; + return (((~iidx_io_ezusb_read_packet.inverted_pad) >> 28) & 0x03) | + ((((~iidx_io_ezusb_read_packet.inverted_pad) >> 22) & 0x01) << 2); } uint8_t iidx_io_ep2_get_panel(void) From 3396c09fbf661ffb425486aeb6dc6fa18c2b1447 Mon Sep 17 00:00:00 2001 From: icex2 Date: Tue, 11 Aug 2020 23:11:23 +0200 Subject: [PATCH 2/3] ezusb-iidx: Add macro to enable D01 board emulation Used for dumping firmware, only. C02 and D01 boards only differ in the FPGA firmware written to the board on boot up. This doesn't matter for emulation, but when using a real IO board with iidxio-ezusb.dll, a different FPGA firmware is required to be flashed in order to get working turntables, top unit lights etc --- src/main/ezusb-iidx-emu/msg.c | 4 ++++ src/main/ezusb-iidx/msg.h | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/ezusb-iidx-emu/msg.c b/src/main/ezusb-iidx-emu/msg.c index c7dafcb..c651042 100644 --- a/src/main/ezusb-iidx-emu/msg.c +++ b/src/main/ezusb-iidx-emu/msg.c @@ -160,6 +160,10 @@ static HRESULT ezusb_iidx_emu_msg_interrupt_read(struct iobuf *read) otherwise the game's fpga check will fail */ msg_resp->fpga2_check_flag_unkn = 2; +#ifdef EZUSB_IIDX_EMU_D01_BOARD + msg_resp->inverted_pad &= ~(1 << 4); +#endif + read->pos = sizeof(*msg_resp); return S_OK; diff --git a/src/main/ezusb-iidx/msg.h b/src/main/ezusb-iidx/msg.h index 718f149..5f81f8d 100644 --- a/src/main/ezusb-iidx/msg.h +++ b/src/main/ezusb-iidx/msg.h @@ -59,7 +59,9 @@ struct ezusb_iidx_msg_interrupt_read_packet { 1: Not used 2: Not used 3: Not used - 4: Not used + 4: C02/D01 board identifier, 1 = C02, 0 = D01 (on active low). This defines how the game has + to flash the FPGA board since D01 needs a different firmware (see result of FPGA CHECK on + game bootup) 5: Not used 6: usb mute? 7: Not used From 93cfb591b74d003aa57a26a127a3bccb8c28de0d Mon Sep 17 00:00:00 2001 From: icex2 Date: Tue, 11 Aug 2020 23:17:09 +0200 Subject: [PATCH 3/3] iidxio-ezusb: Update documentation --- doc/iidxhook/iidxio-ezusb.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/iidxhook/iidxio-ezusb.md b/doc/iidxhook/iidxio-ezusb.md index ca893ce..981e04b 100644 --- a/doc/iidxhook/iidxio-ezusb.md +++ b/doc/iidxhook/iidxio-ezusb.md @@ -1,4 +1,4 @@ -This library drives a "legacy" ezusb IO board, also known as C02 IO, and +This library drives a "legacy" ezusb IO board, also known as C02/D01 IO, and implements the iidxio API of BT5. Thus, it allows you to use this IO board with *any* version of IIDX that is supported by BT5. @@ -24,5 +24,7 @@ the status LEDs on the side of the board should show a blinking pattern. dump to the FPGA. * There is a script called ezusb-boot.bat which combines the two steps above and can be integrated into the startup process of a dedicated setup. +* If you are using a D01 IO board, use the `fpga-d01.bin` file instead of the +`fpga.bin` file. * If you ignore these steps, you will either run into errors or parts of the IO board won't work (e.g. lights). \ No newline at end of file