diff --git a/chusanhook/dllmain.c b/chusanhook/dllmain.c index 6e3308f..6ba4cd4 100644 --- a/chusanhook/dllmain.c +++ b/chusanhook/dllmain.c @@ -26,19 +26,24 @@ #include #include -#include "amex/amex.h" #include "board/sg-reader.h" #include "board/vfd.h" + #include "chuniio/chuniio.h" #include "chusanhook/config.h" #include "chusanhook/io4.h" #include "chusanhook/slider.h" + #include "gfxhook/d3d9.h" #include "gfxhook/gfx.h" + #include "hook/process.h" + #include "hooklib/serial.h" #include "hooklib/spike.h" + #include "platform/platform.h" + #include "util/dprintf.h" #include "util/env.h" @@ -96,8 +101,11 @@ static DWORD CALLBACK chusan_pre_startup(void) { memcpy(chusan_hook_cfg.platform.system.dipsw_config, new_dipsw_config, sizeof(new_dipsw_config)); - hr = platform_hook_init(&chusan_hook_cfg.platform, "SDHD", "ACA2", - chusan_hook_mod); + hr = platform_hook_init( + &chusan_hook_cfg.platform, + "SDHD", + "ACA2", + chusan_hook_mod); if (FAILED(hr)) { goto fail; diff --git a/idachook/dllmain.c b/idachook/dllmain.c index a7b3c86..448ea5b 100644 --- a/idachook/dllmain.c +++ b/idachook/dllmain.c @@ -82,13 +82,21 @@ static DWORD CALLBACK idac_pre_startup(void) goto fail; } + bool *dipsw = &idac_hook_cfg.platform.system.dipsw[0]; + bool is_swdc_cvt = dipsw[1]; + + if (!dipsw[2]) { + // the next two bit are the seat number most significant bit first + dprintf("System: Seat Number: %d\n", ((dipsw[4] << 1) | dipsw[3]) + 1); + } + hr = idac_dll_init(&idac_hook_cfg.dll, idac_hook_mod); if (FAILED(hr)) { goto fail; } - hr = sg_reader_hook_init(&idac_hook_cfg.aime, 3, 3, idac_hook_mod); + hr = sg_reader_hook_init(&idac_hook_cfg.aime, 3, is_swdc_cvt ? 3 : 2, idac_hook_mod); if (FAILED(hr)) { goto fail; diff --git a/tokyohook/dllmain.c b/tokyohook/dllmain.c index 5f46615..9c3a262 100644 --- a/tokyohook/dllmain.c +++ b/tokyohook/dllmain.c @@ -70,6 +70,26 @@ static DWORD CALLBACK tokyo_pre_startup(void) goto fail; } + bool *dipsw = &tokyo_hook_cfg.platform.system.dipsw[0]; + unsigned int cabinet_id = 0; + + if (dipsw[0] == 1 && dipsw[1] == 0 && dipsw[2] == 0) { + cabinet_id = 1; // Server 1 + } else if (dipsw[0] == 0 && dipsw[1] == 1 && dipsw[2] == 0) { + cabinet_id = 2; // Client 2 + } else if (dipsw[0] == 0 && dipsw[1] == 0 && dipsw[2] == 1) { + cabinet_id = 3; // Client 3 + } else if (dipsw[0] == 0 && dipsw[1] == 1 && dipsw[2] == 1) { + cabinet_id = 4; // Client 4 + } else { + dprintf("Error: Invalid dip switch configuration!\n"); + } + + // Print the correct Cabinet ID if valid + if (cabinet_id > 0) { + dprintf("System: Cabinet ID %d\n", cabinet_id); + } + hr = tokyo_dll_init(&tokyo_hook_cfg.dll, tokyo_hook_mod); if (FAILED(hr)) {