all repos — mgba @ 178017a9e0ae8ad56a1273b95bbe6e071cf7ee40

mGBA Game Boy Advance Emulator

GBA Memory: Make WRAM+IWRAM one allocation
Vicki Pfau vi@endrift.com
Fri, 29 Dec 2017 15:06:22 -0500
commit

178017a9e0ae8ad56a1273b95bbe6e071cf7ee40

parent

f5ef07bebb7cdc0df60c63cc739c44e95ec0650e

1 files changed, 3 insertions(+), 4 deletions(-)

jump to
M src/gba/memory.csrc/gba/memory.c

@@ -87,16 +87,15 @@ gba->memory.agbPrint = 0;

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); }