oops forgot that

Former-commit-id: 51b7d68a6dc95736271f84b0fc77ebf6d47e52cd [formerly 2c85d1c72fdc9bb1fbf167e646bdeb09ef3ab61e] [formerly a13e518d540596eb3f572666e7dc1f0e9fc23735 [formerly 5a1125980db68c93b676d756a1735174827465c8]]
Former-commit-id: 32929e424314258696aadd1fa822cc97697c1f87 [formerly 40f3f2bb14e103445d97e3a8956926eda59e5f73]
Former-commit-id: 6124ae5e2340b83c14e40668868ecacb9f4d1fa3
This commit is contained in:
kholdfuzion
2019-08-03 18:01:45 +00:00
parent 3ebe19d728
commit 7dfe175f34
1823 changed files with 1202862 additions and 912 deletions
File diff suppressed because it is too large Load Diff
@@ -1 +0,0 @@
33dcfc1d6700a83ef9dbd72f2525dd70b40815d0
File diff suppressed because it is too large Load Diff
@@ -1 +0,0 @@
47eedda88463aa2aa6a6ae860e4412678c2c5d72
@@ -0,0 +1,278 @@
Used to set 09 actors. A1 is a pointer to 09 characters
7F02370C: ADDIU SP, SP, 0xFFA0
7F023710: SW RA, 0x0024 (SP)
7F023714: SW S0, 0x0020 (SP)
7F023718: SW A0, 0x0060 (SP)
7F02371C: SW A2, 0x0068 (SP)
7F023720: LHU T6, 0x0006 (A1) //T6=preset position
7F023724: LUI T8, 0x8007
7F023728: LW T8, 0x5D18 (T8) //T8=0xxx preset pointer base
7F02372C: SLL T7, T6, 0x2
7F023730: SUBU T7, T7, T6
7F023734: SLL T7, T7, 0x2
7F023738: SUBU T7, T7, T6
7F02373C: SLL T7, T7, 0x2
7F023740: OR S0, A1, R0 //S0=A1 (guard OBJ pointer)
7F023744: ADDU A0, T7, T8 //A0=pointer to preset data
7F023748: LW A1, 0x0028 (A0) //A1=tile pointer
7F02374C: ADDIU T9, SP, 0x0054
7F023750: SW T9, 0x0010 (SP)
7F023754: SW A0, 0x005C (SP) //save preset pointer
7F023758: LUI A2, 0x41A0
7F02375C: JAL 0x0F056850
7F023760: ADDIU A3, SP, 0x0048
7F023764: BEQ V0, R0, 0x7F0238FC //if V0 invalid, abort!
7F023768: ADDIU T0, R0, 0xFFFF //T0=-1
7F02376C: SW T0, 0x0030 (SP)
7F023770: LHU V0, 0x0008 (S0) //V0=body [S0=pointer to 09 actor data]
7F023774: ORI AT, R0, 0xFFFF //AT=-1
7F023778: BNEL V0,AT,7F023794 //branch if valid and save to stack
7F02377C: SW V0, 0x0034 (SP)
7F023780: JAL 0x0F023590 //returns V0=current random body
7F023784: NOP
7F023788: BEQ R0, R0, 0x7F023794
7F02378C: SW V0, 0x0034 (SP)
7F023790: SW V0, 0x0034 (SP)
7F023794: LW T1, 0x0034 (SP) //? grab voice flag ?
7F023798: LUI T3, 0x8004
7F02379C: SLL T2, T1, 0x2
7F0237A0: ADDU T2, T2, T1
7F0237A4: SLL T2, T2, 0x2 //T2=T1*0x14
7F0237A8: ADDU T3, T3, T2
7F0237AC: LBU T3, 0xDE21 (T3) //T3=embedded head?
7F0237B0: BNEL T3,R0,7F0237DC
7F0237B4: LW A0, 0x0034 (SP)
7F0237B8: LH V0, 0x0016 (S0)
7F0237BC: BLTZ V0, 0x7F0237CC
7F0237C0: NOP
7F0237C4: BEQ R0, R0, 0x7F0237D8
7F0237C8: SW V0, 0x0030 (SP)
7F0237CC: JAL 0x0F0235AC //returns V0=norm random head
7F0237D0: LW A0, 0x0034 (SP)
7F0237D4: SW V0, 0x0030 (SP)
7F0237D8: LW A0, 0x0034 (SP)
7F0237DC: LW A1, 0x0030 (SP)
7F0237E0: JAL 0x0F0234D0
7F0237E4: LHU A2, 0x0014 (S0)
7F0237E8: BEQ V0, R0, 0x7F0238FC
7F0237EC: SW V0, 0x0038 (SP)
7F0237F0: LW V0, 0x005C (SP)
7F0237F4: LWC1 F12,0018 (V0)
7F0237F8: JAL 0x0F05AA30
7F0237FC: LWC1 F14,0020 (V0)
7F023800: SWC1 F0,003C (SP)
7F023804: JAL 0x0F035398
7F023808: LHU A0, 0x000A (S0)
7F02380C: LW A0, 0x0038 (SP)
7F023810: ADDIU A1, SP, 0x0048
7F023814: LW A2, 0x003C (SP)
7F023818: LW A3, 0x0054 (SP)
7F02381C: JAL 0x0F0203B8
7F023820: SW V0, 0x0010 (SP)
7F023824: BEQ V0, R0, 0x7F0238FC
7F023828: OR A0, V0, R0
7F02382C: JAL 0x0F03A4A4
7F023830: SW V0, 0x0044 (SP)
7F023834: JAL 0x0F03A404
7F023838: LW A0, 0x0044 (SP)
7F02383C: LW T4, 0x0044 (SP)
7F023840: LHU T5, 0x0004 (S0)
7F023844: LUI AT, 0x4F80
7F023848: LW V0, 0x0004 (T4)
7F02384C: SH T5, 0x0000 (V0)
7F023850: LHU T6, 0x0010 (S0)
7F023854: MTC1 T6,F4
7F023858: BGEZ T6, 0x7F02386C
7F02385C: CVT.S.W F6,F4
7F023860: MTC1 AT,F8
7F023864: NOP
7F023868: ADD.S F6,F6,F8
7F02386C: LUI AT, 0x447A
7F023870: MTC1 AT,F10
7F023874: LUI AT, 0x4F80
7F023878: DIV.S F16,F6,F10
7F02387C: SWC1 F16,00EC (V0)
7F023880: LHU T7, 0x0012 (S0)
7F023884: MTC1 T7,F18
7F023888: BGEZ T7, 0x7F02389C
7F02388C: CVT.S.W F4,F18
7F023890: MTC1 AT,F8
7F023894: NOP
7F023898: ADD.S F4,F4,F8
7F02389C: SWC1 F4,00D0 (V0)
7F0238A0: LHU T8, 0x000C (S0)
7F0238A4: SH T8, 0x0114 (V0)
7F0238A8: LHU T9, 0x000E (S0)
7F0238AC: SH T9, 0x0116 (V0)
7F0238B0: LW T0, 0x0030 (SP)
7F0238B4: SB T0, 0x0006 (V0)
7F0238B8: LW T1, 0x0034 (SP)
7F0238BC: SB T1, 0x000F (V0)
7F0238C0: LHU V1, 0x0014 (S0)
7F0238C4: ANDI T2, V1, 0x0004
7F0238C8: BEQL T2,R0,7F0238E4
7F0238CC: ANDI T5, V1, 0x0008
7F0238D0: LW T3, 0x0014 (V0)
7F0238D4: ORI T4, T3, 0x0002
7F0238D8: SW T4, 0x0014 (V0)
7F0238DC: LHU V1, 0x0014 (S0)
7F0238E0: ANDI T5, V1, 0x0008
7F0238E4: BEQL T5,R0,7F0238FC
7F0238E8: SW V0, 0x0018 (S0)
7F0238EC: LW T6, 0x0014 (V0)
7F0238F0: ORI T7, T6, 0x0010
7F0238F4: SW T7, 0x0014 (V0)
7F0238F8: SW V0, 0x0018 (S0)
7F0238FC: LW RA, 0x0024 (SP)
7F023900: LW S0, 0x0020 (SP)
7F023904: ADDIU SP, SP, 0x0060
7F023908: JR RA
7F02390C: NOP
---------
7F023724: LUI T8, 0x8007
7F023730: SLTI A0,T6,2710
BNEZ A0,[general]
7F02372C: ORI T7,R0,002C
//2710
7F023734: ADDI T6,T6,D8F0 //correction for -2710
7F023738: ADDIU T8,T8,0004
7F02373C: ORI T7,R0,0044
//general
MULTU T6,T7
7F023728: LW T8, 0x5D18 (T8) //T8=0xxx preset pointer base
MFLO T7
7F023744: ADDU A0, T7, T8 //A0=pointer to preset data
[rewrite]
7F02370C: ADDIU SP, SP, 0xFFA0
7F023710: SW RA, 0x0024 (SP)
7F023714: SW S0, 0x0020 (SP)
7F023718: SW A0, 0x0060 (SP)
7F02371C: SW A2, 0x0068 (SP)
7F023720: LHU T6, 0x0006 (A1) //T6=preset position
7F023724: LUI T8, 0x8007
//start editting!
7F023728: 2DC42710 SLTI A0,T6,2710
7F02372C: 14800004 BNEZ A0,[general] +4
7F023730: 340F002C ORI T7,R0,002C
7F023734: 21CED8F0 ADDI T6,T6,D8F0 //correction for -2710
7F023738: 27180004 ADDIU T8,T8,0004
7F02373C: 340F0044 ORI T7,R0,0044
7F023740: 01CF0019 MULTU T6,T7 [general]
7F023744: 00A08025 OR S0, A1, R0 //S0=A1 (guard OBJ pointer)
7F023748: 8F185D18 LW T8, 0x5D18 (T8) //T8=0xxx preset pointer base
7F02374C: 00007812 MFLO T7
7F023750: 01F82021 ADDU A0, T7, T8 //A0=pointer to preset data
7F023754: 8C850028 LW A1, 0x0028 (A0) //A1=tile pointer
7F023758: 27B90054 ADDIU T9, SP, 0x0054
7F02375C: AFB90010 SW T9, 0x0010 (SP)
7F023760: AFA4005C SW A0, 0x005C (SP) //save preset pointer
7F023764: 3C0641A0 LUI A2, 0x41A0
7F023768: 0FC15A14 JAL 0x0F056850 //PROXIMITY TEST FOR PRESET
7F02376C: 27A70048 ADDIU A3, SP, 0x0048
7F023770: 10400062* BEQ V0, R0, 0x7F0238FC //1 if okay to spawn there
7F023774: 2408FFFF ADDIU T0, R0, 0xFFFF //T0=-1
7F023778: 86020008 *LH V0, 0x0008 (S0) //V0=body
7F02377C: 04430003 *BGEZ V0,+4 //branch < 0
7F023780: AFA80030 SW T0, 0x0030 (SP)
7F023784: 0FC08D88 JAL 0x0F023620 //returns V0=random body
7F023788: 00000000 NOP
7F02378C: 00000000 NOP
//end editting - unless need more space!
7F023790: SW V0, 0x0034 (SP) +3
7F023794: LW T1, 0x0034 (SP) //? grab voice flag ?
7F023798: LUI T3, 0x8004
7F02379C: SLL T2, T1, 0x2
7F0237A0: ADDU T2, T2, T1
7F0237A4: SLL T2, T2, 0x2 //T2=T1*0x14
7F0237A8: ADDU T3, T3, T2
7F0237AC: LBU T3, 0xDE21 (T3) //T3=embedded head?
7F0237B0: BNEL T3,R0,7F0237DC
7F0237B4: LW A0, 0x0034 (SP)
7F0237B8: LH V0, 0x0016 (S0)
7F0237BC: BLTZ V0, 0x7F0237CC
7F0237C0: NOP
7F0237C4: BEQ R0, R0, 0x7F0237D8
7F0237C8: SW V0, 0x0030 (SP)
7F0237CC: JAL 0x0F0235AC //returns V0=norm random head
7F0237D0: LW A0, 0x0034 (SP)
7F0237D4: SW V0, 0x0030 (SP)
7F0237D8: LW A0, 0x0034 (SP)
7F0237DC: LW A1, 0x0030 (SP)
7F0237E0: JAL 0x0F0234D0
7F0237E4: LHU A2, 0x0014 (S0)
7F0237E8: BEQ V0, R0, 0x7F0238FC
7F0237EC: SW V0, 0x0038 (SP)
7F0237F0: LW V0, 0x005C (SP)
7F0237F4: LWC1 F12,0018 (V0)
7F0237F8: JAL 0x0F05AA30
7F0237FC: LWC1 F14,0020 (V0)
7F023800: SWC1 F0,003C (SP)
7F023804: JAL 0x0F035398
7F023808: LHU A0, 0x000A (S0)
7F02380C: LW A0, 0x0038 (SP)
7F023810: ADDIU A1, SP, 0x0048
7F023814: LW A2, 0x003C (SP)
7F023818: LW A3, 0x0054 (SP)
7F02381C: JAL 0x0F0203B8
7F023820: SW V0, 0x0010 (SP)
7F023824: BEQ V0, R0, 0x7F0238FC
7F023828: OR A0, V0, R0
7F02382C: JAL 0x0F03A4A4
7F023830: SW V0, 0x0044 (SP)
7F023834: JAL 0x0F03A404
7F023838: LW A0, 0x0044 (SP)
7F02383C: LW T4, 0x0044 (SP)
7F023840: LHU T5, 0x0004 (S0)
7F023844: LUI AT, 0x4F80
7F023848: LW V0, 0x0004 (T4)
7F02384C: SH T5, 0x0000 (V0)
7F023850: LHU T6, 0x0010 (S0)
7F023854: MTC1 T6,F4
7F023858: BGEZ T6, 0x7F02386C
7F02385C: CVT.S.W F6,F4
7F023860: MTC1 AT,F8
7F023864: NOP
7F023868: ADD.S F6,F6,F8
7F02386C: LUI AT, 0x447A
7F023870: MTC1 AT,F10
7F023874: LUI AT, 0x4F80
7F023878: DIV.S F16,F6,F10
7F02387C: SWC1 F16,00EC (V0)
7F023880: LHU T7, 0x0012 (S0)
7F023884: MTC1 T7,F18
7F023888: BGEZ T7, 0x7F02389C
7F02388C: CVT.S.W F4,F18
7F023890: MTC1 AT,F8
7F023894: NOP
7F023898: ADD.S F4,F4,F8
7F02389C: SWC1 F4,00D0 (V0)
7F0238A0: LHU T8, 0x000C (S0)
7F0238A4: SH T8, 0x0114 (V0)
7F0238A8: LHU T9, 0x000E (S0)
7F0238AC: SH T9, 0x0116 (V0)
7F0238B0: LW T0, 0x0030 (SP)
7F0238B4: SB T0, 0x0006 (V0)
7F0238B8: LW T1, 0x0034 (SP)
7F0238BC: SB T1, 0x000F (V0)
7F0238C0: LHU V1, 0x0014 (S0)
7F0238C4: ANDI T2, V1, 0x0004
7F0238C8: *BEQ T2,R0,+4
7F0238D0: LW T3, 0x0014 (V0)
7F0238D4: ORI T4, T3, 0x0002
7F0238D8: SW T4, 0x0014 (V0)
7F0238DC: LHU V1, 0x0014 (S0)
7F0238E0: ANDI T5, V1, 0x0008 +4
7F0238E4: *BEQ T5,R0,+3
7F0238EC: LW T6, 0x0014 (V0)
7F0238F0: ORI T7, T6, 0x0010
7F0238F4: SW T7, 0x0014 (V0)
7F0238F8: SW V0, 0x0018 (S0) +3
7F0238FC: LW RA, 0x0024 (SP)
7F023900: LW S0, 0x0020 (SP)
//don't move this one
7F023908: JR RA
7F023904: *ADDIU SP, SP, 0x0060
@@ -1 +0,0 @@
eade0dfdbd9e77305e7f86f8bef07f74f2ff0dcd
@@ -0,0 +1,51 @@
7F000A00 35530 expand animation table entries (animation source at ROM 0x124AC0)
accepts: A0=p->list of animation table entries
LW V1,0000 (A0)
LUI A2,8007
OR V0,A0,R0 ;V0=A0: p->
BEQ V1,R0,7F000A6C
ADDIU A2,A2,9538 ;A2=80069538
LW V1,0000 (A0)
ADDIU A1,R0,0001 ;A1=1: default animation value
//7F000A1C:
BEQL A1,V1,7F000A58 ;branch if entry 1
LW V1,0004 (V0)
LW T6,0000 (A2) ;T6=80069538: p->animation table
ADDU T7,V1,T6
SW T7,0000 (V0)
LW T9,0000 (A2) ;T9=80069538: p->animation table
LW T8,0008 (T7)
ADDU T0,T8,T9
SW T0,0008 (T7)
LW V1,0000 (V0)
LW T2,0000 (A2) ;T2=80069538: p->animation table
LW T1,0010 (V1)
ADDU T3,T1,T2
SW T3,0010 (V1)
//7F000A54:
LW V1,0004 (V0)
ADDIU V0,V0,0004 ;V0+=4: next entry
BNE V1,R0,7F000A1C ;loop while more entries in table
NOP
OR V0,A0,R0 ;V0=A0: p->
LW V1,0000 (A0)
//7F000A6C:
BEQ V1,R0,7F000AA4 ;return if end of table
ADDIU A1,R0,0001 ;A1=1
LUI A0,0012
ADDIU A0,A0,4AC0 ;A0=0x124AC0
LW V1,0000 (V0)
//7F000A80: generate ROM offsets if not 1
BEQL A1,V1,7F000A98 ;branch if 1
LW V1,0004 (V0)
LW T4,0000 (V1) ;T4=V0+0: offset
ADDU T5,T4,A0 ;T5=T4+0x124AC0:
SW T5,0000 (V1) ;@V1+=0x124AC0: offset->ROM address
//7F000A94:
LW V1,0004 (V0)
ADDIU V0,V0,0004 ;V0+=4: next entry
BNE V1,R0,7F000A80 ;loop while more data in table
NOP
//7F000AA4: return
JR RA
NOP
@@ -0,0 +1,48 @@
7F000AAC 355DC allocate, load, and expand animation tables
ADDIU SP,SP,FFE0
SW RA,0014 (SP)
LUI A0,8007
LUI A1,8007
ADDIU A1,A1,9518 ;A1=80069518:
ADDIU A0,A0,9440 ;A0=80069440:
JAL 7000D6D0
ADDIU A2,R0,0008
//7F000ACC:
LUI A0,8003
LUI A1,8007
LUI A2,8007
ADDIU A2,A2,9458 ;A2-80069458:
ADDIU A1,A1,9440 ;A1=80069440:
JAL 7F0009E0
ADDIU A0,A0,9D60 ;A0=80029D60
//7F000AE8: allocate animation table
LUI T6,0001
LUI T7,0000
ADDIU T7,T7,0000
ADDIU T6,T6,E7E0
SUBU A2,T6,T7 ;A2= E7E0 - 0
OR A0,A2,R0 ;A0=size
SW A2,0018 (SP)
JAL 70009720 ;V0=p->A0 bytes allocated in bank A1
ADDIU A1,R0,0006 ;A1=6
//7F000B0C: load the animations to rdram
LUI V1,8007
ADDIU V1,V1,9538
LUI A1,0029
SW V0,0000 (V1) ;V0->80069538: p->animation table
LW A2,0018 (SP) ;A2= E7E0: size
ADDIU A1,A1,E980 ;A1= 28E980
JAL 70005C1C ;read A2 bytes from hardware A1 to rdram A0
OR A0,V0,R0 ;A0=p->animation table
//7F000B2C: expand both animation tables
LUI A0,8003
JAL 7F000A00 ;expand animation table A0's entries
ADDIU A0,A0,9D6C ;A0=80029D6C: offset table for animations
LUI A0,8003
JAL 7F000A00 ;expand animation table A0's entries
ADDIU A0,A0,A04C ;A0=8002A04C: offset table for final animations
//7F000B44: return
LW RA,0014 (SP)
ADDIU SP,SP,0020
JR RA
NOP
@@ -1 +0,0 @@
12fdf935a5b4506da5761a59b7d9b358d5598713
@@ -0,0 +1,37 @@
First 0x10 appears to be a sort of header
offsets 4018 4070 40D4 4144 4298 42C8
size 58 64 70 154 30 BC
0x0 1 [7] [8] [6] [7] [0] [8]
0x1 1 [0] [0] [0] [0] [0] [0]
0x2 2 [040A] [041C] [041F] [0415] [0000] [03DA]
0x4 2 [C] [C] [A] [C] [0] [A]
0x6 2 [0600] [0600] [0500] [0700] [0000] [0400]
0x8 2 [AF] [73] [36] [1F] [0] [2]
0xA 2 [12] [12] [F] [13] [0] [E]
0xC 4 [0] [0] [0] [0] [0] [0]
Last 0x1C appears to be a sort of tail
offsets 4018 4070 40D4 4144 4298 42C8
size 58 64 70 154 30 BC
datasize 2B 36 42 126 4 90
0x0 2 [5] [5] [5] [5] [5] [5]
0x2 2 [3CE0] [41EC] [484C] [5198] [7788] [8278]
0x4 2 [13] [18] [23] [7C] [3C] [52]
0x6 2 [0C01] [0C01] [0C01] [0C00] [0C00] [0C00]
0x8 2 [0] [0] [0] [0] [0] [0]
0xA 2 [402C] [4084] [40E8] [4158] [42AC] [42DC]
0xC 2 [12] [12] [F] [13] [0] [E]
0xE 2 [0220] [0220] [0220] [0220] [0220] [0220]
0x10 2 [0] [0] [0] [0] [0] [0]
0x12 2 [4044] [409C] [4100] [4170] [42C4] [42F4]
0x14 2 [0] [0] [0] [0] [0] [0]
0x16 2 [0400] [0400] [0500] [0] [0200] [0500]
0x18 2 [1] [1] [9] [0] [0] [-3]
0x1A 2 [4] [4] [5] [0] [2] [5]
0xA 2 offset always data+14
0x12 2 offset always data+14+18
NOTE: 4298 has NULL data.
@@ -1 +0,0 @@
a6bfdd114fa2851fa5b97b53d8d8630600bed49a
@@ -0,0 +1,133 @@
80036514 selected solo animation
80036518 15788-15818 animations for intro block type 4 0x10 each
potential new format:
0x0 2 anim
0x2 2 start point
0x4 2 run length
0x6 2 rate, * 10000
42BE0000 95 005F
42200000 40 0028
40E00000 7 0007
3CA3D70A 0.02 00C8 (2710) or 0014 (0064)
3F000000 0.5 1388 (2710) or 01F4 (0064)
003D 00F4
0042 0108
0061 0184
0062 0188
0063 018C
0064 0190
0066 0198
0067 019C
00B0 02C0
ani val1 val2 val3*10000
003D 005F FFFF 00C8
0042 0007 0028 1388
0061 0000 FFFF 1388
0062 0000 FFFF 1388
0063 0000 FFFF 1388
0064 0000 FFFF 1388
0066 0000 FFFF 1388
0067 0000 FFFF 1388
00B0 0000 FFFF 1388
reset just prior to parsing the intro block commands:
//7F005A10: SW R0,6514 (AT)
7F005C28: writes value set in intro block command to 80036514 register
//7F07ABBC: 0x use, to load the animation!
LUI T0,8003
LW T0,6514 (T0) T0=80036514: animation register
LUI T2,8003
LUI S0,8008
ADDIU T2,T2,6518 T2=80036518: base address for animations
SLL T1,T0,0x4
ADDIU S0,S0,A0B0 S0=8007A0B0
ADDU V0,T1,T2 V0=address for chosen ani data
LW T5,0000 (S0) T5=cur. playerdata
LWC1 F0,0004 (V0) F0=val1
LUI T4,8007
LW T4,9538 (T4) T4=80069538: pointer to animation binaries
LW T3,0000 (V0) T3=offset to ani
LWC1 F12,0008 (V0) F12=val2
LWC1 F2,000C (V0) F2=val3
MTC1 R0,F10
LW A0,00D4 (T5) A0=player's obj.instance
MFC1 A3,F0 A3=val1
OR A2,R0,R0 A2=0
ADDU A1,T3,T4 A1=pointer to selected ani binary
SWC1 F12,0078 (SP) save val2
SWC1 F2,0010 (SP) save val3
JAL 7F06FCA8
SWC1 F10,0014 (SP) 0->SP+14
+ +
+
+ +
Potential Rewrite
//7F07AB84: 0xAF6B4
14400039 -BNEZ V0,7F07AC6C
3C018003 LUI AT,8003
44806000 -MTC1 R0,F12 F12 must=0
AC2064A4 SW R0,64A4 (AT)
24190001 -ADDIU T9,R0,0001
AC3964A8 SW T9,64A8 (AT)
3C013F80 LUI AT,3F80
0FC20284 JAL 7F080A10
44817000 MTC1 AT,F14
0FC1E73C JAL 7F079CF0 leaves AT at 80050000...
00000000 NOP
//7F07ABB0: 0xAF6E0 use, to load the animation!
3C0A8003 LUI T2,8003
8D496514 LW T1,6514 (T2) T0=80036514: animation register
000948C0 SLL T1,T1,0x3 newsize
012A1021 ADDU V0,T1,T2 V0=address for chosen ani data
844B6518 LH T3,6518 (V0) T3=offset to ani
000B5880 SLL T3,T3,0x2
016A2821 ADDU A1,T3,T2
8CA59D6C LW A1,9D6C (A1)
3C108008 LUI S0,8008
2610A0B0 ADDIU S0,S0,A0B0
8E0D0000 LW T5,0000 (S0) T5=cur. playerdata
8DA400D4 LW A0,00D4 (T5) A0=player's obj.instance
//
8446651E LH A2,651E (V0)
44861000 MTC1 A2,F2 F2=val3 LH A2, MTC1, CVT, DIV, SWC1, and need divisor
C4201A3C LWC1 F0,1A3C (AT) 10000, borrowed from main menu, used in scale division!
468010A0 CVT.S.W F2,F2
46001083 DIV.S F2,F2,F0
//
8447651A LH A3,651A (V0)
44870000 MTC1 A3,F0
E7A20010 SWC1 F2,0010 (SP) save val3
46800020 CVT.S.W F0,F0 F0=val1
44070000 MFC1 A3,F0 A3=val1
//
8446651C LH A2,651C (V0)
44866000 MTC1 A2,F12
00003025 OR A2,R0,R0 A2=0
46806320 CVT.S.W F12,F12
E7AC0078 SWC1 F12,0078 (SP) save val2
//
0FC1BF2A JAL 7F06FCA8
AFA00014 SW R0,0014 (SP) 0->SP+14
44808000 MTC1 R0,F16
C7AC0078 LWC1 F12,0078 (SP)
460C803C C.LT.S F16,F12
00000000 NOP
45000004 BC1F +4
8E0F0000 LW T7,0000 (S0)
//7F07AC3C: 0xAF76C
44056000 -MFC1 A1,F12
0FC1BF7A -JAL 7F06FDE8
8DE400D4 LW A0,00D4 (T7)
@@ -1 +0,0 @@
3764ee079398ae14109d3331e5b29d1a7a295f52
@@ -0,0 +1,43 @@
7F000EB8 359E8 allocate and intialize A0 + 10 GUARDdata entries
accepts: A0= #guards
ADDIU T6,A0,000A
SLL T7,T6,0x4
SUBU T7,T7,T6
SLL T7,T7,0x3
SUBU T7,T7,T6
SLL T7,T7,0x2 ;T7= 1DC(A0 + A): space for A0+10 guards
ADDIU SP,SP,FFE8
LUI A2,8003
ADDIU A0,T7,000F
ADDIU A2,A2,CC68
SW RA,0014 (SP)
ORI T8,A0,000F
SW T6,0000 (A2) ;8002CC68 = A0+A: set #guards+10
XORI A0,T8,000F ;A0->nearest quadword boundry
JAL 70009720 ;V0=p->A0 bytes allocated in bank A1
ADDIU A1,R0,0004 ;A1= bank 4
//7F000EF8: set pointer to allocated block
LUI A2,8003
ADDIU A2,A2,CC68
LW T0,0000 (A2) ;T0=8002CC68: #guards
LUI A0,8003
ADDIU A0,A0,CC64
SW V0,0000 (A0) ;V0->8002CC64: p->GUARDdata block
BLEZ T0,7F000F40 ;return if no entries, which isn't really possible
OR V1,R0,R0 ;V1=0 init. count
OR V0,R0,R0 ;V0=0 init. offset
//7F000F1C: initialize each entry
LW T1,0000 (A0) ;T1=p->GUARDdata
ADDIU V1,V1,0001 ;V1+=1 count+=1
ADDU T2,T1,V0
SW R0,001C (T2) ;0->GUARDdata+1C: set NULL p->model
LW T3,0000 (A2) ;T3= #guards
ADDIU V0,V0,01DC ;V0+=1DC: next GUARDdata's offset
SLT AT,V1,T3
BNEL AT,R0,7F000F20 ;loop for each entry
LW T1,0000 (A0)
//7F000F40: return
LW RA,0014 (SP)
ADDIU SP,SP,0018
JR RA
NOP
@@ -0,0 +1,234 @@
7F0050D0 39C00 initialize current player's BONDdata and statistics
ADDIU SP,SP,FC30
LUI T7,8003
ADDIU T7,T7,A3D0
SW RA,001C (SP)
SW S0,0018 (SP)
ADDIU T0,T7,03A8
ADDIU T6,SP,0024
//7F0050EC: copy 8002A3D0-8002A778 to stack
LW AT,0000 (T7)
ADDIU T7,T7,000C
ADDIU T6,T6,000C
SW AT,FFF4 (T6)
LW AT,FFF8 (T7)
SW AT,FFF8 (T6)
LW AT,FFFC (T7)
BNE T7,T0,7F0050EC
SW AT,FFFC (T6)
//7F005110: allocate a right item buffer
LUI A0,8003
LW A0,245C (A0) ;A0=8003245C: [14820]
JAL 70009720 ;V0=p->A0 bytes allocated in bank A1
ADDIU A1,R0,0004 ;A1= bank 4
LUI S0,8008
ADDIU S0,S0,A0B0
LW T1,0000 (S0) ;T1=cur.BONDdata
JAL 7F09A464 ;V0= # players
SW V0,0808 (T1) ;V0->BONDdata+808: right weapon buffer
ADDIU AT,R0,0001
BNE V0,AT,7F005154 ;skip if multiplayer
//7F00513C: allocate a left item buffer
LUI A0,8003
LW A0,2460 (A0) ;A0=80032460: [14820]
JAL 70009720 ;V0=p->A0 bytes allocated in bank A1
ADDIU A1,R0,0004 ;A1= bank 4
LW T2,0000 (S0)
SW V0,080C (T2) ;V0->BONDdata+80C: left weapon buffer
//7F005154:
LW T3,0000 (S0)
ADDIU A1,R0,FFFF
ADDIU V1,SP,0024
SW R0,07F8 (T3) ; 0->BONDdata+7F8: 1st person right invisible
LW T4,0000 (S0)
ADDIU T3,V1,03A8
OR V0,R0,R0
SW R0,07FC (T4) ; 0->BONDdata+7FC: 1st person left invisible
LW T5,0000 (S0)
OR T4,V1,R0
SW R0,0800 (T5) ;0->BONDdata+800: NULL item right #
LW T9,0000 (S0)
SW R0,0804 (T9) ;0->BONDdata+804: NULL item left #
LW T8,0000 (S0)
SW A1,2A44 (T8) ;-1->BONDdata+2A44:
LW T0,0000 (S0)
ADDIU T8,V1,03A8
SW A1,2A48 (T0) ;-1->BONDdata+2A48:
LW T7,0000 (S0)
OR T0,V1,R0
LUI V1,8008
SW R0,2A50 (T7) ; 0->BONDdata+2A50: right item model unlocked
LW T6,0000 (S0)
ADDIU V1,V1,A0B4
SW R0,2A54 (T6) ; 0->BONDdata+2A54: left item model unlocked
LW T1,0000 (S0)
//7F0051BC: copy right item controller initialization from buffer to BONDdata
LW AT,0000 (T4)
ADDIU T4,T4,000C
ADDIU T1,T1,000C
SW AT,0864 (T1)
LW AT,FFF8 (T4)
SW AT,0868 (T1)
LW AT,FFFC (T4)
BNE T4,T3,7F0051BC
SW AT,086C (T1)
LW T5,0000 (S0)
//7F0051E4: copy left item controller initialization from buffer to BONDdata
LW AT,0000 (T0)
ADDIU T0,T0,000C
ADDIU T5,T5,000C
SW AT,0C0C (T5)
LW AT,FFF8 (T0)
SW AT,0C10 (T5)
LW AT,FFFC (T0)
BNE T0,T8,7F0051E4
SW AT,0C14 (T5)
//7F005208: initialize inventory
LW T7,0000 (S0)
ADDU T6,T7,V0
ADDIU V0,V0,0004
SLTI AT,V0,0078
BNE AT,R0,7F005208
SW R0,1130 (T6) ; 0->BONDdata+1130 - +11A8
//7F005220: initialize statistics
LW T2,0000 (V1)
ADDIU A0,R0,0003
SLL V0,A0,0x2
SW R0,0000 (T2) ;0->cur.player.stats+0: reset shots fired
LW T3,0000 (V1)
LUI AT,3F80
MTC1 AT,F2
SW R0,0004 (T3) ;0->cur.player.stats+4: reset hits.head
LW T4,0000 (V1)
LUI AT,8005
MTC1 R0,F0
SW R0,0008 (T4) ;0->cur.player.stats+8: reset hits.body
LW T1,0000 (V1)
OR A0,R0,R0 ;A0= right hand
ADDU T9,T1,V0
SW R0,0000 (T9) ;0->cur.player.stats+C: reset hits.leg
LW T8,0000 (V1)
ADDU T0,T8,V0
SW R0,0004 (T0) ;0->cur.player.stats+10: reset hits.weapon
LW T5,0000 (V1)
ADDU T7,T5,V0
SW R0,0008 (T7) ;0->cur.player.stats+14: reset hits.hat
LW T6,0000 (V1)
ADDU T2,T6,V0
SW R0,000C (T2) ;0->cur.player.stats+18: reset hits.objects
LW T3,0000 (V1)
LWC1 F12,F0E0 (AT) ;F12=8004F0E0: 0.9
ADDIU V0,R0,00FF
SW R0,006C (T3) ;0->cur.player.stats+6C: reset civilians killed
LW T4,0000 (V1)
LUI AT,8005
SW R0,001C (T4) ;0->cur.player.stats+1C: reset kill count
LW T1,0000 (V1)
SW R0,0020 (T1) ;0->cur.player.stats+20: MwtGX kills
//7F0052A8:
LW T9,0000 (S0)
SW R0,29D8 (T9) ; 0->BONDdata+29D8: reset #deaths
LW T8,0000 (S0)
SW R0,29DC (T8) ; 0->BONDdata+29DC: reset #suicides
LW T0,0000 (S0)
SWC1 F2,0FC0 (T0) ;1.0->BONDdata+FC0:
LW T5,0000 (S0)
SWC1 F2,0FC4 (T5) ;1.0->BONDdata+FC4:
LW T7,0000 (S0)
ADDIU T5,R0,0001
SW R0,0FC8 (T7) ; 0->BONDdata+FC8:
LW T6,0000 (S0)
SW R0,0FCC (T6) ; 0->BONDdata+FCC:
LW T2,0000 (S0)
SW R0,0FD0 (T2) ; 0->BONDdata+FD0:
LW T3,0000 (S0)
SW R0,0FD4 (T3) ; 0->BONDdata+FD4:
LW T4,0000 (S0)
SW R0,0FD8 (T4) ; 0->BONDdata+FD8:
LW T1,0000 (S0)
SB V0,0FDC (T1) ;-1->BONDdata+FDC:
LW T9,0000 (S0)
SB V0,0FDD (T9) ;-1->BONDdata+FDD:
LW T8,0000 (S0)
SB V0,0FDE (T8) ;-1->BONDdata+FDE:
LW T0,0000 (S0)
SB R0,0FDF (T0) ; 0->BONDdata+FDF:
LW T7,0000 (S0)
SW T5,0FE0 (T7) ; 1->BONDdata+FE0:
LW T6,0000 (S0)
SW R0,0FE4 (T6) ; 0->BONDdata+FE4:
LW T2,0000 (S0)
SWC1 F0,0FE8 (T2) ;0.0->BONDdata+FE8:
LW T3,0000 (S0)
SWC1 F0,0FEC (T3) ;0.O->BONDdata+FEC:
LW T4,0000 (S0)
SWC1 F0,0FF0 (T4) ;0.0->BONDdata+FF0:
LW T1,0000 (S0)
SWC1 F0,0FF4 (T1) ;0.0->BONDdata+FF4:
LW T9,0000 (S0)
SWC1 F12,0FF8 (T9) ;0.9->BONDdata+FF8:
LW T8,0000 (S0)
SWC1 F0,0FFC (T8) ;0.0->BONDdata+FFC:
LW T0,0000 (S0)
SWC1 F0,1000 (T0) ;0.0->BONDdata+1000:
LW T5,0000 (S0)
SWC1 F0,1004 (T5) ;0.0->BONDdata+1004:
LW T7,0000 (S0)
SWC1 F0,1008 (T7) ;0.0->BONDdata+1008:
LW T6,0000 (S0)
SWC1 F12,100C (T6) ;0.9->BONDdata+100C:
LW T2,0000 (S0)
SWC1 F0,1010 (T2) ;0.0->BONDdata+1010:
LW T3,0000 (S0)
LWC1 F4,F0E4 (AT) ;F4=8004F0E4: -Pi
SWC1 F4,1014 (T3) ;-Pi->BONDdata+1014:
LW T4,0000 (S0)
SWC1 F0,1018 (T4) ;0.0->BONDdata+1018:
LW T1,0000 (S0)
SW R0,1060 (T1) ; 0->BONDdata+1060: reset GEkey analyzed used flag
LW T9,0000 (S0)
SW A1,1270 (T9) ;-1->BONDdata+1270:
LW T8,0000 (S0)
SWC1 F0,106C (T8) ;0.0->BONDdata+106C:
LW T0,0000 (S0)
SWC1 F0,1070 (T0) ;0.0->BONDdata+1070:
LW T5,0000 (S0)
SWC1 F0,1074 (T5) ;0.0->BONDdata+1074:
LW T7,0000 (S0)
SW R0,1078 (T7) ; 0->BONDdata+1078:
LW T6,0000 (S0)
SWC1 F0,107C (T6) ;0.0->BONDdata+107C:
LW T2,0000 (S0)
//7F0053CC:
JAL 7F05C980
SWC1 F0,1080 (T2) ;0.0->BONDdata+1080:
JAL 7F05C980
OR A0,R0,R0 ;A0= right hand
JAL 7F05C980
OR A0,R0,R0 ;A0= right hand
JAL 7F05C980
ADDIU A0,R0,0001 ;A0= left hand
JAL 7F05C980
ADDIU A0,R0,0001 ;A0= left hand
JAL 7F05C980
ADDIU A0,R0,0001 ;A0= left hand
//7F0053FC:
LW T3,0000 (S0)
ADDIU T4,R0,0002
LUI AT,8003
SW R0,1064 (T3) ; 0->BONDdata+1064: reset flags
LW T1,0000 (S0)
SW T4,1128 (T1) ; 2->BONDdata+1128: reset more flags
LW T9,0000 (S0)
LWC1 F6,2C38 (AT) ;F6=80032C38: item 11+34: sniper rifle zoom
LUI AT,8003
SWC1 F6,1084 (T9) ;zoom->BONDdata+1084: sniper zoom
LW T8,0000 (S0)
LWC1 F8,36B8 (AT) ;F8=800336B8: item 29+34: camera zoom
SWC1 F8,1088 (T8) ;zoom->BONDdata+1088: camera zoom
//7F005430: return
LW RA,001C (SP)
LW S0,0018 (SP)
ADDIU SP,SP,03D0
JR RA
NOP
@@ -0,0 +1,346 @@
7F0793EC ADF1C initialize playerdata
ADDIU SP,SP,FFE8
SW RA,0014 (SP)
JAL 7F09A464 ;V0=#players
NOP
SLTI AT,V0,0002
BNEZ AT,7F07943C ;branch if solo
NOP
//7F079408: multiplayer only...
JAL 7F09B150 ;V0=cur.player#
NOP
JAL 7F0100BC ;V0= player A0's control style
OR A0,V0,R0 ;A0=V0: player#
LUI V1,8008
ADDIU V1,V1,A0B0
LW T6,0000 (V1) ;T6=8007A0B0: cur.player data pointer
JAL 7F09B150 ;V0=cur.player#
SW V0,0430 (T6) ;cur.player+430: control style
JAL 7F0100BC ;V0= player A0's control style
OR A0,V0,R0 ;A0=V0: player#
JAL 7F0A4DD0 ;set control style A0 to current playerdata
OR A0,V0,R0 ;A0=V0: control style
//7F07943C:
LUI V1,8008
ADDIU V1,V1,A0B0
MTC1 R0,F0 ;F0=0
LW T7,0000 (V1) ;T7=8007A0B0: cur.BONDdata pointer
LUI AT,3F80
MTC1 AT,F2 ;F2=1.0 [3F800000]
SWC1 F0,0038 (T7) ;BONDdata+38= 0.0
LW T8,0000 (V1) ;T8=p->cur.BONDdata
ADDIU A3,R0,0002 ;A3=2
ADDIU A1,R0,0001 ;A1=1
SWC1 F0,003C (T8) ;BONDdata+3C= 0.0
LW T9,0000 (V1) ;T9=p->cur.BONDdata
ADDIU A2,R0,FFFF ;A2=-1
LUI AT,C080
SWC1 F0,0040 (T9) ;BONDdata+40= 0.0
LW T0,0000 (V1) ;T0=p->cur.BONDdata
MTC1 AT,F4 ;F4=-4.0 [C0800000]
LUI AT,43B4
SWC1 F0,0044 (T0) ;BONDdata+44= 0.0
LW T1,0000 (V1) ;T1=p->cur.BONDdata
SWC1 F0,0048 (T1) ;BONDdata+48= 0.0
LW T2,0000 (V1) ;T2=p->cur.BONDdata
SWC1 F0,004C (T2) ;BONDdata+4C= 0.0
LW T3,0000 (V1) ;T3=p->cur.BONDdata
SWC1 F0,0050 (T3) ;BONDdata+50= 0.0
LW T4,0000 (V1) ;T4=p->cur.BONDdata
SWC1 F0,0054 (T4) ;BONDdata+54= 0.0
LW T5,0000 (V1) ;T5=p->cur.BONDdata
SWC1 F0,0058 (T5) ;BONDdata+58= 0.0
LW T6,0000 (V1) ;T6=p->cur.BONDdata
SW R0,0000 (T6) ;BONDdata+0= 0
LW T7,0000 (V1) ;T7=p->cur.BONDdata
SWC1 F0,0004 (T7) ;BONDdata+4= 0.0
LW T8,0000 (V1) ;T8=p->cur.BONDdata
SWC1 F0,0008 (T8) ;BONDdata+8= 0.0
LW T9,0000 (V1) ;T9=p->cur.BONDdata
SWC1 F0,000C (T9) ;BONDdata+C= 0.0
LW T0,0000 (V1) ;T0=p->cur.BONDdata
SWC1 F0,0010 (T0) ;BONDdata+10= 0.0
LW T1,0000 (V1) ;T1=p->cur.BONDdata
SWC1 F0,0014 (T1) ;BONDdata+14= 0.0
LW T2,0000 (V1) ;T2=p->cur.BONDdata
SWC1 F2,0018 (T2) ;BONDdata+18= 1.0
LW T3,0000 (V1) ;T3=p->cur.BONDdata
SWC1 F0,001C (T3) ;BONDdata+1C= 0.0
LW T4,0000 (V1) ;T4=p->cur.BONDdata
SWC1 F2,0020 (T4) ;BONDdata+20= 1.0
LW T5,0000 (V1) ;T5=p->cur.BONDdata
SWC1 F0,0024 (T5) ;BONDdata+24= 0.0
LW T6,0000 (V1) ;T6=p->cur.BONDdata
SWC1 F0,0028 (T6) ;BONDdata+28= 0.0
LW T7,0000 (V1) ;T7=p->cur.BONDdata
SWC1 F0,002C (T7) ;BONDdata+2C= 0.0
LW T8,0000 (V1) ;T8=p->cur.BONDdata
SWC1 F0,0030 (T8) ;BONDdata+30= 0.0
LW T9,0000 (V1) ;T9=p->cur.BONDdata
SW R0,0034 (T9) ;BONDdata+34= 0
LW T0,0000 (V1) ;T0=p->cur.BONDdata
SWC1 F0,03C4 (T0) ;BONDdata+3C4= 0.0
LW T1,0000 (V1) ;T1=p->cur.BONDdata
SWC1 F0,03C8 (T1) ;BONDdata+3C8= 0.0
LW T2,0000 (V1) ;T2=p->cur.BONDdata
SWC1 F2,03CC (T2) ;BONDdata+3CC= 1.0
LW T3,0000 (V1) ;T3=p->cur.BONDdata
SWC1 F0,0084 (T3) ;BONDdata+84= 0.0
LW T4,0000 (V1) ;T4=p->cur.BONDdata
SWC1 F0,0088 (T4) ;BONDdata+88= 0.0
LW T5,0000 (V1) ;T5=p->cur.BONDdata
SW R0,008C (T5) ;BONDdata+8C= 0
LW T6,0000 (V1) ;T6=p->cur.BONDdata
SWC1 F0,0090 (T6) ;BONDdata+90= 0.0
LW T7,0000 (V1) ;T7=p->cur.BONDdata
SW R0,0094 (T7) ;BONDdata+94= 0
LW T8,0000 (V1) ;T8=p->cur.BONDdata
SWC1 F0,0098 (T8) ;BONDdata+98= 0.0
LW T9,0000 (V1) ;T9=p->cur.BONDdata
SWC1 F0,1274 (T9) ;BONDdata+1274= 0.0
LW T0,0000 (V1) ;T0=p->cur.BONDdata
SWC1 F0,1278 (T0) ;BONDdata+1278= 0.0
LW T1,0000 (V1) ;T1=p->cur.BONDdata
SWC1 F0,127C (T1) ;BONDdata+127C= 0.0
LW T2,0000 (V1) ;T2=p->cur.BONDdata
SW A3,009C (T2) ;BONDdata+9C= 2
LW T3,0000 (V1) ;T3=p->cur.BONDdata
SW A3,29FC (T3) ;BONDdata+29FC= 2
LW T4,0000 (V1) ;T4=p->cur.BONDdata
SWC1 F0,00A0 (T4) ;BONDdata+A0= 0.0
LW T5,0000 (V1) ;T5=p->cur.BONDdata
SWC1 F0,00A4 (T5) ;BONDdata+A4= 0.0
LW T6,0000 (V1) ;T6=p->cur.BONDdata
SW A1,00AC (T6) ;BONDdata+AC= 1
LW T7,0000 (V1) ;T7=p->cur.BONDdata
SW R0,00D0 (T7) ;BONDdata+D0= 0
LW T8,0000 (V1) ;T8=p->cur.BONDdata
SW R0,00D8 (T8) ;BONDdata+D8= 0
LW T9,0000 (V1) ;T9=p->cur.BONDdata
SWC1 F2,00DC (T9) ;BONDdata+DC= 1.0
LW T0,0000 (V1) ;T0=p->cur.BONDdata
SWC1 F0,00E0 (T0) ;BONDdata+E0= 0.0
LW T1,0000 (V1) ;T1=p->cur.BONDdata
SWC1 F2,00E4 (T1) ;BONDdata+E4= 1.0
LW T2,0000 (V1) ;T2=p->cur.BONDdata
SWC1 F0,00E8 (T2) ;BONDdata+E8= 0.0
LW T3,0000 (V1) ;T3=p->cur.BONDdata
SWC1 F2,00EC (T3) ;BONDdata+EC= 1.0
LW T4,0000 (V1) ;T4=p->cur.BONDdata
SWC1 F0,00F0 (T4) ;BONDdata+F0= 0.0
LW T5,0000 (V1) ;T5=p->cur.BONDdata
SW A2,00F4 (T5) ;BONDdata+F4= -1
LW T6,0000 (V1) ;T6=p->cur.BONDdata
SW A2,00F8 (T6) ;BONDdata+F8= -1
LW T7,0000 (V1) ;T7=p->cur.BONDdata
SW R0,01C0 (T7) ;BONDdata+1C0= 0
LW T8,0000 (V1) ;T8=p->cur.BONDdata
SW R0,01C4 (T8) ;BONDdata+1C4= 0
LW T9,0000 (V1) ;T9=p->cur.BONDdata
SW R0,01C8 (T9) ;BONDdata+1C8= 0
LW T0,0000 (V1) ;T0=p->cur.BONDdata
SW A1,01CC (T0) ;BONDdata+1CC= 1
LW T1,0000 (V1) ;T1=p->cur.BONDdata
SW R0,01D0 (T1) ;BONDdata+1D0= 0
LW T2,0000 (V1) ;T2=p->cur.BONDdata
SW R0,01A0 (T2) ;BONDdata+1A0= 0
LW T3,0000 (V1) ;T3=p->cur.BONDdata
SWC1 F0,019C (T3) ;BONDdata+19C= 0.0
LW T4,0000 (V1) ;T4=p->cur.BONDdata
SWC1 F0,014C (T4) ;BONDdata+14C= 0,0
LW T5,0000 (V1) ;T5=p->cur.BONDdata
SWC1 F2,0150 (T5) ;BONDdata+150= 1.0
LW T6,0000 (V1) ;T6=p->cur.BONDdata
SWC1 F0,0154 (T6) ;BONDdata+154= 0.0
LW T7,0000 (V1) ;T7=p->cur.BONDdata
SWC1 F4,0158 (T7) ;BONDdata+158= -4.0
//7F079650:
LW A0,0000 (V1) ;A0=p->cur.BONDdata
LWC1 F6,0158 (A0) ;F6=-4.0
SWC1 F6,015C (A0) ;BONDdata+15C= -4.0
LW A0,0000 (V1) ;A0=p->cur.BONDdata
LWC1 F12,015C (A0) ;F12= -4.0
C.LT.S F12,F0
NOP
BC1FL 7F07968C ;branch if -4.0 >= 0.0, which it never will be...
SWC1 F0,0160 (A0)
MTC1 AT,F8 ;F8=360.0 [43B40000]
NOP
ADD.S F10,F12,F8 ;F10=-4.0 + 360.0: 356.0
SWC1 F10,015C (A0) ;BONDdata+15C= 356.0 [43B20000]
LW A0,0000 (V1) ;A0=p->cur.BONDdata
//7F079688:
SWC1 F0,0160 (A0) ;BONDdata+160=0.0
LW T8,0000 (V1) ;T8=p->cur.BONDdata
ADDIU V0,R0,00FF ;V0=FF
LUI AT,BF80
SWC1 F2,0164 (T8) ;BONDdata+164= 1.0
LW T9,0000 (V1) ;T9=p->cur.BONDdata
MTC1 AT,F12 ;F12=-1 [BF800000]
LUI AT,4170
SWC1 F0,0168 (T9) ;BONDdata+168= 0.0
LW T0,0000 (V1) ;T0=p->cur.BONDdata
MTC1 AT,F16 ;F16=15.0 [41700000]
SWC1 F0,016C (T0) ;BONDdata+16C= 0.0
LW T1,0000 (V1) ;T1=p->cur.BONDdata
SWC1 F0,0170 (T1) ;BONDdata+170= 0.0
LW T2,0000 (V1) ;T2=p->cur.BONDdata
SWC1 F0,0174 (T2) ;BONDdata+174= 0.0
LW T3,0000 (V1) ;T3=p->cur.BONDdata
SWC1 F0,2A4C (T3) ;BONDdata+2A4C= 0.0
LW T4,0000 (V1) ;T4=p->cur.BONDdata
SWC1 F2,0178 (T4) ;BONDdata+178= 1.0
LW T5,0000 (V1) ;T5=p->cur.BONDdata
SW R0,017C (T5) ;BONDdata+17C= 0
LW T6,0000 (V1) ;T6=p->cur.BONDdata
SWC1 F0,0180 (T6) ;BONDdata+180= 0.0
LW T7,0000 (V1) ;T7=p->cur.BONDdata
SWC1 F0,0184 (T7) ;BONDdata+184= 0.0
LW T8,0000 (V1) ;T8=p->cur.BONDdata
SWC1 F0,0188 (T8) ;BONDdata+188= 0.0
LW T9,0000 (V1) ;T9=p->cur.BONDdata
SW R0,0104 (T9) ;BONDdata+104= 0
LW T0,0000 (V1) ;T0=p->cur.BONDdata
SW R0,0108 (T0) ;BONDdata+108= 0
LW T1,0000 (V1) ;T1=p->cur.BONDdata
SW R0,010C (T1) ;BONDdata+10C= 0
LW T2,0000 (V1) ;T2=p->cur.BONDdata
SW R0,0110 (T2) ;BONDdata+110= 0
LW T3,0000 (V1) ;T3=p->cur.BONDdata
SW A1,0114 (T3) ;BONDdata+114= 1
LW T4,0000 (V1) ;T4=p->cur.BONDdata
SW A1,0118 (T4) ;BONDdata+118= 1
LW T5,0000 (V1) ;T5=p->cur.BONDdata
SW R0,011C (T5) ;BONDdata+11C= 0
LW T6,0000 (V1) ;T6=p->cur.BONDdata
SW A1,0120 (T6) ;BONDdata+120= 1
LW T7,0000 (V1) ;T7=p->cur.BONDdata
SW R0,0124 (T7) ;BONDdata+124= 0
LW T8,0000 (V1) ;T8=p->cur.BONDdata
SW A1,0128 (T8) ;BONDdata+128= 1
LW T9,0000 (V1) ;T9=p->cur.BONDdata
SWC1 F0,012C (T9) ;BONDdata+12C= 0.O
LW T0,0000 (V1) ;T0=p->cur.BONDdata
SW R0,0130 (T0) ;BONDdata+130= 0
LW T1,0000 (V1) ;T1=p->cur.BONDdata
SW A2,0134 (T1) ;BONDdata+134=-1
LW T2,0000 (V1) ;T2=p->cur.BONDdata
SW A1,0138 (T2) ;BONDdata+138= 1
LW T3,0000 (V1) ;T3=p->cur.BONDdata
SWC1 F0,013C (T3) ;BONDdata+13C= 0.0
LW T4,0000 (V1) ;T4=p->cur.BONDdata
SW R0,0140 (T4) ;BONDdata+140= 0
LW T5,0000 (V1) ;T5=p->cur.BONDdata
SW A2,0144 (T5) ;BONDdata+144=-1
LW T6,0000 (V1) ;T6=p->cur.BONDdata
SW V0,03D0 (T6) ;BONDdata+3D0= FF
LW T7,0000 (V1) ;T7=p->cur.BONDdata
SW V0,03D4 (T7) ;BONDdata+3D4= FF
LW T8,0000 (V1) ;T8=p->cur.BONDdata
SW V0,03D8 (T8) ;BONDdata+3D8= FF
LW T9,0000 (V1) ;T9=p->cur.BONDdata
SWC1 F0,03DC (T9) ;BONDdata+3DC= 0.0
LW T0,0000 (V1) ;T0=p->cur.BONDdata
SWC1 F12,03E0 (T0) ;BONDdata+3E0=-1.0
LW T1,0000 (V1) ;T1=p->cur.BONDdata
SWC1 F12,03E4 (T1) ;BONDdata+3E4=-1.0
LW T2,0000 (V1) ;T2=p->cur.BONDdata
SW V0,03E8 (T2) ;BONDdata+3E8= FF
LW T3,0000 (V1) ;T3=p->cur.BONDdata
SW V0,03EC (T3) ;BONDdata+3EC= FF
LW T4,0000 (V1) ;T4=p->cur.BONDdata
SW V0,03F0 (T4) ;BONDdata+3F0= FF
LW T5,0000 (V1) ;T5=p->cur.BONDdata
SW V0,03F4 (T5) ;BONDdata+3F4= FF
LW T6,0000 (V1) ;T6=p->cur.BONDdata
SW V0,03F8 (T6) ;BONDdata+3F8= FF
LW T7,0000 (V1) ;T7=p->cur.BONDdata
SW V0,03FC (T7) ;BONDdata+3FC= FF
LW T8,0000 (V1) ;T8=p->cur.BONDdata
SWC1 F0,0400 (T8) ;BONDdata+400= 0.0
LW T9,0000 (V1) ;T9=p->cur.BONDdata
SWC1 F0,0404 (T9) ;BONDdata+404= 0.0
LW T0,0000 (V1) ;T0=p->cur.BONDdata
SWC1 F12,018C (T0) ;BONDdata+18C=-1.0
LW T1,0000 (V1) ;T1=p->cur.BONDdata
SWC1 F12,0190 (T1) ;BONDdata+190=-1.0
LW T2,0000 (V1) ;T2=p->cur.BONDdata
SWC1 F0,0194 (T2) ;BONDdata+194= 0.0
LW T3,0000 (V1) ;T3=p->cur.BONDdata
SWC1 F0,0198 (T3) ;BONDdata+198= 0.0
LW T4,0000 (V1) ;T4=p->cur.BONDdata
SW A3,042C (T4) ;BONDdata+42C= 2
LW T5,0000 (V1) ;T5=p->cur.BONDdata
SW R0,0430 (T5) ;BONDdata+430= 0
LW T6,0000 (V1) ;T6=p->cur.BONDdata
SWC1 F0,0204 (T6) ;BONDdata+204= 0.0
LW T7,0000 (V1) ;T7=p->cur.BONDdata
SWC1 F0,0208 (T7) ;BONDdata+208= 0.0
LW T8,0000 (V1) ;T8=p->cur.BONDdata
SWC1 F0,020C (T8) ;BONDdata+20C= 0.0
LW T9,0000 (V1) ;T9=p->cur.BONDdata
SWC1 F0,0210 (T9) ;BONDdata+210= 0.0
LW T0,0000 (V1) ;T0=p->cur.BONDdata
SWC1 F0,0214 (T0) ;BONDdata+214= 0.0
LW T1,0000 (V1) ;T1=p->cur.BONDdata
SW R0,0218 (T1) ;BONDdata+218= 0
LW T2,0000 (V1) ;T2=p->cur.BONDdata
SW R0,0220 (T2) ;BONDdata+220= 0
LW T3,0000 (V1) ;T3=p->cur.BONDdata
SWC1 F0,0224 (T3) ;BONDdata+224= 0.0
LW T4,0000 (V1) ;T4=p->cur.BONDdata
SW R0,0200 (T4) ;BONDdata+200= 0
LW T5,0000 (V1) ;T5=p->cur.BONDdata
SH R0,03B4 (T5) ;BONDdata+3B4= 0
LW T6,0000 (V1) ;T6=p->cur.BONDdata
SH R0,03B6 (T6) ;BONDdata+3B6= 0
LW T7,0000 (V1) ;T7=p->cur.BONDdata
SWC1 F16,29C0 (T7) ;BONDdata+29C0= 15.0
LW T8,0000 (V1) ;T8=p->cur.BONDdata
SH A2,2A04 (T8) ;BONDdata+2A04=-1
LW T9,0000 (V1) ;T9=p->cur.BONDdata
SWC1 F0,2A08 (T9) ;BONDdata+2A08= 0.0
LW T0,0000 (V1) ;T0=p->cur.BONDdata
SWC1 F0,2A0C (T0) ;BONDdata+2A0C= 0.0
LW T1,0000 (V1) ;T1=p->cur.BONDdata
SW R0,2A6C (T1) ;BONDdata+2A6C= 0
LW T2,0000 (V1) ;T2=p->cur.BONDdata
SW R0,2A70 (T2) ;BONDdata+2A70= 0
//7F0798A8: return
LW RA,0014 (SP)
ADDIU SP,SP,0018
JR RA
NOP
+_+
7F0A4DD0 D9900 set control style A0 to current playerdata
accepts: A0=control style
fries: V0,V1,T0,T1,T2,T3,T4,T6,T7,T8,T9,F4,F6
LUI V1,8008
ADDIU V1,V1,A0B0
LW T6,0000 (V1) ;T6=cur.BONDdata
MTC1 A0,F4
LUI T9,8005
SW A0,2A58 (T6) ;BONDdata+2A58= style
LW T7,0000 (V1) ;T7=cur.BONDdata
CVT.S.W F6,F4 ;F6=(float) style
ADDIU V0,R0,000A
SW A0,2A5C (T7) ;BONDdata+2A5C= style
LW T8,0000 (V1) ;T8=cur.BONDdata
SWC1 F6,2A60 (T8) ;BONDdata+2A60= (float) style
LB T9,84D0 (T9) ;T9=800484D0: selected language
BLEZ T9,+3 ;if english-ish, V0=A
NOP
BEQ R0,R0,+1 ;if japanese-ish, V0=E
ADDIU V0,R0,000E
//
MULTU V0,A0
LW T2,0000 (V1) ;T2=cur.BONDdata
ADDIU T3,R0,0001
MFLO T0 ;T0=style * language vertical spacing
SUBU T1,R0,T0 ;T1=0-spacing
SW T1,2A64 (T2) ;BONDdata+2A64= vertical spacing to entry
LW T4,0000 (V1) ;T4=cur.BONDdata
JR RA
SW T3,2A68 (T4) ;BONDdata+2A68=1:
@@ -0,0 +1,225 @@
800364D8 0x15748 12 longs, probably offsets
most likely death animations
//7F006160: determine number of entries, save to 8003650C
LUI A0,8003
ADDIU A0,A0,64D8
SLL T0,R0,0x2
ADDU T1,A0,T0
LW T3,0000 (T1) ;T3=800364D8: 000030B8, first of values
LUI V1,8003
ADDIU V1,V1,650C
SW R0,0000 (V1) ;0->8003650C: counter of values
BEQ T3,R0,7F0061A8
OR V0,R0,R0 ;V0=counter
ADDIU T4,V0,0001
//7F00618C:
SLL T2,T4,0x2
ADDU T9,A0,T2
LW T5,0000 (T9) ;retrieve value
SW T4,0000 (V1) ;save running total
OR V0,T4,R0
BNEL T5,R0,7F00618C ;keep indexing
ADDIU T4,V0,0001
//7F0061A8:
Used here when blowing a player up in multiplayer. Recalls a random entry
7F080B34: recall and use player death animation, or something like that
...
//7F080BC4:
JAL 7000A450 ;ret. V0=rand
SW V0,0044 (SP)
LUI T9,8003
LW T9,650C (T9) ;#entries
LW T8,0044 (SP)
LUI T2,8003
LUI T3,8007
DIVU T8,T9
MFHI T0
SLL T1,T0,0x2 ;T0=random entry in range
ADDU T2,T2,T1
LW T2,64D8 (T2) ;load the animation offset
LW T3,9538 (T3) ;T3=80069538: p->animation binaries
MFC1 A2,F20
BNEZ T9,7F080C08
NOP
BREAK
ANDI A1,V0,0001
LUI A3,3F80
JAL 7F08EA48
ADDU A0,T2,T3 ;final animation value
//7F08B3AC:
LUI A3,8003
LW A3,650C (A3) ;A3=#ani
OR A1,R0,R0
OR S0,R0,R0
BLEZ A3,7F08B400 ;skip if stupid
LUI T9,8003
ADDIU V0,T9,64D8 ;V0=800364D8: base for ani table
LUI V1,8007
SLL T1,A3,0x2 ;T1=entry -> offset
ADDU A0,T1,V0 ;A0=entry
LW V1,9538 (V1)
LW A2,1284 (T0) ;A2=player's cur animation; T0=playerdata
LW T2,0000 (V0)
//7F08B3E0:
ADDIU V0,V0,0004 ;span the list, looking for a hit
SLTU AT,V0,A0
ADDU T3,T2,V1
BNE A2,T3,7F08B3F8
NOP
ADDIU A1,R0,0001
//7F08B3F8:
BNEL AT,R0,7F08B3E0
LW T2,0000 (V0)
//7F08B400:
BEQ A1,R0,7F08B418
LUI AT,3F00
LW A2,1284 (T0)
MTC1 AT,F12
BEQ R0,R0,7F08B470
SW A2,009C (SP)
//7F08B418:
JAL 7000A450
SWC1 F2,0094 (SP)
LUI T4,8003
LW T4,650C (T4)
LUI T7,8003
LUI T8,8007
DIVU V0,T4
MFHI T5
SLL T6,T5,0x2
ADDU T7,T7,T6
LW T7,64D8 (T7)
LW T8,9538 (T8)
LW T0,0000 (S1)
LUI AT,3F00
ADDU T1,T7,T8
SW T1,009C (SP)
MTC1 AT,F12
LWC1 F2,0094 (SP)
BNEZ T4,7F08B46C
NOP
BREAK
LW A2,1284 (T0)
MTC1 R0,F14
NOP
SWC1 F14,008C (SP)
BEQ R0,R0,7F08B858
SWC1 F14,0088 (SP)
[minor edit so they use less and follow 0A method]
000030B8 001A
000031DC 001B
000032C8 001C
000033AC 001D
000034D4 001E
000035C8 001F
000036D8 0020
0000384C 0021
000039C0 0022
00003AF0 0023
00003C10 0024
00003D04 0025
!REVISED!
//7F006168: 0x3AC98
00004040 *SLL T0,R0,0x1
-
852B0000 *LH T3,0000 (T1)
//7F00618C: 0x3ACBC
000C5040 *SLL T2,T4,0x1
-
85EF0000 *LH T5,0000 (T9) ;retrieve value
//7F080BC4: 0xB56F4
-JAL 7000A450 ;ret. V0=rand
-SW V0,0044 (SP)
-LUI T9,8003
-LW T9,650C (T9) #entries
-LW T8,0044 (SP)
-LUI T2,8003
3C0B8003 *LUI T3,8003
53200003 BEQL T9,R0,+3
00004025 OR T0,R0,R0
0319001B DIVU T8,T9
00004010 MFHI T0
00084840 *SLL T1,T0,0x1 ;T0=random entry in range
01495021 ADDU T2,T2,T1
854A64D8 *LH T2,64D8 (T2) ;load the animation offset
000A5080 +SLL T2,T2,0x2
014B2021 ADDU A0,T2,T3 ;final animation value
4406A000 MFC1 A2,F20
-ANDI A1,V0,0001
-LUI A3,3F80
-JAL 7F08EA48
8C849D6C LW A0,9D6C (A0) ;T3=table of animation binary pointers
//7F08B3AC: 0xBFEDC
LUI A3,8003
LW A3,650C (A3) ;A3=8003650C+offset: #ani
OR A1,R0,R0
OR S0,R0,R0
BLEZ A3,7F08B400 ;skip if stupid
LUI T9,8003
ADDIU V0,T9,64D8 ;V0=800364D8: base for ani table
//7F08B3C8: 0xBFEF8
00074840 *SLL T1,A3,0x1 ;T1=entry -> offset
01222021 ADDU A0,T1,V0 ;A0=entry
27239D6C *ADDIU V1,9D6C (T9) ;V1=80029D6C: pointers to animation binaries
8D061284 LW A2,1284 (T0) ;T0=cur playerdata
844A0000 *LH T2,0000 (V0) ;T2=ani #
//7F08B3DC: 0xBFF0C
000A5080 *SLL T2,T2,0x2
*ADDIU V0,V0,0002
-SLTU AT,V0,A0
-ADDU T3,T2,V1
8D6B0000 *LW T3,0000 (T3)
50CB0001 *BEQL A2,T3,7F08B3F8
-ADDIU A1,R0,0001
//7F08B3F8: 0xBFF28
5420FFF8 *BNEL AT,R0,7F08B3DC
844A0000 *LH T2,0000 (V0)
//7F08B400:
BEQ A1,R0,7F08B418
LUI AT,3F00
LW A2,1284 (T0)
MTC1 AT,F12
BEQ R0,R0,7F08B470
SW A2,009C (SP)
//7F08B418: 0xBFF48
JAL 7000A450
SWC1 F2,0094 (SP)
3C188003 *LUI T8,8003
8F0C650C *LW T4,650C (T8)
59800003 *BLEZL T4,+3
00006825 *OR T5,R0,R0
004C001B -DIVU V0,T4
00006810 -MFHI T5
000D7040 *SLL T6,T5,0x1 ;offset in table
030E7821 *ADDU T7,T8,T6
85EF64D8 *LH T7,64D8 (T7) ;T7=ani#
000F7880 *SLL T7,T7,0x2
8E280000 -LW T0,0000 (S1) ;T0=specific playerdata
3C013F00 -LUI AT,3F00
01F84821 -ADDU T1,T7,T8
8D299D6C *LW T1,9D6C (T1) ;80029D6C+
AFA9009C SW T1,009C (SP)
44816000 MTC1 AT,F12
C7A20094 LWC1 F2,0094 (SP)
00000000 -NOP
00000000 *NOP
LW A2,1284 (T0)
MTC1 R0,F14
NOP
SWC1 F14,008C (SP)
BEQ R0,R0,7F08B858
SWC1 F14,0088 (SP)
@@ -1 +0,0 @@
05f13cd5c4b83d1a12c6d8f0de40d5c4a8d66211
@@ -0,0 +1,238 @@
cuff value pulled from setup in 7F005C3C
stored to player data +0x41C
summary of below.
Note that the characters below were identified from the various hand models. The list should be accurate.
Also, although model numbers differ, heads 4A, 4B, 4C are identical. 4D is unused
Cuff 0 Blue suit (default values when not otherwise set)
body: 0xAE8C7 default: 17
head: 0xAE8CB default: 4B
Cuff 1 Brosnan (mp)
body: 0xAE957 default: 05
head: 0xAEA3F default: 4E
Cuff 2 Jungle camo
body: 0xAE93F default: 18
head: 0xAEA33 default: 4C
Cuff 3 Boiler suit
body: 0xAE933 default: 16
head: 0xAEA27 default: 4A
Cuff 4 Snowsuit
body: 0xAE94B default: 19
head: 0xAE8CB default: 4B [shared with bluesuit]
Cuff 5 Connery
body: 0xAE963 default: 05
head: 0xAEA4B default: 4E
Cuff 6 Moore
body: 0xAE96F default: 05
head: 0xAEA57 default: 4E
Cuff 7 Dalton
body: 0xAE97B default: 05
head: 0xAEA63 default: 4E
Cuff 8 Variable Bonds
body: 0xAE98B default: 05
head: 0xAEA6F default: 4E
Patch to allow snowsuit it's own head entry:
AEA24:
100000xx BEQ R0,R0,
240D004A ADDIU T5,R0,004A
//+4 to normal address
100000xx BEQ R0,R0,
240D004C ADDIU T5,R0,004C
//new snowsuit
100000xx BEQ R0,R0,
240D004B ADDIU T5,R0,004B
//change registers for entry only
0xA3AED 0D
0xAEA45
AD
RESULT:
AEA24 000E 10000006 240D004A 10000004 240D
AEA37 0007 02240D00 4B240D
AEA45 0001 AD
in 21990:
change entry 2 to 7F079EFC, entry 4 to 7F079F04
34282
0002 9EFC
3428B 0001 04
-----------
note: bluesuit is default; values initilaized at 7F079D94 (body, head)
recalled @ 7F079DD4:
LUI T7,8008
LW T7,A0B0 (T7)
LW V1,041C (T7) //cuff for player
SLTIU AT,V1,0009 //must be 0-8
BEQ AT,R0,7F079EA4 //skip recall when invalid
SLL T3,V1,0x2 //T3=cuff->offset
LUI AT,8005
ADDU AT,AT,T3
LW T3,4FE4 (AT) //80054FE4: pull TLB pointer for routine setting body model for each
JR T3
NOP
7F079E00: 3-boiler suit
ADDIU T2,R0,0016
BEQ R0,R0,7F079EA4
SW T2,0044 (SP)
7F079E0C: 2-jungle bond
ADDIU T2,R0,0018
BEQ R0,R0,7F079EA4
SW T2,0044 (SP)
7F079E18: 4-snowsuit bond
ADDIU T2,R0,0019
BEQ R0,R0,7F079EA4
SW T2,0044 (SP)
7F079E24: 1-Brosnan Tux (from multiplayer)
ADDIU T2,R0,0005
BEQ R0,R0,7F079EA4
SW T2,0044 (SP)
7F079E30: 5-Connery Tux (according to cuff images)
ADDIU T2,R0,0005
BEQ R0,R0,7F079EA4
SW T2,0044 (SP)
7F079E3C: 6-Moore Tux (according to cuff images)
ADDIU T2,R0,0005
BEQ R0,R0,7F079EA4
SW T2,0044 (SP)
7F079E48: 7-Dalton Tux (according to cuff images)
ADDIU T2,R0,0005
BEQ R0,R0,7F079EA4
SW T2,0044 (SP)
7F079E54: 8-variable bond heads, based off selection on folder screen; defaults to 05/4E
BEQ V0,R0,7F079E88
ADDIU T3,R0,0005
ADDIU AT,R0,0001
BEQ V0,AT,7F079E90 //V0=selected Bond
ADDIU T2,R0,0005
ADDIU AT,R0,0002
BEQ V0,AT,70F79E98
ADDIU T4,R0,0005
ADDIU AT,R0,0003
BEQ V0,AT,7F079EA0
ADDIU T9,R0,0005
BEQ R0,R0,7F079EA4
NOP
//7F079E88:
BEQ R0,R0,7F079EA4
SW T3,0044 (SP)
//7F079E90:
BEQ R0,R0,7F079EA4
SW T2,0044 (SP)
//7F079E98:
BEQ R0,R0,7F079EA4
SW T4,0044 (SP)
SW T9,0044 (SP)
7F079EA4:
BEQ V0,R0,7F079ED8 //take branch on solo, setting head
SLTIU AT,V1,0009
//7F079EAC: MP only routine retrieving head based on player number
ADDIU AT,R0,0001
BEQ V0,AT,7F079F48
ADDIU T8,R0,004E //default head - Brosnan Tux
ADDIU AT,R0,0002
BEQ V0,AT,7F079F50
ADDIU T5,R0,004E
ADDIU AT,R0,0003
BEQ V0,AT,7F079F58
ADDIU T6,R0,004E
BEQ R0,R0,7F079F84
NOP
//7F079ED8: pull head using cuff value
BEQ AT,R0,7F079F84
SLL T8,V1,0x2
LUI AT,8005
ADDU AT,AT,T8
LW T8,5008 (AT)
JR T8
NOP
7F079EF4: 3-boiler bond head
ADDIU T5,R0,004A
BEQ R0,R0,7F079F84
SW T5,0040 (SP)
7F079F00: 2-jungle bond head
ADDIU T6,R0,004C
BEQ R0,R0,7F079F84
SW T6,0040 (SP)
7F079F0C: 1-Bronsnan Tux head (from multiplayer)
ADDIU T7,R0,004E
BEQ R0,R0,7F079F84
SW T7,0040 (SP)
7F079F18: 5-Connery Tux head (according to cuff images)
ADDIU T3,R0,004E
BEQ R0,R0,7F079F84
SW T3,0040 (SP)
7F079F24: 6-Moore Tux (according to cuff images)
ADDIU T2,R0,004E
BEQ R0,R0,7F079F84
SW T2,0040 (SP)
7F079F30: 7-Dalton Tux (according to cuff images)
ADDIU T4,R0,004E
BEQ R0,R0,7F079F84
SW T4,0040 (SP)
7F079F3C: 8-Variable Body
ADDIU T9,R0,004E
BEQ R0,R0,7F079F84
SW T9,0040 (SP)
7F079F48: mp player 2
BEQ R0,R0,7F079F84
SW T8,0040 (SP)
//7F079F50: mp player 3
BEQ R0,R0,7F079F84
SW T5,0040 (SP)
//7F079F58: mp player 4
BEQ R0,R0,7F079F84
SW T6,0040 (SP)
//7F079F60: this bugger looks like the routine that pulls specific MP character body/heads
JAL 7F09B150
NOP
JAL 7F0102BC
OR A0,V0,R0
JAL 7F09B150
SW V0,0040 (SP)
JAL 7F01035C
OR A0,V0,R0
SW V0,0044 (SP)
7F079F84:
LUI T7,8003
LW T7,6494 (T7) //CURRENT MODE (intro camera, 1st person, etc)
ADDIU AT,R0,0003 //testing for swirl
BNE T7,AT,7F079FA0
LUI T3,8008
LW T3,99E0 (T3) //800799E0:
SW T3,0048 (SP)
//7F079FA0: think this disables 1st person display
JAL 7F09A464 //V0=#players
NOP
ADDIU AT,R0,0001
BNE V0,AT,7F07A1BC
LW T7,0044 (SP)
JAL 7F05CF5C //clear left gun
ADDIU A0,R0,0001
JAL 7F05CF5C //clear right gun
OR A0,R0,R0
//7F079FC4:
etc...
@@ -1 +0,0 @@
b8f1890e039f733298879b5601424f234b01af59
File diff suppressed because it is too large Load Diff
@@ -1 +0,0 @@
dacd73a869546f68d2087362772172794ef6da13
@@ -0,0 +1,564 @@
7F079CF0-7F07A4A0 solo character load
ADDIU SP,SP,FEE8
SW RA,001C (SP)
JAL 7F089EE4
NOP
LUI T6,8008
LW T6,A0B0 (T6)
SWC1 F0,0114 (SP)
LW T7,00A8 (T6)
LW V0,0004 (T7)
BNEL V0,R0,7F07A440
LW T7,001C (V0)
JAL 7F05CF30
OR A0,R0,R0
SW V0,00F0 (SP)
JAL 7F05CF30
ADDIU A0,R0,0001
SW V0,00EC (SP)
SW R0,00E8 (SP)
JAL 7F05CF48
OR A0,R0,R0
SW V0,00E4 (SP)
JAL 7F05CF48
ADIU A0,R0,0001
//7F079D4C: copy a generic 08 PP7 to stack... this section extroneous
LUI T9,8003
ADDIU T9,T9,65AC ;T9=800265AC: a copy of a 08 PP7 object from the 21990 binary
SW V0,00E0 (SP)
ADDIU T4,T9,0084
ADDIU T8,SP,0054
//7F079D60: iterate to copy yo
LW AT,0000 (T9)
ADDIU T9,T9,000C
ADDIU T8,T8,000C
SW AT,FFF4 (T8)
LW AT,FFF8 (T9)
SW AT,FFF8 (T8)
LW AT,FFFC (T9)
BNE T9,T4,7F079D60
SW AT,FFFC (T8)
//7F079D84:
LW AT,0000 (T9)
OR A0,R0,R0 ;A0=right hand
JAL 7F05DA44 ;ret. V0=ammo in wep.
SW AT,0000 (T8)
ADDIU T5,R0,0017 ;default body
ADDIU T6,R0,004B ;default head
LUI A0,8008
SW V0,0048 (SP)
SW T5,0044 (SP)
SW T6,0040 (SP)
SW R0,0038 (SP)
JAL 7F07DE64
LW A0,A0B0 (A0)
JAL 7F09A464 ;returns V0=#players
NOP
ADDIU AT,R0,0001
BNE V0,AT,7F079F60 ;branch if multi!
NOP
JAL 7F01D56C ;WOULD HAVE RETURNED V0=folder#
ADDIU SP,SP,FFE8
SW RA,0014 (SP)
LUI A0,8003
JAL 7F01EBC0
SW A0,0000 (SP)
JR RA
OR V0,R0,R0
LW A0,A8E8 (A0)
LW RA,0014 (SP)
JR RA
NOP
NOP
//7F079DD4: solo bodies
LUI T7,8008
LW T7,A0B0 (T7)
LW V1,041C (T7) ;V1=cuff
SLTIU AT,V1,0009
BEQ AT,R0,7F079EA4 ;skip if not a valid cuff
SLL T3,V1,0x2
LUI AT,8005
ADDU AT,AT,T3
LW T3,4FE4 (AT)
JR T3
NOP
//7F079E00:
ADDIU T2,R0,0016
BEQ R0,R0,7F079EA4
SW T2,0044 (SP)
//7F079E0C:
ADDIU T4,R0,0018
BEQ R0,R0,7F079EA4
SW T4,0044 (SP)
//7F079E18:
ADDIU T9,R0,0019
BEQ R0,R0,7F079EA4
SW T9,0044 (SP)
//7F079E24:
ADDIU T8,R0,0005
BEQ R0,R0,7F079EA4
SW T8,0044 (SP)
//7F079E30:
ADDIU T5,R0,0005
BEQ R0,R0,7F079EA4
SW T5,0044 (SP)
//7F079E3C:
ADDIU T6,R0,0005
BEQ R0,R0,7F079EA4
SW T6,0044 (SP)
//7F079E48:
ADDIU T7,R0,0005
BEQ R0,R0,7F079EA4
SW T7,0044 (SP)
//7F079E54: choose one of four bond models!
BEQ V0,R0,7F079E88
ADDIU T3,R0,0005
ADDIU AT,R0,0001
BEQ V0,AT,7F079E90
ADDIU T2,R0,0005
ADDIU AT,R0,0002
BEQ V0,AT,7F079E98
ADDIU T4,R0,0005
ADDIU AT,R0,0003
BEQ V0,AT,7F079EA0
ADDIU T9,R0,0005
BEQ R0,R0,7F079EA4
NOP
//7F079E88:
BEQ R0,R0,7F079EA4
SW T3,0044 (SP)
//7F079E90:
BEQ R0,R0,7F079EA4
SW T2,0044 (SP)
//7F079E98:
BEQ R0,R0,7F079EA4
SW T4,0044 (SP)
//7F079EA0:
SW T9,0044 (SP)
//7F079EA4:
BEQ V0,R0,7F079ED8
SLTIU AT,V1,0009
ADDIU AT,R0,0001
BEQ V0,AT,7F079F48
ADDIU T8,R0,004E
ADDIU AT,R0,0002
BEQ V0,AT,7F079F50
ADDIU T5,R0,004E
ADDIU AT,R0,0003
BEQ V0,AT,7F079F58
ADDIU T6,R0,004E
BEQ R0,R0,F7079F84
NOP
//7F079ED8: solo heads
BEQ AT,R0,7F079F84
SLL T8,V1,0x2
LUI AT,8005
ADDU AT,AT,T8
LW T8,5008 (AT)
JR T8
NOP
//7F079EF4:
ADDIU T5,R0,004A
BEQ R0,R0,7F079F84
SW T5,0040 (SP)
//7F079F00:
ADDIU T6,R0,004C
BEQ R0,R0,7F079F84
SW T6,0040 (SP)
//7F079F0C:
ADDIU T7,R0,004E
BEQ R0,R0,7F079F84
SW T7,0040 (SP)
//7F079F18:
ADDIU T3,R0,004E
BEQ R0,R0,7F079F84
SW T3,0040 (SP)
//7F079F24:
ADDIU T2,R0,004E
BEQ R0,R0,7F079F84
SW T2,0040 (SP)
//7F079F30:
ADDIU T4,R0,004E
BEQ R0,R0,7F079F84
SW T4,0040 (SP)
//7F079F3C:
ADDIU T9,R0,004E
BEQ R0,R0,7F079F84
SW T9,0040 (SP)
//7F079F48:
BEQ R0,R0,7F079F84
SW T8,0040 (SP)
//7F079F50:
BEQ R0,R0,7F079F84
SW T5,0040 (SP)
//7F079F58:
BEQ R0,R0,7F079F84
SW T6,0040 (SP)
//7F079F60: multiplayer bodies/heads
JAL 7F09B150
NOP
JAL 7F01035C
OR A0,V0,R0
JAL 7F09B150
SW V0,0044 (SP)
JAL 7F0102BC
OR A0,V0,R0
SW V0,0040 (SP)
//7F079F84:
LUI T7,8003
LW T7,6494 (T7)
ADDIU AT,R0,0003
BNE T7,AT,7F079FA0
LUI T3,8008
LW T3,99E0 (T3)
SW T3,0048 (SP)
//7F079FA0: load and initialize solo character
JAL 7F09A464 ;ret. V0=#players
NOP
ADDIU AT,R0,0001
BNE V0,AT,7F07A1BC ;branch if multi
LW T7,0044 (SP)
JAL 7F05CF5C ;clear left hand
ADDIU A0,R0,0001
JAL 7F05CF5C ;clear right hand
OR A0,R0,R0
//7F079FC4: copy data for body to playerdata and obj. instance
ADDIU A0,SP,0100
LW A1,00EC (SP)
JAL 7F0CBAF4
ADDU V0,A1,A2
SW A1,0000 (A0) ;??? POINTER
SW V0,0004 (A0) ;??? pointer + 0x14820
SW A1,0008 (A0)
JR RA
SW V0,000C (A0)
LW A2,00E0 (SP)
JAL 7F05CF18 ;returns V0=address of one of the obj.headers
LUI T6,8008
LW T6,A0B0 (T6)
SLL T7,A0,0x5
ADDU V0,T6,T7
JR RA
ADDIU V0,V0,0810
OR A0,R0,R0
LW T2,0044 (SP) ;T2=body
//7F079FE0:
LUI T9,8004
ADDIU T9,T9,DE10
SLL T4,T2,0x2 ;change to SLL, T4,T2,0x1 for mini table
ADDU T4,T4,T2
SLL T4,T4,0x2
ADDU V1,T4,T9
LW T8,0000 (V1) ;T8=body obj.header
SW V0,00FC (SP)
ADDIU T3,SP,0100
LW AT,0000 (T8) ;copy obj.header to 0x810 in playerdata!
OR A0,V0,R0
SW AT,0000 (V0)
LW T7,0004 (T8)
SW T7,0004 (V0)
LW AT,0008 (T8)
SW AT,0008 (V0)
LW T7,000C (T8)
SW T7,000C (V0)
LW AT,0010 (T8)
SW AT,0010 (V0)
LW T7,0014 (T8)
SW T7,0014 (V0)
LW AT,0018 (T8)
SW AT,0018 (V0)
LW T7,001C (T8)
SW T7,001C (V0)
SW V1,0028 (SP) ;save body's table entry pointer
SW T3,0010 (SP) ;save SP+0x100
//7F07A050: prep the object for load, filling header and such
LW A3,00E4 (SP) ;0x14820, same as SP+0xE0. could be a memory total...
LW A2,00F0 (SP) ;immediately after an object, so pointer to next, or instance?
JAL 7F0764A4 ;loads object and fills in the header data
LW A1,0004 (V1) ;A1=body's string pointer
LW V1,0028 (SP) ;V1=body's table entry pointer
JAL 7F0BD188 ;please pretty please tell me this isn't the decompressor...
LW A0,0004 (V1) ;A0=body's string pointer
//7F07A06C: copy data for body to playerdata and obj. instance
LW T5,0040 (SP) ;T5=head#
LUI T7,8004
ADDIU T7,T7,DE10
SLL T8,T5,0x2 ;for smaller table change to SLL T8,T5,0x1
ADDU T8,T8,T5
SLL T8,T8,0x2
ADDU V1,T8,T7
LW T3,0000 (V1) ;T3=head's obj.header
ADDIU T0,V0,003F ;T0=V0+0x3F V0=size of last model+0x3F - here, body
LW T1,00F0 (SP) ;T1=pointer to body's model in rdram
ORI T2,T0,003F
LW AT,0000 (T3) ;AT=offset to object table if already loaded...
XORI T4,T2,003F ;T4=size pushed to the 0x40 boundry
ADDIU T0,T4,005F
ORI T9,T0,003F
ADDU A0,T1,T4 ;A0=end of last object, start of next
XORI T0,T9,003F ;T0=size + 0x40, pushed to 0x40 boundry (T4+0x40)
SW AT,0000 (A0)
LW T9,0004 (T3) ;copy obj.header to this crazy address
ADDIU T5,SP,0100
ADDU A2,T1,T0 ;A2=location for next model binary
SW T9,0004 (A0)
LW AT,0008 (T3)
SW AT,0008 (A0)
LW T9,000C (T3)
SW T9,000C (A0)
LW AT,0010 (T3)
SW AT,0010 (A0)
LW T9,0014 (T3)
SW T9,0014 (A0)
LW AT,0018 (T3)
SW AT,0018 (A0)
LW T9,001C (T3)
SW T9,001C (A0)
LW T6,00E4 (SP) ;T6=max size? 14820
SW T0,00E8 (SP) ;T0=size of model in rdram
SW A0,00F8 (SP)
SW V1,0028 (SP)
SW T5,0010 (SP)
LW A1,0004 (V1) ;A1=pointer to head string [V1=head table entry]
JAL 7F0764A4 ;loads object and fills in header data
SUBU A3,T6,T0 ;A3=amount of available memory left (14820-body size)
LW V1,0028 (SP) ;V1=head table entry
JAL 7F0BD188 ;ret. V0=size of object in rdram expansion?
LW A0,0004 (V1) ;A0=pointer to head string
//7F07A120:
LW V1,00E8 (SP) ;V1=body size
LW T4,00F0 (SP) ;T4=pointer to body model in rdram
LW A0,00FC (SP) ;A0=playerdata + 0x810
ADDU V1,V0,V1 ;V1=update amount of memory already cluttered
ADDIU V1,V1,003F
ORI T8,V1,003F
XORI T7,T8,003F
ADDIU V1,T7,00FB
ORI T3,V1,003F
XORI T9,T3,003F ;T9=total used memory pushed to 0x40 boundry
ADDU T2,T4,T7 ;T2=start of next model
SW T2,0038 (SP) ;save next model location
JAL 7F075CF4 ;prep body for use?
SW T9,00E8 (SP) ;save total used memory
JAL 7F075CF4 ;prep head for use; set use flag, compute group numbers
LW A0,00F8 (SP) ;A0=pointer to a copy of head's header in model data area
//7F07A160:
LW A1,00FC (SP) ;A1=body header in playerdata
LW T7,00F8 (SP) ;T7=copy of head's header in model data
LW V1,00E8 (SP) ;V1=total used memory
LH T8,0014 (A1) ;T8=body's group # (61 if head not present)
LH T4,0014 (T7) ;T4=head's group # (2 if head)
LW T6,00F0 (SP) ;T6=body model in rdram
LW A0,0038 (SP) ;A0=next object!
ADDU V0,T8,T4 ;V0=sum of groupcodes (should be 63 for characters)
ADDIU V0,V0,000A ;offset for the space made to copy header, etc
SLL T2,V0,0x2 ;multiply by 4...
ADDU A2,T6,V1 ;A2=next object's address
ADDU V1,T2,V1 ;total memory used + group codes->offset
ADDIU V1,V1,003F
ORI T3,V1,003F
XORI T9,T3,003F ;total ushed to 0x40 boundry
SW T9,00E8 (SP) ;save it yo
JAL 7F075FAC
SW V0,0030 (SP) ;save group# + A
LW V0,0030 (SP)
LW T6,0038 (SP) ;save object instance pointer
SH V0,0002 (T6)
BEQ R0,R0,7F07A234
LW A3,00F8 (SP) ;A3=head's header copied to model area in rdram
//7F07A1BC: load and initialize multi character
SLL T8,T7,0x2 ;for smaller table use SLL T8,T7,0x1
ADDU T8,T8,T7
LUI T4,8004
ADDIU T4,T4,DE10
SLL T8,T8,0x2
ADDU V1,T8,T4
LW T2,0000 (V1)
SW T2,00FC (SP)
LW T9,0000 (T2)
OR A0,T2,R0
BNEL T9,R0,7F07A1F8
LW T5,0040 (SP)
JAL 7F07654C
LW A1,0004 (V1)
LW T5,0040 (SP)
LUI T7,8004
ADDIU T7,T7,DE10
SLL T6,T5,0x2 ;for smaller table use SLL T6,T5,0x1
ADDU T6,T6,T5
SLL T6,T6,0x2
ADDU V1,T6,T7
LW A3,0000 (V1)
LW T8,0000 (A3)
OR A0,A3,R0
BNEL T8,R0,7F07A238
LW T4,0038 (SP)
LW A1,0004 (V1)
JAL 7F07654C
SW A3,00F8 (SP)
LW A3,00F8 (SP) ;A3=head's header copied to model area in rdram
//7F07A234:
LW T4,0038 (SP) ;T4=object instance pointer!
LW A0,0044 (SP) ;A0=body#
LW A1,0040 (SP) ;A1=head#
LW A2,00FC (SP) ;A2=copy of body header in playerdata (+0x810)
SW R0,0010 (SP)
JAL 7F0232E8 ;returns V0=obj. instance pointer, filled and everything
SW T4,0014 (SP)
LUI V1,8008
ADDIU V1,V1,A0B0
LW T2,0000 (V1) ;T2=playerdata
LUI AT,8005
SW V0,00D4 (T2) ;save obj. instance pointer!
LW T9,0000 (V1) ;T9=playerdata
LWC1 F6,502C (AT) ;F6=8005502C: ???
LW A0,00D4 (T9) ;A0=obj. instance pointer
LWC1 F4,0014 (A0) ;F4=object scale
MUL.S F8,F4,F6
MFC1 A1,F8
JAL 7F06CE78 ;save converted scale
NOP
//7F07A284: handle player position
LUI V1,8008
LW V1,A0B0 (V1)
LW A3,0114 (SP)
LW A0,00A8 (V1) ;A0=obj. position pointer (8006)
LW A1,00D4 (V1) ;A1=obj. instance pointer
LW T3,0014 (A0) ;T3=room pointer
SW R0,0014 (SP)
ADDIU A2,A0,0008 ;A2=offset to xyz positions
JAL 7F0200BC ;copies positions or adjusts them or something
SW T3,0010 (SP)
//7F07A2AC:
LUI A3,8008
ADDIU A3,A3,A0B0
LW T6,0000 (A3) ;T6=playerdata
ADDIU T5,R0,0006
LW T7,00A8 (T6) ;T7=obj. position pointer (8006)
SB T5,0000 (T7) ;type specify to 6 (character)
LW T8,0000 (A3)
LW T4,00A8 (T8) ;T4=p->obj. pos
LW A2,0004 (T4) ;A2=p->guarddata
LW T2,0014 (A2) ;T2='guard' bitflags
ORI T9,T2,0001
SW T9,0014 (A2) ;uhm, it can't have just set sunglasses on...
LW V1,0000 (A3) ;V1=playerdata
LW A1,00A8 (V1) ;A1=p->obj. pos
LW A0,00D4 (V1) ;A0=obj. instance
SW A2,0110 (SP) ;save guarddata pointer
JAL 7F06CC0C
ADDIU A1,A1,0008 ;A1=offset to xyz position
//7F07A2F4:
LUI T3,8008
LW T3,A0B0 (T3)
LW A1,0114 (SP)
JAL 7F06CD3C
LW A0,00D4 (T3) ;A0=obj. instance
JAL 7F09B244 ;ret. V0=3rd person model based on the item# used
LW A0,0048 (SP) ;weapon (1-0x20)
BLTZ V0,7F07A428 ;returns model for selected weapon
SW V0,004C (SP) ;save it yo
JAL 7F09A464 ;returns # players
NOP
ADDIU AT,R0,0001
BNE V0,AT,7F07A3FC ;branch if multiplayer
LW T6,00F0 (SP) ;T6=body model
//7F07A32C:
LW V0,00E8 (SP) ;V0=memory consumed by the character+data
ADDIU A0,R0,0001
ADDU T5,T6,V0 ;T5=end of character data
ADDIU V0,V0,00C7
ORI T7,V0,003F
XORI T8,T7,003F
SW T5,00DC (SP) ;save endpoint
JAL 7F05CF18 ;returns, in this case, playerdata + 0x830
SW T8,00E8 (SP) ;effectively, size - 0x40
LW T4,004C (SP) ;T4=3rd person object in hand
LUI T9,8004
ADDIU T9,T9,A228 ;object,header,&scale table
SLL T2,T4,0x2
SUBU T2,T2,T4
SLL T2,T2,0x2
ADDU V1,T2,T9
LW T3,0000 (V1) ;header for object
SW V0,00F4 (SP)
ADDIU T5,SP,0100
LW AT,0000 (T3) ;copy weapon header to playerdata
OR A0,V0,R0
SW AT,0000 (V0)
LW T7,0004 (T3)
SW T7,0004 (V0)
LW AT,0008 (T3)
SW AT,0008 (V0)
LW T7,000C (T3)
SW T7,000C (V0)
LW AT,0010 (T3)
SW AT,0010 (V0)
LW T7,0014 (T3)
SW T7,0014 (V0)
LW AT,0018 (T3)
SW AT,0018 (V0)
LW T7,001C (T3)
SW T7,001C (V0)
LW T4,00E8 (SP) ;T4=memory consumed
LW T2,00E4 (SP) ;T2=max memory
LW T8,00F0 (SP) ;T8=body model (start of this clump)
SW V1,0028 (SP) ;save p->weapon's table entry
SW T5,0010 (SP) ;save SP+0x100
LW A1,0004 (V1) ;A1=model's string
SUBU A3,T2,T4 ;A3=room left
JAL 7F0764A4 ;loads object and fills in header data
ADDU A2,T8,T4 ;A2=address for next model data
LW V1,0028 (SP) ;V1=p->weapon's table entry
JAL 7F0BD188 ;load or expand or whatnot
LW A0,0004 (V1) ;A0=model's string
JAL 7F075CF4 ;set object in use
LW A0,00F4 (SP)
BEQ R0,R0,7F07A408
LW T6,00DC (SP) ;T6=endpoint
//7F07A3FC:
SW R0,00DC (SP)
SW R0,00F4 (SP)
LW T6,00DC (SP)
//7F07A408:
LW T3,00F4 (SP) ;T3=weapon header in playerdata
LW A0,0110 (SP) ;A0=guardata
LW A1,004C (SP) ;A1=3rd person weapon#
LW A2,0048 (SP) ;A2=weapon type (ie. 5=silpp7)
OR A3,R0,R0
SW T6,0010 (SP) ;save model endpoint
JAL 7F052214 ;returns V0=obj. position entry for weapon
SW T3,0014 (SP) ;save weapon header in playerdata
//7F07A428:
LW A0,0110 (SP) ;A0=guarddata
JAL 7F023A94
ADDIU A1,R0,0000
BEQ R0,R0,7F07A494
LW RA,001C (SP)
//7F07A43C: Multi!
LW T7,001C (V0)
OR A0,V0,R0
LW T8,0020 (T7)
BNEL T8,R0,7F07A494
LW RA,001C (SP)
LW T4,0014 (V0)
ADDIU A1,R0,0000
ORI T2,T4,0001
JAL 7F023A94
SW T2,0014 (V0)
LUI V1,8008
LW V1,A0B0 (V1)
LW A1,00A8 (V1)
LW A0,00D4 (V1)
JAL 7F06CC0C
ADDIU A1,A1,0008
LUI T9,8008
LW T9,A0B0 (T9)
LW A1,0114 (SP)
JAL 7F06CD3C
LW A0,00D4 (T9)
LW RA,001C (SP)
//7F07A494:
ADDIU SP,SP,0118
JR RA
NOP
@@ -1 +0,0 @@
483f1e7bfcd461d53e901fee93bcc58d51d73a8d
@@ -0,0 +1,39 @@
7001385C: copy part of decompression
The tile advance offset address can be changed. The routine can be rewritten a bit, changing 7F0B2FB8:
SLL T8,T6,0x3
ADDIU T8,T8,0008
000EC0C0
27180008
ALSO DO 7F0B2ED4:
SLL T5,T3,0x3
ADDIU T5,T5,0008
Otherwise, you could just change the value on line 7F0B2F6C (0xE7A9C in rom) to '24C60F49', then change the values in 21990 @ 0x201BC to '20283038 40485058 60687078'. That would support up to 14 point tiles.
7F0B2FAC:
LH V1,0006 (V0) //V1=tile's special
SRA T5,V1,0xC //T5=#points
ANDI T6,T5,000F //T6=#points (limit of 15)
ADDU T7,A2,T6 //T7=80040F4C+#points
LBU T8,0000 (T7) //T8=offset for given number of points
ADDU V0,T8,V0 //V0=address for next tile
LW T9,0000 (V0) //T9=p-for next tile
BNEL T9,R0,7F0B2FAC
SW V0,0000 (A1) //current tile address->80040F60
JR RA
SW A0,0000 (T0) //address for start of clipping file->8007B120
7F0AF144:
LH S0,0006 (A0) //S0=tile's special
SLL T7,A2,0x2 //T7=room# * 4
SUBU T7,T7,A2 //T7=room# * 3
SRA T9,S0,0xC //T9=#points
ANDI S0,T9,000F //S0=#points (limit of 15)
BLEZ S0,7F0AF1D4
OR S1,A0,R0 //S1=address of tile
@@ -1 +0,0 @@
4a366fa27e708af372135d8c840c1ad4fbc5dafc
@@ -1 +0,0 @@
0c929bbfa9abafe5f4182eae042dc50246216dc4
@@ -0,0 +1,83 @@
Clipping Files - 1172 (z-custom) compressed binaries
--------------
Clipping files outline the area players and objects can validly be located. In addition, they also set the spectral lighting for a given region. The clipping file is composed of tiles, each of which is a 3-10 sided polygon. The format supports up to 15-sided forms, but these can not be processed without patching the handling routine.
The start of the file itself consists of a series of offsets. The first is always NULL, technically linked to a removed TLB routine but of no use nowadays. The second always points to the first tile in the list, and must do so; it is used as the basis of all the connection values described below.
Further offsets can be included if desired but are not used at runtime. Rare typically used these to indicate tiles belonging to removed rooms. One NULL offset indicates the end of the file offset section.
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Tile headers are the first 8 bytes of the tile data. They contain a specific 3-byte selection ID, the room ID that appears when a player or object is on the tile, the colour of the light on the tile, and other flags indicating the attributes of the polygon data.
The first three bytes act as a unique tile ID. They are converted to a textual format in setup files and used to look up the tile in the list, linking object positions to unique areas in the stage. The text appears as:
"P" + first two values of header as unsigned decimal value + third byte alpha-numeric value
The first two bytes of the header are an unsigned short integer, converted to decimal form. The third byte is a alpha-numeric string based on this format:
a 00
a1 01
a2 02
a3 03
a4 04
a5 05
a6 06
a7 07
b 08
b1 09
b2 0A
b3 0B
b4 0C
b5 0D
b6 0E
b7 0F
etc.
The highest values used in the release game were "p#", 78-7F. The physical limit is "z#", C8-CF.
As an example, here are some textual strings and their corresponding header values.
Header string
014E 02 "p334a2"
0070 1A "p112d2"
0494 0A "p1148b2"
The last three nibbles all indicate points in the tile. These three points are the three extremes of the tile. If you were to circumscribe the polygon, using these three points would contain either the entire form or the largest portion of it. They are actually used for radial triangle generation, which is beyond the scope of this document. Suffice it to say, this should make a triangle that encompasses most of the tile within it.
These values will always be 012 for a triangle, as the first, second, and third points will invariably be at the furthest extremes. Most quads tend to be rectangular, so either 012 or 013 may be used.
---------------
X, Y, and Z positions are signed short values relative to the center of the stage. Points in each tile are expected to be counter-clockwise. Each face, or series of two points, also has a connection value. If set to 0000, the player can not walk past that edge of the tile. If set to some other value, this creates a link to another tile in the file.
Connection values start at 0010, as the initial offset to clipping data is offset by 0x80. To determine the connection value of a given tile, take the current file offset of that tile's header, subtract the initial offset of the first tile, add an additional 0x80 to account for the offset, then divide the result by 8.
This example retrieves the connection value to link to a tile at offset 0x20C, assuming the first tile starts at 0xC.
*subtract initial from target:
0x20C-0xC = 0x200
*add 0x80, the initial offset for all tiles:
0x200-0x80 = 0x280
*divide by 8 for the final offset:
0x280/8 = 0x0050
The final offset is 0x0050.
It is very important the Room # matches that of the room to be visualized. Otherwise, objects in the room will not appear unless that room is currently loaded, and players in the room will disappear until stepping on another tile. Since it affects the one room which should be visible, do not allow tiles to cross portals!
--------------
Header Format:
FFFFFF00 00000000 3-byte selection ID
000000FF 00000000 Room # (1-FF)
00000000 30000000 special attribute
0 normal tile
1 kneeling
3 ladder
00000000 0F000000 4-bit Red lighting component
00000000 00F00000 4-bit Green lighting component
00000000 000F0000 4-bit Blue lighting component
00000000 0000F000 number points in tile (3-F)
00000000 00000F00 extreme point 1
00000000 000000F0 extreme point 2
00000000 0000000F extreme point 3
Point Format:
FFFF0000 00000000 X position
0000FFFF 00000000 y position
00000000 FFFF0000 Z position
00000000 0000FFFF connection value
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The list of tiles ends with a NULL tile header. This is typically followed by the string "unstrict" and extended to 0x20 bytes. This ensures that the routine does not break on a read of 0 points, as all tiles 0-3 points are expected to contain 0x20 data total.
-Zoinkity
@@ -1 +0,0 @@
796ad9cba479bb721456b86669330a4ab4c7939f
@@ -0,0 +1,50 @@
7F0B2F2C: E7A5C determines endpoint of clipping file
accepts: A0=p->clipping file, A1=?, A2=?
LUI T0,8008
ADDIU T0,T0,B120 ;T0=8007B120: table of pointers to room tiles
SW A0,0000 (T0) ;A0->8007B120: save start of file
LW T6,0004 (A0) ;T6=A0+4: p->first room
SUBU V0,A2,A1
LUI AT,8004
ADDU T7,T6,V0
ADDIU T8,T7,FF80 ;T8=T7-0x80: base pointer for connection values
SW T8,0F58 (AT) ;T8->80040F58: save base pointer for all connection values
LW T9,0004 (A0) ;T9=A0+4: p->first room
LUI AT,8004
LUI A2,8004
ADDU T1,T9,V0
SW T1,0F5C (AT) ;T1->80040F5C: p->first room (actual tile list start)
LW T2,0004 (A0) ;T2=A0+4: p->first room
ADDIU A3,A0,0004 ;A3=A0+4
ADDIU A2,A2,0F4C ;A2=80040F4C: list of tile sizes
BEQ T2,R0,7F0B2F94 ;branch if no stan exceptions present
LUI A1,8004
LW V1,0000 (A3) ;V1=p->first room
ADDU T3,V1,V0
//7F0B2F80: loop for each of the exception entries
LW V1,0004 (A3)
SW T3,0000 (A3)
ADDIU A3,A3,0004
BNEL V1,R0,7F0B2F80
ADDU T3,V1,V0
//7F0B2F94: grab first tile
ADDIU V0,A3,0004 ;V0=p->tile
LW T4,0000 (V0) ;T4=tile name and room
ADDIU A1,A1,0F60 ;A1=80040F60: p->final tile
BEQ T4,R0,7F0B2FD0 ;kill if "unstric"
NOP
//7F0B2FA8: loop for each tile
SW V0,0000 (A1) ;V0->80040F60: save current tile as final
LH V1,0006 (V0) ;V1=V0+6: side and division halfword
SRA T5,V1,0xC ;T5=V1>>C: #sides
ANDI T6,T5,000F ;T6=#sides
ADDU T7,A2,T6 ;T7=80040F4C+#sides: p->offset for next tile
LBU T8,0000 (T7) ;T8=offset to next tile
ADDU V0,T8,V0 ;V0+=offset
LW T9,0000 (V0) ;T9=next tile's name and room
BNEL T9,R0,7F0B2FAC ;branch if not "unstric"
SW V0,0000 (A1)
//7F0B2FD0: return
JR RA
SW A0,0000 (T0) ;p->start of stan tile list -> 8007B120
@@ -1 +0,0 @@
abfb54e63170b9d3933f28e7dd0daaf886f6a14f
@@ -0,0 +1,604 @@
80044DC0 current sky
80044E10 start of list
7F0BAA64: locate and copy enviroment values
accepts: A0=stage#, A1=0 if MP?
ADDIU SP,SP,FFD8
SW RA,0014 (SP)
SW A1,002C (SP) ;SP+2C=A1: ?
SW R0,001C (SP)
JAL 7F09A464 ;V0=#players
SW A0,0028 (SP) ;SP+28=A0: stage#
ADDIU AT,R0,0001
LW A2,001C (SP) ;A2=0
LW A3,0028 (SP) ;A3=stage#
BNE V0,AT,7F0BAA94 ;branch if not 1 player
OR T0,V0,R0 ;T0=#players
OR T0,R0,R0 ;T0=0 if solo
//7F0BAA94: set default enviroment
LUI AT,8006
LWC1 F4,8D70 (AT) ;F4=80058D70: 7F7FFFFF - default near fog
LW T6,002C (SP) ;T6=SP+2C: ?
LUI AT,8004
MTC1 R0,F6
SWC1 F4,4DC4 (AT) ;7F7FFFFF->80044DC4: near fog value
LUI AT,8004
BEQ T6,R0,7F0BAB1C ;skip cutscene env. tests if zero
SWC1 F6,4DC8 (AT) ;0->80044DC8: near fog * intensity of zero
//7F0BAAB8: cutscene env. testing
LUI T1,8004
ADDIU V1,T1,4E10 ;V1=80044E10: env.table 1
LW T7,0000 (V1) ;T7=env.stage#
LUI T8,8004
ADDIU T8,T8,4E10 ;T8=80044E10: env.table 1
BEQ T7,R0,7F0BAB1C ;branch if at end of list
ADDIU A0,A3,0384 ;A0=stage#+0x384: cutscene env.set offset
//7F0BAAD8: copy enviroment on hit
LW V0,0000 (T8) ;V0=env.stage#
BNE A0,V0,7F0BAB0C ;branch if env.# doesn't match cutscene#
LUI V0,8008
ADDIU V0,V0,25E8
SW V1,0000 (V0) ;V1->800825E8: save env.table hit
LUI AT,8008
SW V1,25EC (AT) ;V1->800825EC: save env.table match start
LUI AT,8008
ADDIU T9,V1,005C ;T9=V1+0x5C: p->end of entry (next entry)
SW T9,25F0 (AT) ;T9->800825F0: save env.table match endpoint
JAL 7F0BA758 ;copy table 1 enviroment to current
LW A0,0000 (V0) ;A0=p->env.tabel match
BEQ R0,R0,7F0BAC9C
LW RA,0014 (SP)
//7F0BAB0C: loop for each entry
LW V0,005C (V1) ;V0=next env.stage#
ADDIU V1,V1,005C ;V1+=0x5C: p->next entry
BNEZ V0,7F0BAAD8 ;branch if not at end of list
NOP
//7F0BAB1C: offset stage# to current # players
LUI T1,8004
ADDIU T1,T1,4E10 ;T1=80044E10: env.table 1
LW A1,0000 (T1) ;A1=env.stage#
LUI T2,8004
ADDIU T2,T2,4E10 ;T2=80044E10: env.table 1
BEQ A1,R0,7F0BAB98 ;branch if at end of list
OR V1,T1,R0 ;V1=T1: env.table 1
SLL T3,T0,0x2
SUBU T3,T3,T0
SLL T3,T3,0x3
ADDU T3,T3,T0
SLL T3,T3,0x2 ;T3=#players * 100 (0x64)
ADDU A0,A3,T3 ;A0=MPstage#
LW V0,0000 (T2) ;V0=env.stage#
//7F0BAB54:
BNE A0,V0,7F0BAB88 ;branch if no match
LUI V0,8008
ADDIU V0,V0,25E8
SW V1,0000 (V0) ;V1->800825E8: save env.table hit
LUI AT,8008
SW V1,25EC (AT) ;V1->800825EC: save env.table match start
LUI AT,8008
ADDIU T4,V1,005C
SW T4,25F0 (AT) ;T4->800825F0: save env.table match endpoint
JAL 7F0BA758 ;copy table 1 enviroment to current
LW A0,0000 (V0) ;A0=p->env.table match
BEQ R0,R0,7F0BAC9C
LW RA,0014 (SP)
//7F0BAB88: loop for each entry
LW V0,005C (V1) ;V0=next env.stage#
ADDIU V1,V1,005C ;V1+=0x5C: p->next entry
BNEZ V0,7F0BAB54 ;branch if not at end of list
NOP
//7F0BAB98: MP-specific enviroment test, although this was covered in previous segment...
SLTI AT,T0,0002
BNEL AT,R0,7F0BAC14 ;branch if solo
LUI AT,4170
BEQ A1,R0,7F0BAC10 ;branch if table 1 contains no entries
OR V1,T1,R0 ;V1=T1: env.table 1
SLL A0,T0,0x2
SUBU A0,A0,T0
SLL A0,A0,0x3
LUI T5,8004
ADDIU T5,T5,4E10 ;T5=80044E10: env.table 1
ADDU A0,A0,T0
SLL A0,A0,0x2 ;A0=#players * 100: offset to MPstage#
LW V0,0000 (T5) ;V0=env.stage#
//7F0BABCC:
BNE A0,V0,7F0BAC00 ;branch if no match
LUI V0,8008
ADDIU V0,V0,25E8
SW V1,0000 (V0) ;V1->800825E8: save env.table hit
LUI AT,8008
SW V1,25EC (AT) ;V1->800825EC: save env.table match start
LUI AT,8008
ADDIU T6,V1,005C
SW T6,25F0 (AT) ;T6->800825F0: save env.table match endpoint
JAL 7F0BA758 ;copy table 1 enviroment to current
LW A0,0000 (V0) ;A0=p->env.table match
BEQ R0,R0,7F0BAC9C
LW RA,0014 (SP)
//7F0BAC00: loop for each entry
LW V0,005C (V1) ;V0=next env.stage#
ADDIU V1,V1,005C ;V1+=0x5C: p->next entry
BNEZ V0,7F0BABCC ;branch if not at end of list
NOP
//7F0BAC10:
LUI AT,4170
MTC1 AT,F12 ;F12=15.0
LUI AT,8006
LWC1 F14,8D74 (AT) ;F14=80058D74: 10000.0 [461C4000]
SW A2,001C (SP) ;A2=SP+1C: 0
JAL 70004650 ;set page height
SW A3,0028 (SP) ;A3=SP+28: stage#
LUI A0,8004
LUI AT,8008
ADDIU A0,A0,5F50 ;A0=80045F50: env.table 2
SW R0,25C0 (AT) ;0->800825C0:
LW T7,0000 (A0) ;T7=env.stage#
LW A2,001C (SP) ;A2=SP+1C: 0
LW A3,0028 (SP) ;A3=SP+28: stage#
BEQ T7,R0,7F0BAC78 ;branch if no entries in list
OR V1,A0,R0 ;V1=80045F50: env.table 2
LUI T8,8004
ADDIU T8,T8,5F50 ;T8=80045F50: env.table 2
LW V0,0000 (T8) ;V0=env.stage#
//7F0BAC5C: save hits
BNEL A3,V0,7F0BAC6C ;branch if no match
LW V0,0038 (V1)
OR A2,V1,R0 ;A2=V1: env.table hit
//7F0BAC68: loop for all entries
LW V0,0038 (V1) ;V0=next env.stage#
ADDIU V1,V1,0038 ;V1+=0x38: p->env.entry
BNEZ V0,7F0BAC5C ;branch if not at end of list
NOP
//7F0BAC78: set default otherwise
BNEZ A2,7F0BAC84 ;branch if hit found
NOP
OR A2,A0,R0 ;A2=A0: p->default entry
//7F0BAC84:
JAL 7F0BA9D0 ;copy table 2 enviroment to current
OR A0,A2,R0 ;A0=A2: p->env.data
LUI V0,8008
ADDIU V0,V0,25E8
SW R0,0000 (V0) ;0->800825E8: fry env.table hit buffer
//7F0BAC98:
LW RA,0014 (SP)
ADDIU SP,SP,0028
JR RA
NOP
7F0BA758: EF288 0FC2E9D6 copy large enviroment bank to current
ADDIU SP,SP,FFC8
SW RA,0014 (SP)
LWC1 F14,0008 (A0) ;F14=far fog
LWC1 F12,0004 (A0) ;F12=pervasiveness
JAL 70004650 ;set page height
SW A0,0038 (SP) ;SP+38=A0: p->env.data
JAL 700046AC
ADDIU A0,SP,0030 ;A0=SP+30:
JAL 7F0B4878 ;ret F0=800413FC: 1.0
NOP
LWC1 F4,0030 (SP) ;F4=pervasiveness
LWC1 F8,0034 (SP) ;F8=far fog
LW A1,0038 (SP) ;A1=p->env.data
DIV.S F6,F4,F0 ;F6=F4/1.0: pervasiveness
LUI AT,447A
LUI A0,8008
ADDIU A0,A0,25E4 ;A0=800825E4:
LUI A2,8008
ADDIU A2,A2,25E0 ;A2=800825E0: buffer for far ambient light
LUI V1,8008
ADDIU V1,V1,25C8 ;V1=800825C8: buffer for pervasiveness
LUI V0,8004
ADDIU V0,V0,4DCC ;V0=80044DCC: p->current data, starting at BG light
DIV.S F10,F8,F0 ;F10=F8/1.0: far fog
SWC1 F6,0030 (SP) ;SP+30=F6: pervasiveness
MTC1 AT,F8 ;F8= 1000.0 [447A0000]
SWC1 F10,0034 (SP) ;SP+34=F10: far fog
//7F0BA7C4:
LW T6,0020 (A1) ;T6=BG dif.in light
MTC1 T6,F4
NOP
CVT.S.W F6,F4 ;F6=(float) BG dif.in light
DIV.S F10,F6,F8 ;F10=BG dif.light / 1000.0
MTC1 AT,F8
LUI AT,8004
SWC1 F10,0000 (A0) ;BG dif.light->800825E4
//7F0BA7E4:
LW T7,0024 (A1) ;T7=far ambient light
MTC1 T7,F4
ADDIU T7,A1,000C ;T7=p->near fog in env.data
CVT.S.W F6,F4 ;F6=(float) far ambient light
LWC1 F4,0034 (SP) ;F4=far fog
DIV.S F10,F6,F8 ;F10=far ambient light / 1000.0
LWC1 F6,0030 (SP) ;F6=pervasiveness
SUB.S F14,F4,F6 ;F14=far fog - pervasiveness
SWC1 F10,0000 (A2) ;F10->800825E0: buffer for far ambient light
//7F0BA808: finalize near fog value
LWC1 F16,0000 (A2) ;F16=far ambient light %%
MUL.S F8,F14,F16 ;F8=F14*F16: (far fog - pervasiveness) * far ambient light%%
ADD.S F10,F6,F8 ;F10=F6+F8: pervasiveness + ""
SWC1 F10,4DC4 (AT) ;F10->80044DC4: near fog value
//7F0BA818: finalize intensity
LWC1 F2,0000 (A0) ;F2=BG dif.light
LUI AT,8004
MUL.S F4,F14,F2 ;F4=F14*F2: (far fog - pervasiveness) * BG dif.light
ADD.S F8,F6,F4 ;F8=F6+F4: pervasiveness + ""
SWC1 F8,4DC8 (AT) ;F8->80044DC8: intensity
//7F0BA82C:
LWC1 F10,0004 (A1) ;F10=pervasiveness
LUI AT,4300
DIV.S F6,F10,F0 ;F6=F10/F0: pervasiveness / 1.0
SUB.S F10,F16,F2 ;F10=far ambient light - BG dif.light
SWC1 F6,0000 (V1) ;pervasiveness->800825C8: buffer for pervasiveness
//7F0BA840:
LWC1 F4,0008 (A1) ;F4=far fog
SWC1 F10,0018 (SP) ;SP+18=(far ambient light - BG dif.light)
MTC1 AT,F6 ;F6= 128.0 [43000000]
DIV.S F8,F4,F0 ;F8=F4/F0: far fog / 1.0
LWC1 F4,0018 (SP) ;F4=(far ambient light - BG dif.light)
LUI AT,3F00
MTC1 AT,F10 ;F10=0.5 [3F000000]
LUI AT,4380
LWC1 F18,0000 (V1) ;F18=pervasiveness
SWC1 F8,0004 (V1) ;far fog->800825CC
//7F0BA868:
DIV.S F8,F6,F4 ;F8=F6/F4: 128.0 / (far ambient light - BG dif.light)
LWC1 F12,0004 (V1) ;F12=far fog
SUB.S F6,F10,F2 ;F6=F10-F2: 0.5 - BG dif.light
SWC1 F8,0020 (SP) ;SP+20=128.0 / (far ambient light - BG dif.light)
//7F0BA878:
MTC1 AT,F8 ;F8=256.0 [43800000]
LUI AT,3F80
MUL.S F10,F6,F8 ;F10=F6*F8: (0.5 - BG dif.light) * 256.0
SUB.S F8,F12,F18 ;F8=F12-F18: far fog - pervasiveness
SWC1 F8,0018 (SP) ;SP+18=F8: far fog - pervasiveness
//7F0BA88C:
MTC1 AT,F8 ;F8=1.0 [3F800000]
DIV.S F6,F10,F4 ;F6=F10-F4: 256(0.5 - BG dif.light) / (far ambient light - BG dif.light)
LWC1 F10,0020 (SP) ;F10=128.0 / (far ambient light - BG dif.light)
LUI AT,437F
NEG.S F4,F10 ;F4=-128.0 / (far ambient light - BG dif.light)
ADD.S F10,F18,F8 ;F10=F18+F8: pervasiveness++
LWC1 F8,0018 (SP) ;F8=far fog - pervasiveness
SWC1 F6,001C (SP) ;SP+1C=F6= 256(0.5 - BG dif.light) / (far ambient light - BG dif.light)
//7F0BA8AC:
MUL.S F6,F4,F12 ;F6=F4*F12: -128.0*far fog / (far ambient light - BG dif.light)
NOP
MUL.S F4,F6,F10 ;F4=F6*F10: -128.0*far fog*pervasiveness++ / (far ambient light - BG dif.light)
MTC1 AT,F10 ;F10=255.0 [437F0000]
LUI AT,3F80
DIV.S F6,F4,F8 ;F6=F4/F8: (-128.0*far fog*pervasiveness++) / (far ambient light - BG dif.light)(far fog - pervasiveness)
MTC1 AT,F8 ;F8=1.0 [3F800000]
LUI AT,437F
DIV.S F4,F6,F10 ;F4=F6/F10: (-128.0*far fog*pervasiveness++) / 255(far ambient light - BG dif.light)(far fog - pervasiveness)
LWC1 F10,0020 (SP) ;F10=128.0 / (far ambient light - BG dif.light)
ADD.S F6,F12,F8 ;F6=F12+F8: far fog++
LWC1 F8,0018 (SP) ;F8=far fog - pervasiveness
SWC1 F4,0010 (V1) ;F4->800825D8
//7F0BA8E0:
MUL.S F4,F6,F10 ;F4= F6*F10: 128(far fog++) / (far ambient light - BG dif.light)
LWC1 F10,001C (SP) ;F10= 256(0.5 - BG dif.light) / (far ambient light - BG dif.light)
DIV.S F6,F4,F8 ;F6=F4/F8: 128(far fog++) / (far ambient light - BG dif.light)(far fog - pervasiveness)
MTC1 AT,F8 ;F8=255.0 [437F0000]
LUI AT,8008
ADD.S F4,F6,F10 ;F4=F6+F10: 128(far fog++) / (far ambient light - BG dif.light)(far fog - pervasiveness) + 256(0.5 - BG dif.light) / (far ambient light - BG dif.light)
DIV.S F6,F4,F8 ;F6=F4/F8: (128(far fog++) / (far ambient light - BG dif.light)(far fog - pervasiveness) + 256(0.5 - BG dif.light) / (far ambient light - BG dif.light)) / 255.0
SWC1 F6,0014 (V1) ;F6=800825DC
//7F0BA900: light values
LW T8,0020 (A1) ;T8=env.+20: BG dif.in light
SW T8,0000 (V0) ;T8->80044DCC
LW T9,0024 (A1) ;T8=far ambient light
ADDIU T8,R0,0001
SW T9,0004 (V0) ;T9->80044DD0
//7F0BA914: fog values
LBU T0,0028 (A1) ;T0=fog red component
SB T0,0008 (V0) ;T0->80044DD4
LBU T1,0029 (A1) ;T1=fog green component
SB T1,0009 (V0) ;T1->80044DD5
LBU T2,002A (A1) ;T2=fog blue component
SB T2,000A (V0) ;T2->80044DD6
//7F0BA92C: cloud values
LBU T3,002B (A1) ;T3=cloud flag
SB T3,000B (V0) ;T3->80044DD7
LWC1 F10,002C (A1) ;F10=cloud repeat value
SWC1 F10,000C (V0) ;F10->80044DD8
LH T4,0030 (A1) ;T4=cloud image offset
SH T4,0010 (V0) ;T4->80044DDC
LWC1 F4,0034 (A1) ;F4=cloud red channel
SWC1 F4,0014 (V0) ;F4->80044DE0
LWC1 F8,0038 (A1) ;F8=cloud green channel
SWC1 F8,0018 (V0) ;F8->80044DE4
LWC1 F6,003C (A1) ;F6=cloud blue channel
SWC1 F6,001C (V0) ;F6->80044DE8
//7F0BA95C: water values
LBU T5,0040 (A1) ;T5=water flag
SB T5,0020 (V0) ;T5->80044DEC
LWC1 F10,0044 (A1) ;F10=water repeat value
SWC1 F10,0024 (V0) ;F10->80044DF0
LH T6,0048 (A1) ;T6=water image offset
SH T6,0028 (V0) ;T6->80044DF4
LWC1 F4,004C (A1) ;F4=water red channel
SWC1 F4,002C (V0) ;F4->80044DF8
LWC1 F8,0050 (A1) ;F8=water green channel
MTC1 R0,F4
SWC1 F8,0030 (V0) ;F8->80044DFC
LWC1 F6,0054 (A1) ;F6=water blue channel
SWC1 F6,0034 (V0) ;F6->80044E00
//7F0BA990: concavity distort
LWC1 F10,0058 (A1) ;F10=world concavity distort
SWC1 F10,0038 (V0) ;F10->80044E04
//7F0BA998:
LWC1 F8,000C (A1) ;F8=near fog
C.EQ.S F4,F8
NOP
BC1F 7F0BA9B8 ;branch if 0!=near fog
NOP
LUI AT,8008
BEQ R0,R0,7F0BA9BC
SW R0,25C4 (AT) ;0->800825C4: NULL near fog pointer
//7F0BA9B8:
SW T7,25C4 (AT) ;save p->near fog
//7F0BA9BC:
LW RA,0014 (SP)
LUI AT,8008
SW T8,25C0 (AT) ;1->800825C0: enviroment table 1 entry in use
JR RA
ADDIU SP,SP,0038
7F0BA9D0: 0FC2EA74 copy short enviroment bank to current
accepts: A0=p->enviroment data
LBU T6,0004 (A0) ;T6=fog red component
LUI V0,8004
ADDIU V0,V0,4DCC ;V0=80044DCC: current env.data
SB T6,0008 (V0) ;T6->80044DD4
LBU T7,0005 (A0) ;T7=fog green component
SB T7,0009 (V0) ;T7->80044DD5
LBU T8,0006 (A0) ;T8=fog blue component
SB T8,000A (V0) ;T8->80044DD6
LBU T9,0007 (A0) ;T9=cloud flag
SB T9,000B (V0) ;T9->80044DD7
//7F0BA9F8: clouds
LWC1 F4,0008 (A0) ;F4=cloud image repeat
SWC1 F4,000C (V0) ;F4->80044DD8
LH T0,000C (A0) ;T0=cloud image index
SH T0,0010 (V0) ;T0->80044DDC
LWC1 F6,0010 (A0) ;F6=cloud red component
SWC1 F6,0014 (V0) ;F6->80044DE0
LWC1 F8,0014 (A0) ;F8=cloud green component
SWC1 F8,0018 (V0) ;F8->80044DE4
LWC1 F10,0018 (A0) ;F10=cloud blue component
SWC1 F10,001C (V0) ;F10->80044DE8
//7F0BAA20: water
LBU T1,001C (A0) ;T1=water flag
SB T1,0020 (V0) ;T1->80044DEC
LWC1 F16,0020 (A0) ;F16=water image repeat
SWC1 F16,0024 (V0) ;F16->80044DF0
LH T2,0024 (A0) ;T2=water image index
SH T2,0028 (V0) ;T2->80044DF4
LWC1 F18,0028 (A0) ;F18=water red component
SWC1 F18,002C (V0) ;F18->80044DF8
LWC1 F4,002C (A0) ;F4=water green component
SWC1 F4,0030 (V0) ;F4->80044DFC
LWC1 F6,0030 (A0) ;F6=water blue component
SWC1 F6,0034 (V0) ;F6->80044E00
LWC1 F8,0034 (A0) ;F8=world concavity distort
JR RA
SWC1 F8,0038 (V0) ;F8->80044E04
70004650 set page height
accepts: F12=?, F14=?
ADDIU SP,SP,FFE8
LUI V1,8002
ADDIU V1,V1,32A8
SWC1 F12,0018 (SP) ;SP+18=F12:
LWC1 F4,0018 (SP) ;F4=F12
LW T6,0000 (V1) ;T6=800232A8: p->?
SW RA,0014 (SP)
SWC1 F14,001C (SP) ;SP+1C=F14:
SWC1 F4,0010 (T6) ;F12-> p+0x10
LW T7,0000 (V1) ;T7=800232A8: p->?
LWC1 F6,001C (SP) ;F6=F14
SWC1 F6,0014 (T7) ;F14-> p+0x14
LW V0,0000 (V1) ;V0=800232A8: p->?
LWC1 F12,0010 (V0) ;F12=F12
LWC1 F14,0008 (V0) ;F14=?
JAL 7F077C30
LW A2,000C (V0) ;A2=?
JAL 7F077C5C
NOP
LW RA,0014 (SP)
ADDIU SP,SP,0018
JR RA
NOP
700046AC: ???
accepts: A0=p->target
LUI V0,8002
ADDIU V0,V0,32A8
LW T6,0000 (V0) ;T6=800232A8: p->?
LWC1 F4,0010 (T6)
SWC1 F4,0000 (A0) ;F4->target+0
LW T7,0000 (V0) ;T6=800232A8: p->?
LWC1 F6,0014 (T7)
JR RA
SWC1 F6,0004 (A0) ;F6->target+4
7F077C30: ??? copies floats to BONDdata
accepts: A2=?, F12=?, F14=?
LUI V0,8008
ADDIU V0,V0,A0B0
LW T6,0000 (V0)
SW A2,0008 (SP)
SWC1 F12,10A0 (T6)
LW T7,0000 (V0)
SWC1 F14,10A4 (T7)
LW T8,0000 (V0)
LWC1 F4,0008 (SP)
JR RA
SWC1 F4,10A8 (T8)
7F054B80:
ADDIU SP,SP,FFE0
LUI AT,3F80
MTC1 AT,F16 ;F16=1.0
SW RA,0014 (SP)
SW A0,0020 (SP) ;SP+20=A0:
SW A1,0024 (SP) ;SP+24=A1:
JAL 7F0BB398 ;V0=p->fog values [800825C4]
SWC1 F16,001C (SP) ;SP+1C=1.0
BEQ V0,R0,7F054C44 ;branch if not present
LWC1 F16,001C (SP) ;F16=1.0
//7F054BA8:
LW T6,0020 (SP)
LWC1 F4,0008 (V0) ;F4=obj.obfuscation range
LWC1 F6,0018 (T6) ;F6=T6+18:
C.LT.S F4,F6
NOP
BC1FL 7F054C48 ;branch if obj.obfuscation range >= F6
LW RA,0014 (SP)
SW V0,0018 (SP) ;SP+18=V0: p->fog values
JAL 7F078484 ;F0= BONDdata+10F8
SWC1 F16,001C (SP) ;SP+1C=1.0
//7F054BD0:
LW V1,0018 (SP) ;V1=p->fog values
LW T7,0020 (SP)
LUI AT,42C8
LWC1 F2,0008 (V1) ;F2=obj.obfuscation range
LWC1 F8,0018 (T7)
MTC1 AT,F18 ;F18=100.0
LWC1 F6,0024 (SP)
SUB.S F10,F8,F2 ;F10=F8-obj.obfuscation range
LWC1 F14,0004 (V1) ;F14=max obj vis. range
LWC1 F16,001C (SP) ;F16=SP+1C: 1.0
MUL.S F4,F10,F18 ;F4=100.0(F8-obj.obfuscation range)
DIV.S F8,F4,F6 ;F8=100.0(F8-obj.obfuscation range)/F6
ADD.S F10,F8,F2 ;F10=100.0(F8-obj.obfuscation range)/F6 + obj.obfuscation range
MUL.S F12,F10,F0 ;F12=(BONDdata+10F8) * (100.0(F8-obj.obfuscation range)/F6 + obj.obfuscation range)
C.LE.S F14,F12
NOP
BC1FL 7F054C28 ;branch if max obj vis. range > F12
LWC1 F0,0000 (V1)
MTC1 R0,F16 ;F16=0
BEQ R0,R0,7F054C48
LW RA,0014 (SP)
//7F054C24:
LWC1 F0,0000 (V1) ;F0=near fog value
C.LT.S F0,F12
NOP
BC1FL 7F054C48 ;branch if near fog value >= F12
LW RA,0014 (SP)
SUB.S F10,F14,F12 ;F10=max obj vis. range - F12
SUB.S F4,F14,F0 ;F4=max obj vis. range - near fog value
DIV.S F16,F18,F4 ;F16=100/(max obj vis. range - near fog value)
//7F054C44: return
LW RA,0014 (SP)
ADDIU SP,SP,0020
MOV.S F0,F16 ;F0=F16: percentage visibility?
JR RA
NOP
7F054C58:
ADDIU SP,SP,FFC8
SW RA,0014 (SP)
ADDIU T6,R0,0001
SW A0,0038 (SP) ;SP=38=A0:
SW A1,003C (SP) ;SP+3C=A1:
JAL 7F0BB398 ;V0=p->fog values [800825C4]
SW T6,0034 (SP) ;SP+34=1: true return
BEQL V0,R0,7F054D5C ;branch if 0
LW RA,0014 (SP)
//7F054C7C:
JAL 7F089FD4 ;V0=p->position
SW V0,0030 (SP) ;SP+30=p->fog values
JAL 7F0783C4 ;V0= BONDdata+0x10CC
SW V0,001C (SP) ;SP+1C=p->position
//7F054C8C:
LW V1,001C (SP) ;V1=p->position
LW A1,0038 (SP)
LW A0,0030 (SP) ;A0=p->fog values
LWC1 F6,0000 (V1) ;F6=x position
LWC1 F4,0000 (A1)
SUB.S F8,F4,F6
SWC1 F8,0024 (SP) ;SP+24=?-xpos
LWC1 F16,0004 (V1) ;F16=y position
LWC1 F10,0004 (A1)
SUB.S F18,F10,F16
LWC1 F10,0024 (SP) ;F10=F8
SWC1 F18,0028 (SP) ;SP+28=?-ypos
LWC1 F6,0008 (V1) ;F6=z position
LWC1 F4,0008 (A1)
SUB.S F8,F4,F6
LWC1 F4,0028 (SP) ;F4=F18
SWC1 F8,002C (SP) ;SP+2C=?-zpos
LWC1 F16,0000 (V0) ;F16=BONDdata+10CC
LWC1 F6,0004 (V0) ;F6=BONDdata+10D0
MUL.S F18,F10,F16 ;F18=(?-xpos)*(BONDdata+10CC)
LWC1 F16,0008 (V0) ;F16=BONDdata+10D4
MUL.S F8,F4,F6 ;F8=(?-ypos)*(BONDdata+10D0)
LWC1 F4,002C (SP) ;F4=(?-zpos)
MUL.S F6,F16,F8 ;F6=(BONDdata+10D4)*(?-ypos)*(BONDdata+10D0)
LWC1 F18,0008 (A0) ;F18=obj.obfuscation range
ADD.S F12,F6,F10 ;F12=(BONDdata+10D4)*(?-ypos)*(BONDdata+10D0) + (?-xpos)
C.LT.S F18,F12
NOP
BC1FL 7F054D5C ;branch if obj.obfuscation range >= F12
LW RA,0014 (SP)
//7F054D08:
SW A0,0030 (SP) ;SP+30=A0: same as before
JAL 7F078484 ;F0= BONDdata+10F8
SWC1 F12,0020 (SP) ;SP+20=F12
LW A0,0030 (SP) ;A0=SP+30: p->fog values
LWC1 F12,0020 (SP) ;F12=SP+20
LUI AT,42C8
LWC1 F2,0008 (A0) ;F2=A0+8: obj.obfuscation range
MTC1 AT,F16 ;F16=100.0
LWC1 F6,003C (SP) ;F6=SP+3C:
SUB.S F8,F12,F2 ;F8=F12-obj.obfuscation range
MUL.S F4,F8,F16 ;F4=100.0(F12-obj.obfuscation range)
LWC1 F8,0004 (A0) ;F8=max.obj.vis.range
DIV.S F10,F4,F6 ;F10=100.0(F12-obj.obfuscation range) / F6
ADD.S F18,F10,F2 ;F18=100.0(F12-obj.obfuscation range) / F6 + obj.obfuscation range
MUL.S F12,F18,F0 ;F12=(100.0(F12-obj.obfuscation range) / F6 + obj.obfuscation range) * F0
C.LE.S F8,F12
NOP
BC1FL 7F054D5C ;branch if max.obj.vis.range > F12
LW RA,0014 (SP)
SW R0,0034 (SP) ;SP+34=0: false return
//7F054D58:
LW RA,0014 (SP)
LW V0,0034 (SP) ;V0=SP+34: return value
ADDIU SP,SP,0038
JR RA
NOP
+_+
for the record, the sky is constructed here:
//7F096E2C:
here's a sample 'cloud' mapping:
//at 7F096E2C
E7000000 00000000
E7000000 00000000
BA001402 00000000
B900031D 00552048
BB000001 FFFFFFFF
BA001001 00000000
FC121824 FF33FFFF
FD700000 0015DE78
F5700000 07000000
E6000000 00000000
F3000000 077FF100
E7000000 00000000
BA000E02 00000000
F5681000 00018060
F2002002 000FE0FE
//at 7F096E7C
FB000000 280000FF
//at 7F006EDC:
FC40FE81 55FEF97C
//at 7F098E84
B4000000 CE8002A1 ;
B2000000 0
@@ -1 +0,0 @@
75eb0121520d34ab92d3756114ee63ccf7c57abb
@@ -0,0 +1,470 @@
These dASMs are from PAL, not NTSC, to explain how the conversion will work
Do NOT index these TLB commands
7F0B9E34: copy fog values to current sky
ADDIU SP,SP,FFD8
SW RA,0014 (SP)
SW A1,002C (SP)
SW R0,001C (SP)
JAL 7F0999A4 ;V0=#players
SW A0,0028 (SP)
//7F0B9E4C:
ADDIU AT,R0,0001
LW A2,001C (SP)
LW A3,0028 (SP) ;A3=search stage#
BNE V0,AT,7F0B9E64 ;if solo, set T0=0
OR T0,V0,R0 ;T0=#players
OR T0,R0,R0
//7F0B9E64: set default values
LUI AT,8005
LWC1 F4,D7C0 (AT) ;F4=7F7FFFFF
LW T6,002C (SP)
LUI AT,8004
MTC1 R0,F6
SWC1 F4,E2B4 (AT) ;8003E2B4=7F7FFFFF: near fog value
LUI AT,8004
BEQ T6,R0,7F089EEC ;branches over solo sky tests
SWC1 F6,E2B8 (AT) ;8003E2B8=0: near fog * (intensity/far intensity)
//7F0B9E88:
LUI T1,8004
ADDIU V1,T1,E300 ;V1=8003E300: start of fog table 1
LH T7,0000 (V1) ;T7=stage#
LUI T8,8004
ADDIU T8,T8,E300 ;T8=8003E300
BEQ T7,R0,7F0B9EEC ;if stage=0, end of list 1 found
ADDIU A0,A3,0384 ;A0=A3+0x384: search stage# + set 9 offset - cutscene sky
LH V0,0000 (T8) ;V0=stage#
//7F0B9EA8: loop until a match is found
BNE A0,V0,7F0B9EDC ;branch if stage# doesn't match stage+set9
LUI V0,8007
//7F0B9EB0: sky match
ADDIU V0,V0,CF88 ;V0=8006CF88: p->sky
SW V1,0000 (V0) ;V1->8006CF88: save p->sky
LUI AT,8007
SW V1,CF8C (AT) ;V1->8006CF8C: save p->sky
LUI AT,8007
ADDIU T9,V1,0024 ;T9=V1+0x24: p->next sky
SW T9,CF90 (AT) ;T9->8006CF90: save p->end of sky data
JAL 7F0B99F8
LW A0,0000 (V0) ;A0=p->sky
BEQ R0,R0,7F0BA06C ;since you got a match, end this bugger
LW RA,0014 (SP)
//7F0B9EDC: loopus
LH V0,0024 (V1) ;V0=stage#
ADDIU V1,V1,0024 ;V1+=0x24: next sky
BNEZ V0,7F0B9EA8 ;branch if not at end of list
NOP
//7F0B9EEC: look for MP sky
LUI T1,8004
ADDIU T1,T1,E300 ;T1=8003E300: start of sky list 1
LH A1,0000 (T1) ;A1=stage#
LUI T2,8004
ADDIU T2,T2,E300 ;T2=8003E300: start of sky list 1
BEQ A1,R0,7F0B9F68 ;branch if at EOL
OR V1,T1,R0 ;V1=T1=8003E300: start of sky list 1
SLL T3,T0,0x2
SUBU T3,T3,T0
SLL T3,T3,0x3
ADDU T3,T3,T0
SLL T3,T3,0x2 ;T3=#players * 0x64
ADDU A0,A3,T3 ;A0=stage+MPoffset
LH V0,0000 (T2)
BNE A0,V0,7F0B9F58
LUI V0,8007
//7F0B9F2C:
ADDIU V0,V0,CF88
SW V1,0000 (V0)
LUI AT,8007
SW V1,CF8C (AT)
LUI AT,8007
ADDIU T4,V1,0024
SW T4,CF90 (AT)
JAL 7F0B99F8
LW A0,0000 (V0)
BEQ R0,R0,7F0BA06C
LW RA,0014 (SP)
//7F0B9F58:
LH V0,0024 (V1)
ADDIU V1,V1,0024
BNEZ V0,7F0B9F24
NOP
//7F0B9F68:
SLTI AT,T0,0002
BNEL AT,R0,7F0B9FE4
LUI AT,4170
BEQ A1,R0,7F0B9FE0
OR V1,T1,R0
SLL A0,T0,0x2
SUBU A0,A0,T0
SLL A0,A0,0x3
LUI T5,8004
ADDIU T5,T5,E300
ADDU A0,A0,T0
SLL A0,A0,0x2
LH V0,0000 (T5)
//7F0B9F9C:
BNE A0,V0,7F0B9FD0
LUI V0,8007
//7F0B9FA4:
ADDIU V0,V0,CF88
SW V1,0000 (V0)
LUI AT,8007
ADDIU T6,V1,0024
SW T6,CF90 (AT)
JAL 7F0B99F8
LW A0,0000 (V0)
BEQ R0,R0,7F0BA06C
LW RA,0014 (SP)
//7F0B9FD0:
LH V0,0024 (V1)
ADDIU V1,V1,0024
BNEZ V0,7F0B9F9C
NOP
//7F0B9FE0:
LUI AT,4170
MTC1 AT,F12
LUI AT,8005
LWC1 F14,D7C4 (AT)
SW A2,001C (SP)
JAL 700040A0
SW A3,0028 (SP) ;SP+28=A3: search stage#
LUI A0,8004
LUI AT,8007
ADDIU A0,A0,E9C0 ;A0=8003E9C0: sky table 2
SW R0,CF60 (AT) ;0->8006CF60:
LW T7,0000 (A0) ;T7=stage#
LW A2,001C (SP)
LW A3,0028 (SP) ;A3=search stage#
BEQ T7,R0,7F0BA048 ;branch if at end of table
OR V1,A0,R0 ;V1=A0=8003E9C0: sky table 2
//7F0BA020:
LUI T8,8004
ADDIU T8,T8,E9C0 ;T8=8003E9C0: sky table 2
LW V0,0000 (T8) ;V0=stage#
//7F0BA02C:
BNEL A3,V0,7F0BA03C ;branch if not a match
LW V0,0038 (V1)
OR A2,V1,R0 ;A2=p->sky
//7F0BA038:
LW V0,0038 (V1) ;V0=next stage#
ADDIU V1,V1,0038 ;V1+=0x38: next sky
BNEZ V0,7F0BA02C ;loop for all entries
NOP
//7F0BA048:
BNEZ A2,7F0BA054 ;branch if no table 2 hit found
NOP
OR A2,A0,R0 ;A2=A0: p->default sky
//7F0BA054:
JAL 7F0B9DA0 ;make table 2 sky active
OR A0,A2,R0 ;A0=A2: p->sky
LUI V0,8007
ADDIU V0,V0,CF88
SW R0,0000 (V0) ;0->8006CF88:
//7F0BA068:
LW RA,0014 (SP)
ADDIU SP,SP,0028
JR RA
NOP
7F0B99F8: set sky values - table 1
accepts: A0=p->sky
ADDIU SP,SP,FFC8
SW RA,0014 (SP)
LH T7,0004 (A0) ;T7=sky+4: far fog
LH T6,0002 (A0) ;T6=sky+2: near pervasiveness
SW A0,0038 (SP) ;SP+38=A0: sky
MTC1 T7,F6
MTC1 T6,F4
CVT.S.W F14,F6 ;F14=far fog
JAL 700040A0
CVT.S.W F12,F4 ;F12=near pervasiveness
JAL 700040FC
ADDIU A0,SP,0030 ;A0=SP+30: target for returned float (+0, +4)
JAL 7F0B3BB4 ;F0=8003AC4C: 1.0 cutoff. set higher blackens portals and kills objects unless very close
NOP
//7F0B9A30:
LWC1 F8,0030 (SP) ;F8=SP+30: probably near pervasiveness
LWC1 F4,0034 (SP) ;F4=SP+34: probably far fog
LW A1,0038 (SP) ;A1=sky
DIV.S F10,F8,F0
LUI AT,447A
LUI A0,8007
ADDIU A0,A0,CF84 ;A0=8006CF84
LUI A2,8007
ADDIU A2,A2,CF80 ;A2=8006CF80
LUI V1,8007
ADDIU V1,V1,CF68 ;V1=8006CF68
LUI V0,8004
ADDIU V0,V0,E2BC ;V0=8003E2BC: intensity
DIV.S F6,F4,F0
SWC1 F10,0030 (SP)
MTC1 AT,F4
SWC1 F6,0034 (SP)
LH T8,000C (A1)
MTC1 T8,F8
NOP
CVT.S.W F10,F8
DIV.S F6,F10,F4
MTC1 AT,F4
//7F0B9A8C:
LUI AT,8004
SWC1 F6,0000 (A0)
LH T9,000E (A1)
MTC1 T9,F8
NOP
CVT.S.W F10,F8
LWC1 F8,0034 (SP)
DIV.S F6,F10,F4
LWC1 F10,0030 (SP)
SUB.S F14,F8,F10
SWC1 F6,0000 (A2)
LWC1 F16,0000 (A2)
MUL.S F4,F14,F16
ADD.S F6,F10,F4
SWC1 F6,E2B4 (AT)
//7F0B9AC8:
LWC1 F2,0000 (A0)
LUI AT,8004
MUL.S F8,F14,F2
ADD.S F4,F10,F8
SWC1 F4,E2B8 (AT)
//7F0B9ADC:
LH T0,0002 (A1)
LUI AT,4300
MTC1 T0,F6
NOP
CVT.S.W F10,F6
DIV.S F8,F10,F0
SWC1 F8,0000 (V1)
LH T1,0004 (A1)
SUB.S F8,F16,F2
LWC1 F18,0000 (V1)
MTC1 T1,F4
SWC1 F8,0018 (SP)
CVT.S.W F6,F4
MTC1 AT,F4
LUI AT,3F00
MTC1 AT,F8
LUI AT,4380
DIV.S F10,F6,F0
LWC1 F6,0018 (SP)
SWC1 F10,0004 (V1)
//7F0B9B2C:
DIV.S F10,F4,F6
LWC1 F12,0004 (V1)
SUB.S F4,F8,F2
SWC1 F10,0020 (SP)
MTC1 AT,F10
LUI AT,3F80
MUL.S F8,F4,F10
SUB.S F10,F12,F18
SWC1 F10,0018 (SP)
MTC1 AT,F10
DIV.S F4,F8,F6
LWC1 F8,0020 (SP)
LUI AT,437F
NEG.S F6,F8
ADD.S F8,F18,F10
LWC1 F10,0018 (SP)
SWC1 F4,001C (SP)
MUL.S F4,F6,F12
NOP
MUL.S F6,F4,F8
MTC1 AT,F8
LUI AT,3F80
DIV.S F4,F6,F10
MTC1 AT,F10
LUI AT,437F
DIV.S F6,F4,F8
LWC1 F8,0020 (SP)
ADD.S F4,F12,F10
LWC1 F10,0018 (SP)
SWC1 F6,0010 (V1)
//7F0B9BA4:
MUL.S F6,F4,F8
LWC1 F8,001C (SP)
DIV.S F4,F6,F10
MTC1 AT,F10
LUI AT,4F80
ADD.S F6,F4,F8
DIV.S F4,F6,F10
SWC1 F4,0014 (V1)
//7F0B9BC4: light values
LH T2,000C (A1) ;T2=BG dif.light
SW T2,0000 (V0) ;T2->8003E2BC
LW T3,000E (A1) ;T3=far ambient light
SW T3,0004 (V0) ;T3->8003E2C0
//7F0B9BD4: fog values
LBU T4,0010 (A1) ;T4=fog red component
SB T4,0008 (V0) ;T4->8003E2C4
LBU T5,0011 (A1) ;T5=fog green component
SB T5,0009 (V0) ;T5->8003E2C5
LBU T6,0012 (A1) ;T6=fog blue component
SB T6,000A (V0) ;T6->8003E2C6
//7F0B9BEC: cloud values
LBU T7,0013 (A1) ;T7=cloud flag
SB T7,000B (V0) ;T7->8003E2C7
LH T8,0014 (A1) ;T8=cloud image repeat
MTC1 T8,F8
NOP
CVT.S.W F6,F8 ;F6=(float) cloud repeat
SWC1 F6,000C (V0) ;F6->8003E2C8
LBU T9,0016 (A1) ;T9=offset to sky image
SH T9,0010 (V0) ;T9->8003E2CC
LBU T0,0017 (A1) ;T0=cloud red component
MTC1 T0,F10
BGEZ T0,7F0B9C2C ;silly. always >= 0 because value is unsigned!
CVT.S.W F4,F10 ;F4=(float) cloud red component
//7F0B9C20: fix rollover that never occurs
MTC1 AT,F8 ;F8=4294967296.0 [4F800000]
NOP
ADD.S F4,F4,F8 ;F4=0x100000000 + value, rolling it around to a positive number
//7F0B9C2C:
SWC1 F4,0014 (V0) ;F4->8003E2D0
LBU T1,0018 (A1) ;T1=cloud green component
LUI AT,4F80
MTC1 T1,F6
BGEZ T1,7F0B9C50 ;silly. always >= 0 because value is unsigned!
CVT.S.W F10,F6
//7F0B9C44: fix rollover that never occurs
MTC1 AT,F8 ;F8=4294967296.0 [4F800000]
NOP
ADD.S F10,F10,F8 ;F10=0x100000000 + value, rolling it around to a positive number
//7F0B9C50:
SWC1 F10,0018 (V0) ;F10->8003E2D4
LBU T2,0019 (A1) ;T2=cloud green component
LUI AT,4F80
MTC1 T2,F4
BGEZ T2,7F0B9C74 ;silly. always >= 0 because value is unsigned!
CVT.S.W F6,F4
//7F0B9C68: fix rollover that never occurs
MTC1 AT,F8 ;F8=4294967296.0 [4F800000]
NOP
ADD.S F6,F6,F8 ;F6=0x100000000 + value, rolling it around to a positive number
//7F0B9C74: water values
SWC1 F6,001C (V0) ;F6->8003E2D8
LBU T3,001A (A1) ;T3=water flag
LUI AT,4F80
ADDIU T2,R0,0001 ;T2=1
SB T3,0020 (V0) ;T3->8003E2DC
LH T4,001C (A1) ;T4=water repeat value
MTC1 T4,F10
NOP
CVT.S.W F4,F10 ;F4=(float) water repeat value
SWC1 F4,0024 (V0) ;F4->8003E2E0
//7F0B9C9C:
LBU T5,001E (A1) ;T5=offset to water image
SH T5,0028 (V0) ;T5->8003E2E4
LBU T6,001F (A1) ;T6=water red component
MTC1 T6,F8
BGEZ T6,7F0B9CC0
CVT.S.W F6,F8
//7F0B9CB4:
MTC1 AT,F10
NOP
ADD.S F6,F6,F10
//7F0B9CC0:
SWC1 F6,002C (V0)
LBU T7,0020 (A1)
LUI AT,4F80
MTC1 T7,F4
BGEZ T7,7F0B9CE4
CVT.S.W F8,F4
//7F0B9CD8:
MTC1 AT,F10
NOP
ADD.S F8,F8,F10
//7F0B9CE4:
SWC1 F8,0030 (V0)
LBU T8,0021 (A1)
LUI AT,4F80
MTC1 T8,F6
BGEZ T8,7F0B9D08
CVT.S.W F4,F6
MTC1 AT,F10
NOP
ADD.S F4,F4,F10
//7F0B9D08: world concavity
SWC1 F4,0034 (V0)
LBU T9,0022 (A1) ;T9=world concavity
LUI AT,4F80
MTC1 T9,F8
BGEZ T9,7F0B9D2C
CVT.S.W F6,F8
MTC1 AT,F10
NOP
ADD.S F6,F6,F10
//7F0B9D2C:
SWC1 F6,0038 (V0)
LH V1,0006 (A1) ;V1=near fog value
LUI AT,8007
BNEL V1,R0,7F0B9D4C ;branch if near fog value present
MTC1 V1,F4
BEQ R0,R0,7F0B9D8C
SW R0,CF64 (AT) ;0->8006CF64
//7F0B9D48:
MTC1 V1,F4
LUI V0,8007
ADDIU V0,V0,CF98 ;V0=8006CF98
CVT.S.W F8,F4 ;F8=(float) near fog value
LUI AT,8007
SWC1 F8,0000 (V0)
LH T0,0008 (A1) ;T0=max obj vis. range
MTC1 T0,F10
NOP
CVT.S.W F6,F10 ;F6=(float) max obj vis. range
SWC1 F6,0004 (V0)
LH T1,000A (A1) ;T1=obfuscation range
MTC1 T1,F4
NOP
CVT.S.W F8,F4 ;F8=(float) obfuscation range
SWC1 F8,0008 (V0)
SW V0,CF64 (AT) ;8006CF98->8006CF64
//7F0B9D8C:
LW RA,0014 (SP)
LUI AT,8007
SW T2,CF60 (AT) ;1->8006CF60
JR RA
ADDIU SP,SP,0038
7F0B9DA0: set sky values - table 2
accepts: A0=p->sky
LBU T6,0004 (A0) ;T6=fog red component
LUI V0,8004
ADDIU V0,V0,E2BC ;V0=8003E2BC: current env.data
SB T6,0008 (V0) ;T6->8003E2C4
LBU T7,0005 (A0) ;T7=fog green component
SB T7,0009 (V0) ;T7->8003E2C5
LBU T8,0006 (A0) ;T8=fog blue component
SB T8,000A (V0) ;T8->8003E2C6
LBU T9,0007 (A0) ;T9=cloud flag
SB T9,000B (V0) ;T9->8003E2C7
LWC1 F4,0008 (A0) ;F4=cloud repeat value
SWC1 F4,000C (V0) ;F4->8003E2C8
LH T0,000C (A0) ;T0=cloud image offset
SH T0,0010 (V0) ;T0->8003E2CC
LWC1 F6,0010 (A0) ;F6=cloud red component
SWC1 F6,0014 (V0) ;F6->8003E2D0
LWC1 F8,0014 (A0) ;F8=cloud green component
SWC1 F8,0018 (V0) ;F8->8003E2D4
LWC1 F10,0018 (A0) ;F10=cloud blue component
SWC1 F10,001C (V0) ;F10->8003E2D8
LBU T1,001C (A0) ;T1=water flag
SB T1,0020 (V0) ;T1->8003E2DC
LWC1 F16,0020 (A0) ;F16=water repeat value
SWC1 F16,0024 (V0) ;F16->8003E2E0
LH T2,0024 (A0) ;T2=water image offset
SH T2,0028 (V0) ;T2->8003E2E4
LWC1 F18,0028 (A0) ;F18=water red component
SWC1 F18,002C (V0) ;F18->8003E2E8
LWC1 F4,002C (A0) ;F4=water green component
SWC1 F4,0030 (V0) ;F4->8003E2EC
LWC1 F6,0030 (A0) ;F6=water blue component
SWC1 F6,0034 (V0) ;F6->8003E2F0
LWC1 F8,0034 (A0) ;F8=world concavity distort
JR RA
SWC1 F8,0038 (V0) ;F8->8003E2F4
@@ -1 +0,0 @@
d0923d44404d29ac040f55d01be79e0ad5ccf95b
@@ -0,0 +1,58 @@
PAL uses a reduced fog/sky/water block format.
NOT ACCURATE except for size. Did this quickly just to start a document on the subject.
Trust nothing you see
entries 0x24 in size
0x0 2 stage ID number (or multiple thereof)
0x2 2 near pervasiveness of fog on rendered surfaces
0x4 2 far fog value; beyond this is complete obscurity
0x6 2 near fog value; distance from player to start of fog gradient
0x8 2 max obj vis. range; furthest dist standard (non-door) obj and actors are visible at
0xA 2 obj obfuscation range; objs start to 'fade' at this distance
0xC 2 default 996 BG: dif. in light. smaller # = foggier near player
0xE 2 default 1000 far ambient light value value. used with above two values
I think this is when fog occurs, and above two are subtracted to create the near fog boundry.
permillage. light/ambient=multiplier
0x10 1 red component 0-FF
0x11 1 green component 0-FF
0x12 1 blue component 0-FF
0x13 1 clouds 1-on/0-off
/*cloud-specific*/
0x14 2 default 5000; cloud image repeat value. larger = more repetitions (pushed to DL)
0x16 1 default 00; offset from loaded sky image (8B6) to image entry used for sky.
0x17 1 cloud red component 0-FF
0x18 1 cloud green component 0-FF
0x19 1 cloud blue component 0-FF
0x1A 1 unsigned byte Nonzero='water'; also pulls the object ambient light value...
0x1B 1 RESERVED
/*water-specific*/
0x1C 2 default -1000; water image repeat value. larger = more repetition (pushed to DL)
0x1E 1 default 01 or 02; offset to loaded water image entry.
0x1F 1 water highlight red component 0-FF
0x20 1 water highlight green component 0-FF
0x21 1 water highlight blue component 0-FF
0x22 1 world concavity distort! positive makes world concave, negative world convex. distorts perspective
0x23 1 RESERVED
currently active sky 8003E2B0, first sky at 8003E300
format is the same as NTSC, so that means it will be really easy to port it!
8003E2B4 [float] near fog value
8003E2B8 [float] near fog * (intensity/far intensity)
8003E2BC intensity
8003E2C0 far intensity
8003E2C4 fog colour
8003E2C8 [float] cloud repeat value
8003E2CC offset to sky image
8003E2D0 [float] red component
8003E2D4 [float] green component
8003E2D8 [float] blue component
8003E2DC water flag
8003E2E0 [float] water repeat value
8003E2E4 offset to water image
8003E2E8 [float] red component
8003E2EC [float] green component
8003E2F0 [float] blue component
8003E2F4 [float] world distort
@@ -1 +0,0 @@
ee3c9a79a641376955c7004b8aaae35be52f314e
@@ -0,0 +1,535 @@
fog elements, typically 0x5C
@4d88
80044928
80044940
80044c00
80044c28
80044c50
800449c8
80044ab0
80044b58
80044c68
80044ca0
format: 0x5c per entry
0x0 4 stage ID number (or multiple thereof)
(these values are more dedicated to obscuring stage/object elements)
0x4 4 (float) odd blend multiplier. pervasiveness of fog on rendered surfaces (ie. ground) closer than near fog value. Also affects the z index for the viewport to some degree but not on PAL.
0x8 4 (float) far fog value; beyond this is complete obscurity
0xC 4 (float) near fog value; distance from player to start of fog gradient
0x10 4 (float) max obj vis. range; furthest dist standard (non-door) obj and actors are visible at
0x14 4 (float) obj obfuscation range; objs start to 'fade' at this distance
0x18 4 (float) default 0 min obj vis range; nearest stand. objs are visible at. Always set to zero!
(note: these values are more dedicated to actual ambient fog lighting effect)
0x1C 4 long default 999 All Objects: difference between near and far ambient light. Intensity, in other words
0x20 4 long default 996 BG: dif. in light. smaller # = foggier near player
0x24 4 long default 1000 far ambient light value value. used with above two values
I think this is when fog occurs, and above two are subtracted to create the near fog boundry.
0x28 1 red component 0-FF
0x29 1 green component 0-FF
0x2A 1 blue component 0-FF
0x2B 1 clouds 1-on/0-off
0x2C 4 (float) default 5000; cloud image repeat value. larger = more repetitions (pushed to DL)
0x30 2 default 0000; offset from loaded sky image (8B6) to image entry used for sky.
0x32 2 reserved (0)
0x34 4 (float) cloud Red channel (alpha->red)
0x38 4 (float) cloud Green channel
0x3C 4 (float) cloud Blue channel
0x40 1 unsigned byte Nonzero='water'; also pulls the object ambient light value...
0x41 3 reserved (0)
0x44 4 (float) default -1000; water image repeat value. larger = more repetition (pushed to DL)
0x48 2 default 0001 or 0002; offset to loaded water image entry.
0x4A 2 reserved
0x4C 4 (float) water Red channel; these three values affect water highlight near the player only
0x50 4 (float) water Green channel
0x54 4 (float) water Blue channel
0x58 4 (float) world concavity distort! positive makes world concave, negative world convex. distorts perspective
Note: stages 1A, 36, default omit fog data (0x4-0x24 above):
0x0 stage ID
0x4 fog colour
0x8 cloud repeat value
etc...
currently active sky 4db0
81044dd4 ????
81044dd6 ????
water tag 4dec
01000000
statue 81044E12 0016
81044e38 0000
81044e3a 0801
-----------
control 81044E6E 0017
81044e94 0000
81044e96 0000
-----------
Archives 81044ECA 0018
81044EF0 0000
81044EF2 0001
-----------
train 81044F26 0019
81044f4c 0000
81044f4e 0801
part 2 81044F82 007D
81044fa8 0000
81044faa 0801
-----------
Streets 81044FDE 001D
81045004 1018
81045006 2001
-----------
depot 8104503A 001E
81045060 0000
81045062 0801
-----------
complex 81045096 001F
810450bc 2800
810450be 0001
-----------
Dam 810450F2 0021
81045118 1030
8104511A 6001
sky part 2 8104514E 03A5
81045174 1030
81045176 6001
-----------
facility 810451AA 0022
810451d0 1020
810451d2 1000
facility gas leak? 81045206 0086
8104522c 4080
8104522e 4000
-----------
Runway 81045262 0023
81045288 1030
8104528A 4001
-----------
Surface 1 810452BE 0024
810452E4 6060
810452E6 8001
-----------
jungle 8104531A 0025
81045340 459c
81045342 4000
-----------
temple 81045376 0026
8104539c 1818
8104539e 2801
-----------
Caverns 810453D2 0027
810453F8 0800
810453FA 0800
-----------
Cradle 8104542E 0029
81045454 6080
81045456 A001
-----------
Surface 2 8104548A 002B
810454B0 2010
810454B2 1001
sky part 2 810454E6 03AF
8104550C 2010
8104550E 1001
-----------
Bunker 2 81045542 001B
81045568 1000
8104556A 0001
-----------
complex MULTI
2pl 8104559E 00D1
810455C4 8078
810455C6 7000
3pl 810455FA 0135
81045620 8078
81045622 7000
4pl 81045656 0199
8104567C 8078
8104567E 7000
-----------
cradle MULTI
2pl 810456B2 00F1
810456D8 6080
810456DA A001
3pl 8104570E 0155
81045734 6080
81045736 A001
4pl 8104576A 01B9
81045790 6080
81045792 A001
-----------
temple MULTI
2pl 810457C6 00EE
810457ec 1818
810457ee 1801
3pl 81045822 0152
81045848 1818
8104584a 1801
4pl 8104587E 01B6
810458a0 1818
810458a2 1801
-----------
caverns MULTI
2pl 810458DA 00EF
81045900 0800
81045902 0800
3pl 81045936 0153
8104595C 0800
8104595E 0800
4pl 81045992 01B7
810459B8 0800
810459BA 0800
-----------
default multiplayer
statue, library/basement/stack, caves, bunker 2, facility, egyptian, archives
2pl 810459EE 00C8
81045A14 0000
81045A16 0000
3pl 81045A4A 012C
81045A70 0000
81045A72 0000
4pl 81045AA6 0190
81045ACC 0000
81045ACE 0000
-----------
citadel 81045B02 0028
81045B28 1850
81045B2A 3801
-----------
citadel MULTI
2pl 81045B5E 00F0
81045B84 1850
81045B86 3801
3pl 81045BBA 0154
81045BE0 1850
81045BE2 3801
4pl 81045C16 01B8
81045C3C 1850
81045C3E 3801
-----------
complex'S SECOND SKY! MULTI
2pl 81045C72 00E7
81045C98 2800
81045C9C 0001
3pl 81045CCE 014B
81045CF4 2800
81045CF6 0001
4pl 81045D28 01AF
81045D50 2800
81045D52 0001
-----------
aztec 81045D86 001C
81045dac 0000
81045dae 0001
second sky 81045DE2 0080
81045E08 0000
81045E0A 0001
-----------
egyptian 81045E3E 0020
81045e64 1030
81045e66 6001
second sky 81045E9A 0084
81045EC0 0000
81045EC2 0001
-----------
blank entry at 5ef4
followed by unusually different (yet valid) format
-----------
default/bunker 1 81045F50 FFFF + 81045F52 FFFF
81045F54 0010
81045F56 4000
-----------
frigate 81045F8A 001A
81045F8C 1030
81045F8E 6001
-----------
cuba 81045FC2 0036
81045FC4 3040
81045FC6 1000
--------------------------
0x64 b/w skies. solo 1, solo 2, multi 2pl, multi 3pl, multi 4pl. (I think...)
FFFF 1pl default (bunker 1,silo)
0009 {1pl bunker 1 beta}
0014 {1pl silo beta}
0016 1pl statue
0017 1pl control
0018 1pl archives
0019 1pl train
001A 1pl frigate
001B 1pl Bunker 2
001C 1pl aztec
001D 1pl streets
001E 1pl depot
001F 1pl complex
0020 1pl egypt
0021 1pl dam
0022 1pl facility
0023 1pl runway
0024 1pl surface 1
0025 1pl jungle
0026 1pl temple
0027 1pl caverns
0028 1pl citadel
0029 1pl Cradle
002B 1pl surface 2
002D {1pl Basement beta}
002E {1pl Stacks beta}
0030 {1pl Library beta}
0032 {1pl Caves beta}
0036 1pl cuba
0064 {1pl #2 default sky}
006D {1pl #2 bunker 1 beta}
0078 {1pl #2 silo beta}
007A {1pl #2 statue beta}
007B {1pl #2 control beta}
007C {1pl #2 archives beta}
007D 1pl #2 train
007E {1pl #2 frigate beta}
007F {1pl #2 Bunker 2 beta}
0080 1pl #2 aztec
0081 {1pl #2 streets beta}
0082 {1pl #2 depot beta}
0083 {1pl #2 complex beta}
0084 1pl #2 egypt
0085 {1pl #2 dam beta}
0086 1pl #2 facility
0087 {1pl #2 runway beta}
0088 {1pl #2 surface 1 beta}
0089 {1pl #2 jungle beta}
008A {1pl #2 temple beta}
008B {1pl #2 caverns beta}
008C {1pl #2 citadel beta}
008D {1pl #2 cradle beta}
008E {1pl #2 surface 2 beta}
0094 {1pl #2 library}
009A {1pl #2 cuba beta}
00C8 2pl default multi
00D1 2pl complex (BETA BUNKER 1?)
00DC {2pl silo beta}
00DE {2pl statue beta}
00DF {2pl control beta}
00E0 {2pl archives beta}
00E1 {2pl train beta}
00E2 {2pl frigate beta}
00E3 {2pl bunker 2 beta}
00E4 {2pl aztec beta}
00E5 {2pl streets beta}
00E6 {2pl depot beta}
00E7 2pl #2 complex
00E8 {2pl egypt beta}
00E9 {2pl dam beta}
00EA {2pl facility beta}
00EB {2pl runway beta}
00EC {2pl surface 1 beta}
00ED {2pl jungle beta}
00EE 2pl Temple
00EF 2pl caverns
00F0 2pl citadel
00F1 2pl cradle
00F2 {2pl surface 2 beta}
00F8 {2pl library}
00FE {2pl cuba beta}
012C 3pl default multi
0135 3pl complex {bunker 1?}
0140 {3pl silo beta}
0142 {3pl statue beta}
0143 {3pl control beta}
0144 {3pl archives beta}
0145 {3pl train beta}
0146 {3pl frigate beta}
0147 {3pl bunker 2 beta}
0148 {3pl aztec beta}
0149 {3pl streets beta}
014A {3pl depot beta}
014B 3pl #2 complex
014C {3pl egypt beta}
014D {3pl dam beta}
014E {3pl facility beta}
014F {3pl runway beta}
0150 {3pl surface 1 beta}
0151 {3pl jungle beta}
0152 3pl temple
0153 3pl caverns
0154 3pl citadel
0155 3pl cradle
0156 {3pl surface 2 beta}
015C {3pl library}
0162 {3pl cuba beta}
0190 4pl default multi
0199 4pl complex {bunker 1?}
01A4 {4pl silo beta}
01A6 {4pl statue beta}
01A7 {4pl control beta}
01A8 {4pl archives beta}
01A9 {4pl train beta}
01AA {4pl frigate beta}
01AB {4pl bunker 2 beta}
01AC {4pl aztec beta}
01AD {4pl streets beta}
01AE {4pl depot beta}
01AF 4pl #2 complex
01B0 {4pl egypt beta}
01B1 {4pl dam beta}
01B2 {4pl facility beta}
01B3 {4pl runway beta}
01B4 {4pl surface 1 beta}
01B5 {4pl jungle beta}
01B6 4pl temple
01B7 4pl caverns
01B8 4pl citadel
01B9 4pl cradle
01BA {4pl surface 2 beta}
01C0 {4pl library}
01C6 {4pl cuba beta}
x9 cutscenes?
03A5 1pl #2 dam?
03AF 1pl #2 surface 2?
one blank entry in the chart...plus room after it
---------------------------
statue multiplayer skies
81044E12 00DE
D002B523 0003
81044E12 0142
D002B523 0004
81044E12 01A6
control multiplayer skies
(not necessary)
81044E6E 00DF
D002B523 0003
81044E6E 0143
D002B523 0004
81044E6E 01A7
archives multiplayer skies
81044ECA 00E0
D002B523 0003
81044ECA 0144
D002B523 0004
81044ECA 01A8
train multiplayer skies
81044F26 00E1
D002B523 0003
81044F26 0145
D002B523 0004
81044F26 01A9
frigate multiplayer skies
(minus water...)
81045F8A 00E2
D002B523 0003
81045F8A 0146
D002B523 0004
81045F8A 01AA
Bunker 2 multiplayer skies
81045542 00E3
D002B523 0003
81045542 0147
D002B523 0004
81045542 01AB
aztec multiplayer skies
81045D86 00E4
D002B523 0003
81045D86 0148
D002B523 0004
81045D86 01AC
streets multiplayer skies
81044FDE 00E5
D002B523 0003
81044FDE 0149
D002B523 0004
81044FDE 01AD
depot multiplayer skies
8104503A 00E6
D002B523 0003
8104503A 014A
D002B523 0004
8104503A 01AE
egyptian multiplayer skies
81045E3E 00E8
D002B523 0003
81045E3E 014C
D002B523 0004
81045E3E 01B0
egyptian after dark multiplayer skies
81045E9A 00E8
D002B523 0003
81045E9A 014C
D002B523 0004
81045E9A 01B0
dam multiplayer skies
(minus the water...)
810450F2 00E9
D002B523 0003
810450F2 014D
D002B523 0004
810450F2 01B1
facility multiplayer skies
810451AA 00EA
D002B523 0003
810451AA 014E
D002B523 0004
810451AA 01B2
runway multiplayer skies
81045262 00EB
D002B523 0003
81045262 014F
D002B523 0004
81045262 01B3
surface 1 multiplayer skies
810452BE 00EC
D002B523 0003
810452BE 0150
D002B523 0004
810452BE 01B4
jungle multiplayer skies
8104531A 00ED
D002B523 0003
8104531A 0151
D002B523 0004
8104531A 01B5
surface 2 multiplayer skies
8104548A 00F2
D002B523 0003
8104548A 0156
D002B523 0004
8104548A 01BA
surface 2 sky in surface 1 multi
8104548A 00EC
D002B523 0003
8104548A 0150
D002B523 0004
8104548A 01B4
cuba multiplayer skies
81045FC2 00FE
D002B523 0003
81045FC2 0162
D002B523 0004
81045FC2 01C6
@@ -1 +0,0 @@
8d49638b96547c3f86cb1c10c2631aeea0024a2f
@@ -0,0 +1,79 @@
format:
0x0 1 type
0x1 1 #commands, 0x8 each
0x2 2 RESERVED
0x4 var data
for multi-command entries, 645 is a type identifier for portal offsets and 65 the identifier for room numbers.
type 00: end
00.01.0000 00000000
type 01: push d to stack
01.01.0000 dddddddd
type 02: pull off stack
02.01.0000 00000000
type 03: AND and merge last two values on stack
03.01.0000 00000000
type 04: OR and merge last two values on stack
04.01.0000 00000000
type 05: ! last value on stack
05.01.0000 00000000
type 06: XOR and merge last two values on stack
06.01.0000 00000000
type 14: push TRUE/FALSE to stack if within range of rooms
14.03.0000 00000000 65000000 000000rr 65000000 000000rr
type 1E: force visible
1E.01.0000 00000000
type 1F: match visibility to that of portal
1F.02.0000 00000000 64000000 pppppppp
type 20: add visible room
20.02.0000 00000000 65000000 000000rr
type 21: initialize block; removes visibility
21.01.0000 00000000
type 22: make visible if portal can view room
22.02.0000 00000000 64000000 pppppppp
type 23: remove visibility if portal can not view room
23.02.0000 00000000 64000000 pppppppp
type 24: disable room (1->room[r]+34)
24.02.0000 00000000 65000000 000000rr
type 25: disable rooms (1->room[r1:r2]+34)
24.03.0000 00000000 65000000 000000r1 65000000 000000r2
type 26: preload room
26.02.0000 00000000 65000000 000000rr
type 27: preload range of rooms
27.03.0000 00000000 65000000 000000rr 65000000 000000rr
type 50: IF statement (re-entrant)
50.01.0000 00000000
type 51: disable reading commands; if reading disabled, also disables parent
51.01.0000 00000000
type 52: ENDIF FALSE, command reading enabled
52.01.0000 00000000
type 5A: IF(pulled condition) statement (re-entrant)
5A.01.0000 00000000
type 5B: toggle reading/ignoring commands
5B.01.0000 00000000
type 5C: ENDIF
5C.01.0000 00000000
@@ -1 +0,0 @@
7954721c65c2ffafd086b809cf2648d57bbb93b4
@@ -0,0 +1,620 @@
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 to stack
7F0B84F8 type 02 pull from stack
7F0B8518 type 03 & and merge last two on stack
7F0B8548 type 04 | and merge last two on stack
7F0B8578 type 05 ! last on stack
7F0B85A0 type 06 ^ last two on stack
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 push true/false if in range of rooms
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 visible
7F0B8654 type 1F match portal visibility
7F0B8788 type 20 add visible room
7F0B8914 type 21 remove visibility [save S7->S4]
7F0B86A8 type 22 visible if seen through portal
7F0B8714 type 23 not visible if not seen through portal
7F0B87F4 type 24 disable room
7F0B8828 type 25 disable range of rooms
7F0B8884 type 26 preload room
7F0B88B8 type 27 preload range of rooms
7F0B8930 type 50 if statement
7F0B896C type 51 don't execute commands even on return
7F0B8954 type 52 endif and continue executing commands
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 if(pull from stack) statement
7F0B89C8 type 5B toggle execute vs read only
7F0B89E0 type 5C endif
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 ECEA4 push A0 onto 800448A8 table; V0=value written
accepts: A0=value to set onto table
LUI A1,8004
ADDIU A1,A1,48F8
LW V1,0000 (A1) ;V1=800448F8: index.cur, or alternately total entries
LUI AT,8004
OR V0,A0,R0 ;V0=A0: value
SLL T6,V1,0x2
ADDU AT,AT,T6
SW A0,48A8 (AT) ;A0->800448A8+offset: save value to final (current) entry
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 ECEE0 pull V0 from 800448A8 table
LUI A0,8004
ADDIU A0,A0,48F8
LW T6,0000 (A0) ;T6=800448F8: index.cur
ADDIU AT,R0,0014 ;AT=0x14
LUI V1,8004
ADDIU T7,T6,0013 ;previous
DIV T7,AT
MFHI T8
SLL T0,T8,0x2 ;T0=previous index -> offset
ADDU V1,V1,T0
SW T8,0000 (A0) ;save new index value to 800448F8
JR RA
LW V0,48A8 (V1) ;V0=800448A8+offset: value pulled from table
7F0B83E4 ECF14 pull V0 from entry A0 in 800458A8 table
accepts: A0=entry to pull
LUI T6,8004
LW T6,48F8 (T6) ;T6=800448F8: #entries
ADDIU AT,R0,0014 ;AT=0x14
LUI V0,8004
SUBU T7,T6,A0 ;T7=index.cur-A0: nth entry from end to start
ADDIU T8,T7,0013 ;T8=T7-1: previous entry
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: value pulled from table[A0]
+_+
7F0B8414 ECF44 parse global visibility command list
accepts: A0=p->cmd, A1=mode
ADDIU SP,SP,FF80
SW S3,0024 (SP)
SW S2,0020 (SP)
SW S1,001C (SP)
LUI AT,8008
OR S1,A0,R0 ;S1=A0: p->cmd
OR S2,A1,R0 ;S2=A1: mode
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 ;S3=1
BNEZ A0,7F0B8460 ;return if A0 NULL
SW R0,1610 (AT) ;0->80081610: return value for 'conditional' types
BEQ R0,R0,7F0B89F4
OR V0,A0,R0
//7F0B8460:
LUI S8,8008
LUI S6,8008
LUI S4,8004
ADDIU S4,S4,48FC ;S4= 800448FC
ADDIU S6,S6,1600 ;S6= 80081600
ADDIU S8,S8,A0B0 ;S8= 8007A0B0: p->BONDdata
ADDIU S7,R0,0001 ;S7= 1
ADDIU S5,R0,0001 ;S5= 1
//7F0B8480: process command
LBU A0,0000 (S1) ;A0=cmd.type
SLTI AT,A0,0028
BNEZ AT,7F0B84B0 ;skip if 0-27
ADDIU T6,A0,FFB0
//7F0B8490: commands 50-5C
SLTIU AT,T6,000D
BEQ AT,R0,7F0B89F0 ;return if invalid
SLL T6,T6,0x2
LUI AT,8006
ADDU AT,AT,T6
LW T6,8C80 (AT) ;T6=80058C80+offset: handler for types 50-5C
JR T6
NOP
//7F0B84B0: commands 0-27
SLTIU AT,A0,0028
BEQ AT,R0,7F0B89F0 ;return if invalid
SLL T7,A0,0x2
LUI AT,8006
ADDU AT,AT,T7
LW T7,8CB4 (AT) ;T6=80058CB4+offset: handler for types 50-5C
JR T7
NOP
7F0B84D0 type 00 break
BEQ R0,R0,7F0B89F4 ;return V0=p->cmd
OR V0,S1,R0
7F0B84D8 type 01 ???; push DATA onto 800448A8 stack
BEQL S2,R0,7F0B84EC ;if mode 0, ignore command
LBU T8,0001 (S1)
JAL 7F0B8374 ;push A0 onto table
LW A0,0004 (S1) ;A0=data
//7F0B84E8: advance
LBU T8,0001 (S1) ;cmd.size
SLL T9,T8,0x3
BEQ R0,R0,7F0B8480
ADDU S1,S1,T9 ;S1=next cmd
7F0B84F8 type 02 ???; pull V0 off 800448A8 stack
BEQL S2,R0,7F0B850C ;if mode 0, ignore command
LBU T0,0001 (S1)
JAL 7F0B83B0 ;pull V0 from stack
NOP
//7F0B8508:
LBU T0,0001 (S1) ;cmd.size
SLL T1,T0,0x3
BEQ R0,R0,7F0B8480
ADDU S1,S1,T1 ;S1=next cmd
7F0B8518 type 03 ???; AND last two values on stack and replace
BEQL S2,R0,7F0B853C ;if mode 0, ignore command
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
//7F0B8538:
LBU T2,0001 (S1) ;cmd.size
SLL T3,T2,0x3
BEQ R0,R0,7F0B8480
ADDU S1,S1,T3 ;S1=next cmd
7F0B8548 type 04 ??? OR last two values on stack and replace
BEQL S2,R0,7F0B856C ;if mode 0, ignore command
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
//7F0B8568:
LBU T4,0001 (S1) ;cmd.size
SLL T5,T4,0x3
BEQ R0,R0,7F0B8480
ADDU S1,S1,T5 ;S1=next cmd
7F0B8578 type 05 ??? ! last value on stack
BEQL S2,R0,7F0B8594 ;if mode 0, ignore command
LBU T6,0001 (S1)
JAL 7F0B83B0 ;pull V0 off stack
NOP
JAL 7F0B8374 ;push A0 onto stack
SLTIU A0,V0,0001 ;A0=!V0
//7F0B8590:
LBU T6,0001 (S1) ;cmd.size
SLL T7,T6,0x3
BEQ R0,R0,7F0B8480
ADDU S1,S1,T7 ;S1=next cmd
7F0B85A0 type 06 ??? XOR last two values on stack
BEQL S2,R0,7F0B85C4 ;if mode 0, ignore command
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
//7F0B85C0:
LBU T8,0001 (S1) ;cmd.size
SLL T9,T8,0x3
BEQ R0,R0,7F0B8480
ADDU S1,S1,T9 ;S1=next cmd
7F0B85D0 type 14 range of rooms capable of sight
BEQ S2,R0,7F0B8604 ;if mode 0, ignore command
LUI V0,8004
LW V0,4838 (V0) ;V0=80044838: current room?
LW T0,000C (S1) ;T0=room #1
SLT A0,V0,T0
XORI A0,A0,0001 ;A0=TRUE if ? >= room1
BEQ A0,R0,7F0B85FC ;branch if included in range
NOP
LW T1,0014 (S1) ;T1=room #2
SLT A0,T1,V0
XORI A0,A0,0001 ;A0=TRUE if room2 >= ?
//7F0B85FC: pushes 1 to stack if cur. within range
JAL 7F0B8374 ;push A0 onto stack
NOP
//7F0B8604:
LBU T2,0001 (S1) ;cmd.size
SLL T3,T2,0x3
BEQ R0,R0,7F0B8480
ADDU S1,S1,T3 ;S1=next cmd
7F0B8614 type 1E force room visible without need of portals
BEQL S2,R0,7F0B8648 ;if mode 0, ignore command
LBU T4,0001 (S1)
LW V0,0000 (S8) ;V0=p->BONDdata
LWC1 F4,1118 (V0)
SWC1 F4,0000 (S6) ;BONDdata+1118 -> 80081600+0
LWC1 F6,111C (V0)
SWC1 F6,0004 (S6) ;BONDdata+111C -> 80081600+4
LWC1 F8,1120 (V0)
SWC1 F8,0008 (S6) ;BONDdata+1120 -> 80081600+8
LWC1 F10,1124 (V0)
SW R0,0000 (S4) ;0->800448FC
SWC1 F10,000C (S6) ;BONDdata+1124 -> 80081600+C
//7F0B8644:
LBU T4,0001 (S1) ;cmd.size
SLL T5,T4,0x3
BEQ R0,R0,7F0B8480
ADDU S1,S1,T5 ;S1=next cmd
7F0B8654 type 1F match portal visibility
BEQ S2,R0,7F0B8698 ;if mode 0, ignore command
OR A1,S6,R0 ;A1= 80081600
JAL 7F0B5864
LW A0,000C (S1) ;A0=portal
BNEL V0,R0,7F0B8678 ;disable unless referenced
LW A1,0000 (S8)
BEQ R0,R0,7F0B8698
SW S7,0000 (S4) ;1->800448FC
//7F0B8674: V0!=0
LW A1,0000 (S8) ;A1=p->BONDdata
OR A0,S6,R0 ;A0= 80081600
JAL 7F0B5BDC ;V0=TRUE if A0 in line-of-sight with A1
ADDIU A1,A1,1118 ;A1=BONDdata+1118
BNEL V0,R0,7F0B8698 ;if set, make visible: 0->800448FC
SW R0,0000 (S4)
BEQ R0,R0,7F0B8698 ;else 1->800448FC
SW S7,0000 (S4) ;1->800448FC
//7F0B8694:
SW R0,0000 (S4)
//7F0B8698:
LBU T6,0001 (S1) ;cmd.size
SLL T7,T6,0x3
BEQ R0,R0,7F0B8480
ADDU S1,S1,T7 ;S1=next cmd
7F0B8788 type 20 add visible room
BEQL S2,R0,7F0B87E8 ;if mode 0, ignore command
LBU T7,0001 (S1)
LW T4,0000 (S4)
OR A1,S6,R0 ;A1=S6: 80081600
BNEL T4,R0,7F0B87E8 ;ignore if 800448FC set: not visible
LBU T7,0001 (S1)
JAL 7F0B5208
LW A0,000C (S1) ;A0=room#
BEQ V0,R0,7F0B87E4 ;ignore if FALSE
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
//7F0B87E4:
LBU T7,0001 (S1) ;cmd.size
SLL T8,T7,0x3
BEQ R0,R0,7F0B8480
ADDU S1,S1,T8 ;S1=next cmd
7F0B8914 type 21 begin new block; set not visible
BEQL S2,R0,7F0B8924 ;if mode 0, ignore command
LBU T5,0001 (S1)
SW S7,0000 (S4) ;1->800448FC
//7F0B8920:
LBU T5,0001 (S1) ;cmd.size
SLL T6,T5,0x3
BEQ R0,R0,7F0B8480
ADDU S1,S1,T6 ;S1=next cmd
7F0B86A8 type 22 make visible if portal can view room
BEQ S2,R0,7F0B8704 ;if mode 0, ignore command
ADDIU A1,SP,0068 ;A1=SP+68
JAL 7F0B5864
LW A0,000C (S1) ;A0=cmd+C: portal#
BEQL V0,R0,7F0B8708 ;ignore if not referenced
LBU T9,0001 (S1)
LW A1,0000 (S8) ;A1=p->cur.BONDdata
ADDIU A0,SP,0068 ;A0=SP+68
JAL 7F0B5BDC ;V0=TRUE if A0 in line-of-sight with A1
ADDIU A1,A1,1118 ;A1=p->cur.BONDdata+1118: unknown float use in no_portals_necessary
BEQL V0,R0,7F0B8708 ;ignore if portal not visible
LBU T9,0001 (S1)
//7F0B86D8: copy perspective info or something like that
LW T8,0000 (S4) ;T8=800448FC: current visibility setting
ADDIU A1,SP,0068 ;A1=SP+68
OR A0,S6,R0 ;A0=S6:
BEQ T8,R0,7F0B86FC ;skip if room already set visible
NOP
JAL 7F0B5D58 ;copies 4 floats from A1->A0
OR A0,S6,R0 ;A0=S6: 80081600
BEQ R0,R0,7F0B8704
SW R0,0000 (S4) ;0->800448FC: make visible
//7F0B86FC:
JAL 7F0B5CC0
ADDIU A1,SP,0068 ;A1=SP+68
//7F0B8704:
LBU T9,0001 (S1) ;cmd.size
SLL T0,T9,0x3
BEQ R0,R0,7F0B8480
ADDU S1,S1,T0 ;S1=next cmd
7F0B8714 type 23 remove visibility if portal can not view room
BEQL S2,R0,7F0B877C ;if mode 0, ignore command
LBU T2,0001 (S1)
LW T1,0000 (S4) ;T1=800448FC
ADDIU A1,SP,0058 ;A1=SP+58
BNEL T1,R0,7F0B877C ;ignore command if T1!=0
LBU T2,0001 (S1)
JAL 7F0B5864
LW A0,000C (S1) ;A0=portal#
BNEL V0,R0,7F0B8748
LW A1,0000 (S8)
BEQ R0,R0,7F0B8778
SW S7,0000 (S4) ;1->800448FC
//7F0B8744: when V0!=0
LW A1,0000 (S8)
ADDIU A0,SP,0058 ;A0=SP+58
JAL 7F0B5BDC ;V0=TRUE if A0 in line-of-sight with A1
ADDIU A1,A1,1118 ;A1=cur.BONDdata+1118
BNEZ V0,7F0B8764 ;if not in line-of-sight, kill visibility
OR A0,S6,R0 ;A0=S6: 80081600
BEQ R0,R0,7F0B8778
SW S7,0000 (S4) ;1->800448FC
//7F0B8764:
JAL 7F0B5BDC ;V0=TRUE if A0 in line-of-sight with A1
ADDIU A1,SP,0058 ;A1=SP+58
BNEL V0,R0,7F0B877C ;if not within perspective also kill visibility
LBU T2,0001 (S1)
SW S7,0000 (S4) ;1->800448FC
//7F0B8778:
LBU T2,0001 (S1) ;cmd.size
SLL T3,T2,0x3
BEQ R0,R0,7F0B8480
ADDU S1,S1,T3 ;S1=next cmd
7F0B87F4 type 24 save 1 to entry +34 in room table
BEQL S2,R0,7F0B881C ;if mode 0, ignore command
LBU T1,0001 (S1)
LW T9,000C (S1) ;T9=room#
LUI AT,8004
SLL T0,T9,0x2
ADDU T0,T0,T9
SLL T0,T0,0x4 ;T0=T9*0x50
ADDU AT,AT,T0
SB S5,1448 (AT) ;1->80041414+34+offset:
//7F0B8818:
LBU T1,0001 (S1) ;cmd.size
SLL T2,T1,0x3
BEQ R0,R0,7F0B8480
ADDU S1,S1,T2 ;S1=next cmd
7F0B8828 type 25 set flag for rooms between val1 and val2
BEQL S2,R0,7F0B8878 ;if mode 0, ignore command
LBU T7,0001 (S1)
LW V0,000C (S1) ;V0=room.start
LW T3,0014 (S1) ;T3=room.end
LUI T5,8004
SLL T4,V0,0x2
SLT AT,T3,V0
BNEZ AT,7F0B8874 ;end if room.end < room.start
ADDU T4,T4,V0
SLL T4,T4,0x4 ;T4=value1*0x50
ADDIU T5,T5,1414
ADDU V1,T4,T5 ;V1=80041414+offset: p->room
SB S5,0034 (V1) ;1->V1+34: ?->80041414+val1offset+34
//7F0B885C: loop while cur>=end
LW T6,0014 (S1) ;T6=end
ADDIU V0,V0,0001 ;V0++ next room
ADDIU V1,V1,0050 ;V1+=50 next entry
SLT AT,T6,V0
BEQL AT,R0,7F0B885C
SB S5,0034 (V1) ;1->room+34:
//7F0B8874:
LBU T7,0001 (S1) ;cmd.size
SLL T8,T7,0x3
BEQ R0,R0,7F0B8480
ADDU S1,S1,T8 ;S1=next cmd
7F0B8884 type 26 preload room
BEQL S2,R0,7F0B88AC ;if mode 0, ignore command
LBU T0,0001 (S1)
BEQL S3,R0,7F0B88AC ;skip if room.loaded flag not set
LBU T0,0001 (S1)
JAL 7F0B6314
LW A0,000C (S1) ;A0=room#
SLTIU S3,V0,0001 ;S3= !value: TRUE if room.loaded flag set
ANDI T9,S3,00FF
OR S3,T9,R0 ;(byte) S3
//7F0B88A8:
LBU T0,0001 (S1) ;cmd.size
SLL T1,T0,0x3
BEQ R0,R0,7F0B8480
ADDU S1,S1,T1 ;S1=next cmd
7F0B88B8 type 27 preload range of rooms
BEQL S2,R0,7F0B8908 ;if mode 0, ignore command
LBU T3,0001 (S1)
LW S0,000C (S1) ;S0=room.start
LW V1,0014 (S1) ;V1=room.end
SLT AT,V1,S0 ;TRUE if end<start
BNEL AT,R0,7F0B8908
LBU T3,0001 (S1)
//7F0B88D4: while val2<val1
BEQL S3,R0,7F0B88F8 ;skip if room.loaded flag not set
ADDIU S0,S0,0001 ;S0++ val1++
JAL 7F0B6314
OR A0,S0,R0 ;A0=room#
SLTIU S3,V0,0001 ;S3= !value: TRUE if room.loaded flag set
ANDI T2,S3,00FF
OR S3,T2,R0 ;(byte) S3
LW V1,0014 (S1) ;V1=end
ADDIU S0,S0,0001 ;S0++ room#++
//7F0B88F8:
SLT AT,V1,S0 ;TRUE if end<cur
BEQ AT,R0,7F0B88D4
NOP
//7F0B8904:
LBU T3,0001 (S1) ;cmd.size
SLL T4,T3,0x3
BEQ R0,R0,7F0B8480
ADDU S1,S1,T4 ;S1=next cmd
7F0B8930 type 50 re-entrant: calls following command block as its own 'thread'
LBU T7,0001 (S1) ;cmd.size
OR A1,S2,R0 ;A1=S2: preserve mode
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) ;cmd.size
SLL T0,T9,0x3
BEQ R0,R0,7F0B8480
ADDU S1,V0,T0
7F0B896C type 51 ignore commands; disable reading commands on return if read org. enabled
LBU T3,0001 (S1) ;cmd.size
SLTU V0,R0,S2 ;TRUE if S2
OR S2,R0,R0 ;S2=0 no longer read commands
SLL T4,T3,0x3
BEQ V0,R0,7F0B8480 ;set 80081610 if reading commands
ADDU S1,S1,T4 ;S1=next cmd
LUI AT,8008
BEQ R0,R0,7F0B8480
SW S7,1610 (AT) ;1->80081610
7F0B8954 type 52 return and permit reading commands
LBU T1,0001 (S1) ;cmd.size
LUI AT,8008
SW R0,1610 (AT) ;0->80081610
SLL T2,T1,0x3
BEQ R0,R0,7F0B89F4 ;return V0=p->next command
ADDU V0,S1,T2
7F0B8990 type 5A re-entrant: calls parser in previously set mode, setting mode on return
JAL 7F0B83B0 ;pull V0 off stack
NOP
LBU T5,0001 (S1) ;cmd.size
AND A1,V0,S2 ;A1= mode & result
SLL T6,T5,0x3
JAL 7F0B8414 ;calls this command parser using next command
ADDU A0,T6,S1
LUI T7,8008
LW T7,1610 (T7) ;T7=80081610
OR S1,V0,R0
BEQL T7,R0,7F0B8484 ;if 80081610 set, set mode to 0 (ignore command)
LBU A0,0000 (S1)
BEQ R0,R0,7F0B8480
OR S2,R0,R0
7F0B89C8 type 5B toggle S2 flag (read/ignore commands)
LBU T9,0001 (S1) ;cmd.size
XORI T8,S2,0001
OR S2,T8,R0 ;untoggle S2 flag
SLL T0,T9,0x3
BEQ R0,R0,7F0B8480
ADDU S1,S1,T0 ;S1=next cmd
7F0B89E0 type 5C return p->next command
LBU T1,0001 (S1) ;cmd.size
SLL T2,T1,0x3
BEQ R0,R0,7F0B89F4
ADDU V0,S1,T2 ;V0=p->next command
7F0B89F0 terminate
OR V0,S1,R0 ;return V0=p->cmd
//7F0B89F4: 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,0080
+_+
7F0B6314 EAE44
accepts: A0=room#
SLL T6,A0,0x2
ADDU T6,T6,A0
LUI T7,8004
ADDIU T7,T7,1414
SLL T6,T6,0x4 ;T6=A0*0x50
ADDU V0,T6,T7
LBU T9,0002 (V0) ;80041414+2+offset: rooms.loaded
ADDIU SP,SP,FFE8
ADDIU T8,R0,0001
SW RA,0014 (SP)
BNEZ T9,7F0B6354 ;return FALSE if models already loaded
SB T8,0035 (V0) ;1->rooms+35:
JAL 7F0B6368
NOP
BEQ 7F0B6358 ;return TRUE
ADDIU V0,R0,0001
//7F0B6354: return FALSE
OR V0,R0,R0
//7F0B6358: return
LW RA,0014 (SP)
ADDIU SP,SP,0018
JR RA
NOP
@@ -1 +0,0 @@
bbd0169d971c8c630875a5e21ec695a1a1c70205
@@ -0,0 +1,169 @@
Background Data
---------------
Background data consists of three seperate orders of files. The primary background file is an uncompressed binary. This binary contains offsets to the 1172 (z-custom) compressed room data. Room data is partitioned into one or two display lists and a point table. The final file is an 1172 compressed clipping file that dictates the playable area. This will be covered in a seperate document.
The primary background file consists of several sections. First are a list of offsets to the room mapping and point binaries. Second is a list of special globalized visibility, triggering multiple rooms to be visible at once through pseudocode. Lastly are the room portals and a table relating what rooms are interlinked.
The background file's header indicates at what offset each of these is located at. All offsets are relative to the location of the primary background file in ROM and are preceeded by a value, indicating the scope of that offset. Only use the lower three bytes of each offset, and add it to the initial ROM location of the file.
0x0 4 reserved
0x4 4 offset to room data table
0x8 4 offset to portal data table
0xC 4 offset to global visibility commands
---------------
Room Data Table
The room data table contains a wide assortment of data. Each room is positioned within the level using the position data given here. It also contains pointers to each of the mapping and point table blocks used to construct the room. The beginning of the table is given at bg_file offset 0x4, starting with room 0. Room 0 is always invalid, so all the values in this struct will be set to zero. The last entry is also not a valid room. It exists for the sole purpose of demarking the filesizes of the previous room's entries.
Each rooms' x, y, and z positions are given as floating-point numbers. To ensure the model aligns with the possible clipping coordinates, these values will always translate to integer values. All values are relative to the stage centerpoint; 0,0,0.
The file offsets are offsets from the ROM location of the bg_file. The first byte of each offset should be masked to remove the value indicating scope, ie. 0x00FFFFFF & offset. The size of each binary can be determined by retrieving the next entry in the table.
At no point are the total number of room entries given, though it can be calculated from the visibility offset or more simply determined by comparing the first room's primary mapping offset to the point table offset of the current room. If the two match, the current 'room' is the final dummy entry. Each struct is 0x18 bytes large, so you can divide the difference in the first and current offsets by this value to return the room number.
All room binaries are compressed with 1172 compression. The primary mapping is always present and is used to draw the majority of the room. Secondary mapping is optional; gunfire does not collide with polygons drawn by this block. For this reason, secondary mapping is used for overlays, railings, and other effects. Point tables are shared by both mapping types and contain a full list of the positions needed to draw the room.
0x0 4 (float) x position
0x4 4 (float) y position
0x8 4 (float) z position
0xC 4 offset to point table binary
0x10 4 offset to primary mapping binary
0x14 4 offset to secondary mapping binary, when preset
There is a certain pattern to the room binaries. All the point tables are listed immediately after the primary bg_file. Following these are the primary, then secondary mapping for each room. To determine the size of a binary:
Point tables:
Subtract offset for current binary from following room's point table offset
Primary Mapping Only:
Subtract offset for current binary from following room's primary mapping offset
Primary + Secondary Mapping:
Subtract offset of primary mapping from secondary mapping
Subtract offset of secondary mapping from following room's primary mapping
---------------
Portal Data Table
Portals allow rooms to be activated when within sight. Each acts as a window connecting one unique room to another. The portal table consists of offsets to actual portal polygonal data and a list of rooms interlinked. An offset to the portal table can be found at bg_file offset 0x8.
0x0 4 offset to portal address (mask offset with 0x0F000000)
0x4 1 connected room 1
0x5 1 connected room 2
0x6 2 control bytes for special attributes, beyond the scope of file parsing
The table terminates with a NULL entry - all values equal to zero.
When a player enters a room, the room ID is searched for in the table. If the value matches either connected room ID, then the portal at the offset is activated. When the player is within sight of a portal, both rooms connected to that portal are activated. Technically, rooms connected directly to the current room are usually pre-loaded even when not within visible range to ensure smooth gameplay.
Portals themselves are stored at the end of the bg_file, just before the compressed room data. They are a simple list of x, y, and z positions storeed as floating-point numbers. All points proceed clockwise around to form a polygon, and all points are relative to the centerpoint of the stage, 0,0,0. To properly integrate them with clipping, each float should be an integer value. The first byte of the first word indicates the number of points following, 1-n, and each portal can consist of as many points as desired.
0x0 1 number of points in portal
0x1 3 filler bytes (000000)
0x4 4 (float) first X position
0x8 4 (float) first y position
0xC 4 (float) first z position
etc...
---------------
Global Visibility Commands
Global visibility commands are used to activate and deactivate rooms and portals through triggered events. They are used, among other times, to render the cliff faces around the Dam, the roof in the lower storage area of Archives, and the gas containers in two of the bottling rooms of Facility.
The pseudocode is built from 32bit values and begins at the offset given at 0xC in the bg_file. Commands are processed until a terminator is reached, command 00010000 00000000. Most commands are container classes that contain lists of other command types.
Basic Commands:
00010000 00000000 terminator
21010000 00000000 starts a block of visibility commands, ending any previous blocks
Containers:
14030000 00000000 activated rooms are visible from every room between room #1 to room #2
expects: 65000000 000000#1 65000000 000000#2 5A010000 00000000
5A010000 00000000 end 14 list
1E010000 00000000 activated rooms are visible without portals
expects: 5C010000 00000000
1F020000 00000000 activated rooms are visible through the following portals
expects: 64000000 0F###### ...
further entries 22020000 00000000 64000000 0F######
end list 5C010000 00000000
5C010000 00000000 end 1E or 1F list
20020000 00000000 following rooms (65 commands) are activated
expects: 65000000 000000#1
24020000 00000000 following room (65 command) is ?
expects: 65000000 000000#1
25030000 00000000 following rooms (65 commands) are ?
expects: 65000000 000000#1 65000000 000000#2 ?
further entries 26020000 00000000 65000000 000000#n
26020000 00000000 following room (65 command) is ?
expects: 65000000 000000#1
27030000 00000000 following rooms (65 commands) are ?
expects: 65000000 000000#1 65000000 000000#2 ?
Sub-Commands (always within containers):
22020000 00000000 AND statement linking multiple 64 commands when listed
64000000 0Fxxxxxx offset within file, typically to portal data (0F relates scope)
26020000 00000000 AND statement linking multiple 65 commands when listed
65000000 000000xx room number. multiple entries do not require 2202 commands
This is not as complex as it seems. To make a single room visible when a player is within one of four sequential rooms, this code would apply.
21010000 00000000 \\start block
14030000 00000000 \\room is visible from following rooms
65000000 0000001C \\from room 1C...
65000000 0000001F \\...to room 1F
5A010000 00000000 \\end list
1E010000 00000000 \\activated room doesn't need portals to any of the above rooms
5C010000 00000000 \\end command
20020000 00000000 \\room to be activated
65000000 00000010 \\room 10 is activated when in rooms 1C, 1D, 1E, or 1F
00010000 00000000 \\end global visibility
Lets assume though you want to make the room visible not just when you are standing inside of rooms 18-1F, bt also when you look in the windows to the room. This just requires a 1F command.
21010000 00000000 \\start block
14030000 00000000 \\room is visible from following rooms
65000000 00000018 \\from room 18...
65000000 0000001F \\...to room 1F
5A010000 00000000 \\end list
1E010000 00000000 \\activated room doesn't need portals to any of the above rooms
5C010000 00000000 \\end command
1F020000 00000000 \\activate room when looking in the following portals
64000000 0F00148C \\portal at offset 0x148C
22020000 00000000 \\and...
64000000 0F001374 \\portal at offset 0x1374
22020000 00000000 \\and...
64000000 0F0014C0 \\portal at offset 0x14C0
22020000 00000000 \\and...
64000000 0F0014F4 \\portal at offset 0x14FC
5C010000 00000000 \\end list of portals
20020000 00000000 \\rooms to be activated
65000000 00000010 \\room 10 is activated in all the above
00010000 00000000 \\end global visibility
Also, multiple rooms can be activated at one time by adding more 2002 commands...
...
20020000 00000000 \\rooms to be activated
65000000 00000010 \\room 10
20020000 00000000 \\rooms to be activated
65000000 00000011 \\room 11
2101 commands end one list and start another. Only use the 0001 to end the entire global visibility block.
21010000 00000000 \\start FIRST block
14030000 00000000 \\room is visible from following rooms
65000000 0000001C \\from room 1C...
65000000 0000001F \\...to room 1F
5A010000 00000000 \\end list
1E010000 00000000 \\activated room doesn't need portals to any of the above rooms
5C010000 00000000 \\end command
20020000 00000000 \\room to be activated
65000000 00000010 \\room 10 is activated when in rooms 1C, 1D, 1E, or 1F
21010000 00000000 \\start SECOND block, ending FIRST
14030000 00000000 \\room is visible from following rooms
65000000 00000020 \\from room 20...
65000000 00000023 \\...to room 23
5A010000 00000000 \\end list
1E010000 00000000 \\activated room doesn't need portals to any of the above rooms
5C010000 00000000 \\end command
20020000 00000000 \\room to be activated
65000000 00000011 \\room 11 is activated when in rooms 20, 21, 22, or 23
-Zoinkity
@@ -1 +0,0 @@
d1555ab8081c10a7b6b03a1503bad5f19770d169
@@ -1 +0,0 @@
e3ae077ce51164982588b2a13f54a3750695206d
@@ -0,0 +1,116 @@
G-Z Models
----------
G-Z models are 1st person models, used either as weapons, gadgets, discharged shells, etc. These models are used in both the watch menu and when the object is in use in the first-person menu. Because they are only displayed, no collision information is stored.
The primary display list type used in 1st person objects is the 04 command. The breakdown is such:
04 command:
0x0 4 offset to primary mapping
0x4 4 offset to secondary mapping
0x8 4 reserved
0xC 4 offset to point table
0x10 2 number of points in point table
0x12 2 0300 - unknown
Both primary and secondary mapping may be present - and usually are. Secondary tends to be used special effects or transparently mapped areas, just like with room models. In particular, one may point toward mapping while the other points toward nothing, allowing that part of the model to 'disappear' when need be. In this case, the mapping used is set at runtime using linked 12 commands.
09 commands are also common. They are used for more than placing hats on character's heads. What they do is set a placement for a seperate model that is loaded simulatiously with the current one. For instance, the character's arm appears when some weapons and items are in use. There are many different character arm models, and storing the each object with copies of each arm is ineffecient. Instead, 09 commands in the weapon load the arm's components and place them appropriately. Because each component is loaded specificly to a given location, this also eliminates hand/object misalignment.
Most models are used for player items, so they have a series of offsets used for fingers, gun attributes, and other items. Obviously not all the offsets will be used, depending on the item. Some objects that aren't used as items, such as discharged shells, do not follow this pattern.
(fill in with offset coorespondance here before sending it off)
offsets: (28/36)
watch laser autoshot SHOTGUN AK47-SOVIET golden gun GOLD PP7 G-LAUNCH HUNT-KNIFE R-LAUNCH taser throwknife sil PP7
0x0 00000000 050001E0 0500049C 050003F0 0500012C 050001A4 00000000 00000000 00000000 00000000 00000000 050001B0 15 command
0x4 00000000 05000168 05000124 05000180 05000144 0500012C 0500015C 00000000 00000000 00000000 00000000 05000138
0x8 00000000 05000198 05000154 050001B0 05000174 0500015C 0500018C 00000000 00000000 00000000 00000000 05000168
0xC 050001B0 05000180 0500013C 05000198 0500015C 05000144 05000174 00000000 05000120 00000000 00000000 05000150
0x10 00000000 00000000 00000000 00000000 00000000 00000000 05000204 00000000 00000000 00000000 00000000 00000000
0x14 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
0x18 05000318 00000000 00000000 00000000 05000204 05000264 00000000 00000000 00000000 00000000 00000000 05000390
0x1C 00000000 00000000 00000000 00000000 00000000 050003E4 00000000 00000000 00000000 00000000 00000000 050004E0
0x20 00000000 00000000 00000000 00000000 050001EC 0500024C 00000000 0500018C 00000000 05000188 05000144 05000258
0x24 00000000 00000000 00000000 00000000 05000234 050002AC 00000000 0500039C 00000000 050001E8 0500036C 05000498
0x28 00000000 00000000 00000000 00000000 05000294 050002F4 00000000 050001D4 00000000 05000458 0500018C 05000450
0x2C 00000000 00000000 00000000 00000000 00000000 0500039C 00000000 0500030C 00000000 05000428 050002C4 050002B8
0x30 00000000 00000000 00000000 00000000 05000354 050004BC 00000000 00000000 00000000 00000000 00000000 05000378
0x34 00000000 00000000 00000000 00000000 00000000 05000504 00000000 00000000 00000000 00000000 00000000 050003F0
0x38 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 0500039C 00000000 throwing knife 12
0x3C 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 0500033C 00000000 throwing knife blade 12
0x40 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 05000410 00000000 00000000 taser placeholder for animation (18)
0x44 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 050003F8 00000000 00000000 taser 12 for animation
0x48 00000000 05000708 050003F4 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 shotgun shell 1
0x4C 00000000 05000498 05000394 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 shotgun shell 2
0x50 00000000 05000540 05000424 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 shotgun shell 3
0x54 00000000 05000678 05000454 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 shotgun shell 4
0x58 00000000 050005E8 0500031C 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 shotgun shell 5
0x5C 00000000 050006C0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 autoshotgun shell
0x60 00000000 05000450 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 autoshotgun shell
0x64 00000000 050004F8 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 autoshotgun shell
0x68 00000000 05000630 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 autoshotgun shell
0x6C 00000000 050005A0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 autoshotgun shell
[these eight offsets only present on weapons]
[they do not appear on collectables (blueprints, black box, etc.)]
0x70 05000348 00000000 not present 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 watch 0F command
0x74 050002A0 00000000 not present 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 watch boiler cuff
0x78 05000240 00000000 not present 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 watch black tuxedo cuff
0x7C 05000270 00000000 not present 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 watch connery cuff
0x80 050001E0 00000000 not present 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 watch blue cuff
0x84 05000210 00000000 not present 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 watch jungle cuff
0x88 050002D0 00000000 not present 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 watch snowsuit cuff
0x8C 00000000 00000000 not present 00000000 00000000 00000000 00000000 00000000 00000000 not present 00000000 050001E0 pp7 silencer
-------------------
-------------------
Pchr-Z Item Models
---------------
Item pickups - especially weapons - differ slightly from other P-Z models insofar as different commands are used.
Most other objects use 02 commands to position pieces in the model. Most item pickups utilize the 15 position command instead. Just like the 02 commands, each command is relative to the last. The breakdown is such:
15 command:
0x0 4 (float) X Position
0x4 4 (float) Y Position
0x8 4 (float) Z Position
0xC 2 command ID number
0xE 2 unknown - probably piece ID number or reserved
0x10 4 (float) unknown
Many use the 04 display type as the primary display list type, and commonly 12 commands are also used. 12 commands are little more than a pointer to other commands, allowing the piece to either be selected independant from the object or selectively deactivated when rendering the object as a whole. Rendering these pieces is optional in most cases.
04 command:
0x0 4 offset to primary mapping
0x4 4 offset to secondary mapping
0x8 4 reserved
0xC 4 offset to point table
0x10 2 number of points in point table
0x12 2 0300 - unknown
12 command:
0x0 4 offset to command in table
0x4 4 reserved
Another command, used with most weapon pickups, is the 0C command. This sets the position and image used for the gunfire flare rendered when the player is using the weapon in 3rd person. The flare appears at the end of the firearm.
0C Command:
0x0 4 (float) X Position
0x4 4 (float) Y Position
0x8 4 (float) Z Position
0xC 4 (float) Width
0x10 4 (float) Height
0x14 4 (float) Depth
0x18 4 offset to image declaration for gunfire (0x847)
0x1C 4 (float) unknown
Occationally type 16 display lists are used. They are a special animation type to build gunfire. These are incredibly simple, despite the animation.
16 command: gunfire
0x0 4 number of flares created (4 points each, 1 04+B1-mapping command for each)
0x4 4 offset to point table
0x8 4 offset to mapping
It renders only one of the flares at a time, then switches to the next flare in the list. Notice this is different from the generic weapon flare when a weapon fires. It is probably the actual gunfire from the weapon. Note that most weapons use image 0x374, but the laser uses 0x851, colourshifted to 00B6FF (light blue). You probably will never render these commands, unless you are building objects or creating a port/clone.
Weapon pickups also utilize three offsets at the beginning of the file, not all of which are set for every weapon.
0x0 offset to 0C gunfire command in table
0x4 offset to 15 position command for gunfire animation
0x8 offset to 12 reference command for gunfire animation
Notice only weapons - and certain weapons at that - specify a special gunfire animation or flare when firing. When not present, these fields are left NULL (00000000).
@@ -1 +0,0 @@
f5beca60b52c97deeac9254efcb030ec12ef9dbd
@@ -0,0 +1,93 @@
Every object and room requires different kinds of data in order to be rendered. The bare minimum requirement is a list of points in the model and a display list that maps those points.
Goldeneye Point Table Structure
Most N64 games follow this structure. It contains x, y, z data, as well as s/t coordinates to map textures to the surface and an RGBA value blended between the points composing the triangles.
offset size data type usage
0x0 2 signed short x coordinate
0x2 2 signed short y coordinate
0x4 2 signed short z coordinate
0x6 2 signed short reserved (0000)
0x8 2 signed short s value (x image mapping component)
0xA 2 signed short t value (y image mapping value)
0xC 1 unsigned byte Red Component, from 00-FF
0xD 1 unsigned byte Green Component, from 00-FF
0xE 1 unsigned byte Blue Component, from 00-FF
0xF 1 unsigned byte Alpha Component, from 00 (invisible) to FF (opaque)
Sample: FFE0 0000 0020 0000 0020 0020 FFFFFFFF
S/t coordinates are used for texture mapping. Unfortunately, the values are intimately tied to the image's own dimentions. There are several common mapping modes, including mirrorred, clamped, and tiled.
First, lets build a 32x32 square from these four points...
0000 0000 0020 0000 0000 0000 FF0000FF
0020 0000 0020 0000 0020 0000 00FF00FF
0020 0000 0000 0000 0020 FFE0 0000FFFF
0000 0000 0000 0000 0000 FFE0 FFFF00FF
Clockwise, from the upper left, the square is red, green, blue, and yellow. Notice the mapping coordinates already set. The s values match the x values for the square. However, the t values are negative. Negative s or t values naturally mirror the image on that axis. So, the image should appear inverted.
Now, to actually apply an image. Lets assume a greyscale image, 32x32 to match the square. When applied, it will fit precisely, albeit upside-down because of the t values. If the colour combining mode is active, the image will also be colourized to match the lighting of the square, red, blue, green, and yellow.
However, if the image is 64x64, it doesn't fit precisely on the square. Ordinarily, you will only see the upper-left corner of the image. To fit precisely, the 0020 needs to be 0040, and FFE0 changed to FFC0.
Lets try a 16x16 image now. For this example, the tile flag is assumed to be set. The image will repeat after being textured, so instead of seeing one image, four are mapped to the square! Without tiling set but with active clamps, it is more likely the image will be stretched to fit.
Imagine, for a minute, that you wish to draw four triangles, all meeting at a centerpoint, but still want the 32x32 texture to map perfectly to the surface. This is easy enough. The point list will look like so:
0000 0000 0020 0000 0000 0000 FF0000FF //ul
0020 0000 0020 0000 0020 0000 00FF00FF //ur
0020 0000 0000 0000 0020 FFE0 0000FFFF //lr
0000 0000 0000 0000 0000 FFE0 FFFF00FF //ll
0010 0000 0010 0000 0010 FFF0 FFFFFFFF //center
Notice the centerpoint chose mapping pins in the center of the image. Conforming to the image's properties ensures the image is rendered correctly.
Image sizes and other properties can be found in SubDrag's image index.
-------------
04 point table offset command
The RSP 04 command is used to set the offset within a point table. At most, 16 points can be declared at one time. Functionally, rooms and objects will be concidered seperately.
Rooms are the simplest case. The offset command is a literal offset within the point data file. You can expect:
04F00100 00000000
to grab the first 16 entries at the beginning of the point table. The 0100 indicates, in bytes, how much data is being copied. If only 8 points are being pulled, the command would look like this:
04700080 00000000
The offset is a literal offset in the point data binary. For instance,
04F00100 00000100
grabs the next 0x100 bytes at file offset 0x100. To get the next 5 points, you would use this:
04400050 00000200
-and the next 10 points...
049000A0 00000250
Objects are more difficult. Each offset is relative to the pointer set by the display list command. In other words-
04F00100 04000000
-would load the first 16 points and 0x100 bytes from the beginning of the display list's point table.
05 offsets can also be used to specificly state the offset within the file to start pulling points from.
-------------
B1 4-triangle draw routine
The primary triangle drawing routine draws up to four at once. This function is unique to Rare's games, so don't expect it to work with other ucodes.
The format is a little unusual, refering to the points in the point table loaded perviously. The values are one nibble long, ranging from 0-F, or point 1 to 16. If all the points are set to 0, that triangle is not drawn. Below, the first point in the triangle is listed as x, the second y, and the third z.
B100zzzz yxyxyxyx
0000000z 000000yx first triangle
000000z0 0000yx00 second triangle
00000z00 00yx0000 third triangle
0000z000 yx000000 fourth triangle
B1000002 00000010 Creates one triangle using points {0,1,2}
B1000042 00003110 Creates two triangles, using points {0,1,2} and {1,3,4}
B1000242 00413110 Creates three triangles; {0,1,2}, {1,3,4}, and {1,4,2}
B1007242 65413110 Creates four triangles; {0,1,2}, {1,3,4}, {1,4,2}, and {5,6,7}
Remember, don't try to use points that were not previously called with the 04 command. If only five points were declared (0-4), then the last example, B1007242 65413110 would be invalid and cause an exception.
-------------
BF single triangle draw routine
These are very infrequently used. They draw only one triangle at a time, again refering to the points in the point table loaded previously. Before each value can be used, they must be divided by 10 (0xA) to return the point index number.
BF000000 00zzyyxx
BF000000 00140A00 Creates a triangle using points {0,1,2}, or 0/A=0, A/A=1, 14/A=2
BF000000 00968C82 Creates a triangle using points {13,14,15}, or 82/A=D, 8C/A=E, 96/A=F
Again, you still can't use points that haven't been loaded with the 04 vertex command.
-------------
@@ -1 +0,0 @@
95a3827bfbdbe04372cf58cdf245546f4c6502e3
@@ -0,0 +1,247 @@
HEAD:
0x0 sunglasses toggle
0x4 distant head toggle
CAM: cctv cameras
0x0 camera position
0x4 glass
0x8 glass dimentions
0xC camera toggle
TV1:
0x0 DL for screen
TV4: note that NULL is used if the screen is not present (ie. only 1-3 screens)
0x0 DL for screen 1
0x4 DL for screen 2
0x8 DL for screen 3
0xC DL for screen 4
RACK: main object is in group 0. position data alone exists for groups 1-4
0x0 position for monitor 1 (pos:grp 0001 0001)
0x4 position for monitor 2 (pos:grp 0002 0002)
0x8 position for monitor 3 (pos:grp 0003 0003)
0xC position for monitor 4 (pos:grp 0004 0004)
AUTOGUN: [note: only first three needed for SWIVEL objects]
0x0 group 0 position position of base
0x4 group 1 position position of horizontal swivel bar (gun mount)
0x8 group 2 position position of vertical swivel point/main body
0xC group 3 position position of autogun turret(s)
0x10 group 4 position position of gunfire; used when only gunfire 1 present
0x14 gunfire 1
0x18 group 5/4 position position of gunfire/object; used on groundgun
0x1C gunfire 2
EYE_DOOR:
0x0 group 0 position base position of door
0x4 group 1 position position for top?
0x8 group 2 position position for bottom?
IRIS_DOOR:
0x0 group 0 position base position of door
0x4 group 1 position position of inner spline
0x8 group 2 position position of outer track
0xC group 3 position position of inner spline
0x10 group 4 position position of outer track
0x14 group 5 position position of inner spline
0x18 group 6 position position of outer track
0x1C group 7 position position of inner spline
0x20 group 8 position position of outer track
0x24 group 9 position position of inner spline
0x28 group A position position of outer track
0x2C group B position position of inner spline
0x30 group C position position of outer track
MENU:
0x0 toggle for tabs on side of folder
0x4 toggle for basic folder
0x8 toggle for FOR YOUR EYES ONLY
0xC toggle for OHMSS
0x10 toggle for CONFIDENTIAL - briefing
0x14 toggle for CONFIDENTIAL - multi
0x18 toggle for CLASSIFIED
0x1C toggle for shadow beneath character image
0x20 toggle for 1st selected file image (Connery)
0x24 toggle for 2st selected file image (Dalton)
0x28 toggle for 3st selected file image (Moore)
0x2C toggle for 4st selected file image (Brosnan)
0x30 toggle for shadow beneath briefing image
0x34 toggle for main folder select screen
0x38 toggle for shadow beneath slot selection pic
0x3C toggle for 1st slot selection pic (Connery)
0x40 toggle for 2st slot selection pic (Dalton)
0x44 toggle for 3st slot selection pic (Moore)
0x48 toggle for 4st slot selection pic (Brosnan)
0x4C toggle for solo stage select
0x50 toggle for solo selection table (stage imgs)
0x54 solo selection table (stage imgs)
0x58 toggle for Dam briefing image
0x5C toggle for Facility briefing image
0x60 toggle for Runway briefing image
0x64 toggle for Surface I briefing image
0x68 toggle for Bunker I briefing image
0x6C toggle for Silo briefing image
0x70 toggle for Frigate briefing image
0x74 toggle for Surface II briefing image
0x78 toggle for Bunker II briefing image
0x7C toggle for Statue briefing image
0x80 toggle for Archives briefing image
0x84 toggle for Streets briefing image
0x88 toggle for Depot briefing image
0x8C toggle for Train briefing image
0x90 toggle for Jungle briefing image
0x94 toggle for Control briefing image
0x98 toggle for Caverns briefing image
0x9C toggle for Cradle briefing image
0xA0 toggle for Aztec briefing image
0xA4 toggle for Egypt briefing image
0xA8 toggle to secondary folder (multi, cheats, briefings)
CAR:
0x0 main object position
0x4 wheel 1 position
0x8 wheel 2 position
0xC wheel 3 position
0x10 wheel 4 position
0x14
0x18 dimentions wheel 1
0x1C dimentions wheel 2
0x20 dimentions wheel 3
0x24 dimentions wheel 4
0x28 dimentions main body
AIRCRAFT:
0x0 main 01 heading
0x4 main position
0x8 forward prop
0xC rear prop
0x10 position for turret
0x14 prop dimention
WIN_DOOR: note that first glass DL is dud, second generates glass
0x0 dimentions of door
0x4 toggle for glass
0x8 dimentions of glass
0xC glass
Generic DUD glass display list:
E7000000 00000000 pipesync
BA000C02 00002000 setothermode.h: bi-level interpretation
B8000000 00000000 enddl
TANK:
0x0 144 main position
0x4 18c position of cupola
0x8 204 group 2 position parent of turret, antennae, etc
0xC 21c group 3 position
0x10 234 group 4 position child of group 3; parent of firing effect
0x14 15c dimentions of tank chassis
0x18 1a4 dimentions of cupolla
0x1C 24c firing effect (0C)
0x20 264 toggle for turret
HAT:
none
STD_OBJ:
none
CHR_OBJ: note when fields aren't present set to NULL
0x0 gunfire
0x4 group 1 position rifles: isolated 15 command
0x8 toggle secondary flare rifles: horizontal flare
RARE:
Unknown Object...
ARM:
0x0 watch hour hand position
0x4 watch minute hand position
0x8 watch second hand position
0xC toggle watch dial face
0x10 boiler suit cuff toggle
0x14 brosnan tux cuff toggle
0x18 connery tux cuff toggle
0x1C blue suit cuff toggle
0x20 jungle suit cuff toggle
0x24 snowsuit cuff toggle
STD_GUN: hands are optional!
0x0 position (15), possibly of ejected shells (projectile weapons only)
0x4 gunfire toggle (on-screen blast from gun barrel)
0x8 gunfire flash position (linked to render for flash)
0xC gunfire position (origin of rendered beam)
0x10 horiz. gunfire flash/special feature position
0x14 hammer position
0x18 position of index [trigger] finger
0x1C position for 09 linked to trigger/slide
0x20 toggle (12) for fingers (first joint)
0x24 toggle (12) for index [trigger] finger
0x28 toggle (12) for 09s linked to tips of middle/ring/pinky fingers
0x2C toggle (12) for thumb
0x30 toggle (12) for flesh of hand
0x34 toggle (12) for arm
0x38 throwing knife toggle
0x3C throwing knife blade toggle
0x40 taser animation display list
0x44 taser animation toggle
0x48 shotgun shell toggle
0x4C shotgun shell toggle
0x50 shotgun shell toggle
0x54 shotgun shell toggle
0x58 shotgun shell toggle
0x5C autoshotgun shell toggle
0x60 autoshotgun shell toggle
0x64 autoshotgun shell toggle
0x68 autoshotgun shell toggle
0x6C autoshotgun shell toggle
//these and below are hand...
0x70 button? 0F type
0x74 boiler arm toggle
0x78 tux arm toggle
0x7C connery arm toggle
0x80 bluesuit arm toggle
0x84 jungle arm toggle
0x88 snowsuit toggle
0x8C toggle (12) for barrel (odd that. Could be to kill entire weapon...)
NULL_OBJ:
N/A
BARREL_GUN: all fields appear valid
same as STD_GUN, except entry #5
...
0x10 rotating barrel
...
UZI_GUN: only first five fields filled; rest appear valid
same as STD_GUN; uses a special flash effect in entry #5
...
0x10 gunfire flash position (linked to plane with second gunfire effect)
...
CTRL:
0x0 primary position data (all commands are its children)
0x4 start button position
0x8 directional pad position
0xC control stick position
0x10 c button position
0x14 c button position
0x18 c button position
0x1C c button position
0x20 a button position
0x24 b button position
0x28 r button position
0x2C l button position
0x30 z button position
0x34 switch for body (12 type)
ACTOR:
0x0 right arm position
0x4 right hand position
0x8 left hand position
0xC left hand position
0x10 head position or placeholder (17)
0x14 right hand position
0x18 hat position
@@ -1 +0,0 @@
ec44caf4e54fc816adfb0be5e4b6ac7a329b00a7
@@ -1 +0,0 @@
93c6b750ba5f70d1e796484cab432e16c4c631cf
@@ -0,0 +1,143 @@
type 01 0x10 main object heading
4 ID command ID
4 child child entry
2 grp1 group 1 ID
2 grp2 group 2 ID
2 TAG
2 RESERVED
type 02 0x1C position
float xpos relative x,y,z position to parent
float ypos
float zpos
1 grp1 command ID
1 grp2 group 2 ID or 0
1 grp3 group 3 ID or -1
1 grp4 group 4 ID or -1
4 child child subcommand TBL offset
float unknown
type 03 ???? unknown type
type 04 0x14 display list
4 DL1 primary display list
4 DL2 secondary display list or NULL
2 grp1 group ID 1
2 grp2 group ID 2
4 PIN point table
2 pinnum # points in block
1 TAG
1 RESERVED
type 05 ???? unknown type
type 06 ???? unknown type
type 07 ???? unknown type
type 08 0x10 distance trigger
float min minimum distance from viewport
float max maximum distance from viewport
4 target display list used when within range
2 TAG
2 RESERVED
type 09 0x24 head/hat placement
float xmin dimentions
float xmax
float ymin
float ymax
float zmin
float zmax
4 head head DL or 17 placeholder
4 neck neckline display list
2 RESERVED
2 TAG
type 0A 0x1C dimentions
4 group
float xmin
float xmax
float ymin
float ymax
float zmin
float zmax
type 0B ???? unknown
type 0C 0x28 gunfire
float xpos could also be xmin/xmax, etc.
float ypos
float zpos
float xdim
float ydim
float zdim
4 imgdecl offset to entry in IMG block for firing effect
float unknown
2 TAG
2 RESERVED
4 RESERVED2
type 0D 0x24 shadow
0x0 float x position. + moves to character's left, - to character's right
0x4 float z position. + moves in front of character, - backward
0x8 float x size (width) width of image from side to side
0xC float z size (length) length of image from forward to back
4 imgdecl offset to entry in IMG block for shadow
4 parent gleans model offset from type01 parent
float unknown
2 TAG
2 RESERVED
type 0E ???? unknown
type 0F 0x1C interlinkage
float xpos
float ypos
float zpos
float unknown1
float unknown2
float unknown3
float unknown4
type 10 ???? unknown
type 11 ???? unknown
type 12 0x8 handle/switch
4 target
2 TAG
2 RESERVED
type 13 ???? unknown
type 14 ???? unknown
type 15 0x14 position - held items, especially
float xpos xyz position relative to parent
float ypos
float zpos
2 grp1 model group 1 ID
2 grp2 model group 2 ID
float unknown
type 16 0x10 display list - simple
2 unknown
2 ID
4 PIN
4 DL
4 RESERVED
type 17 0x4 placeholder for pointer to head
0x0 4 RESERVED
type 18 0x1C display list
4 DL1 primary display list
4 DL2 secondary display list or NULL
4 PIN point table offset
2 PINnum # points in table
2 MRGnum # points in merge table
4 MRG merge table offset
4 USE usage table offset
2 TAG
2 RESERVED
@@ -1 +0,0 @@
cbaa48911dc45bb45a85f7bf44b1e374a5079f45
@@ -1 +0,0 @@
54334b1723adec264303edcaba215eace4e31d87
@@ -0,0 +1,68 @@
Models that Merge Points
------------------------
It isn't as confusing as you think. It only applies to models that use the point usage tables - 18 display lists. Points from one piece in a model can be borrowed by another. No fudging involved. It always really works.
-----------------------
Before rendering the object's display list, you have to change the points used in the point table. The changes are outlined in the 'collision' point table.
Collision Point Table
FF9B 001E FFB2 0000 00000000 FFFF 0000
FF9B FFC8 FFB8 0001 00000000 FFFF 0000
FF9B 004B 00A2 0002 00000000 FFFF 0000
FF9B FFCE 00AB 0003 00000000 FFFF 0000
FFBF 0026 0094 0004 00000000 FFFF 0000
FFF7 0030 FFFC 0005 05000190 000D 0000
FFFC FFDC FFCC 0006 05000190 0011 0000
FFBD FFEB 00AF 0007 00000000 FFFF 0000
0002 000C FFBF 0008 05000190 000F 0000
0003 FFE1 FFEF 0009 05000190 0010 0000
0002 FFE7 0015 000A 05000190 000E 0000
FFFB 0020 FFE1 000B 05000190 000C 0000
Notice how some points have offset values at 0x8. These are offsets to other 18 render commands that you'll steal points from. The short value following the offset (0xA) is the point in the linked 'collision' table that will be used. The fastest thing is to look up the entry in the point usage table, a weird little list of short values. 'Collision' points are the unique points in the piece, and the usage table indicates which points are shared by other points in the model. This sample is the usage list targetted by the point table above.
0xF28: Usage point table for display list linked at 0x190
0020 0016 0017 001A 001B 0014 0015 000C 001E 000D 001F 0018 001C 0019 FFFF FFFF FFFF
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 001D FFFF FFFF FFFF FFFF 0028
002A FFFF 0025 FFFF 002D 002C FFFF FFFF FFFF FFFF FFFF FFFF
Usage tables have one entry for each point in the display list's point table. The first point in the table is the first entry, second the second, etc. If a point is reused then the slot's number is given in the table. For instance, the first point is shared by point 32 (0x20). If you look at the 'collision' point table, there will not be an entry with ID 0x20, but there will be one for 0x0.
Every point in the table is given a number (offset 0x6), but if it isn't present you will need to check the point usage table to see which point is equivalent.
Taking the running example, let's swap out point 05 in the first table with the shared model's point. Point five is:
FFF7 0030 FFFC 0005 05000190 000D 0000
It calls the 18 command at offset 0x190, and merges with point 0xD. The 18 command's data is found at offset 05000F84...
point display struct: 0x190 right shin
0xF84 05005F48 00000000 05000AA8 002E 001A 05000D88 05000F28 0003 0000 00000000
mapping @ 0x5F48
normal point table @ 0xAA8; 2E normal points
collision point table @ 0xD88; 1A collision points
point usage table @ 0xF28
First, check the point usage table to ensure it isn't dummied up somehow. Scan through entries 0-C, and if 000D isn't found, the point will be a unique entry in the list:
0020 0016 0017 001A 001B 0014 0015 000C 001E*000D*001F 0018
Unfortuantely the point is not unique, but it is the same as point 0x9. So, search the 'collision' point list for the new position:
0x9 FE25 FFE2 FFB5 0009 00000000 FFFF 0000
All you need are the x, y, and z coordinates. These get copied onto the other model's point data.
Remember, because this point is from another piece of the object, you have to make certain that the point's position is corrected for that piece's position, etc. In this example (Bond's right leg) no conversion is necessary; the foot and shin share the same position. Otherwise, determine what positions affect the part you're stealing from and which ones affect the target to determine a global position.
Now, all you have to do is replace the point in the original piece. You copy the new data over point 05's x,y,z data - and anything that shares that point! To see if anything shares the point, you need to refer to the original model's point usage table.
0xA40 FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
Good. The point is unique. Replace the x,y,z of fifth point in the normal point table. That point should now be merged with the leg.
Note:
If the point wasn't unique (something else used point five) you would change it and any entry that refers to it. Say the table looked more like this:
FFFF FFFF FFFF FFFF FFFF 0006 0007 0008 FFFF
Order of operations: point five is shared by point 6. Point 7 is set after point 6 is corrected, so it is also the same as 5. Point 8 is also sharing point 7's corrected data, so it is the same as 5.
-------------------------
Another note:
The plane *does not* use merging. Any render problems are due to some other sizing issue. No points in the collision table use offsets.
I haven't ID'd any objects that use merging yet, but the same rules apply. Undoubtedly there must be a few...
@@ -1 +0,0 @@
c2cb409a4de3d40eb0c3c8810a65f740219911d7
@@ -0,0 +1,154 @@
Memory locations - decompressed in ROM
First ROM offset is given, then relative offset, size, and description
29E560 02000000 0x18 unknown - RGB values?
29E580 02000020 0xAB8
0x0 RA 16bit 64x16 (21)
0x800 RA 16bit 32x10
29F040 02000AE0 0xAB8
0x0 RE 16bit 64x16 (21)
0x800 RE 16bit 32x10
29FB00 020015A0 0xAB8
0x0 RE 16bit 64x16 (21)
0x800 RE 16bit 32x10
2A05C0 02002060 0xAB8
0x0 WA 16bit 64x16 (21)
0x800 WA 16bit 32x10
2A1078 02002B18 0x18D0 vertex table
2A2948 020043E8 0xC8 blue DL
2A2A10 020044B0 0x2A8 text DL
2A2CB8 02004758 0x888 gold DL
2A3548 02004FE8 0x1000 blue 16bit 64x32
2A4550 02005FF0 0x800 gold 16bit 32x32
Special Note:
Two types of image commands may be used in these display lists.
FD commands may either use a relative data pointer (02xxxxxx) or physical data pointer (80xxxxxx/7Fxxxxxx) as usual.
You may also declare and load an image bank image using the code:
ABCD 0xxx
ABCD indicates to load the following short image ID to memory and link it here.
Also, images above contain mipmaps of varying sizes pregenerated. Emulators will select the primary and console, due to distances, will use a mipmap.
To alter this behaviour requires removing the mipmapping usage.
<_>
7F0084C0 3CFF0 Load Rare logo display lists
//7F0089AC 3D4DC blue DL + text line
3C0E0200 LUI T6,0200
25CE43E8 ADDIU T6,T6,43E8 ;T6=020043E8: int. off. to blue DL
3C060600 LUI A2,0600
02001025 OR V0,S0,R0
ACE60000 SW A2,0000 (A3) ;A2->uDL: 06000000 - branchdl
ACEE0004 SW T6,0004 (A3) ;T6->lDL: 020043E8 - blue DL
26100008 ADDIU S0,S0,0008
3C0F0200 LUI T7,0200
25EF44B0 ADDIU T7,T7,44B0 ;T7=020044B0: int. off. to text DL
02001825 OR V1,S0,R0
AC4F0004 SW T7,0004 (V0) ;T7->lDL: 020044B0 - text DL
AC460000 SW A2,0000 (V0) ;A2->uDL: 06000000 - branchdl
3C180200 LUI T8,0200
27185FF0 ADDIU T8,T8,5FF0 ;T8=02005FF0: int. off. to images
26100008 ADDIU S0,S0,0008
02002025 OR A0,S0,R0
AC780004 SW T8,0004 (V1) ;T8->lDL: 02005FF0 - gold image
AC6B0000 SW T3,0000 (V1) ;T3->uDL: FD100000 - loadimg
26100008 ADDIU S0,S0,0008
02002825 OR A1,S0,R0
26100008 ADDIU S0,S0,0008
AC8D0004 SW T5,0004 (A0) ;T5->lDL: 07014050 - tile 7 S: shift 0 mask 5 T: shift 0 mask 5
AC8C0000 SW T4,0000 (A0) ;T4->uDL: F5100000 - settile 16bit RGBA line 0 tmem 0 palette 0
02005025 OR T2,S0,R0
26100008 ADDIU S0,S0,0008
ACA00004 SW R0,0004 (A1)
ACBF0000 SW RA,0000 (A1)
3C19073F LUI T9,073F
3739F100 ORI T9,T9,F100 ;T9=0x073FF100:
02001025 OR V0,S0,R0
240700FF ADDIU A3,R0,00FF ;A3=0xFF
AD590004 SW T9,0004 (T2)
AD510000 SW S1,0000 (T2)
26100008 ADDIU S0,S0,0008
3C0F0001 LUI T7,0001
35EF4050 ORI T7,T7,4050 ;T7=0x00014050:
02001825 OR V1,S0,R0
AC400004 SW R0,0004 (V0)
AC490000 SW T1,0000 (V0)
AC6F0004 SW T7,0004 (A2)
00087900 SLL T7,T0,0x4
01E87823 SUBU T7,T7,T0
000F7900 SLL T7,T7,0x4
01E7001A DIV T7,A3
3C0EF510 LUI T6,F510
35CE1000 ORI T6,T6,1000 ;T6=F5101000
26100008 ADDIU S0,S0,0008
02002025 OR A0,S0,R0
AC6E0000 SW T6,0000 (V1)
3C190007 LUI T9,0007
3739C07C ORI T9,T9,C07C ;T7=0x0007C07C
26100008 ADDIU S0,S0,0008
3C18F200 LUI T8,F200
AC980000 SW T8,0000 (A0)
AC990004 SW T9,0004 (A0)
02002825 OR A1,S0,R0
3C0EFA00 LUI T6,FA00
ACAE0000 SW T6,0000 (A1)
00087080 SLL T6,T0,0x2
01C87023 SUBU T6,T6,T0
000E7080 SLL T6,T6,0x2
01C87021 ADDU T6,T6,T0
000E7100 SLL T7,T6,0x0
00003012 MFLO A2
30D800FF ANDI T8,A2,00FF
03003025 OR A2,T8,R0
01C7001A DIV T6,A3
0018CE00 SLL T9,T8,0x10
26100008 ADDIU S0,S0,0008
14E00002 BNE A3,R0,0002
00000000 NOP
0007000D BREAK 01C00
2401FFFF ADDIU AT,R0,FFFF
14E10004 BNE A3,AT,0004
3C018000 LUI AT,8000
15E10002 BNE A3,AT,0002
00000000 NOP
0006000D BREAK 01800
00007812 MFLO T7
31F800FF ANDI T9,T7,00FF
14E00002 BNE A3,R0,0002
00000000 NOP
0007000D BREAK 01C00
2401FFFF ADDIU AT,R0,FFFF
14E10004 BNE A3,AT,0004
3C018000 LUI AT,8000
15C10002 BNE T6,AT,0002
00000000 NOP
0006000D BREAK 01800
00187400 SLL T7,18,0x10
032E7825 OR T7,T9,T6
0006C200 SLL T8,A2,0x8
01F8C825 OR T9,T7,T9
372E00FF ORI T6,T9,00FF
ACAE0004 SW T6,0004 (A1)
//7F008B28 3D658 load gold DL
3C180200 LUI T8,0200
02001825 OR V1,S0,R0
27184758 ADDIU T8,T8,4758 ;T8=0x02004758
3C0F0600 LUI T7,0600
AC6F0000 SW T7,0000 (V1) ;T7->uDL: 06000000 - branchdl
AC780004 SW T8,0004 (V1) ;T8->lDL: 02004758 - gold DL
8FBF0034 LW RA,0034 (SP)
26020008 ADDIU V0,S0,0008
8FB0002C LW S0,002C (SP)
8FB10030 LW S1,0030 (SP)
03E00008 JR RA
27BD00E8 ADDIU SP,SP,00E8
7F00XXXX 3D688 loads the RareWare logo
// 3D6E8 ROM offset
3C05002A LUI A1,002A
AC440000 SW A0,0000 (V0)
24A5E560 ADDIU A1,A1,E560 ;A1=0x29E560: RAREWARE logo
0C001707 JAL 70005C1C
3B06003F ANDI A2,T8,003F
@@ -1 +0,0 @@
ed67877b9f2659691cd936eb68abc41558526520
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

@@ -1 +0,0 @@
83e7da55678bb955a5a9de22a200df6a47070eeb
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

@@ -1 +0,0 @@
b11ec77e20514b4f48e3fce4e518b0145cc67811
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

@@ -1 +0,0 @@
303b29941ba396d2de1a882fce013dc1b5e4af83
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

@@ -1 +0,0 @@
58f387867e08533152e1c623afbbb3a708df23f8
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

@@ -1 +0,0 @@
6c730218e1d48441334c12cb68d6adad9611b90b
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

@@ -1 +0,0 @@
061beaf224e3a85f996dddec7617f0f0c3aefe9c
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

@@ -1 +0,0 @@
79c2f89167786bbbf167212c762763fc19d04ae4
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

@@ -1 +0,0 @@
dcb2a9f17d94831294f4e7939fd0b7b8a1d351c9
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

@@ -1 +0,0 @@
05a401b7928794cb29a61cd7cfa2d82630b6e648
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

@@ -1 +0,0 @@
203393d444e1d45ec2a7dd9e01e36f893724d0a3
@@ -0,0 +1,607 @@
header:
00000000 8003D400 00000000 00070015
44A0A1BD 0000000D 00000000 00000000
21 models; 7 offsets, 13 images
offsets: (7)
0x0 05000460 //left arm
0x4 05000478 //left hand
0x8 050005E0 //right hand
0xC 050005E0 //right gun
0x10 05000418 //head
0x14 05000478 //left gun
0x18 050003D0 //hat
images: (D)
0x1C 0000063B 20300400 02020200
0x28 0000065C 20200600 02000000
0x34 0000064D 20200600 02020200
0x40 00000650 20200600 02020200
0x4C 00000653 20200600 02020200
0x58 00000656 20200600 02020200
0x64 00000649 20200600 02000000
0x70 0000065B 20300400 02000200
0x7C 0000065E 20200600 02000000
0x88 0000065F 30200400 02020000
0x94 00000810 20300400 02000200
0xA0 00000644 01010100 02000000
0xAC 000007BC 20200600 01000000
Table:
0xB8 00010000 05000820 00000000 00000000 00000000 050000D0
0xD0 00020000 05000830 050000B8 05000808 00000000 050000E8
0xE8 00020000 0500084C 050000D0 05000250 00000000 05000100
0x100 01020000 05000868 050000E8 050001D8 00000000 05000118
0x118 00020000 05000884 05000100 05000160 00000000 05000130
0x130 000A0000 050008A0 05000118 00000000 00000000 05000148
0x148 00180000 05000A58 05000130 00000000 00000000 00000000 //right foot
0x160 000A0000 05000A78 05000100 00000000 05000118 05000178
0x178 00080000 05000A94 05000160 050001A8 00000000 05000190
0x190 00180000 05000F84 05000178 00000000 00000000 00000000 //right shin
0x1A8 00080000 05000FA4 05000160 00000000 05000178 050001C0
0x1C0 00180000 050010EC 050001A8 00000000 00000000 00000000 //right shin (distance)
0x1D8 000A0000 0500110C 050000E8 00000000 05000100 050001F0
0x1F0 00080000 05001128 050001D8 05000220 00000000 05000208
0x208 00180000 05001794 050001F0 00000000 00000000 00000000 //right leg
0x220 00080000 050017B4 050001D8 00000000 050001F0 05000238
0x238 00180000 05001944 05000220 00000000 00000000 00000000 //right leg (distance)
0x250 00020000 05001964 050000D0 050003B8 050000E8 05000268
0x268 01020000 05001980 05000250 05000340 00000000 05000280
0x280 00020000 0500199C 05000268 050002C8 00000000 05000298
0x298 000A0000 050019B8 05000280 00000000 00000000 050002B0
0x2B0 00180000 05001B70 05000298 00000000 00000000 00000000 //left foot
0x2C8 000A0000 05001B90 05000268 00000000 05000280 050002E0
0x2E0 00080000 05001BAC 050002C8 05000310 00000000 050002F8
0x2F8 00180000 050020C0 050002E0 00000000 00000000 00000000 //left shin
0x310 00080000 050020E0 050002C8 00000000 050002E0 05000328
0x328 00180000 05002224 05000310 00000000 00000000 00000000 //left shin (distance)
0x340 000A0000 05002244 05000250 00000000 05000268 05000358
0x358 00080000 05002260 05000340 05000388 00000000 05000370
0x370 00180000 05002914 05000358 00000000 00000000 00000000 //left leg
0x388 00080000 05002934 05000340 00000000 05000358 050003A0
0x3A0 00180000 05002AC4 05000388 00000000 00000000 00000000 //left leg (distance)
0x3B8 01020000 05002AE4 050000D0 05000790 05000250 050003D0
0x3D0 00020000 05002B00 050003B8 05000448 00000000 050003E8
0x3E8 000A0000 05002B1C 050003D0 00000000 00000000 05000400
0x400 00090000 05002B38 050003E8 00000000 00000000 05000418
0x418 00170000 05002B5C 05000400 05000430 00000000 00000000 //head placeholder
0x430 00180000 05002E0C 05000400 00000000 05000418 00000000 //front collar
0x448 00020000 05002E2C 050003B8 050005B0 050003D0 05000460
0x460 01020000 05002E48 05000448 05000538 00000000 05000478
0x478 00020000 05002E64 05000460 050004C0 00000000 05000490
0x490 000A0000 05002E80 05000478 00000000 00000000 050004A8
0x4A8 00180000 050030F0 05000490 00000000 00000000 00000000 //right hand
0x4C0 000A0000 05003110 05000460 00000000 05000478 050004D8
0x4D8 00080000 0500312C 050004C0 05000508 00000000 050004F0
0x4F0 00180000 0500356C 050004D8 00000000 00000000 00000000 //right forearm
0x508 00080000 0500358C 050004C0 00000000 050004D8 05000520
0x520 00180000 050036B0 05000508 00000000 00000000 00000000 //right forearm (distance)
0x538 000A0000 050036D0 05000448 00000000 05000460 05000550
0x550 00080000 050036EC 05000538 05000580 00000000 05000568
0x568 00180000 05003AB4 05000550 00000000 00000000 00000000 //right arm
0x580 00080000 05003AD4 05000538 00000000 05000550 05000598
0x598 00180000 05003C1C 05000580 00000000 00000000 00000000 //right arm (distance)
0x5B0 00020000 05003C3C 050003B8 05000718 05000448 050005C8
0x5C8 01020000 05003C58 050005B0 050006A0 00000000 050005E0
0x5E0 00020000 05003C74 050005C8 05000628 00000000 050005F8
0x5F8 000A0000 05003C90 050005E0 00000000 00000000 05000610
0x610 00180000 05003F00 050005F8 00000000 00000000 00000000 //left hand
0x628 000A0000 05003F20 050005C8 00000000 050005E0 05000640
0x640 00080000 05003F3C 05000628 05000670 00000000 05000658
0x658 00180000 0500437C 05000640 00000000 00000000 00000000 //left forearm
0x670 00080000 0500439C 05000628 00000000 05000640 05000688
0x688 00180000 050044C0 05000670 00000000 00000000 00000000 //left forearm (distance)
0x6A0 000A0000 050044E0 050005B0 00000000 050005C8 050006B8
0x6B8 00080000 050044FC 050006A0 050006E8 00000000 050006D0
0x6D0 00180000 050048C4 050006B8 00000000 00000000 00000000 //left arm
0x6E8 00080000 050048E4 050006A0 00000000 050006B8 05000700
0x700 00180000 05004A2C 050006E8 00000000 00000000 00000000 //left arm (distance)
0x718 000A0000 05004A4C 050003B8 00000000 050005B0 05000730
0x730 00080000 05004A68 05000718 05000760 00000000 05000748
0x748 00180000 0500541C 05000730 00000000 00000000 00000000 //chest
0x760 00080000 0500543C 05000718 00000000 05000730 05000778
0x778 00180000 050056B8 05000760 00000000 00000000 00000000 //chest (distance)
0x790 000A0000 050056D8 050000D0 00000000 050003B8 050007A8
0x7A8 00080000 050056F4 05000790 050007D8 00000000 050007C0
0x7C0 00180000 05005C48 050007A8 00000000 00000000 00000000 //waist
0x7D8 00080000 05005C68 05000790 00000000 050007A8 050007F0
0x7F0 00180000 05005E98 050007D8 00000000 00000000 00000000 //waist (distance)
0x808 000D0000 05005EB8 050000B8 00000000 050000D0 00000000
-
01:B8 {02:D0 {02:E8 {02:100 {02:118 {0A:130 {18:148}}
0A:160 {08:178 {18:190}
08:1A8 {18:1C0}}
}
0A:1D8 {08:1F0 {18:208}
08:220 {18:238}
}
}
02:250 {02:268 {02:280 {0A:298 {18:2B0}}
{0A:2C8 {08:2E0 {18:2F8}
08:310 {18:328}}
}
0A:340 {08:358 {18:370}
08:388 {18:3A0}
}
}
02:3B8 {02:3D0 {0A:3E8 {09:400 {17:418
18:430}}
}
}
02:448 {02:460 {02:478 {0A:490 {18:4A8}}
0A:4C0 {08:4D8 {18:4F0}
08:508 {18:520}}
}
0A:538 {08:550 {18:568}
08:580 {18:598}}
}
02:5B0 {02:5C8 {02:5E0 {0A:5F8 {18:610}}
0A:628 {08:640 {18:658}
08:670 {18:688}}
}
0A:6A0 {08:6B8 {18:6D0}
08:6E8 {18:700}}
0A:718 {08:730 {18:748}
08:760 {18:778}}
}
0A:790 {08:7A8 {18:7C0}
08:7D8 {18:7F0}}
}
0D:808}
-
superheading: 0xB8
0x820 00000004 050000D0 00000000 00000000
position: 0xD0 complete body
0x830 00000000 00000000 00000000 0001 0005 FFFF FFFF 050000E8 439FB526
0 0 0
319.415222
position: 0xE8 complete right leg
0x84C C2BD40D3 C2D455B8 00000000 000B 0006 FFFF FFFF 05000100 43F16463
-94.626610 -106.167419 0
482.784271
position: 0x100 right foot+right shin
0x868 C3E0BD2F C102FE8A 00000000 000D 0007 0009 FFFF 05000118 43FC7B17
-449.477997 -8.187143 0
504.961639
position: 0x118 right leg
0x884 C3F1CD0B C0AEBA1D 00000000 000F 0008 FFFF FFFF 00000000 434CE4F4
-483.601898 -5.460219 0
204.894348
dimentions: 0x130 right foot
0x8A0 00000004
C2CA0000 40400000
C2600000 42960000
C29C0000 432F0000
point display struct: 0x148 right foot
0xA58 05005ED8 00000000 050008C0 000C 000C 05000980 05000A40 0003 0000 00000000
mapping @ 0x5ED8
normal point table @ 0x8C0; C normal points
collision point table @ 0x980; C collision points
point usage table @ 0xA40
dimentions: 0x160 right shin
0xA78 00000005
C3F88000 41F80000
C2A60000 429E0000
C2B20000 42AE0000
distance: 0x178
0xA94 00000000 4647B000 05000190 00000000
point display struct: 0x190 right shin
0xF84 05005F48 00000000 05000AA8 002E 001A 05000D88 05000F28 0003 0000 00000000
mapping @ 0x5F48
normal point table @ 0xAA8; 2E normal points
collision point table @ 0xD88; 1A collision points
point usage table @ 0xF28
distance: 0x1A8
0xFA4 4647B000 4DCB21F4 050001C0 00000000
point display struct: 0x1C0 right shin (distance)
0x10EC 05006030 00000000 05000FB8 000A 0008 05001058 050010D8 0003 0000 00000000
mapping @ 0x6030
normal point table @ 0xFB8; A normal points
collision point table @ 0x1058; 8 collision points
point usage table @ 0x10D8
dimentions: 0x1D8
0x110C 00000006
C3ED0000 42BE0000
C2BE0000 429C0000
C2C40000 42FC0000
distance: 0x1F0
0x1128 00000000 4647B000 05000208 00000000
point display struct: 0x208 right leg
0x1794 05006098 00000000 05001138 003E 0020 05001518 05001718 0003 0000 00000000
mapping @ 0x6098
normal point table @ 0x1138; 3E normal points
collision point table @ 0x1518; 20 collision points
point usage table @ 0x1718
distance: 0x220
0x17B4 4647B000 4DCB21F4 05000238 00000000
point display struct: 0x238 right leg (distance)
0x1944 050061D8 00000000 050017C8 000E 0008 050018A8 05001928 0003 0000 00000000
mapping @ 0x61D8
normal point table @ 0x17C8; E normal points
collision point table @ 0x18A8; 8 collision points
point usage table @ 0x1928
position: 0x250
0x1964 42CAFE38 C2CF8EF7 00000000 000A 000A FFFF FFFF 05000268 43F2C96D
101.496521 -103.779228 0
485.573639
position: 0x268
0x1980 43D9E04D C154FE48 00000000 000C 000B 000D FFFF 05000280 44024CC0
435.752350 -13.312080 0
521.199219
position: 0x280
0x199C 43F8EC2F C08F40CF 00000000 000E 000C FFFF FFFF 00000000 434E1293
497.845184 -4.476661 0
206.072556
dimentions: 0x298
0x19B8 00000001
BF800000 42CC0000
C2640000 42960000
C29C0000 432F0000
point display struct: 0x2B0 left foot
0x1B70 05006240 00000000 050019D8 000C 000C 05001A98 05001B58 0003 0000 00000000
mapping @ 0x6240
normal point table @ 0x19D8; C normal points
collision point table @ 0x1A98; C collision points
point usage table @ 0x1B58
dimentions: 0x2C8
0x1B90 00000002
C1700000 44004000
C2AE0000 429A0000
C2B20000 42AE0000
distance: 0x2E0
0x1BAC 00000000 4647B000 050002F8 00000000
point display struct: 0x2F8 left shin
0x20C0 050062B0 00000000 05001BC0 0030 001A 05001EC0 05002060 0003 0000 00000000
mapping @ 0x62B0
normal point table @ 0x1BC0; 30 normal points
collision point table @ 0x1EC0; 1A collision points
point usage table @ 0x2060
distance: 0x310
0x20E0 4647B000 4DCB21F4 05000328 00000000
point display struct: 0x328 left shin (distance)
0x2224 05006398 00000000 050020F0 000A 0008 05002190 05002210 0003 0000 00000000
mapping @ 0x6398
normal point table @ 0x20F0; A normal points
collision point table @ 0x2190; 8 collision points
point usage table @ 0x2210
dimentions: 0x340
0x2244 00000003
C2CC0000 43EE0000
C2CC0000 429E0000
C2C40000 42FC0000
distance: 0x358
0x2260 00000000 4647B000 05000370 00000000
point display struct: 0x370 left leg
0x2914 05006400 00000000 05002270 0042 0020 05002690 05002890 0003 0000 00000000
mapping @ 0x6400
normal point table @ 0x2270; 42 normal points
collision point table @ 0x2690; 20 collision points
point usage table @ 0x2890
distance: 0x388
0x2934 4647B000 4DCB21F4 050003A0 00000000
point display struct: 0x3A0 left leg (distance)
0x2AC4 05006538 00000000 05002948 000E 0008 05002A28 05002AA8 0003 0000 00000000
mapping @ 0x6538
normal point table @ 0x2948; E normal points
collision point table @ 0x2A28; 8 collision points
point usage table @ 0x2AA8
position: 0x3B8
0x2AE4 3F9D6367 427824EC 00000000 0002 0001 0014 FFFF 050003D0 43E3A383
1.229596 62.036057 0
455.277435
position: 0x3D0
0x2B00 C02A90A3 43EBEEA3 00000000 0003 0000 FFFF FFFF 00000000 435474E2
-2.665078 471.864349 0
212.456573
dimentions: 0x3E8
0x2B1C 00000008
C2A00000 42A20000
C2DE0000 432C0000
C29E0000 43090000
head placement: 0x400
0x2B38 C076F8D7 C28EE1D4 433BF051 3E56C615 C19FA475 C0EE3F98 05000418 05000430 00000000
//ties to 0x418(type 17) and 0x430 (type 18 display list - front collar)
offset to head: 0x418
0x2B5C 00000000
point display struct: 0x430 front collar
0x2E0C 050065A0 00000000 05002B60 0016 0012 05002CC0 05002DE0 0003 0000 00000000
mapping @ 0x65A0
normal point table @ 0x2B60; 16 normal points
collision point table @ 0x2CC0; 12 collision points
point usage table @ 0x2DE0
position: 0x448
0x2E2C 4353B63D 43880BD6 00000000 0004 0002 FFFF FFFF 05000460 43787589
211.711868 272.092468 0
248.459122
position: 0x460
0x2E48 435A1BA3 428594A7 4107070C 0006 000E 0010 FFFF 05000478 43887949
218.107956 66.790337 8.439220
272.947540
position: 0x478
0x2E64 437ACDBB 3E82AEB0 40F1F6FF 0008 000F FFFF FFFF 00000000 430F0027
250.803635 0.255239 7.561401
143.000595
dimentions: 0x490
0x2E80 00000009
41100000 43020000
C2040000 42480000
C2540000 424C0000
point display struct: 0x4A8 right hand
0x30F0 05006650 00000000 05002EA0 0018 000A 05003020 050030C0 0003 0000 00000000
mapping @ 0x6650
normal point table @ 0x2EA0; 18 normal points
collision point table @ 0x3020; A collision points
point usage table @ 0x30C0
dimentions: 0x4C0
0x3110 0000000A
C0E00000 43868000
C2A00000 42300000
C25C0000 42A60000
distance: 0x4D8
0x312C 00000000 4647B000 050004F0 00000000
point display struct: 0x4F0 right forearm
0x356C 050066F8 00000000 05003140 0026 0018 050033A0 05003520 0003 0000 00000000
mapping @ 0x66F8
normal point table @ 0x3140; 26 normal points
collision point table @ 0x33A0; 18 collision points
point usage table @ 0x3520
distance: 0x508
0x358C 4647B000 4DCB21F4 05000520 00000000
point display struct: 0x520 right forearm (distance)
0x36B0 050067E8 00000000 050035A0 0008 0008 05003620 050036A0 0003 0000 00000000
mapping @ 0x67E8
normal point table @ 0x35A0; 8 normal points
collision point table @ 0x3620; 8 collision points
point usage table @ 0x36A0
dimentions: 0x538
0x36D0 0000000B
C2EA0000 435C0000
C2340000 42E20000
C2640000 42B60000
distance: 0x550
0x36EC 00000000 4647B000 05000568 00000000
point display struct: 0x568 right arm
0x3AB4 05006850 00000000 05003700 0021 0016 05003910 05003A70 0003 0000 00000000
mapping @ 0x6850
normal point table @ 0x3700; 21 normal points
collision point table @ 0x3910; 16 collision points
point usage table @ 0x3A70
distance: 0x580
0x3AD4 4647B000 4DCB21F4 05000598 00000000
point display struct: 0x598 right arm (distance)
0x3C1C 05006920 00000000 05003AE8 000A 0008 05003B88 05003C08 0003 0000 00000000
position: 0x5B0
0x3C3C C348FD21 438AD798 00000000 0005 0003 FFFF FFFF 050005C8 4380E125
-200.988785 277.684326 0
257.758942
position: 0x5C8
0x3C58 C35E742B 4274E7D1 00000000 0007 0011 0013 FFFF 050005E0 438B53D1
-222.453781 61.226383 0
278.654816
position: 0x5E0
0x3C74 C38411CD 3FAEB13E 00000000 0009 0012 FFFF FFFF 00000000 4306DABA
-264.139069 1.364784 0
134.854401
dimentions: 0x5F8
0x3C90 0000000C
C2EE0000 3F800000
C1E80000 42580000
C2380000 42680000
point display struct: 0x610 left hand
0x3F00 05006988 00000000 05003CB0 0018 000A 05003E30 05003ED0 0003 0000 00000000
mapping @ 0x6988
normal point table @ 0x3CB0; 18 normal points
collision point table @ 0x3E30; A collision points
point usage table @ 0x3ED0
dimentions: 0x628
0x3F20 0000000D
C3890000 40000000
C2900000 42500000
C2440000 42B20000
distance: 0x640
0x3F3C 00000000 4647B000 05000658 00000000
point display struct: 0x658 left forearm
0x437C 05006A30 00000000 05003F50 0026 0018 050041B0 05004330 0003 0000 00000000
mapping @ 0x6A30
normal point table @ 0x3F50; 26 normal points
collision point table @ 0x41B0; 18 collision points
point usage table @ 0x4330
distance: 0x670
0x439C 4647B000 4DCB21F4 05000688 00000000
point display struct: 0x688 left forearm (distance)
0x44C0 05006B20 00000000 050043B0 0008 0008 05004430 050044B0 0003 0000 00000000
mapping @ 0x6B20
normal point table @ 0x43B0; 8 normal points
collision point table @ 0x4430; 8 collision points
point usage table @ 0x44B0
dimentions: 0x6A0
0x44E0 0000000E
C3600000 42E00000
C24C0000 42D40000
C2600000 42B20000
distance: 0x6B8
0x44FC 00000000 4647B000 050006D0 00000000
point display struct: 0x6D0 left arm
0x48C4 05006B88 00000000 05004510 0021 0016 05004720 05004880 0003 0000 00000000
mapping @ 0x6B88
normal point table @ 0x4510; 21 normal points
collision point table @ 0x4720; 16 collision points
point usage table @ 0x4880
distance: 0x6E8
0x48E4 4647B000 4DCB21F4 05000700 00000000
point display struct: 0x700 left arm (distance)
0x4A2C 05006C58 00000000 050048F8 000A 0008 05004998 05004A18 0003 0000 00000000
mapping @ 0x6C58
normal point table @ 0x48F8; A normal points
collision point table @ 0x4998; 8 collision points
point usage table @ 0x4A18
dimentions: 0x718
0x4A4C 0000000F
C3510000 43520000
C1F80000 43D38000
C2C80000 43140000
distance: 0x730
0x4A68 00000000 4647B000 05000748 00000000
point display struct: 0x748 chest
0x541C 05006CC0 00000000 05004A78 0062 002C 05005098 05005358 0003 0000 00000000
mapping @ 0x6CC0
normal point table @ 0x4A78; 62 normal points
collision point table @ 0x5098; 2C collision points
point usage table @ 0x5358
distance: 0x760
0x543C 4647B000 4DCB21F4 05000778 00000000
point display struct: 0x778 chest (distance)
0x56B8 05006E20 00000000 05005450 001B 0008 05005600 05005680 0003 0000 00000000
mapping @ 0x6E20
normal point table @ 0x5450; 1B normal points
collision point table @ 0x5600; 8 collision points
point usage table @ 0x5680
dimentions: 0x790
0x56D8 00000007
C33F0000 433C0000
C3710000 42B40000
C2BC0000 430F0000
distance: 0x7A8
0x56F4 00000000 4647B000 050007C0 00000000
point display struct: 0x7C0 waist
0x5C48 05006EA0 00000000 05005708 0030 001E 05005A08 05005BE8 0003 0000 00000000
mapping @ 0x6EA0
normal point table @ 0x5708; 30 normal points
collision point table @ 0x5A08; 1E collision points
point usage table @ 0x5BE8
distance: 0x7D8
0x5C68 4647B000 4DCB21F4 050007F0 00000000
point display struct: 0x7F0 waist (distance)
0x5E98 05006F98 00000000 05005C78 0017 0008 05005DE8 05005E68 0003 0000 00000000
mapping @ 0x6F98
normal point table @ 0x5C78; 17 normal points
collision point table @ 0x5DE8; 8 collision points
point usage table @ 0x5E68
shadow: 0x808
0x5EB8 40600000 42000000 43CC4000 43D90000 050000AC 050000B8 441500A8 00000000
3.5 32
408.5 434
image @ 0xAC
main model directory heading @ 0xB8 (target)
596.010254
------------------
01 superheading 4
02 position call 1,5 link position Character
shadow
02 position call B,6 link position Right Leg 01 used to indicate one of five major commands
position call D,7,9 link position R.foot+shin
dimentions 4 R.foot
dimentions 5 R.shin (+distance)
position call F,8 no linkage R.leg
dimentions 6 R.leg (+distance)
02 position call A,A link position Left Leg 01 used to indicate one of five major commands
position call C,B,D link position L.foot+shin
dimentions 1 L.foot
dimentions 2 L.shin (+distance)
position call E,C no linkage L.leg
dimentions 3 L.leg (+distance)
02 position call 2,1,14 link position Upper Body 01 used to indicate one of five major commands
dimentions F chest (+distance)
dimentions 7 waist (+distance)
position call 3,0 no linkage Head and Collar
dimentions 8 head and collar
02 position call 4,2 link position Right Arm 01 used to indicate one of five major commands
position call 6,E,10 link position R.hand+forearm
dimentions 9 R.hand
dimentions A R.forearm (+distance)
position call 8,F no linkage R.arm
dimentions B R.arm (+distance)
02 position call 5,3 link position Left Arm 01 used to indicate one of five major commands
position call 7,11,13 link position L.hand+forearm
dimentions C L.hand
dimentions D L.forearm (+distance)
position call 9,12 no linkage L.arm
dimentions E L.arm (+distance)
@@ -1 +0,0 @@
92c202d1807f36475fcf1a0f89e0256d9ccc7332
@@ -0,0 +1,590 @@
header:
00000000 8003A170 00000000 002B0001
455B087B 00000054 00000000 00000000
84 images; 1 object - 43 offsets
offsets: (43)
0x0 050004E4 //0 handle for tabs on side of folder
0x4 05000514 //1 handle for basic folder
0x8 050005D4 //2 handle for FOR YOUR EYES ONLY
0xC 05000604 //3 handle for OHMSS
0x10 05000634 //4 handle for CONFIDENTIAL - briefing
0x14 05000664 //5 handle for CONFIDENTIAL - multi
0x18 05000694 //6 handle for CLASSIFIED
0x1C 050006C4 //7 handle to shadow beneath character image
0x20 050006F4 //8 handle for 1st selected file image (Brosnan)
0x24 05000724 //9 handle for 2st selected file image (Connery)
0x28 05000754 //A handle for 3st selected file image (Moore)
0x2C 05000784 //B handle for 4st selected file image (Dalton)
0x30 050007CC //C handle to shadow beneath briefing image
0x34 05000BD4 //D handle to main folder select screen
0x38 05000C04 //E handle to shadow beneath slot selection pic
0x3C 05000C34 //F handle for 1st slot selection pic (Brosnan)
0x40 05000C64 //10 handle for 2st slot selection pic (Connery)
0x44 05000C94 //11 handle for 3st slot selection pic (Moore)
0x48 05000CC4 //12 handle for 4st slot selection pic (Dalton)
0x4C 05000574 //13 handle for solo stage select
0x50 050005A4 //14 handle to solo selection table (stage imgs)
0x54 050005BC //15 solo selection table (stage imgs)
0x58 050007FC //16 handle for Dam briefing image
0x5C 0500082C //17 handle for Facility briefing image
0x60 0500085C //18 handle for Runway briefing image
0x64 0500088C //19 handle for Surface I briefing image
0x68 050008BC //1A handle for Bunker I briefing image
0x6C 050008EC //1B handle for Silo briefing image
0x70 0500091C //1C handle for Frigate briefing image
0x74 0500094C //1D handle for Surface II briefing image
0x78 0500097C //1E handle for Bunker II briefing image
0x7C 050009AC //1F handle for Statue briefing image
0x80 050009DC //20 handle for Archives briefing image
0x84 05000A0C //21 handle for Streets briefing image
0x88 05000A3C //22 handle for Depot briefing image
0x8C 05000A6C //23 handle for Train briefing image
0x90 05000A9C //24 handle for Jungle briefing image
0x94 05000ACC //25 handle for Control briefing image
0x98 05000AFC //26 handle for Caverns briefing image
0x9C 05000B2C //27 handle for Cradle briefing image
0xA0 05000B5C //28 handle for Aztec briefing image
0xA4 05000B8C //29 handle for Egypt briefing image
0xA8 05000544 //2A handle to secondary folder (multi, cheats, briefings)
images: (84)
0xAC 00000A26 41410700 00020200 //coat of arms - upper left
0xB8 00000A27 41410700 00020200 //coat of arms - upper right
0xC4 00000A28 41410700 00020200 //coat of arms - lower left
0xD0 00000A29 41410700 00020200 //coat of arms - lower right
0xDC 000003F6 20400700 01020200 //paperclip
0xE8 00000A2A 41410700 00020200 //Brosnan - upper left
0xF4 00000A2B 41410700 00020200 //Brosnan - upper right
0x100 00000A2C 41410700 00020200 //Brosnan - lower left
0x10C 00000A2D 41410700 00020200 //Brosnan - lower right
0x118 00000A43 5F200300 01020200 //OHMSS - left half
0x124 00000A42 40400700 00000000 //dark manilla texture
0x130 00000A45 40400700 00000000 //light manilla texture
0x13C 00000A46 40400700 00020200 //coat of arms on manilla
0x148 00000A40 5F200300 01020200 //FOR -
0x154 00000A3E 5F200300 01020200 //- EYES-
0x160 00000A3F 5F200400 01020200 //- ONLY
0x16C 00000A41 5F200400 01020200 //-YOUR-
0x178 000004FD 20200600 02020200 //shadow of paper
0x184 00000A44 5F200400 01020200 //OHMSS - right half
0x190 00000A3C 5F200300 01020200 //CONFIDENTIAL - left half
0x19C 00000A3D 5F200400 01020200 //CONFIDENTIAL - right half
0x1A8 00000A3A 5F200300 01020200 //CLASSIFIED - left half
0x1B4 00000A3B 5F200400 01020200 //CLASSIFIED - right half
0x1C0 00000A47 10100000 01000000 //filmstrip
0x1CC 000009EA 80400000 00020200 //Archives briefing - top
0x1D8 000009F8 80400000 00020200 //Dam briefing - top
0x1E4 000009F9 80400000 00020200 //Dam briefing - bottom
0x1F0 000009EB 80400000 00020200 //Archives briefing - bottom
0x1FC 000009F0 80400000 00020200 //Aztec briefing - top
0x208 000009F1 80400000 00020200 //Aztec briefing - bottom
0x214 000009F2 80400000 00020200 //Caverns briefing - top
0x220 000009F3 80400000 00020200 //Caverns briefing - bottom
0x22C 000009F4 80400000 00020200 //Cradle briefing - top
0x238 000009F5 80400000 00020200 //Cradle briefing - bottom
0x244 000009F6 80400000 00020200 //Egyptian briefing - top
0x250 000009F7 80400000 00020200 //Egyptian briefing - bottom
0x25C 000009FA 80400000 00020200 //Depot briefing - top
0x268 000009FB 80400000 00020200 //Depot briefing - bottom
0x274 000009FC 80400000 00020200 //Frigate briefing - top
0x280 000009FD 80400000 00020200 //Frigate briefing - bottom
0x28C 000009FE 80400000 00020200 //Jungle briefing - top
0x298 000009FF 80400000 00020200 //Jungle briefing - bottom
0x2A4 00000A00 80400000 00020200 //Streets briefing - top
0x2B0 00000A01 80400000 00020200 //Streets briefing - bottom
0x2BC 00000A02 80400000 00020200 //Runway briefing - top
0x2C8 00000A03 80400000 00020200 //Runway briefing - bottom
0x2D4 00000A04 80400000 00020200 //Bunker I briefing - top
0x2E0 00000A05 80400000 00020200 //Bunker I briefing - bottom
0x2EC 00000A06 80400000 00020200 //Bunker II briefing - top
0x2F8 00000A07 80400000 00020200 //Bunker II briefing - bottom
0x304 00000A08 80400000 00020200 //Surface I briefing - top
0x310 00000A09 80400000 00020200 //Surface I briefing - bottom
0x31C 00000A0A 80400000 00020200 //Surface II briefing - top
0x328 00000A0B 80400000 00020200 //Surface II briefing - bottom
0x334 00000A0C 80400000 00020200 //Silo briefing - top
0x340 00000A0D 80400000 00020200 //Silo briefing - bottom
0x34C 00000A0E 80400000 00020200 //Statue briefing - top
0x358 00000A0F 80400000 00020200 //Statue briefing - bottom
0x364 00000A10 80400000 00020200 //Train briefing - top
0x370 00000A11 80400000 00020200 //Train briefing - bottom
0x37C 000009EE 80400000 00020200 //Facility briefing - top
0x388 000009EF 80400000 00020200 //Facility briefing - bottom
0x394 000009EC 80400000 00020200 //Control briefing - top
0x3A0 000009ED 80400000 00020200 //Control briefing - bottom
0x3AC 00000A12 442C0000 01020200 //Archives stage select
0x3B8 00000A13 442C0000 01020200 //Control stage select
0x3C4 00000A14 442C0000 01020200 //Facility stage select
0x3D0 00000A15 442C0000 01020200 //Aztec stage select
0x3DC 00000A16 442C0000 01020200 //Caverns stage select
0x3E8 00000A17 442C0000 01020200 //Cradle stage select
0x3F4 00000A18 442C0000 01020200 //Egyptian stage select
0x400 00000A19 442C0000 01020200 //Dam stage select
0x40C 00000A1A 442C0000 01020200 //Depot stage select
0x418 00000A1B 442C0000 01020200 //Frigate stage select
0x424 00000A1C 442C0000 01020200 //Jungle stage select
0x430 00000A1D 442C0000 01020200 //Streets stage select
0x43C 00000A1E 442C0000 01020200 //Runway stage select
0x448 00000A1F 442C0000 01020200 //Bunker I stage select
0x454 00000A20 442C0000 01020200 //Bunker II stage select
0x460 00000A21 442C0000 01020200 //Surface I stage select
0x46C 00000A22 442C0000 01020200 //Surface II stage select
0x478 00000A23 442C0000 01020200 //Silo stage select
0x484 00000A24 442C0000 01020200 //Statue stage select
0x490 00000A25 442C0000 01020200 //Train stage select
Table:
0x49C 00020000 05000D0C 00000000 00000000 00000000 050004B4
0x4B4 000A0000 05000D28 0500049C 00000000 00000000 050004CC
0x4CC 00040000 05000DC8 050004B4 050004E4 00000000 00000000
0x4E4 00120000 05000DDC 050004B4 05000514 050004CC 050004FC
0x4FC 00040000 05000F28 050004E4 00000000 00000000 00000000
0x514 00120000 05000F3C 050004B4 05000544 050004E4 0500052C
0x52C 00040000 05001098 05000514 00000000 00000000 00000000
0x544 00120000 050010AC 050004B4 05000574 05000514 0500055C
0x55C 00040000 05001158 05000544 00000000 00000000 00000000
0x574 00120000 0500116C 050004B4 050005D4 05000544 0500058C
0x58C 00040000 05001F28 05000574 050005A4 00000000 00000000
0x5A4 00120000 05001F3C 05000574 00000000 0500058C 050005BC
0x5BC 00180000 050029E8 050005A4 00000000 00000000 00000000
0x5D4 00120000 05002A08 050004B4 05000604 05000574 050005EC
0x5EC 00040000 05002B10 050005D4 00000000 00000000 00000000
0x604 00120000 05002B24 050004B4 05000634 050005D4 0500061C
0x61C 00040000 05002BB0 05000604 00000000 00000000 00000000
0x634 00120000 05002BC4 050004B4 05000664 05000604 0500064C
0x64C 00040000 05002C50 05000634 00000000 00000000 00000000
0x664 00120000 05002C64 050004B4 05000694 05000634 0500067C
0x67C 00040000 05002CF0 05000664 00000000 00000000 00000000
0x694 00120000 05002D04 050004B4 050006C4 05000664 050006AC
0x6AC 00040000 05002D90 05000694 00000000 00000000 00000000
0x6C4 00120000 05002DA4 050004B4 050007CC 05000694 050006DC
0x6DC 00040000 05002E20 050006C4 050006F4 00000000 00000000
0x6F4 00120000 05002E34 050006C4 05000724 050006DC 0500070C
0x70C 00040000 05002F40 050006F4 00000000 00000000 00000000
0x724 00120000 05002F54 050006C4 05000754 050006F4 0500073C
0x73C 00040000 05003060 05000724 00000000 00000000 00000000
0x754 00120000 05003074 050006C4 05000784 05000724 0500076C
0x76C 00040000 05003180 05000754 00000000 00000000 00000000
0x784 00120000 05003194 050006C4 050007B4 05000754 0500079C
0x79C 00040000 050032A0 05000784 00000000 00000000 00000000
0x7B4 00040000 050032F8 050006C4 00000000 05000784 00000000
0x7CC 00120000 0500330C 050004B4 05000BD4 050006C4 050007E4
0x7E4 00040000 05003388 050007CC 050007FC 00000000 00000000
0x7FC 00120000 0500339C 050007CC 0500082C 050007E4 05000814
0x814 00040000 05003428 050007FC 00000000 00000000 00000000
0x82C 00120000 0500343C 050007CC 0500085C 050007FC 05000844
0x844 00040000 050034C8 0500082C 00000000 00000000 00000000
0x85C 00120000 050034DC 050007CC 0500088C 0500082C 05000874
0x874 00040000 05003568 0500085C 00000000 00000000 00000000
0x88C 00120000 0500357C 050007CC 050008BC 0500085C 050008A4
0x8A4 00040000 05003608 0500088C 00000000 00000000 00000000
0x8BC 00120000 0500361C 050007CC 050008EC 0500088C 050008D4
0x8D4 00040000 050036A8 050008BC 00000000 00000000 00000000
0x8EC 00120000 050036BC 050007CC 0500091C 050008BC 05000904
0x904 00040000 05003748 050008EC 00000000 00000000 00000000
0x91C 00120000 0500375C 050007CC 0500094C 050008EC 05000934
0x934 00040000 050037E8 0500091C 00000000 00000000 00000000
0x94C 00120000 050037FC 050007CC 0500097C 0500091C 05000964
0x964 00040000 05003888 0500094C 00000000 00000000 00000000
0x97C 00120000 0500389C 050007CC 050009AC 0500094C 05000994
0x994 00040000 05003928 0500097C 00000000 00000000 00000000
0x9AC 00120000 0500393C 050007CC 050009DC 0500097C 050009C4
0x9C4 00040000 050039C8 050009AC 00000000 00000000 00000000
0x9DC 00120000 050039DC 050007CC 05000A0C 050009AC 050009F4
0x9F4 00040000 05003A68 050009DC 00000000 00000000 00000000
0xA0C 00120000 05003A7C 050007CC 05000A3C 050009DC 05000A24
0xA24 00040000 05003B08 05000A0C 00000000 00000000 00000000
0xA3C 00120000 05003B1C 050007CC 05000A6C 05000A0C 05000A54
0xA54 00040000 05003BA8 05000A3C 00000000 00000000 00000000
0xA6C 00120000 05003BBC 050007CC 05000A9C 05000A3C 05000A84
0xA84 00040000 05003C48 05000A6C 00000000 00000000 00000000
0xA9C 00120000 05003C5C 050007CC 05000ACC 05000A6C 05000AB4
0xAB4 00040000 05003CE8 05000A9C 00000000 00000000 00000000
0xACC 00120000 05003CFC 050007CC 05000AFC 05000A9C 05000AE4
0xAE4 00040000 05003D88 05000ACC 00000000 00000000 00000000
0xAFC 00120000 05003D9C 050007CC 05000B2C 05000ACC 05000B14
0xB14 00040000 05003E28 05000AFC 00000000 00000000 00000000
0xB2C 00120000 05003E3C 050007CC 05000B5C 05000AFC 05000B44
0xB44 00040000 05003EC8 05000B2C 00000000 00000000 00000000
0xB5C 00120000 05003EDC 050007CC 05000B8C 05000B2C 05000B74
0xB74 00040000 05003F68 05000B5C 00000000 00000000 00000000
0xB8C 00120000 05003F7C 050007CC 05000BBC 05000B5C 05000BA4
0xBA4 00040000 05004008 05000B8C 00000000 00000000 00000000
0xBBC 00040000 05004060 050007CC 00000000 05000B8C 00000000
0xBD4 00120000 05004074 050004B4 00000000 050007CC 05000BEC
0xBEC 00040000 050042E0 05000BD4 05000C04 00000000 00000000
0xC04 00120000 050042F4 05000BD4 00000000 05000BEC 05000C1C
0xC1C 00040000 05004370 05000C04 05000C34 00000000 00000000
0xC34 00120000 05004384 05000C04 05000C64 05000C1C 05000C4C
0xC4C 00040000 05004490 05000C34 00000000 00000000 00000000
0xC64 00120000 050044A4 05000C04 05000C94 05000C34 05000C7C
0xC7C 00040000 050045B0 05000C64 00000000 00000000 00000000
0xC94 00120000 050045C4 05000C04 05000CC4 05000C64 05000CAC
0xCAC 00040000 050046D0 05000C94 00000000 00000000 00000000
0xCC4 00120000 050046E4 05000C04 05000CF4 05000C94 05000CDC
0xCDC 00040000 050047F0 05000CC4 00000000 00000000 00000000
0xCF4 00040000 05004848 05000C04 00000000 05000CC4 00000000
2:49C{ A:4B4{ 4:4CC
12:4E4{ 4:4FC}
12:514{ 4:52C}
12:544{ 4:55C}
12:574{ 4:58C
12:5A4{ 18:5BC}}
12:5D4{ 4:5EC}
12:604{ 4:61C}
12:634{ 4:64C}
12:664{ 4:67C}
12:694{ 4:6AC}
12:6C4{ 4:6DC
12:6F4{ 4:70C}
12:724{ 4:73C}
12:754{ 4:76C}
12:784{ 4:79C}
4:7B4}
12:7CC{ 4:7E4
12:7FC{ 4:814}
12:82C{ 4:844}
12:85C{ 4:874}
12:88C{ 4:8A4}
12:8BC{ 4:8D4}
12:8EC{ 4:904}
12:91C{ 4:934}
12:94C{ 4:964}
12:97C{ 4:994}
12:9AC{ 4:9C4}
12:9DC{ 4:9F4}
12:A0C{ 4:A24}
12:A3C{ 4:A54}
12:A6C{ 4:A84}
12:A9C{ 4:AB4}
12:ACC{ 4:AE4}
12:AFC{ 4:B14}
12:B2C{ 4:B44}
12:B5C{ 4:B7C}
12:B8C{ 4:BA4}
4:BBC}
12:BD4{ 4:BEC
12:C04{ 4:C1C
12:C34{ 4:C4C}
12:C64{ 4:C7C}
12:C94{ 4:CAC}
12:CC4{ 4:CDC}
4:CF4}}}}
0xD0C 02 position (0x49C)
C364EBBF 4340F1B8 C2480000 0000 0000 FFFF FFFF 00000000 455B087B
0xD28 0A dimentions (0x4B4)
00000001
C50C0000 450C0000
C5285000 45285000
C2C80000 42C80000
0xDC8 04 display list (0x4CC) [dark manilla backdrop]
05004860 00000000 0000 0000 05000D48 0008 0000
point table @ 0xD48; 8 points
display list @ 0x4860
0xDDC 12 handle (0x4E4)
050004FC 00000000
0xF28 04 display list (0x4FC) [tabs on side of folders]
050048D8 00000000 00000000 05000DE8 0014 0000
point table @ 0xDE8; 20 points
display list @ 0x48D8
0xF3C 12 handle (0x514)
0500052C 00000000
0x1098 04 display list (0x52C) [basic folder]
05004968 00000000 00000000 05000F48 0015 0000
point table @ 0x; points
display list @ 0x
0x10AC 12 handle (0x544)
0500055C 00000000
0x1158 04 display list (0x5CC) [secondary folder - cheats, multi, briefings]
point table @ 0x; points
display list @ 0x
0x116C 12 handle (0x574)
0x1F28 04 display list (0x58C) [solo stage select]
05004AC8 00000000 00000000 05001178 00DB 0000
point table @ 0x1178; 219 points
display list @ 0x4AC8
0x1F3C 12 handle (0x5A4)
0x29E8 18 display list (0x5BC) [selection table with stage images]
05004FE0 00000000 05001F48 0050 0050 05002448 05002948 0000 0000
point table @ 0x1F48; 80 points
collision point table @ 0x2448; 80 points
point usage table @ 0x2948
display list @ 0x4FE0
0x2A08 12 handle (0x5D4)
050005EC 00000000
0x2B10 04 display list (0x5EC) [FOR YOUR EYES ONLY]
point table @ 0x; points
display list @ 0x
0x2B24 12 handle (0x604)
0x2BB0 04 display list (0x61C) [OHMSS]
point table @ 0x; points
display list @ 0x
0x2BC4 12 handle (0x634)
0x2C50 04 display list (0x64C) [briefing CONFIDENTIAL]
point table @ 0x; points
display list @ 0x
0x2C64 12 handle (0x664)
0x2CF0 04 display list (0x67C) [multi CONFIDENTIAL]
point table @ 0x; points
display list @ 0x
0x2D04 12 handle (0x694)
0x2D90 04 display list (0x6AC) [CLASSIFIED]
050053E0 00000000 00000000 05002D10 0008 0000
point table @ 0x2D10; 8 points
display list @ 0x53E0
0x2DA4 12 handle (0x6C4)
050006DC 00000000
0x2E20 04 display list (0x6DC) [shadow under character image]
05005468 00000000 00000000 05002DB0 0007 0000
point table @ 0x2DB0; 7 points
display list @ 0x5468
0x2E34 12 handle (0x6F4)
0500070C 00000000
0x2F40 04 display list (0x70C) [selected file 1 character image]
050054D8 00000000 00000000 05002E40 0010 0000
point table @ 0x2E40; 16 points
display list @ 0x54D8
0x2F54 12 handle (0x724)
0500073C 00000000
0x3060 04 display list (0x73C) [selected file 2 character image]
05005578 00000000 00000000 05002F60 0010 0000
point table @ 0x2F60; 16 points
display list @ 0x5578
0x3074 12 handle (0x754)
0500076C 00000000
0x3180 04 display list (0x76C) [selected file 3 character image]
05005618 00000000 00000000 05003080 0010 0000
point table @ 0x3080; 16 points
display list @ 0x5618
0x3194 12 handle (0x784)
0500079C 00000000
0x32A0 04 display list (0x79C) [selected file 4 character image]
050056B8 00000000 00000000 050031A0 0010 0000
point table @ 0x31A0; 16 points
display list @ 0x56B8
0x32F8 04 display list (0x7B4) [paperclip]
05005758 00000000 00000000 050032B8 0004 0000
point table @ 0x32B8; 4 points
display list @ 0x5758
0x330C 12 handle (0x7CC)
050007E4 00000000
0x3388 04 display list (0x7E4) [Briefing image shadow]
050057C8 00000000 00000000 05003318 0007 0000
point table @ 0x3318; 7 points
display list @ 0x57C8
0x339C 12 handle (0x7FC)
05000814 00000000
0x3428 04 display list (0x814) [Briefing Dam Image]
point table @ 0x; points
display list @ 0x
0x343C 12 handle (0x82C)
0x34C8 04 display list (0x844) [Briefing Facility Image]
point table @ 0x; points
display list @ 0x
0x34DC 12 handle (0x85C)
0x3568 04 display list (0x874) [Briefing Runway Image]
point table @ 0x; points
display list @ 0x
0x357C 12 handle (0x88C)
0x3608 04 display list (0x8A4) [Briefing Surface I Image]
point table @ 0x; points
display list @ 0x
0x361C 12 handle (0x8BC)
0x36A8 04 display list (0x8D4) [Briefing Bunker I Image]
point table @ 0x; points
display list @ 0x
0x36BC 12 handle (0x8EC)
0x3748 04 display list (0x904) [Briefing Silo Image]
point table @ 0x; points
display list @ 0x
0x375C 12 handle (0x91C)
0x37E8 04 display list (0x934) [Briefing Frigate Image]
point table @ 0x; points
display list @ 0x
0x37FC 12 handle (0x94C)
0x3888 04 display list (0x964) [Briefing Surface II Image]
point table @ 0x; points
display list @ 0x
0x389C 12 handle (0x97C)
0x3928 04 display type (0x994) [Briefing Bunker II Image]
point table @ 0x; points
display list @ 0x
0x393C 12 handle (0x9AC)
0x39C8 04 display list (0x9C4) [Briefing Statue Image]
point table @ 0x; points
display list @ 0x
0x39DC 12 handle (0x9DC)
0x3A68 04 display list (0x9F4) [Briefing Archives Image]
point table @ 0x; points
display list @ 0x
0x3A7C 12 handle (0xA0C)
0x3B08 04 display list (0xA24) [Briefing Streets Image]
point table @ 0x; points
display list @ 0x
0x3B1C 12 handle (0xA3C)
0x3BA8 04 display list (0xA54) [Briefing Depot Image]
point table @ 0x; points
display list @ 0x
0x3BBC 12 handle (0xA6C)
0x3C48 04 display list (0xA84) [Briefing Train Image]
point table @ 0x; points
display list @ 0x
0x3C5C 12 handle (0xA9C)
0x3CE8 04 display list (0xAB4) [Briefing Jungle Image]
point table @ 0x; points
display list @ 0x
0x3CFC 12 handle (0xACC)
0x3D88 04 display list (0xAE4) [Briefing Control Image]
point table @ 0x; points
display list @ 0x
0x3D9C 12 handle (0xAFC)
0x3E28 04 display list (0xB14) [Briefing Caverns Image]
point table @ 0x; points
display list @ 0x
0x3E3C 12 handle (0xB2C)
0x3EC8 04 display list (0xB44) [Briefing Cradle Image]
point table @ 0x; points
display list @ 0x
0x3EDC 12 handle (0xB5C)
0x3F68 04 display list (0xB74) [Briefing Aztec Image]
point table @ 0x; points
display list @ 0x
0x3F7C 12 handle (0xB8C)
0x4008 04 display list (0xBA4) [Briefing Egypt Image]
point table @ 0x; points
display list @ 0x
0x4060 04 display list (0xBBC) [Briefing paper clip]
point table @ 0x; points
display list @ 0x
0x4074 12 handle (0xBD4)
05000BEC 00000000
0x42E0 04 display list (0xBEC) [main folder select screen]
050062A8 00000000 00000000 05004080 0026 0000
point table @ 0x4080; 38 points
display list @ 0x62A8
0x42F4 12 handle (0xC04)
05000C1C 00000000
0x4370 04 display list (0xC1C) [main folder select picture shadow]
050063B0 00000000 00000000 05004300 0007 0000
point table @ 0x4300; 7 points
display list @ 0x63B0
0x4384 12 handle (0xC34)
05000C4C 00000000
0x4490 04 display list (0xC4C) [slot 1 file select picture]
05006420 00000000 00000000 05004390 0010 0000
point table @ 0x4390; 16 points
display list @ 0x6420
0x44A4 12 handle (0xC64)
05000C7C 00000000
0x45B0 04 display list (0xC7C) [slot 2 file select picture]
050064C0 00000000 00000000 050044B0 0010 0000
point table @ 0x44B0; 16 points
display list @ 0x64C0
0x45C4 12 handle (0xC94)
05000CAC 00000000
0x46D0 04 display list (0xCAC) [slot 3 file select picture]
05006560 00000000 00000000 050045D0 0010 0000
point table @ 0x45D0; 16 points
display list @ 0x6560
0x46E4 12 handle (0xCC4)
05000CDC 00000000
0x47F0 04 display list (0xCDC) [slot 4 file select picture]
05006600 00000000 00000000 050046F0 0010 0000
point table @ 0x46F0; 16 points
display list @ 0x6600
0x4848 04 display list (0xCF4) [paper clip on main folder select]
050066A0 00000000 00000000 05004808 0004 0000
point table @ 0x4808; 4 points
display list @ 0x66A0
@@ -1 +0,0 @@
8fadf452ba8f3ef116d4feb32e20b659355c334e
@@ -0,0 +1,404 @@
Setting Textured and Untextured Geometry in GoldenEye
Image application is done via microcode commands (herein called OPs regardless the inaccuracy of the word). There are four OPs you must keep track of, and in this document I'll mostly refer to them by number and not name. They are listed here in the order they are usually used:
B9 SetOtherModeLow: sets how the image is applied to geometry
FC SetCombine: dictates how alpha and color are combined
BA SetOtherModeHigh: sets how the image is applied to geometry
BB Texture: size and application of image data
There are also two more important commands:
C0 Normally NOP, used here to do image recall
E7 SyncPipe: waits for all geometry data to finish before proceeding
Before you change any B9, BA, of FC OPs, you need to set an E7 command. Otherwise, you could wind up applying the wrong settings accidentally while the RSP catches up to you. You only need one sync between the old data and the new, such as:
E7000000 00000000
BA001402 00100000
B900031D 0C182078
FC26A004 1F1093FF
NOT:
E7000000 00000000
BA001402 00100000
E7000000 00000000
B900031D 0C182078
E7000000 00000000
FC26A004 1F1093FF
The format for a C0 command is more complicated and is covered in more depth in a dedicated document. These examples will mostly deal with type 02 OPs, whose format is as follows:
C0000000 00000000 basic command
00800000 00000000 mirror S
00400000 00000000 clamp S
00200000 00000000 mirror T
00100000 00000000 clamp T
000C0000 00000000 ST offset, 2 avoids pixelized edges
00000002 00000000 type, which here is 2
00000000 00000FFF image ID
Suffice it to say your command will almost always look like:
C0080002 00000### ;# is image ID value
Other commands have more complex formatting that described above. S and T above are what are usually called U and V coordinates; these map a position in the image to the vertex, pinning it to your geometry.
As a final note before moving onto the next section, you only need to change a setting if it isn't the same as the current one. For instance, if you have two images using the same size and same format, you probably won't have to set anything at all. This will be mentioned in the examples below as well.
+_+
Basics of Textured and Untextured Geometry
The difference between textured and untextured geometry is more than just including an image. You must provide the correct settings to render the difference. This example comes from the start of a room and will be explained in one moment.
Textured:
E7000000 00000000 ;Always start by flushing the pipe
BA001402 00100000 ;2 cycle when textured
B900031D 0C182078 ;color image - ignore alpha
FC26A004 1F1093FF ;ignores image and vertex alpha
BA001001 00010000 ;images use lod
BB002801 FFFFFFFF ;on, level 5, tile 0, ignore ST
C0080002 00000iii ;type 02 image #iii
Untextured:
E7000000 00000000 ;Always start by flushing the pipe
BA001402 00000000 ;1 cycle when untextured
B900031D 00502078 ;only uses vertex and enviroment colors
FCFFFFFF FFFE793C ;only applies vertex and enviroment color
(BA001001 00000000) ;not included: already set to tile
BB000001 FFFFFFFF ;on, level 0, tile 0, ignore ST
In the untextured example the OP in parathesis is not actually included in the script. When a value is already set you do not need to include it. Here it was inserted for your benefit.
As a brief note, the settings above refer to a room binary. At runtime extra flags are toggled and all this will be mentioned below. Take it as it comes for now.
Breakdown:
The pipe is flushed at the beginning because geometry modes and combiners are going to change. The first BA command is also a point-in-fact. It must be set to 2-cycle in order to manage textures and 1-cycle to operate more efficiently on untextured triads. The second BA is not entirely necessary but takes advantage of level-of-detail. This will use different scale textures at different distances, and when textures are in use you will almost always want to flag it on.
In the following section B9 commands will be expressed in more depth, but the thing to note here is how you set them for color and texture. The upper word (B900031D) merely says what settings are being changed and this will always be the same. The lower word contains the settings themselves. The actual settings are complicated, but the only operative change is:
0C182078 img-a: blend alpha shade, blend 0
00502078 no img: color blender
In other words, everything within 0x1FFFFF is the same. Textureless geometry sets the 00400000 flag, and images do not.
The combiner is a far more invloved case, and due to the math and hardware background involved will not be covered at all in this document. Suffice it to say there are only four settings that ever need to be applied in GE, and they are:
FC26A004 1F1093FF image-alpha
FC26A004 1F1493FF color image+alpha
FC26A004 1FFC93FF greyscale+alpha (ia)
FCFFFFFF FFFE793C no image
These include flags to allow, when B9 permits, merging with enviroment color alpha. Setting them even when unused has no adverse results, so might as well ;*)
BB texture commands used regardless if textures are applied. They require you to know a little about the texture you're using, it any. A quick breakdown:
BB000000 00000000 basic command
00FF0000 00000000 bowtie, usually 0. +4 kills a scanline!
00003800 00000000 level, or size of tile in dmem. 0-7
00000700 00000000 tile, used to save it in memory. usually 0
00000001 00000000 on(1) or off(0). You want on.
00000000 FFFF0000 S offset. Leave at -1 (FFFF)
00000000 0000FFFF T offset. Leave at -1 (FFFF)
The tile value allows you to store a image for recall with a bunch of restrictions. In GE this is a bad idea since you'd overwrite things the programmers placed in those slots and generally make a mess. So, for new objects and rooms use 0.
S and T offsets are usually left at -1,-1 (FFFFFFFF) so the ST for each vertex is used instead. They would usually be set only when a different tile is being used, such as applying luster. The different tile will include the "reflection" and be applied using funny ST offsets to stretch the image and make it look like the reflection is offset from the sample.
The level refers to the size of your image when assembled and sent off. That's the width, the height, and the format multiplied together. For indexed images, imagine each index is replaced by the color sample.
level image binary total size
7 8192 0x2000
6 4096 0x1000
5 2048 0x800
4 1024 0x400
3 512 0x200
2 256 0x100
1 128 0x80
0 0 0x0 (more likely no image)
As in 32x32 16bit = 800, 32x64 ia = 1000. Max of 2000. The largest color image would be 64x64, 16bit color making it 0x2000, or tile 7. It's BB command would look like:
BB003801 FFFFFFFF
32x32 color images, used more than anything, are level 5:
BB002801 FFFFFFFF
Note that untextured images don't have an image source. That's why they use level 0. That's the meaning behind BB000001 FFFFFFFF.
Now that you are thoroughly confused, the following sections discuss practical application of multisized images in different types of geometry files.
+_+
Rooms: Type 02 Texture Application
Lets start with applying type 02 textures, as this is the most prevalent method to apply images and is common to all image formats. Note this assumes you have already added the texture into the ROM and know its ID, size, and format. This outlines how you set the microcode to properly apply it.
Rooms and objects are handled slightly differently due to certain settings rolling over. Lets start with rooms first.
Texture settings come before all other data in any kind of telemetry file. The actual formula is very simple and requires only the below.
The example is for a 32x32 ci image using image alpha and BG alpha if present. Color comes from both the image and vertex colors. That's the most common scenario in GE.
E7000000 00000000 ;Always start by flushing the pipe
if(image)
BA001402 00100000 ;2 cycle when textured
B900031D 0C184978 ;color image - use image alpha
FC26A004 1F1493FF ;color: img A + BG A, no vtx A
BA001001 00010000 ;images use lod
BB002801 FFFFFFFF ;on: level 5, tile 0, default ST
C0080002 00000iii ;type 2 image #iii, presumed 32x32 ci
else(color)
BA001402 00000000 ;1 cycle when color
B900031D 00502078 ;use vertex color only
FCFFFFFF FFFE793C ;apply vertex and bg color only
BB000001 FFFFFFFF ;on: level 0, tile 0, default ST
if(not yet set)
BA001102 00000000 ;clamp
BA000C02 00002000 ;bi-level interpretation
B7000000 00002000 ;cull back
FB000000 000000FF ;background color
;insert geometry here
First thing to note: included are the OPs to use just vertex color as well. You can simply switch between them as you see fit. That's included here for reference, but for now we'll only deal with the image part of it now.
Before playing with commands, a word about the "if not yet set" section. These commands only need to be set once at the start of the file. You never need to tinker with them again unless you honestly want to. Set them after the first texture call to ensure nothing alters them behind your back.
GE files expect images to be clamped and yours probably will be anyway. To be consistent you'll have to use bi-level interpretation. Point and average will not mesh well with any of the original geometry. In general you don't want to use point anyway, as it tends to pixelate much like the graphics in Doom.
Cull back is set to prevent rendering the back side of geometry. This way only the side facing you is rendered, not the back as well. Gives a performance boost. If you use two-sided geometry be sure to set it back afterward!
The background (or enviroment) color is used to flatten against. In particular, you need to make sure the alpha value is set to FF unless you want translucent walls--yours or unexpectantly others.
Everything else worth saying has to do with the "image" section. Only four commands in the entire script will change depending on your image, and of them only three are worth mentioning.
B9 changes based on image format
FC changes based on image format
BB changes based on image size
C0 call a different image ID
B9 is the most difficult to set simply because of the large degree of options available. By comparison FC and BB are simple. So, first, B9. To save time and energy, the most common settings are listed here as well as when to apply them.
The upper part of the command will always be B900031D and states you'll be changing render mode, convergance, depthmode, and blender settings. The bottom word will change depending on your specific image and what effects you'll want to use. The most common scenarios are these:
B900031D 00502078 no image, no BG color
B900031D 0C182048 greyscale - alpha, BG alpha
B900031D 0C104DD8 intensity+alpha, no BG color
B900031D 0C182078 color image - alpha, BG alpha
B900031D 0C184978 color image + alpha, BG alpha
Certain flags have different uses, and most enable modes for the combiner to use without directly having their own impact. The flags of most importance here are these:
00400000 no image
00080000 enables BG alpha using the FB OP
00004000 enables image alpha; not used with below
00002000 alpha converge selection; no img. alpha
Actually working out exactly what you want is beyond the scope of this. You would have to refer to documentation on the RSP microcode. The generic settings above though should serve for almost any image and scenario you run into.
FC is easy to set. If no alpha is used use one of the first two settings. If no image is used use one of the last two settings. If the image uses alpha, pick the appropriate one for color or greyscale (I/IA) image.
FC26A004 1F1093FC image-alpha
FC26A004 1F1093FF image-alpha, BG alpha
FC26A004 1F1493FC color image+alpha
FC26A004 1F1493FF color image+alpha, BG alpha
FC26A004 1FFC93FC greyscale+alpha (ia)
FC26A004 1FFC93FF greyscale+alpha (ia), BG alpha
FCFFFFFF FFFE793C no image
FCFFFFFF FFFE793F no image, BG alpha
Working out the exact settings is more of a chore. The individual flags combine based on selected render settings to combine the final output. Again, well beyond the scope of this document.
BB is also easy to set so long as you know what size the image is. The key is the image format and size.
Width * Height * Depth = Size
Multiply the width and height, then multiply this by the size of the color data. If the image is indexed, use the size of the color key in the table. Remember there's 16bits in a byte.
level image binary total size
7 8192 0x2000
6 4096 0x1000
5 2048 0x800
4 1024 0x400
3 512 0x200
2 256 0x100
1 128 0x80
0 0 0x0 (more likely no image)
Here's some examples:
32x32 ci, 16bit color
32 * 32 * 2bytes = 4096 bytes: level 6
32x32 i, 8bit
32 * 32 * 1byte = 2048 bytes: level 5
If you fall between levels, round up:
12x12 32bit color
12 * 12 * 4bytes = 576 bytes
round up to 1024: level 4
Now you stuff the level value into the OP.
level OP
0 BB000001 FFFFFFFF
1 BB000801 FFFFFFFF
2 BB001001 FFFFFFFF
3 BB001801 FFFFFFFF
4 BB002001 FFFFFFFF
5 BB002801 FFFFFFFF
6 BB003001 FFFFFFFF
7 BB003801 FFFFFFFF
+_+
Changing Textures Within a Room
Most interesting rooms will use more than one texture. When swapping textures you only need to include the code that changes. Also, you only need to sync the pipe (E7 OP) when a B9, BA, or FC OP changes.
As an example, here's a sample room illustrating a few texture changes. The types of textures are noted.
E7000000 00000000 ;Always start by flushing the pipe
BA001402 00100000 ;2 cycle when textured
B900031D 0C184978 ;color image - use image alpha
FC26A004 1F1493FF ;color: img A + BG A, no vtx A
BA001001 00010000 ;images use lod
BB002801 FFFFFFFF ;on: level 5, tile 0, default ST
C0080002 00000iii ;type 2 image #iii, 32x32 ci
BA001102 00000000 ;clamp
BA000C02 00002000 ;bi-level interpretation
B7000000 00002000 ;cull back
FB000000 000000FF ;background color
;insert geometry here
;example 1: same type+size
C0080002 00000iii ;type 2 image #iii, 32x32 ci
;more geometry
;example 2: different size
BB003001 FFFFFFFF ;on: level 6, tile 0, default ST
C0080002 00000iii ;type 2 image #iii, 64x32 ci
;more geometry
;example 3: change render mode
E7000000 00000000 ;changing settings
B900031D 0C182078 ;color image - no image alpha
C0080002 00000iii ;type 2 image #iii, 64x32 ci
;more geometry
;example 4: complete change
E7000000 00000000 ;changing settings
B900031D 0C102048 ;greyscale image - no image alpha
FC26A004 1F1093FF ;image without alpha + BG alpha
BB002001 FFFFFFFF ;on: level 4, tile 0, default ST
C0080002 00000iii ;type 2 image #iii, 32x32 i8
Each in series. Example 1 shows that if the image is exactly the same as the previous settings, you just add a new texture call. It's that easy.
Example 2 shows how you call an image that has the same format as the current image but differs in size. Simply write in the new BB and CO OPs. No pipe is necessary.
Example 3 illustrates changing the render mode in a B9 OP, here ignoring the alpha channel. A flush OP (E7) is needed because a B9 command will be used. The new render setting is applied and the texture OP is written. As a side note, by disabling alpha in B9 you do not need to change the FC command. You could also achieve the same effect by altering FC if you like, but disabling it from B9 saves you from having to write a million FCs.
Example 4 is a complete texture swap. All four commands are used and a flush is called beforehand.
You can also switch between textured and untextured, presuming you watch the settings. In this example, you start out untextured, then swap to using textures:
E7000000 00000000 ;Always start by flushing the pipe
BA001402 00000000 ;1 cycle when color
B900031D 00502078 ;use vertex color only
FCFFFFFF FFFE793C ;apply vertex and bg color only
BB000001 FFFFFFFF ;on: level 0, tile 0, default ST
BA001102 00000000 ;clamp
BA000C02 00002000 ;bi-level interpretation
B7000000 00002000 ;cull back
FB000000 000000FF ;background color
;insert geometry here
;switch to textures
E7000000 00000000 ;changing settings
BA001402 00100000 ;2 cycle when textured
B900031D 0C184978 ;color image - use image alpha
FC26A004 1F1493FF ;color: img A + BG A, no vtx A
BA001001 00010000 ;images use lod
BB002801 FFFFFFFF ;on: level 5, tile 0, default ST
C0080002 00000iii ;type 2 image #iii, presumed 32x32 ci
;insert more geometry here
In order to switch, you flush, set the cycle rate back to 2, set LOD, then do your normal texture commands. You won't need to clamp, cull, set the BG, or set the interpretation level again. If you wanted, you could also change back from textured to untextured. Simply turn off LOD, set the cycles back to 1, and set the OPs for colour.
+_+
Unorthodox Texture Application
The simplest change can be used with the settings given above. It adds a fixed amount of translucency to any geometry following it by setting the background enviroment color. The OP is FB and simply takes a 32bit color value:
FB000000 00000000 basic command
00000000 FF000000 red
00000000 00FF0000 green
00000000 0000FF00 blue
00000000 000000FF alpha
By altering the render mode you can also use this to make the black in a greyscale image lacking alpha act like alpha. For instance:
B900031D 0C1849D8 ;intensity, BG alpha
FC26A004 1F1093FF ;image-alpha, BG alpha
BB003001 FFFFFFFF ;on: level 6, tile 0
C0080002 00000iii ;image, expected to be greyscale
FB000000 00000080 ;50% translucent
Ever wonder how to add luster to a surface? It is as simple as making a small change to your BB command and setting two flags. For instance:
BB002801 08000800
C0080002 00000iii
B7000000 00060000
The B7 setting here sets lighting and texture gen, and this causes luster on the surface. Note the ST settings in the BB command. By setting these you offset the texture, effectively setting the repeat rate of the lusterous overlay. After the shiny part of the model and definately before ending the display list you must reset the flags using this line:
B6000000 00060000
Otherwise, the effect will leak onto every other piece of geometry that follows it, and this can also crash the game.
Type 01 texture commands load two images, one visible at a distance and the other close up. It can also be used to add detail to an image when close but keep from rendering it far away. Examples would be the rock walls in Dam and the stone walls in Grid. This example comes from Dam:
B900031D 0C1849D8 ;uses convergence and depth comparisons
FC26E404 1F10FFFF ;uses LOD fraction
BB002801 FFFFFFFF ;on: level 5, tile 0, default ST
C01B8001 FA 9A1 4B1 ;type 1: 9A1 near, 4B1 far, dist. FA
BA001102 00040000 ;enable colour dither
The format for the type 1 C0 OP is more complicated, and here it is in detail:
C0000000 00000000 basic command
00800000 00000000 S mirror
00400000 00000000 S clamp
00200000 00000000 T mirror
00100000 00000000 T clamp
000C0000 00000000 ST offset
0003C000 00000000 S shift
00003C00 00000000 T shift
00000001 00000000 type 1 command
00000000 FF000000 distance for replacement
00000000 00iii000 near image ID (base)
00000000 00000iii far image ID (overlay)
The important parts are the level and two image IDs. In simplest form you have C0080001 FAiiiIII, where i is image 1 and I image 2.
The level is the distance at which replacement occurs. Set to FF no replacement happens. For "detail textures" you want a value roughly F8 to FB. Finding the right value is more a matter of trial-and-error. Technically this sets a PrimaryColor alpha level which converges with the overlay texture, but you don't have to worry about that.
Oddly, the near image will always be present. The far image acts as an overlay that fades as you near the level set in the command.
For best effect you want the two images to be the same size and preferably the same format. If the size differs, set the difference in the S and T to the appropriate shift values. The example above uses S shift to account for image misalignment.
Remember too to enable colour dither in BA and disable it when you're done. This allows the transition to smoothly blend the two images. Otherwise, the effect can be very ugly.
+_+
Objects
As mentioned before, objects use a slightly different set of commands. In particular, rooms will automatically set certain flags in B9 commands. There's also certain OPs that must be included and omitted from the display list.
As before, here's the general initialization for a 32x32 ci image without alpha. Note the difference from rooms.
E7000000 00000000 ;Always start by flushing the pipe
if(image)
BA001001 00010000 ;images use LOD
BB002801 FFFFFFFF ;on: level 5, tile 0, default ST
C0080002 00000iii ;type 2 image, presumed 32x32 ci
if(not yet set)
BA001102 00000000 ;clamp
BA000C02 00002000 ;bi-level interpretation
else(color)
BA001402 00000000
B900031D 00552078
FCFFFFFF FFFE793C
if(not yet set)
B7000000 00002000 ;cull back
01020040 03000000 ;basic matrix
If images are in use you also have to set clamp and bi-level interp. Pure color doesn't require it, but images will. Also note the addition of the matrix command. This loads a default matrix for the object. It is required, and failing to do so will cause bad things to happen.
It is more obvious what you don't need. 2-cycle is already set, and the BG color should already be set to black. Objects presume B9 is already set to C8102078. That's the equivalent of 0C102078 in rooms. In general, XOR room values with C4000000 to get this table:
Common B9 values:
B900031D 00552078 no image, no BG color
B900031D C8182048 greyscale - alpha, BG alpha
B900031D C8104DD8 intensity+alpha, no BG color
B900031D C8182078 color image - alpha, BG alpha
B900031D C8184978 color image + alpha, BG alpha
Otherwise, all other settings should be identical to rooms. Note you do need to set B9 if it differs from the default, and because the values aren't automatically corrected at runtime you have more control over how to set them.
+_+
Note only a fraction of the above applies to other N64 titles and is not written as a general guide to display list editting. It is presented with generic values to allow the average hacker with little experience in N64 display lists to custom hex edit pre-generated output. Please refer to RSP / RDP microcode documentation for a better reference of available render and combiner settings.
-Zoinkity
@@ -1 +0,0 @@
7bd7fd164da248321266719c1e9846e24d61e94f
@@ -0,0 +1,45 @@
This is a sort of side project that developed out of analyzing a guard to death.
Guard Part Ordering (though any object will do)
-------------------------------------------------
Each 'piece' of an object model is given a label so it can be identified in-game. Up until now the numbering system has been neglected; it usually isn't necessary to know what piece is which. It usually is only used during collision detection, as when shooting a head versus a foot. For our purposes it is more likely to be used to rebuild models though.
The ordering system is generated using the 02 position commands in the object's table. Here's an example of the 02 command and a breakdown of the features:
0x0 4 relative x position
0x4 4 relative y position
0x8 4 relative z position
0xC 2 *current command order number*
0xE 2 *first piece order #*
0x10 2 *second piece order #* (FFFF if not present)
0x12 2 *third piece order #* (FFFF if not present)
0x14 4 offset to child 02 command (if applicable)
0x18 4 unknown float value
0x5C8 C35E742B 4274E7D1 00000000 0007 0011 0013 FFFF 050005E0 438B53D1
In this example, the 02 command shown is #7 in the model. If some bizare function requests 7's data, it will retrieve this command.
There are two piece entries to this command as well, 11 and 13. In this particular case it is the left hand and left forearm of a character, but it could be any two pieces of the model.
It is rather important to note that command numbers and piece numbers form two different lists! Commands span from 1+ but piece numbers start at 0.
Child entries are those entries that are linked together in the main object table. Piece numbers are assigned to the child entry alone. Command numbers are assigned to the 02 commands that set the piece numbers.
{02:5C8 {02:5E0 {0A:5F8 {18:610}}
0A:628 {08:640 {18:658}
08:670 {18:688}}
}
0x5C8 has two children: 0x5E0 and 0x628. 0x5E0 is labelled #11, and 0x628 is labelled #13. Since only render commands (dimentions, distance, and display structs) are in 0x628's group, piece 13 is exclusively the value for the left forearm model.
Now for a quick look at part #11 - an 02 command used in the hand. 0x5E0 set its piece number to 11. If the entire piece, including the command needs to be grabbed, this number can be used. However, it also assigns a piece number to its children:
0x5E0 C38411CD 3FAEB13E 00000000 0009 0012 FFFFFFFF 00000000 4306DABA
0x5E0's COMMAND number is set to 09 while its piece number is 11. The 0A and 18 child commands are now assigned piece number 12. When something wants to access the hand model alone it can use piece number 12 to do so.
--------------------------------
Complicated, eh?
It can also skip command numbers and probably piece numbers as well. Bodies without heads skip commands 3-4, for instance.
Also, this has no bearing on the IDs assigned to the dimention data. That's just in a sort of random numerical order starting at 1.
@@ -1 +0,0 @@
10a195ba470adf2858f7228d077925693148792b
@@ -0,0 +1,91 @@
simple heads:
Simple heads only have one head model (no distance model present). They follow a very simple header format as shown here (taken from Trevhead). All require 2 offsets at the beginning of the file and only contain one line of points and mapping.
header:
00000000 00000000 00000000 0002 0001
433E9EA3 0000 0004 00000000 00000000
2 offsets, 4 images
offsets: (2)
0x0 00000000
0x4 00000000
images: (4)
000007F4 20200000 02000000
000007F8 20400000 02000000
000007F9 20400000 02000000
000007FC 20200000 02000000
Table:
00180000 05002390 00000000 00000000 00000000 00000000
point display struct:
050023B0 00000000 05000050 0198 0069 050019D0 05002060 0003 0000 00000000
mapping at 0x23B0
normal point table at 0x50; 0x198 entries
collision point table at 0x19D0; 0x69 entries
point usage table at 0x2060
--------
Complex heads:
Complex heads have mulitple head models (distance-specific models) or multiple objects attached to the head, such as sunglasses. These use slightly more complicated file tables. This example is of CheadmartinZ. Run headmartinZ run.
Complex heads *will* have 1-2 offset values preset.
First is to the 12-relative command for sunglasses.
Second is to 12-relative command for distance model (low-res)
header:
00000000 00000000 00000000 0002 0001
435E5914 0000 0006 00000000 00000000
2 offsets, 6 images
offsets: (2)
0x0 050000B0
0x4 05000068
images: (6)
0x8 000007CC 20200600 02000000
0x14 000007CB 10200600 02000000
0x20 0000073E 20400000 02000000
0x2C 0000073F 20400000 02000000
0x38 0000073D 20400000 02000000
0x44 00000740 20300400 02000200
Table:
0x50 00120000 050000E0 00000000 00000000 00000000 05000068
0x68 00120000 050000E8 05000050 05000098 00000000 05000080
0x80 00180000 050001BC 05000068 00000000 00000000 00000000
0x98 00180000 05000780 05000050 050000B0 05000068 00000000
0xB0 00120000 050007A0 05000050 00000000 05000098 050000C8
0xC8 00180000 05000A30 050000B0 00000000 00000000 00000000
relative:
0xE0 05000068 00000000
relative:
0xE8 05000080 00000000
point display struct: //low-res head
0x1BC 05000A50 00000000 050000F0 0006 0006 05000150 050001B0 0003 0000 00000000
mapping @ 0xA50
normal point table @ 0xF0; 6 normal points
collision points @ 0x150; 6 collision points
point usage table @ 0x1B0
point display struct: //hi-res head
0x780 05000AB0 00000000 050001E0 0038 001B 05000560 05000710 0003 0000 00000000
mapping @ 0xAB0
normal point table @ 0x1E0; 38 normal points
collision points @ 0x560; 1B collision points
point usage table @ 0x710
relative:
0x7A0 050000C8 00000000
point display struct: //sunglasses
0xA30 05000B98 05000BF0 050007A8 0014 0012 050008E8 05000A08 0003 0000 00000000
mapping @ 0xB98
collisionless mapping @ 0xBF0
normal point table @ 0x7A8; 14 normal points
collision points @ 0x8E8; 12 collision points
point usage table @ 0xA08
@@ -1 +0,0 @@
f694fc7857f2317a676554ab5c4e285fa880fbdb

Some files were not shown because too many files have changed in this diff Show More