From d6c82a578ee1b741fcb92a2dabe96503b81466c6 Mon Sep 17 00:00:00 2001 From: squall-leonhart Date: Thu, 25 Sep 2008 21:20:37 +0000 Subject: [PATCH] applied GB Clear Vram, MBC 1 Mapper and Sound Volume fix for beetlejuice patches provided by Chrono git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@747 a31d4220-a93d-0410-bf67-fe4944624d44 --- src/dmg/GB.cpp | 6 +++++- src/dmg/gbMemory.cpp | 11 ++++++++--- src/dmg/gbSound.cpp | 6 ++++++ 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/dmg/GB.cpp b/src/dmg/GB.cpp index 58ff3664..8e6b0ec1 100644 --- a/src/dmg/GB.cpp +++ b/src/dmg/GB.cpp @@ -2218,7 +2218,11 @@ void gbReset() gbMemory[temp] = 0xff; } - + // GB bios set this memory area to 0 + // Fixes Pitman (J) title screen + if (gbHardware & 0x1) { + memset(&gbMemory[0x8000], 0x0, 0x2000); + } // clean LineBuffer if (gbLineBuffer != NULL) diff --git a/src/dmg/gbMemory.cpp b/src/dmg/gbMemory.cpp index afc89232..85774086 100644 --- a/src/dmg/gbMemory.cpp +++ b/src/dmg/gbMemory.cpp @@ -252,9 +252,14 @@ void memoryUpdateMapMBC1() gbMemoryMap[0x07] = &gbRom[tmpAddress + 0x3000]; } - if((gbRamSize) && (gbDataMBC1.mapperMemoryModel == 1)){ - gbMemoryMap[0x0a] = &gbRam[gbDataMBC1.mapperRAMAddress]; - gbMemoryMap[0x0b] = &gbRam[gbDataMBC1.mapperRAMAddress + 0x1000]; + if(gbRamSize) { + if(gbDataMBC1.mapperMemoryModel == 1) { + gbMemoryMap[0x0a] = &gbRam[gbDataMBC1.mapperRAMAddress]; + gbMemoryMap[0x0b] = &gbRam[gbDataMBC1.mapperRAMAddress + 0x1000]; + } else { + gbMemoryMap[0x0a] = &gbRam[0]; + gbMemoryMap[0x0b] = &gbRam[0x1000]; + } } } diff --git a/src/dmg/gbSound.cpp b/src/dmg/gbSound.cpp index 481afd81..bb00506f 100644 --- a/src/dmg/gbSound.cpp +++ b/src/dmg/gbSound.cpp @@ -237,6 +237,12 @@ void gbSoundReset() else gbSoundEvent(0xff26, 0xf1); + /* workaround for game Beetlejuice */ + if (gbHardware & 0x1) { + gbSoundEvent(0xff24, 0x77); + gbSoundEvent(0xff25, 0xf3); + } + int addr = 0xff30; while(addr < 0xff40) {