00083cd4 - 00083e0c
Jump to navigation
Jump to search
00083cd4: 27bdffe8 addiu r29,r29,0xffe8 00083cd8: 00803021 addu r6,r4,r0 #Unit's Misc Unit ID 00083cdc: 00042400 sll r4,r4,0x10 00083ce0: 00042403 sra r4,r4,0x10 00083ce4: 28820010 slti r2,r4,0x0010 #set if unit's ID is less than 16 (no more than 16 units per fight?) 00083ce8: 10400036 beq r2,r0,0x00083dc4 #if ID is 0 (force initialise) 00083cec: afbf0010 sw r31,0x0010(r29) 00083cf0: 00002821 addu r5,r0,r0 #Battle unit counter 00083cf4: 00001821 addu r3,r0,r0 #Misc unit data counter 00083cf8: 3c01800b lui r1,0x800b #While No. units initialised < No. units in battle: 00083cfc: 00230821 addu r1,r1,r3 00083d00: 8c227304 lw r2,0x7304(r1) #previous unit's Initialization byte 00083d04: 00000000 nop 00083d08: 10400007 beq r2,r0,0x00083d28 #branch to E if 0 (not to be initialized?) 00083d0c: 00000000 nop 00083d10: 3c01800b lui r1,0x800b 00083d14: 00230821 addu r1,r1,r3 00083d18: 9022730c lbu r2,0x730c(r1) #load unit's misc ID 00083d1c: 00000000 nop 00083d20: 10440006 beq r2,r4,0x00083d3c #if current misc ID <> unit's misc ID (else, branch) // is the r4 input actually the number of units in the battle? 00083d24: 28a20010 slti r2,r5,0x0010 #true if misc unit ID counter < 16 00083d28: 24a50001 addiu r5,r5,0x0001 #E add 1 to the unit counter 00083d2c: 28a20010 slti r2,r5,0x0010 00083d30: 1440fff1 bne r2,r0,0x00083cf8 #Loop 00083d34: 24630440 addiu r3,r3,0x0440 #add 0x0440 to pointer counter 00083d38: 28a20010 slti r2,r5,0x0010 00083d3c: 14400030 bne r2,r0,0x00083e00 #if misc unit ID > 16 (else end) 00083d40: 00001021 addu r2,r0,r0 00083d44: 00061400 sll r2,r6,0x10 # 00083d48: 00021403 sra r2,r2,0x10 # 00083d4c: 00021900 sll r3,r2,0x04 00083d50: 00621821 addu r3,r3,r2 00083d54: 00032180 sll r4,r3,0x06 #Unit ID * 440 00083d58: 3c01800b lui r1,0x800b 00083d5c: 00240821 addu r1,r1,r4 00083d60: 8c227304 lw r2,0x7304(r1) #load previous unit's initialization byte? 00083d64: 00000000 nop 00083d68: 14400025 bne r2,r0,0x00083e00 #if unit 15's initialization byte is do not initialise (else End) 00083d6c: 00001021 addu r2,r0,r0 00083d70: 3c02800b lui r2,0x800b 00083d74: 24427308 addiu r2,r2,0x7308 #r2 = Misc unit data pointer 00083d78: 34030001 ori r3,r0,0x0001 00083d7c: 3c01800b lui r1,0x800b 00083d80: 00240821 addu r1,r1,r4 00083d84: ac237304 sw r3,0x7304(r1) #save enforced initialization to previous unit ID 00083d88: 3c01800b lui r1,0x800b 00083d8c: 00240821 addu r1,r1,r4 00083d90: a026730c sb r6,0x730c(r1) #Store Unit's ID 00083d94: 08020f80 j 0x00083e00 00083d98: 00821021 addu r2,r4,r2 #r2 = Unit's Misc data pointer // End 00083d9c: 3c02800b lui r2,0x800b 00083da0: 24427308 addiu r2,r2,0x7308 #unit misc data pointer 00083da4: 3c01800b lui r1,0x800b 00083da8: 00240821 addu r1,r1,r4 00083dac: ac237304 sw r3,0x7304(r1) #initialise previous unit 00083db0: 3c01800b lui r1,0x800b 00083db4: 00240821 addu r1,r1,r4 00083db8: a025730c sb r5,0x730c(r1) #save unit ID 00083dbc: 08020f80 j 0x00083e00 00083dc0: 00821021 addu r2,r4,r2 #r2 = Unit misc data pointer // End 00083dc4: 00002821 addu r5,r0,r0 #Unit counter = 5 00083dc8: 00002021 addu r4,r0,r0 #misc data pointer counter 00083dcc: 3c01800b lui r1,0x800b #E #While Unit Misc ID < 16 00083dd0: 00240821 addu r1,r1,r4 00083dd4: 8c227304 lw r2,0x7304(r1) #load unit previous unit's initialization byte 00083dd8: 00000000 nop 00083ddc: 1040ffef beq r2,r0,0x00083d9c #if initialize previous unit (else, branch backward) 00083de0: 34030001 ori r3,r0,0x0001 #r3 = 1 00083de4: 24a50001 addiu r5,r5,0x0001 #increase unit counter 00083de8: 28a20010 slti r2,r5,0x0010 #set if less than 16 00083dec: 1440fff7 bne r2,r0,0x00083dcc #loop #E 00083df0: 24840440 addiu r4,r4,0x0440 #increment misc data pointer counter 0x440 00083df4: 0c011282 jal 0x00044a08 #move 0x6 to r5 00044a08 - 00044a30 // also clears 0x8004c6c4. if unit is 16 or greater? 00083df8: 34040006 ori r4,r0,0x0006 00083dfc: 00001021 addu r2,r0,r0 #in the result of an error, no unit misc pointer. 00083e00: 8fbf0010 lw r31,0x0010(r29) 00083e04: 27bd0018 addiu r29,r29,0x0018 00083e08: 03e00008 jr r31 00083e0c: 00000000 nop