• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
April 24, 2024, 08:51:50 am

News:

Please use .png instead of .bmp when uploading unfinished sprites to the forum!


Repointing item attributes without issues

Started by nitwit, July 13, 2015, 01:32:29 am

nitwit

July 13, 2015, 01:32:29 am Last Edit: July 14, 2015, 01:36:33 am by nitwit
What is known about item attribute data?  I know it can be repointed, but last I checked there were still issues with menus and item previews.  Have new routines related to this been documented?

EDIT

http://ffhacktics.com/wiki/Equipment_Attribute_Setting

0005c67c: 00000000 nop
0005c680: 34420008 ori r2,r2,0x0008 Enable Sword
0005c684: a2220184 sb r2,0x0184(r17) Store new Equipped Flags?
0005c688: 30a300ff andi r3,r5,0x00ff
0005c68c: 340200ff ori r2,r0,0x00ff r2 = ff
0005c690: 10620062 beq r3,r2,0x 0005c81c Branch if nothing is equipped
0005c694: 00031040 sll r2,r3,0x01 ID * 2
0005c698: 00803021 addu r6,r4,r0 r6 = Unit's Data Pointer (Bonus Stats)
0005c69c: 00431021 addu r2,r2,r3 ID * 3
0005c6a0: 00021080 sll r2,r2,0x02 ID * 12
0005c6a4: 3c038006 lui r3,0x8006
0005c6a8: 24632eb8 addiu r3,r3,0x2eb8
0005c6ac: 00434821 addu r9,r2,r3
0005c6b0: 91230007 lbu r3,0x0007(r9) Load Equipment's Item Attributes
0005c6b4: 24880003 addiu r8,r4,0x0003 r8 = Unit's Data Pointer (PA)
0005c6b8: 00031040 sll r2,r3,0x01 ID * 2
0005c6bc: 00431021 addu r2,r2,r3 ID * 3
0005c6c0: 000210c0 sll r2,r2,0x03 ID * 24
0005c6c4: 00431021 addu r2,r2,r3 ID * 25
0005c6c8: 3c038006 lui r3,0x8006
0005c6cc: 246342c4 addiu r3,r3,0x42c4
0005c6d0: 00433821 addu r7,r2,r3 r7 = Item Attribute's Data Location
0005c6d4: 00e02821 addu r5,r7,r0 r5 = Item Attribute's Data Location
0005c6d8: 90a20000 lbu r2,0x0000(r5) Load Item Attribute's Stat
0005c6dc: 90c30000 lbu r3,0x0000(r6) Load Unit's Bonus Stat
0005c6e0: 00000000 nop
0005c6e4: 00431821 addu r3,r2,r3 Bonus Stat + Item Attribute's Stat
0005c6e8: 2c620100 sltiu r2,r3,0x0100
0005c6ec: 14400002 bne r2,r0,0x 0005c6f8 Branch if new Stat < 256
0005c6f0: 24a50001 addiu r5,r5,0x0001 Item Attribute's Data Pointer += 1
0005c6f4: 340300ff ori r3,r0,0x00ff Stat = 255
0005c6f8: a0c30000 sb r3,0x0000(r6) Store new Bonus Stat
0005c6fc: 24c60001 addiu r6,r6,0x0001 Unit's Bonus Stat Pointer += 1
0005c700: 00c8102a slt r2,r6,r8
0005c704: 1440fff4 bne r2,r0,0x 0005c6d8 Branch if all Bonus Stats haven't been checked