Coding Questions and other Quandaries
Link's Crossbow Training - Wii (USA)

Fully automatic exploding grenades:

(Goal) Write 0x0 to button press/release address. The exploding arrows are only fired when you release the button. For this code I'm using 0x80322010 as an example.
Don't have the exact address handy right now.

lis r11, 0x8000 #ASM this is setting up a 0x0 -> 0xF rotation at 0x800003C0
lhz r12, 0x3c0 (r11)
addi r12, r12, 0x1
cmpwi r12, 0xf #ASM this value will set up the speed of the 0x0 writes to 0x80322010 in the next C0 code; lower the value, the faster the writes
bne+ update_it
li r12, 0x0
update_it:
sth r12, 0x3c0 (r11)
blr

Here is the button compare and write portion:

lis r11, 0x802e #ASM setting up the button conditional
ori r11, r11, 0xe000
lhz r12, 0x43e (r11)
andi. r12, r12, 0x4400 #ASM checks to see if B and C buttons are being pressed
beqlr #ASM if not end C0
lis r11, 8000 #ASM load EVA rotation value for compare
lhz r12, 0x3c0 (r11)
cmpwi r12, 0xf
bnelr+ #ASM end C0 if EVA rotation value not 0xF
li r3, 0x0 #ASM load 0x0 to write to button press/release address 0x80322010
lis r4, 0x8032
sth r3, 0x201a (r4) #ASM store 0x0 to button press/release address 0x80322010, signaling the game that button has been released
blr #ASM let's blow this joint
Reply


Messages In This Thread
RE: Coding Questions and other Quandaries - by Hackwiz - 04-20-2022, 01:44 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)