From b90e1381c5f91a108380b446e8056ec1d36fd4ba Mon Sep 17 00:00:00 2001 From: sup39 Date: Fri, 24 Feb 2023 03:24:26 +0900 Subject: [PATCH] add SetPlazaFlag Set the correct BH/RH/GB unlock flag on Plaza --- src/SetPlazaFlag.ld | 2 ++ src/SetPlazaFlag.s | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 src/SetPlazaFlag.ld create mode 100644 src/SetPlazaFlag.s diff --git a/src/SetPlazaFlag.ld b/src/SetPlazaFlag.ld new file mode 100644 index 0000000..feb2df1 --- /dev/null +++ b/src/SetPlazaFlag.ld @@ -0,0 +1,2 @@ +$$ = 0; +$C2$.SetPlazaFlag = 0x70 + TMarDirector.setupObjects; diff --git a/src/SetPlazaFlag.s b/src/SetPlazaFlag.s new file mode 100644 index 0000000..4d686dd --- /dev/null +++ b/src/SetPlazaFlag.s @@ -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)