diff --git a/gbapatcher/arm9/source/main.cpp b/gbapatcher/arm9/source/main.cpp index f37d463bd1..ae4cc967ed 100644 --- a/gbapatcher/arm9/source/main.cpp +++ b/gbapatcher/arm9/source/main.cpp @@ -47,6 +47,11 @@ static u32 prefetchPatch[6] = { 0x080000C0 }; +static const u32 classicNesPatch[2] = { + 0xE8BD0003, + 0xE281F00C +}; + static const u8 sDbzLoGUPatch1[0x24] = {0x0A, 0x1C, 0x40, 0x0B, 0xE0, 0x21, 0x09, 0x05, 0x41, 0x18, 0x07, 0x31, 0x00, 0x23, 0x08, 0x78, 0x10, 0x70, 0x01, 0x33, 0x01, 0x32, 0x01, 0x39, 0x07, 0x2B, 0xF8, 0xD9, 0x00, 0x20, 0x70, 0xBC, @@ -134,7 +139,7 @@ ITCM_CODE void gptc_patchWait() if (data8_last == 0x00 || data8_last == 0x03 || data8_last == 0x04 || *(u8*)(addr+7) == 0x04 || *(u8*)(addr+0xB) == 0x04 || data8_last == 0x08 || data8_last == 0x09 || data8_last == 0x47 || data8_last == 0x81 || data8_last == 0x85 - || data8_last == 0xE0 || data8_last == 0xE7 || *(u16*)(addr-2) == 0xFFFE) + || data8_last == 0xE0 || data8_last == 0xE7 || *(u16*)(addr+4) == 0x4017 || *(u16*)(addr-2) == 0xFFFE) { toncset((u16*)addr, 0, sizeof(u32)); } @@ -153,18 +158,324 @@ ITCM_CODE void gptc_patchWait() } } -void gptc_patchRom() +static int paddingLevel = 0; +static void fixRomPadding(void) { + if (paddingLevel != 1) { + return; + } + + // Pad unused ROM area with 0xFFs (trimmed ROMs). + // Smallest retail ROM chip is 8 Mbit (1 MiB). + s32 romSize = 1; + while (romSize < (s32)romFileSize) { + romSize += romSize; + } + if(romSize < 0x100000) romSize = 0x100000; + const uintptr_t romLoc = 0x08000000; + toncset((void*)(romLoc + romFileSize), 0xFF, romSize - romFileSize); + + u32 mirroredSize = romSize; + if(romSize == 0x100000) // 1 MiB. + { + // ROM mirroring for Classic NES Series/others with 8 Mbit ROM. + // The ROM is mirrored exactly 4 times. + // Thanks to endrift for discovering this. + mirroredSize = 0x400000; // 4 MiB. + uintptr_t mirrorLoc = romLoc + romSize; + do + { + tonccpy((void*)mirrorLoc, (void*)romLoc, romSize); + mirrorLoc += romSize; + } while(mirrorLoc < romLoc + mirroredSize); + } + + /* if (paddingLevel != 2) { + return; + } + + if (mirroredSize < 0x02000000) { + // Fake "open bus" padding. + u16 hword = 0; + for(uintptr_t i = romLoc + mirroredSize; i < 0x09FFFFCC; i += 2) + { + toncset16((u16*)i, hword, 1); + hword++; + } + } */ +} + +static void gptc_patchRom() { gptc_patchWait(); - u32 nop = 0xE1A00000; + const u32 nop = 0xE1A00000; + const u16 nopT = 0x46C0; - u32 gameCode = *(u32*)(0x080000AC); + const u32 gameCode = *(u32*)(0x080000AC); if (gameCode == 0x50584C42) { //Astreix & Obelix XXL (Europe) //Fix white screen crash if (*(u16*)(0x08000000 + 0x50118) == 0x4014) *(u16*)(0x08000000 + 0x50118) = 0x4000; + } else if (gameCode == 0x454D4246) { + //Classic NES Series: Bomberman (USA, Europe) + paddingLevel = 1; + //Fix white screen crash + tonccpy((u16*)(0x08000000 + 0xF4), classicNesPatch, 8); + + //Patch out SRAM check + //*(u8*)(0x08000000 + 0xB3D5) = 0; + } else if (gameCode == 0x45444146) { + //Classic NES Series: Castlevania (USA, Europe) + paddingLevel = 1; + //Fix white screen crash + tonccpy((u16*)(0x08000000 + 0xFC), classicNesPatch, 8); + + //Patch out SRAM check + //*(u8*)(0x08000000 + 0x1B5EF) = 0; + } else if (gameCode == 0x454B4446) { + //Classic NES Series: Donkey Kong (USA, Europe) + paddingLevel = 1; + //Fix white screen crash + tonccpy((u16*)(0x08000000 + 0xF4), classicNesPatch, 8); + + //Patch out SRAM check + //*(u8*)(0x08000000 + 0xCB5E) = 0; + } else if (gameCode == 0x454D4446) { + //Classic NES Series: Dr. Mario (USA, Europe) + paddingLevel = 1; + //Fix white screen crash + tonccpy((u16*)(0x08000000 + 0xFC), classicNesPatch, 8); + + //Patch out SRAM check + //*(u8*)(0x08000000 + 0x1D974) = 0; + } else if (gameCode == 0x45424546) { + //Classic NES Series: Excitebike (USA, Europe) + paddingLevel = 1; + //Fix white screen crash + tonccpy((u16*)(0x08000000 + 0xF4), classicNesPatch, 8); + + //Patch out SRAM check + //*(u8*)(0x08000000 + 0xADDD) = 0; + } else if (gameCode == 0x45434946) { + //Classic NES Series: Ice Climber (USA, Europe) + paddingLevel = 1; + //Fix white screen crash + tonccpy((u16*)(0x08000000 + 0xF4), classicNesPatch, 8); + + //Patch out SRAM check + //*(u8*)(0x08000000 + 0xCB3B) = 0; + } else if (gameCode == 0x454C5A46) { + //Classic NES Series: The Legend of Zelda (USA, Europe) + paddingLevel = 1; + //Fix white screen crash + tonccpy((u16*)(0x08000000 + 0xF4), classicNesPatch, 8); + + //Patch out SRAM check + //*(u8*)(0x08000000 + 0x19417) = 0; + } else if (gameCode == 0x45524D46 || gameCode == 0x45524D46) { + //Classic NES Series: Metroid (USA, Europe) + //Classic NES Series: Zelda II: The Adventure of Link (USA, Europe) + paddingLevel = 1; + //Fix white screen crash + tonccpy((u16*)(0x08000000 + 0xFC), classicNesPatch, 8); + + //Patch out SRAM check + //*(u8*)(0x08000000 + 0x20631) = 0; + } else if (gameCode == 0x45375046) { + //Classic NES Series: Pac-Man (USA, Europe) + paddingLevel = 1; + //Fix white screen crash + tonccpy((u16*)(0x08000000 + 0xF4), classicNesPatch, 8); + + //Patch out SRAM check + //*(u8*)(0x08000000 + 0xCEF7) = 0; + } else if (gameCode == 0x454D5346) { + //Classic NES Series: Super Mario Bros. (USA, Europe) + paddingLevel = 1; + //Fix white screen crash + tonccpy((u16*)(0x08000000 + 0xF4), classicNesPatch, 8); + + //Patch out SRAM check + //*(u8*)(0x08000000 + 0xCB53) = 0; + } else if (gameCode == 0x45565846) { + //Classic NES Series: Xevious (USA, Europe) + paddingLevel = 1; + //Fix white screen crash + tonccpy((u16*)(0x08000000 + 0xF4), classicNesPatch, 8); + + //Patch out SRAM check + //*(u8*)(0x08000000 + 0x14E02) = 0; + } else if (gameCode == 0x4A4D5346 || gameCode == 0x4A4B4446 || gameCode == 0x4A434946 || gameCode == 0x4A4D5046 || gameCode == 0x4A565846 || gameCode == 0x4A504D46 || gameCode == 0x4A444446 || gameCode == 0x4A575446) { + //Famicom Mini 01: Super Mario Bros. (Japan) + //Famicom Mini 02: Donkey Kong (Japan) + //Famicom Mini 03: Ice Climber (Japan) + //Famicom Mini 06: Pac-Man (Japan) + //Famicom Mini 07: Xevious (Japan) + //Famicom Mini 08: Mappy (Japan) + //Famicom Mini 16: Dig Dug (Japan) + //Famicom Mini 19: TwinBee (Japan) + paddingLevel = 1; + //Fix white screen crash + tonccpy((u16*)(0x08000000 + 0xF4), classicNesPatch, 8); + } else if (gameCode == 0x4A425A46 || gameCode == 0x4A4C5A46 || gameCode == 0x4A4D4246 || gameCode == 0x4A4F5346) { + //Famicom Mini 04: Excitebike (Japan) + //Famicom Mini 05: Zelda no Densetsu 1: The Hyrule Fantasy (Japan) + //Famicom Mini 09: Bomberman (Japan) + //Famicom Mini 10: Star Soldier (Japan) + paddingLevel = 1; + //Fix white screen crash + tonccpy((u16*)(0x08000000 + 0x100), classicNesPatch, 8); + } else if (gameCode == 0x4A424D46) { + //Famicom Mini 11: Mario Bros. (Japan) + paddingLevel = 1; + //Fix white screen crash + tonccpy((u16*)(0x08000000 + 0xF4), classicNesPatch, 8); + + //Patch out SRAM check + //*(u8*)(0x08000000 + 0xD1C5) = 0; + } else if (gameCode == 0x4A4C4346) { + //Famicom Mini 12: Clu Clu Land (Japan) + paddingLevel = 1; + //Fix white screen crash + tonccpy((u16*)(0x08000000 + 0xF4), classicNesPatch, 8); + + //Patch out SRAM check + //*(u8*)(0x08000000 + 0xD1BE) = 0; + } else if (gameCode == 0x4A464246) { + //Famicom Mini 13: Balloon Fight (Japan) + paddingLevel = 1; + //Fix white screen crash + tonccpy((u16*)(0x08000000 + 0xF4), classicNesPatch, 8); + + //Patch out SRAM check + //*(u8*)(0x08000000 + 0xD1EE) = 0; + } else if (gameCode == 0x4A574346) { + //Famicom Mini 14: Wrecking Crew (Japan) + paddingLevel = 1; + //Fix white screen crash + tonccpy((u16*)(0x08000000 + 0xF4), classicNesPatch, 8); + + //Patch out SRAM check + //*(u8*)(0x08000000 + 0xD6BA) = 0; + } else if (gameCode == 0x4A4D4446) { + //Famicom Mini 15: Dr. Mario (Japan) + paddingLevel = 1; + //Fix white screen crash + tonccpy((u16*)(0x08000000 + 0xF4), classicNesPatch, 8); + + //Patch out SRAM check + //*(u8*)(0x08000000 + 0x1DF1E) = 0; + } else if (gameCode == 0x4A425446) { + //Famicom Mini 17: Takahashi Meijin no Bouken-jima (Japan) + paddingLevel = 1; + //Fix white screen crash + tonccpy((u16*)(0x08000000 + 0xF4), classicNesPatch, 8); + + //Patch out SRAM check + //*(u8*)(0x08000000 + 0x233CC) = 0; + } else if (gameCode == 0x4A4B4D46) { + //Famicom Mini 18: Makaimura (Japan) + paddingLevel = 1; + //Fix white screen crash + tonccpy((u16*)(0x08000000 + 0xF4), classicNesPatch, 8); + + //Patch out SRAM check + //*(u8*)(0x08000000 + 0xD3E0) = 0; + } else if (gameCode == 0x4A474746) { + //Famicom Mini 20: Ganbare Goemon!: Karakuri Douchuu (Japan) + paddingLevel = 1; + //Fix white screen crash + tonccpy((u16*)(0x08000000 + 0xF4), classicNesPatch, 8); + + //Patch out SRAM check + //*(u8*)(0x08000000 + 0x5B38D) = 0; + } else if (gameCode == 0x45324D46 || gameCode == 0x4A445346) { + //Famicom Mini 21: Super Mario Bros. 2 (Japan) + //Famicom Mini 30: SD Gundam World: Gachapon Senshi Scramble Wars (Japan) + paddingLevel = 1; + //Fix white screen crash + tonccpy((u16*)(0x08000000 + 0xFC), classicNesPatch, 8); + } else if (gameCode == 0x4A4D4E46) { + //Famicom Mini 22: Nazo no Murasame Jou (Japan) + paddingLevel = 1; + //Fix white screen crash + tonccpy((u16*)(0x08000000 + 0xFC), classicNesPatch, 8); + + //Patch out SRAM check + //*(u8*)(0x08000000 + 0x18614) = 0; + } else if (gameCode == 0x4A524D46) { + //Famicom Mini 23: Metroid (Japan) + paddingLevel = 1; + //Fix white screen crash + tonccpy((u16*)(0x08000000 + 0xFC), classicNesPatch, 8); + + //Patch out SRAM check + //*(u8*)(0x08000000 + 0x1B305) = 0; + } else if (gameCode == 0x4A545046) { + //Famicom Mini 24: Hikari Shinwa: Palthena no Kagami (Japan) + paddingLevel = 1; + //Fix white screen crash + tonccpy((u16*)(0x08000000 + 0xFC), classicNesPatch, 8); + + //Patch out SRAM check + //*(u8*)(0x08000000 + 0x1B8EC) = 0; + } else if (gameCode == 0x4A424C46) { + //Famicom Mini 25: The Legend of Zelda 2: Link no Bouken (Japan) + paddingLevel = 1; + //Fix white screen crash + tonccpy((u16*)(0x08000000 + 0xFC), classicNesPatch, 8); + + //Patch out SRAM check + //*(u8*)(0x08000000 + 0x1F068) = 0; + } else if (gameCode == 0x4A4D4646) { + //Famicom Mini 26: Famicom Mukashibanashi: Shin Onigashima: Zen, Kouhen (Japan) + paddingLevel = 1; + //Fix white screen crash + tonccpy((u16*)(0x08000000 + 0xFC), classicNesPatch, 8); + + //Patch out SRAM check + //*(u8*)(0x08000000 + 0x31D8F) = 0; + } else if (gameCode == 0x4A4B5446) { + //Famicom Mini 27: Famicom Tantei Club: Kieta Koukeisha: Zen, Kouhen (Japan) + paddingLevel = 1; + //Fix white screen crash + tonccpy((u16*)(0x08000000 + 0xFC), classicNesPatch, 8); + + //Patch out SRAM check + //*(u8*)(0x08000000 + 0x2D80C) = 0; + } else if (gameCode == 0x4A555446) { + //Famicom Mini 28: Famicom Tantei Club Part II: Ushiro ni Tatsu Shoujo: Zen, Kouhen (Japan) + paddingLevel = 1; + //Fix white screen crash + tonccpy((u16*)(0x08000000 + 0xFC), classicNesPatch, 8); + + //Patch out SRAM check + //*(u8*)(0x08000000 + 0x2ED9C) = 0; + } else if (gameCode == 0x4A444146) { + //Famicom Mini 29: Akumajou Dracula (Japan) + paddingLevel = 1; + //Fix white screen crash + tonccpy((u16*)(0x08000000 + 0xFC), classicNesPatch, 8); + + //Patch out SRAM check + //*(u8*)(0x08000000 + 0x1C81C) = 0; + } else if (gameCode == 0x4A525346) { + //Famicom Mini: Dai-2-ji Super Robot Taisen (Japan) (Promo) + paddingLevel = 1; + //Fix white screen crash + tonccpy((u16*)(0x08000000 + 0xFC), classicNesPatch, 8); + + //Patch out SRAM check + //*(u8*)(0x08000000 + 0xC7F00) = 0; + } else if (gameCode == 0x4A5A4746) { + //Famicom Mini: Kidou Senshi Z Gundam: Hot Scramble (Japan) (Promo) + paddingLevel = 1; + //Fix white screen crash + tonccpy((u16*)(0x08000000 + 0xFC), classicNesPatch, 8); + + //Patch out SRAM check + //*(u8*)(0x08000000 + 0x27F1F) = 0; } else if (gameCode == 0x454D4441) { //Doom (USA) //Fix black screen crash @@ -174,12 +485,12 @@ void gptc_patchRom() //Doom II (USA/Europe) //Fix black screen crash if (*(u16*)(0x08000000 + 0x2856) == 0x5281) - *(u16*)(0x08000000 + 0x2856) = 0x46C0; + *(u16*)(0x08000000 + 0x2856) = nopT; } else if (gameCode == 0x45474C41) { //Dragon Ball Z - The Legacy of Goku (USA) //Fix white screen crash if (*(u16*)(0x08000000 + 0x96E8) == 0x80A8) - *(u16*)(0x08000000 + 0x96E8) = 0x46C0; + *(u16*)(0x08000000 + 0x96E8) = nopT; //Fix "game cannot be played on hardware found" error if (*(u16*)(0x08000000 + 0x356) == 0x7002) @@ -207,47 +518,47 @@ void gptc_patchRom() //Dragon Ball Z - The Legacy of Goku (Europe) //Fix white screen crash if (*(u16*)(0x08000000 + 0x9948) == 0x80B0) - *(u16*)(0x08000000 + 0x9948) = 0x46C0; + *(u16*)(0x08000000 + 0x9948) = nopT; //Fix "game cannot be played on hardware found" error if (*(u16*)(0x08000000 + 0x33C) == 0x7119) - *(u16*)(0x08000000 + 0x33C) = 0x46C0; + *(u16*)(0x08000000 + 0x33C) = nopT; if (*(u16*)(0x08000000 + 0x340) == 0x7159) - *(u16*)(0x08000000 + 0x340) = 0x46C0; + *(u16*)(0x08000000 + 0x340) = nopT; if (*(u16*)(0x08000000 + 0x356) == 0x705A) - *(u16*)(0x08000000 + 0x356) = 0x46C0; + *(u16*)(0x08000000 + 0x356) = nopT; if (*(u16*)(0x08000000 + 0x35A) == 0x7002) - *(u16*)(0x08000000 + 0x35A) = 0x46C0; + *(u16*)(0x08000000 + 0x35A) = nopT; if (*(u16*)(0x08000000 + 0x35E) == 0x7042) - *(u16*)(0x08000000 + 0x35E) = 0x46C0; + *(u16*)(0x08000000 + 0x35E) = nopT; if (*(u16*)(0x08000000 + 0x384) == 0x7001) - *(u16*)(0x08000000 + 0x384) = 0x46C0; + *(u16*)(0x08000000 + 0x384) = nopT; if (*(u16*)(0x08000000 + 0x388) == 0x7041) - *(u16*)(0x08000000 + 0x388) = 0x46C0; + *(u16*)(0x08000000 + 0x388) = nopT; if (*(u16*)(0x08000000 + 0x494C) == 0x7002) - *(u16*)(0x08000000 + 0x494C) = 0x46C0; + *(u16*)(0x08000000 + 0x494C) = nopT; if (*(u16*)(0x08000000 + 0x4950) == 0x7042) - *(u16*)(0x08000000 + 0x4950) = 0x46C0; + *(u16*)(0x08000000 + 0x4950) = nopT; if (*(u16*)(0x08000000 + 0x4978) == 0x7001) - *(u16*)(0x08000000 + 0x4978) = 0x46C0; + *(u16*)(0x08000000 + 0x4978) = nopT; if (*(u16*)(0x08000000 + 0x497C) == 0x7041) - *(u16*)(0x08000000 + 0x497C) = 0x46C0; + *(u16*)(0x08000000 + 0x497C) = nopT; if (*(u16*)(0x08000000 + 0x988E) == 0x7028) - *(u16*)(0x08000000 + 0x988E) = 0x46C0; + *(u16*)(0x08000000 + 0x988E) = nopT; if (*(u16*)(0x08000000 + 0x9992) == 0x7068) - *(u16*)(0x08000000 + 0x9992) = 0x46C0; + *(u16*)(0x08000000 + 0x9992) = nopT; } else if (gameCode == 0x45464C41) { //Dragon Ball Z - The Legacy of Goku II (USA) tonccpy((u16*)0x080000E0, &nop, sizeof(u32)); // Fix white screen crash @@ -283,7 +594,7 @@ void gptc_patchRom() tonccpy((u16*)0x080000E0, &nop, sizeof(u32)); // Fix white screen crash if (*(u16*)(0x08000000 + 0x49840) == 0x80A8) - *(u16*)(0x08000000 + 0x49840) = 0x46C0; + *(u16*)(0x08000000 + 0x49840) = nopT; tonccpy((u16*)0x088000E0, &nop, sizeof(u32)); @@ -416,47 +727,47 @@ void gptc_patchRom() //Dragon Ball - Advanced Adventure (USA) //Fix white screen crash if (*(u16*)(0x08000000 + 0x10C240) == 0x8008) - *(u16*)(0x08000000 + 0x10C240) = 0x46C0; + *(u16*)(0x08000000 + 0x10C240) = nopT; } else if (gameCode == 0x50564442) { //Dragon Ball - Advanced Adventure (Europe) //Fix white screen crash if (*(u16*)(0x08000000 + 0x10CE3C) == 0x8008) - *(u16*)(0x08000000 + 0x10CE3C) = 0x46C0; + *(u16*)(0x08000000 + 0x10CE3C) = nopT; } else if (gameCode == 0x4A564442) { //Dragon Ball - Advanced Adventure (Japan) //Fix white screen crash if (*(u16*)(0x08000000 + 0x10B078) == 0x8008) - *(u16*)(0x08000000 + 0x10B078) = 0x46C0; + *(u16*)(0x08000000 + 0x10B078) = nopT; } else if (gameCode == 0x454B3842) { //Kirby and the Amazing Mirror (USA) //Fix white screen crash if (*(u16*)(0x08000000 + 0x1515A4) == 0x8008) - *(u16*)(0x08000000 + 0x1515A4) = 0x46C0; + *(u16*)(0x08000000 + 0x1515A4) = nopT; } else if (gameCode == 0x504B3842) { //Kirby and the Amazing Mirror (Europe) //Fix white screen crash if (*(u16*)(0x08000000 + 0x151EE0) == 0x8008) - *(u16*)(0x08000000 + 0x151EE0) = 0x46C0; + *(u16*)(0x08000000 + 0x151EE0) = nopT; } else if (gameCode == 0x4A4B3842) { //Hoshi no Kirby - Kagami no Daimeikyuu (Japan) (V1.1) //Fix white screen crash if (*(u16*)(0x08000000 + 0x151564) == 0x8008) - *(u16*)(0x08000000 + 0x151564) = 0x46C0; + *(u16*)(0x08000000 + 0x151564) = nopT; } else if (gameCode == 0x45533342) { //Sonic Advance 3 (USA) //Fix white screen crash if (*(u16*)(0x08000000 + 0xBB67C) == 0x8008) - *(u16*)(0x08000000 + 0xBB67C) = 0x46C0; + *(u16*)(0x08000000 + 0xBB67C) = nopT; } else if (gameCode == 0x50533342) { //Sonic Advance 3 (Europe) //Fix white screen crash if (*(u16*)(0x08000000 + 0xBBA04) == 0x8008) - *(u16*)(0x08000000 + 0xBBA04) = 0x46C0; + *(u16*)(0x08000000 + 0xBBA04) = nopT; } else if (gameCode == 0x4A533342) { //Sonic Advance 3 (Japan) //Fix white screen crash if (*(u16*)(0x08000000 + 0xBB9F8) == 0x8008) - *(u16*)(0x08000000 + 0xBB9F8) = 0x46C0; + *(u16*)(0x08000000 + 0xBB9F8) = nopT; } else if (gameCode == 0x45593241) { //Top Gun - Combat Zones (USA) //Fix softlock when attempting to save (original cartridge does not have a save chip) @@ -468,12 +779,12 @@ void gptc_patchRom() //Wario Land 4/Advance (USA/Europe/Japan) //Fix white screen crash if (*(u16*)(0x08000000 + 0x726) == 0x8008) - *(u16*)(0x08000000 + 0x726) = 0x46C0; + *(u16*)(0x08000000 + 0x726) = nopT; } else if (gameCode == 0x43415741) { //Wario Land Advance (iQue) //Fix white screen crash if (*(u16*)(0x08000000 + 0xE92) == 0x8008) - *(u16*)(0x08000000 + 0xE92) = 0x46C0; + *(u16*)(0x08000000 + 0xE92) = nopT; } else if (gameCode == 0x45575A52) { //WarioWare: Twisted! (USA) //Patch out tilt controls @@ -490,7 +801,7 @@ void gptc_patchRom() //Yoshi Topsy-Turvy (USA) //Fix white screen crash if (*(u16*)(0x08000000 + 0x16E4) == 0x8008) - *(u16*)(0x08000000 + 0x16E4) = 0x46C0; + *(u16*)(0x08000000 + 0x16E4) = nopT; //Patch out tilt controls if (*(u16*)(0x08000000 + 0x1F2) == 0x0802 && *(u16*)(0x08000000 + 0x1F0) == 0x5169) { @@ -515,6 +826,8 @@ void gptc_patchRom() if (*(u16*)(0x08000000 + 0x1A16) == 0x0D81) *(u16*)(0x08000000 + 0x1A16) = 0x087B; } + + fixRomPadding(); }