NOTE:	I have undoubtedly molested this routine when hacking the no flag scenarios.  Read that for sure...

7F004434:	jump that executes specific object expansion
LW	T7,0278 (SP)	//the infamous 'better equal 1 if you want objects'...
BEQ	T7,R0,7F004AFC
NOP
LW	T6,000C (S2)	//upper 32 bitflags
OR	A0,S5,R0
OR	A1,S2,R0	//A1=S2=address of object
AND	T8,T6,S4
BNEZ	T8,7F004AFC	//skip if killflags present
NOP
JAL	7F002738	//specific parsing code for weapons
OR	A2,S3,R0
//7F004460:
BEQ	R0,R0,7F004AFC
NOP


7F002738:	the main honcho.  calls necessary 08 expansion code
ADDIU	SP,SP,FFD8
SW	RA,0014 (SP)
SW	A0,0028 (SP)
SW	A2,0030 (SP)
LW	T6,0008 (A1)	//T6=high bitfield
OR	A3,A1,R0	//A3=A1=object data address
ANDI	T7,T6,4000
BEQL	T7,R0,7F002804	//branch if no assigned to a guard
ADDIU	A1,R0,0001	//A1=1
//7F00275C:	weapon attached to guard
LH	A0,0006 (A1)	//A0=preset
JAL	7F022FC8
SW	A1,002C (SP)
LW	A3,002C (SP)	//A3=object data address
BEQ	V0,R0,7F002998
SW	V0,001C (SP)
LW	T8,0018 (V0)	//
BEQL	T8,R0,7F00299C
LW	RA,0014 (SP)
LW	T9,001C (V0)
ADDIU	A0,R0,001C	//A0=1C
BEQL	T9,R0,7F00299C
LW	RA,0014 (SP)
JAL	7F0927BC
SW	A3,002C (SP)
//7F002798:
BEQ	V0,R0,7F0027E0
LW	A3,002C (SP)
LB	T0,0080 (A3)
ADDIU	T1,T0,FFFE
SLTIU	AT,T1,001E
BEQ	AT,R0,7F0027E0
SLL	T1,T1,0x2
LUI	AT,8005
ADDU	AT,AT,T1
LW	T1,EEB8 (AT)	//T1=8004EEB8 + offset
JR	T1
NOP

--------------------------------------
//7F0027C8:
ADDIU	T2,R0,0019
ADDIU	T3,R0,00D3
ADDIU	T4,R0,0100
SB	T2,0080 (A3)	//set weapon as grenade
SH	T3,0004 (A3)	//set model as grenade
SH	T4,0000 (A3)	//set scale=100%
//7F0027E0:
LB	A0,0080 (A3)	//A0=weapon type
JAL	7F005710
SW	A3,002C (SP)
LW	A0,002C (SP)	//A0=object data address
JAL	7F052030
LW	A1,001C (SP)
BEQ	R0,R0,7F00299C
LW	RA,0014 (SP)

--------------------------------------
//7F002800:	0x37330-E	MP expansion handling
ADDIU	A1,R0,0001
SW	A1,0018 (SP)
JAL	7F09A464	//RETURNS V0=# players
SW	A3,002C (SP)
SLTI	AT,V0,0002	//TRUE if solo
LW	A1,0018 (SP)
BNEZ	AT,7F00296C	//skip MP weapon expansion if solo
LW	A3,002C (SP)
ADDIU	T5,R0,FFFF	//T5=-1
LUI	AT,8007
SW	T5,9540 (AT)	//-1->80069540
LBU	V0,0080 (A3)	//V0=type
SLTI	AT,V0,0059	//tests if weapon is valid (<59)
BNEZ	AT,7F00285C	//retrieve type for MP or use current
ADDIU	T6,V0,FF10	//T6=MP weapon # converted to index
//7F00283C:	this only applies to MP weapons
SLTIU	AT,T6,0008
BEQ	AT,R0,7F00296C	//if < 8, doesn't think it is an MP weapon
SLL	T6,T6,0x2
LUI	AT,8005
ADDU	AT,AT,T6
LW	T6,EF30 (AT)	//T6=8004EF30 + offset	(all 8 = 7F002870)
JR	T6
NOP

--------------------------------------
7F00285C:	write 08 object fields; deal with flag first
	0x3738C-E
ADDIU	AT,R0,0058
BEQL	V0,AT,7F002950	//branch if flag
SW	A1,0018 (SP)
BEQ	R0,R0,7F002970	//branch if a normal weapon pickup
LB	A0,0080 (A3)	//A0=weapon type

7F002870:	figure out MP weapon type
	0x373B0-E
0FC31985	JAL	7F0C6614	//returns V0=pointer to weapon set
AFA7002C	SW	A3,002C (SP)
8FA7002C	LW	A3,002C (SP)	//A3=object address
3C018007	LUI	AT,8007
24090001	ADDIU	T1,R0,0001
90E40080	LBU	A0,0080 (A3)	//A0=weapon type
2484FF10	ADDIU	A0,A0,FF10	//A0=0-8
00047880	SLL	T7,A0,0x2
01E47823	SUBU	T7,T7,A0
000F78C0	SLL	T7,T7,0x3	//T7=offset	type*0x18
AC249540	SW	A0,9540 (AT)	//weapon set #->80069540	current weapon in set, read by 14 ammo box routine to set ammo type
004F1821	ADDU	V1,V0,T7	//V1=pointer to specific weapon data in set
8C780000	LW	T8,0000 (V1)	//T8=weapon type
3C014380	LUI	AT,4380
44813000	MTC1	AT,F6		;F6=256.0
A0F80080	SB	T8,0080 (A3)	//change object's weapon type to literal
8C790004	LW	T9,0004 (V1)	//T9=model type
3C014F00	LUI	AT,4F00
A4F90004	SH	T9,0004 (A3)	//change model type
C4640008	LWC1	F4,0008 (V1)	//F4=scale
46062202	MUL.S	F8,F4,F6	//F8=scale * 256.
4448F800	CFC1	T0,F31		;keep its current state here
44C9F800	CTC1	T1,F31		;sets rounding mode
00000000	NOP
460042A4	CVT.WS	F10,F8
4449F800	CFC1	T1,F31
00000000	NOP
31290078	ANDI	T1,T1,0078
51200013	BEQL	T1,R0,7F002930
44095000	MFC1	T1,F10		//T1=scale modified -> header scale value
//7F0028E8:
44815000	MTC1	AT,F10
24090001	ADDIU	T1,R0,0001
460A4281	SUB.S	F10,F8,F10
44C9F800	CTC1	T1,F31
00000000	NOP
460052A4	CVT.WS	F10,F10
4449F800	CFC1	T1,F31
00000000	NOP
31290078	ANDI	T1,T1,0078
15200005	BNEZ	T1,7F002924
00000000	NOP
44095000	MFC1	T1,F10
3C018000	LUI	AT,8000
10000007	BEQ	R0,R0,7F00293C
01214825	OR	T1,T1,AT
//7F002924:
10000005	BEQ	R0,R0,7F00293C
2409FFFF	ADDIU	T1,R0,FFFF	;default scale...
44095000	MFC1	T1,F10
//7F002930:
00000000	NOP
0520FFFB	BLTZ	T1,7F002924
00000000	NOP
44C8F800	CTC1	T0,F31
A4E90000	SH	T1,0000 (A3)	//scale->header
10000009	BEQ	R0,R0,7F00296C
8C650014	LW	A1,0014 (V1)	//A1=1 if weapon pickup present
----------
//7F00294C:	//Flag tag check; remember to set SP and RA back to normal
	0x3747C-E
SW	A1,0018 (SP)
JAL	7F014758	//returns V0=8002B540=scenario
SW	A3,002C (SP)
ADDIU	AT,R0,0002
LW	A1,0018 (SP)
BEQ	V0,AT,7F00296C	//available if flag tag...
LW	A3,002C (SP)	//A3=object data
OR	A1,R0,R0	//A1=0 (no pickup!)
----------
//7F00296C:	generic weapon expansion - SOLO and MP
	0x3749C-E
LB	A0,0080 (A3)	//weapon type

BEQL	A0,R0,7F00299C	//skip if type 0
LW	RA,0014 (SP)
BEQL	A1,R0,7F00299C	//skip if no pickup
LW	RA,0014 (SP)
JAL	7F005710	//sets throwable models. returns V0=1 loaded model
SW	A3,002C (SP)	//save the object offset
LW	A1,002C (SP)	//A1=object offset
LW	A0,0028 (SP)
JAL	7F001D9C	//expand object
LW	A2,0030 (SP)
LW	RA,0014 (SP)
//7F00299C
ADDIU	SP,SP,0028
JR	RA
NOP

--------------------------------------


--------------------------------------
-7F005710:
ADDIU	T6,A0,FFFD	//T6=weapon type-3
ADDIU	SP,SP,FFE8
SLTIU	AT,T6,002E	//TRUE if a selectable weapon (Tank and below)
SW	RA,0014 (SP)
BEQ	AT,R0,7F00589C
ADDIU	A1,R0,FFFF	//A1=-1
SLL	T6,T6,0x2	//weapon type -> offset
LUI	AT,8005
ADDU	AT,AT,T6
LW	T6,F0F0 (AT)	//T6=8004F0F0 + offset
JR	T6
NOP
...
sets model values for specific objects
...
//7F00579C:
BLTZ	A1,7F0057B4	//if model not set, return
OR	V0,R0,R0
JAL	7F056C38	//if model loaded, return V0=1?
OR	A0,A1,R0	//A0=A1=model
BEQ	R0,R0,7F0057B8
LW	RA,0014 (SP)
//7F0057B4:
LW	RA,0014 (SP)
ADDIU	SP,SP,0018
JR	RA
NOP

--------------------------------------
7F001D9C:	expand object.  All objects call this routine

--------------------------------------
7F056C38:	returns V0=1 if model sucessfully loaded
	ACCEPTS	A0=model
SLL	T6,A0,0x2
SUBU	T6,T6,A0
LUI	T7,8004
ADDIU	T7,T7,A228	//T7=8003A228
SLL	T6,T6,0x2	//T6=model# * 0xC
ADDU	V0,T6,T7
LW	A2,0000 (V0)	//A2=model load line from object ist
ADDIU	SP,SP,FFE0
SW	RA,0014 (SP)
LW	T8,0000 (A2)	//T8=address of model data; NULL if not loaded
OR	A0,A2,R0	//A0=A2=model load line
BNEL	T8,R0,7F056C90	//don't bother if the model is loaded
OR	V0,R0,R0
LW	A1,0004 (V0)	//A1=addy of model archetype
JAL	7F07654C	//loads model and images
SW	V0,001C (SP)
LW	V0,001C (SP)
JAL	7F075CF4	//process entry#s for all model Table types
LW	A0,0000 (V0)
BEQ	R0,R0,7F056C90
ADDIU	V0,R0,0001	//return sucessful
//7F056C90:
LW	RA,0014 (SP)
ADDIU	SP,SP,0020
JR	RA
NOP


7F075B1C:	set Table list entry numbers for types; returns V0=last entry#
ADDIU	SP,SP,FFE0
SW	S1,0018 (SP)
SW	S0,0014 (SP)
SW	RA,001C (SP)
OR	A2,A0,R0	//A2=A0=Table entry
OR	S1,R0,R0	//S1=0
BEQ	A0,R0,7F075CDC	//kill if NULL pointer
OR	S0,A0,R0	//S0=A0=Table entry
LHU	V0,0000 (S0)	//V0=type
//7F075B40:
ANDI	T6,V0,00FF	//T6=type (no flags)
ADDIU	T7,T6,FFFF	//T7=type-1
SLTIU	AT,T7,0018	//TRUE if valid (1-18)
BEQ	AT,R0,7F075C84
SLL	T7,T7,0x2	//T7=type->offset
LUI	AT,8005
ADDU	AT,AT,T7
LW	T7,4E74 (AT)	//T7=80054E74+offset
JR	T7
NOP
...
7F075B68:	01 entries	container for complex multipart models
LW	V0,0004 (S0)	//V0=entry's data
SH	S1,000C (V0)	//save counter to 01 data+0xC
ADDIU	S1,S1,0018	//S1+=18	offset to next
ANDI	T8,S1,FFFF
OR	S1,T8,R0	//S1 remains a halfword
BEQ	R0,R0,7F075C88
LW	V1,0014 (S0)	//V1=child entry
...
7F075B84:	07 entries	UNKNOWN TYPE!
LW	V0,0004 (S0)	//V0=entry's data
SH	S1,01AA (V0)	//save counter to 07 data + 0x1AA
ADDIU	S1,S1,0001	//S1++
ANDI	T9,S1,FFFF
OR	S1,T9,R0	//S1 remains a halfword
BEQ	R0,R0,7F075C88
LW	V1,0014 (S0)	//V1=child entry
...
7F075BA0:	08 entries	distance trigger
LW	V0,0004 (S0)
SH	S1,000C (V0)	//save counter to 08 data + 0xC
LW	V1,0008 (V0)	//V1=offset to activated display list entry
ADDIU	S1,S1,0001	//S1++
ANDI	T0,S1,FFFF
OR	S1,T0,R0	//S1 remains a halfword
BEQ	R0,R0,7F075C88
SW	V1,0014 (S0)	//activated->child entry
...
7F075BC0:	12 entries	tag entry
LW	V0,0004 (S0)
SH	S1,0004 (V0)	//save counter to 12 data + 0x4
LW	V1,0000 (V0)	//V1=offset to display list entry
ADDIU	S1,S1,0001	//S1++
ANDI	T2,S1,FFFF
OR	S1,T2,R0	//S1 remains halfword
BEQ	R0,R0,7F075C88
SW	V1,0014 (S0)	//DL->child entry
...
7F075BE0:	17 entries	head model placeholder
LW	V0,0004 (S0)
OR	V1,R0,R0	//V1=0
SH	S1,0000 (V0)	//save counter to 17 data + 0x0
ADDIU	S1,S1,0002	//S1+=2
ANDI	T4,S1,FFFF
OR	S1,T4,R0	//S1 remains halfword
BEQ	R0,R0,7F075C88
SW	R0,0014 (S0)	//eliminate any child entries
...
7F075C00:	09 entries	hat placement
LW	V0,0004 (S0)	//V0=entry's data
OR	A0,S0,R0	//A0=S0=Table entry pointer
OR	A1,R0,R0	//A1=0
SH	S1,0022 (V0)	//save counter to 09 data + 0x22
ADDIU	S1,S1,0001	//S1++
ANDI	T5,S1,FFFF
OR	S1,T5,R0	//S1 remains halfword
JAL	7F06EA54
SW	A2,0020 (SP)
LW	A2,0020 (SP)
BEQ	R0,R0,7F075C88
LW	V1,0014 (S0)	//v1=child entry
...
7F075C30:	0B entries	UNKNOWN TYPE!
LW	V0,0004 (S0)
SH	S1,0044 (V0)	//save counter to 0B data + 0x44
ADDIU	S1,S1,0001	//S1++
ANDI	T6,S1,FFFF
OR	S1,T6,R0	//S1 remains halfword
BEQ	R0,R0,7F075C88
LW	V1,0014 (S0)	//V1=child entry
...
7F075C4C:	0C entries	firing effect for weapons
LW	V0,0004 (S0)
SH	S1,0020 (V0)	//save counter to 0C data + 0x20
ADDIU	S1,S1,0001	//S1++
ANDI	T7,S1,FFFF
OR	S1,T7,R0	//S1 remains hafword
BEQ	R0,R0,7F075C88
LW	V1,0014 (S0)	//V1=child entry
...
7F075C68:	18 entries	display list (2 DLs, collisions, merging)
LW	V0,0004 (S0)
SH	S1,001A (V0)	//save counter to 18 data + 0x1A
ADDIU	S1,S1,0002	//S1+=2
ANDI	T8,S1,FFFF
OR	S1,T8,R0	//S1 remains halfword
BEQ	R0,R0,7F075C88
LW	V1,0014 (S0)	//V1=child entry
...
7F075C84:	loopus
LW	V1,0014 (S0)	//V1=child entry
BEQ	V1,R0,7F075C98
NOP
BEQ	R0,R0,7F075CD4
OR	S0,V1,R0	//S0=V1=child entry
//7F075C98:	if child NULL...
BEQ	S0,R0,7F075CD4
NOP
LW	V1,0008 (A2)	//V1=parent entry
//7F075CA4:
BNEL	S0,V1,7F075CB8	//test if self-referencing...
LW	V0,000C (S0)	//V0=next entry (I think)
BEQ	R0,R0,7F075CD4
OR	S0,R0,R0	//S0=NULL
//7F075CB8:
BEQL	V0,R0,7F075CCC	//test if next entry NULL
LW	S0,0008 (S0)	//S0=parent entry
BEQ	R0,R0,7F075CD4
OR	S0,V0,R0	//S0=V0=next entry
//7F075CCC:
BNEZ	S0,7F075CA4	//either parent NULL or use parent's next
NOP
//7F075CD4:
BNEL	S0,R0,7F075B40	//if there's another entry to process, branch
LHU	V0,0000 (S0)	//V0=type
LW	RA,001C (SP)
OR	V0,S1,R0	//V0=S1=counter
LW	S1,0018 (SP)
LW	S0,0014 (SP)
JR	RA
ADDIU	SP,SP,0020

7F075CF4:	reroute to 7F075B1C
ADDIU	SP,SP,FFE8
SW	RA,0014 (SP)
ADDIU	T6,R0,0001	//T6=1
OR	A1,A0,R0	//A1=A0=model load line
SW	T6,001C (A0)	//1->model loaded indicator
LW	A0,0000 (A0)	//A0=offset to Table
JAL	7F075B1C	//sets entry numbers for certain model Table types
			//returns V0=last entry #
SW	A1,0018 (SP)
LW	A1,0018 (SP)	//A1=model load line
SH	V0,0014 (A1)	//save last entry # to 0x14
LW	RA,0014 (SP)
ADDIU	SP,SP,0018
JR	RA
NOP


7F0764A4:	loads model with A0=load line, A1=string name
ADDIU	SP,SP,FFE0
SW	S0,0018 (SP)
OR	S0,A0,R0	//S0=A0=model load line address
SW	RA,001C (SP)
SW	A1,0024 (SP)	//A1=P->string name
BEQ	A2,R0,7F0764D4
SW	A2,0028 (SP)	//[specificly set to 0 by referer]
//7F0764C0:
OR	A0,A1,R0
JAL	7F0BCD40
OR	A1,R0,R0
BEQ	R0,R0,7F0764EC
OR	A2,V0,R0
//7F0764D4:
LW	A0,0024 (SP)	//A0=string name
OR	A1,R0,R0	//A1=0
ADDIU	A2,R0,0100	//A2=0100
JAL	7F0BCD04	//I think this loads model data!  returns V0=addy
ADDIU	A3,R0,0004	//A3=4
OR	A2,V0,R0	//A2=V0=pointer to model data
//7F0764EC:
LH	T9,0016 (S0)	//T9=# images
LH	T7,000C (S0)	//T7=# offsets
SW	A2,0008 (S0)	//save model data offset to 0x8 in load line
SLL	T0,T9,0x2
SUBU	T0,T0,T9
SLL	T8,T7,0x2	//T8=size of offset block
ADDU	V0,A2,T8	//V0=offset to images (data + offsets)
SLL	T0,T0,0x2	//T0=size of image block
ADDU	T1,V0,T0	//T1=offset to Table (data + offsets + images)
SW	V0,0018 (S0)	//image block offset->load line + 0x18
SW	T1,0000 (S0)	//Table offset -> load line 0x0
OR	A0,S0,R0	//A0=S0=load line pointer
JAL	7F075A90	//I think this expands all the object offsets
LUI	A1,0500
OR	A0,S0,R0	//A0=S0=load line offset
LW	A1,0024 (SP)	//A1=string name pointer
LW	A2,0028 (SP)	//A2=[set to 0 by referer]
JAL	7F0762E0	//loads and expands images, DLs
LW	A3,0030 (SP)	//A3=[also set to 0 by referer]
LW	RA,001C (SP)
LW	S0,0018 (SP)
ADDIU	SP,SP,0020
JR	RA
NOP


7F07654C:	reroute to 7F0764A4; load model
ADDIU	SP,SP,FFE0
SW	RA,001C (SP)
SW	R0,0010 (SP)
OR	A2,R0,R0	//A2=0
JAL	7F0764A4
OR	A3,R0,R0	//A3=0
LW	RA,001C (SP)
ADDIU	SP,SP,0020
JR	RA
NOP
