88#include "gba/syscall.h"
99#include "game/shared/stage/spot_light_beam_task.h"
1010
11- void Task_SpotlightBeamTask (void );
12- void TaskDestructor_SpotlightBeamTask (struct Task * );
13-
14- /* This task is related to spot lights in Ice Paradise. */
11+ void Task_SpotlightBeam (void );
12+ void TaskDestructor_SpotlightBeam (struct Task * );
1513
1614struct Task * CreateSpotlightBeamTask (void )
1715{
18- struct Task * t = TaskCreate (Task_SpotlightBeamTask , sizeof (SpotlightBeam ), 0x2000 , 0 , TaskDestructor_SpotlightBeamTask );
16+ struct Task * t = TaskCreate (Task_SpotlightBeam , sizeof (SpotlightBeam ), 0x2000 , 0 , TaskDestructor_SpotlightBeam );
1917 SpotlightBeam * beam = TASK_DATA (t );
2018
2119 beam -> unk6 = 120 ;
@@ -35,11 +33,17 @@ typedef struct {
3533
3634} Struct_SP10 ;
3735
36+ #if (GAME == GAME_SA1 )
37+ NONMATCH ("asm/non_matching/game/shared/stage/sa1_Task_SpotlightBeam.inc" , void Task_SpotlightBeam (void ))
38+ #elif (GAME == GAME_SA2 )
3839// (68.53%) https://decomp.me/scratch/NchTb
3940// (66.79%) https://decomp.me/scratch/PmbTP
4041// (52.07%) https://decomp.me/scratch/I1Kkn (M2C generated)
41- NONMATCH ("asm/non_matching/game/shared/stage/Task_SpotlightBeamTask.inc" , void Task_SpotlightBeamTask (void ))
42+ NONMATCH ("asm/non_matching/game/shared/stage/Task_SpotlightBeamTask.inc" , void Task_SpotlightBeam (void ))
43+ #endif
4244{
45+ // NOTE: This was decompiled from the SA2 code
46+ // It may not be the SA1 code, since the asm is difference
4347 TriParam1 sp8 ;
4448 Struct_SP10 sp10 ;
4549 Struct_SP10 sp14 ;
@@ -176,15 +180,15 @@ NONMATCH("asm/non_matching/game/shared/stage/Task_SpotlightBeamTask.inc", void T
176180 } else {
177181 gWinRegs [WINREG_WIN0V ] = WIN_RANGE (sp8 .unk5 , DISPLAY_HEIGHT );
178182 }
179- sub_8006228 (beam -> bg , sp8 .unk4 , sp8 .unk5 , sp8 .unk6 , sp8 .unk7 , 0 );
183+ SA2_LABEL ( sub_8006228 ) (beam -> bg , sp8 .unk4 , sp8 .unk5 , sp8 .unk6 , sp8 .unk7 , 0 );
180184 return ;
181185 }
182186 if (1 & beam -> bg ) {
183187 gWinRegs [WINREG_WIN1V ] = WIN_RANGE (sp8 .unk5 , DISPLAY_HEIGHT );
184188 } else {
185189 gWinRegs [WINREG_WIN0V ] = WIN_RANGE (sp8 .unk5 , DISPLAY_HEIGHT );
186190 }
187- sub_800724C (beam -> bg , & sp8 );
191+ SA2_LABEL ( sub_800724C ) (beam -> bg , & sp8 );
188192 return ;
189193 }
190194
@@ -196,18 +200,18 @@ NONMATCH("asm/non_matching/game/shared/stage/Task_SpotlightBeamTask.inc", void T
196200 gWinRegs [WINREG_WIN0V ] = WIN_RANGE (sp8 .unk1 , DISPLAY_HEIGHT );
197201 }
198202
199- sub_80064A8 (beam -> bg , sp8 .unk0 , sp8 .unk1 , sp8 .unk2 , (s32 )sp8 .unk3 , 0 );
203+ SA2_LABEL ( sub_80064A8 ) (beam -> bg , sp8 .unk0 , sp8 .unk1 , sp8 .unk2 , (s32 )sp8 .unk3 , 0 );
200204 } else {
201205 if (beam -> bg & 0x1 ) {
202206 gWinRegs [WINREG_WIN1V ] = WIN_RANGE (sp8 .unk1 , DISPLAY_HEIGHT );
203207 } else {
204208 gWinRegs [WINREG_WIN0V ] = WIN_RANGE (sp8 .unk1 , DISPLAY_HEIGHT );
205209 }
206210
207- sub_800724C (beam -> bg , & sp8 );
211+ SA2_LABEL ( sub_800724C ) (beam -> bg , & sp8 );
208212 }
209213 }
210214}
211215END_NONMATCH
212216
213- void TaskDestructor_SpotlightBeamTask (struct Task * t ) { gFlags &= ~FLAGS_EXECUTE_HBLANK_COPY ; }
217+ void TaskDestructor_SpotlightBeam (struct Task * t ) { gFlags &= ~FLAGS_EXECUTE_HBLANK_COPY ; }
0 commit comments