1
0
Fork 0

add ResetTRailBlockPosition

This commit is contained in:
sup39 2022-11-02 21:37:04 +09:00
parent 1ee755b71b
commit 22ceb9893b
3 changed files with 70 additions and 0 deletions

View file

@ -0,0 +1,18 @@
$ Reset TRailBlock Position (v0.1, 2022/11/02) [sup39]
C21C7E48 00000010
3C808040 A0840D50
28040022 40A20068
7FC3F378 81830000
818C0168 7D8803A6
4E800021 E0030118
F003015C F0030168
80030120 90030164
90030170 387E0174
3D808009 618C42B0
7D8803A6 4E800021
807E0138 80830004
1C840044 38840008
80630000 80630004
7C63202E 5460D7BC
901E0140 800101B4
60000000 00000000

View file

@ -0,0 +1,2 @@
$$ = 0;
$C2$.control = 0x801c7e48;

View file

@ -0,0 +1,50 @@
.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)