Bar Menu Controller Input Routine

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
Bar menu control routine
00071bb0: 27bdffe8 addiu r29,r29,0xffe8
00071bb4: afb00010 sw r16,0x0010(r29)
00071bb8: 00808021 addu r16,r4,r0
00071bbc: afbf0014 sw r31,0x0014(r29)
00071bc0: 8e020008 lw r2,0x0008(r16)
00071bc4: 00000000 nop
00071bc8: 00021840 sll r3,r2,0x01
00071bcc: 00621821 addu r3,r3,r2
00071bd0: 00031880 sll r3,r3,0x02
00071bd4: 00621821 addu r3,r3,r2
00071bd8: 00031880 sll r3,r3,0x02
00071bdc: 3c01800c lui r1,0x800c
00071be0: 2421bc70 addiu r1,r1,0xbc70
00071be4: 00230821 addu r1,r1,r3
00071be8: 8c220000 lw r2,0x0000(r1)
00071bec: 00000000 nop
00071bf0: 30420100 andi r2,r2,0x0100
00071bf4: 14400118 bne r2,r0,0x00072058				branch to end if ??
00071bf8: 00000000 nop
00071bfc: 3c038005 lui r3,0x8005
00071c00: 8c63d950 lw r3,-0x26b0(r3)				4d950
00071c04: 00000000 nop
00071c08: 30620008 andi r2,r3,0x0008
00071c0c: 14400112 bne r2,r0,0x00072058
00071c10: 30620004 andi r2,r3,0x0004
00071c14: 1040000f beq r2,r0,0x00071c54
00071c18: 00000000 nop
00071c1c: 0c03ffbb jal 0x000ffeec
00071c20: 3404000e ori r4,r0,0x000e
00071c24: 1440000b bne r2,r0,0x00071c54
00071c28: 00000000 nop
00071c2c: 3c028005 lui r2,0x8005
00071c30: 8c42d950 lw r2,-0x26b0(r2)
00071c34: 00000000 nop
00071c38: 38420004 xori r2,r2,0x0004
00071c3c: 3c018005 lui r1,0x8005
00071c40: ac22d950 sw r2,-0x26b0(r1)
00071c44: 0c01c6a8 jal 0x00071aa0
00071c48: 02002021 addu r4,r16,r0
00071c4c: 0801c816 j 0x00072058
00071c50: 00000000 nop
00071c54: 8e020018 lw r2,0x0018(r16)
00071c58: 00000000 nop
00071c5c: 10400019 beq r2,r0,0x00071cc4
00071c60: 00000000 nop
00071c64: 3c02800c lui r2,0x800c
00071c68: 8c42c2f0 lw r2,-0x3d10(r2)
00071c6c: 00000000 nop
00071c70: 30420060 andi r2,r2,0x0060
00071c74: 104000f8 beq r2,r0,0x00072058
00071c78: 3404000e ori r4,r0,0x000e
00071c7c: 00002821 addu r5,r0,r0
00071c80: 2406ffff addiu r6,r0,0xffff
00071c84: 00003821 addu r7,r0,r0
00071c88: 0c03ffc2 jal 0x000fff08
00071c8c: ae000018 sw r0,0x0018(r16)
00071c90: 34040002 ori r4,r0,0x0002
00071c94: 3c028005 lui r2,0x8005
00071c98: 8c42d950 lw r2,-0x26b0(r2)
00071c9c: 00000000 nop
00071ca0: 34420004 ori r2,r2,0x0004
00071ca4: 3c018005 lui r1,0x8005
00071ca8: ac22d950 sw r2,-0x26b0(r1)
00071cac: 0c01a500 jal 0x00069400
00071cb0: 34050010 ori r5,r0,0x0010
00071cb4: 0c02445d jal 0x00091174
00071cb8: 3404011b ori r4,r0,0x011b
00071cbc: 0801c816 j 0x00072058
00071cc0: 00000000 nop

00071cc4: 3c03800c lui r3,0x800c
00071cc8: 8c63c2f0 lw r3,-0x3d10(r3)
00071ccc: 00000000 nop
00071cd0: 30620040 andi r2,r3,0x0040
00071cd4: 10400005 beq r2,r0,0x00071cec			branch if cancel not pressed?
00071cd8: 30620100 andi r2,r3,0x0100

00071cdc: 0c02434c jal 0x00090d30				cancel pressed
00071ce0: 34040002 ori r4,r0,0x0002
00071ce4: 0801c795 j 0x00071e54
00071ce8: 3404000e ori r4,r0,0x000e

00071cec: 10400012 beq r2,r0,0x00071d38			branch if Select not pressed
00071cf0: 30620020 andi r2,r3,0x0020
00071cf4: 0c01c66f jal 0x000719bc
00071cf8: 02002021 addu r4,r16,r0
00071cfc: 8e02001c lw r2,0x001c(r16)
00071d00: 00000000 nop
00071d04: 00021080 sll r2,r2,0x02
00071d08: 00501021 addu r2,r2,r16
00071d0c: 8c420034 lw r2,0x0034(r2)
00071d10: 00000000 nop
00071d14: 3c01800a lui r1,0x800a
00071d18: 2421eb2c addiu r1,r1,0xeb2c
00071d1c: 00220821 addu r1,r1,r2
00071d20: 90240000 lbu r4,0x0000(r1)
00071d24: 34050001 ori r5,r0,0x0001
00071d28: 0c01ba18 jal 0x0006e860
00071d2c: 34841000 ori r4,r4,0x1000
00071d30: 0801c816 j 0x00072058
00071d34: 00000000 nop

00071d38: 1040005f beq r2,r0,0x00071eb8			branch if confirm not pressed
00071d3c: 00000000 nop
If Confirm was pressed
00071d40: 0c02434c jal 0x00090d30				play confirmation sound
00071d44: 34040001 ori r4,r0,0x0001
00071d48: 8e02001c lw r2,0x001c(r16)			load selectedindex of menu?
00071d4c: 00000000 nop
00071d50: 3c01800d lui r1,0x800d
00071d54: ac2207e0 sw r2,0x07e0(r1)				store in 800d07e0
00071d58: 8e02001c lw r2,0x001c(r16)			load bar menu selectedindex?
00071d5c: 00000000 nop
00071d60: 00021080 sll r2,r2,0x02				index*4
00071d64: 00501021 addu r2,r2,r16				add to other menu address (get menu data
00071d68: 8c430034 lw r3,0x0034(r2)				load ??
00071d6c: 34020004 ori r2,r0,0x0004
00071d70: 1062000b beq r3,r2,0x00071da0			branch if not 4
00071d74: 00000000 nop
00071d78: 8e020000 lw r2,0x0000(r16)			load 0x2C in  this data
00071d7c: 00000000 nop
00071d80: 000218c0 sll r3,r2,0x03				*8
00071d84: 00621821 addu r3,r3,r2				*9
00071d88: 00031880 sll r3,r3,0x02				*36 0x24
00071d8c: 34020001 ori r2,r0,0x0001
00071d90: 3c01800c lui r1,0x800c
00071d94: 2421b508 addiu r1,r1,0xb508			800cb508 - World Graphic Data
00071d98: 00230821 addu r1,r1,r3
00071d9c: ac220000 sw r2,0x0000(r1)			store counteR?
00071da0: 8e02001c lw r2,0x001c(r16)		load bar menu selectedindex?
00071da4: 00000000 nop
00071da8: 00021080 sll r2,r2,0x02
00071dac: 00501021 addu r2,r2,r16
00071db0: 8c430034 lw r3,0x0034(r2)			jump based on bar menu selection
00071db4: 00000000 nop
00071db8: 2c620005 sltiu r2,r3,0x0005
00071dbc: 104000a6 beq r2,r0,0x00072058
00071dc0: 00031080 sll r2,r3,0x02
00071dc4: 3c018006 lui r1,0x8006
00071dc8: 24217034 addiu r1,r1,0x7034
00071dcc: 00220821 addu r1,r1,r2
00071dd0: 8c220000 lw r2,0x0000(r1)
00071dd4: 00000000 nop
00071dd8: 00400008 jr r2
00071ddc: 00000000 nop

Load Rumors
00071de0: 0c01a2f1 jal 0x00068bc4		Load wldmes text sector - 00 Rumor Description (link)
00071de4: 00002021 addu r4,r0,r0		r4 = 0 (Rumor Descriptions)
00071de8: 0c01c66f jal 0x000719bc		Fade out previous menu into a blue color? (link)
00071dec: 02002021 addu r4,r16,r0
00071df0: 0c01c81b jal 0x0007206c		Rumors Name & Display (link)
00071df4: 00000000 nop
00071df8: 0801c816 j 0x00072058
00071dfc: 00000000 nop

Load Propositions
00071e00: 0c01a2f1 jal 0x00068bc4		Load wldmes text sector - 01 Proposition Description (link)
00071e04: 34040001 ori r4,r0,0x0001		r4 = 1 (Proposition Descriptions)
00071e08: 0c01c66f jal 0x000719bc		Fade out previous menu into a blue color? (link)
00071e0c: 02002021 addu r4,r16,r0		
00071e10: 0c01ca86 jal 0x00072a18		
00071e14: 00000000 nop		
00071e18: 0801c816 j 0x00072058
00071e1c: 00000000 nop

Reload menu? - Job report
00071e20: 0c01c66f jal 0x000719bc
00071e24: 02002021 addu r4,r16,r0
00071e28: 0c01dc5d jal 0x00077174
00071e2c: 00000000 nop
00071e30: 0801c816 j 0x00072058
00071e34: 00000000 nop

Call Back
00071e38: 0c01c66f jal 0x000719bc
00071e3c: 02002021 addu r4,r16,r0
00071e40: 0c01ea7b jal 0x0007a9ec
00071e44: 00000000 nop
00071e48: 0801c816 j 0x00072058
00071e4c: 00000000 nop

Leave Bar
00071e50: 3404000e ori r4,r0,0x000e
00071e54: 34050019 ori r5,r0,0x0019
00071e58: 3406b807 ori r6,r0,0xb807
00071e5c: 3c01800d lui r1,0x800d
00071e60: ac2007e0 sw r0,0x07e0(r1)
00071e64: 0c03ffc2 jal 0x000fff08
00071e68: 00003821 addu r7,r0,r0
00071e6c: 3c02800a lui r2,0x800a
00071e70: 8c42f180 lw r2,-0x0e80(r2)
00071e74: 34030001 ori r3,r0,0x0001
00071e78: ae030018 sw r3,0x0018(r16)
00071e7c: 3c03800a lui r3,0x800a
00071e80: 8c63f198 lw r3,-0x0e68(r3)
00071e84: 2442fffe addiu r2,r2,0xfffe
00071e88: 3c01800a lui r1,0x800a
00071e8c: ac22f180 sw r2,-0x0e80(r1)
00071e90: 3c02800a lui r2,0x800a
00071e94: 8c42f244 lw r2,-0x0dbc(r2)
00071e98: 2463fffd addiu r3,r3,0xfffd
00071e9c: 3c01800a lui r1,0x800a
00071ea0: ac23f198 sw r3,-0x0e68(r1)
00071ea4: 2442ffff addiu r2,r2,0xffff
00071ea8: 3c01800a lui r1,0x800a
00071eac: ac22f244 sw r2,-0x0dbc(r1)
00071eb0: 0801c816 j 0x00072058
00071eb4: 00000000 nop

If confirm wasn't pressed (part of idle loop)
00071eb8: 0c01a404 jal 0x00069010
00071ebc: 34041000 ori r4,r0,0x1000
00071ec0: 1040002c beq r2,r0,0x00071f74			branch if up arrow not pressed
00071ec4: 00000000 nop
up arrow pressed
00071ec8: 8e02001c lw r2,0x001c(r16)			load bar menu selectedindex?
00071ecc: 00000000 nop
00071ed0: 10400013 beq r2,r0,0x00071f20			branch if zero
00071ed4: 00000000 nop
00071ed8: 8e020000 lw r2,0x0000(r16)			load ??
00071edc: 00000000 nop
00071ee0: 000218c0 sll r3,r2,0x03
00071ee4: 00621821 addu r3,r3,r2
00071ee8: 00031880 sll r3,r3,0x02
00071eec: 3c01800c lui r1,0x800c
00071ef0: 2421b520 addiu r1,r1,0xb520
00071ef4: 00230821 addu r1,r1,r3
00071ef8: 8c220000 lw r2,0x0000(r1)
00071efc: 00000000 nop
00071f00: 2442fff0 addiu r2,r2,0xfff0
00071f04: 3c01800c lui r1,0x800c
00071f08: 2421b520 addiu r1,r1,0xb520
00071f0c: 00230821 addu r1,r1,r3
00071f10: ac220000 sw r2,0x0000(r1)
00071f14: 8e02001c lw r2,0x001c(r16)			load bar menu selectedindex?
00071f18: 0801c7db j 0x00071f6c
00071f1c: 2442ffff addiu r2,r2,0xffff			decrement bar menu selectedindex?

00071f20: 8e020000 lw r2,0x0000(r16)			load ??
00071f24: 8e030030 lw r3,0x0030(r16)			load ??
00071f28: 000220c0 sll r4,r2,0x03				*8
00071f2c: 00822021 addu r4,r4,r2				*9
00071f30: 00042080 sll r4,r4,0x02				*36 (0x24)
00071f34: 2463ffff addiu r3,r3,0xffff			decrement ??
00071f38: 3c01800c lui r1,0x800c
00071f3c: 2421b520 addiu r1,r1,0xb520			800bb520
00071f40: 00240821 addu r1,r1,r4				get graphical menu data
00071f44: 8c220000 lw r2,0x0000(r1)				load ??
00071f48: 00031900 sll r3,r3,0x04
00071f4c: 00431021 addu r2,r2,r3
00071f50: 3c01800c lui r1,0x800c
00071f54: 2421b520 addiu r1,r1,0xb520			800bb520
00071f58: 00240821 addu r1,r1,r4				get graphical data?
00071f5c: ac220000 sw r2,0x0000(r1)
00071f60: 8e020030 lw r2,0x0030(r16)
00071f64: 00000000 nop
00071f68: 2442ffff addiu r2,r2,0xffff			decrement
00071f6c: 0801c80b j 0x0007202c
00071f70: ae02001c sw r2,0x001c(r16)			store bar menu selectedindex

00071f74: 0c01a404 jal 0x00069010
00071f78: 34044000 ori r4,r0,0x4000
00071f7c: 10400036 beq r2,r0,0x00072058
00071f80: 00000000 nop
If down arrow is pressed
00071f84: 8e030030 lw r3,0x0030(r16)			load ??
00071f88: 8e02001c lw r2,0x001c(r16)			load bar menu selectedindex
00071f8c: 2464ffff addiu r4,r3,0xffff			decrement ??
00071f90: 0044102a slt r2,r2,r4					set if bar menu selected index < ???
00071f94: 10400015 beq r2,r0,0x00071fec			branch if not
00071f98: 00042100 sll r4,r4,0x04				??*16

00071f9c: 8e020000 lw r2,0x0000(r16)			load ??
00071fa0: 00000000 nop
00071fa4: 000218c0 sll r3,r2,0x03
00071fa8: 00621821 addu r3,r3,r2
00071fac: 00031880 sll r3,r3,0x02
00071fb0: 3c01800c lui r1,0x800c
00071fb4: 2421b520 addiu r1,r1,0xb520			800bb520
00071fb8: 00230821 addu r1,r1,r3
00071fbc: 8c220000 lw r2,0x0000(r1)				load ??
00071fc0: 00000000 nop
00071fc4: 24420010 addiu r2,r2,0x0010			add 0x10
00071fc8: 3c01800c lui r1,0x800c
00071fcc: 2421b520 addiu r1,r1,0xb520			bb520
00071fd0: 00230821 addu r1,r1,r3
00071fd4: ac220000 sw r2,0x0000(r1)				store new
00071fd8: 8e02001c lw r2,0x001c(r16)			load selectedindex
00071fdc: 00000000 nop
00071fe0: 24420001 addiu r2,r2,0x0001			add 1
00071fe4: 0801c80b j 0x0007202c
00071fe8: ae02001c sw r2,0x001c(r16)			store new selectedindex

00071fec: 8e020000 lw r2,0x0000(r16)			load 
00071ff0: 00000000 nop
00071ff4: 000218c0 sll r3,r2,0x03
00071ff8: 00621821 addu r3,r3,r2
00071ffc: 00031880 sll r3,r3,0x02
00072000: 3c01800c lui r1,0x800c
00072004: 2421b520 addiu r1,r1,0xb520			get other data
00072008: 00230821 addu r1,r1,r3
0007200c: 8c220000 lw r2,0x0000(r1)				load ?
00072010: 00000000 nop
00072014: 00441023 subu r2,r2,r4				subtract the 2
00072018: 3c01800c lui r1,0x800c
0007201c: 2421b520 addiu r1,r1,0xb520
00072020: 00230821 addu r1,r1,r3
00072024: ac220000 sw r2,0x0000(r1)				store result
00072028: ae00001c sw r0,0x001c(r16)
0007202c: 0c02434c jal 0x00090d30					play sound
00072030: 34040003 ori r4,r0,0x0003
00072034: 8e02000c lw r2,0x000c(r16)			load ??
00072038: 00000000 nop
0007203c: 10400006 beq r2,r0,0x00072058			branch if ??
00072040: 3404000e ori r4,r0,0x000e

00072044: 34050019 ori r5,r0,0x0019
00072048: 3406b806 ori r6,r0,0xb806
0007204c: 0c03ffc2 jal 0x000fff08
00072050: 00003821 addu r7,r0,r0
00072054: ae00000c sw r0,0x000c(r16)
00072058: 8fbf0014 lw r31,0x0014(r29)
0007205c: 8fb00010 lw r16,0x0010(r29)
00072060: 27bd0018 addiu r29,r29,0x0018
00072064: 03e00008 jr r31
00072068: 00000000 nop