@@ -49,12 +49,12 @@ void DECOMP_RB_Spider_DrawWebs(struct Thread *t, struct TileView *view)
49
49
50
50
scratchpad [0 ] = uVar2 ;
51
51
scratchpad [1 ] = instDef -> pos [1 ] + 0x540 ;
52
- scratchpad [2 ] = ( int ) sVar1 ;
52
+ scratchpad [2 ] = sVar1 ;
53
53
scratchpad [3 ] = 0 ;
54
54
55
55
scratchpad [4 ] = uVar2 ;
56
56
scratchpad [5 ] = t -> inst -> matrix .t [1 ] + 0x60 ;
57
- scratchpad [6 ] = ( int ) sVar1 ;
57
+ scratchpad [6 ] = sVar1 ;
58
58
scratchpad [7 ] = 0 ;
59
59
60
60
scratchpad += 8 ;
@@ -64,10 +64,11 @@ void DECOMP_RB_Spider_DrawWebs(struct Thread *t, struct TileView *view)
64
64
65
65
int i , j ;
66
66
int numPlyr ;
67
- p = primMem -> curr ;
68
67
numPlyr = gGT -> numPlyrCurrGame ;
69
68
70
- if (p + (numSpiders * numPlyr ) >= primMem -> endMin100 )
69
+ p = primMem -> curr ;
70
+ p = p + (numSpiders * numPlyr );
71
+ if (p >= primMem -> endMin100 )
71
72
return ;
72
73
73
74
// loop through all players
@@ -81,6 +82,9 @@ void DECOMP_RB_Spider_DrawWebs(struct Thread *t, struct TileView *view)
81
82
gte_SetTransMatrix (m );
82
83
83
84
scratchpad = 0x1f800000 ;
85
+
86
+ // 0x10 * numSpiders
87
+ short * output = 0x1F800050 ;
84
88
85
89
// loop through spiders
86
90
for (j = 0 ; j < numSpiders ; j ++ )
@@ -98,12 +102,11 @@ void DECOMP_RB_Spider_DrawWebs(struct Thread *t, struct TileView *view)
98
102
// rtps is "single", rtpt is "triple"
99
103
gte_ldv01 (& scratchpad [0 ], & scratchpad [4 ]);
100
104
gte_rtpt ();
101
- gte_stsxy01 (& p -> f2 . x0 , & p -> f2 . x1 );
105
+ gte_stsxy01 (& output [ 0 ] , & output [ 2 ] );
102
106
103
107
// depth of 2nd vertex
104
108
__asm__ ("swc2 $18, 0( %0 );" : : "r" (& depth ));
105
109
#else
106
- short output [4 ];
107
110
108
111
gte_ldv0 (& scratchpad [0 ]);
109
112
gte_rtps ();
@@ -124,6 +127,9 @@ void DECOMP_RB_Spider_DrawWebs(struct Thread *t, struct TileView *view)
124
127
// to be seen, then generate primitives
125
128
if ((unsigned int )(depth - 1 ) < (0x1200 - 1 ))
126
129
{
130
+ p = primMem -> curr ;
131
+ primMem -> curr = p + 1 ;
132
+
127
133
p -> tpage = 0xe1000a20 ;
128
134
p -> f2 .tag = 0 ;
129
135
@@ -151,13 +157,10 @@ void DECOMP_RB_Spider_DrawWebs(struct Thread *t, struct TileView *view)
151
157
// prim header, OT and prim len
152
158
* (int * )p = * ot | 0x5000000 ;
153
159
* ot = (u_int )p & 0xffffff ;
154
-
155
- p = p + 1 ;
156
160
}
157
161
}
158
162
}
159
163
160
- primMem -> curr = p ;
161
164
}
162
165
163
166
void DECOMP_RB_Spider_ThTick (struct Thread * t )
0 commit comments