chusan: fixed SP/CVT switching

This commit is contained in:
Dniel97 2023-12-19 13:45:06 +01:00
parent 8ebdf67d6e
commit 3bf223c04e
Signed by untrusted user: Dniel97
GPG Key ID: 6180B3C768FB2E08

View File

@ -100,7 +100,7 @@ static DWORD CALLBACK chusan_pre_startup(void)
}
bool *dipsw = &chusan_hook_cfg.platform.dipsw.dipsw[0];
bool *is_sp = dipsw + 2;
bool is_cvt = dipsw[2];
for (int i = 0; i < 3; i++) {
switch (i) {
@ -113,15 +113,15 @@ static DWORD CALLBACK chusan_pre_startup(void)
break;
case 2:
dprintf("DipSw: Cab Type: %s\n", is_sp ? "SP" : "CVT");
dprintf("DipSw: Cab Type: %s\n", is_cvt ? "CVT" : "SP");
break;
}
}
unsigned int first_port = is_sp ? 20 : 2;
unsigned int first_port = is_cvt ? 2 : 20;
if (is_sp) {
if (!is_cvt) {
hr = vfd_hook_init(2);
if (FAILED(hr)) {
@ -136,7 +136,7 @@ static DWORD CALLBACK chusan_pre_startup(void)
goto fail;
}
hr = sg_reader_hook_init(&chusan_hook_cfg.aime, 4, is_sp ? 3: 2, chusan_hook_mod);
hr = sg_reader_hook_init(&chusan_hook_cfg.aime, 4, is_cvt ? 2: 3, chusan_hook_mod);
if (FAILED(hr)) {
goto fail;