1
0
mirror of https://gitea.tendokyu.moe/Dniel97/segatools.git synced 2024-11-27 22:40:48 +01:00

swdc: minor improvements

This commit is contained in:
Dniel97 2024-09-30 23:17:37 +02:00
parent 259b763a13
commit 5f817c8a36
No known key found for this signature in database
GPG Key ID: 6180B3C768FB2E08
3 changed files with 17 additions and 13 deletions

View File

@ -30,7 +30,7 @@ void led15070_config_load(struct led15070_config *cfg, const wchar_t *filename)
GetPrivateProfileStringW(
L"led15070",
L"boardNumber",
L"15070-02",
L"15070-04",
tmpstr,
_countof(tmpstr),
filename);
@ -66,6 +66,14 @@ void swdc_dll_config_load(
filename);
}
void zinput_config_load(struct zinput_config *cfg, const wchar_t *filename)
{
assert(cfg != NULL);
assert(filename != NULL);
cfg->enable = GetPrivateProfileIntW(L"zinput", L"enable", 1, filename);
}
void swdc_hook_config_load(
struct swdc_hook_config *cfg,
const wchar_t *filename)
@ -79,14 +87,7 @@ void swdc_hook_config_load(
zinput_config_load(&cfg->zinput, filename);
dvd_config_load(&cfg->dvd, filename);
io4_config_load(&cfg->io4, filename);
vfd_config_load(&cfg->vfd, filename);
ffb_config_load(&cfg->ffb, filename);
led15070_config_load(&cfg->led15070, filename);
}
void zinput_config_load(struct zinput_config *cfg, const wchar_t *filename)
{
assert(cfg != NULL);
assert(filename != NULL);
cfg->enable = GetPrivateProfileIntW(L"zinput", L"enable", 1, filename);
vfd_config_load(&cfg->vfd, filename);
}

View File

@ -8,8 +8,8 @@
WITH
838-15416 Indicator BD LED Board
COM1: 838-15069 MOTOR DRIVE BD RS232/422 board
COM2: 837-15396 "Gen 3" Aime reader
COM3: 837-15070-04 IC BD LED controller board
COM2: 837-15070-04 IC BD LED controller board
COM3: 837-15396 "Gen 3" Aime reader
COM4: 200-6275 VFD GP1232A02A FUTABA board
*/
@ -98,6 +98,7 @@ static DWORD CALLBACK swdc_pre_startup(void)
goto fail;
}
/* Not working, different board -04 instead of -02? */
hr = led15070_hook_init(&swdc_hook_cfg.led15070, swdc_dll.led_init,
swdc_dll.led_set_fet_output, NULL, swdc_dll.led_gs_update, 2, 1);

View File

@ -177,6 +177,8 @@ static HRESULT swdc_io4_poll(void *ctx, struct io4_state *state) {
static HRESULT swdc_io4_write_gpio(uint8_t* payload, size_t len)
{
assert(swdc_dll.led_set_leds != NULL);
// Just fast fail if there aren't enough bytes in the payload
if (len < 3)
return S_OK;