Hacking Action Replay code to switch screens

cracker

Nyah!
Member
Joined
Aug 24, 2005
Messages
3,619
Trophies
1
XP
2,213
Country
United States
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
 

_V1qY

Well-Known Member
OP
Member
Joined
May 31, 2012
Messages
138
Trophies
0
XP
166
Country
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!
 

cracker

Nyah!
Member
Joined
Aug 24, 2005
Messages
3,619
Trophies
1
XP
2,213
Country
United States
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.
 

_V1qY

Well-Known Member
OP
Member
Joined
May 31, 2012
Messages
138
Trophies
0
XP
166
Country
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.
 

Coto

-
Member
Joined
Jun 4, 2010
Messages
2,979
Trophies
2
XP
2,565
Country
Chile
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?
 

cracker

Nyah!
Member
Joined
Aug 24, 2005
Messages
3,619
Trophies
1
XP
2,213
Country
United States
Yeah, it's raw ARM code that gets loaded to 0x2000000. The game's display handling function @ 0x203809C gets patched to jump to it.
 

Vague Rant

Deceptively cute
Member
Joined
Aug 7, 2008
Messages
2,464
Trophies
2
Location
Melbourne
Website
vaguerant.tumblr.com
XP
3,315
Country
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?).
 

cracker

Nyah!
Member
Joined
Aug 24, 2005
Messages
3,619
Trophies
1
XP
2,213
Country
United States
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.
 

Elru

Well-Known Member
Newcomer
Joined
May 14, 2014
Messages
54
Trophies
0
XP
906
Country
Chile
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
 

schnurbi

New Member
Newbie
Joined
Jan 30, 2016
Messages
1
Trophies
0
Age
44
XP
52
Country
Angola
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.
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,348
Country
United Kingdom
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
 

Butterbean

Member
Newcomer
Joined
Jun 13, 2018
Messages
13
Trophies
0
Age
46
XP
79
Country
United States
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,

Zaphod77

Well-Known Member
Member
Joined
Aug 25, 2015
Messages
665
Trophies
0
Age
49
XP
615
Country
United States
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.
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,348
Country
United Kingdom
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

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • BakerMan
    I rather enjoy a life of taking it easy. I haven't reached that life yet though.
  • BigOnYa @ BigOnYa:
    I don't trust the free ones, but ipvanish I've used for couple years now, n like
  • Psionic Roshambo @ Psionic Roshambo:
    I wonder if they could get CPUs to run that hot then use the heat to power a steam turbine to power the CPUs....
  • BigOnYa @ BigOnYa:
    Good idea, or at least power the GPU
  • Psionic Roshambo @ Psionic Roshambo:
    It's not the movies or games downloads that I would worry about, like breaking into networks, downloading encrypted things, spying on network traffic. I have seen so many "Top Secret" seals on files when I was a kid
  • Psionic Roshambo @ Psionic Roshambo:
    I was obsessed with finding UFOs, a surprising amount of US files where stashed on computers in other countries, China back in the early 90s omg sooo much
  • BigOnYa @ BigOnYa:
    Yea that crazy, I've never tried hack into anything, I just pirate, and my ISP have send me 3-4 letters, so had to VPN it
  • Psionic Roshambo @ Psionic Roshambo:
    Ship to ship communication software for the Navy although without access to the encrypting chips it was mostly useless
  • Psionic Roshambo @ Psionic Roshambo:
    I bet now a 4090 could probably crack it? Hmmm maybe not even back then I'm pretty sure they where using like 1024 bit encryption
  • Psionic Roshambo @ Psionic Roshambo:
    Yayyy the one set finished 324GBs lol
  • Psionic Roshambo @ Psionic Roshambo:
    Compressed....
  • Psionic Roshambo @ Psionic Roshambo:
    I wonder how many years that would have taken on a 56K modem lol
  • Psionic Roshambo @ Psionic Roshambo:
    18000 hours lol
  • Psionic Roshambo @ Psionic Roshambo:
    750 days lol
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    So Internet is very much faster now lol
  • BigOnYa @ BigOnYa:
    "Time Remaining- 2 years, 9 girlfriends, 6 hairstyles, please standby..."
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    I remember one time I downloaded like a 500MB ISO file on 56K and that literally took like 2 days
  • Psionic Roshambo @ Psionic Roshambo:
    I had some sort of resume thing, I remember the software had chains
  • Psionic Roshambo @ Psionic Roshambo:
    Damned if I can't remember.the name though
  • Psionic Roshambo @ Psionic Roshambo:
    Some sort of download management app
  • BigOnYa @ BigOnYa:
    Ok good chatting, I'm off to the bar, to shoot some pool, nighty night.
    +1
  • BakerMan @ BakerMan:
    hey psi
  • BakerMan @ BakerMan:
    i call your girl lyndon the way she b on my johnson
    BakerMan @ BakerMan: i call your girl lyndon the way she b on my johnson