Coding Questions and other Quandaries
I have a question.
As the code stands, it rotates through the character values 0x0 -> 0x11.
The value for the Mii character is 0x13. It skips 0x12
I've been driving myself nuts trying to rewrite this:

lis r11, 0x8000 #ASM Load upper half-word of EVA address
lhz r12, 0x3b2 (r11) #ASM Load lower half-word of EVA address for interval timer.
lhz r5, 0x3b0 (r11) #ASM Load lower half-word of EVA address for character mod value cycling
addi r12, r12, 0x1 #ASM Add 0x1 to interval timer
cmpwi r12, 0x38 #ASM See if upper limit of interval timer has been reached; Adjust this for cycling speed
bne+ store_interval_timer #ASM if not reached, store the incremented value
li r12, 0x0 #ASM If it has been reached, load r12 to reset value to 0x0
addi r5, r5, 0x1 #ASM Load r5 to increment character mod value by 0x1
cmpwi r5, 0x12 #ASM See if upper limit of character mod value has been reached 0x11 (Black Mage)
blt+ store_char #ASM If not, store the incremented character mod value
li r5, 0x0 #ASM If it has been reached, load r5 to reset value to 0x0 (Mario)
store_char:
sth r5, 0x3b0 (r11) #ASM Store character mod value
store_interval_timer:
sth r12, 0x3b2 (r11) #ASM Store interval timer value
blr

How would I do this. I know this is going to be one of those "oh crap, why didn't I think of that" moments.

Thanks!!!!!!!!!!!
Reply


Messages In This Thread
RE: Coding Questions and other Quandaries - by Hackwiz - 05-06-2023, 07:07 PM

Forum Jump:


Users browsing this thread: 33 Guest(s)