S1=p->current command	[801B68EC]
command structure:
0x0	1	type
0x1	1	minimum number of commands expected in type
0x2	2	reserved
0x4	4	data

parsing through 7F0B8480
processing uses commands @ 80058C80 (0xD) and 80058CB4 (0x28)

7F0B84D0	type 00	normal termination	[set position to start and break]
7F0B84D8	type 01	push DATA onto stack
7F0B84F8	type 02	???
7F0B8518	type 03	???
7F0B8548	type 04	???
7F0B8578	type 05	???
7F0B85A0	type 06	???
7F0B89F0	type 07	terminate (invalid type)
7F0B89F0	type 08	terminate (invalid type)
7F0B89F0	type 09	terminate (invalid type)
7F0B89F0	type 0A	terminate (invalid type)
7F0B89F0	type 0B	terminate (invalid type)
7F0B89F0	type 0C	terminate (invalid type)
7F0B89F0	type 0D	terminate (invalid type)
7F0B89F0	type 0E	terminate (invalid type)
7F0B89F0	type 0F	terminate (invalid type)
7F0B89F0	type 10	terminate (invalid type)
7F0B89F0	type 11	terminate (invalid type)
7F0B89F0	type 12	terminate (invalid type)
7F0B89F0	type 13	terminate (invalid type)
7F0B85D0	type 14	range of rooms capable of sight
7F0B89F0	type 15	terminate (invalid type)
7F0B89F0	type 16	terminate (invalid type)
7F0B89F0	type 17	terminate (invalid type)
7F0B89F0	type 18	terminate (invalid type)
7F0B89F0	type 19	terminate (invalid type)
7F0B89F0	type 1A	terminate (invalid type)
7F0B89F0	type 1B	terminate (invalid type)
7F0B89F0	type 1C	terminate (invalid type)
7F0B89F0	type 1D	terminate (invalid type)
7F0B8614	type 1E	force room visible without need of portals
7F0B8654	type 1F	list of portals that can view room
7F0B8788	type 20	visible room
7F0B8914	type 21	begin new block	[save S7->S4]
7F0B86A8	type 22	further entries in portal list 1F
7F0B8714	type 23	
7F0B87F4	type 24	
7F0B8828	type 25	
7F0B8884	type 26	
7F0B88B8	type 27	

7F0B8930	type 50	
7F0B896C	type 51	
7F0B8954	type 52	break and reset 80081610 flag
7F0B89F0	type 53	terminate (invalid type)
7F0B89F0	type 54	terminate (invalid type)
7F0B89F0	type 55	terminate (invalid type)
7F0B89F0	type 56	terminate (invalid type)
7F0B89F0	type 57	terminate (invalid type)
7F0B89F0	type 58	terminate (invalid type)
7F0B89F0	type 59	terminate (invalid type)
7F0B8990	type 5A	terminate 14 group
7F0B89C8	type 5B	untoggle S2 flag
7F0B89E0	type 5C	break

Actual execution is more complex than originaly deemed.  There are multiple tables of entries, and entries can be toggled on-off during processing.  Execution only occurs when breaks are intered, so table management is key.  Aegh...

+-+	types in detail

7F0B8374	???	push A0 onto 800448A8 table
	accepts: A0=value to set onto table
LUI	A1,8004
ADDIU	A1,A1,48F8	;A1=800448F8
LW	V1,0000 (A1)	;V1=?
LUI	AT,8004
OR	V0,A0,R0	;V0=A0: 
SLL	T6,V1,0x2	;T6=?->offset
ADDU	AT,AT,T6
SW	A0,48A8 (AT)	;A0->800448A8+offset: 
ADDIU	AT,R0,0014	;AT=0x14
ADDIU	T7,V1,0001	;T7=?+1	increment index
DIV	T7,AT
MFHI	T8		;T8=T7%0x14
SW	T8,0000 (A1)	;save new index
JR	RA
NOP

7F0B83B0	???	pull V0 from 800448A8 table
LUI	A0,8004
ADDIU	A0,A0,48F8	;A0=800448F8
LW	T6,0000 (A0)	;T6=?
ADDIU	AT,R0,0014	;AT=0x14
LUI	V1,8004
ADDIU	T7,T6,0013	;T7=?+0x13: subtract 1!
DIV	T7,AT
MFHI	T8
SLL	T0,T8,0x2	;T0=T7%0x14 -> offset
ADDU	V1,V1,T0
SW	T8,0000 (A0)	;save new index value to 800448F8
JR	RA
LW	V0,48A8 (V1)	;V0=800448A8+offset: ?

7F0B83E4	???	pull V0 from entry A0 in 800458A8 table
	accepts: A0=entry to pull
LUI	T6,8004
LW	T6,48F8 (T6)	;T6=800448F8: ?
ADDIU	AT,R0,0014	;AT=0x14
LUI	V0,8004
SUBU	T7,T6,A0	;T7=?-A0: 
ADDIU	T8,T7,0013	;T8=T7-1
DIV	T8,AT
MFHI	T9		;T9=T8%0x14
SLL	T0,T9,0x2	;T0=T9->offset
ADDU	V0,V0,T0
JR	RA
LW	V0,48A8 (V0)	;V0->800448A8+offset: ?

7F0B8414	parse global visibility command list
ADDIU	SP,SP,FF80
SW	S3,0024 (SP)
SW	S2,0020 (SP)
SW	S1,001C (SP)
LUI	AT,8008
OR	S1,A0,R0
OR	S2,A1,R0
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	S0,0018 (SP)
ADDIU	S3,R0,0001
BNEZ	A0,7F0B8460
SW	R0,1610 (AT)
BEQ	R0,R0,7F0B89F4
OR	V0,A0,R0
//7F0B8460:
LUI	S8,8008
LUI	S6,8008
LUI	S4,8004
ADDIU	S4,S4,48FC
ADDIU	S6,S6,1600
ADDIU	S8,S8,A0B0
ADDIU	S7,R0,0001
ADDIU	S5,R0,0001
//7F0B8480:
LBU	A0,0000 (S1)
SLTI	AT,A0,0028
BNEZ	AT,7F0B84B0
ADDIU	T6,A0,FFB0
//7F0B8490:	commands 50-5C
SLTIU	AT,T6,000D
BEQ	AT,R0,7F0B89F0
SLL	T6,T6,0x2
LUI	AT,8006
ADDU	AT,AT,T6
LW	T6,8C80 (AT)
JR	T6
NOP
//7F0B84B0:	commands 0-27
SLTIU	AT,A0,0028
BEQ	AT,R0,7F0B89F0
SLL	T7,A0,0x2
LUI	AT,8006
ADDU	AT,AT,T7
LW	T7,8CB4 (AT)
JR	T7
NOP

7F0B84D0	type 00	break - reset to beginning of list
BEQ	R0,R0,7F0B89F4
OR	V0,S1,R0

7F0B84D8	type 01	push DATA onto 800448A8 stack
BEQL	S2,R0,7F0B84EC
LBU	T8,0001 (S1)
JAL	7F0B8374	;push A0 onto table
LW	A0,0004 (S1)	;A0=data
LBU	T8,0001 (S1)
//7F0B84EC:
SLL	T9,T8,0x3
BEQ	R0,R0,7F0B8480
ADDU	S1,S1,T9

7F0B84F8	type 02	???	pull V0 off 800448A8 stack
BEQL	S2,R0,7F0B850C
LBU	T0,0001 (S1)
JAL	7F0B83B0	;pull V0 from stack
NOP
LBU	T0,0001 (S1)
//7F0B850C:
SLL	T1,T0,0x3
BEQ	R0,R0,7F0B8480
ADDU	S1,S1,T1

7F0B8518	type 03	???	AND last two values on stack and replace
BEQL	S2,R0,7F0B853C
LBU	T2,0001 (S1)
JAL	7F0B83B0	;pull V0 off stack
NOP
JAL	7F0B83B0	;pull V0 off stack
OR	S0,V0,R0	;S0=V0: value 1
JAL	7F0B8374	;push A0 onto stack
AND	A0,V0,S0	;A0=value2 & value1
LBU	T2,0001 (S1)
//7F0B853C:
SLL	T3,T2,0x3
BEQ	R0,R0,7F0B8480
ADDU	S1,S1,T3

7F0B8548	type 04	???	OR last two values on stack and replace
BEQL	S2,R0,7F0B853C
LBU	T4,0001 (S1)
JAL	7F0B83B0	;pull V0 off stack
NOP
JAL	7F0B83B0	;pull V0 off stack
OR	S0,V0,R0	;S0=V0: value 1
JAL	7F0B8374	;push A0 onto stack
OR	A0,V0,S0	;A0=V0 | S0
LBU	T4,0001 (S1)
//7F0B853C:
SLL	T5,T4,0x3
BEQ	R0,R0,7F0B8480
ADDU	S1,S1,T5

7F0B8578	type 05	???	! last value on stack
BEQL	S2,R0,7F0B8594
LBU	T6,0001 (S1)
JAL	7F0B83B0	;pull V0 off stack
NOP
JAL	7F0B8374	;push A0 onto stack
SLTIU	A0,V0,0001	;A0=!V0
LBU	T6,0001 (S1)
//7F0B8594:
SLL	T7,T6,0x3
BEQ	R0,R0,7F0B8480
ADDU	S1,S1,T7

7F0B85A0	type 06	???	XOR last two values on stack
BEQL	S2,R0,7F0B853C
LBU	T8,0001 (S1)
JAL	7F0B83B0	;pull V0 off stack
NOP
JAL	7F0B83B0	;pull V0 off stack
OR	S0,V0,R0	;S0=V0: value 1
JAL	7F0B8374	;push A0 onto stack
XOR	A0,V0,S0	;A0=value2^value1
LBU	T8,0001 (S1)
//7F0B853C:
SLL	T9,T8,0x3
BEQ	R0,R0,7F0B8480
ADDU	S1,S1,T9

7F0B85D0	type 14	range of rooms capable of sight
BEQ	S2,R0,7F0B8604
LUI	V0,8004
LW	V0,4838 (V0)	;V0=80044838: ?
LW	T0,000C (S1)	;T0=room #1
SLT	A0,V0,T0	;A0=TRUE if ? < room1
XORI	A0,A0,0001	;TRUE<->FALSE
BEQ	A0,R0,7F0B85FC	;branch if ? >= room1	[A0=1]
NOP
LW	T1,0014 (S1)	;T1=room #2
SLT	A0,T1,V0	;A0=TRUE if room2 < ?
XORI	A0,A0,0001	;TRUE<->FALSE
//7F0B85FC:	pushes 1 room2>=? or ?>=room1
JAL	7F0B8374	;push A0 onto stack
NOP
//7F0B8604:
LBU	T2,0001 (S1)
SLL	T3,T2,0x3
BEQ	R0,R0,7F0B8480
ADDU	S1,S1,T3

7F0B8614	type 1E	force room visible without need of portals
BEQL	S2,R0,7F0B8648
LBU	T4,0001 (S1)
LW	V0,0000 (S8)	;load p->current player data
LWC1	F4,1118 (V0)
SWC1	F4,0000 (S6)	;save to 80081600+0
LWC1	F6,111C (V0)
SWC1	F6,0004 (S6)	;save to 80081600+4
LWC1	F8,1120 (V0)
SWC1	F8,0008 (S6)	;save to 80081600+8
LWC1	F10,1124 (V0)
SW	R0,0000 (S4)	;0->[800448FC]
SWC1	F10,000C (S6)	;save to 80081600+C
LBU	T4,0001 (S1)
//7F0B8648:
SLL	T5,T4,0x3
BEQ	R0,R0,7F0B8480
ADDU	S1,S1,T5

7F0B8654	type 1F	list of portals that can view room
BEQ	S2,R0,7F0B8698
OR	A1,S6,R0
JAL	7F0B5864
LW	A0,000C (S1)	;A0=portal
BNEL	V0,R0,7F0B8678
LW	A1,0000 (S8)
BEQ	R0,R0,7F0B8698
SW	S7,0000 (S4)
-LW	A1,0000 (S8)
//7F0B8678:
OR	A0,S6,R0
JAL	7F0B5BDC
ADDIU	A1,A1,1118
BNEL	V0,R0,7F0B8698
SW	R0,0000 (S4)
BEQ	R0,R0,7F0B8698
SW	S7,0000 (S4)
-SW	R0,0000 (S4)
//7F0B8698:
LBU	T6,0001 (S1)
SLL	T7,T6,0x3
BEQ	R0,R0,7F0B8480
ADDU	S1,S1,T7

7F0B8788	type 20	visible room
BEQL	S2,R0,7F0B87E8
LBU	T7,0001 (S1)
LW	T4,0000 (S4)
OR	A1,S6,R0	;A1=S6: 80081600
BNEL	T4,R0,7F0B87E8
LBU	T7,0001 (S1)
JAL	7F0B5208
LW	A0,000C (S1)	;A0=room#
BEQ	V0,R0,7F0B87E4
OR	A1,R0,R0	;A1=0
LW	A0,000C (S1)	;A0=room#
OR	A2,S6,R0	;A2=S6: 80081600
JAL	7F0B39BC
OR	A3,R0,R0	;A3=0
//7F0B87C0:	add room to list and increment total
LUI	V1,8008
LW	V1,C038 (V1)	;V1=8007C038: number of visible rooms in list
LW	T5,000C (S1)	;T5=room#
LUI	AT,8008
ADDU	AT,AT,V1
SB	T5,BFA0 (AT)	;T5->8007BFA0+offset: save room# to list
LUI	AT,8008
ADDIU	T6,V1,0001	;T6=V1+1
SW	T6,C038 (AT)	;T6->8007C038: save new count
LBU	T7,0001 (S1)
//7F0B87E8:
SLL	T8,T7,0x3
BEQ	R0,R0,7F0B8480
ADDU	S1,S1,T8

7F0B8914	type 21	begin new block
BEQL	S2,R0,7F0B8924
LBU	T5,0001 (S1)
SW	S7,0000 (S4)	;S7->S4: ?->800448FC
LBU	T5,0001 (S1)
//7F0B8924:
SLL	T6,T5,0x3
BEQ	R0,R0,7F0B8480
ADDU	S1,S1,T6

7F0B86A8	type 22	
BEQ	S2,R0,7F0B8704
ADDIU	A1,SP,0068	;A1=SP+68
JAL	7F0B5864
LW	A0,000C (S1)	;A0=data in next word
BEQL	V0,R0,7F0B8708
LBU	T9,0001 (S1)
LW	A1,0000 (S8)	;A1=p->cur.playerdata
ADDIU	A0,SP,0068	;A0=SP+68
JAL	7F0B5BDC
ADDIU	A1,A1,1118	;A1=p->cur.playerdata+1118: unknown float use in no_portals_necessary
BEQL	V0,R0,7F0B8708
LBU	T9,0001 (S1)
//7F0B86D8:
LW	T8,0000 (S4)	;T8=[800448FC]	value set by 21 command...
ADDIU	A1,SP,0068	;A1=SP+68
OR	A0,S6,R0	;A0=S6: 
BEQ	T8,R0,7F0B86FC	;branch if T8=0
NOP
JAL	7F0B5D58	;copies 4 floats from A1->A0
OR	A0,S6,R0	;A0=S6: 
BEQ	R0,R0,7F0B8704
SW	R0,0000 (S4)	;0->[800448FC]
//7F0B86FC:
JAL	7F0B5CC0
ADDIU	A1,SP,0068	;A1=SP+68
//7F0B8704:
LBU	T9,0001 (S1)
SLL	T0,T9,0x3
BEQ	R0,R0,7F0B8480
ADDU	S1,S1,T0

7F0B8714	type 23	
BEQL	S2,R0,7F0B877C
LBU	T2,0001 (S1)
LW	T1,0000 (S4)	;T1=[800448FC]
ADDIU	A1,SP,0058	;A1=SP+58
BNEL	T1,R0,7F0B877C	;branch if T1!=0
LBU	T2,0001 (S1)
JAL	7F0B5864
LW	A0,000C (S1)	;A0=next command's data word
BNEL	V0,R0,7F0B8748
LW	A1,0000 (S8)
BEQ	R0,R0,7F0B8778
SW	S7,0000 (S4)
-LW	A1,0000 (S8)
//7F0B8748:	when V0!=0
ADDIU	A0,SP,0058	;A0=SP+58
JAL	7F0B5BDC
ADDIU	A1,A1,1118	;A1=cur.playerdata+1118	mysterious float value
BNEZ	V0,7F0B8764
OR	A0,S6,R0	;A0=S6: [80081600]
BEQ	R0,R0,7F0B8778
SW	S7,0000 (S4)	;S7->[800448FC]
//7F0B8764:
JAL	7F0B5BDC
ADDIU	A1,SP,0058	;A1=SP+58
BNEL	V0,R0,7F0B877C
LBU	T2,0001 (S1)
SW	S7,0000 (S4)	;S7->[800448FC]
//7F0B8778:
LBU	T2,0001 (S1)
SLL	T3,T2,0x3
BEQ	R0,R0,7F0B8480
ADDU	S1,S1,T3

7F0B87F4	type 24	save S5 to DATA entry in 80041448 table
BEQL	S2,R0,7F0B881C
LBU	T1,0001 (S1)
LW	T9,000C (S1)	;T9=entry#
LUI	AT,8004
SLL	T0,T9,0x2
ADDU	T0,T0,T9
SLL	T0,T0,0x4	;T0=T9*0x14
ADDU	AT,AT,T0
SB	S5,1448 (AT)	;S5->80041448+offset: 
LBU	T1,0001 (S1)
//7F0B881C:
SLL	T2,T1,0x3
BEQ	R0,R0,7F0B8480
ADDU	S1,S1,T2

7F0B8828	type 25	set flag for rooms between val1 and val2
BEQL	S2,R0,7F0B8878
LBU	T7,0001 (S1)
LW	V0,000C (S1)	;V0=value1
LW	T3,0014 (S1)	;T3=value2
LUI	T5,8004
SLL	T4,V0,0x2
SLT	AT,T3,V0	;TRUE if val2<val1
BNEZ	AT,7F0B8874	;branch if TRUE
ADDU	T4,T4,V0
SLL	T4,T4,0x4	;T4=value1*0x50
ADDIU	T5,T5,1414
ADDU	V1,T4,T5	;V1=80041414+val1offset
SB	S5,0034 (V1)	;S5->V1+34: ?->80041414+val1offset+34
//7F0B885C:	loop while val1>=val2
LW	T6,0014 (S1)	;T6=val2
ADDIU	V0,V0,0001	;V0++	val1++
ADDIU	V1,V1,0050	;V1+=50	next entry
SLT	AT,T6,V0
BEQL	AT,R0,7F0B885C
SB	S5,0034 (V1)	;S5->V1+34: ?->80041448+val1offset
LBU	T7,0001 (S1)
//7F0B8878:	end
SLL	T8,T7,0x3
BEQ	R0,R0,7F0B8480
ADDU	S1,S1,T8

7F0B8884	type 26	
BEQL	S2,R0,7F0B88AC
LBU	T0,0001 (S1)
BEQL	S3,R0,7F0B88AC
LBU	T0,0001 (S1)
JAL	7F0B6314
LW	A0,000C (S1)	;A0=val1
SLTIU	S3,V0,0001	;TRUE of V0=0
ANDI	T9,S3,00FF	;T9=S3
OR	S3,T9,R0	;S3=T9
LBU	T0,0001 (S1)
//7F0B88AC:
SLL	T1,T0,0x3
BEQ	R0,R0,7F0B8480
ADDU	S1,S1,T1

7F0B88B8	type 27	do what 26 does for a range of rooms
BEQL	S2,R0,7F0B8908
LBU	T3,0001 (S1)
LW	S0,000C (S1)	;S0=val1
LW	V1,0014 (S1)	;V1=val2
SLT	AT,V1,S0	;TRUE if val2<val1
BNEL	AT,R0,7F0B8908
LBU	T3,0001 (S1)
//7F0B88D4:	while val2<val1
BEQL	S3,R0,7F0B88F8	;branch if S3=FALSE
ADDIU	S0,S0,0001	;S0++	val1++
JAL	7F0B6314
OR	A0,S0,R0	;A0=val1
SLTIU	S3,V0,0001	;TRUE if V0=0
ANDI	T2,S3,00FF
OR	S3,T2,R0
LW	V1,0014 (S1)	;V1=val2
ADDIU	S0,S0,0001	;S0++	val1++
//7F0B88F8:
SLT	AT,V1,S0	;TRUE if val2<val1
BEQ	AT,R0,7F0B88D4
NOP
LBU	T3,0001 (S1)
//7F0B8908:	quit
SLL	T4,T3,0x3
BEQ	R0,R0,7F0B8480
ADDU	S1,S1,T4

7F0B8930	type 50	
LBU	T7,0001 (S1)
OR	A1,S2,R0	;A1=S2: 
SLL	T8,T7,0x3
JAL	7F0B8414	;calls this command parser using next command as start!
ADDU	A0,T8,S1	;A0=next command
LBU	T9,0001 (V0)
SLL	T0,T9,0x3
BEQ	R0,R0,7F0B8480
ADDU	S1,V0,T0

7F0B896C	type 51	
LBU	T3,0001 (S1)
SLTU	V0,R0,S2	;TRUE if 0<S2
OR	S2,R0,R0	;S2=0
SLL	T4,T3,0x3
BEQ	V0,R0,7F0B8480
ADDU	S1,S1,T4	;S1=next command
LUI	AT,8008
BEQ	R0,R0,7F0B8480
SW	S7,1610 (AT)	;S7->80081610

7F0B8954	type 52	break loop and reset 80081610
LBU	T1,0001 (S1)
LUI	AT,8008
SW	R0,1610 (AT)	;80081610=0
SLL	T2,T1,0x3
BEQ	R0,R0,7F0B89F4	;break loop
ADDU	V0,S1,T2	;V0=next command

7F0B8990	type 5A	
JAL	7F0B83B0
NOP
LBU	T5,0001 (S1)
AND	A1,V0,S2
SLL	T6,T5,0x3
JAL	7F0B8414
ADDU	A0,T6,S1
LUI	T7,8008
LW	T7,1610 (T7)	;T7=80081610
OR	S1,V0,R0
BEQL	T7,R0,7F0B8484
LBU	A0,0000 (S1)
BEQ	R0,R0,7F0B8480
OR	S2,R0,R0

7F0B89C8	type 5B	untoggle S2 flag
LBU	T9,0001 (S1)
XORI	T8,S2,0001
OR	S2,T8,R0	;untoggle S2 flag
SLL	T0,T9,0x3
BEQ	R0,R0,7F0B8480
ADDU	S1,S1,T0

7F0B89E0	type 5C	break
LBU	T1,0001 (S1)
SLL	T2,T1,0x3
BEQ	R0,R0,7F0B89F4
ADDU	V0,S1,T2	;V0=S1+offset: position of next command

7F0B89F0	terminate
OR	V0,S1,R0	;set position to start of list
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,0080
