From 85285a68e51d3d8b4030c8a45db8f4787beaec93 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Sat, 24 Dec 2016 21:22:29 -0800 Subject: [PATCH] GB Memory: Reset ROM bank when loading a ROM --- CHANGES | 1 + src/gb/gb.c | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index 08bf2cd0d..1aad47280 100644 --- a/CHANGES +++ b/CHANGES @@ -66,6 +66,7 @@ Misc: - GB Audio: Improve initial envelope samples - GB Audio: Initialize wave RAM to GBC values - Debugger: Add functions for read- or write-only watchpoints + - GB Memory: Reset ROM bank when loading a ROM 0.5.1: (2016-10-05) Bugfixes: diff --git a/src/gb/gb.c b/src/gb/gb.c index 92cd79ec2..1df6c4891 100644 --- a/src/gb/gb.c +++ b/src/gb/gb.c @@ -108,6 +108,7 @@ bool GBLoadROM(struct GB* gb, struct VFile* vf) { gb->memory.romBase = gb->memory.rom; gb->memory.romSize = gb->pristineRomSize; gb->romCrc32 = doCrc32(gb->memory.rom, gb->memory.romSize); + GBMBCSwitchBank(&gb->memory, gb->memory.currentBank); if (gb->cpu) { struct LR35902Core* cpu = gb->cpu;