7F012EC4	479F4	menu 10 interface: handicap select
ADDIU	SP,SP,FFB8
SW	RA,003C (SP)
SW	S8,0038 (SP)
SW	S7,0034 (SP)
SW	S6,0030 (SP)
SW	S5,002C (SP)
SW	S4,0028 (SP)
SW	S3,0024 (SP)
SW	S2,0020 (SP)
SW	S1,001C (SP)
JAL	7F010290	;ret V0=selected #MP players
SW	S0,0018 (SP)
LUI	AT,4270
MTC1	AT,F12		;F12=60.0
SW	V0,0044 (SP)	;#player->SP+44
JAL	70004544
OR	S8,R0,R0
LUI	AT,8005
JAL	70004590
LWC1	F12,1A90 (AT)	;60.0->80051A90: ???
LUI	AT,42C8
MTC1	AT,F12		;F12=100.0
LUI	AT,8005
JAL	70004650
LWC1	F14,1A94 (AT)	;100.0->80051A94: ???
JAL	70004534	;stores A0->p@800232A8+24: ???
OR	A0,R0,R0	;A0=0
LW	T6,0044 (SP)	;T6=SP+44: #sel players
OR	S3,R0,R0	;S3=0: playercounter
OR	S4,R0,R0	;S4=0: offset to player's slot
BLEZ	T6,7F0130FC	;branch if stupid # players
LUI	S1,8007
LUI	S6,8007
LUI	S5,8006
ADDIU	S5,S5,3720	;S5=80063720: p->SE buffer
ADDIU	S6,S6,97A8	;S6=800697A8: selected handicaps
ADDIU	S1,S1,9740	;S1=80069740: ???
ADDIU	S7,R0,0001	;S7=1
//7F012F5C:	47A8C	test each player for updates - cancel first
LW	T7,0000 (S1)
SLL	A0,S3,0x18	;A0=S3<<18: player*1000000
SRA	T8,A0,0x18	;T8=A0>>18: 1-byte player number
BEQ	T7,R0,7F012F90
OR	A0,T8,R0	;A0=T8: playercount & 0xFF
JAL	7000C3AC	;ret V0=button mask A1 on player A0's controller
ADDIU	A1,R0,4000	;A1=0x4000: B button
BEQ	V0,R0,7F012F90	;branch if B not pressed
ADDIU	A1,R0,00C7	;A1=SE 0C7: menu selection and folder change
SW	R0,0000 (S1)
LW	A0,0000 (S5)	;A0=80063720: p->SE buffer
JAL	70008E08	;play SE A1
OR	A2,R0,R0	;A2=0: NULL p->data
//7F012F90:
LW	V0,0000 (S1)
SLL	S0,S3,0x18
SRA	T9,S0,0x18
BNEZ	V0,7F0130E0
OR	S0,T9,R0
//7F012FA4:	47AD4	press left - decrement list
SLL	A0,T9,0x18
LUI	T1,8007
ADDIU	T1,T1,9760	;T1=80069760: 
SRA	T0,A0,0x18
OR	A0,T0,R0
ADDU	S2,S4,T1
JAL	7000C3AC	;ret V0=button mask A1 on player A0's controller
ADDIU	A1,R0,0202	;A1=0202: dpad or c-left
BNEZ	V0,7F012FF4	;branch if either was pressed
SLL	A0,S0,0x18
SRA	T2,A0,0x18
OR	A0,T2,R0	;A0=player#
ADDIU	A1,R0,FFFE
JAL	7000C4B4	;ret V0=control stick state?
OR	A2,S7,R0
SLTI	AT,V0,FFFF	;TRUE if holding stick left
BEQ	AT,R0,7F01300C	;??? - test increment
SLL	A0,S0,0x18
LW	T3,0000 (S2)
BEQ	T3,R0,7F01300C	;??? - increment instead
//7F012FF4:	47B24	decrement if not at end
ADDU	V0,S6,S4	;V0=S6+S4: p->sel.handicaps + offset to player's entry
LW	V1,0000 (V0)	;V1=cur.handicap
BLEZ	V1,7F01308C	;branch if already at 0
ADDIU	T4,V1,FFFF	;T4=cur.handicap--
BEQ	R0,R0,7F01308C
SW	T4,0000 (V0)	;T4->cur.handicap: save new setting
//7F01300C:	47B54	press right - increment list
SRA	T5,A0,0x18
OR	A0,T5,R0
JAL	7000C3AC	;ret V0=button mask A1 on player A0's controller
ADDIU	A1,R0,0101	;A1=0101: dpad or c-right
BNEZ	V0,7F013048
SLL	A0,S0,0x18
SRA	T6,A0,0x18
OR	A0,T6,R0
ADDIU	A1,R0,FFFE
//7F013030:
JAL	7000C4B4
OR	A2,S7,R0
BLEZ	V0,7F013064
SLL	A0,S0,0x18
LW	T7,0000 (S2)
BEQ	T7,R0,7F013064
//7F013048:	47B78	increment if not at end
ADDU	V0,S6,S4	;V0=S6+S4: p->sel.handicaps + offset to player's entry
LW	V1,0000 (V0)	;V1=cur.handicap
SLTI	AT,V1,000A	;TRUE if < A (max # entries)
BEQ	AT,R0,7F01308C	;branch if over limit
ADDIU	T8,V1,0001	;T8=cur.handicap++
BEQ	R0,R0,7F01308C
SW	T8,0000 (V0)	;T8->cur.handicap: save new handicap
//7F013064:	47B94	press A - select entry
SRA	T9,A0,0x18
OR	A0,T9,R0	;A0=player# & 0xFF, effectively
JAL	7000C3AC	;ret V0=button mask A1 on player A0's controller
ORI	A1,R0,B000	;A1=button mask
BEQ	V0,R0,7F01308C
ADDIU	A1,R0,00C7	;A1=SE 0C7: menu selection and folder change
SW	S7,0000 (S1)
LW	A0,0000 (S5)	;A0=p->SE buffer
JAL	70008E08	;play SE 0C7
OR	A2,R0,R0	;A2=0: NULL p->data
//7F01308C:	47BBC
SLL	A0,S0,0x18
SRA	T0,A0,0x18
OR	A0,T0,R0
ADDIU	A1,R0,FFFE
JAL	7000C4B4
OR	A2,S7,R0
ADDIU	AT,R0,FFFF
BEQ	V0,AT,7F0130CC
SLL	A0,S0,0x18
SRA	T1,A0,0x18
OR	A0,T1,R0
ADDIU	A1,R0,FFFE
JAL	7000C4B4
OR	A2,S7,R0
BNEL	V0,R0,7F0130DC
SW	R0,0000 (S2)
//7F0130CC:
SW	S7,0000 (S2)
BEQ	R0,R0,7F0130E0
LW	V0,0000 (S1)
//7F0130D8:
SW	R0,0000 (S2)
LW	V0,0000 (S1)
//7F0130E0:
BEQ	V0,R0,7F0130EC
LW	T2,0044 (SP)	;T2=sel#players
ADDIU	S8,S8,0001	;S8++
//7F0130EC:	47C1C	loop per player
ADDIU	S3,S3,0001	;S3++
ADDIU	S4,S4,0004	;S4+=4: next player slot
BNE	S3,T2,7F012F5C	;branch if you have more players to go
ADDIU	S1,S1,0004	;S1+=4
//7F0130FC:	47C2C	done checking updates...
LUI	S0,8003
ADDIU	S0,S0,A95C	;S0=8002A95C: ???
JAL	7F00B724
LW	A0,0000 (S0)
LW	A0,0000 (S0)
OR	A1,R0,R0	;A1=0
JAL	7F00B7C0
ADDIU	A2,R0,0001	;A2=1
LW	A0,0000 (S0)
ADDIU	A1,R0,002A
JAL	7F00B7C0
ADDIU	A2,R0,0001
JAL	7F009B84
NOP	
LW	T3,0044 (SP)
ADDIU	A0,R0,000E
BNEL	S8,T3,7F013150
LW	RA,003C (SP)
JAL	7F01A5D4
OR	A1,R0,R0
//7F01314C:	47C7C	return
LW	RA,003C (SP)
LW	S0,0018 (SP)
LW	S1,001C (SP)
LW	S2,0020 (SP)
LW	S3,0024 (SP)
LW	S4,0028 (SP)
LW	S5,002C (SP)
LW	S6,0030 (SP)
LW	S7,0034 (SP)
LW	S8,0038 (SP)
JR	RA
ADDIU	SP,SP,0048
