Skip to content

Commit

Permalink
fix GBC BIOS overwriting palette in SGB mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Lana-chan committed Mar 13, 2023
1 parent 7269f5b commit 04f88d9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions arm9/source/gameboy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,10 +398,6 @@ void initGameboyMode() {
case 0: // GB
gbRegs.af.b.h = 0x01;
gbMode = GB;
if (romSlot0[0x143] == 0x80 || romSlot1[0x143] == 0xC0)
// Init the palette in case the bios overwrote it, since it
// assumed it was starting in GBC mode.
initGFXPalette(true);
break;
case 1: // GBC
gbRegs.af.b.h = 0x11;
Expand All @@ -416,6 +412,11 @@ void initGameboyMode() {
initSGB();
break;
}

if (gbMode == GB && (romSlot0[0x143] == 0x80 || romSlot1[0x143] == 0xC0))
// Init the palette in case the bios overwrote it, since it
// assumed it was starting in GBC mode.
initGFXPalette(true);
}

void checkLYC() {
Expand Down

0 comments on commit 04f88d9

Please sign in to comment.