non-working coin insert emulation

This commit is contained in:
Hay1tsme 2022-02-23 02:44:23 -05:00 committed by Hay1tsme
parent 1964fa766f
commit 25a532347b
6 changed files with 12 additions and 0 deletions

View File

@ -39,6 +39,7 @@ enable=1
; Input API selection for JVS input emulator. ; Input API selection for JVS input emulator.
test=0x2D test=0x2D
service=0x2E service=0x2E
coin=0x24
volup=0x26 volup=0x26
voldown=0x28 voldown=0x28

View File

@ -61,6 +61,10 @@ static HRESULT mercury_io4_poll(void *ctx, struct io4_state *state)
if (opbtn & MERCURY_IO_OPBTN_SERVICE) { if (opbtn & MERCURY_IO_OPBTN_SERVICE) {
state->buttons[0] |= IO4_BUTTON_SERVICE; state->buttons[0] |= IO4_BUTTON_SERVICE;
}
if (gamebtn & MERCURY_IO_OPBTN_COIN) {
state->chutes[0] |= 1 << 1; // FIXME: insert coins
} }
if (gamebtn & MERCURY_IO_GAMEBTN_VOL_UP) { if (gamebtn & MERCURY_IO_GAMEBTN_VOL_UP) {

View File

@ -29,6 +29,7 @@ void mercury_io_config_load(
cfg->vk_test = GetPrivateProfileIntW(L"io4", L"test", 0x2D, filename); cfg->vk_test = GetPrivateProfileIntW(L"io4", L"test", 0x2D, filename);
cfg->vk_service = GetPrivateProfileIntW(L"io4", L"service", 0x2E, filename); cfg->vk_service = GetPrivateProfileIntW(L"io4", L"service", 0x2E, filename);
cfg->vk_coin = GetPrivateProfileIntW(L"io4", L"coin", 0x24, filename);
cfg->vk_vol_up = GetPrivateProfileIntW(L"io4", L"volup", 0x26, filename); cfg->vk_vol_up = GetPrivateProfileIntW(L"io4", L"volup", 0x26, filename);
cfg->vk_vol_down = GetPrivateProfileIntW(L"io4", L"voldown", 0x28, filename); cfg->vk_vol_down = GetPrivateProfileIntW(L"io4", L"voldown", 0x28, filename);

View File

@ -8,6 +8,7 @@
struct mercury_io_config { struct mercury_io_config {
uint8_t vk_test; uint8_t vk_test;
uint8_t vk_service; uint8_t vk_service;
uint8_t vk_coin;
uint8_t vk_vol_up; uint8_t vk_vol_up;
uint8_t vk_vol_down; uint8_t vk_vol_down;
uint8_t vk_cell[240]; uint8_t vk_cell[240];

View File

@ -40,6 +40,10 @@ HRESULT mercury_io_poll(void)
mercury_opbtn |= MERCURY_IO_OPBTN_SERVICE; mercury_opbtn |= MERCURY_IO_OPBTN_SERVICE;
} }
if (GetAsyncKeyState(mercury_io_cfg.vk_coin)) {
mercury_opbtn |= MERCURY_IO_OPBTN_COIN;
}
if (GetAsyncKeyState(mercury_io_cfg.vk_vol_up)) { if (GetAsyncKeyState(mercury_io_cfg.vk_vol_up)) {
mercury_gamebtn |= MERCURY_IO_GAMEBTN_VOL_UP; mercury_gamebtn |= MERCURY_IO_GAMEBTN_VOL_UP;
} }

View File

@ -7,6 +7,7 @@
enum { enum {
MERCURY_IO_OPBTN_TEST = 0x01, MERCURY_IO_OPBTN_TEST = 0x01,
MERCURY_IO_OPBTN_SERVICE = 0x02, MERCURY_IO_OPBTN_SERVICE = 0x02,
MERCURY_IO_OPBTN_COIN = 0x04,
}; };
enum { enum {