change a few of the index values:
8002CD00	1	#female heads
8002CD01	1	#male heads
8002CD02	1	#bodies

8002CD04	1	cur female head
8002CD05	1	cur male head
8002CD06	1	cur body


8002CD08	new start of value tables


-------
probably replaces most if not all the code

7F000110:	0x34C40	reset counters for random body/head tables
3C188003	LUI	T8,8003
00182025	OR	A0,R0,T8	A0=address of lists
240E0002	ADDIU	T6,R0,0002	T8=OFFSET TO # for each entry
;initialize
00001025	OR	V0,R0,R0	V0 will be our counter today
01D87821	ADDU	T7,T8,T6	T7=entry address
;loopus
808DCD08	LB	T5,CD08 (A0)
24840001	ADDIU	A0,A0,0001	next byte in the table
0509FFFD	BGEZL	T5,-3 [loopus]
24420001	ADDIU	V0,V0,0001	increment # counter
;save and next
A1E2CD00	SB	V0,CD00 (T7)	save new value
15C0FFF8	BNEZ	T6,-8 [initialize]
25CEFFFF	ADDIU	T6,T6,FFFF	decrement by 1
;ditch this
03E00008	JR	RA
00000000	NOP

---------
all below is new (probably)
//7F000F88:	0x35AB8	set new random value for all groups
34080002	ORI	T0,R0,0002	write +2,+1,+0
;loopus
0C002914	JAL	7000A450	returns V0=rand	fries AT,A0,A1,A2,V0
3C188003	LUI	T8,8003
03080821	ADDU	AT,T8,T0	AT=80030000+offset
8038CD00	LB	T8,CD00 (AT)	T8=# stuff
53000004	BEZL	T8,+4
A038CD04	SB	T8,CD04 (AT)	this prevents division by zero
0058001B	DIVU	V0,T8
0000C810	MFHI	T9
A039CD04	SB	T9,CD04 (AT)	T9=new random value
1D00FFF6	BGTZ	T0,-A	(loopus)
2108FFFF	ADDI	T0,T0,FFFF
//7F000FB8:
8FBF0014	LW	RA,0014 (SP)
03E00008	JR	RA
27BD0018	ADDIU	SP,SP,0018

  This should work, computing body(+2), male(+1), fem(+0).  If a table does =0, should handle it (mostly) gracefully.  It will probably still crash later on, but not here due to stupid division.

---------
new subroutine! -> 7F023590	0x580C0
7F023620:	0x58150	returns T7=gender flag for body A0
00047080	SLL	T6,A0,0x2
01C47021	ADDU	T6,T6,A0
000E7080	SLL	T6,T6,0x2	T6=head * 0x14
3C0F8004	LUI	T7,8004
01EE7821	ADDU	T7,T7,T6
03E00008	JR	RA
91EFDE20	LBU	T7,DE20 (T7)	8003DE20: gender flag for body

---------
7F0235AC:	0x580DC	normal random head routine
AFBFFFEC	*SW	RA,FFEC (SP)
0FC08D64	*JAL	7F023590	NEW ONE DOWN THERE!
00000000
100F000F	*BEQ	T7,R0,7F0235F8	PULL FEM HEADS
3C0B8003	*LUI	T3,8003
//7F0235C0:	pseudorandomize male head
0C002914	*JAL	7000A450	returns V0=random value; fries AT,A0,A1,A2,V0
9178CD05	*LBU	T8,CD05 (T3)	T8=current random male head
30590003	*ANDI	T9,V0,0003	reduces rand to two bits (4 unique heads)
8169CD01	*LB	T1,CD01 (T3)	T1=number of male head entries
03194021	*ADDU	T0,T8,T9
5920000F	*BLEZL	T1,[return]	no div by zero!
3403004E	*ORI	V1,R0,004E	default head is Bond Tux
0109001B	*DIVU	T0,T1
00005010	*MFHI	T2		T2=T0%T1 - number lying between 0-B
016AC021	*ADDU	T8,T3,T2	T8=upper half of head table offset
9179CD02	*LBU	T9,CD02 (T3)	T9=number of bodies (offset to data in table)
03191821	*ADDU	V1,T8,T9
//7F0235F0:	pull male head at offset
10000008	*BEQ	R0,R0,7F023614	return yo
9063CD09	*LBU	V1,CD09 (V1)	V1=random male head; adds +1 to addy for -1 bod val
//7F0235F8:	pull female head at offset
9163CD04	*LBU	V1,CD04 (T3)	cur fem head
916CCD02	*LBU	T4,CD02 (T3)	#bodies
006C1821	*ADDU	V1,V1,T4	V1+T4
916CCD01	*LBU	T4,CD01 (T3)	#male
006C1821	*ADDU	V1,V1,T4
006B5821	*ADDU	T3,V1,T3
9163CD0A	*LBU	V1,CD0A (T3)	V1=rand fem head; add +2 for -1 male+body entries
//7F023614:	return
8FBFFFEC	*LW	RA,FFEC (SP)
03E00008	*JR	RA
00601025	*OR	V0,V1,R0

---
7F023590:	0x58150
15 commands - random bodies MP, single solo

AFBFFFEC	*SW	RA,FFEC (SP)
0FC040A4	JAL	7F010290	returns T6=mode, V0=#players
3C0F8003	LUI	T7,8003
59C00007	BLEZL	T6, [retrieve]
91E8CD06	*LBU	T0,CD06 (T7)
//random
0C002914	*JAL	7000A450	returns V0=random; fries AT,A0,A1,A2,V0
91EECD02	*LBU	T6,CD02 (T7)	T9=count for body
59C00003	BLEZL	T6,[retrieve]	crappy error handling
00004025	OR	T0,R0,R0
004E001B	*DIVU	V0,T6
00004010	*MFHI	T0
//retrieve
01E87821	*ADDU	T7,T7,T0
8FBFFFEC	*LW	RA,FFEC (SP)
03E00008	JR	RA
91E2CD08	*LBU	V0,CD08 (T7)	V0=body value in 8002CD08 body table

0x582B0 = 0FC08D88

+++++++++
7F023660	0x58190	LOAD TRULY RANDOM HEAD
AFBFFFEC	*SW	RA,FFEC (SP)
0FC08D64	*JAL	7F023590	returns T7=gender for body A0
00000000	*NOP
*3C0E8003	*LUI	T6,8003
*91C3CD02	*LBU	V1,CD02 (T6)	V1=#bodies
*01C3C021	*ADDU	T8,T6,V1	T8=offset to data
15E00004	*BNEZ	T7,7F023684	+4	skip female-exclusive data offsetting
*01CFC821	*ADDU	T9,T6,T7	T9=cur head for gender;acts as an offset!  
sneaky, eh?
//7F023680:	female-exclusive offsetting
*91C3CD01	*LBU	V1,CD01 (T6)	V1=#male
0303C021	*ADDU	T8,T8,V1
27180001	*ADDIU	T8,T8,0001	accounts for -1 male head entry
//7F023684:	all genders
0C002914	*JAL	7000A450	returns V0=random; fries AT,A0,A1,A2,V0
9339CD00	*LB	T9,CD00 (T9)	T9=count for gender
5B200005	*BLEZL	T9,7F0236AC	+5	catch division by zero
3403004E	*ORI	V1,R0,004E	default is brosnan tux head
//7F02369C:	get head
0059001B	*DIVU	V0,T9
00004010	*MFHI	T0
0308C021	*ADDU	T8,T8,T0
9303CD09	*LBU	V1,CD09 (T8)	V1=head; start at data+1 accounting for body entry -1
//7F0236AC:	return
8FBFFFEC	*LW	RA,FFEC (SP)
03E00008	*JR	RA
00601025	*OR	V0,V1,R0

--------

--------
MP characters would be done easiest through recall routines.  Make them more efficient
7F079F68 calls the two that retrieve heads/bodies

switch the calls so you can get the body number!
[rewrite]
7F079F68:	0xAEA98
0FC040D7	*JAL	7F01035C
00402025	OR	A0,V0,R0
0FC26C54	JAL	7F09B150
AFA20044	*SW	V0,0044 (SP)
0FC040AF	*JAL	7F0102BC
00402025	OR	A0,V0,R0
AFA20040	*SW	V0,0040 (SP)

---
7F0102BC:	MP character head
SLL	T6,A0,0x2
LUI	V1,8003
ADDU	V1,V1,T6
LW	V1,B524 (V1)	V1=selection
SLL	T7,A0,0x2
LUI	V0,8003
BGEZ	V1,7F0102F4	uhm, branch if a valid selection?
SLL	T8,V1,0x2	
//7F0102E0:	invalid selection?
SUBU	T7,T7,A0
LUI	V0,8003
ADDU	V0,V0,T7
JR	RA
LHU	V0,B19E (V0)
//7F0102F4:	valid selection
SUBU	T8,T8,V1
SLL	T8,T8,0x2	T8=selection * 0xC
ADDU	V0,V0,T8
LHU	V0,B19E (V0)	V0=head
JR	RA
NOP

[Rewrite!]
44DEC:
00047080	SLL	T6,A0,0x2
3C028003	*LUI	V0,8003
004E1821	*ADDU	V1,V0,T6
8C63B524	LW	V1,B524 (V1)	V1=selection
00037080	*SLL	T6,V1,0x2
01C37023	*SUBU	T6,T6,V1
000E7080	*SLL	T6,T6,0x2	T8=selection * 0xC
004E1021	*ADDU	V0,V0,T6
8342B19E	*LH	V0,B19E (V0)	V0=head
04410004	*BGEZ	V0,+3
AFBF0040	*SW	RA,0040 (SP)	(head is stored here after J, so it works)
8FA40044	*LW	A0,0044 (SP)	body value from stack 0FC08D98	*JAL	7F023660	truly-random head routine from above
8FBF0040	*LW	RA,0040 (SP)	(test!  Should directly jump back from subroutine)
//7F0102F8:	valid selection
03E00008	*JR	RA
00000000	*NOP
-LHU	V0,B19E (V0)	V0=head
-JR	RA
-NOP

------
7F01030C:	44E3C	MP YELP gender block
ORIGINAL
00047080	SLL	T6,A0,0x2
3C038003	LUI	V1,8003
006E1821	ADDU	V1,V1,T6
8C63B524	LW	V1,B524 (V1)	V1=selection
00047880	SLL	T7,A0,0x2
3C028003	LUI	V0,8003
04610007	BGEZ	V1,+7
0003C080	SLL	T8,V1,0x2
01E47823	SUBU	T7,T7,A0
000F7880	SLL	T7,T7,0x2
3C028003	LUI	V0,8003
004F1021	ADDU	V0,V0,T7
03E00008	JR	RA
9042B19A	LBU	V0,B19A (V0)
0303C023	SUBU	T8,T8,V1
0018C080	SLL	T8,T8,0x2
00581021	ADDU	V0,V0,T8
9042B19A	LBU	V0,B19A (V0)
03E00008	JR	RA
00000000	NOP

rewrite!  Should pull it from the body, not from the block of data
[REWRITE]	7F01030C	44E3C	MP gender block
00047080	SLL	T6,A0,0x2	selected(A0)->offset
3C038008	LUI	V1,8008
006E1821	ADDU	V1,V1,T6
8C639EE0	LW	V1,9EE0 (V1)	V1=playerdata for selected
8C6300A8	LW	V1,00A8 (V1)	8006 data for char
8C630004	LW	V1,0004 (V1)	MP only: player guarddata
AFBFFFEC	SW	RA,FFEC (SP)
0FC08D64	JAL	[body->gender subroutine]
9064000F	LBU	A0,000F (V1)	A0=BODY
8FBFFFEC	LW	RA,FFEC (SP)
03E00008	JR	RA
000F1025	OR	V0,R0,T7

or this one omits the subroutine
00047080	SLL	T6,A0,0x2	selected(A0)->offset
3C028008	LUI	V0,8008
004E1021	ADDU	V0,V0,T6
8C429EE0	LW	V0,9EE0 (V0)	V1=playerdata for selected
8C4200A8	LW	V0,00A8 (V0)	8006 data for char
8C420004	LW	V0,0004 (V0)	MP only: player guarddata
54400001	BNEZL	V0,+1	skip if pointers get screwed
9042000F	LBU	V0,000F (V0)	A0=BODY
00027080	SLL	T6,V0,0x2
01C27021	ADDU	T6,T6,V0
000E7080	SLL	T6,T6,0x2	T6=head * 0x14
3C028004	LUI	V0,8004
004E1021	ADDU	V0,V0,T6
03E00008	JR	RA
9042DE20	LBU	V0,DE20 (V0)

called (after loading A0=selected) at 7F027118 - when shot


------
7F01035C:	MP character body
SLL	T6,A0,0x2	A0=player#
LUI	V1,8003
ADDU	V1,V1,T6
LW	V1,B524 (V1)	V1=selection
SLL	T7,A0,0x2
LUI	V0,8003
BGEZ	V1,7F010394	uhm, branch if a valid selection?
SLL	T8,V1,0x2	
//7F010380:	invalid selection?
SUBU	T7,T7,A0
LUI	V0,8003
ADDU	V0,V0,T7
JR	RA
LHU	V0,B19C (V0)
//7F010394:	valid selection
SUBU	T8,T8,V1
SLL	T8,T8,0x2	T8=selection * 0xC
ADDU	V0,V0,T8
LHU	V0,B19C (V0)	V0=body
JR	RA
NOP

[REWRITE]
44E8C:
00047080	SLL	T6,A0,0x2
3C028003	*LUI	V0,8003
004E1821	*ADDU	V1,V0,T6
8C63B524	LW	V1,B524 (V1)	V1=selection
00037080	*SLL	T6,V1,0x2
01C37023	*SUBU	T6,T6,V1
000E7080	*SLL	T6,T6,0x2	T8=selection * 0xC
004E1021	*ADDU	V0,V0,T6
8342B19D	*LH	V0,B19D (V0)	V0=body
04410003	*BGEZ	V0,+3
AFBF0044	*SW	RA,0044 (SP)	(body is stored here after J, so it works)
0FC08D88	*JAL	truly-random head routien from above
8FBF0044	*LW	RA,0044 (SP)	(test!  Should directly jump back from subroutine)
//7F0102F4:	valid selection
03E00008	*JR	RA
00000000	*NOP

++++++++
//7F079FA0:	set up playerdata; get # players, hop to 7F07A1BC if multi
//7F07A2A4:	calls 7F0200BC: setting guarddata for player I guess

7F0200BC:	first, gets a pointer for player guarddata
	7F020130	sets 8006 positionblock data (0x0-0x14)
	7F020164	calls 7F06FF5C: saves 7F01FC10->[801DB950]
	7F0201A8	recalls current ID (1388) f/ 8002CC60, saves to guarddata
	7F0201C0	inc ID, save it again
	7F0201D4	0->head; 0->body
			HEAD=SP+34 or SP+70; BODY=SP+30 or SP+74


--
7F0201A8:	54CD8		COPIES BODY/HEAD TO PLAYER GUARDDATA
	LUI	V0,8003
8FAA0030	*LW	T2,0030 (SP)	BODY
8C48CC60	*LW	T0,CC60 (V0)
	LUI	T3,8005
	LUI	AT,437A
	SH	T0,0000 (S0)
8FA90034	*LW	T1,0034 (SP)	HEAD
	MTC1	AT,F10
	LUI	AT,3F80
25080001	*ADDIU	T0,T0,0001
AC48CC60	*SW	T0,CC60 (V0)
A2090006	*SB	T1,0006 (S0)
A20A000F	*SB	T2,000F (S0)

-------------------
RANDOM BODIES IN INTRO

//7F0187BC:	0x4D2EC
`	LW	T9,0004 (A0)	head value
`	LW	T1,B8C8 (T1)	8002B8C8 - probably for random wep or animation selection
AFA9006C	*SW	T1,006C (SP)
`	BNEZ	T2,7F0187D4
`	NOP
`	BREAK
//7F0187D4:
200AFFFF	ADDI	T2,R0,FFFF
150A000F	BNE	T0,T2,7F018818
3C0A8003	LUI	T2,8003
0C002914	JAL	7000A450	returns V0=random; fries AT,A0,A1,A2,V0
9148CD02	LUI	T2,8003
//7F0187E8-7F01886C	random BODY
0048001B	DIVU	V0,T0
00000810	MFHI	AT
9149CD06	LBU	T1,CD06 (T2)
50290001	BEQL	AT,T1,+1
24210001	ADDIU	AT,AT,0001
50280001	BEQL	AT,T0,+1
24010000	ADDIU	AT,R0,0000
A149CD06	SB	T1,CD06 (T2)	never the same guy twice!
00000000	nop?
00000000	nop?
002A5021	ADDU	T2,AT,T2
9148CD08	LBU	T0,CD08 (T2)
24010016	ADDIU	AT,R0,0016
//7F01881C:	
AFA8008C	SW	T0,008C (SP)	save body
01005025	OR	T2,T0,R0
AFB90088	SW	T9,0088 (SP)	save head
15010010	BNE	T0,AT,7F01886C	branch if not the bond suit #16
00000000	*NOP?
//7F018830:	
00000000	*NOP?
00000000	*NOP?
0C002914	JAL	7000A450	returns V0=random; fries AT,A0,A1,A2,V0
240C0005	ADDIU	T4,R0,0005
004C001B	DIVU	V0,T4
//7F018844:	increment and correct for tux
00005810	MFHI	T3
0168C021	ADDU	T8,T3,T0
240F001A	ADDIU	T7,R0,001A
51F80001	BEQL	T7,T8,+1
24180005	ADDIU	T8,R0,0005
//7F018858:
51980001	BEQL	T4,T8,+1
	ADDIU	T9,R0,004E	!these lines unchanged!
	SW	T9,0088 (SP)
!BEQ	R0,R0,7F0188C0
!SW	T8,008C (SP)
//7F01886C:


//7F0188C0:	0x4D3F0		!do the heads!
LW	T9,0088 (SP)
00000000	*nop
07230005	*BGEZL	T9,7F0188E0	branch if not FF9F...
LW	T7,00B4 (SP)
//7F0188D0:
JAL	7F023660	RETURNS V0=very random head
LW	A0,008C (SP)	A0=body
SW	V0,0088 (SP)
LW	T7,00B4 (SP)

FINAL:
04D3F8	0002	0723


//7F01927C:	0x4DDAC	change endpoint to unused!=0
818B0009	*LB	T3,0009 (T4)
11600003	*BEQ	T3,R0,7F019290
818D0000	*LB	T5,0000 (T4)

-	random weapon recall

//7F018A50:	0x4D580
3C0F8003	LUI	T7,8003
018F7021	ADDU	T6,T7,T4
91CEBA74	LBU	T6,BA74 (T6)
11C00078	BEQ	T6,R0,7F018C40	if no weapons, branch
//7F018A64:	2=rifles
000E4021	ADDU	T0,R0,T6
0C002914	JAL	7000A450
24090002	ADDIU	T1,R0,0002
004E001B	DIVU	V0,T6
00004010	MFHI	T0
51800001	BEQL	T4,R0,+1
25080001	ADDIU	T0,T0,0001
110E0070	BEQ	T0,T6,7F018C40	completely unarmed when over # entries
00084040	SLL	T0,T0,0x1
010F1821	ADDU	V1,T0,T7
55890001	BNEL	T4,T1,+1	if not rifles, add +0x18
24630018	ADDIU	V1,V1,0018
51800001	BEQL	T4,R0,+1	if unarmed, add another +0x1E
2463001E	ADDIU	V1,V1,001E
1000001E	BEQ	R0,R0,7F018B14
9463BA38	LHU	V1,BA38 (V1)

FINAL:
3C 0F 80 03 01 8F 70 21 91 CE BA 74 11 C0 00 78 
00 0E 40 21 0C 00 29 14 24 09 00 02 51 80 00 01 
25 08 00 01 00 48 00 1B 00 00 40 10 11 0E 00 70 
00 08 40 40 01 0F 18 21 55 89 00 01 24 63 00 18 
51 80 00 01 24 63 00 1E 10 00 00 1E 94 63 BA 38 
