From 0f833a9d876b095d28592227db10261ad784c8ca Mon Sep 17 00:00:00 2001 From: "Carl.Kenner" Date: Fri, 13 Mar 2009 08:55:53 +0000 Subject: [PATCH] Fix for issue 57. http://code.google.com/p/vba-wii/issues/detail?id=57 --- source/ngc/gameinput.h | 2 ++ source/vba/gba/GBAinline.h | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/source/ngc/gameinput.h b/source/ngc/gameinput.h index 2e6a68b..4d1f60e 100644 --- a/source/ngc/gameinput.h +++ b/source/ngc/gameinput.h @@ -80,6 +80,8 @@ #define MKDA gid('A','X','D') #define MKTE gid('A','W','4') +#define CORVETTE gid('A','V','C') + u8 gbReadMemory(register u16 address); void gbWriteMemory(register u16 address, register u8 value); diff --git a/source/vba/gba/GBAinline.h b/source/vba/gba/GBAinline.h index 2e6b9fd..7523c56 100644 --- a/source/vba/gba/GBAinline.h +++ b/source/vba/gba/GBAinline.h @@ -33,6 +33,10 @@ extern bool timer3On; extern int timer3Ticks; extern int timer3ClockReload; extern int cpuTotalTicks; +extern u32 RomIdCode; + +#define gid(a,b,c) (a|(b<<8)|(c<<16)) +#define CORVETTE gid('A','V','C') /***************************************************************************** * Nintendo GC Virtual Memory function override @@ -560,6 +564,7 @@ static inline void CPUWriteMemory(u32 address, u32 value) value); else #endif + if(address < 0x5000400 || (RomIdCode & 0xFFFFFF) != CORVETTE) WRITE32LE(((u32 *)&paletteRAM[address & 0x3FC]), value); break; case 0x06: @@ -656,6 +661,7 @@ static inline void CPUWriteHalfWord(u32 address, u16 value) value); else #endif + if(address < 0x5000400 || (RomIdCode & 0xFFFFFF) != CORVETTE) WRITE16LE(((u16 *)&paletteRAM[address & 0x3fe]), value); break; case 6: