Hacking Action Replay code to switch screens

  • Thread starter Thread starter _V1qY
  • Start date Start date
  • Views Views 17,712
  • Replies Replies 39
It was a pain in the ass to find a good 'flag' to test for so it would only switch the screen while in the race but I finally got it! Because of the way I had to make it it will only work on MKDS [EU].

SWAP LCD
5203809C E1D100B0
0203809C E51FF004
020380A0 02000000
D0000000 00000000
52000000 E7FFDEFF
E2000000 00000034
E92D5FFF E5910000
E3800902 E59F3014
E1530004 1A000000
E3C00902 E5810000
E8BD5FFF E59FF004
022CC594 04000304
020380A8 00000000
D2000000 00000000
 
Wow, you went above and beyond what I expected! I would have been fine with the screens being always switched but this is just perfect. Thanks!
 
No problem. It was fun getting back into code hacking (even though it showed me how rusty I had gotten). It actually would get trapped in a few loops if I didn't make it so it was only swapped during the race so it would have been more work to do the screen swap during the full game. I tested different racers and tracks that were unlocked so hopefully nothing in other tracks breaks it. Let me know how it goes.
 
No problem. It was fun getting back into code hacking (even though it showed me how rusty I had gotten). It actually would get trapped in a few loops if I didn't make it so it was only swapped during the race so it would have been more work to do the screen swap during the full game. I tested different racers and tracks that were unlocked so hopefully nothing in other tracks breaks it. Let me know how it goes.
The code works fine as an Action Replay code, but I can't apply it with DSATM. White screen on hardware.
 
It was a pain in the ass to find a good 'flag' to test for so it would only switch the screen while in the race but I finally got it! Because of the way I had to make it it will only work on MKDS [EU].

SWAP LCD
5203809C E1D100B0
0203809C E51FF004
020380A0 02000000
D0000000 00000000
52000000 E7FFDEFF
E2000000 00000034
E92D5FFF E5910000
E3800902 E59F3014
E1530004 1A000000
E3C00902 E5810000
E8BD5FFF E59FF004
022CC594 04000304
020380A8 00000000
D2000000 00000000

nice work! 8)

are those compressed 4 byte instructions + ram offsets?
 
Yeah, it's raw ARM code that gets loaded to 0x2000000. The game's display handling function @ 0x203809C gets patched to jump to it.
 
How hard would it be to generalize this code to other games? Is there an easy way to locate the display handler, e.g. by finding the same code in another game (presumably the handler is similar/the same and comes from the SDK?).
 
The problem is it would probably require manually touching up the code from one game to the next anyway because of bugs created by improperly switching the lcd states. I had to search quite a while with no$gba to find some good areas of memory to test that would always have the same value duing the race and only then. I think the same thing would happen in many games.
 
That is very strange. Do you have v5.1? Did you change any settings?


Hi, i'm really interested in doing this in mario kart (and other games jeje), i tried to use the AR with DSATM v5.1 in wood R4
(i have a modded ds without top screen)
but it didn't work, :( (i dnt change anything) any suggestions?
thx
 
DSATM does not have the same effect as using AR in Desmume. even the simple "14000304 00000FFF" works in Desmume for SM64, but with DSATM- no change.
If I start the patched rom and the apply the AR cheat, it works. So DSATM seems to be unable to permanently change this.
 
DSATM does not have the same effect as using AR in Desmume. even the simple "14000304 00000FFF" works in Desmume for SM64, but with DSATM- no change.
If I start the patched rom and the apply the AR cheat, it works. So DSATM seems to be unable to permanently change this.
Not so much.

The DS has a register that it looks to so as to know what screen to put things on. That is what the simple code tries to change. Desmume is happy enough to write this as it is an emulator and does not have the same restrictions as the hardware, hardware however does not respond quite the same to this. This is why cracker made a far more more complex cheat up above to target Mario Kart EU specifically
http://gbatemp.net/threads/action-replay-code-to-switch-screens.355486/page-2#post-4910138

Here are some links that might help you in analysing the code, however I came unstuck when I tried the second part of it (the part after the D0 code) as I am not sure what it is writing where.
http://doc.kodewerx.org/hacking_nds.html
http://problemkaputt.de/gbatek.htm#dsmemorymaps
and as the link from my opening post is broken you might as well have the new/current one
http://problemkaputt.de/gbatek.htm#dspowermanagement
 
Are there any codes or known AR codes out there we can apply to Super Princess Peach and New Super Mario Bros. that would accomplish the same thing with flipping the LCD screen, or is it a trial and error pain?

Also, I tried patching the Mario Kart one above using those AR codes, and DSATM crashes when trying to apply them - does anyone have the patch available by chance?
 
Last edited by Butterbean,
it's pointless to try this with the ds vanias, because they require that the action be on the touch screen.

you need to draw seals, tap to teleport, tap to break ice, etc.
 
it's pointless to try this with the ds vanias, because they require that the action be on the touch screen.

you need to draw seals, tap to teleport, tap to break ice, etc.
You could probably make it an activator cheat (the effect is mostly just a register wanting to be changed, cracker's stuff beyond the simplistic thing I had in the previous page just being the reassuring platitudes that need to be whispered to the hardware to do it), and beyond that maybe chain it one with the various improvement hacks* that do away with the seals and ice aspect just in case (which might even not need a swap if it instead is more or less "is button pressed?" than "is seal drawn properly?")

*for those unfamiliar with such things
http://www.romhacking.net/?page=hac...e=20&order=&dir=&title=&author=&hacksearch=Go
Has some for all three DS efforts (might need to go on the next page). Various levels of change available for those.
 
  • Like
Reactions: cearp
Have anybody found anything for pokemon soul silver? I don't care if I have to patch the rom, I just want it to successfully boot and be able to switch screens via button combination (and for the online battle mode to work).
 

Site & Scene News

Popular threads in this forum