part of the routine:
7F0CBB0C:	returns V0=offset to matching image list slot, or NULL if no match found
BNEL	A1,R0,7F0CBB20
LW	V0,0004 (A1)	//V0=address for next entry in image list
LUI	A1,8009
ADDIU	A1,A1,C720	//A1=8008C720
LW	V0,0004 (A1)
//7F0CBB20:
LW	V1,000C (A1)	//V1=address for start of image list
SLTU	AT,V1,V0	//true if not at end of list
BEQL	AT,R0,7F0CBB5C
	OR	V0,R0,R0	//V0=0
LW	T6,0000 (V1)	//T6=ID word of facemapper image list
//7F0CBB34:
SRL	T7,T6,0x14	//T7=ID alone
BNEL	A0,T7,7F0CBB4C	//branch if no match
	ADDIU	V1,V1,0010	//V1+=offset for next entry
JR	RA
OR	V0,V1,R0	//V0=V1=offset in image list to match
ADDIU	V1,V1,0010
//7F0CBB4C:
SLTU	AT,V1,V0	//true if still not finished with list
BNEL	AT,R0,7F0CBB34
	LW	T6,0000 (V1)	//T6=next ID word in image list
OR	V0,R0,R0	//V0=0
//7F0CBB5C:	search finished
JR	RA
NOP


7F0CBC18:	handles ID image declarations
ADDIU	SP,SP,F008
SW	S0,0020 (SP)	//save org. op address
OR	S0,A1,R0	//S0=A1=address in stack for obj header data
SW	RA,0024 (SP)
BNEZ	A1,7F0CBC38
SW	A0,0FF8 (SP)
LUI	S0,8009
ADDIU	S0,S0,C720	//S0=8008C720
//7F0CBC38:	valid buffer for data
LW	T6,0FF8 (SP)	//address in stack for img ID
LUI	V0,8009
ADDIU	V0,V0,D094	//V0=8008D094
LW	T7,0000 (T6)	//T7=img ID
OR	A1,S0,R0	//A1=S0=address in stack for obj header data
ANDI	A0,T7,FFFF	//A0=img ID-1
JAL	7F0CBB0C	//V0=matching offset in facemapper image list, or NULL
SW	A0,0000 (V0)	//img ID->8008D094
BNEZ	V0,7F0CBE2C	//branch if entry found in list
OR	V1,V0,R0	//V1=V0=offset in facemapper image list
ADDIU	V1,SP,0067
SRL	T9,V1,0x4
SLL	T0,T9,0x4
JAL	7000D320
SW	T0,002C (SP)
LW	A0,002C (SP)
JAL	70010B20
ADDIU	A1,R0,2000

7F0CBC80:	0x1007B0 ROM
LUI	T1,8009
LW	T1,D094 (T1)	//T1=8008D094=image ID, used as offset
LUI	T3,8005
ADDIU	T3,T3,9300
SLL	T2,T1,0x3	//T2=T1*8
ADDU	V0,T2,T3	//V0=address for image data
LW	V1,0000 (V0)	//V1=data for image
LW	A3,0008 (V0)	//A3=next entry's data
LUI	AT,00FF
ORI	AT,AT,FFFF	//AT=FFFFFF
AND	T4,V1,AT	//T4=offset to image
AND	T5,A3,AT	//T5=offset to next image
SUBU	A2,T5,T4	//A2=size of file
ADDIU	A2,A2,001F	//A2+=1F
ADDIU	AT,R0,FFF8	//AT=-8
LUI	T7,008F
ADDIU	T7,T7,7DF0	//T7=8F7DF0	[ROM address for start of images]
AND	T6,T4,AT	//T6=size to nearest DWORD
SRL	T8,A2,0x4
SLL	A2,T8,0x4	//A2=size of file to nearest QWORD
ADDU	A1,T6,T7	//A1=ROM addy of img
SW	T4,003C (SP)	//save img offset
JAL	70005C1C
LW	A0,002C (SP)	//A0=unused data to load image to

-

7F0CBD88:	creates entry in the main facemapper table
LUI	T7,8009
LW	V0,0008 (S0)
LW	T7,D094 (T7)	//T7=8008D094=image ID
LUI	T3,8009
SH	T7,0000 (V0)
LW	T8,0008 (S0)
LW	T0,000C (S0)
ADDIU	T9,T8,0008
ADDIU	T1,T0,FFF0
SW	T9,0008 (S0)
SW	T1,000C (SP)
LHU	T6,0000 (T1)
LW	T4,D094 (T3)	//T4=8008D094=image ID
OR	V1,T1,R0
ANDI	T7,T6,000F
SLL	T5,T4,0x4	//T5*=0x10
OR	T8,T5,T7
SH	T8,0000 (T1)
LW	T9,0008 (S0)
BEQ	A1,R0,7F0CBDF8
SW	T9,0004 (T1)

-
7F0CBE2C:
JAL	7000E8B0
LW	A0,0004 (V1)	//A0=offset to image data
LW	T3,0FF8 (SP)	//T3=offset in stack to image list addresses
SW	V0,0000 (T3)	//1B0B08->offset
LW	RA,0024 (SP)
LW	S0,0020 (SP)	//S0=org. op address
ADDIU	SP,SP,0FF8
JR	RA
NOP	


7F0CBE50:	model header parsing
//7F0CBE70:	call # images
LH	V0,0016 (A0)
//7F0CBE90:	handle image declarations
LW	T6,0000 (S1)	//T6=image ID or address
ADDU	A0,S0,S3
SLTI	AT,T6,0BB9	//true if under the maximum number of indexed images - BB9.  Used to detect offset types
BEQL	AT,R0,7F0CBEB4
	ADDIU	S2,S2,0001
//7F0CBEA4:	ID image handler
JAL	7F0CBC18
OR	A1,S5,R0	//A1=S5=buffer for image
LH	V0,0016 (S4)
ADDIU	S2,S2,0001
//7F0CBEB4:	IDs and offsets
SLT	AT,S2,V0
ADDIU	S0,S0,000C
BNEZ	AT,7F0CBE90
ADDIU	S1,S1,000C
LW	RA,002C (SP)
LW	S0,0014 (SP)
LW	S1,0018 (SP)
LW	S2,001C (SP)
LW	S3,0020 (SP)
LW	S4,0024 (SP)
LW	S5,0028 (SP)
JR	RA
ADDIU	SP,SP,0030

7F0CBEE8:
ADDIU	SP,SP,FFE0
SW	RA,0014 (SP)
SW	A0,001C (SP)	//store img ID
JAL	7F0CBC18
ADDIU	A0,SP,001C	//A0=address of img ID in stack
LW	RA,0014 (SP)
ADDIU	SP,SP,0020
JR	RA
NOP

-7F0CC548:	check if BA image attributes need setting.  V0=true, false
LUI	V1,8009
ADDIU	V1,V1,D140	//V1=8008D140
LW	T6,0000 (V1)	//T6=-1
ADDIU	V0,R0,0001	//V0=1
BNEL	A0,T6,7F0CC56C
	SW	A0,0000 (V1)	//save the new attributes onto the image attrib buffer
JR	RA
OR	V0,R0,R0	//v0=0
//7F0CC56C:
JR	RA
NOP

-part of C0 expansion
-7F0CC574:	I dont' know.  returns 1, seemingly
SLL	T6,A0,0x2	//[in this case, A0 set to 7]
SUBU	T6,T6,A0	//T6=val*3
SLL	T6,T6,0x2	//T6=val*12
SUBU	T6,T6,A0	//T6=val*11
LUI	T7,8009
ADDIU	T7,T7,D148	//T7=8008D148
SLL	T6,T6,0x2	//T6=val*44
ADDU	V0,T6,T7	//V0=8008D148+offset
LW	T8,0000 (V0)	//T8=first word there
OR	V1,R0,R0	//V1=0
BEQL	T8,R0,7F0CC63C
	LW	T7,0010 (SP)
LW	T9,0004 (V0)
BNEL	A1,T9,7F0CC63C
	LW	T7,0010 (SP)
LW	T0,0008 (V0)
BNEL	A2,T0,7F0CC63C
	LW	T7,0010 (SP)
LW	T1,000C (V0)
LW	T2,0010 (SP)
BNEL	A3,T1,7F0CC63C
	LW	T7,0010 (SP)
LW	T3,0010 (V0)
LW	T4,0014 (SP)
BNEL	T2,T3,7F0CC63C
	LW	T7,0010 (SP)
LW	T5,0014 (V0)
LW	T6,0018 (SP)
BNEL	T4,T5,7F0CC63C
	LW	T7,0010 (SP)
LW	T7,0018 (V0)
LW	T8,001C (SP)
BNEL	T6,T7,7F0CC63C
	LW	T7,0010 (SP)
LW	T9,001C (V0)
LW	T0,0020 (SP)
BNEL	T8,T9,7F0CC63C
	LW	T7,0010 (SP)
LW	T1,0020 (V0)
LW	T2,0024 (SP)
BNEL	T0,T1,7F0CC63C
	LW	T7,0010 (SP)
LW	T3,0024 (V0)
LW	T4,0028 (SP)
BNEL	T2,T3,7F0CC63C
	LW	T7,0010 (SP)
LW	T5,0028 (V0)
BEQ	T4,T5,7F0CC688
NOP
//7F0CC63C:
LW	T8,0014 (SP)	//these were all set to zero by the calling routine...
LW	T9,0018 (SP)
LW	T0,001C (SP)
LW	T1,0020 (SP)
LW	T2,0024 (SP)
LW	T3,0028 (SP)
ADDIU	T6,R0,0001	//T6=1
ADDIU	V1,R0,0001	//V1=1
SW	T6,0000 (V0)
SW	A1,0004 (V0)
SW	A2,0008 (V0)
SW	A3,000C (V0)
SW	T7,0010 (V0)
SW	T8,0014 (V0)
SW	T9,0018 (V0)
SW	T0,001C (V0)
SW	T1,0020 (V0)
SW	T2,0024 (V0)
SW	T3,0028 (V0)
JR	RA
OR	V0,V1,R0


-7F0CC714:	right off, returns V0=img width
BNEZ	A1,7F0CC724
LBU	V1,0008 (A0)	//V1=width of img
JR	RA
OR	V0,V1,R0	//V0=V1=width


-7F0CC7FC:	right off, returns V0=img height
BNEZ	A1,7F0CC80C
LBU	V1,0009 (A0)	//V1=height of image
JR	RA
OR	V0,V1,R0	//V0=V1=height of image
//7F0CC80C:
LW	T6,000C (A0)
LUI	V0,8009
SLL	T8,T6,0x2
...

-7F0CC8E4:	returns V0=width/bits in image.
ADDIU	SP,SP,FFE0
SW	RA,0014 (SP)
LW	V1,0008 (A0)	//V1=third word of facemapper entry
ANDI	T6,V1,0003	//T6=img type (bits)
JAL	7F0CC714	//returns V0=img width
SW	T6,001C (SP)
LW	V1,001C (SP)	//V1=image type
ADDIU	AT,R0,0003	//AT=3
OR	A0,V0,R0	//A0=V0=width
BNE	V1,AT,7F0CC92C	//if type!=32bit, branch
LW	RA,0014 (SP)
ADDIU	V0,V0,0003	//V0=width+3
BGEZ	V0,7F0CC924
SRA	T7,V0,0x2
ADDIU	AT,V0,0003
SRA	T7,AT,0x2
//7F0CC924:
BEQ	R0,R0,7F0CC98C
OR	V0,T7,R0
//7F0CC92C:	test if 16bit...
ADDIU	AT,R0,0002	//AT=2
BNE	V1,AT,7F0CC950	//if !=16bit, branch
ADDIU	V0,A0,0003	//V0=width+3
BGEZ	V0,7F0CC948
SRA	T8,V0,0x2
ADDIU	AT,V0,0003
SRA	T8,AT,0x2
//7F0CC948:
BEQ	R0,R0,7F0CC98C
OR	V0,T8,R0
//7F0CC950:	test if 8bit...
ADDIU	AT,R0,0001	//AT=1
BNE	V1,AT,7F0CC978	//if !=8bit, branch
ADDIU	V0,A0,000F	//V0=width + F
ADDIU	V0,A0,0007	//V0=width + 7
BGEZ	V0,7F0CC970
SRA	T9,V0,0x3	//T9=(width+7)/8
ADDIU	AT,V0,0007
SRA	T9,AT,0x3
//7F0CC970:	if image not mirrored or invalid or something
BEQ	R0,R0,7F0CC98C
OR	V0,T9,R0	//V0=T9
//7F0CC978:	4bit image...
BGEZ	V0,7F0CC988
SRA	T0,V0,0x4
ADDIU	AT,V0,000F
SRA	T0,AT,R0
OR	V0,T0,R0
//7F0CC98C:
JR	RA
ADDIU	SP,SP,0020


-7F0CC994:	returns V0=(width/type)*height
ADDIU	SP,SP,FFE0
SW	RA,0014 (SP)
SW	A0,0020 (SP)	//A0=matching entry in facemapper img list
JAL	7F0CC7FC	//returns V0=img height
SW	A1,0024 (SP)	//A1=0
SW	V0,001C (SP)	//V0=height of image
LW	A0,0020 (SP)	//A0=matching entry in facemapper img list
JAL	7F0CC8E4	//returns V0=width/bitdepth
LW	A1,0024 (SP)	//A1=0
LW	T6,001C (SP)	//T6=height
LW	RA,0014 (SP)
ADDIU	SP,SP,0020
MULTU	V0,T6
MFLO	V0		//V0=bits in image (ie. 8bit image, 30x20 = C0)
JR	RA
NOP


-7F0CC9D4:
ADDIU	SP,SP,FFD8
SW	RA,0024 (SP)
SW	S3,0020 (SP)	//S3=img ID
SW	S2,001C (SP)	//S2=matching entry in facemapper img list
SW	S1,0018 (SP)	//S1=matching entry in facemapper img list
SW	S0,0014 (SP)	//S0=org. op addy
LW	V1,0008 (A0)	//V1=third word in facemapper entry (size, type, etc)
LBU	V0,000B (A0)	//V0=format/type byte
OR	S1,A2,R0	//S1=A2=pointer on stack...
ANDI	T6,V1,0003	//T6=image type (bits)
SRL	T7,V0,0x5	//T7= unknown attrib, like masked with E0
OR	S3,A0,R0	//S3=A0=matching entry in facemapper img list
BEQ	T7,R0,7F0CCA14	//skip if attribs not set
OR	V1,T6,R0	//V1=T6=image type
BEQ	R0,R0,7F0CCA18
OR	S2,T7,R0	//S2=T7=attribs
//7F0CCA14:	set 3 to stack if 32bit image
ADDIU	S2,R0,0001	//S2=1 (not set to attribs)
ADDIU	V0,R0,0003	//V0=3
BNE	V1,V0,7F0CCA2C
SW	R0,0000 (S1)	//0-> some value on stack (SP+88)
BEQ	R0,R0,7F0CCA54
SW	V0,0000 (A1)	//3-> some value on stack (SP+8C)
//7F0CCA2C:	set 2 on stack if 16bit value
ADDIU	V0,R0,0002	//V0=2
BNE	V1,V0,7F0CCA40
ADDIU	AT,R0,0001	//AT=1
BEQ	R0,R0,7F0CCA54
SW	V0,0000 (A1)	//2-> some value on stack (SP+8C)
//7F0CCA40:	set 1 on stack if 8bit, or 0 if 4bit
BNEL	V1,AT,7F0CCA54
	SW	V0,0000 (A1)	//1-> some value on stack (SP+8C)
BEQ	R0,R0,7F0CCA54
SW	V0,0000 (A1)	//0-> some value on stack (SP+8C)
SW	V0,0000 (A1)
//7F0CCA54:
BLEZ	S2,7F0CCA80	//when would this equal 0, much less lower...
OR	
S0,R0,R0	//S0=0
//7F0CCA5C:
OR	A0,S3,R0	//A0=S3=matching entry in facemapper list
JAL	7F0CC994	//returns V0=(width/type)*height
OR	A1,S0,R0	//A1=S0=0
//7F0CCA68:
LW	T8,0000 (S1)	//T8=some value on stack (SP+88).  probably 0
SLL	T9,V0,0x2	//T9=img width*height/type *4
ADDIU	S0,S0,0001	//S0++ (S0=1)
ADDU	T0,T8,T9	//T0=(width*height/type *4) + stack value
BNE	S0,S2,7F0CCA5C	//loop until S0=attrib value
SW	T0,0000 (S1)	//set to value on stack (SP+88)
//7F0CCA80:	when finished, 8bit 30x20 image sets 0x400 on SP+88...
LW	RA,0024 (SP)
LW	S0,0014 (SP)	//S0=org. op addy
LW	S1,0018 (SP)	//S1=matching entry in facemapper img list
LW	S2,001C (SP)	//S2=matching entry in facemapper img list
LW	S3,0020 (SP)	//S3=img ID
JR	RA
ADDIU	SP,SP,0028

-7F0CCA9C:	returns nearest exponential of A0, for what its worth (ie. 2^5=20, 2^6=40, etc)
ADDIU	A0,A0,FFFF	//A0=width-1
BLEZ	A0,7F0CCAC4	//bail if invalid width
OR	V1,R0,R0	//V1=0
ADDIU	V0,R0,0008	//V0=8
SRA	T6,A0,0x1	//T6=(width-1)/2
//7F0CCAB0:
OR	A0,T6,R0	//A0=T6=tampered width
BLEZ	T6,7F0CCAC4
ADDIU	V1,V1,0001	//V1++
BNEL	V1,V0,7F0CCAB0	//keep testing until all possible widths dealt with (0x80 max)
SRA	T6,A0,0x1	//T6=tampered width /2
//7F0CCAC4:
JR	RA
OR	V0,V1,R0	//V0=V1= [w30=6]


-part of C0 expansion
7F0CDE18:
ADDIU	SP,SP,FFD8
SW	RA,0024 (SP)
SW	A2,0030 (SP)	//A2=op masked for 00C00000
SW	A1,002C (SP)	//A1=matching entry in facemapper img table
SW	A3,0034 (SP)	//A3=op masked for 00300000
JAL	7F0CD078	//expand C0 command.  May be 256 paletted image specific
OR	A2,R0,R0	//A2=0
//7F0CDE34:
LW	T6,0038 (SP)	//T6=img type
OR	A0,V0,R0	//A0=V0=cur. op offset, after expanding C0
LW	A1,002C (SP)	//A1=matching entry in facemapper img table
LW	A2,0030 (SP)	//A2=op masked for 00C00000
LW	A3,0034 (SP)	//A3=op masked for 00300000
SW	R0,0014 (SP)
SW	R0,0018 (SP)
JAL	7F0CD430	//WORKING ON THIS ROUTINE THREAD
SW	T6,0010 (SP)	//save the image type again
//7F0CDE58:
LW	A1,002C (SP)	//A1=matching entry in facemapper img table
ADDIU	AT,R0,0001	//AT=1
OR	A0,V0,R0
LBU	T7,000C (A1)
LW	A2,0030 (SP)
LW	A3,0034 (SP)
SRL	T8,T7,0x5
BNE	T8,AT,7F0CDE94
LW	T9,0038 (SP)
ADDIU	T0,R0,0001
SW	T0,0014 (SP)
SW	T9,0010 (SP)
JAL	7F0CD430
SW	R0,0018 (SP)
OR	A0,V0,R0
//7F0CDE94:
LW	RA,0024 (SP)
ADDIU	SP,SP,0028
OR	V0,A0,R0
JR	RA
NOP

-

impact list
7F04EC94:	0x837C4
LH	V0,003A (S0)	//V0=img ID
OR	T1,R0,R0
LUI	T7,8005
BGEZ	V0,7F04ECB4
SLL	T9,V0,0x3	//T9=ID*8 (offset)
LUI	T0,8005
BEQ	R0,R0,7F04ECD0
LW	T0,E86C (T0)
ADDU	T7,T7,T9	//T7=offset to img data
LBU	T7,9300 (T7)	//T7=impact data
LUI	T0,8005
ANDI	T3,T7,000F	//second nibble of impact
ETC.

-7F000BD0:	0x35700	used to convert from image sizes to file offsets
LUI	A0,8005
ADDIU	V0,A0,9300	//V0=80049300
LW	T6,0000 (V0)	//T6=size
LUI	AT,00FF
ORI	AT,AT,FFFF	//AT=mask for address
ORI	A3,R0,FFFF	//A3=EOF (-1)
AND	T7,T6,AT	//T7=size alone
BEQ	A3,T7,7F000C40	//branch @ EOF
OR	V1,R0,R0	//initial offset
LUI	T8,8005
ADDIU	T8,T8,9300	//T8=80049300
LW	A1,0000 (T8)	//A1=size
LUI	AT,00FF
ORI	AT,AT,FFFF
AND	A2,A1,AT	//A2=size
//7F000C0C:	convert all to offsets.  sloppy code, really.  This must have been written and rewritten a few times.
LUI	AT,00FF
ORI	AT,AT,FFFF
AND	T9,V1,AT	//T9=previous offset
XOR	T0,T9,A1
SLL	T1,T0,0x8
SRL	T2,T1,0x8
XOR	T3,T2,A1	//T3=offset for current
LW	A1,0008 (V0)	//A1=next increment
ADDU	V1,V1,A2	//V1=new offset
SW	T3,0000 (V0)	//copy current offset
AND	A2,A1,AT	//A2=next size
BNE	A3,A2,7F000C0C	//loop if not EOF
ADDIU	V0,V0,0008	//increment to next offset
//7F000C40:
LW	A1,0000 (V0)	//A1=EOF
LUI	AT,00FF
ORI	AT,AT,FFFF	//AT=size mask
AND	T4,V1,AT	//T4=cur offset masked
XOR	T5,T4,A1
SLL	T6,T5,0x8
SRL	T7,T6,0x8
XOR	T8,T7,A1
JR	RA
SW	T8,0000 (V0)	//copy last file offset

[INCIDENTALLY]
70005D58 calls the img size expansion routine.  There are a series of calls in this block, and it may be fun to tamper with them...

----------------
USA	
1007B8	offset to image data list
		LUI T3,8005; ADDIU T3,T3,9300
1007C0	offset within list
		000950C0	->	00095080
		SLL T2,T1,0x3	->	SLL T2,T1,0x2
1007EC	ROM address of image list
		3C0F008F;	25EF7DF0
		LUI T7,008F;	ADDIU T7,T7,7DF0

837D4	offset within list
		0002C8C0	->	0002C880
		SLL T9,V0,0x3	->	SLL T9,V0,0x2
35758	offset conversion increment
		8C450008	->	8C450004
		LW A1,0008 (V0)	->	LW A1,0004 (V0)
3576C	offset conversion increment
		24420008	->	24420004
	ADDIU V0,V0,0008	->	ADDIU V0,V0,0004

--
To move the *entire* image list!
1007BEC:
3C0F008F	LUI	T7,008F
25EF7E00	ADDIU	T7,T7,7DF0	//T7=8F7DF0	[ROM address for start of images]
