chuasn: fixed coin insert for custom chuniio

This commit is contained in:
Dniel97 2023-12-17 09:26:30 +01:00
parent 72db08ac93
commit 1cbc33d97d
Signed by untrusted user: Dniel97
GPG Key ID: 6180B3C768FB2E08
3 changed files with 5 additions and 15 deletions

View File

@ -38,7 +38,7 @@ void chuni_io_jvs_read_coin_counter(uint16_t *out)
return; return;
} }
if (GetAsyncKeyState(chuni_io_cfg.vk_coin)) { if (GetAsyncKeyState(chuni_io_cfg.vk_coin) & 0x8000) {
if (!chuni_io_coin) { if (!chuni_io_coin) {
chuni_io_coin = true; chuni_io_coin = true;
chuni_io_coins++; chuni_io_coins++;
@ -62,15 +62,6 @@ void chuni_io_jvs_poll(uint8_t *opbtn, uint8_t *beams)
*opbtn |= CHUNI_IO_OPBTN_SERVICE; *opbtn |= CHUNI_IO_OPBTN_SERVICE;
} }
if (GetAsyncKeyState(chuni_io_cfg.vk_coin) & 0x8000) {
if (!chuni_io_coin) {
chuni_io_coin = true;
*opbtn |= CHUNI_IO_OPBTN_COIN;
}
} else {
chuni_io_coin = false;
}
if (chuni_io_cfg.vk_ir_emu) { if (chuni_io_cfg.vk_ir_emu) {
// Use emulated AIR // Use emulated AIR
if (GetAsyncKeyState(chuni_io_cfg.vk_ir_emu)) { if (GetAsyncKeyState(chuni_io_cfg.vk_ir_emu)) {

View File

@ -73,6 +73,7 @@ static HRESULT chusan_io4_poll(void* ctx, struct io4_state* state)
beams = 0; beams = 0;
chuni_dll.jvs_poll(&opbtn, &beams); chuni_dll.jvs_poll(&opbtn, &beams);
chuni_dll.jvs_read_coin_counter(&coins);
if (chuni_dll.api_version >= 0x0101) { if (chuni_dll.api_version >= 0x0101) {
// Use correct mapping // Use correct mapping
@ -90,9 +91,7 @@ static HRESULT chusan_io4_poll(void* ctx, struct io4_state* state)
state->buttons[0] |= IO4_BUTTON_SERVICE; state->buttons[0] |= IO4_BUTTON_SERVICE;
} }
if (opbtn & CHUNI_IO_OPBTN_COIN) { // Update the coin counter with the value from jvs_read_coin_counter
coins++;
}
state->chutes[0] = coins << 8; state->chutes[0] = coins << 8;
for (i = 0; i < 6; i++) { for (i = 0; i < 6; i++) {

View File

@ -18,7 +18,7 @@ aimePath=DEVICE\aime.txt
[aimeio] [aimeio]
; x64 aimeio dll path. ; x64 aimeio dll path.
; Uncomment this if you have custom aime implementation. ; Uncomment this if you have custom aime implementation.
;path64= ;path=
[dns] [dns]
; Insert the hostname or IP address of the server you wish to use here. ; Insert the hostname or IP address of the server you wish to use here.
@ -35,7 +35,7 @@ enable=1
; The /24 LAN subnet that the emulated keychip will tell the game to expect. ; The /24 LAN subnet that the emulated keychip will tell the game to expect.
; If you disable netenv then you must set this to your LAN's IP subnet, and ; If you disable netenv then you must set this to your LAN's IP subnet, and
; that subnet must start with 192.168. ; that subnet must start with 192.168.
subnet=192.168.100.0 subnet=192.168.139.0
[gpio] [gpio]
; ALLS DIP switches. ; ALLS DIP switches.