00130718 - 001307d0

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search

00130718: 8c820018 lw r2,0x0018(r4)               # r2 = Load 0x18: counter from scratchpad?
0013071c: 00000000 nop
00130720: 18400007 blez r2,0x00130740             # Branch if zero (or less)
00130724: 24a50001 addiu r5,r5,0x0001             # Add 1 to text pointer?
00130728: 2442ffff addiu r2,r2,0xffff             # Counter --
0013072c: 14400004 bne r2,r0,0x00130740           # Branch if zero
00130730: ac820018 sw r2,0x0018(r4)               # Save new counter
00130734: 8c85001c lw r5,0x001c(r4)               # Load text pointer     
00130738: 2402ffff addiu r2,r0,0xffff             # r2 = -r1
0013073c: ac82001c sw r2,0x001c(r4)               # Save as new text pointer?
00130740: 90a60000 lbu r6,0x0000(r5)              # r6 = Load byte from text pointer
00130744: 340200f0 ori r2,r0,0x00f0               # r2 = 0xF0
00130748: 30c300f0 andi r3,r6,0x00f0              # r3 = Text byte but without lower half of byte
0013074c: 1462001f bne r3,r2,0x001307cc           # Branch if not 0xF0-0xFF
00130750: 00000000 nop
00130754: 30c2000f andi r2,r6,0x000f              # r2 = Text byte but without upper half of byte
00130758: 2c420004 sltiu r2,r2,0x0004             # r2 = 0x01 if 0xF0-0xF3 (unknown)
0013075c: 1040001b beq r2,r0,0x001307cc           # Branch to end of routine if not 0xF0-0xF3
00130760: 00000000 nop
00130764: 24a20003 addiu r2,r5,0x0003             # r2 = Text pointer + 3
00130768: ac82001c sw r2,0x001c(r4)               # Save as new text pointer?
0013076c: 90a20000 lbu r2,0x0000(r5)              # r2 = Load byte from old text pointer
00130770: 00000000 nop
00130774: 30420003 andi r2,r2,0x0003              # r2 = Check for 0x01-0x03
00130778: 000210c0 sll r2,r2,0x03                 # r2 * 2
0013077c: ac820014 sw r2,0x0014(r4)               # Save doubled value to scratch pad
00130780: 90a20001 lbu r2,0x0001(r5)              # Load next byte from old text pointer
00130784: 8c830014 lw r3,0x0014(r4)               # Load doubled value from scratch pad
00130788: 00021142 srl r2,r2,0x05                 # Look for the 0x20, 0x40, or 0x80 flags
0013078c: ac820018 sw r2,0x0018(r4)               # Save to scratch pad? yeah idk, I'm done with this part of the code now
00130790: 00431021 addu r2,r2,r3
00130794: 24420004 addiu r2,r2,0x0004
00130798: ac820018 sw r2,0x0018(r4)
0013079c: 90a20001 lbu r2,0x0001(r5)
001307a0: 00000000 nop
001307a4: 3042000f andi r2,r2,0x000f
001307a8: 000219c0 sll r3,r2,0x07
001307ac: 00621823 subu r3,r3,r2
001307b0: 00031840 sll r3,r3,0x01
001307b4: ac830014 sw r3,0x0014(r4)
001307b8: 90a20002 lbu r2,0x0002(r5)
001307bc: 00000000 nop
001307c0: 00431021 addu r2,r2,r3
001307c4: 00a22823 subu r5,r5,r2
001307c8: ac820014 sw r2,0x0014(r4)
001307cc: 03e00008 jr r31
001307d0: 00a01021 addu r2,r5,r0