Init the memory after everything is loaded

This commit is contained in:
Godzil 2021-04-09 23:09:55 +01:00
parent 8ab6b20815
commit b3c0a39d00
2 changed files with 10 additions and 3 deletions

View File

@ -55,4 +55,11 @@ ws_romHeaderStruct *ws_rom_getHeader(uint8_t *wsrom, uint32_t wsromSize);
uint32_t ws_rom_sramSize(uint8_t *wsrom, uint32_t wsromSize);
uint32_t ws_rom_eepromSize(uint8_t *wsrom, uint32_t wsromSize);
static inline uint8_t *ws_get_page_ptr(uint8_t *wsrom, uint32_t romSize, uint16_t page)
{
uint32_t temp = page << 16;
temp &= (romSize - 1);
return &wsrom[temp];
}
#endif

View File

@ -106,9 +106,6 @@ int ws_init(char *rompath)
return (0);
}
ws_memory_init(rom, romSize);
ws_patchRom();
ws_staticRam = (uint8_t *)load_file(ws_sram_path);
if (ws_staticRam == NULL)
{
@ -132,6 +129,9 @@ int ws_init(char *rompath)
return 0;
}
ws_memory_init(rom, romSize);
ws_patchRom();
ws_io_init();
ws_audio_init();
ws_gpu_init();