forked from Hay1tsme/segatools
platform: fix dipsw settings not applying
This commit is contained in:
@ -82,13 +82,13 @@ HRESULT platform_hook_init(
|
|||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
hr = system_init(&cfg->system, &cfg->vfs);
|
hr = epay_hook_init(&cfg->epay);
|
||||||
|
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
hr = epay_hook_init(&cfg->epay);
|
hr = system_init(&cfg->system, &cfg->vfs);
|
||||||
|
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
return hr;
|
return hr;
|
||||||
|
@ -110,7 +110,8 @@ static void system_save_sysfile(const wchar_t *sys_file) {
|
|||||||
uint8_t system = 0;
|
uint8_t system = 0;
|
||||||
uint8_t freeplay = 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) {
|
if (h_sysfile == INVALID_HANDLE_VALUE) {
|
||||||
return;
|
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 + 0x2800, block, BLOCK_SIZE);
|
||||||
memcpy(system_info.data + 0x5800, 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);
|
WriteFile(h_sysfile, system_info.data, 0x6000, &sysfile_bytes_written, NULL);
|
||||||
CloseHandle(h_sysfile);
|
CloseHandle(h_sysfile);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user