Set Post Effect Messages data

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
BATTLE.BIN : Set Post Effect Messages data
----------------------------------------------------------------------
Parameters : r4 - Unit Misc data pointer
Returns : Nothing

Set Message data in post effect message table (0x80096248)
-------------------------------------------------------------------------
00072d8c: 108000f3 beq r4,r0,0x0007315c     #If pointer is invalid  Exit routine
00072d90: 00000000 nop                         
00072d94: 8c830134 lw r3,0x0134(r4)         |Load Unit Battle data pointer
00072d98: 00000000 nop                      |
00072d9c: 106000ef beq r3,r0,0x0007315c     #If pointer is invalid  Exit routine
00072da0: 00000000 nop                       
00072da4: 3c028009 lui r2,0x8009            |
00072da8: 8c426244 lw r2,0x6244(r2)         |Load Current Message ID 
00072dac: 00000000 nop                      |
00072db0: 28420010 slti r2,r2,0x0010        |
00072db4: 104000e9 beq r2,r0,0x0007315c     #If Message ID is invalid (> 0x0f)  Exit routine
00072db8: 00000000 nop                          
00072dbc: 9062018c lbu r2,0x018c(r3)        |Unit current action hit flag
00072dc0: 00000000 nop                      |
00072dc4: 104000e5 beq r2,r0,0x0007315c     #If Action hit flag is OFF   Exit routine
00072dc8: 2465018c addiu r5,r3,0x018c       |r5 = Unit Current Action data pointer
00072dcc: 00003821 addu r7,r0,r0            |
00072dd0: 2ce2000b sltiu r2,r7,0x000b       |
                                            @Loop 11 Times 
00072dd4: 104000ce beq r2,r0,0x00073110         #If counter is off limit :   Exit loop
00072dd8: 00003021 addu r6,r0,r0                    |Initialize r6
00072ddc: 00071080 sll r2,r7,0x02                   |counter * 4
00072de0: 3c018006 lui r1,0x8006                    |
00072de4: 00220821 addu r1,r1,r2                    |
00072de8: 8c227548 lw r2,0x7548(r1)                 |Load Some pointer based on loop counter
00072dec: 00000000 nop                              |
00072df0: 00400008 jr r2                            >>Jump in Iteration section
00072df4: 00000000 nop                              |
---- 1st Iteration Section (Speed Change)----
00072df8: 90a20012 lbu r2,0x0012(r5)                |Load Current Action Speed change
00072dfc: 00000000 nop                              |
00072e00: 104000c3 beq r2,r0,0x00073110             |
00072e04: 34020028 ori r2,r0,0x0028                 |
00072e08: 3c038009 lui r3,0x8009                    |
00072e0c: 8c636244 lw r3,0x6244(r3)                 |
00072e10: 00000000 nop                              |
00072e14: 000318c0 sll r3,r3,0x03                   |
00072e18: 3c018009 lui r1,0x8009                    |
00072e1c: 00230821 addu r1,r1,r3                    |
00072e20: a0226248 sb r2,0x6248(r1)                 |Store 0x28 in Post Effect list
00072e24: 3c028009 lui r2,0x8009                    |
00072e28: 8c426244 lw r2,0x6244(r2)                 |
00072e2c: 90a30012 lbu r3,0x0012(r5)                |
00072e30: 0801cc40 j 0x00073100                     >>Jump to resolution 
00072e34: 34060001 ori r6,r0,0x0001                 |
---- 2nd Iteration Section (CT Change)----
00072e38: 90a20013 lbu r2,0x0013(r5)                |Load Current Action CT change
00072e3c: 00000000 nop                              |
00072e40: 104000b3 beq r2,r0,0x00073110             #If CT change is  null : go to   Next iteration
00072e44: 34020027 ori r2,r0,0x0027                 |Ct Change flag
00072e48: 3c038009 lui r3,0x8009                    |
00072e4c: 8c636244 lw r3,0x6244(r3)                 |Current Message ID
00072e50: 00000000 nop                              |
00072e54: 000318c0 sll r3,r3,0x03                   |Nb*8
00072e58: 3c018009 lui r1,0x8009                    |
00072e5c: 00230821 addu r1,r1,r3                    |Message Offset in post effect message list
00072e60: a0226248 sb r2,0x6248(r1)                 |Store 0x27 in Post Effect list
00072e64: 3c028009 lui r2,0x8009                    |
00072e68: 8c426244 lw r2,0x6244(r2)                 |Current Message ID
00072e6c: 90a30013 lbu r3,0x0013(r5)                |Load Current Action CT change (Displayed Value)
00072e70: 0801cc40 j 0x00073100                     >>Jump to resolution (message found)
00072e74: 34060001 ori r6,r0,0x0001                 |"Message is found" flag
---- 3rd Iteration Section (Brave Change)----
00072e78: 90a20016 lbu r2,0x0016(r5)                |Load Current Action Brave change
00072e7c: 00000000 nop                              |
00072e80: 104000a3 beq r2,r0,0x00073110             |
00072e84: 34020029 ori r2,r0,0x0029                 |
00072e88: 3c038009 lui r3,0x8009                    |
00072e8c: 8c636244 lw r3,0x6244(r3)                 |
00072e90: 00000000 nop                              |
00072e94: 000318c0 sll r3,r3,0x03                   |
00072e98: 3c018009 lui r1,0x8009                    |
00072e9c: 00230821 addu r1,r1,r3                    |
00072ea0: a0226248 sb r2,0x6248(r1)                 |Store 0x29 in Post Effect list
00072ea4: 3c028009 lui r2,0x8009                    |
00072ea8: 8c426244 lw r2,0x6244(r2)                 |
00072eac: 90a30016 lbu r3,0x0016(r5)                |
00072eb0: 0801cc40 j 0x00073100                     |
00072eb4: 34060001 ori r6,r0,0x0001                 |
---- 4th Iteration Section (Faith Change)----
00072eb8: 90a20017 lbu r2,0x0017(r5)                |Load Current Action Faith change
00072ebc: 00000000 nop                              |
00072ec0: 10400093 beq r2,r0,0x00073110             |
00072ec4: 3402002a ori r2,r0,0x002a                 |
00072ec8: 3c038009 lui r3,0x8009                    |
00072ecc: 8c636244 lw r3,0x6244(r3)                 |
00072ed0: 00000000 nop                              |
00072ed4: 000318c0 sll r3,r3,0x03                   |
00072ed8: 3c018009 lui r1,0x8009                    |
00072edc: 00230821 addu r1,r1,r3                    |
00072ee0: a0226248 sb r2,0x6248(r1)                 |Store 0x2a in Post Effect list
00072ee4: 3c028009 lui r2,0x8009                    |
00072ee8: 8c426244 lw r2,0x6244(r2)                 |
00072eec: 90a30017 lbu r3,0x0017(r5)                |
00072ef0: 0801cc40 j 0x00073100                     |
00072ef4: 34060001 ori r6,r0,0x0001                 |
---- 5th Iteration Section (PA Change)----
00072ef8: 90a20014 lbu r2,0x0014(r5)                |Load Current Action PA change
00072efc: 00000000 nop                              |
00072f00: 10400083 beq r2,r0,0x00073110             |
00072f04: 3402002b ori r2,r0,0x002b                 |
00072f08: 3c038009 lui r3,0x8009                    |
00072f0c: 8c636244 lw r3,0x6244(r3)                 |
00072f10: 00000000 nop                              |
00072f14: 000318c0 sll r3,r3,0x03                   |
00072f18: 3c018009 lui r1,0x8009                    |
00072f1c: 00230821 addu r1,r1,r3                    |
00072f20: a0226248 sb r2,0x6248(r1)                 |Store 0x2b in Post Effect list
00072f24: 3c028009 lui r2,0x8009                    |
00072f28: 8c426244 lw r2,0x6244(r2)                 |
00072f2c: 90a30014 lbu r3,0x0014(r5)                |
00072f30: 0801cc40 j 0x00073100                     |
00072f34: 34060001 ori r6,r0,0x0001                 |
---- 6th Iteration Section (MA Change)----
00072f38: 90a20015 lbu r2,0x0015(r5)                |Load Current Action MA change
00072f3c: 00000000 nop                              |
00072f40: 10400073 beq r2,r0,0x00073110             |
00072f44: 3402002c ori r2,r0,0x002c                 |
00072f48: 3c038009 lui r3,0x8009                    |
00072f4c: 8c636244 lw r3,0x6244(r3)                 |
00072f50: 00000000 nop                              |
00072f54: 000318c0 sll r3,r3,0x03                   |
00072f58: 3c018009 lui r1,0x8009                    |
00072f5c: 00230821 addu r1,r1,r3                    |
00072f60: a0226248 sb r2,0x6248(r1)                 |Store 0x2c in Post Effect list
00072f64: 3c028009 lui r2,0x8009                    |
00072f68: 8c426244 lw r2,0x6244(r2)                 |
00072f6c: 90a30015 lbu r3,0x0015(r5)                |
00072f70: 0801cc40 j 0x00073100                     |
00072f74: 34060001 ori r6,r0,0x0001                 |
---- 7th Iteration Section (Stolen Gils)----
00072f78: 84a2000c lh r2,0x000c(r5)                 |Load Current Action Stolen/Lost Gils
00072f7c: 00000000 nop                              |
00072f80: 18400063 blez r2,0x00073110               |
00072f84: 3402002e ori r2,r0,0x002e                 |
00072f88: 3c038009 lui r3,0x8009                    |
00072f8c: 8c636244 lw r3,0x6244(r3)                 |
00072f90: 00000000 nop                              |
00072f94: 000318c0 sll r3,r3,0x03                   |
00072f98: 3c018009 lui r1,0x8009                    |
00072f9c: 00230821 addu r1,r1,r3                    |
00072fa0: a0226248 sb r2,0x6248(r1)                 |Store 0x2e in Post Effect list
00072fa4: 3c028009 lui r2,0x8009                    |
00072fa8: 8c426244 lw r2,0x6244(r2)                 |
00072fac: 84a3000c lh r3,0x000c(r5)                 |
00072fb0: 0801cc40 j 0x00073100                     |
00072fb4: 34060001 ori r6,r0,0x0001                 |
---- 8th Iteration Section (Stolen Xp)----
00072fb8: 90a20028 lbu r2,0x0028(r5)                |Load Current Action Stolen/Lost Xp
00072fbc: 00000000 nop                              |
00072fc0: 30420080 andi r2,r2,0x0080                |
00072fc4: 10400052 beq r2,r0,0x00073110             |
00072fc8: 3402002f ori r2,r0,0x002f                 |
00072fcc: 3c038009 lui r3,0x8009                    |
00072fd0: 8c636244 lw r3,0x6244(r3)                 |
00072fd4: 00000000 nop                              |
00072fd8: 000318c0 sll r3,r3,0x03                   |
00072fdc: 3c018009 lui r1,0x8009                    |
00072fe0: 00230821 addu r1,r1,r3                    |
00072fe4: a0226248 sb r2,0x6248(r1)                 |Store 0x2f in Post Effect list
00072fe8: 3c028009 lui r2,0x8009                    |
00072fec: 8c426244 lw r2,0x6244(r2)                 |
00072ff0: 90a30028 lbu r3,0x0028(r5)                |
00072ff4: 0801cc40 j 0x00073100                     |
00072ff8: 34060001 ori r6,r0,0x0001                 |
---- 9th Iteration Section (Golem stuff)----
00072ffc: 94a20010 lhu r2,0x0010(r5)                |Current Action special flags
00073000: 00000000 nop                              |
00073004: 30420180 andi r2,r2,0x0180                |Golem flags
00073008: 10400041 beq r2,r0,0x00073110             |
0007300c: 3402002d ori r2,r0,0x002d                 |
00073010: 3c038009 lui r3,0x8009                    |
00073014: 8c636244 lw r3,0x6244(r3)                 |
00073018: 00000000 nop                              |
0007301c: 000318c0 sll r3,r3,0x03                   |
00073020: 3c018009 lui r1,0x8009                    |
00073024: 00230821 addu r1,r1,r3                    |
00073028: a0226248 sb r2,0x6248(r1)                 |Store 0x2d in Post Effect list
0007302c: 3c028009 lui r2,0x8009                    |
00073030: 8c426244 lw r2,0x6244(r2)                 |
00073034: 94a30010 lhu r3,0x0010(r5)                |
00073038: 0801cc40 j 0x00073100                     |
0007303c: 34060001 ori r6,r0,0x0001                 |
---- 10th Iteration Section (Broken stuff)----
00073040: 94a20010 lhu r2,0x0010(r5)                |Current Action special flags
00073044: 00000000 nop                              |
00073048: 30421004 andi r2,r2,0x1004                |Item or Katana breakage flags
0007304c: 10400030 beq r2,r0,0x00073110             |
00073050: 3403001d ori r3,r0,0x001d                 |
00073054: 3c028009 lui r2,0x8009                    |
00073058: 8c426244 lw r2,0x6244(r2)                 |
0007305c: 00000000 nop                              |
00073060: 000210c0 sll r2,r2,0x03                   |
00073064: 3c018009 lui r1,0x8009                    |
00073068: 00220821 addu r1,r1,r2                    |
0007306c: a0236248 sb r3,0x6248(r1)                 |Store 0x1d in Post effect list
00073070: 3c028009 lui r2,0x8009                    |
00073074: 8c426244 lw r2,0x6244(r2)                 |
00073078: 90a30003 lbu r3,0x0003(r5)                |Current action Item to remove
0007307c: 000230c0 sll r6,r2,0x03                   |
00073080: 3c018009 lui r1,0x8009                    |
00073084: 00260821 addu r1,r1,r6                    |
00073088: ac23624c sw r3,0x624c(r1)                 |Store Item in Post Effect list (0x04)
0007308c: 94a20010 lhu r2,0x0010(r5)                |
00073090: 00000000 nop                              |
00073094: 30421000 andi r2,r2,0x1000                |Katana ? 
00073098: 10400007 beq r2,r0,0x000730b8             #If Broken katana
0007309c: 00000000 nop                                  |
000730a0: 90a20003 lbu r2,0x0003(r5)                    |Item ID
000730a4: 00000000 nop                                  |
000730a8: 34428000 ori r2,r2,0x8000                     |Katana flag ?
000730ac: 3c018009 lui r1,0x8009                        |
000730b0: 00260821 addu r1,r1,r6                        |
000730b4: ac22624c sw r2,0x624c(r1)                     |Store Item ID + katana flag in Post Effect list (0x04)
000730b8: 0801cc44 j 0x00073110                     >>Jump to resolution
000730bc: 34060001 ori r6,r0,0x0001                 |
---- 11th Iteration Section (Item Stolen)----
000730c0: 94a20010 lhu r2,0x0010(r5)                |Current Action special flags
000730c4: 00000000 nop                              |
000730c8: 30420010 andi r2,r2,0x0010                |Item Stolen
000730cc: 10400010 beq r2,r0,0x00073110             |
000730d0: 3402001c ori r2,r0,0x001c                 |
000730d4: 34060001 ori r6,r0,0x0001                 |
000730d8: 3c038009 lui r3,0x8009                    |
000730dc: 8c636244 lw r3,0x6244(r3)                 |
000730e0: 00000000 nop                              |
000730e4: 000318c0 sll r3,r3,0x03                   |
000730e8: 3c018009 lui r1,0x8009                    |
000730ec: 00230821 addu r1,r1,r3                    |
000730f0: a0226248 sb r2,0x6248(r1)                 |Store 0x1c in Post effect list
000730f4: 3c028009 lui r2,0x8009                    |
000730f8: 8c426244 lw r2,0x6244(r2)                 |
000730fc: 90a30003 lbu r3,0x0003(r5)                |Stolen item ID
00073100: 000210c0 sll r2,r2,0x03                   |
00073104: 3c018009 lui r1,0x8009                    |
00073108: 00220821 addu r1,r1,r2                    |
0007310c: ac23624c sw r3,0x624c(r1)                 |

---- Resolution Section (message or not ?)----
00073110: 10c0000f beq r6,r0,0x00073150         #If r6 is not null
00073114: 24e70001 addiu r7,r7,0x0001           |Loop counter + 1
00073118: 8c830134 lw r3,0x0134(r4)                 |Unit battle data pointer
0007311c: 3c028009 lui r2,0x8009                    |
00073120: 8c426244 lw r2,0x6244(r2)                 |Current Message Nb
00073124: 9063018a lbu r3,0x018a(r3)                |Unit ID (without 0xff checks)
00073128: 000210c0 sll r2,r2,0x03                   |Unit Nb * 8
0007312c: 3c018009 lui r1,0x8009                    |
00073130: 00220821 addu r1,r1,r2                    |This unit Offset 
00073134: a0236249 sb r3,0x6249(r1)                 |Store unit ID in Post action effect list
00073138: 3c028009 lui r2,0x8009                    |
0007313c: 8c426244 lw r2,0x6244(r2)                 |Current Message ID
00073140: 00000000 nop                              |
00073144: 24420001 addiu r2,r2,0x0001               |Next free message ID
00073148: 3c018009 lui r1,0x8009                    |
0007314c: ac226244 sw r2,0x6244(r1)                 |Update Current Message ID
00073150: 28e2000b slti r2,r7,0x000b            |Check limit
00073154: 1440ff1f bne r2,r0,0x00072dd4     #Loop 11 Times
00073158: 2ce2000b sltiu r2,r7,0x000b           |Unsigned check limit (used at the start of the loop)
0007315c: 03e00008 jr r31 
00073160: 00000000 nop

Return location

BATTLE.BIN
000731ac: 00073164_-_000731d4
000731f4: 000731d8_-_0007324c