1
0
Fork 0
supSMS-MiscCode/src/ResetTRailBlockPosition.s

50 lines
923 B
ArmAsm

.include "./macros.s"
.set $btn, 0x22 # R+Right
.set btn, mPadStatus
.control:
## check button
lis r4, btn@ha
lhz r4, btn@l(r4)
cmplwi r4, $btn
bne+ .done
## resetPosition
mr r3, r30
lwz r12, 0(r3) # vt
lwz r12, 0x168(r12) # resetPosition
mtlr r12
blrl
## reset mtx
#lfs f1, 0x118(r30)
#lfs f2, 0x11c(r30)
#lfs f3, 0x120(r30)
psq_l f0, 0x118(r3), 0, gqr0
psq_st f0, 0x15C(r3), 0, gqr0
psq_st f0, 0x168(r3), 0, gqr0
lwz r0, 0x120(r3)
stw r0, 0x164(r3)
stw r0, 0x170(r3)
addi r3, r30, 0x174
li32 r12, PSMTXIdentity
mtlr r12
blrl
## set x140 flag
### r3 = graph
lwz r3, 0x138(r30)
### r4 = (cur index)*0x44 + 8
lwz r4, 0x4(r3)
mulli r4, r4, 0x44
addi r4, r4, 8
### r3 = web
lwz r3, 0(r3)
### r3 = &railnode[0]
lwz r3, 4(r3)
### r3 = node flag
lwzx r3, r3, r4
### r0 = r3&128 ? 2 : 0
rlwinm r0, r3, 32-6, 0x2
stw r0, 0x140(r30)
.done:
## orig
lwz r0, 0x1b4(r1)