Text Format String Fetching

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search

# Determines which section of text strings to load from, depending on the value of the character used here. See Text Format for more information.

0012fd20: 340200e0 ori r2,r0,0x00e0                # r2 = 0xE0: {Ramza}. 
0012fd24: 14820003 bne r4,r2,0x0012fd34            # Branch if not {Ramza}.
0012fd28: 340200e1 ori r2,r0,0x00e1                # r2 = 0xE1: {unitname}.
0012fd2c: 0804bf61 j 0x0012fd84                    # If {Ramza}, jump to end with r2 = 0x4000
0012fd30: 34024000 ori r2,r0,0x4000                # r2 = 0x4000. Roster Unit Nicknames on WORLD. Ignored on BATTLE. 
0012fd34: 14820003 bne r4,r2,0x0012fd44            # Branch if not {unitname}.
0012fd38: 340200e5 ori r2,r0,0x00e5                # r2 = {0xE5}
0012fd3c: 0804bf61 j 0x0012fd84                    # If {unitname}, jump to end with r2 = 0x4000 + r5 (variable value? specified unit's slot ID?)
0012fd40: 24a24000 addiu r2,r5,0x4000              # r2 = r5 + 0x4000: ENTD nicknames... or roster nicknames?
0012fd44: 14820003 bne r4,r2,0x0012fd54            # Branch if not {0xE5}
0012fd48: 34029000 ori r2,r0,0x9000                # r2 = 0x9000 (BATTLE: Formation/Squad/MC Text (???), WORLD: Locations - Names). 
0012fd4c: 0804bf61 j 0x0012fd84                    # If {0xE5}, jump to end with r2 = 0x9000 + r5
0012fd50: 00a21021 addu r2,r5,r2                   # r2 = 0x9000 + r5? why is this two lines?
0012fd54: 340200e9 ori r2,r0,0x00e9                # r2 = {0xE9}: Item Names
0012fd58: 14820003 bne r4,r2,0x0012fd68            # Branch if not {0xE9}
0012fd5c: 340200ea ori r2,r0,0x00ea                # r2 = {0xEA}: Ability Names
0012fd60: 0804bf61 j 0x0012fd84                    # If {0xE9}, jump to end with r2 = 0x3800 (Item Names offset) + r5.
0012fd64: 24a23800 addiu r2,r5,0x3800              # r2 = r5 + 0x3800 (Item Names)
0012fd68: 14820003 bne r4,r2,0x0012fd78            # Branch if not {0xEA}
0012fd6c: 340300eb ori r3,r0,0x00eb                # r3 = {0xEB}
0012fd70: 0804bf61 j 0x0012fd84                    # If {0xEA}, jump to end with r2 = 0x7000 (Ability Names)
0012fd74: 24a27000 addiu r2,r5,0x7000              # r2 = r5 + 0x7000 (Ability Names)
0012fd78: 10830002 beq r4,r3,0x0012fd84            # Branch to end if {0xEB} with no addition to r5
0012fd7c: 00a01021 addu r2,r5,r0                   # r2 = r5 + 0 (section manually defined in the variable, not automatically)
0012fd80: 2402ffff addiu r2,r0,0xffff              # r2 = 0xFFFF (failure) if invalid value
0012fd84: 03e00008 jr r31
0012fd88: 00000000 nop