Skip to content

Commit 589ed19

Browse files
committed
gbapatcher: Add fix for *Top Gun: Combat Zones*
Fix by @Dartz150
1 parent c3ff1a7 commit 589ed19

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ You can help translate TWiLight Menu++ on the [Crowdin project](https://crowdin.
9696
- [ahezard](https://github.com/ahezard): NDMA code from nds-bootstrap
9797
- Another World & Yellow Wood Goblin: The original akMenu/Wood UI
9898
- [Arisotura](https://github.com/Arisotura): ROM list from melonDS, and BIOS dumper code from [dsibiosdumper](https://github.com/Arisotura/dsibiosdumper)
99+
- [Dartz150](https://github.com/Dartz150): Provided fix for *Top Gun: Combat Zones* GBA game
99100
- [devkitPro](https://github.com/devkitPro): Code used in nds-hb-menu, and the use of the bootloader, devkitARM, libnds, and libfat
100101
- [edo9300](https://github.com/edo9300): DS Phat check code
101102
- [Gericom](https://github.com/Gericom), TrolleyDave, and FAST6191: GBA SRAM-patching code, used in gbapatcher ([SRAM patching thread at GBAtemp](https://gbatemp.net/threads/reverse-engineering-gba-patching.60168/))

gbapatcher/arm9/source/main.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ u8 borderData[0x30000] = {0};
2727
std::string gbaBorder = "default.png";
2828

2929
u32 romSize = 0;
30+
bool savingAllowed = true;
3031

3132
u32 greenSwapPatch[8] = {
3233
0xE59F000C, // LDR R0, =0x4000002
@@ -461,6 +462,13 @@ void gptc_patchRom()
461462
//Fix white screen crash
462463
if (*(u16*)(0x08000000 + 0xBB9F8) == 0x8008)
463464
*(u16*)(0x08000000 + 0xBB9F8) = 0x46C0;
465+
} else if (gameCode == 0x45593241) {
466+
//Top Gun - Combat Zones (USA)
467+
//Fix softlock when attempting to save (original cartridge does not have a save chip)
468+
if (*(u16*)(0x08000000 + 0x88816) == 0x3501)
469+
*(u16*)(0x08000000 + 0x88816) = 0x3401;
470+
471+
savingAllowed = false;
464472
} else if (gameCode == 0x45415741 || gameCode == 0x4A415741) {
465473
//Wario Land 4/Advance (USA/Europe/Japan)
466474
//Fix white screen crash
@@ -630,7 +638,7 @@ int main(int argc, char **argv) {
630638
//iprintf("ROM patched\n");
631639
}
632640

633-
const save_type_t* saveType = save_findTag();
641+
const save_type_t* saveType = savingAllowed ? save_findTag() : NULL;
634642
//iprintf("Save tag found\n");
635643
if (saveType != NULL && saveType->patchFunc != NULL) {
636644
if (saveType->patchFunc(saveType) && *(u16*)(0x020000C0) == 0x5A45) {

0 commit comments

Comments
 (0)