From 3bf223c04eb901725333d60408bfcc8343ec8ebe Mon Sep 17 00:00:00 2001 From: Dniel97 Date: Tue, 19 Dec 2023 13:45:06 +0100 Subject: [PATCH] chusan: fixed SP/CVT switching --- chusanhook/dllmain.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/chusanhook/dllmain.c b/chusanhook/dllmain.c index ee8bc77..1e3ee2c 100644 --- a/chusanhook/dllmain.c +++ b/chusanhook/dllmain.c @@ -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;