@@ -25,10 +25,12 @@ void DECOMP_MainInit_FinalizeInit(struct GameTracker *gGT)
2525 gGT -> pushBuffer [0 ].distanceToScreen_PREV = 0x100 ;
2626 gGT -> pushBuffer [0 ].distanceToScreen_CURR = 0x100 ;
2727
28- // erase all threadBucket structs
29- memset (& gGT -> threadBuckets [0 ], 0 , sizeof (struct ThreadBucket ) * NUM_BUCKETS );
28+ // reset root thread for each bucket
29+ for (int i = 0 ; i < NUM_BUCKETS ; i ++ )
30+ gGT -> threadBuckets [i ].thread = 0 ;
3031
31- #if 0
32+ // This code was in OG, but not needed by retail game
33+ #ifdef USE_PROFILER
3234 gGT -> threadBuckets [PLAYER ].s_longName = 0x8008d30c ; // PLAYER
3335 gGT -> threadBuckets [PLAYER ].s_shortName = 0x8008d314 ; // PLYR
3436 gGT -> threadBuckets [ROBOT ].s_longName = 0x8008d31c ; // ROBOT
@@ -41,39 +43,37 @@ void DECOMP_MainInit_FinalizeInit(struct GameTracker *gGT)
4143 gGT -> threadBuckets [WARPPAD ].s_shortName = 0x8008d34c ; // WRPD
4244 gGT -> threadBuckets [TRACKING ].s_longName = 0x80011434 ; // TRACKING
4345 gGT -> threadBuckets [TRACKING ].s_shortName = 0x8008d354 ; // TRKG
44- #endif
4546
4647 gGT -> threadBuckets [PLAYER ].boolCantPause = 0 ;
47- gGT -> threadBuckets [PLAYER ].unk2 [0 ] = 0x40 ;
48- gGT -> threadBuckets [PLAYER ].unk2 [1 ] = 0x40 ;
49- gGT -> threadBuckets [PLAYER ].unk2 [2 ] = 0x80 ;
48+ gGT -> threadBuckets [PLAYER ].rectCol [0 ] = 0x40 ;
49+ gGT -> threadBuckets [PLAYER ].rectCol [1 ] = 0x40 ;
50+ gGT -> threadBuckets [PLAYER ].rectCol [2 ] = 0x80 ;
5051
5152 gGT -> threadBuckets [ROBOT ].boolCantPause = 0 ;
52- gGT -> threadBuckets [ROBOT ].unk2 [0 ] = 0x40 ;
53- gGT -> threadBuckets [ROBOT ].unk2 [1 ] = 0x80 ;
54- gGT -> threadBuckets [ROBOT ].unk2 [2 ] = 0x40 ;
53+ gGT -> threadBuckets [ROBOT ].rectCol [0 ] = 0x40 ;
54+ gGT -> threadBuckets [ROBOT ].rectCol [1 ] = 0x80 ;
55+ gGT -> threadBuckets [ROBOT ].rectCol [2 ] = 0x40 ;
5556
5657 gGT -> threadBuckets [STATIC ].boolCantPause = 1 ;
57- gGT -> threadBuckets [STATIC ].unk2 [0 ] = 0x40 ;
58- gGT -> threadBuckets [STATIC ].unk2 [1 ] = 0x80 ;
59- gGT -> threadBuckets [STATIC ].unk2 [2 ] = 0x80 ;
58+ gGT -> threadBuckets [STATIC ].rectCol [0 ] = 0x40 ;
59+ gGT -> threadBuckets [STATIC ].rectCol [1 ] = 0x80 ;
60+ gGT -> threadBuckets [STATIC ].rectCol [2 ] = 0x80 ;
6061
6162 gGT -> threadBuckets [MINE ].boolCantPause = 0 ;
62- gGT -> threadBuckets [MINE ].unk2 [0 ] = 0x80 ;
63- gGT -> threadBuckets [MINE ].unk2 [1 ] = 0x80 ;
64- gGT -> threadBuckets [MINE ].unk2 [2 ] = 0x80 ;
63+ gGT -> threadBuckets [MINE ].rectCol [0 ] = 0x80 ;
64+ gGT -> threadBuckets [MINE ].rectCol [1 ] = 0x80 ;
65+ gGT -> threadBuckets [MINE ].rectCol [2 ] = 0x80 ;
6566
6667 gGT -> threadBuckets [WARPPAD ].boolCantPause = 1 ;
67- gGT -> threadBuckets [WARPPAD ].unk2 [0 ] = 0x80 ;
68- gGT -> threadBuckets [WARPPAD ].unk2 [1 ] = 0x40 ;
69- gGT -> threadBuckets [WARPPAD ].unk2 [2 ] = 0x80 ;
68+ gGT -> threadBuckets [WARPPAD ].rectCol [0 ] = 0x80 ;
69+ gGT -> threadBuckets [WARPPAD ].rectCol [1 ] = 0x40 ;
70+ gGT -> threadBuckets [WARPPAD ].rectCol [2 ] = 0x80 ;
7071
7172 gGT -> threadBuckets [TRACKING ].boolCantPause = 0 ;
72- gGT -> threadBuckets [TRACKING ].unk2 [0 ] = 0x80 ;
73- gGT -> threadBuckets [TRACKING ].unk2 [1 ] = 0x80 ;
74- gGT -> threadBuckets [TRACKING ].unk2 [2 ] = 0x80 ;
73+ gGT -> threadBuckets [TRACKING ].rectCol [0 ] = 0x80 ;
74+ gGT -> threadBuckets [TRACKING ].rectCol [1 ] = 0x80 ;
75+ gGT -> threadBuckets [TRACKING ].rectCol [2 ] = 0x80 ;
7576
76- #if 0
7777 gGT -> threadBuckets [BURST ].s_longName = 0x8008d35c ; // BURST
7878 gGT -> threadBuckets [BURST ].s_shortName = 0x8008d364 ; // BRST
7979 gGT -> threadBuckets [BLOWUP ].s_longName = 0x8008d36c ; // BLOWUP
@@ -85,34 +85,32 @@ void DECOMP_MainInit_FinalizeInit(struct GameTracker *gGT)
8585 gGT -> threadBuckets [FOLLOWER ].s_longName = 0x80011440 ; // FOLLOWER
8686 gGT -> threadBuckets [FOLLOWER ].s_shortName = 0x8008d39c ; // FLWR
8787 gGT -> threadBuckets [STARTTEXT ].s_longName = 0x8001144c ; // STARTTEXT
88- #endif
8988
9089 gGT -> threadBuckets [BURST ].boolCantPause = 0 ;
91- gGT -> threadBuckets [BURST ].unk2 [0 ] = 0x80 ;
92- gGT -> threadBuckets [BURST ].unk2 [1 ] = 0x40 ;
93- gGT -> threadBuckets [BURST ].unk2 [2 ] = 0x80 ;
90+ gGT -> threadBuckets [BURST ].rectCol [0 ] = 0x80 ;
91+ gGT -> threadBuckets [BURST ].rectCol [1 ] = 0x40 ;
92+ gGT -> threadBuckets [BURST ].rectCol [2 ] = 0x80 ;
9493
9594 gGT -> threadBuckets [BLOWUP ].boolCantPause = 0 ;
96- gGT -> threadBuckets [BLOWUP ].unk2 [0 ] = 0x80 ;
97- gGT -> threadBuckets [BLOWUP ].unk2 [1 ] = 0x80 ;
98- gGT -> threadBuckets [BLOWUP ].unk2 [2 ] = 0 ;
95+ gGT -> threadBuckets [BLOWUP ].rectCol [0 ] = 0x80 ;
96+ gGT -> threadBuckets [BLOWUP ].rectCol [1 ] = 0x80 ;
97+ gGT -> threadBuckets [BLOWUP ].rectCol [2 ] = 0 ;
9998
10099 gGT -> threadBuckets [TURBO ].boolCantPause = 0 ;
101- gGT -> threadBuckets [TURBO ].unk2 [0 ] = 0 ;
102- gGT -> threadBuckets [TURBO ].unk2 [1 ] = 0 ;
103- gGT -> threadBuckets [TURBO ].unk2 [2 ] = 0x80 ;
100+ gGT -> threadBuckets [TURBO ].rectCol [0 ] = 0 ;
101+ gGT -> threadBuckets [TURBO ].rectCol [1 ] = 0 ;
102+ gGT -> threadBuckets [TURBO ].rectCol [2 ] = 0x80 ;
104103
105104 gGT -> threadBuckets [SPIDER ].boolCantPause = 0 ;
106- gGT -> threadBuckets [SPIDER ].unk2 [0 ] = 0x80 ;
107- gGT -> threadBuckets [SPIDER ].unk2 [1 ] = 0x40 ;
108- gGT -> threadBuckets [SPIDER ].unk2 [2 ] = 0x80 ;
105+ gGT -> threadBuckets [SPIDER ].rectCol [0 ] = 0x80 ;
106+ gGT -> threadBuckets [SPIDER ].rectCol [1 ] = 0x40 ;
107+ gGT -> threadBuckets [SPIDER ].rectCol [2 ] = 0x80 ;
109108
110109 gGT -> threadBuckets [FOLLOWER ].boolCantPause = 0 ;
111- gGT -> threadBuckets [FOLLOWER ].unk2 [0 ] = 0x40 ;
112- gGT -> threadBuckets [FOLLOWER ].unk2 [1 ] = 0x40 ;
113- gGT -> threadBuckets [FOLLOWER ].unk2 [2 ] = 0x80 ;
110+ gGT -> threadBuckets [FOLLOWER ].rectCol [0 ] = 0x40 ;
111+ gGT -> threadBuckets [FOLLOWER ].rectCol [1 ] = 0x40 ;
112+ gGT -> threadBuckets [FOLLOWER ].rectCol [2 ] = 0x80 ;
114113
115- #if 0
116114 gGT -> threadBuckets [STARTTEXT ].s_shortName = 0x8008d3a4 ; // STXT
117115 gGT -> threadBuckets [OTHER ].s_longName = 0x8008d3ac ; // OTHER
118116 gGT -> threadBuckets [OTHER ].s_shortName = 0x8008d3b4 ; // OTHR
@@ -124,37 +122,37 @@ void DECOMP_MainInit_FinalizeInit(struct GameTracker *gGT)
124122 gGT -> threadBuckets [HUD ].s_shortName = 0x8008d3e0 ; // THUD
125123 gGT -> threadBuckets [PAUSE ].s_longName = 0x8008d3e8 ; // PAUSE
126124 gGT -> threadBuckets [PAUSE ].s_shortName = 0x8008d3f0 ; // PAUS
127- #endif
128-
125+
129126 gGT -> threadBuckets [STARTTEXT ].boolCantPause = 0 ;
130- gGT -> threadBuckets [STARTTEXT ].unk2 [0 ] = 0x80 ;
131- gGT -> threadBuckets [STARTTEXT ].unk2 [2 ] = 0x80 ;
132- gGT -> threadBuckets [STARTTEXT ].unk2 [1 ] = 0x40 ;
127+ gGT -> threadBuckets [STARTTEXT ].rectCol [0 ] = 0x80 ;
128+ gGT -> threadBuckets [STARTTEXT ].rectCol [2 ] = 0x80 ;
129+ gGT -> threadBuckets [STARTTEXT ].rectCol [1 ] = 0x40 ;
133130
134131 gGT -> threadBuckets [OTHER ].boolCantPause = 0 ;
135- gGT -> threadBuckets [OTHER ].unk2 [0 ] = 0x80 ;
136- gGT -> threadBuckets [OTHER ].unk2 [1 ] = 0x40 ;
137- gGT -> threadBuckets [OTHER ].unk2 [2 ] = 0x40 ;
132+ gGT -> threadBuckets [OTHER ].rectCol [0 ] = 0x80 ;
133+ gGT -> threadBuckets [OTHER ].rectCol [1 ] = 0x40 ;
134+ gGT -> threadBuckets [OTHER ].rectCol [2 ] = 0x40 ;
138135
139136 gGT -> threadBuckets [AKUAKU ].boolCantPause = 0 ;
140- gGT -> threadBuckets [AKUAKU ].unk2 [0 ] = 0x80 ;
141- gGT -> threadBuckets [AKUAKU ].unk2 [1 ] = 0x40 ;
142- gGT -> threadBuckets [AKUAKU ].unk2 [2 ] = 0x40 ;
137+ gGT -> threadBuckets [AKUAKU ].rectCol [0 ] = 0x80 ;
138+ gGT -> threadBuckets [AKUAKU ].rectCol [1 ] = 0x40 ;
139+ gGT -> threadBuckets [AKUAKU ].rectCol [2 ] = 0x40 ;
143140
144141 gGT -> threadBuckets [CAMERA ].boolCantPause = 1 ;
145- gGT -> threadBuckets [CAMERA ].unk2 [0 ] = 0x80 ;
146- gGT -> threadBuckets [CAMERA ].unk2 [1 ] = 0x80 ;
147- gGT -> threadBuckets [CAMERA ].unk2 [2 ] = 0x40 ;
142+ gGT -> threadBuckets [CAMERA ].rectCol [0 ] = 0x80 ;
143+ gGT -> threadBuckets [CAMERA ].rectCol [1 ] = 0x80 ;
144+ gGT -> threadBuckets [CAMERA ].rectCol [2 ] = 0x40 ;
148145
149146 gGT -> threadBuckets [HUD ].boolCantPause = 1 ;
150- gGT -> threadBuckets [HUD ].unk2 [0 ] = 0x80 ;
151- gGT -> threadBuckets [HUD ].unk2 [1 ] = 0x80 ;
152- gGT -> threadBuckets [HUD ].unk2 [2 ] = 0x80 ;
147+ gGT -> threadBuckets [HUD ].rectCol [0 ] = 0x80 ;
148+ gGT -> threadBuckets [HUD ].rectCol [1 ] = 0x80 ;
149+ gGT -> threadBuckets [HUD ].rectCol [2 ] = 0x80 ;
153150
154151 gGT -> threadBuckets [PAUSE ].boolCantPause = 0 ;
155- gGT -> threadBuckets [PAUSE ].unk2 [0 ] = 0 ;
156- gGT -> threadBuckets [PAUSE ].unk2 [1 ] = 0x80 ;
157- gGT -> threadBuckets [PAUSE ].unk2 [2 ] = 0 ;
152+ gGT -> threadBuckets [PAUSE ].rectCol [0 ] = 0 ;
153+ gGT -> threadBuckets [PAUSE ].rectCol [1 ] = 0x80 ;
154+ gGT -> threadBuckets [PAUSE ].rectCol [2 ] = 0 ;
155+ #endif
158156
159157 // particles
160158 gGT -> particleList_ordinary = NULL ;
0 commit comments