Difference between revisions of "Load party data into Formation screen data"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
m
m
 
Line 1: Line 1:
 
Load party data into Formation screen data
 
 
  00120bb0: 27bdffd8 addiu r29,r29,0xffd8
 
  00120bb0: 27bdffd8 addiu r29,r29,0xffd8
 
  00120bb4: afb1001c sw r17,0x001c(r29)
 
  00120bb4: afb1001c sw r17,0x001c(r29)

Latest revision as of 02:51, 29 September 2024

00120bb0: 27bdffd8 addiu r29,r29,0xffd8
00120bb4: afb1001c sw r17,0x001c(r29)
00120bb8: 00808821 addu r17,r4,r0			stack address
00120bbc: afb00018 sw r16,0x0018(r29)
00120bc0: 00a08021 addu r16,r5,r0			Formation screen address
00120bc4: afb20020 sw r18,0x0020(r29)
00120bc8: 00c09021 addu r18,r6,r0			party data address
00120bcc: 02002021 addu r4,r16,r0
00120bd0: 00002821 addu r5,r0,r0
00120bd4: afbf0024 sw r31,0x0024(r29)
00120bd8: 0c0088bf jal 0x000222fc			clear first 0x128 bytes in formation screen data
00120bdc: 34060128 ori r6,r0,0x0128
00120be0: 92420016 lbu r2,0x0016(r18)		load level
00120be4: 00000000 nop
00120be8: 2c420064 sltiu r2,r2,0x0064		cap at 99
00120bec: 10400002 beq r2,r0,0x00120bf8
00120bf0: 34030063 ori r3,r0,0x0063
00120bf4: 92430016 lbu r3,0x0016(r18)		load level
00120bf8: 00000000 nop
00120bfc: a6030000 sh r3,0x0000(r16)		store level
00120c00: 92220002 lbu r2,0x0002(r17)		load ??
00120c04: 00000000 nop
00120c08: 2c420010 sltiu r2,r2,0x0010
00120c0c: 14400003 bne r2,r0,0x00120c1c		??
00120c10: 34030063 ori r3,r0,0x0063
00120c14: 34020002 ori r2,r0,0x0002
00120c18: a6020002 sh r2,0x0002(r16)		store 0x02 in formation screen
00120c1c: 92420015 lbu r2,0x0015(r18)		load experience
00120c20: 00000000 nop
00120c24: 2c420064 sltiu r2,r2,0x0064
00120c28: 10400002 beq r2,r0,0x00120c34		cap at 99
00120c2c: 00000000 nop
00120c30: 92430015 lbu r3,0x0015(r18)		load exp
00120c34: 00000000 nop
00120c38: a6030008 sh r3,0x0008(r16)		store exp
00120c3c: 92220002 lbu r2,0x0002(r17)		
00120c40: 00000000 nop
00120c44: a602000a sh r2,0x000a(r16)		store 0x0a in formation screen
00120c48: 9622002a lhu r2,0x002a(r17)		load Hp?
00120c4c: 00000000 nop
00120c50: 2c4203e8 sltiu r2,r2,0x03e8
00120c54: 10400002 beq r2,r0,0x00120c60		cap at 999
00120c58: 340303e7 ori r3,r0,0x03e7
00120c5c: 9623002a lhu r3,0x002a(r17)		load hP?
00120c60: 00000000 nop
00120c64: a603000c sh r3,0x000c(r16)
00120c68: 9622002a lhu r2,0x002a(r17)
00120c6c: 00000000 nop
00120c70: 2c4203e8 sltiu r2,r2,0x03e8
00120c74: 10400002 beq r2,r0,0x00120c80		cap at 999
00120c78: 340303e7 ori r3,r0,0x03e7
00120c7c: 9623002a lhu r3,0x002a(r17)
00120c80: 00000000 nop
00120c84: a6030010 sh r3,0x0010(r16)
00120c88: 9622002e lhu r2,0x002e(r17)
00120c8c: 00000000 nop
00120c90: 2c4203e8 sltiu r2,r2,0x03e8
00120c94: 10400002 beq r2,r0,0x00120ca0		cap at 999
00120c98: 340303e7 ori r3,r0,0x03e7
00120c9c: 9623002e lhu r3,0x002e(r17)
00120ca0: 00000000 nop
00120ca4: a6030012 sh r3,0x0012(r16)		store mp?
00120ca8: 9622002e lhu r2,0x002e(r17)
00120cac: 00000000 nop
00120cb0: 2c4203e8 sltiu r2,r2,0x03e8
00120cb4: 10400002 beq r2,r0,0x00120cc0
00120cb8: 340303e7 ori r3,r0,0x03e7
00120cbc: 9623002e lhu r3,0x002e(r17)		store mp?
00120cc0: 00000000 nop
00120cc4: a6030016 sh r3,0x0016(r16)
00120cc8: 92220039 lbu r2,0x0039(r17)		load ??
00120ccc: 00000000 nop
00120cd0: 2c420065 sltiu r2,r2,0x0065
00120cd4: 10400002 beq r2,r0,0x00120ce0
00120cd8: 34030064 ori r3,r0,0x0064
00120cdc: 92230039 lbu r3,0x0039(r17)
00120ce0: 34020064 ori r2,r0,0x0064
00120ce4: a6030018 sh r3,0x0018(r16)		store 
00120ce8: a602001c sh r2,0x001c(r16)		store 100
00120cec: 92220002 lbu r2,0x0002(r17)
00120cf0: 00000000 nop
00120cf4: a6020022 sh r2,0x0022(r16)
00120cf8: 92420002 lbu r2,0x0002(r18)
00120cfc: 00000000 nop
00120d00: a6020024 sh r2,0x0024(r16)		store job ID
00120d04: 92220024 lbu r2,0x0024(r17)
00120d08: 00000000 nop
00120d0c: a6020026 sh r2,0x0026(r16)		store brave
00120d10: 92220026 lbu r2,0x0026(r17)
00120d14: 00000000 nop
00120d18: a6020028 sh r2,0x0028(r16)		store faith
00120d1c: 96220008 lhu r2,0x0008(r17)
00120d20: 00000000 nop
00120d24: 00021302 srl r2,r2,0x0c
00120d28: a602002a sh r2,0x002a(r16)		store first 4 bits of above half
00120d2c: 92220002 lbu r2,0x0002(r17)		
00120d30: 00000000 nop
00120d34: a602002c sh r2,0x002c(r16)
00120d38: 9222003a lbu r2,0x003a(r17)
00120d3c: 00000000 nop
00120d40: a6020030 sh r2,0x0030(r16)		store move
00120d44: 92220038 lbu r2,0x0038(r17)
00120d48: 00000000 nop
00120d4c: a6020032 sh r2,0x0032(r16)		store speed
00120d50: 9222003b lbu r2,0x003b(r17)
00120d54: 00000000 nop
00120d58: a6020034 sh r2,0x0034(r16)		store jump
00120d5c: 9222003c lbu r2,0x003c(r17)
00120d60: 00000000 nop
00120d64: a6020036 sh r2,0x0036(r16)		store right hand Wp
00120d68: 9222003d lbu r2,0x003d(r17)
00120d6c: 00000000 nop
00120d70: a6020038 sh r2,0x0038(r16)		store left hand Wp
00120d74: 9222003e lbu r2,0x003e(r17)
00120d78: 00000000 nop
00120d7c: a602003a sh r2,0x003a(r16)		store right hand W-Ev
00120d80: 9222003f lbu r2,0x003f(r17)
00120d84: 00000000 nop
00120d88: a602003c sh r2,0x003c(r16)		store left hand W-Ev
00120d8c: 92220012 lbu r2,0x0012(r17)
00120d90: 00000000 nop
00120d94: 24420050 addiu r2,r2,0x0050		??+50
00120d98: 304200ff andi r2,r2,0x00ff
00120d9c: 2c440030 sltiu r4,r2,0x0030		set if ?? < 30
00120da0: a604003e sh r4,0x003e(r16)		store 1 or 0
00120da4: 92220036 lbu r2,0x0036(r17)
00120da8: 00000000 nop
00120dac: a6020042 sh r2,0x0042(r16)		Store PA as half
00120db0: 92220043 lbu r2,0x0043(r17)
00120db4: 00000000 nop
00120db8: a6020044 sh r2,0x0044(r16)		store MA as half
00120dbc: 92230041 lbu r3,0x0041(r17)
00120dc0: 92240042 lbu r4,0x0042(r17)
00120dc4: 00000000 nop
00120dc8: 0064102b sltu r2,r3,r4
00120dcc: 10400002 beq r2,r0,0x00120dd8		branch if ? < ?
00120dd0: 00000000 nop
00120dd4: 00801821 addu r3,r4,r0			Store highest physical S-Ev
00120dd8: a6030046 sh r3,0x0046(r16)			Save Physical S-Ev
00120ddc: 92220040 lbu r2,0x0040(r17)
00120de0: 00000000 nop
00120de4: a6020048 sh r2,0x0048(r16)		store physical A-Ev
00120de8: 92220037 lbu r2,0x0037(r17)
00120dec: a600004e sh r0,0x004e(r16)		store no ??
00120df0: a602004c sh r2,0x004c(r16)		store ??
00120df4: 92230045 lbu r3,0x0045(r17)
00120df8: 92240046 lbu r4,0x0046(r17)
00120dfc: 00000000 nop
00120e00: 0064102b sltu r2,r3,r4
00120e04: 10400002 beq r2,r0,0x00120e10		branch if ? < ?
00120e08: 00000000 nop
00120e0c: 00801821 addu r3,r4,r0
00120e10: a6030050 sh r3,0x0050(r16)		store highest magic S-Ev
00120e14: 92220044 lbu r2,0x0044(r17)
00120e18: 8603003e lh r3,0x003e(r16)		load ??
00120e1c: 00000000 nop
00120e20: 10600013 beq r3,r0,0x00120e70		branch if Monster Skillset
00120e24: a6020052 sh r2,0x0052(r16)		store magic A-Ev
00120e28: 92240012 lbu r4,0x0012(r17)		load Skillset?
00120e2c: 0c01698e jal 0x0005a638			Store Skillsets Abilities
00120e30: 34050001 ori r5,r0,0x0001
00120e34: 00002021 addu r4,r0,r0
00120e38: 00403021 addu r6,r2,r0			r6 = temp ability list of monster abilities
00120e3c: 02002821 addu r5,r16,r0
00120e40: 84c20000 lh r2,0x0000(r6)			load Ability
00120e44: 00000000 nop
00120e48: 10400003 beq r2,r0,0x00120e58
00120e4c: 00401821 addu r3,r2,r0
00120e50: a4a3005e sh r3,0x005e(r5)			Store primary skillset
00120e54: 24a50002 addiu r5,r5,0x0002
00120e58: 24840001 addiu r4,r4,0x0001
00120e5c: 28820003 slti r2,r4,0x0003		Store all monster abilities
00120e60: 1440fff7 bne r2,r0,0x00120e40		
00120e64: 24c60002 addiu r6,r6,0x0002
00120e68: 080483da j 0x00120f68
00120e6c: 00000000 nop

00120e70: 92220012 lbu r2,0x0012(r17)		load skillset
00120e74: 86030024 lh r3,0x0024(r16)		load job
00120e78: a602005e sh r2,0x005e(r16)		store skillset
00120e7c: 3402005d ori r2,r0,0x005d
00120e80: 10620039 beq r3,r2,0x00120f68		branch if mime
00120e84: 340200ff ori r2,r0,0x00ff
00120e88: 92430011 lbu r3,0x0011(r18)		load right hand weapon
00120e8c: 00000000 nop
00120e90: 10620004 beq r3,r2,0x00120ea4		branch if no right hand weapon
00120e94: 00000000 nop
00120e98: 92420011 lbu r2,0x0011(r18)		load right hand weapon
00120e9c: 080483ac j 0x00120eb0
00120ea0: a6020054 sh r2,0x0054(r16)		store right hand weapon

00120ea4: 92420012 lbu r2,0x0012(r18)		load right hand shield
00120ea8: 00000000 nop
00120eac: a6020054 sh r2,0x0054(r16)		store right hand shield
00120eb0: 92430013 lbu r3,0x0013(r18)		load left hand weapon
00120eb4: 340200ff ori r2,r0,0x00ff
00120eb8: 10620004 beq r3,r2,0x00120ecc		branch if none
00120ebc: 00000000 nop
00120ec0: 92420013 lbu r2,0x0013(r18)		load left hand weapon
00120ec4: 080483b6 j 0x00120ed8
00120ec8: a6020056 sh r2,0x0056(r16)		store weapon
00120ecc: 92420014 lbu r2,0x0014(r18)		load left hand shield
00120ed0: 00000000 nop
00120ed4: a6020056 sh r2,0x0056(r16)		store left hand shield
00120ed8: 9242000e lbu r2,0x000e(r18)		load head
00120edc: 00000000 nop
00120ee0: a6020058 sh r2,0x0058(r16)		store head
00120ee4: 9242000f lbu r2,0x000f(r18)		load body
00120ee8: 00002021 addu r4,r0,r0
00120eec: a602005a sh r2,0x005a(r16)		store body
00120ef0: 92420010 lbu r2,0x0010(r18)		load accessory
00120ef4: 02001821 addu r3,r16,r0
00120ef8: a602005c sh r2,0x005c(r16)		store accessory
00120efc: 94620054 lhu r2,0x0054(r3)		load left hand equip
00120f00: 00000000 nop
00120f04: 2c4200fe sltiu r2,r2,0x00fe
00120f08: 14400002 bne r2,r0,0x00120f14		branch if valid
00120f0c: 24840001 addiu r4,r4,0x0001
00120f10: a4600054 sh r0,0x0054(r3)			else store no equip
00120f14: 28820005 slti r2,r4,0x0005
00120f18: 1440fff8 bne r2,r0,0x00120efc		validate all equipment < fe
00120f1c: 24630002 addiu r3,r3,0x0002
00120f20: 92420007 lbu r2,0x0007(r18)		load secondary skillset
00120f24: 00000000 nop
00120f28: a6020060 sh r2,0x0060(r16)		store secondary skillset
00120f2c: 92420009 lbu r2,0x0009(r18)		
00120f30: 92430008 lbu r3,0x0008(r18)
00120f34: 00021200 sll r2,r2,0x08
00120f38: 00621821 addu r3,r3,r2			r3 = reaction ability
00120f3c: a6030062 sh r3,0x0062(r16)		store reaction ability
00120f40: 9242000b lbu r2,0x000b(r18)
00120f44: 9243000a lbu r3,0x000a(r18)
00120f48: 00021200 sll r2,r2,0x08
00120f4c: 00621821 addu r3,r3,r2
00120f50: a6030064 sh r3,0x0064(r16)		store support ability
00120f54: 9242000d lbu r2,0x000d(r18)	
00120f58: 9243000c lbu r3,0x000c(r18)
00120f5c: 00021200 sll r2,r2,0x08
00120f60: 00621821 addu r3,r3,r2
00120f64: a6030066 sh r3,0x0066(r16)		store movement ability
Monster skillset jumps back here
00120f68: 92240003 lbu r4,0x0003(r17)		load current job
00120f6c: 0c0482e4 jal 0x00120b90			check if special monster (1 if so)
00120f70: 00000000 nop
00120f74: 14400005 bne r2,r0,0x00120f8c		branch if special monster
00120f78: 26240096 addiu r4,r17,0x0096		r4 = data pointer
00120f7c: 8602003e lh r2,0x003e(r16)		load ??
00120f80: 00000000 nop
00120f84: 10400006 beq r2,r0,0x00120fa0		branch if not? monster skillset
00120f88: 00000000 nop
00120f8c: 26050077 addiu r5,r16,0x0077		r5 = 0x77 in formation screen pointer
00120f90: 0c0088b7 jal 0x000222dc			
00120f94: 34060003 ori r6,r0,0x0003
00120f98: 080483f3 j 0x00120fcc
00120f9c: 2624004a addiu r4,r17,0x004a
00120fa0: 92250006 lbu r5,0x0006(r17)		load birthday?
00120fa4: 262400d2 addiu r4,r17,0x00d2		r4 = address
00120fa8: 0c017705 jal 0x0005dc14			Calculate Unlocked Jobs
00120fac: 30a500c0 andi r5,r5,0x00c0		Serpentarius check?
00120fb0: 00402021 addu r4,r2,r0
00120fb4: 00041403 sra r2,r4,0x10
00120fb8: a2020077 sb r2,0x0077(r16)		Store Unlocked Jobs 1
00120fbc: 00041203 sra r2,r4,0x08
00120fc0: a2020078 sb r2,0x0078(r16)		Store Unlocked Jobs 2
00120fc4: a2040079 sb r4,0x0079(r16)		Store Unlocked Jobs 3
00120fc8: 2624004a addiu r4,r17,0x004a		r4 = stack address
00120fcc: 92420004 lbu r2,0x0004(r18)		load gender	
00120fd0: 26050073 addiu r5,r16,0x0073		r5 = equippable items address (Formation Screen data)
00120fd4: a2020070 sb r2,0x0070(r16)		store gender
00120fd8: 92420000 lbu r2,0x0000(r18)		Load Sprite Set
00120fdc: 34060004 ori r6,r0,0x0004
00120fe0: 0c0088b7 jal 0x000222dc			Transfer Data equippable items?
00120fe4: a2020072 sb r2,0x0072(r16)		store Sprite Set
00120fe8: 2644002b addiu r4,r18,0x002b		r4 = Known abilities address (Party Data)
00120fec: 2605007a addiu r5,r16,0x007a		r5 = Known abilities address (Formation Screen data)
00120ff0: 0c0088b7 jal 0x000222dc			transfer Data
00120ff4: 34060039 ori r6,r0,0x0039			length = 0x39
00120ff8: 26440064 addiu r4,r18,0x0064		r4 = Job Levels Address (Party Data)
00120ffc: 260500b3 addiu r5,r16,0x00b3		r5 = Job Levels Address (Formation Screen Data)
00121000: 0c0088b7 jal 0x000222dc			Transfer data
00121004: 3406000a ori r6,r0,0x000a			length = 0x0a
00121008: 2644006e addiu r4,r18,0x006e		r4 = JP amounts address (Party Data)
0012100c: 260500be addiu r5,r16,0x00be		r5 = JP Amounts Address (
00121010: 0c0088b7 jal 0x000222dc
00121014: 34060028 ori r6,r0,0x0028
00121018: 26440096 addiu r4,r18,0x0096		Transfer Total JP amounts
0012101c: 260500e6 addiu r5,r16,0x00e6
00121020: 0c0088b7 jal 0x000222dc
00121024: 34060028 ori r6,r0,0x0028
00121028: 00002021 addu r4,r0,r0
0012102c: 3405270f ori r5,r0,0x270f
00121030: 02001821 addu r3,r16,r0
00121034: 946200be lhu r2,0x00be(r3)		load JP
00121038: 00000000 nop
0012103c: 2c422710 sltiu r2,r2,0x2710
00121040: 14400002 bne r2,r0,0x0012104c		
00121044: 00000000 nop
00121048: a46500be sh r5,0x00be(r3)			Cap at JP 9999
0012104c: 946200e6 lhu r2,0x00e6(r3)
00121050: 00000000 nop
00121054: 2c422710 sltiu r2,r2,0x2710
00121058: 14400002 bne r2,r0,0x00121064
0012105c: 24840001 addiu r4,r4,0x0001
00121060: a46500e6 sh r5,0x00e6(r3)			Cap Total JP at 9999
00121064: 28820014 slti r2,r4,0x0014
00121068: 1440fff2 bne r2,r0,0x00121034		do for all
0012106c: 24630002 addiu r3,r3,0x0002
00121070: 264400be addiu r4,r18,0x00be
00121074: 2605010e addiu r5,r16,0x010e
00121078: 0c0088b7 jal 0x000222dc			Transfer Unit Name
0012107c: 34060010 ori r6,r0,0x0010
00121080: 2624008f addiu r4,r17,0x008f
00121084: 26050124 addiu r5,r16,0x0124		0x124
00121088: 0c0088b7 jal 0x000222dc			store ??
0012108c: 34060004 ori r6,r0,0x0004
00121090: 924200d0 lbu r2,0x00d0(r18)
00121094: 00000000 nop
00121098: a202011f sb r2,0x011f(r16)		Store proposition byte
0012109c: 9222015e lbu r2,0x015e(r17)
001210a0: 26040054 addiu r4,r16,0x0054
001210a4: a202011e sb r2,0x011e(r16)
001210a8: 96220008 lhu r2,0x0008(r17)
001210ac: 92050126 lbu r5,0x0126(r16)
001210b0: 304201ff andi r2,r2,0x01ff
001210b4: a6020120 sh r2,0x0120(r16)		Store current job?
001210b8: 924200d2 lbu r2,0x00d2(r18)		load 0xd2 byte (Party Data)
001210bc: 30a50002 andi r5,r5,0x0002
001210c0: 0c0482bf jal 0x00120afc			Two hands check for equipping weapons
001210c4: a6020122 sh r2,0x0122(r16)
001210c8: a6020040 sh r2,0x0040(r16)
001210cc: 8fbf0024 lw r31,0x0024(r29)
001210d0: 8fb20020 lw r18,0x0020(r29)
001210d4: 8fb1001c lw r17,0x001c(r29)
001210d8: 8fb00018 lw r16,0x0018(r29)
001210dc: 27bd0028 addiu r29,r29,0x0028
001210e0: 03e00008 jr r31
001210e4: 00000000 nop