ahezard / twl_firm_patcher

GNU General Public License v3.0
43 stars 4 forks source link

Incompatibility with Pokemon - HeartGold Version (U) (Nintendo DS Release #4787) #6

Closed ahezard closed 7 years ago

ahezard commented 8 years ago

From hacksn5s4 on gbatemp

"well pokemon heart gold does not work when i use the patched twl all other games work with heart gold when i load my save theirs a black screen and its not the game because i remove the patched twl in the luma folder and it works i think the issues only with heart gold and not soul sliver which is werid"

ghost commented 8 years ago

I can also confirm this issue, but I'm using soulsilver. Also using the latest Luma update.

TuxSH commented 8 years ago

The dev launcher has this code (but this is weird because it's run before the function being patched...)

if ( v4004008 & 0x80000000 )
  {
    for ( i = v4000180; (v4000180 & 8) != 8; i = v4000180 )
      swiDelay(0x64u);
    *(_WORD *)(v8 + 4) = i & 0xFFF7;
    v4000180 = 0x800;
    if ( *(_WORD *)(v8 + 4) )
      *(_DWORD *)(v8 + 16) = 0;                 // lr of the patched function
    result = 2 * *(_DWORD *)(v8 + 12);
    *(_DWORD *)(v8 + 12) = result;
  }
ahezard commented 8 years ago

The pokemon heart gold game (and other game of the same release period) needs that you launch this game via a launcher that relock the SCFG before launching the game. I cannot do anything about it in the patch itself. You can use (NitroHax https://github.com/ahezard/NitroHax/releases or NtrLauncher https://github.com/ApacheThunder/NTR_Launcher)

A possible way of definitevely fix this could be to found a way to go back to to NTR mode from fully unlocked TWL mode. This would remove the need for this patch entirely since a fully unlocked TWL mode is esay to achieve via editing the srl header (set 1B8h "ARM7 SCFG EXT mask" to 0xFFFFFFFF and convert to cia). But I never succeeded to do this, the SCFG_ROM register is always blocked into TWL mode which create big problem in games (because the dsi bios is still active and not the ds bios).

ahezard commented 8 years ago

Seems that with the information gathered with this project ApacheThunder got the TWL to NTR mode switch working :-) https://github.com/ApacheThunder/NTR_Launcher/commit/18fdf50ec4c1a56a9f57671f0746a50e82f117ce

This project is reaching his end, no patches will be needed in the end. It was very useful for research purpose though and may still be used for that in the future.