GBA Memory: Make WRAM+IWRAM one allocation

This commit is contained in:
Vicki Pfau 2017-12-29 15:06:22 -05:00
parent f5ef07bebb
commit 178017a9e0
1 changed files with 3 additions and 4 deletions

View File

@ -87,16 +87,15 @@ void GBAMemoryInit(struct GBA* gba) {
memset(&gba->memory.agbPrintCtx, 0, sizeof(gba->memory.agbPrintCtx));
gba->memory.agbPrintBuffer = NULL;
gba->memory.iwram = anonymousMemoryMap(SIZE_WORKING_IRAM);
gba->memory.wram = anonymousMemoryMap(SIZE_WORKING_RAM);
gba->memory.wram = anonymousMemoryMap(SIZE_WORKING_RAM + SIZE_WORKING_IRAM);
gba->memory.iwram = &gba->memory.wram[SIZE_WORKING_RAM >> 2];
GBADMAInit(gba);
GBAVFameInit(&gba->memory.vfame);
}
void GBAMemoryDeinit(struct GBA* gba) {
mappedMemoryFree(gba->memory.wram, SIZE_WORKING_RAM);
mappedMemoryFree(gba->memory.iwram, SIZE_WORKING_IRAM);
mappedMemoryFree(gba->memory.wram, SIZE_WORKING_RAM + SIZE_WORKING_IRAM);
if (gba->memory.rom) {
mappedMemoryFree(gba->memory.rom, gba->memory.romSize);
}