Action Replay code conversion

Discussion in 'NDS - ROM Hacking and Translations' started by 8BitWalugi, Jul 20, 2012.

Jul 20, 2012
  1. 8BitWalugi
    OP

    Member 8BitWalugi Taiyohhhhhh!

    Joined:
    Mar 22, 2008
    Messages:
    3,271
    Location:
    Side 7
    Country:
    Australia
    This is something I've been looking for for a while, and have no idea how to do it.

    Basically, in Lunar Knights (Boktai 4) there were numerous items (And even Terrenials) dummied out due to the removal of the Megaman StarForce crossover.
    I looked around and found out that someone managaed to hack these removed items back in via AR codes.

    Only problem is that he did it only for US games.

    I managed to get in touch with him a while back (Ian Chamberlain, @the_9th_sage), and he couldn't help me out (He did help me get it working on my US ROM. :D).

    The only thing that I can think of now would be converting the code's region, and even then I have no idea how possible this is.

    The site with all the codes is here: http://zeldadd.xanga...-the-equipment/

    The codes in particular that need conversion from US to EUR are
    Code:
    Django/Aaron - Warrock
    221ec044 0000001d
    221ec045 00000000
    Code:
    Sabata/Lucian - Warrock
    221ec054 0000001d
    221ec055 00000000
    Any help would be greatly appreciated.

    Thank you, in advance.
     
  2. FAST6191

    Reporter FAST6191 Techromancer

    pip
    Joined:
    Nov 21, 2005
    Messages:
    21,743
    Country:
    United Kingdom
    Short version- probably not going to happen that easily but if you feel up to it then there might be something you can try.

    http://cheats.gbatemp.net/hack/hacking_nds.html has some on how to decode cheats
    In this case
    221ec044 0000001d
    221ec045 00000000

    2XXXXXXX 000000YY
    Type 0x02 is an 8 bit write of YY to XXXXXXX (+offset if you defined one in an earlier cheat)
    2
    21ec044 is probably more commonly written as 021ec044 which is 1ec044 in the main memory of the DS (most will leave it as 021ec044 though).
    0000001d is actually just 1d (8 bits remember)

    I could teach you how to make it into a codebreaker or some other form of cheat (not that it is hard as you have everything you need once you have decoded it like that) but regions are a different matter. The trouble is between regions they might have shifted something in the code (new language options or something) and the compiler almost certainly would have which means the location is now different. I would be not be surprised to see the memory layout just be shifted and would be quite surprised to see the payload not work as and when you track down the game; unless the developers actually removed the extras which the occasional loss of audio aside is fairly rare for a simple European languages localisation it should all still be there.

    You might be able to observe the memory in the NA game without the cheat and then go to the EU game and try to find a similar memory structure from a memory dump before changing the location in the cheat but that is a very crude method- still some of the earlier AP patches could do a similar technique to port between regions so you never know. If it does not work like that there may be a semi obvious tweak the localisation did (added an extra few bytes between something) but frankly you are stuck remaking the cheat which for these hidden extras can sometimes be a pain as it will have involved a proper debugging of the game to get there although other times but other times if the wooden sword is 00, the iron sword is 01, the steel sword is 02 and so on the uber debug sword of power is probably going to be one after the ultimate sword from the game proper.

    Rather nicely for you this appears to be in actual memory for this game and not in a binary or an overlay region.

    If the cheat only needs to be activated the once, kind of like if you give yourself infinite lives in a game it would probably give you 99 and then when you lose the cheat you are still left with 99 lives although that number will now go down, then you are probably better off seeing if the save for the game will go across to the other region. Sometimes if faces almost the exact same problem as just described (shifting memory locations) and for others there might be font issues (usually for Japanese to Roman character languages and the like but not always) but it is usually worth a try.
     
  3. 8BitWalugi
    OP

    Member 8BitWalugi Taiyohhhhhh!

    Joined:
    Mar 22, 2008
    Messages:
    3,271
    Location:
    Side 7
    Country:
    Australia
    I... wish I could understand that... D:

    Sorry... I'm not good with this kinda thing... :/
     
  4. FAST6191

    Reporter FAST6191 Techromancer

    pip
    Joined:
    Nov 21, 2005
    Messages:
    21,743
    Country:
    United Kingdom
    I am not entirely sure how I could rephrase it to still be a rough guide as to what needs to be done but I can take the underlying theory.

    Action replay codes are just a listing of the type of code (hold this memory section, add this number to the memory, check and then write this number if.....), the location it is found at in memory and if necessary what the thing that needs to be written is. Some of the better cheat devices will have extra abilities but even then is not that much more.

    A processor like those in the DS only has a series of basic instructions (pretty much basic arithmetic, some boolean logic and instructions to compare, jump to a new location and handle internal stuff) and even more complex ones like the x86/x64 are not much better but with those basics you can build up far more complex functions leading to what you usually think of as a program. Piecing together basic instructions and handling absolutely everything (otherwise known as assembly programming) is a right pain to do so we have programming languages which DS developers pretty much all use which in the case of the DS usually means something of the C/C++ persuasion but higher level stuff like lua is available.
    For the most part you can not compile a program and with the result of that go backwards to source code (it is both a major area of study in computer science and what has given us proprietary programs/most of the computer industry) but said source code might include how to handle a font or what files to load when although developers learned early on to kick text, images and more out of the program itself (doing so it is what has made DS ROM hacking that much nicer than the likes of the GBA, SNES and older consoles and even those are easier than the really old stuff). However the stats used by a game and similar things, which is what you are editing with this cheat, are usually left in the program and controlled by it and if the source code was changed a bit (say to add a language selector) then as the compiler will be the thing to assign memory locations (it being one of the distinguishing factors between assembly and high level programming) it can completely change where everything ends up in memory hence your cheat, which remember as part of it is locked to a given point in memory*, will be bothering some other area of memory that no long handles what that memory location on the original version of the game did. However as localisation tends not to involve much change to the way the game runs and is more often concerned with getting the text translated and the such the original memory layout might well have just been shifted and be composed of similar structures hence your maybe being able to look at the memory to see if it is just in a slightly different location and changing the cheat to that new location. However it is not a sure fire method for if you asked a competent programmer they could force radical changes in memory layout and there are instances of developers needing space either in the rom itself or the binary (which has to be loaded into memory on the DS to run) meaning it could be somewhere very different or not there at all.
    Being entirely possible and not improbable either a radical change would probably mean remaking the cheat from scratch which for as simple as the cheat looks in cheat form might well have taken some serious effort to cook up in the first place; those making some of the nicer cheats are in many cases among some of the finest hackers working on the DS and would be even if they did not otherwise known anything about how to say edit text in a game (they usually do well on the more conventional "ROM hacking" stuff but most of that comes with just knowing how computers work).

    *the game itself can choose a memory location at runtime and where C family programs have it as one of the more tricky parts of the language even higher level programming languages like java, python and such more or less handle it all for you (at the cost of speed) and thus are seen to do it all the time and this is what gives us pointer codes but let us not head down that path right now.
     

Share This Page