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:
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.
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.