Skip to content

Commit a242557

Browse files
authored
Merge pull request #713 from Eebit/chapterintro_revisit
Code review on `chapterintrofx`
2 parents d825506 + 6be83a8 commit a242557

File tree

9 files changed

+643
-556
lines changed

9 files changed

+643
-556
lines changed

data/data_B12A60.s

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,34 +28,34 @@ Img_08B17864: @ 0x08B17864
2828
Pal_08B17B44: @ 0x08B17B44
2929
.incbin "baserom.gba", 0xB17B44, 0x20
3030

31-
.global Img_08B17B64
32-
Img_08B17B64: @ 0x08B17B64
31+
.global Img_ChapterIntro_LensFlare
32+
Img_ChapterIntro_LensFlare: @ 0x08B17B64
3333
.incbin "baserom.gba", 0xB17B64, 0x1204
3434

3535
.global Tsa_08B18D68
3636
Tsa_08B18D68: @ 0x08B18D68
3737
.incbin "baserom.gba", 0xB18D68, 0x16C
3838

39-
.global Pal_08B18ED4
40-
Pal_08B18ED4: @ 0x08B18ED4
39+
.global Pal_ChapterIntro_LensFlare
40+
Pal_ChapterIntro_LensFlare: @ 0x08B18ED4
4141
.incbin "baserom.gba", 0xB18ED4, 0x60
4242

43-
.global Img_08B18F34
44-
Img_08B18F34: @ 0x08B18F34
43+
.global Img_ChapterIntro_Fog
44+
Img_ChapterIntro_Fog: @ 0x08B18F34
4545
.incbin "baserom.gba", 0xB18F34, 0x7A4
4646

47-
.global Img_08B196D8
48-
Img_08B196D8: @ 0x08B196D8
47+
.global Tsa_ChapterIntro_Fog
48+
Tsa_ChapterIntro_Fog: @ 0x08B196D8
4949
.incbin "baserom.gba", 0xB196D8, 0x17C
5050

51-
.global Pal_08B19854
52-
Pal_08B19854: @ 0x08B19854
51+
.global Pal_ChapterIntro_Fog
52+
Pal_ChapterIntro_Fog: @ 0x08B19854
5353
.incbin "baserom.gba", 0xB19854, 0x20
5454

55-
.global Img_08B19874
56-
Img_08B19874: @ 0x08B19874
55+
.global Img_ChapterIntro_Sprites
56+
Img_ChapterIntro_Sprites: @ 0x08B19874
5757
.incbin "baserom.gba", 0xB19874, 0x578
5858

59-
.global Pal_08B19DEC
60-
Pal_08B19DEC: @ 0x08B19DEC
59+
.global Pal_ChapterIntro_Sprites
60+
Pal_ChapterIntro_Sprites: @ 0x08B19DEC
6161
.incbin "baserom.gba", 0xB19DEC, 0x20

include/bmfx.h

Lines changed: 49 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,21 @@ struct ProcBmFx {
2626
/* 66 */ s16 yPos;
2727
};
2828

29-
struct ChapterIntroFXProc {
29+
struct ChapterIntroFxProc
30+
{
3031
/* 00 */ PROC_HEADER;
3132

32-
/* 2C */ int unk_2C;
33-
/* 30 */ int unk_30;
33+
/* 2C */ int xLight;
34+
/* 30 */ int yLight;
3435

35-
u8 _pad1[0x4C-0x34];
36+
STRUCT_PAD(0x34, 0x4C);
3637

37-
/* 4C */ s16 unk_4C;
38+
/* 4C */ s16 timer;
3839
/* 4E */ s16 unk_4E;
39-
/* 50 */ s16 unk_50;
40-
/* 52 */ u16 unk_52;
40+
/* 50 */ s16 skipTarget;
41+
/* 52 */ u16 isSkipping;
4142

42-
u8 _pad2[0x64-0x54];
43+
STRUCT_PAD(0x54, 0x64);
4344

4445
/* 64 */ s16 unk_64;
4546
/* 66 */ s16 unk_66;
@@ -103,52 +104,53 @@ void EndEventEarthQuake(void);
103104
// ??? StoneShatterEvent_OnEnd(???);
104105
void StartStoneShatterAnim(struct Unit *, ProcPtr);
105106

106-
void ChapterIntro_Bg3Scroll_Loop(void);
107-
void ChapterIntro_KeyListen_Init(struct ChapterIntroFXProc * proc);
108-
void ChapterIntro_KeyListen_Loop(struct ChapterIntroFXProc * proc);
109-
void ChapterIntro_801FFD0(struct ChapterIntroFXProc * proc);
110-
void ChapterIntro_801FFD8_Loop(struct ChapterIntroFXProc * proc);
111-
void ChapterIntro_LightBurst_Init(struct ChapterIntroFXProc * proc);
112-
void ChapterIntro_LightBurst_Loop(struct ChapterIntroFXProc * proc);
113-
void ChapterIntro_BeginCloseTextMaybe(struct ChapterIntroFXProc * proc);
114-
void ChapterIntro_LoopCloseTextMaybe(struct ChapterIntroFXProc * proc);
115-
void ChapterIntro_Init(struct ChapterIntroFXProc * proc);
116-
void ChapterIntro_SetSkipTarget(s16 arg, struct ChapterIntroFXProc * proc);
117-
void ChapterIntro_Init_PlaySound316(struct ChapterIntroFXProc * proc);
118-
void ChapterIntro_DrawingLights(struct ChapterIntroFXProc * proc);
107+
void ChapterIntro_Bg2Scroll_Loop(void);
108+
void ChapterIntro_KeyListen_Init(struct ChapterIntroFxProc * proc);
109+
void ChapterIntro_KeyListen_Loop(struct ChapterIntroFxProc * proc);
110+
void ChapterIntro_Bg1And3Scroll_Init(struct ChapterIntroFxProc * proc);
111+
void ChapterIntro_Bg1And3Scroll_Loop(struct ChapterIntroFxProc * proc);
112+
void ChapterIntro_LightBurst_Init(struct ChapterIntroFxProc * proc);
113+
void ChapterIntro_LightBurst_Loop(struct ChapterIntroFxProc * proc);
114+
void ChapterIntro_RevealDecalSprite_Init(struct ChapterIntroFxProc * proc);
115+
void ChapterIntro_RevealDecalSprite_Loop(struct ChapterIntroFxProc * proc);
116+
void ChapterIntro_Init(struct ChapterIntroFxProc * proc);
117+
void ChapterIntro_SetSkipTarget(s16 arg, struct ChapterIntroFxProc * proc);
118+
void ChapterIntro_TwinLights_InitAndPlaySe(struct ChapterIntroFxProc * proc);
119+
void ChapterIntro_TwinLights_Loop(struct ChapterIntroFxProc * proc);
119120
void ChapterIntro_InitBLDCNT(void);
120-
void ChapterIntro_DrawChapterTitleMaybe(void);
121-
void ChapterIntro_80204AC(struct ChapterIntroFXProc * proc);
122-
void ChapterIntro_UnknownFX8020578(struct ChapterIntroFXProc * proc);
121+
void ChapterIntro_DrawChapterTitle(void);
122+
void ChapterIntro_LightExplosion_Init(struct ChapterIntroFxProc * proc);
123+
void ChapterIntro_LightExplosion_Loop(struct ChapterIntroFxProc * proc);
123124
void ChapterIntro_SetBG_802009C(void);
124-
void ChapterIntro_8020944(struct ChapterIntroFXProc * proc);
125-
void ChapterIntro_80209D8(struct ChapterIntroFXProc * proc);
126-
void ChapterIntro_SetTimerMaybe(s16 arg, struct ChapterIntroFXProc * proc);
127-
void ChapterIntro_TickTimerMaybe(struct ChapterIntroFXProc * proc);
128-
void ChapterIntro_8020A40(struct ChapterIntroFXProc * proc);
129-
void ChapterIntro_8020A8C(struct ChapterIntroFXProc * proc);
130-
void ChapterIntro_8020B20(void);
125+
void ChapterIntro_InitFogGfx(struct ChapterIntroFxProc * proc);
126+
void ChapterIntro_BlendFogAlpha_Loop(struct ChapterIntroFxProc * proc);
127+
void ChapterIntro_SetTimer(s16 arg, struct ChapterIntroFxProc * proc);
128+
void ChapterIntro_TickTimerMaybe(struct ChapterIntroFxProc * proc);
129+
void ChapterIntro_8020A40(struct ChapterIntroFxProc * proc);
130+
void ChapterIntro_8020A8C(struct ChapterIntroFxProc * proc);
131+
void ChapterIntro_InitCameraYPos(void);
131132
void ChapterIntro_InitMapDisplay(void);
132-
void ChapterIntro_BeginFadeToMap(struct ChapterIntroFXProc * proc);
133-
void ChapterIntro_LoopFadeToMap(struct ChapterIntroFXProc * proc);
134-
void ChapterIntro_BeginFadeOut(struct ChapterIntroFXProc * proc);
135-
void ChapterIntro_LoopFadeOut(struct ChapterIntroFXProc * proc);
136-
void ChapterIntro_BeginFastFadeToMap(struct ChapterIntroFXProc * proc);
137-
void ChapterIntro_LoopFastFadeToMap(struct ChapterIntroFXProc * proc);
138-
void ChapterIntro_80210C8(void);
133+
void ChapterIntro_BeginFadeToMap(struct ChapterIntroFxProc * proc);
134+
void ChapterIntro_LoopFadeToMap(struct ChapterIntroFxProc * proc);
135+
void ChapterIntro_BeginFadeOut(struct ChapterIntroFxProc * proc);
136+
void ChapterIntro_LoopFadeOut(struct ChapterIntroFxProc * proc);
137+
void ChapterIntro_BeginFastFadeToMap(struct ChapterIntroFxProc * proc);
138+
void ChapterIntro_LoopFastFadeToMap(struct ChapterIntroFxProc * proc);
139+
void ChapterIntro_End(void);
139140
void ChapterIntro_8020AF8(void);
140-
void ChapterIntro_8021188(struct ChapterIntroFXProc * proc);
141+
void ChapterIntro_8021188(struct ChapterIntroFxProc * proc);
141142

142-
void ChapterIntro_80207C8(void);
143-
extern struct ProcCmd sProcScr_ChapterIntro_0859B198[];
143+
void ChapterIntro_PutDecalSprite_Loop(void);
144+
extern struct ProcCmd ProcScr_ChapterIntro_RevealDecalSprite[];
145+
extern struct ProcCmd ProcScr_ChapterIntro_KeyListen[];
144146
extern u8 Img_CommGameBgScreen[];
145-
extern u8 Img_08B17B64[];
147+
extern u8 Img_ChapterIntro_LensFlare[];
146148
extern u8 Tsa_08B18D68[];
147-
extern u8 Img_08B19874[];
148-
extern u8 Pal_08B19DEC[];
149-
extern u16 Img_08B18F34[];
150-
extern u16 Pal_08B19854[];
151-
extern u16 Img_08B196D8[];
149+
extern u8 Img_ChapterIntro_Sprites[];
150+
extern u8 Pal_ChapterIntro_Sprites[];
151+
extern u16 Img_ChapterIntro_Fog[];
152+
extern u16 Pal_ChapterIntro_Fog[];
153+
extern u16 Tsa_ChapterIntro_Fog[];
152154

153155
void ProcBmFx_CommonEnd(struct ProcBmFx *proc);
154156

include/constants/songs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ enum song_idx {
278278
SONG_312 = 0x312,
279279
SONG_313 = 0x313,
280280
SONG_314 = 0x314,
281-
SONG_316 = 0x316,
281+
SONG_SYS_CHAPTER_START = 0x316,
282282
SONG_317 = 0x317,
283283
SONG_320 = 0x320,
284284
SONG_321 = 0x321,

include/ctc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ struct OAM_Attr0 {
3535
#define OAM0_SHAPE_32x64 0x8000
3636

3737
#define OAM1_X(ax) ((ax) & 0x01FF)
38-
#define OAM1_AFFINE_ID(ai) (((ai) << 9) & 0x3E00)
38+
#define OAM1_AFFINE_ID(ai) ((ai) << 9)
3939
#define OAM1_HFLIP 0x1000
4040
#define OAM1_VFLIP 0x2000
4141
#define OAM1_SIZE_8x8 0x0000

include/variables.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,14 +1374,14 @@ extern u16 Pal_08B1756C[]; // pal, used in opsubtitle
13741374
// extern ??? Img_08B177C0
13751375
// extern ??? Img_08B17864
13761376
// extern ??? Pal_08B17B44
1377-
extern u8 Img_08B17B64[]; // gfx?
1377+
extern u8 Img_ChapterIntro_LensFlare[]; // gfx?
13781378
extern u8 Tsa_08B18D68[];
1379-
extern u16 Pal_08B18ED4[]; // pal
1380-
// extern ??? Img_08B18F34
1381-
// extern ??? Img_08B196D8
1382-
// extern ??? Pal_08B19854
1383-
// extern ??? Img_08B19874
1384-
// extern ??? Pal_08B19DEC
1379+
extern u16 Pal_ChapterIntro_LensFlare[]; // pal
1380+
// extern ??? Img_ChapterIntro_Fog
1381+
// extern ??? Tsa_ChapterIntro_Fog
1382+
// extern ??? Pal_ChapterIntro_Fog
1383+
// extern ??? Img_ChapterIntro_Sprites
1384+
// extern ??? Pal_ChapterIntro_Sprites
13851385
// extern ??? gGuideTable
13861386
// extern ??? _impure_ptr
13871387
// extern ??? gUnknown_08B1FA24

0 commit comments

Comments
 (0)