Difference between revisions of "JOBSTTS.OUT 001e4ed0 - 001e4f78"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with "beq r4,r0,end #if passed in value is 0, skip routine addu r2,r0,r0 #clear r2 lui r2,0x801f lbu r2,0x0044(r2) #r2 = byte at 0x801f0044 nop beq r2,r0,forward...")
 
 
(4 intermediate revisions by one other user not shown)
Line 1: Line 1:
beq r4,r0,end        #if passed in value is 0, skip routine
+
scrappy note; open menu by r4 frames?
addu r2,r0,r0       #clear r2
+
001e4ed0: 10800028 beq r4,r0,0x001e4f74    #skip routine if r4 is 0         (menu opening speed?)
lui r2,0x801f
+
001e4ed4: 00001021 addu r2,r0,r0           #clear r2
lbu r2,0x0044(r2)   #r2 = byte at 0x801f0044
+
001e4ed8: 3c02801f lui r2,0x801f
nop
+
001e4edc: 90420044 lbu r2,0x0044(r2)       unit job list marked to open?
beq r2,r0,forward   #jump forward if r2 is empty
+
001e4ee0: 00000000 nop
addu r7,r0,r0       #clear r7
+
001e4ee4: 10400006 beq r2,r0,0x001e4f00   skip if unit job list not yet open
ori r2,r0,0x0007     #r2 = 7
+
001e4ee8: 00003821 addu r7,r0,r0          
lui r1,0x801f
+
001e4eec: 34020007 ori r2,r0,0x0007      
sw r2,0x0048(r1)     #store 7 in 0x801f0048
+
001e4ef0: 3c01801f lui r1,0x801f
lui r1,0x801f
+
001e4ef4: ac220048 sw r2,0x0048(r1)       #store 7 in 0x801f0048
sb r0,0x0044(r1)     #clear 0x801f0044
+
001e4ef8: 3c01801f lui r1,0x801f
forward:             #0x801f0044 is always empty at this point
+
001e4efc: a0200044 sb r0,0x0044(r1)       mark opened?
addiu r4,r4,-0x0001 #r4--
+
001e4f00: 2484ffff addiu r4,r4,-0x0001     #r4--
addiu r2,r0,-0x0001 #r2 = -1
+
001e4f04: 2402ffff addiu r2,r0,-0x0001     #r2 = -1
beq r4,r2,end        #end routine if r4 is -1
+
001e4f08: 1082001a beq r4,r2,0x001e4f74    #end routine if r4 is -1
addu r2,r7,r0       #r7 is return value
+
001e4f0c: 00e01021 addu r2,r7,r0           #r7 is return value
ori r10,r0,0x0001   #r10 is 1
+
001e4f10: 340a0001 ori r10,r0,0x0001       #r10 is 1
ori r9,r0,0x0007     #r9 is 7
+
001e4f14: 34090007 ori r9,r0,0x0007       #r9 is 7
addiu r8,r0,-0x0001 #r8 is -1
+
001e4f18: 2408ffff addiu r8,r0,-0x0001     #r8 is -1
backwards:
+
001e4f1c: 3c068020 lui r6,0x8020
lui r6,0x8020
+
001e4f20: 8cc6a714 lw r6,-0x58ec(r6)       #r6 = word at 0x801fa714
lw r6,-0x58ec(r6)   #r6 = word at 0x801fa714
+
001e4f24: 3c03801f lui r3,0x801f
lui r3,0x801f
+
001e4f28: 8c630048 lw r3,0x0048(r3)       #r3 = word at 0x801f0048 (could be 7?)
lw r3,0x0048(r3)     #r3 = word at 0x801f0048 (could be 7?)
+
001e4f2c: 90c20000 lbu r2,0x0000(r6)       #r2 = value pointed at from 0x801fa714 pointer
lbu r2,0x0000(r6)   #r2 = value pointed at from 0x801fa714 pointer
+
001e4f30: 2465ffff addiu r5,r3,-0x0001     #r5 = r3 - 1
addiu r5,r3,-0x0001 #r5 = r3 - 1
+
001e4f34: 3c01801f lui r1,0x801f
lui r1,0x801f
+
001e4f38: ac250048 sw r5,0x0048(r1)       #store r5 at 0x801f0048
sw r5,0x0048(r1)     #store r5 at 0x801f0048
+
001e4f3c: 00621007 srav r2,r2,r3           #rightshift r2 by r3 bytes (could be 7?)
srav r2,r2,r3       #rightshift r2 by r3 bytes (could be 7?)
+
001e4f40: 30420001 andi r2,r2,0x0001       #r2 = far right byte
andi r2,r2,0x0001   #r2 = far right byte
+
001e4f44: 10400002 beq r2,r0,0x001e4f50    #skip if r2 is odd
beq r2,r0,skip      #skip if r2 is odd
+
001e4f48: 008a1004 sllv r2,r10,r4         #r2 = r10 leftshifted r4
sllv r2,r10,r4       #r2 = r10 leftshifted r4
+
001e4f4c: 00e23825 or r7,r7,r2             #r7 = r7 U r2
or r7,r7,r2         #r7 = r7 U r2
+
001e4f50: 04a10006 bgez r5,0x001e4f6c      #skip down if r5 is positive
skip:
+
001e4f54: 2484ffff addiu r4,r4,-0x0001     #r4--
bgez r5,skip2        #skip this if r5 is positive
+
001e4f58: 24c20001 addiu r2,r6,0x0001     #r2 is r6 + 1
addiu r4,r4,-0x0001 #r4--
+
001e4f5c: 3c01801f lui r1,0x801f
addiu r2,r6,0x0001   #r2 is r6 + 1
+
001e4f60: ac290048 sw r9,0x0048(r1)       #store r9 in 0x801f0048
lui r1,0x801f
+
001e4f64: 3c018020 lui r1,0x8020
sw r9,0x0048(r1)     #store r9 in 0x801f0048
+
001e4f68: ac22a714 sw r2,-0x58ec(r1)       #store r2 in 0x801fa714
lui r1,0x8020
+
001e4f6c: 1488ffeb bne r4,r8,0x001e4f1c    loop until r4 = -1
sw r2,-0x58ec(r1)   #store r2 in 0x801fa714
+
001e4f70: 00e01021 addu r2,r7,r0           #return value is r7
skip2:
+
001e4f74: 03e00008 jr r31               
bne r4,r8,backwards  #loop if r4 and r8 aren't equal
+
001e4f78: 00000000 nop
addu r2,r7,r0       #return value is r7
 
end:
 
jr r31              #finally over
 
nop
 

Latest revision as of 10:49, 25 May 2024

scrappy note; open menu by r4 frames?

001e4ed0: 10800028 beq r4,r0,0x001e4f74    #skip routine if r4 is 0          (menu opening speed?)
001e4ed4: 00001021 addu r2,r0,r0           #clear r2
001e4ed8: 3c02801f lui r2,0x801f
001e4edc: 90420044 lbu r2,0x0044(r2)       unit job list marked to open?
001e4ee0: 00000000 nop
001e4ee4: 10400006 beq r2,r0,0x001e4f00    skip if unit job list not yet open
001e4ee8: 00003821 addu r7,r0,r0           
001e4eec: 34020007 ori r2,r0,0x0007       
001e4ef0: 3c01801f lui r1,0x801f
001e4ef4: ac220048 sw r2,0x0048(r1)        #store 7 in 0x801f0048
001e4ef8: 3c01801f lui r1,0x801f
001e4efc: a0200044 sb r0,0x0044(r1)        mark opened?
001e4f00: 2484ffff addiu r4,r4,-0x0001     #r4--
001e4f04: 2402ffff addiu r2,r0,-0x0001     #r2 = -1
001e4f08: 1082001a beq r4,r2,0x001e4f74    #end routine if r4 is -1
001e4f0c: 00e01021 addu r2,r7,r0           #r7 is return value
001e4f10: 340a0001 ori r10,r0,0x0001       #r10 is 1
001e4f14: 34090007 ori r9,r0,0x0007        #r9 is 7
001e4f18: 2408ffff addiu r8,r0,-0x0001     #r8 is -1
001e4f1c: 3c068020 lui r6,0x8020
001e4f20: 8cc6a714 lw r6,-0x58ec(r6)       #r6 = word at 0x801fa714
001e4f24: 3c03801f lui r3,0x801f
001e4f28: 8c630048 lw r3,0x0048(r3)        #r3 = word at 0x801f0048 (could be 7?)
001e4f2c: 90c20000 lbu r2,0x0000(r6)       #r2 = value pointed at from 0x801fa714 pointer
001e4f30: 2465ffff addiu r5,r3,-0x0001     #r5 = r3 - 1
001e4f34: 3c01801f lui r1,0x801f
001e4f38: ac250048 sw r5,0x0048(r1)        #store r5 at 0x801f0048
001e4f3c: 00621007 srav r2,r2,r3           #rightshift r2 by r3 bytes (could be 7?)
001e4f40: 30420001 andi r2,r2,0x0001       #r2 = far right byte
001e4f44: 10400002 beq r2,r0,0x001e4f50    #skip if r2 is odd
001e4f48: 008a1004 sllv r2,r10,r4          #r2 = r10 leftshifted r4
001e4f4c: 00e23825 or r7,r7,r2             #r7 = r7 U r2
001e4f50: 04a10006 bgez r5,0x001e4f6c      #skip down if r5 is positive
001e4f54: 2484ffff addiu r4,r4,-0x0001     #r4--
001e4f58: 24c20001 addiu r2,r6,0x0001      #r2 is r6 + 1
001e4f5c: 3c01801f lui r1,0x801f
001e4f60: ac290048 sw r9,0x0048(r1)        #store r9 in 0x801f0048
001e4f64: 3c018020 lui r1,0x8020
001e4f68: ac22a714 sw r2,-0x58ec(r1)       #store r2 in 0x801fa714
001e4f6c: 1488ffeb bne r4,r8,0x001e4f1c    loop until r4 = -1
001e4f70: 00e01021 addu r2,r7,r0           #return value is r7
001e4f74: 03e00008 jr r31               
001e4f78: 00000000 nop