chusan, fgo, mu3: fixed LED 15093 board

This commit is contained in:
2023-12-03 21:34:38 +01:00
parent 793417e891
commit 3dd6054a1e
15 changed files with 80 additions and 68 deletions

View File

@ -14,20 +14,20 @@
// Check windows
#if _WIN32 || _WIN64
#if _WIN64
#define ENV64BIT
#else
#define ENV32BIT
#endif
#if _WIN64
#define ENV64BIT
#else
#define ENV32BIT
#endif
#endif
// Check GCC
#if __GNUC__
#if __x86_64__ || __ppc64__
#define ENV64BIT
#else
#define ENV32BIT
#endif
#if __x86_64__ || __ppc64__
#define ENV64BIT
#else
#define ENV32BIT
#endif
#endif
void chuni_dll_config_load(
@ -84,18 +84,7 @@ void led15093_config_load(struct led15093_config *cfg, const wchar_t *filename)
memset(cfg->boot_chip_number, ' ', sizeof(cfg->boot_chip_number));
cfg->enable = GetPrivateProfileIntW(L"led15093", L"enable", 1, filename);
cvt_port = GetPrivateProfileIntW(L"led15093", L"cvtPort", 0, filename);
if (!cvt_port) {
// SP mode: COM20, COM21
cfg->port_no[0] = 20;
cfg->port_no[1] = 21;
} else {
// CVT mode: COM2, COM3
cfg->port_no[0] = 2;
cfg->port_no[1] = 3;
}
cfg->port_no = 0;
cfg->high_baudrate = GetPrivateProfileIntW(L"led15093", L"highBaudrate", 0, filename);
cfg->fw_ver = GetPrivateProfileIntW(L"led15093", L"fwVer", 0x90, filename);
cfg->fw_sum = GetPrivateProfileIntW(L"led15093", L"fwSum", 0xadf7, filename);
@ -143,7 +132,6 @@ void led15093_config_load(struct led15093_config *cfg, const wchar_t *filename)
}
}
void chusan_hook_config_load(
struct chusan_hook_config *cfg,
const wchar_t *filename)

View File

@ -99,7 +99,33 @@ static DWORD CALLBACK chusan_pre_startup(void)
goto fail;
}
hr = led15093_hook_init(&chusan_hook_cfg.led15093, 20, 21);
bool *dipsw = &chusan_hook_cfg.platform.dipsw.dipsw[0];
if (dipsw[1] != dipsw[2]) {
dprintf("DipSw: DipSw2 and 3 must be set to the same value!\n");
goto fail;
}
for (int i = 0; i < 3; i++) {
switch (i) {
case 0:
dprintf("DipSw: NetInstall: %s\n", dipsw[0] ? "Server" : "Client");
break;
case 1:
dprintf("DipSw: Monitor Type: %dFPS\n", dipsw[1] ? 60 : 120);
break;
case 2:
dprintf("DipSw: Aime Reader: %s\n", dipsw[2] ? "CVT" : "SP");
break;
}
}
unsigned int first_port = dipsw[1] ? 2 : 20;
hr = led15093_hook_init(&chusan_hook_cfg.led15093, first_port, 2, 2, 1);
if (FAILED(hr)) {
goto fail;