all repos — mgba @ 4b43a88ebd9deba76421e7741a2abe808a2fa897

mGBA Game Boy Advance Emulator

GB: Fix some memory errors in reset
Jeffrey Pfau jeffrey@endrift.com
Fri, 29 Apr 2016 02:21:15 -0700
commit

4b43a88ebd9deba76421e7741a2abe808a2fa897

parent

af96ee70879f65255c11e1cc28a88f2afd23894c

2 files changed, 2 insertions(+), 1 deletions(-)

jump to
M src/gb/gb.csrc/gb/gb.c

@@ -195,6 +195,7 @@ cpu->b = 0;

cpu->d = 0; cpu->sp = 0xFFFE; cpu->pc = 0x100; + cpu->memory.setActiveRegion(cpu, cpu->pc); if (gb->yankedRomSize) { gb->memory.romSize = gb->yankedRomSize;
M src/gb/memory.csrc/gb/memory.c

@@ -134,6 +134,7 @@ gb->memory.rtcLatched = 0;

memset(&gb->memory.rtcRegs, 0, sizeof(gb->memory.rtcRegs)); memset(&gb->memory.hram, 0, sizeof(gb->memory.hram)); + memset(&gb->memory.mbcState, 0, sizeof(gb->memory.mbcState)); const struct GBCartridge* cart = (const struct GBCartridge*) &gb->memory.rom[0x100]; switch (cart->type) {

@@ -183,7 +184,6 @@ break;

case 0x22: gb->memory.mbc = _GBMBC7; gb->memory.mbcType = GB_MBC7; - memset(&gb->memory.mbcState.mbc7, 0, sizeof(gb->memory.mbcState.mbc7)); break; }