Menu Page Up/Down

From Final Fantasy Hacktics Wiki
Revision as of 01:39, 18 May 2018 by Glain (talk | contribs) (Created page with " # ROUTINE: MENU PAGE UP/DOWN (WORLD.BIN) # Pages up or down in a menu. (Usually activated by pressing Square + Up or Square + Down) # Parameters: #...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
#   ROUTINE: MENU PAGE UP/DOWN (WORLD.BIN)
#       Pages up or down in a menu. (Usually activated by pressing Square + Up or Square + Down)
#       Parameters:
#           r4 = (p1) ?
#           r5 = (p2) ?

80129b7c: 27bdffc0 addiu r29,r29,-0x0040
80129b80: afbf0038 sw r31,0x0038(r29)
80129b84: afb10034 sw r17,0x0034(r29)
80129b88: afb00030 sw r16,0x0030(r29)
80129b8c: 00803021 addu r6,r4,r0                    #   p1
80129b90: 3c11801d lui r17,0x801d
80129b94: 8631d54c lh r17,-0x2ab4(r17)              #   value_s1 = *0x801cd54c
80129b98: 00000000 nop
80129b9c: 02201821 addu r3,r17,r0                   #   *0x801cd54c         // Amount to move
80129ba0: 3c02801d lui r2,0x801d
80129ba4: 9442d20c lhu r2,-0x2df4(r2)               #   *0x801cd20c         // Current position
80129ba8: 00000000 nop
80129bac: 00438023 subu r16,r2,r3                   #   value_s0 = *0x801cd20c - *0x801cd54c
80129bb0: 2402ffff addiu r2,r0,-0x0001              #   -1
80129bb4: 14c2000d bne r6,r2,0x80129bec             
80129bb8: 00a02021 addu r4,r5,r0                    #   p2
                                                    #   if (p1 == -1) {
80129bbc: 90820006 lbu r2,0x0006(r4)                #       p2.0x06
80129bc0: 00000000 nop
80129bc4: 00621023 subu r2,r3,r2                    #       *0x801cd54c - p2.0x06
80129bc8: 3c01801d lui r1,0x801d
80129bcc: a422d54c sh r2,-0x2ab4(r1)                #       *0x801cd54c = *0x801cd54c - p2.0x06
80129bd0: 00021400 sll r2,r2,0x10                   #       (*0x801cd54c - p2.0x06) * 1024
80129bd4: 04410021 bgez r2,0x80129c5c               #       if (((*0x801cd54c - p2.0x06) * 1024) < 0) {
80129bd8: 00000000 nop
80129bdc: 3c01801d lui r1,0x801d
80129be0: a420d54c sh r0,-0x2ab4(r1)                #           *0x801cd54c = 0
80129be4: 0804a717 j 0x80129c5c                                                
80129be8: 00000000 nop                              #       }
                                                    #   } else {                   
80129bec: 34020001 ori r2,r0,0x0001
80129bf0: 14c2001a bne r6,r2,0x80129c5c             #       if (p1 == 1) {
80129bf4: 00000000 nop
80129bf8: 90820006 lbu r2,0x0006(r4)                #          p2.0x06 
80129bfc: 3c03801d lui r3,0x801d
80129c00: 9463d54c lhu r3,-0x2ab4(r3)               #          *0x801cd54c 
80129c04: 00000000 nop
80129c08: 00431021 addu r2,r2,r3                    #           p2.0x06 + *0x801cd54c
80129c0c: 3c01801d lui r1,0x801d
80129c10: a422d54c sh r2,-0x2ab4(r1)                #           *0x801cd54c = p2.0x06 + *0x801cd54c
80129c14: 3c03801d lui r3,0x801d
80129c18: 8463d824 lh r3,-0x27dc(r3)                #           *0x801cd824
80129c1c: 00000000 nop
80129c20: 00602821 addu r5,r3,r0                    #           *0x801cd824
80129c24: 00021400 sll r2,r2,0x10   
80129c28: 00021403 sra r2,r2,0x10                   #           *0x801cd54c
80129c2c: 24420001 addiu r2,r2,0x0001               #           *0x801cd54c + 1
80129c30: 00621823 subu r3,r3,r2                    #           *0x801cd824 - (*0x801cd54c + 1)
80129c34: 90820006 lbu r2,0x0006(r4)                #           p2.0x06 
80129c38: 00000000 nop
80129c3c: 0062182a slt r3,r3,r2
80129c40: 10600006 beq r3,r0,0x80129c5c             #           if ((*0x801cd824 - (*0x801cd54c + 1)) < p2.0x06)
80129c44: 00000000 nop                              #           {
80129c48: 90820006 lbu r2,0x0006(r4)                #               p2.0x06
80129c4c: 00000000 nop
80129c50: 00a21023 subu r2,r5,r2                    #               *0x801cd824 - p2.0x06
80129c54: 3c01801d lui r1,0x801d
80129c58: a422d54c sh r2,-0x2ab4(r1)                #               *0x801cd54c = *0x801cd824 - p2.0x06
                                                    #           }
                                                    #       }
                                                    #   }
80129c5c: 3c02801d lui r2,0x801d
80129c60: 9442d54c lhu r2,-0x2ab4(r2)               #   *0x801cd54c
80129c64: 3c01801d lui r1,0x801d
80129c68: a422d20c sh r2,-0x2df4(r1)                #   *0x801cd20c = *0x801cd54c
80129c6c: 0c04a257 jal 0x8012895c                   #   ? 0x12895c ();
80129c70: 00000000 nop
80129c74: 3c02801d lui r2,0x801d
80129c78: 9442d54c lhu r2,-0x2ab4(r2)               #   *0x801cd54c
80129c7c: 00000000 nop
80129c80: 02021021 addu r2,r16,r2                   #   value_s0 - *0x801cd54c
80129c84: 3c01801d lui r1,0x801d
80129c88: a422d20c sh r2,-0x2df4(r1)                #   *0x801cd20c = value_s0 - *0x801cd54c
80129c8c: 00021400 sll r2,r2,0x10
80129c90: 00021403 sra r2,r2,0x10                   #   *0x801cd20c
80129c94: 3c03801d lui r3,0x801d
80129c98: 8463d824 lh r3,-0x27dc(r3)                #   *0x801cd824
80129c9c: 00000000 nop
80129ca0: 0043102a slt r2,r2,r3
80129ca4: 14400004 bne r2,r0,0x80129cb8
80129ca8: 00602021 addu r4,r3,r0                    #   *0x801cd824
                                                    #   if (*0x801cd20c >= *0x801cd824) {
80129cac: 2482ffff addiu r2,r4,-0x0001              #       *0x801cd824 - 1
80129cb0: 3c01801d lui r1,0x801d
80129cb4: a422d20c sh r2,-0x2df4(r1)                #       *0x801cd20c = *0x801cd824 - 1
                                                    #   }
80129cb8: 3c02801d lui r2,0x801d
80129cbc: 8442d54c lh r2,-0x2ab4(r2)                #   *0x801cd54c
80129cc0: 00000000 nop
80129cc4: 12220003 beq r17,r2,0x80129cd4           
80129cc8: 34020003 ori r2,r0,0x0003
                                                    #   if (value_s1 != *0x801cd54c) {
80129ccc: 3c018019 lui r1,0x8019
80129cd0: a022bacc sb r2,-0x4534(r1)                #       *0x8018bacc = 3
                                                    #   }
80129cd4: 8fbf0038 lw r31,0x0038(r29)
80129cd8: 8fb10034 lw r17,0x0034(r29)
80129cdc: 8fb00030 lw r16,0x0030(r29)
80129ce0: 27bd0040 addiu r29,r29,0x0040
80129ce4: 03e00008 jr r31
80129ce8: 00000000 nop