Find Text Entry (WORLD.BIN)
Revision as of 01:37, 18 May 2018 by Glain (talk | contribs) (Created page with " # ROUTINE: FIND TEXT ENTRY (WORLD.BIN) # This is the WORLD.BIN version of the Prep for Loading Text routine in BATTLE.BIN. # Parameters: # r4 =...")
# ROUTINE: FIND TEXT ENTRY (WORLD.BIN) # This is the WORLD.BIN version of the Prep for Loading Text routine in BATTLE.BIN. # Parameters: # r4 = (combinedTextIndex) for lookup # 16-bit value: # (Upper 5 bits): Text Section # (Lower 11 bits): Inner text index within Section # Returns # r2 = Text character pointer for appropriate entry 800e6edc: 27bdffe8 addiu r29,r29,-0x0018 800e6ee0: 00802821 addu r5,r4,r0 # p1 800e6ee4: 30a2f800 andi r2,r5,0xf800 # p1 & 0xf800 800e6ee8: 00021242 srl r2,r2,0x09 # textSectionOffset = (p1 & 0xf800) >> 9 // (textSection * 4) 800e6eec: afbf0010 sw r31,0x0010(r29) 800e6ef0: 3c01801d lui r1,0x801d 800e6ef4: 00220821 addu r1,r1,r2 800e6ef8: 8c24d8a4 lw r4,-0x275c(r1) # *(0x801cd8a4 + textSectionOffset) 800e6efc: 0c0400d2 jal 0x80100348 # return Get Inner Text (WORLD.BIN) (*(0x801cd8a4 + textSectionOffset), combinedTextIndex & 0x7ff); // Second parameter is Inner text index 800e6f00: 30a507ff andi r5,r5,0x07ff 800e6f04: 8fbf0010 lw r31,0x0010(r29) 800e6f08: 27bd0018 addiu r29,r29,0x0018 800e6f0c: 03e00008 jr r31 800e6f10: 00000000 nop