Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Button remapping (theory)

  1. #1
    Member
    Join Date
    Aug 2008
    Location
    Arizona
    Posts
    1,073
    Blog Entries
    2

    Default Button remapping (theory)

    I had an idea while messing with ACWW. I found the location in the game's code where it loads from 0x4000130. Well, I thought, what if you make it load the button values from another address? And simply write the buttons you want to be pressed to that address.
    You can have it load from 0x4000130 until a certain code is activated and then load from an address you choose.
    Would this be possible? Or am I wasting my time?

    0x20E7EC0 should point to the "gba buttons" address in ACWW
    normally it'd be 0x20E7EC0 04000130
    you can simply replace 04000130 with any address, right?

    Edit: i can confirm it does work XD I just tried writing the code for "Down" to 0x22BF110, made the game load from that and my character started moving down on it's own.

    Theoretically this can be used to make "auto" codes. Like a code that teleports you to a weed, simulates the B button being pressed, pulls the weed, pauses just long enough to do the "pull weed" animation, and teleports to the next weed and so on. All on it's own.

    I'll work on this more when I get home tonight, this is what happens when you're bored and have too much free time -.-
    Always willing to help with anything, code-related or not. :]

  2. #2
    Chris (Administrator) Vash's Avatar
    Join Date
    Sep 2007
    Location
    Teh Interwebz
    Posts
    1,992
    Blog Entries
    27

    Default

    Very cool. You could write automated weed-pulling codes. Although, you could also write a code to just remove weeds. To each their own...
    Animal Crossing: City Folk
    ACToolkit - NPC_Tool - PattView

  3. #3
    Member
    Join Date
    Aug 2008
    Location
    Arizona
    Posts
    1,073
    Blog Entries
    2

    Default

    Well...
    too bad it won't work on the actual game. I hate it when something works on an emulator and then you make a hack and find out it doesn't work on the actual game...
    Unless there's a pointer somehow? I have no idea.

    Auto-Weed puller (emulator only >_>)


    That was heck to make by the way...most complex code I've ever made. And it doesn't work on the actual game.
    Always willing to help with anything, code-related or not. :]

  4. #4

    Default

    Why would it only work on the emulator? Slightly different addresses? Anyway... I guess thats where Toolkit comes in rather handy...
    http://siestacat.webs.com/GetAttachment.jpg

  5. #5
    Chris (Administrator) Vash's Avatar
    Join Date
    Sep 2007
    Location
    Teh Interwebz
    Posts
    1,992
    Blog Entries
    27

    Default

    If you wanted to remap, you could have the game button routine look for your custom address and have a constant loop checking the 4XXXXXXX address (i/o keys I don't know off the top of my head) to see which buttons are pressed. Your code would say if A is actually pressed, have it say B is pressed at your custom address. Stuff like that. Wouldn't be too complicated at all to put together.
    Animal Crossing: City Folk
    ACToolkit - NPC_Tool - PattView

  6. #6
    Member
    Join Date
    Aug 2008
    Location
    Arizona
    Posts
    1,073
    Blog Entries
    2

    Default

    Quote Originally Posted by siestacat View Post
    Why would it only work on the emulator? Slightly different addresses? Anyway... I guess thats where Toolkit comes in rather handy...
    I'm not sure...I'm guessing switching where it loads the button address is "too powerful" for the regular game.
    I had it simply loading from a line in my ASM routine, which works fine in the rom but on the actual game it freezes for some reason...
    So I'll have to find another method. Hopefully I won't have to dig around too much.

    If you wanted to remap, you could have the game button routine look for your custom address and have a constant loop checking the 4XXXXXXX address (i/o keys I don't know off the top of my head) to see which buttons are pressed. Your code would say if A is actually pressed, have it say B is pressed at your custom address. Stuff like that. Wouldn't be too complicated at all to put together.
    That probably wouldn't work on the actual game either. I'm thinking of looking for the "cmp if B is pressed" and just setting the compare to "true" when I want to pull a weed, and setting it back when I pulled it.
    That way nothing is really changed other than a single instruction so it shouldn't cause problems on the actual game.
    My routine changes the "IOKeys" from 0x4000130 to whatever address every half second and then back. So it simulates B being pressed and released over and over again.

    Edit:
    Code:
    020E7E4C E1D120B0 - load from hardware buttons  ldrh r2, [r1]
    
    020E7E4C E3E02002 - fake "B" being pressed        mvn r2, #2
    I need a break before I get carried away with this. I'll work on other games for awhile XD

    Edit: i got it to work on the actual game XD
    Code:
    023FF090 012FFF11
    E0000000 000000D4
    E28F2001 E12FFF12
    482BA431 4B2D4D2E
    290178A1 DC45D03E
    24308802 42220124
    A42BD149 70A12101
    2200601D 21FF4824
    310F0109 2B1F8803
    2B21D00A 2B24DB01
    3201DD06 39013002
    2100D5F4 477070A1
    03092121 23201C0D
    24FF021B 40220A10
    25031C04 402C08A0
    43581C0D 182D0100
    0124435C 240F1909
    40220910 182D4358
    1889435A 6800480D
    00D222A9 60011A80
    47706085 70A12102
    6018480C 01122220
    47708022 39018821
    2210D4BC 80210112
    D1004291 4770601D
    04000130 021C6DEC
    021E3124 020E7E4C
    E1D120B0 E3E02002
    00000000 00000000
    023FF090 E3520003
    I'll work on shortening it...Not that anyone would probably use this code but it's awesome.
    Always willing to help with anything, code-related or not. :]

  7. The Following User Says Thank You to dragonboy269 For This Useful Post:


  8. #7
    Member
    Join Date
    Aug 2008
    Location
    Vancouver, Washington
    Posts
    226

    Default

    y'know, i would like to see the original code by Jay FNG work online...
    I Lost the Game.

    -Lord Was

  9. #8
    Member
    Join Date
    Aug 2008
    Location
    Arizona
    Posts
    1,073
    Blog Entries
    2

    Default

    Quote Originally Posted by Lord Was View Post
    y'know, i would like to see the original code by Jay FNG work online...
    That's impossible. Well, of course I thought this code was impossible a year ago, so..
    maybe wait a year and I might be good enough to mess with the wifi packets XD
    Always willing to help with anything, code-related or not. :]

  10. The Following User Says Thank You to dragonboy269 For This Useful Post:


  11. #9
    J.P. (Global Moderator) Maniac's Avatar
    Join Date
    Sep 2007
    Location
    Ohio, USA
    Posts
    2,083
    Blog Entries
    5

    Default

    Not bad... love to see the source later ;P

    Say what you mean, mean what you say, and let your actions speak for you.


  12. #10
    Chris (Administrator) Vash's Avatar
    Join Date
    Sep 2007
    Location
    Teh Interwebz
    Posts
    1,992
    Blog Entries
    27

    Default

    Quote Originally Posted by Lord Was View Post
    y'know, i would like to see the original code by Jay FNG work online...
    Stop giving Jay FNG credit for anything.
    Animal Crossing: City Folk
    ACToolkit - NPC_Tool - PattView

  13. The Following 3 Users Say Thank You to Vash For This Useful Post:


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •