NOTE: This is a lengthy read. If you don't want to know the full specifics, scroll down to
In short.
For the longest time since nds-bootstrap's first release supporting retail/commercial games, one of those games has never worked, despite the many compatibility fixes implemented throughout each later release.
That game is
Golden Sun: Dark Dawn. When trying to boot it, it would only show two black screens.
The reason for that, is due to an AP measure in the game itself, and the AP-fix included with
TWi
Light Menu++ has unfortunately never patched it out, despite it being known to work with flashcards.
You might be wondering, but then how does the demo version boot sucessfully? It simply didn't include any AP measures.
After a long wait, and gaining a little bit of ARM ASM knowledge from playing around with it and getting DSiWare games working on DS/DS Lite, I've decided to implement a new AP-fix for
Golden Sun: Dark Dawn, with some help from Gericom (the GBARunner2/3 developer) and the NO$GBA debugging emulator.
The first AP measure takes place in overlay 335, which contains DSProtect v2.01s.
By comparing what happens in the game's code with and without nds-bootstrap, I was able to patch the overlay to reproduce what occurs without nds-bootstrap.
As a result, the game now boots into the company logos and the title screen.
From there, the name entry menu would appear, and after entering the name, the company logos would then appear again, and after fading out, the game crashes.
The next step was to patch overlay 334, which contains DSProtect v2.01 (with no s at the end, and works differently from the other one).
After applying the patch, as well as a new checksum for the overlay, the game no longer crashes, and the title screen appears once again.
To make the company logos and title screen not appear again after entering the character's name, the next step was to make the patch for overlay 334 return the proper value the game expects (which is 0x11F).
As a result, the game's opening cutscene now plays. Unfortunately, after it has played, the game once again goes back to the company logos and title screen.
To fix that, the patch for overlay 334 has been made to only return the 0x11F after name entry, and the game's first cutscene after the opening one now plays.
After going through the dialog boxes, the game's main protagonist can now be moved in the overworld, right? Well, sort of.
The overworld is nothing but a black screen and a few icons at the screen corners.
The protagonist can be moved to the right for him to appear, and the background of Haidhia Lookout will shift in close to him as a flat texture.
Touching the bottom-left icon (or pressing the X button) will open the main menu, and can be navigated normally, but when exiting the menu, a battle against Dim Dragon will trigger.
The battle gets triggered because there's still an instance of the overlay 334 checksum which hasn't been patched with the new one.
Patching the checksum instances found in the USA ROM has not removed the battle encounter, but it has been sucessfully removed in the European ROM.
Apparently, some checksum instances are encrypted along with the overlay's code.
To remove the battle encounter in the USA ROM, the patch code has been made so that it looks for an instance of the checksum, once an overlay has loaded.
Furthermore, when I tried a save file which gets past the black area, some features wouldn't work correctly, such as using Psynergy.
It would only work when one is assigned to either the L or R buttons.
Getting an item would also either appear as the wrong one, or crash the game.
The final step is to fix those remaining AP issues, and to do that, the patch code has been slightly reworked to not affect the checksum, but that alone will not fix it.
After some more looking into and patching, the patch code for overlay 335 has been ported over to 334.
For those who understand ASM code, here's what nds-bootstrap does to the overlay code (offsets are for the USA/AUS region, but the patch works with other regions):
Overlay 335 (DSProtect v2.01s)
- At 0x021F8284, change the beq instruction (0A000005) to b.
- At 0x021F82D8, change the ldr instruction (E59D1028) to mov r1, 0h.
- At 0x021F82DC, change the ldr instruction (E59D0040) to mov r0, 0h.
- Change instructions at 021F82E4 & 021F82E8 to nop.
Overlay 334 (DSProtect v2.01)
- At 0x021F910C, change the beq instruction (0A00000E) to b.
- At 0x021F91A8, change the ldr instruction (E59D102C) to mov r1, 0h.
- At 0x021F91AC, change the ldr instruction (E59D0044) to mov r0, 0h.
- Change instructions at 021F91B4 & 021F91B8 to nop.
After all of this looking into and fixing/patching,
Golden Sun: Dark Dawn is finally supported by nds-bootstrap!
In short
The AP-fix that has been included with TWLMenu++ for a while was broken, so a new & better AP-fix has been implemented into nds-bootstrap. It has taken 8 days with lots of changes & improvements to the code to ensure that everything was working properly.