platform: fix dipsw settings not applying

This commit is contained in:
2025-06-19 18:17:20 +02:00
parent 24e8bc87a3
commit dbfc62b5d4
2 changed files with 4 additions and 13 deletions

View File

@ -82,13 +82,13 @@ HRESULT platform_hook_init(
return hr;
}
hr = system_init(&cfg->system, &cfg->vfs);
hr = epay_hook_init(&cfg->epay);
if (FAILED(hr)) {
return hr;
}
hr = epay_hook_init(&cfg->epay);
hr = system_init(&cfg->system, &cfg->vfs);
if (FAILED(hr)) {
return hr;

View File

@ -110,7 +110,8 @@ static void system_save_sysfile(const wchar_t *sys_file) {
uint8_t system = 0;
uint8_t freeplay = 0;
HANDLE h_sysfile = CreateFileW(sys_file, GENERIC_READ | GENERIC_WRITE, 0, NULL, 0, 0, NULL);
// open the sysfile.dat for writing
HANDLE h_sysfile = CreateFileW(sys_file, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (h_sysfile == INVALID_HANDLE_VALUE) {
return;
@ -164,16 +165,6 @@ static void system_save_sysfile(const wchar_t *sys_file) {
memcpy(system_info.data + 0x2800, block, BLOCK_SIZE);
memcpy(system_info.data + 0x5800, block, BLOCK_SIZE);
// print the dip_switch_block in hex
/*
dprintf("System Block: ");
for (size_t i = 0; i < BLOCK_SIZE; i++)
{
dprintf("%02X ", ((uint8_t *)&system_info.dip_switch_block)[i]);
}
dprintf("\n");
*/
WriteFile(h_sysfile, system_info.data, 0x6000, &sysfile_bytes_written, NULL);
CloseHandle(h_sysfile);