R4CCE - 8-Bit load 'stored' from address

Discussion in 'NDS - Console and Game Discussions' started by Zerahn, Feb 3, 2013.

Feb 3, 2013
  1. Zerahn
    OP

    Newcomer Zerahn Newbie

    Joined:
    Feb 3, 2013
    Messages:
    3
    Country:
    Canada
    Hi! I'm attempting to create a code for Harvest Moon: Sunshine Islands (US) that allows the player to cycle through weather effects for the current day using Select+Up, rather than using 8 different button combinations, one for each weather effect. The code I have so far is this:

    Code:
    94000130 FFBB0000 (activate when Select+Up is pressed)
    DB000000 020DBE54 (load current weather state from 20DBE54 - the problem line)
    D4000000 00000001 (add 1 to 'stored')
    D8000000 020DBE54 (write 'stored' back into 20DBE54)
    920DBE54 00000008 (if current weather = 8, which is not a valid weather type)
    220DBE54 00000000 (loop it back to 0)
    D2000000 00000000 (and end the code block, resetting 'stored' and 'offset')
    As mentioned, the second line is the problem line, as it seems to immediately halt execution of the code. If I omit this and and change the D4 line to D4000000 00000005 it changes the weather to snowing, which is exactly what it should do assuming 'stored' starts out as 0. I'm guessing either the '8-bit load stored from memory location' instruction doesn't work at all, or the wrong code (DB?????? xxxxxxxx) was given in the sheet. Does anyone know how to fix this?

    Edit:
    Using a 16-bit load (DA?????? xxxxxxxx) instead of the 8-bit load (DB?????? xxxxxxxx) seems to work. Ignore the broken if-condition to loop back to sunny, it isn't working but I can deal with that.
     
  2. Zerahn
    OP

    Newcomer Zerahn Newbie

    Joined:
    Feb 3, 2013
    Messages:
    3
    Country:
    Canada
    [accidental double-post on an edit]
     
  3. Prof. 9

    Member Prof. 9 GBAtemp Fan

    Joined:
    Jun 17, 2008
    Messages:
    316
    Location:
    The Netherlands
    Country:
    Netherlands
    Code type DB used to be a bugged code type. Nowadays it should be fixed on most cheat devices. It's possible you used one that doesn't have the fix. Generally if you can use 16-bit load and store you might as well use those.

    You will also want to add a D3000000 00000000 line after the D8 line to reset the offset increment and do the loop. Code type 9 should not be affected by the offset register unless its address is 0 (though third-party implementations may vary) but code type 2 WILL be.
     
  4. Zerahn
    OP

    Newcomer Zerahn Newbie

    Joined:
    Feb 3, 2013
    Messages:
    3
    Country:
    Canada
    Ah, thank you for the D3 suggestion. I forgot about the auto-increment thing, blah. And it's good to know I wasn't just using the DB thing wrong, my flash card is about a year old. Probably needs the firmware updated or something but it's too much effort right now. x.x
     

Share This Page