Copy Unit Data to Status Billboard
Jump to navigation
Jump to search
DUPLICATED : Store_units_small_in_battle_display_data 00133754: 3c048015 lui r4,0x8015 00133758: 8484d09a lh r4,-0x2f66(r4) 0013375c: 27bdffc8 addiu r29,r29,0xffc8 00133760: afbf0034 sw r31,0x0034(r29) 00133764: afb40030 sw r20,0x0030(r29) 00133768: afb3002c sw r19,0x002c(r29) 0013376c: afb20028 sw r18,0x0028(r29) 00133770: afb10024 sw r17,0x0024(r29) 00133774: 0c0602bf jal 0x00180afc get unit data pointer for unit ID at 0x8014d09a 00133778: afb00020 sw r16,0x0020(r29) 0013377c: 0040a021 addu r20,r2,r0 00133780: 3c118015 lui r17,0x8015 00133784: 2631d0a0 addiu r17,r17,0xd0a0 billboard data? 00133788: 12800005 beq r20,r0,0x001337a0 branch if no unit data 0013378c: 00000000 nop 00133790: 3c058015 lui r5,0x8015 00133794: 24a5d05c addiu r5,r5,0xd05c start of display data 00133798: 0c04cd62 jal 0x00133588 Store level,exp, HP/MP hardcoding, store CT 0013379c: 02802021 addu r4,r20,r0 001337a0: 3c048015 lui r4,0x8015 001337a4: 8484d08a lh r4,-0x2f76(r4) get unit data pointer for unit ID at 0x808014d08a 001337a8: 0c0602bf jal 0x00180afc Get Unit's Data Pointer - 0x801908cc 001337ac: 00000000 nop 001337b0: 0040a021 addu r20,r2,r0 001337b4: 1280012f beq r20,r0,0x00133c74 branch if no data 001337b8: 00000000 nop 001337bc: 3c058015 lui r5,0x8015 001337c0: 24a5d038 addiu r5,r5,0xd038 pre attack display 001337c4: 0c04cd62 jal 0x00133588 Store level,exp, HP/MP hardcoding, store CT 001337c8: 02802021 addu r4,r20,r0 r4 = battle data 001337cc: 92820003 lbu r2,0x0003(r20) load job ID 001337d0: 3c018015 lui r1,0x8015 001337d4: a422d082 sh r2,-0x2f7e(r1) store job ID 0x8014d082 001337d8: 92820024 lbu r2,0x0024(r20) load brave 001337dc: 3c018015 lui r1,0x8015 001337e0: a422d084 sh r2,-0x2f7c(r1) store brave 0x8014d084 001337e4: 92820026 lbu r2,0x0026(r20) load faith 001337e8: 3c018015 lui r1,0x8015 001337ec: a422d086 sh r2,-0x2f7a(r1) store faith 0x8014d086 001337f0: 96820008 lhu r2,0x0008(r20) load birthday + zodiac 001337f4: 00000000 nop 001337f8: 00021302 srl r2,r2,0x0c zodiac 001337fc: 3c018015 lui r1,0x8015 00133800: a422d088 sh r2,-0x2f78(r1) store zodiac 0x8014d088 00133804: 9282003a lbu r2,0x003a(r20) load move 00133808: 00000000 nop 0013380c: a6220000 sh r2,0x0000(r17) store move to billboard 00133810: 92820038 lbu r2,0x0038(r20) load speed 00133814: 3c018015 lui r1,0x8015 00133818: a422d0a2 sh r2,-0x2f5e(r1) store speed 0x8014d0a2 (this is on the fucking billboard -) 0013381c: 9282003b lbu r2,0x003b(r20) load jump 00133820: 3c018015 lui r1,0x8015 00133824: a422d0a4 sh r2,-0x2f5c(r1) store jump 0x8014d0a4 (oh whatever. have fun or something.) 00133828: 9282003e lbu r2,0x003e(r20) load weapon evade 1 0013382c: 3c018015 lui r1,0x8015 00133830: a422d0aa sh r2,-0x2f56(r1) store W1-ev% 0x8014d0aa 00133834: 9282003f lbu r2,0x003f(r20) load weapon evade 2 00133838: 3c018015 lui r1,0x8015 0013383c: a422d0ac sh r2,-0x2f54(r1) store W2-ev% 0x8014d0ac 00133840: 9282003c lbu r2,0x003c(r20) load WP 1 00133844: 3c018015 lui r1,0x8015 00133848: a422d0a6 sh r2,-0x2f5a(r1) store WP 1 0x8014d0a6 0013384c: 9282003d lbu r2,0x003d(r20) load WP 2 00133850: 3c018015 lui r1,0x8015 00133854: a422d0a8 sh r2,-0x2f58(r1) store WP 2 0x8014d0a8 00133858: 92820036 lbu r2,0x0036(r20) load PA 0013385c: 3c018015 lui r1,0x8015 00133860: a422d0b2 sh r2,-0x2f4e(r1) store PA 0x8014d0b2 00133864: 92820043 lbu r2,0x0043(r20) load c-ev% 00133868: 3c018015 lui r1,0x8015 0013386c: a422d0b4 sh r2,-0x2f4c(r1) store c-ev% 0x8014d0b4 00133870: 92820041 lbu r2,0x0041(r20) load right shield P-ev% 00133874: 3c018015 lui r1,0x8015 00133878: a422d0b6 sh r2,-0x2f4a(r1) store PS-ev% 0x8014d0b6 0013387c: 92830041 lbu r3,0x0041(r20) load RHP S-ev% again 00133880: 92820042 lbu r2,0x0042(r20) load LHP S-ev% 00133884: 00000000 nop 00133888: 0043102b sltu r2,r2,r3 is it that hard to compare numbers and adapt accordingly? you gotta save em first and reload them? 0013388c: 14400004 bne r2,r0,0x001338a0 branch if left have shield has less ev% 00133890: 00000000 nop 00133894: 92820042 lbu r2,0x0042(r20) load LHP S-ev% 00133898: 3c018015 lui r1,0x8015 0013389c: a422d0b6 sh r2,-0x2f4a(r1) store PS-ev% 0x8014d0b6 001338a0: 92820040 lbu r2,0x0040(r20) load A-ev% 001338a4: 3c018015 lui r1,0x8015 001338a8: a422d0b8 sh r2,-0x2f48(r1) store A-ev% 0x8014d0b8 001338ac: 92820037 lbu r2,0x0037(r20) load MA 001338b0: 3c018015 lui r1,0x8015 001338b4: a420d0be sh r0,-0x2f42(r1) store 0 magic c-ev% 0x8014d0be 001338b8: 3c018015 lui r1,0x8015 001338bc: a422d0bc sh r2,-0x2f44(r1) store MA 0x8014d0bc 001338c0: 92820045 lbu r2,0x0045(r20) do magic ev% with shields as messily as before. I'm not notating that. 001338c4: 3c018015 lui r1,0x8015 001338c8: a422d0c0 sh r2,-0x2f40(r1) 001338cc: 92830045 lbu r3,0x0045(r20) 001338d0: 92820046 lbu r2,0x0046(r20) 001338d4: 00000000 nop 001338d8: 0043102b sltu r2,r2,r3 001338dc: 14400004 bne r2,r0,0x001338f0 001338e0: 34040004 ori r4,r0,0x0004 r4 = 4 001338e4: 92820046 lbu r2,0x0046(r20) 001338e8: 3c018015 lui r1,0x8015 001338ec: a422d0c0 sh r2,-0x2f40(r1) 001338f0: 92820044 lbu r2,0x0044(r20) load accessory M-ev% 001338f4: 26230008 addiu r3,r17,0x0008 billboard + 8 001338f8: 3c018015 lui r1,0x8015 001338fc: a422d0c2 sh r2,-0x2f3e(r1) store AM-ev% 0x8014d0c2 00133900: a4600024 sh r0,0x0024(r3) store 0 (why...?) 00133904: 2484ffff addiu r4,r4,0xffff - 1 00133908: 0481fffd bgez r4,0x00133900 do above 4 times? (clear WP 1, WP 2, Jump, Speed, move) 0013390c: 2463fffe addiu r3,r3,0xfffe r3 - 2 00133910: 92820006 lbu r2,0x0006(r20) load gender 00133914: 00000000 nop 00133918: 30420020 andi r2,r2,0x0020 check for monster 0013391c: 1440001e bne r2,r0,0x00133998 branch if not human (monsters cannot wear things.) 00133920: 340200ff ori r2,r0,0x00ff 00133924: 9283001d lbu r3,0x001d(r20) load right hand weapon 00133928: 00000000 nop 0013392c: 10620004 beq r3,r2,0x00133940 branch if right hand weapon is actually shield 00133930: 00000000 nop 00133934: 9282001d lbu r2,0x001d(r20) load RH weapon 00133938: 0804ce53 j 0x0013394c 0013393c: a6220024 sh r2,0x0024(r17) store as RH equip 00133940: 9282001e lbu r2,0x001e(r20) load right hand shield 00133944: 00000000 nop 00133948: a6220024 sh r2,0x0024(r17) save right hand shield as RH equip 0013394c: 9283001f lbu r3,0x001f(r20) load LH weapon 00133950: 340200ff ori r2,r0,0x00ff 00133954: 10620004 beq r3,r2,0x00133968 branch if left hand weapon is actually shield 00133958: 00000000 nop 0013395c: 9282001f lbu r2,0x001f(r20) load LH weapon (so. fucking. redundant. this whole routine. it's like 3 times too long for what it does.) 00133960: 0804ce5d j 0x00133974 00133964: a6220026 sh r2,0x0026(r17) store LH weapon 00133968: 92820020 lbu r2,0x0020(r20) load LH shield 0013396c: 00000000 nop 00133970: a6220026 sh r2,0x0026(r17) store LH shield 00133974: 9282001a lbu r2,0x001a(r20) load helmet 00133978: 00000000 nop 0013397c: a6220028 sh r2,0x0028(r17) store helmet 00133980: 9282001b lbu r2,0x001b(r20) load chest 00133984: 00000000 nop 00133988: a622002a sh r2,0x002a(r17) store chest 0013398c: 9282001c lbu r2,0x001c(r20) load accessory 00133990: 00000000 nop 00133994: a622002c sh r2,0x002c(r17) store accessory 00133998: 00002021 addu r4,r0,r0 Here if monster: 0013399c: 340600ff ori r6,r0,0x00ff 001339a0: 2405ffff addiu r5,r0,0xffff 001339a4: 02201821 addu r3,r17,r0 r3 = billboard 001339a8: 84620024 lh r2,0x0024(r3) load equip 001339ac: 00000000 nop 001339b0: 10400003 beq r2,r0,0x001339c0 branch if null 001339b4: 00000000 nop 001339b8: 14460002 bne r2,r6,0x001339c4 branch if invalid 001339bc: 00000000 nop 001339c0: a4650024 sh r5,0x0024(r3) store invalid weapon 001339c4: 24840001 addiu r4,r4,0x0001 loop 1 001339c8: 28820005 slti r2,r4,0x0005 001339cc: 1440fff6 bne r2,r0,0x001339a8 loop 5 times 001339d0: 24630002 addiu r3,r3,0x0002 001339d4: a620000e sh r0,0x000e(r17) blank primary skillset 001339d8: 92820012 lbu r2,0x0012(r20) load primary skillset 001339dc: 00000000 nop 001339e0: 24420050 addiu r2,r2,0x0050 skillset + 0x50 001339e4: 304200ff andi r2,r2,0x00ff monster skillset, skillset - 0xB0. otherwise + 0x50 001339e8: 2c420030 sltiu r2,r2,0x0030 true if skillset is monster 001339ec: 10400002 beq r2,r0,0x001339f8 branch if skillset isn't a total error for some reason 001339f0: 34020001 ori r2,r0,0x0001 r2 = 1 001339f4: a622000e sh r2,0x000e(r17) if skillset is erroneous, set primary skillset = attack 001339f8: 8622000e lh r2,0x000e(r17) load primary skillset 001339fc: 00000000 nop 00133a00: 10400030 beq r2,r0,0x00133ac4 branch if skillset = 0 (human skillset) 00133a04: 00000000 nop if monster skillset: 00133a08: 92840012 lbu r4,0x0012(r20) load primary skillset 00133a0c: 0c01698e jal 0x0005a638 Store Skillset's Abilities 00133a10: 34050001 ori r5,r0,0x0001 check = ability (not RSM.) 00133a14: 00402821 addu r5,r2,r0 r5 = temporary ability list pointer 00133a18: 00002021 addu r4,r0,r0 r4 = 0 00133a1c: 02201821 addu r3,r17,r0 r3 = billboard 00133a20: 94a20000 lhu r2,0x0000(r5) load first ability ID 00133a24: 24a50002 addiu r5,r5,0x0002 increase ability pointer by 1 00133a28: 24840001 addiu r4,r4,0x0001 increase counter by 1 00133a2c: a462002e sh r2,0x002e(r3) store ability to copy of primary/secondary/R/S/M list on billboard (for monsters?) 00133a30: 28820005 slti r2,r4,0x0005 repeat 4 times 00133a34: 1440fffa bne r2,r0,0x00133a20 branch if not done yet 00133a38: 24630002 addiu r3,r3,0x0002 increase billboard count by 2 00133a3c: 3c028018 lui r2,0x8018 00133a40: 24422430 addiu r2,r2,0x2430 call routine 0x00182430 Monster Skill check prep 00133a44: 3c018017 lui r1,0x8017 00133a48: ac223ca8 sw r2,0x3ca8(r1) store thread 00133a4c: 0c0533ad jal 0x0014ceb4 perform monster skill check prep, but be dumb about it 00133a50: 02802021 addu r4,r20,r0 r4 = unit data pointer 00133a54: 14400002 bne r2,r0,0x00133a60 branch if beast master nearby? 00133a58: 00002021 addu r4,r0,r0 00133a5c: a6200034 sh r0,0x0034(r17) store no 4th monster ability 00133a60: 00008021 addu r16,r0,r0 00133a64: 02203021 addu r6,r17,r0 r6 = billboard 00133a68: 02202821 addu r5,r17,r0 r5 = also billboard 00133a6c: 84c2002e lh r2,0x002e(r6) load first monster ability 00133a70: 00000000 nop 00133a74: 10400004 beq r2,r0,0x00133a88 branch if null/attack 00133a78: 00401821 addu r3,r2,r0 r3 = ability ID 00133a7c: a4a3002e sh r3,0x002e(r5) store to billboard 00133a80: 24a50002 addiu r5,r5,0x0002 billboard + 2 00133a84: 24840001 addiu r4,r4,0x0001 error check counter? pointless? 00133a88: 26100001 addiu r16,r16,0x0001 counter + 1 00133a8c: 2a020005 slti r2,r16,0x0005 set if less than 5 00133a90: 1440fff6 bne r2,r0,0x00133a6c loop 4 times 00133a94: 24c60002 addiu r6,r6,0x0002 r6 + 2 00133a98: 28820005 slti r2,r4,0x0005 set if total number of abilities was less than 5 00133a9c: 10400020 beq r2,r0,0x00133b20 branch if 5 or more loops (not... possible?) 00133aa0: 00041040 sll r2,r4,0x01 if < 5 loops: r2 = counter * 2 00133aa4: 00511821 addu r3,r2,r17 billboard + final saved ability ID * 2 00133aa8: a460002e sh r0,0x002e(r3) store 0 in last looped ability ID slot 00133aac: 24840001 addiu r4,r4,0x0001 r4 + 1 00133ab0: 28820005 slti r2,r4,0x0005 set if less than 5 00133ab4: 1440fffc bne r2,r0,0x00133aa8 loop if so? (clear remaining monster abilities) 00133ab8: 24630002 addiu r3,r3,0x0002 00133abc: 0804cec9 j 0x00133b24 00133ac0: 00002021 addu r4,r0,r0 r4 = 0 00133ac4: 92820012 lbu r2,0x0012(r20) here if human skillset: 00133ac8: 00000000 nop 00133acc: 14400004 bne r2,r0,0x00133ae0 branch if primary skillset != 0 00133ad0: a622002e sh r2,0x002e(r17) store primary skillset 00133ad4: 340200fe ori r2,r0,0x00fe r2 = fe 00133ad8: 3c018015 lui r1,0x8015 00133adc: a022d120 sb r2,-0x2ee0(r1) store fe skillset 0x8014d120 if primary skillset is null 00133ae0: 92820013 lbu r2,0x0013(r20) load secondary skillset 00133ae4: 00000000 nop 00133ae8: 14400004 bne r2,r0,0x00133afc branch if secondary skillset 00133aec: a6220030 sh r2,0x0030(r17) 00133af0: 340200fe ori r2,r0,0x00fe 00133af4: 3c018015 lui r1,0x8015 00133af8: a022d135 sb r2,-0x2ecb(r1) store fe skillset if secondary is null 00133afc: 96820014 lhu r2,0x0014(r20) load reaction 00133b00: 00000000 nop 00133b04: a6220032 sh r2,0x0032(r17) store reaction 00133b08: 96820016 lhu r2,0x0016(r20) load support 00133b0c: 00000000 nop 00133b10: a6220034 sh r2,0x0034(r17) store support 00133b14: 96820018 lhu r2,0x0018(r20) load movement 00133b18: 00000000 nop 00133b1c: a6220036 sh r2,0x0036(r17) store movement 00133b20: 00002021 addu r4,r0,r0 r4 = 0 00133b24: 02202821 addu r5,r17,r0 here if monster skills are sorted out 00133b28: 84a2002e lh r2,0x002e(r5) load primary/secondary/R/S/M 00133b2c: 00000000 nop 00133b30: 14400003 bne r2,r0,0x00133b40 branch if not 0 00133b34: 00401821 addu r3,r2,r0 00133b38: 2462ffff addiu r2,r3,0xffff 00133b3c: a4a2002e sh r2,0x002e(r5) store 0xffff skillset in billboard if 0 00133b40: 24840001 addiu r4,r4,0x0001 r4 + 1 00133b44: 28820005 slti r2,r4,0x0005 00133b48: 1440fff7 bne r2,r0,0x00133b28 loop 4 times 00133b4c: 24a50002 addiu r5,r5,0x0002 billboard + 2 00133b50: 00008021 addu r16,r0,r0 r16 = 0 00133b54: 86230024 lh r3,0x0024(r17) load right hand equip 00133b58: 2402ffff addiu r2,r0,0xffff 00133b5c: 10620008 beq r3,r2,0x00133b80 branch if RH weapon null 00133b60: a6200010 sh r0,0x0010(r17) store 0 ? 00133b64: 86220026 lh r2,0x0026(r17) load LH equip 00133b68: 00000000 nop 00133b6c: 00021027 nor r2,r0,r2 negate 00133b70: 2c420001 sltiu r2,r2,0x0001 set if equip is less than shield 00133b74: 00021023 subu r2,r0,r2 negate the negation. genius. 00133b78: 0804cee5 j 0x00133b94 00133b7c: 00628024 and r16,r3,r2 r16 = bit ANDed both equips? (0 if either is 0?) 00133b80: 86220026 lh r2,0x0026(r17) load LH equip 00133b84: 00000000 nop 00133b88: 10430002 beq r2,r3,0x00133b94 branch if LH equip is null 00133b8c: 00000000 nop 00133b90: 00408021 addu r16,r2,r0 r16 = LH equip (0 if 0) 00133b94: 12000017 beq r16,r0,0x00133bf4 branch if either equip is 0 00133b98: 00000000 nop 00133b9c: 0c016a21 jal 0x0005a884 Get Item Data Pointer 00133ba0: 02002021 addu r4,r16,r0 r4 = Item ID of both equips ANDed? 00133ba4: 90420003 lbu r2,0x0003(r2) load item type 00133ba8: 00000000 nop 00133bac: 30420080 andi r2,r2,0x0080 weapon? 00133bb0: 10400010 beq r2,r0,0x00133bf4 branch if not weapon 00133bb4: 001010c0 sll r2,r16,0x03 ID * 8 00133bb8: 3c018006 lui r1,0x8006 00133bbc: 00220821 addu r1,r1,r2 00133bc0: 90233ab9 lbu r3,0x3ab9(r1) attack flags 00133bc4: 00000000 nop 00133bc8: 30620001 andi r2,r3,0x0001 forced 2 hands 00133bcc: 14400008 bne r2,r0,0x00133bf0 branch if forced 2 hands 00133bd0: 34020001 ori r2,r0,0x0001 :/ 00133bd4: 92820091 lbu r2,0x0091(r20) load supports 3 00133bd8: 00000000 nop 00133bdc: 30420002 andi r2,r2,0x0002 2 hands check 00133be0: 10400004 beq r2,r0,0x00133bf4 branch if not 2 hands available 00133be4: 30620004 andi r2,r3,0x0004 can be 2 handsed? 00133be8: 10400002 beq r2,r0,0x00133bf4 branch if cannot 00133bec: 34020001 ori r2,r0,0x0001 r2 = 1 00133bf0: a6220010 sh r2,0x0010(r17) store 2 hands check 00133bf4: 3c108015 lui r16,0x8015 if either weapon is 0? 00133bf8: 2610d148 addiu r16,r16,0xd148 unit name 00133bfc: 0c04cd5a jal 0x00133568 lmao, I dunno, read it yourself 00133478 - 00133c14 00133c00: 02002021 addu r4,r16,r0 takes the unit's name as an input though :) 00133c04: 3c118015 lui r17,0x8015 00133c08: 2631d15c addiu r17,r17,0xd15c job name initialising? 00133c0c: 0c04cd5a jal 0x00133568 00133c10: 02202021 addu r4,r17,r0 00133c14: 3c128015 lui r18,0x8015 00133c18: 2652d120 addiu r18,r18,0xd120 primary skillset initialisation? 00133c1c: 0c04cd5a jal 0x00133568 00133c20: 02402021 addu r4,r18,r0 00133c24: 3c138015 lui r19,0x8015 00133c28: 2673d134 addiu r19,r19,0xd134 secondary skillset initialisation? 00133c2c: 0c04cd5a jal 0x00133568 00133c30: 02602021 addu r4,r19,r0 00133c34: 02002021 addu r4,r16,r0 r4 = unit name pointer 00133c38: 2685012c addiu r5,r20,0x012c r5 points to unit name in battle data 00133c3c: 0c052fd5 jal 0x0014bf54 copy r5 to r4 00133c40: 34060010 ori r6,r0,0x0010 r6 = 16 characters 00133c44: 02202021 addu r4,r17,r0 00133c48: 2685013c addiu r5,r20,0x013c r5 = unit job name 00133c4c: 0c052fd5 jal 0x0014bf54 00133c50: 34060010 ori r6,r0,0x0010 00133c54: 02402021 addu r4,r18,r0 00133c58: 2685014c addiu r5,r20,0x014c r5 = primary skillset name 00133c5c: 0c052fd5 jal 0x0014bf54 00133c60: 34060010 ori r6,r0,0x0010 r6 = 0x10 (even though only 8 bytes are read from here...?) 00133c64: 02602021 addu r4,r19,r0 00133c68: 26850154 addiu r5,r20,0x0154 r5 = secondary skillset 00133c6c: 0c052fd5 jal 0x0014bf54 00133c70: 34060010 ori r6,r0,0x0010 r6 = 0x10 (same oddity as above?) 00133c74: 8fbf0034 lw r31,0x0034(r29) 00133c78: 8fb40030 lw r20,0x0030(r29) 00133c7c: 8fb3002c lw r19,0x002c(r29) 00133c80: 8fb20028 lw r18,0x0028(r29) 00133c84: 8fb10024 lw r17,0x0024(r29) 00133c88: 8fb00020 lw r16,0x0020(r29) 00133c8c: 27bd0038 addiu r29,r29,0x0038 00133c90: 03e00008 jr r31 00133c94: 00000000 nop