1
0
Fork 0

add SetPlazaFlag

Set the correct BH/RH/GB unlock flag on Plaza
This commit is contained in:
sup39 2023-02-24 03:24:26 +09:00
parent e1825d1e93
commit b90e1381c5
2 changed files with 22 additions and 0 deletions

2
src/SetPlazaFlag.ld Normal file
View file

@ -0,0 +1,2 @@
$$ = 0;
$C2$.SetPlazaFlag = 0x70 + TMarDirector.setupObjects;

20
src/SetPlazaFlag.s Normal file
View file

@ -0,0 +1,20 @@
.SetPlazaFlag:
## orig
lwz r3, TFlagManager.smInstance$r13(r13)
## check plaza number
### r29 = &curArea
lbz r12, 0x1(r29)
### OR 0x2 bit from 0x8 bit
### i.e. map 0x8, 0x9 to 0x2, 0x3
rlwinm r11, r12, 32-2, 0x2
or r12, r12, r11
### 4 bit for each entry
rlwinm r12, r12, 2, 0x1C
### magic
#### @2345 6701
#### =FFF3 FF01
lis r11, 0xFFF3
ori r11, r11, 0xFF01
rlwnm r11, r11, r12, 0xF0
### set BH/RH/GB flag
stb r11, 0x70(r3)