Add price of item / 4 to total gil

From Final Fantasy Hacktics Wiki
Revision as of 14:58, 22 February 2015 by Choto (talk | contribs)
Jump to navigation Jump to search

Add price of item / 4 to total gil

 0018ea98: 3c028019 lui r2,0x8019
 0018ea9c: 8c42f5fc lw r2,-0x0a04(r2)
 0018eaa0: 27bdffe8 addiu r29,r29,0xffe8
 0018eaa4: afb00010 sw r16,0x0010(r29)
 0018eaa8: 00a08021 addu r16,r5,r0
 0018eaac: 14400006 bne r2,r0,0x0018eac8                 branch executing action?
 0018eab0: afbf0014 sw r31,0x0014(r29)
 0018eab4: 90820005 lbu r2,0x0005(r4)                        load team
 0018eab8: 00000000 nop
 0018eabc: 30420030 andi r2,r2,0x0030
 0018eac0: 10400003 beq r2,r0,0x0018ead0               branch if ally team
 0018eac4: 30c600ff andi r6,r6,0x00ff
 0018eac8: 08063acf j 0x0018eb3c
 0018eacc: 00001021 addu r2,r0,r0

 0018ead0: 10c00009 beq r6,r0,0x0018eaf8               branch if item id = 0
 0018ead4: 00061040 sll r2,r6,0x01
 0018ead8: 00461021 addu r2,r2,r6
 0018eadc: 00021080 sll r2,r2,0x02
 0018eae0: 3c018006 lui r1,0x8006
 0018eae4: 00220821 addu r1,r1,r2
 0018eae8: 94222ec0 lhu r2,0x2ec0(r1)                      load price
 0018eaec: 00000000 nop
 0018eaf0: 00021082 srl r2,r2,0x02                             price / 4
 0018eaf4: 02028021 addu r16,r16,r2                         r2 + price / 4
 0018eaf8: 0c04ed64 jal 0x0013b590
 0018eafc: 3404002c ori r4,r0,0x002c
 0018eb00: 00502821 addu r5,r2,r16                         gil + r16 input + price / 4
 0018eb04: 3c0205f5 lui r2,0x05f5
 0018eb08: 3442e0ff ori r2,r2,0xe0ff
 0018eb0c: 0045102a slt r2,r2,r5                               set if over cap?
 0018eb10: 10400004 beq r2,r0,0x0018eb24           branch if not
 0018eb14: 00000000 nop
 0018eb18: 3c0505f5 lui r5,0x05f5
 0018eb1c: 08063acc j 0x0018eb30                       store cap value
 0018eb20: 34a5e0ff ori r5,r5,0xe0ff
 
 0018eb24: 04a10002 bgez r5,0x0018eb30            branch if positive number
 0018eb28: 00000000 nop
 0018eb2c: 00002821 addu r5,r0,r0                        store 0 if negative number
 0018eb30: 0c04ed91 jal 0x0013b644                    store gil
 0018eb34: 3404002c ori r4,r0,0x002c
 0018eb38: 02001021 addu r2,r16,r0
 0018eb3c: 8fbf0014 lw r31,0x0014(r29)
 0018eb40: 8fb00010 lw r16,0x0010(r29)
 0018eb44: 27bd0018 addiu r29,r29,0x0018
 0018eb48: 03e00008 jr r31
 0018eb4c: 00000000 nop