Hacking Others Help porting/converting NDS Action Replay Codes

Scep

Member
OP
Newcomer
Joined
Mar 22, 2023
Messages
10
Trophies
0
XP
91
Country
United Kingdom
Hi, I've been trying to port USA Action Replay codes into EUR Action Replay codes for Pokemon Ranger Guardian signs, but I'm not having a good time.
From what I understand I need to be changing the ofset of the USA code to diffrent ofset in the EUR code that has a similar hex makeup, which has been the problem. I can often find a similar place in the EUR code for the first and last line of the cheats, but the middle lines stump me.
I'm sure there's more to the picture I'm missing out on but I feel that it would be usefull geting some help to get there, any advice would be greatly apreciated.
 

YuseiFD

Well-Known Member
Member
Joined
Jul 6, 2016
Messages
600
Trophies
0
Age
34
XP
2,615
Country
Hi, I've been trying to port USA Action Replay codes into EUR Action Replay codes for Pokemon Ranger Guardian signs, but I'm not having a good time.
From what I understand I need to be changing the ofset of the USA code to diffrent ofset in the EUR code that has a similar hex makeup, which has been the problem. I can often find a similar place in the EUR code for the first and last line of the cheats, but the middle lines stump me.
I'm sure there's more to the picture I'm missing out on but I feel that it would be usefull geting some help to get there, any advice would be greatly apreciated.
This is really an over simplification, code types can range from a direct write, to an actual set of asm instruction, that could, in fact, hold offsets inside the instructions themselves, can you post the codes you want to port ?
 

Scep

Member
OP
Newcomer
Joined
Mar 22, 2023
Messages
10
Trophies
0
XP
91
Country
United Kingdom
This is really an over simplification, code types can range from a direct write, to an actual set of asm instruction, that could, in fact, hold offsets inside the instructions themselves, can you post the codes you want to port ?
I want to port quite a few codes but here's the one I'm working on currently

Pokemon Ranger - Guardian Signs (USA)
Quest Time Never Decreases
520465C8 C2444001
020465C8 C2444000
D2000000 00000000
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,321
Country
United Kingdom
Is there a particular reason to use the European offerings if you presumably speak English? Sometimes there can be notable differences beyond language (in mainline pokemon the gambling stations being notable in this) but a casual search did not reveal much.

Anyway porting cheats...
Assuming they are plain memory cheats (classical infinite potions, ammo type deal) then one of two things tends to happen
1) The location within the memory changes.
2) The data format changes. Not common for gameplay concepts but seen more in names (the changing from 16 bit in Japanese to 8 bit encodings outside it often also triggering a location change as well if the resulting data is stacked end to end, same problem also arises in save editing/why porting saves between regions is tricky).

Most of the time translation and localisation efforts have little need of changing things here so find something equivalent (if gold is easy to find then find gold in the new version/region/bundle pack) and the data you want (presumably something hard or otherwise annoying to alter in normal play that you generally understand the formatting of from the existing knowledge) will be if not the same distance away then near enough that you can spot it manually. Many however will opt to make it again if they are easy enough, and maybe take a hint on a solution if the obvious choice (more on that shortly) is in fact not the ideal solution.

If indeed the game's own code is changed (quite possible as the binary is loaded into memory to run and thus within range of cheat devices that have no chance of altering cart reads or something like the game genies of old) then you get to understand what was done. Memory location manipulation being very much a thing (indeed one of the big three things game code ever does) can make this more tricky, and sometimes clocks in games can need some more subtle attention -- hold a clock on infinite and certain events might not happen, if the game counts it down as a bonus score or something then holding it will see you unable to finish the mission or indeed start...
The location the binaries for a given game are copied to is easy to find with various ROM bothering tools (I usually liked ndsts for this) and overlays can be found in many similar manners. Not all of the binary is instructions ( https://tcrf.net/Pokémon_Ranger:_Guardian_Signs , also a decent website on many occasions to capture region differences, notes all sorts of wifi error codes which I tend to find in there) and overlays even less so, and that is before you encounter games that pack it all into overlays.

I am not going to be able to grab things and do it but to at least start
https://doc.kodewerx.org/hacking_nds.html should detail code types.
Three lines and I have some idea of what is coming but will take the long form
520465C8 C2444001
Code:
Type 0x05
Equal To
5XXXXXXX YYYYYYYY     Checks if YYYYYYYY == (word at [XXXXXXX]).
If not, the code(s) following this one are not executed (ie. execution status is set to false) until a code type D0 or D2 is encountered, or until the end of the code list is reached.

020465C8 C2444000
Code:
Type 0x00
32-bit
0XXXXXXX YYYYYYYY     Writes word YYYYYYYY to [XXXXXXX+offset].

D2000000 00000000
Code:
Type 0xD2
Loop Execute Variant/ Full Terminator
D2000000 00000000     Executes the next block of codes 'n' times (specified by the 0x0C codetype), and clears all temporary data. (i.e. execution status, offsets, code C settings, etc.)
This code can also be used as a full terminator, giving the same effects to any block of code.

So it checks to see if 020465C8 in memory ( https://problemkaputt.de/gbatek.htm#dsmemorymaps , well into the main normal memory, could be binary but I have not checked) has the value C2444001 present. If it does then it writes the same location with C2444000.
For a timer change and value picked that is a bizarre one (milliseconds, seconds, frames... something like that gets used as either a count up or a count down in most timers I have ever encountered though as any 16 bit speedrunner will tell you then internal timers are not the most reliable of things so be aware of that when doing frame advance searches). If it is not some piece of actual code or maybe the cheat maker getting lazy (costs nothing really to do a 32 bit write rather than 16 so overwrite the original data with the same data) then I would wonder if it is a flag that some other mission types (or easy mode) use and it is just tricking them, or maybe it is a multiplier (some pickup that says 10% more time on missions could be implemented as a multiplier and this then changes the rate/multiplier).
If you are lucky then start one of those timed missions and search a memory dump for C2444001. If it is a flag or a non memory instruction then it might well be the same and you can redo accordingly. Otherwise time to figure out what it does and alter that instead.
You might have to remake the obvious choice of code as well -- time, number of steps... whatever it tracks normally and see why the obvious choice of just holding that number solid did not do anything.
 
  • Like
Reactions: Scep and YuseiFD

Scep

Member
OP
Newcomer
Joined
Mar 22, 2023
Messages
10
Trophies
0
XP
91
Country
United Kingdom
Is there a particular reason to use the European offerings if you presumably speak English? Sometimes there can be notable differences beyond language (in mainline pokemon the gambling stations being notable in this) but a casual search did not reveal much.

Anyway porting cheats...
Assuming they are plain memory cheats (classical infinite potions, ammo type deal) then one of two things tends to happen
1) The location within the memory changes.
2) The data format changes. Not common for gameplay concepts but seen more in names (the changing from 16 bit in Japanese to 8 bit encodings outside it often also triggering a location change as well if the resulting data is stacked end to end, same problem also arises in save editing/why porting saves between regions is tricky).

Most of the time translation and localisation efforts have little need of changing things here so find something and the data you want will be if not the same distance away then near enough that you can spot it manually. Many however will opt to make it again if they are easy enough, and maybe take a hint on a solution if the obvious choice (more on that shortly) is in fact not the ideal solution.

If indeed the game's own code is changed (quite possible as the binary is loaded into memory to run and thus within range of cheat devices that have no chance of altering cart reads or something like the game genies of old) then you get to understand what was done. Memory location manipulation being very much a thing (indeed one of the big three things game code ever does) can make this more tricky, and sometimes clocks in games can need some more subtle attention -- hold a clock on infinite and certain events might not happen, if the game counts it down as a bonus score or something then holding it will see you unable to finish the mission...).
The location the binaries for a given game are copied to is easy to find with various ROM bothering tools (I usually liked ndsts for this) and overlays can be found in many similar manners. Not all of the binary is instructions ( https://tcrf.net/Pokémon_Ranger:_Guardian_Signs notes all sorts of wifi error codes which I tend to find in there) and overlays even less so, and that is before you encounter games that pack it all into overlays.

I am not going to be able to grab things and do it but to at least start
https://doc.kodewerx.org/hacking_nds.html should detail code types.
Three lines and I have some idea of what is coming but will take the long form
520465C8 C2444001
Code:
Type 0x05
Equal To
5XXXXXXX YYYYYYYY     Checks if YYYYYYYY == (word at [XXXXXXX]).
If not, the code(s) following this one are not executed (ie. execution status is set to false) until a code type D0 or D2 is encountered, or until the end of the code list is reached.

020465C8 C2444000
Code:
Type 0x00
32-bit
0XXXXXXX YYYYYYYY     Writes word YYYYYYYY to [XXXXXXX+offset].

D2000000 00000000
Code:
Type 0xD2
Loop Execute Variant/ Full Terminator
D2000000 00000000     Executes the next block of codes 'n' times (specified by the 0x0C codetype), and clears all temporary data. (i.e. execution status, offsets, code C settings, etc.)
This code can also be used as a full terminator, giving the same effects to any block of code.

So it checks to see if 020465C8 in memory ( https://problemkaputt.de/gbatek.htm#dsmemorymaps , well into the main normal memory, could be binary but I have not checked) has the value C2444001 present. If it does then it writes the same location with C2444000.
For a timer change and value that is a bizarre one. If it is not some piece of actual code then I would wonder if it is a flag that some other mission types (or easy mode) use and it is just tricking them, or maybe it is a multiplier (some pickup that says 10% more time on missions could be implemented as a multiplier and this then changes the rate/multiplier).
If you are lucky then start one of those timed missions and search a memory dump for C2444001. If it is a flag or a non memory instruction then it might well be the same and you can redo accordingly. Otherwise time to figure out what it does and alter that instead.
You might have to remake the obvious choice of code as well -- time, number of steps... whatever it tracks normally and see why the obvious choice of just holding that number solid did not do anything.

Hi, thanks for the information. I was kinda hoping you'd reply because on the multiple threads I've looked at you provided in-depth responses (that I've admittedly had a hard time wrapping my head around). I've checked out multiple of the sites you linked in previous posts including the one you liked here and I sorta understand some of the things but I'm not quite there yet.
Like I understand what that code type is saying/doing, but I don't understand what to do with that information or what to do next. Basically, I'm having trouble finding the stuff within the code that you're talking about, like I'm going to go and try and search the memory dump for C2444001 but I'm not exactly sure how I'll do that, but I'll bumble my way through anyway.

I probably also have some infinite-type cheats that I am working to try and port, such as this one:
[SELECT]AP MAX:
94000130 FFFB0000
920E9272 00000210
020E9274 0001869F
D2000000 00000000

which I converted into
AP MAX:
91C21072 00000210 / 920E9272 00000210
020F4074 0001869F / 020E9274 0001869F
D2060000 00000000 / D2000000 00000000
since the first line should just be calling for pressing the select button, and it should be the same between USA and EUR considering another cheat I got working for EUR that requires select starts with 94000130 FF7B0000

However, there are only 4 I really want to convert, the time one, the AP one, and the following two. I would probably only need the AP exp one.
The other AP one would help if there are AP differences, and the time one would be of great help, the quad one although unnecessary would also be nice.
AP/Temple Quest EXP Multiplier x128:
520F1BBC E59F0054
120F1BC0 00002382
D2000000 00000000

Activate Dual/Quad Switches Alone:
520EFB24 E1500008
E20EFB24 0000000C
E3500001 B28DD00C
B8BD8FF0 00000000
D2000000 00000000

I've been mostly following this guide to no avail but I'll try following your advice as well.

EDIT: Also I forgot to mention my game is from the Wii U eshop, (not running on the Wii U it's run on DS hardware) which could also be affecting things, although I don't necessarily think it is.
 
Last edited by Scep,

RokuMH

New Member
Newbie
Joined
Aug 18, 2023
Messages
1
Trophies
0
Age
26
XP
17
Country
Spain
I'm currently in the same situation as you are; I started playing the european version of the game with the intention of 100%ing it , only to later realize that things like obtaining all the slates or getting S-rank in the past missions is pretty much impossible to do in single player mode.
After that I started looking for action replay codes that would help me bypass this problem, and saw that only the USA version of the codes were created, so I searched for a couple tutorials on how to port the cheat codes to another region.

Found the same tutorials as you did and, to see if those tutorials would work, I compared the european and north american versions of these 2 codes I found in a GameFAQs thread:
Game ID: B3RE-0A33F3D5

::Activate Dual/Quad Switches Alone (North American version)
520EFB24 E1500008
E20EFB24 0000000C
E3500001 B28DD00C
B8BD8FF0 00000000
D2000000 00000000

::Movement Speed x2 (North American version)
52102CA8 E59241BC
02102CA8 E3A04004
D2000000 00000000

---

Game ID: B3RP-366AB533

::Activate Dual/Quad Switches Alone (European version)
520EFD88 E1500008
E20EFD88 0000000C
E3500001 B28DD00C
B8BD8FF0 00000000
D2000000 00000000

::Movement Speed x2 (European version)
52102F0C E59241BC
02102F0C E3A04004
D2000000 00000000

The conclusion? When I compared the offsets I expected to find the same lines of code written in both games, but no, they're completely different (as seen in the pics attached) and now I'm unsure on how to proceed.
 

Attachments

  • Activate DualQuad switch EUR.PNG
    Activate DualQuad switch EUR.PNG
    30.8 KB · Views: 29
  • Activate DualQuad switch USA.PNG
    Activate DualQuad switch USA.PNG
    39.9 KB · Views: 33
Last edited by RokuMH,

Scep

Member
OP
Newcomer
Joined
Mar 22, 2023
Messages
10
Trophies
0
XP
91
Country
United Kingdom
I'm currently in the same situation as you are; I started playing the european version of the game with the intention of 100%ing it , only to later realize that things like obtaining all the slates or getting S-rank in the past missions is pretty much impossible to do in single player mode.
After that I started looking for action replay codes that would help me bypass this problem, and saw that only the USA version of the codes were created, so I searched for a couple tutorials on how to port the cheat codes to another region.

Found the same tutorials as you did and, to see if those tutorials would work, I compared the european and north american versions of these 2 codes I found in a GameFAQs thread:
Game ID: B3RE-0A33F3D5

::Activate Dual/Quad Switches Alone (North American version)
520EFB24 E1500008
E20EFB24 0000000C
E3500001 B28DD00C
B8BD8FF0 00000000
D2000000 00000000

::Movement Speed x2 (North American version)
52102CA8 E59241BC
02102CA8 E3A04004
D2000000 00000000

---

Game ID: B3RP-366AB533

::Activate Dual/Quad Switches Alone (European version)
520EFD88 E1500008
E20EFD88 0000000C
E3500001 B28DD00C
B8BD8FF0 00000000
D2000000 00000000

::Movement Speed x2 (European version)
52102F0C E59241BC
02102F0C E3A04004
D2000000 00000000

The conclusion? When I compared the offsets I expected to find the same lines of code written in both games, but no, they're completely different (as seen in the pics attached) and now I'm unsure on how to proceed.

Hi, I didn't get an e-mail notif of your reply so sorry for the super late reply.
I also never figured out how to port the codes so unfortunately I can't help you there atm, hopefully someone else might be able to help us in the future.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: Maybe but is it worth it?