Can you edit the button controls on a ds rom?

Discussion in 'NDS - ROM Hacking and Translations' started by Jugo, Jul 4, 2011.

Jul 4, 2011
  1. Jugo
    OP

    Newcomer Jugo Advanced Member

    Joined:
    Apr 17, 2010
    Messages:
    83
    Country:
    United States
    I mean like swapping them. Ex: Switching the B and X buttons in pokemon so you can use the menu with B and run with X.
     
  2. Cyan

    Global Moderator Cyan GBATemp's lurking knight

    Joined:
    Oct 27, 2002
    Messages:
    16,433
    Location:
    Engine room, learning
    Country:
    France
    Such a hack has already been done on other games (like Zelda to enable moving with D-pad instead of stylus).

    I don't know how hard it is to change the button layout, but I just wanted to tell you that it's possible.
     
  3. syko5150

    Member syko5150 GBAtemp Syko!

    Joined:
    Apr 25, 2009
    Messages:
    3,091
    Location:
    California
    Country:
    United States
    I would say it's possible as it's been done on games like Guitar Hero to allow you to change which buttons match to which colors.
     
  4. FAST6191

    Reporter FAST6191 Techromancer

    pip
    Joined:
    Nov 21, 2005
    Messages:
    21,738
    Country:
    United Kingdom
    Guitar hero, zelda Dpad and starfox Dpad hacks were actually a cut above what you want to do here. The touch screen to dpad stuff actually rewrote parts of the game to operate in such a manner (it made the buttons change things the touch screen was previously responsible for) where the guitar hero used part of the GBA slot as a bus which actually added buttons to the DS that the hacks then turned the game away from and pointed at the buttons. I also recall a cheat for trauma center that reset patient health based upon a "miss" that might be worth looking at (or not as a miss probably registers in other places).

    Generally speaking the buttons which all have their own memory mapping are read every so often (might be refresh) and usually dumped to another memory section to use. Theory behind that if you have ever had a mouse that would double click for a single click chances are the switch was experiencing a failure method known as switch bounce (part was worn and making the circuit twice usually)- by copying it to the memory section and only using that you can negate this somewhat (the method is called debouncing).
    That aside over getting back to the hacking the button register is detailed http://nocash.emubase.de/gbatek.htm#dskeypad
    GBA part which has a bit more info
    http://nocash.emubase.de/gbatek.htm#gbakeypadinput

    You get to figure out what the game does and edit it. Naturally this means ASM hacking (if cheats do it they change the binary in memory).

    I personally would find the debounced copy (it might be a straight copy of the register but some games have been known to set a byte for each which is awesome as you then just have to change (or in your case swap) the destination) and fiddle with that (or indeed change how it gets there) so what was the button "a" bit is now the button "b" otherwise you run the risk of having to chase down interrupts and game logic and changing how they all work which is potentially a very long and boring process.

    Although I said starfox stuff was actually a bit outside what you want there is a nice guide to it http://crackerscrap.com/docs/sfchacktut.html which covers a lot of the background theory and implementation of the hack.

    Others have gone the electrical engineering route and physically remapped the buttons which is easier if you can swing a soldering iron.
     

Share This Page