From 0affc96e3e2c043c01a094be7a1e04d65d25a964 Mon Sep 17 00:00:00 2001 From: Dniel97 Date: Tue, 16 Jan 2024 17:54:06 +0100 Subject: [PATCH] small optimizations --- board/config.c | 2 +- chunihook/config.c | 2 +- chusanhook/config.c | 2 +- dist/chusan/segatools.ini | 6 +++++- dist/fgo/segatools.ini | 1 - doc/config/common.md | 2 +- fgohook/config.c | 2 +- fgohook/fgo-dll.h | 2 +- fgoio/fgoio.c | 1 - idachook/idac-dll.c | 3 --- idachook/idac-dll.h | 1 - idachook/io4.c | 8 -------- idacio/idacio.def | 1 - idacio/idacio.h | 9 +-------- 14 files changed, 12 insertions(+), 30 deletions(-) diff --git a/board/config.c b/board/config.c index bbbf074..9fefd4c 100644 --- a/board/config.c +++ b/board/config.c @@ -71,7 +71,7 @@ void aime_config_load(struct aime_config *cfg, const wchar_t *filename) aime_dll_config_load(&cfg->dll, filename); cfg->enable = GetPrivateProfileIntW(L"aime", L"enable", 1, filename); - cfg->high_baudrate = GetPrivateProfileIntW(L"aime", L"highbaud", 1, filename); + cfg->high_baudrate = GetPrivateProfileIntW(L"aime", L"highBaud", 1, filename); cfg->gen = GetPrivateProfileIntW(L"aime", L"gen", 0, filename); } diff --git a/chunihook/config.c b/chunihook/config.c index 99b9c3a..dd1497d 100644 --- a/chunihook/config.c +++ b/chunihook/config.c @@ -56,7 +56,7 @@ void led15093_config_load(struct led15093_config *cfg, const wchar_t *filename) cfg->enable = GetPrivateProfileIntW(L"led15093", L"enable", 1, filename); cfg->port_no = 0; - cfg->high_baudrate = GetPrivateProfileIntW(L"led15093", L"highBaudrate", 0, filename); + cfg->high_baudrate = GetPrivateProfileIntW(L"led15093", L"highBaud", 0, filename); cfg->fw_ver = GetPrivateProfileIntW(L"led15093", L"fwVer", 0x90, filename); cfg->fw_sum = GetPrivateProfileIntW(L"led15093", L"fwSum", 0xadf7, filename); diff --git a/chusanhook/config.c b/chusanhook/config.c index d71ad71..3796f69 100644 --- a/chusanhook/config.c +++ b/chusanhook/config.c @@ -96,7 +96,7 @@ void led15093_config_load(struct led15093_config *cfg, const wchar_t *filename) cfg->enable = GetPrivateProfileIntW(L"led15093", L"enable", 1, filename); cfg->port_no = 0; - cfg->high_baudrate = GetPrivateProfileIntW(L"led15093", L"highBaudrate", 0, filename); + cfg->high_baudrate = GetPrivateProfileIntW(L"led15093", L"highBaud", 0, filename); cfg->fw_ver = GetPrivateProfileIntW(L"led15093", L"fwVer", 0x90, filename); cfg->fw_sum = GetPrivateProfileIntW(L"led15093", L"fwSum", 0xadf7, filename); diff --git a/dist/chusan/segatools.ini b/dist/chusan/segatools.ini index 3531bdf..926a6fe 100644 --- a/dist/chusan/segatools.ini +++ b/dist/chusan/segatools.ini @@ -13,7 +13,7 @@ appdata= enable=1 aimePath=DEVICE\aime.txt ; Enable high baud rate. -;highbaud=1 +;highBaud=1 [aimeio] ; Uncomment this if you have custom (x64) aime implementation. @@ -30,6 +30,10 @@ default=127.0.0.1 ; Chunithm is extremely picky about its LAN environment, so leaving this ; setting enabled is strongly recommended. enable=1 +; The final octet of the local host's IP address on the virtualized subnet (so, +; if the keychip subnet is `192.168.32.0` and this value is set to `11`, then the +; local host's virtualized LAN IP is `192.168.32.11`). +addrSuffix=11 [keychip] ; The /24 LAN subnet that the emulated keychip will tell the game to expect. diff --git a/dist/fgo/segatools.ini b/dist/fgo/segatools.ini index d106aaf..08218a2 100644 --- a/dist/fgo/segatools.ini +++ b/dist/fgo/segatools.ini @@ -23,7 +23,6 @@ default=127.0.0.1 ; SEGA games are somewhat picky about their LAN environment, so leaving this ; setting enabled is recommended. enable=1 - ; The final octet of the local host's IP address on the virtualized subnet (so, ; if the keychip subnet is `192.168.32.0` and this value is set to `11`, then the ; local host's virtualized LAN IP is `192.168.32.11`). diff --git a/doc/config/common.md b/doc/config/common.md index fb82131..56283b5 100644 --- a/doc/config/common.md +++ b/doc/config/common.md @@ -31,7 +31,7 @@ Default: `1` Enable Aime card reader assembly emulation. Disable to use a real SEGA Aime reader (COM port number varies by game). -### `highbaud` +### `highBaud` Default: `1` diff --git a/fgohook/config.c b/fgohook/config.c index 4b05e97..24b5825 100644 --- a/fgohook/config.c +++ b/fgohook/config.c @@ -48,7 +48,7 @@ void led15093_config_load(struct led15093_config *cfg, const wchar_t *filename) cfg->enable = GetPrivateProfileIntW(L"led15093", L"enable", 1, filename); cfg->port_no = GetPrivateProfileIntW(L"led15093", L"portNo", 0, filename); - cfg->high_baudrate = GetPrivateProfileIntW(L"led15093", L"highBaudrate", 0, filename); + cfg->high_baudrate = GetPrivateProfileIntW(L"led15093", L"highBaud", 0, filename); cfg->fw_ver = GetPrivateProfileIntW(L"led15093", L"fwVer", 0xA0, filename); cfg->fw_sum = GetPrivateProfileIntW(L"led15093", L"fwSum", 0xAA53, filename); diff --git a/fgohook/fgo-dll.h b/fgohook/fgo-dll.h index 22bf02d..b7e4f3d 100644 --- a/fgohook/fgo-dll.h +++ b/fgohook/fgo-dll.h @@ -11,7 +11,7 @@ struct fgo_dll { void (*get_opbtns)(uint8_t *opbtn); void (*get_gamebtns)(uint8_t *gamebtn); void (*get_analogs)(int16_t *stick_x, int16_t *stick_y); - HRESULT (*led_init)(); + HRESULT (*led_init)(void); void (*led_set_leds)(uint8_t board, uint8_t *rgb); }; diff --git a/fgoio/fgoio.c b/fgoio/fgoio.c index 95c86d9..d9aeed1 100644 --- a/fgoio/fgoio.c +++ b/fgoio/fgoio.c @@ -142,7 +142,6 @@ void fgo_io_get_analogs(int16_t *stick_x, int16_t *stick_y) HRESULT fgo_io_led_init(void) { - // return 0; return S_OK; } diff --git a/idachook/idac-dll.c b/idachook/idac-dll.c index 03a6a3e..b463a6d 100644 --- a/idachook/idac-dll.c +++ b/idachook/idac-dll.c @@ -12,9 +12,6 @@ const struct dll_bind_sym idac_dll_syms[] = { { .sym = "idac_io_init", .off = offsetof(struct idac_dll, init), - }, { - .sym = "idac_io_poll", - .off = offsetof(struct idac_dll, poll), }, { .sym = "idac_io_get_opbtns", .off = offsetof(struct idac_dll, get_opbtns), diff --git a/idachook/idac-dll.h b/idachook/idac-dll.h index 7db5639..cc4a492 100644 --- a/idachook/idac-dll.h +++ b/idachook/idac-dll.h @@ -7,7 +7,6 @@ struct idac_dll { uint16_t api_version; HRESULT (*init)(void); - HRESULT (*poll)(void); void (*get_opbtns)(uint8_t *opbtn); void (*get_gamebtns)(uint8_t *gamebtn); void (*get_shifter)(uint8_t *gear); diff --git a/idachook/io4.c b/idachook/io4.c index 3d2eec5..b5e13be 100644 --- a/idachook/io4.c +++ b/idachook/io4.c @@ -57,7 +57,6 @@ static HRESULT idac_io4_poll(void *ctx, struct io4_state *state) struct idac_io_analog_state analog_state; HRESULT hr; - assert(idac_dll.poll != NULL); assert(idac_dll.get_opbtns != NULL); assert(idac_dll.get_gamebtns != NULL); assert(idac_dll.get_analogs != NULL); @@ -65,13 +64,6 @@ static HRESULT idac_io4_poll(void *ctx, struct io4_state *state) memset(state, 0, sizeof(*state)); memset(&analog_state, 0, sizeof(analog_state)); - - hr = idac_dll.poll(); - - if (FAILED(hr)) { - return hr; - } - opbtn = 0; gamebtn = 0; gear = 0; diff --git a/idacio/idacio.def b/idacio/idacio.def index 18839b2..e888510 100644 --- a/idacio/idacio.def +++ b/idacio/idacio.def @@ -2,7 +2,6 @@ LIBRARY idacio EXPORTS idac_io_init - idac_io_poll idac_io_get_opbtns idac_io_get_gamebtns idac_io_get_shifter diff --git a/idacio/idacio.h b/idacio/idacio.h index c0e743e..04c1b10 100644 --- a/idacio/idacio.h +++ b/idacio/idacio.h @@ -56,13 +56,6 @@ uint16_t idac_io_get_api_version(void); HRESULT idac_io_init(void); -/* Send any queued outputs (of which there are currently none, though this may - change in subsequent API versions) and retrieve any new inputs. - - Minimum API version: 0x0100 */ - -HRESULT idac_io_poll(void); - /* Get the state of the cabinet's operator buttons as of the last poll. See IDAC_IO_OPBTN enum above: this contains bit mask definitions for button states returned in *opbtn. All buttons are active-high. @@ -93,7 +86,7 @@ void idac_io_get_analogs(struct idac_io_analog_state *out); /* Poll the current position of the six-speed shifter and return it via the gear out parameter. Valid values are 0 for neutral and 1-6 for gears 1-6. - idzhook internally translates this gear position value into the correct + idachook internally translates this gear position value into the correct combination of Gear Left, Gear Right, Gear Up, Gear Down buttons that the game will then interpret as the current position of the gear lever.