Announcement

Collapse
No announcement yet.

[NDS] Execute an AR Code only once?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • MichiS97
    replied
    I really don't understand it, I'm using a new address now and it's the same problem: It works just fine on Desmume and not at all on the DS

    Code:
    221BA598 00000002
    94000130 FCFE0000
    A23F7750 00000001
    DB000000 021BA605
    D4000000 00000002
    D8000000 021BA605
    123F7750 00000001
    D2000000 00000000

    Leave a comment:


  • Pyriel
    replied
    http://problemkaputt.de/gbatek.htm#dsmemorymaps

    That's the range of main memory anyway. It's theoretically possible that some other addresses could be writable with the right offset and codes, but it's generally best to stick with user memory ranges unless you know what you're doing.

    Although, according to this, only 3 KB of the BIOS range is actually used, so if it's writable and initialized, the unused portions would make an ideal, fixed-location code cave. Assuming you can safely branch into code there without issuing syscalls or whatever the ARM/NDS equivalent is. I'm guessing that one or more difficulties make that impossible or infeasible, otherwise people more familiar with the NDS would probably have documented how to do it.

    Leave a comment:


  • MichiS97
    replied
    Originally posted by Demonic722 View Post
    When in doubt, just write to 0x02000000 since it's usually unused/free. If you find another spot, make sure it's between 0x02000000 and 0x02400000.
    Oh so that's the memory range you can write to with AR Codes? I couldn't find that anywhere

    Leave a comment:


  • Demonic722
    replied
    When in doubt, just write to 0x02000000 since it's usually unused/free. If you find another spot, make sure it's between 0x02000000 and 0x02400000.

    Leave a comment:


  • rimsky82
    replied
    Agreed, without looking at the memory map... An emulator might allow a write to 0x2FFFFFF, but the DS hardware might not. I would run the game and look for some RAM that isn't used to store that value.

    Leave a comment:


  • Helder
    replied
    What's at the 3rd line's address? Seems like an odd address.

    Leave a comment:


  • MichiS97
    replied
    Originally posted by Helder View Post
    Are you properly terminating the code with the D2000000 00000000 line? also what game is it?
    Yes I am, it's Legend of Zelda Phantom Hourglass

    Code:
    221BA598 00000002
    94000130 FCFE0000
    A2FFFFFE 00000001
    DB000000 021BA605
    D4000000 00000002
    D8000000 021BA605
    12FFFFFE 00000001
    D2000000 00000000
    I made some changes to the code, here's the updated one
    Last edited by MichiS97; 07-25-2015, 09:58:44 AM.

    Leave a comment:


  • Helder
    replied
    Are you properly terminating the code with the D2000000 00000000 line? also what game is it?

    Leave a comment:


  • MichiS97
    replied
    Okay...now I've got a very strange problem. The code I made works flawlessly on my PC using the Desmume emulator, however, it doesn't work on my DS at all. I use a DSTWO flashcard for the game and the very same code and save file from the emulator. I really don't know what's going on here, I never had this happening before. Are there code types that are not supported by the cheat engine the DS flashcards use?
    Last edited by MichiS97; 07-24-2015, 05:07:05 AM.

    Leave a comment:


  • dlevere
    replied
    static.patater.com/gbaguy/gbaasm.htm
    Kenobi's GameBoy Advanced ASM Tutorial

    www.coranac.com/tonc/text/asm.htm
    Whirlwind Tour of ARM Assembly

    http://www.codemasters-project.net/p...hp?content.202
    Cursor Hacking and Advanced Tracing

    Leave a comment:


  • MichiS97
    replied
    Originally posted by Pyriel View Post
    Well, I'm just talking something like:

    94000130 FCFF0000
    6XXXXXXX 00000001
    your code
    0XXXXXXX 00000001

    The only purpose for XXXXXXX is to ensure the code can be used just once. You could have another code tied to a different combination of buttons set the flag off. However, looking at what you're doing, it seems like the goal might be to run the increment only once each time the code is used (i.e. every time a new potion is added by it). That will probably require ASM.
    Yeah I was thinking to complicatedly Thanks for your advice! I've got one last question though: Can you give me the link to a good tutorial about ASM hacking on the DS? I did some basic NES stuff in the past but nothing apart from that and I'd really like to look into it

    Leave a comment:


  • Pyriel
    replied
    Well, I'm just talking something like:

    94000130 FCFF0000
    6XXXXXXX 00000001
    your code
    0XXXXXXX 00000001

    The only purpose for XXXXXXX is to ensure the code can be used just once. You could have another code tied to a different combination of buttons set the flag off. However, looking at what you're doing, it seems like the goal might be to run the increment only once each time the code is used (i.e. every time a new potion is added by it). That will probably require ASM.

    Leave a comment:


  • Demonic722
    replied
    Try something like this:
    Code:
    ::Your Code
    221BA598 00000002
    [COLOR=#008000]74000100 FF00000C[/COLOR]
    94000130 FCFF0000
    DB000000 021BA605
    D4000000 00000001
    D8000000 021BA605
    D2000000 00000000
    That line highlighted in green slows down the execution time. If that's too fast or slow, try adjusting the value.

    Note: This will not perfect the code. To ensure the code increments by exactly 1 each button press/hold, ASM is your best option.

    Leave a comment:


  • MichiS97
    replied
    Originally posted by Pyriel View Post
    Is there a section of memory that isn't used by the games, that is accessible to the AR, and is initialized on start up? That's the easiest way to handle something like this. Check an address there for not-equal <value> and then at the tail end of your code, set the address to that value.
    I tried to do that but the problem is that I don't know how to compare to offsets. Of course, there are code types which would let me check if the value of a given offset is bigger/smaller/equal/not equal to a value that is also given by me but AFAIK you can't just compare two offsets with another

    Here's the code:
    221BA598 00000002 //this gives my player a potion (that already works but the potion isn't usable since the icon for it is greyed out)
    94000130 FCFF0000 // simple button activator
    DB000000 021BA605 //loads the value at offset 0x021BA605, which determines which icons for the potions are greyed out
    D4000000 00000001 //increments the value by 1
    D8000000 021BA605 // stores the value back at its address

    Okay, so the code works flawlessly, if it wouldn't be for the fact that the value at 0x021BA605 mustn't be incremented more than once.
    Last edited by MichiS97; 07-23-2015, 09:42:18 AM.

    Leave a comment:


  • Demonic722
    replied
    Post the code so we can look at it.

    Leave a comment:

Working...
X