Merge pull request #682 from Eebit/ending-details-cleanup
Some checks failed
Build CI / build (push) Has been cancelled

Cleanup `ending_details`
This commit is contained in:
Revo 2024-10-27 19:56:59 -04:00 committed by GitHub
commit 1193deefdd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 1114 additions and 831 deletions

View File

@ -260,8 +260,8 @@ gUnknown_085A638C: @ 0x085A638C
gUnknown_085A643C: @ 0x085A643C
.incbin "baserom.gba", 0x5A643C, 0x40
.global gUnknown_085A647C
gUnknown_085A647C: @ 0x085A647C
.global Tsa_PlayerRankFog
Tsa_PlayerRankFog: @ 0x085A647C
.incbin "baserom.gba", 0x5A647C, 0x804
.global Img_DanceringFx

View File

@ -184,8 +184,8 @@ gPal_08A07C58: @ 0x08A07C58
Img_ChapterIntroFog: @ 0x08A07DD8
.incbin "baserom.gba", 0xA07DD8, 0x1C84
.global gUnknown_08A09A5C
gUnknown_08A09A5C: @ 0x08A09A5C
.global Pal_PlayerRankFog
Pal_PlayerRankFog: @ 0x08A09A5C
.incbin "baserom.gba", 0xA09A5C, 0x3F0
.global gGfx_08A09E4C

View File

@ -2,20 +2,20 @@
.incbin "baserom.gba", 0xA3EFB4, 0x75C
.global gPal_CharacterEndingMenu
gPal_CharacterEndingMenu: @ 0x08A3F710
.global Pal_CharacterEndingMenu
Pal_CharacterEndingMenu: @ 0x08A3F710
.incbin "baserom.gba", 0xA3F710, 0x40
.global gGfx_CharacterEndingMenu
gGfx_CharacterEndingMenu: @ 0x08A3F750
.global Img_CharacterEndingMenu
Img_CharacterEndingMenu: @ 0x08A3F750
.incbin "baserom.gba", 0xA3F750, 0x89C
.global gUnknown_08A3FFEC
gUnknown_08A3FFEC: @ 0x08A3FFEC
.global Tsa_CharacterEnding_TopBorder
Tsa_CharacterEnding_TopBorder: @ 0x08A3FFEC
.incbin "baserom.gba", 0xA3FFEC, 0x7C
.global gUnknown_08A40068
gUnknown_08A40068: @ 0x08A40068
.global Tsa_CharacterEnding_BottomBorder
Tsa_CharacterEnding_BottomBorder: @ 0x08A40068
.incbin "baserom.gba", 0xA40068, 0x7C
.global gTsa_SoloEndingNameplate
@ -34,24 +34,24 @@ gTsa_PairedEndingNameplates: @ 0x08A4034C
gTsa_PairedEndingWindow: @ 0x08A40470
.incbin "baserom.gba", 0xA40470, 0x144
.global gPal_FinScreen
gPal_FinScreen: @ 0x08A405B4
.global Pal_FinScreen
Pal_FinScreen: @ 0x08A405B4
.incbin "baserom.gba", 0xA405B4, 0x20
.global gGfx_FinScreen
gGfx_FinScreen: @ 0x08A405D4
.global Img_FinScreen
Img_FinScreen: @ 0x08A405D4
.incbin "baserom.gba", 0xA405D4, 0x3FC
.global gTsa_FinScreen
gTsa_FinScreen: @ 0x08A409D0
.global Tsa_FinScreen
Tsa_FinScreen: @ 0x08A409D0
.incbin "baserom.gba", 0xA409D0, 0x104
.global gUnknown_08A40AD4
gUnknown_08A40AD4: @ 0x08A40AD4
.global Pal_08A40AD4
Pal_08A40AD4: @ 0x08A40AD4
.incbin "baserom.gba", 0xA40AD4, 0x40
.global gUnknown_08A40B14
gUnknown_08A40B14: @ 0x08A40B14
.global Tsa_08A40B14
Tsa_08A40B14: @ 0x08A40B14
.incbin "baserom.gba", 0xA40B14, 0x4B4
.global Pal_StaffReelEnt_08A40FC8

View File

@ -1,6 +1,93 @@
#pragma once
enum chapter_idx {
// todo
CHAPTER_IDX_PROLOGUE = 0,
enum chapter_idx
{
CHAPTER_L_PROLOGUE = 0x00, // The Fall of Renais
CHAPTER_L_1 = 0x01, // Ch1: Escape!
CHAPTER_L_2 = 0x02, // Ch2: The Protected
CHAPTER_L_3 = 0x03, // Ch3: The Bandits of Borgo
CHAPTER_L_4 = 0x04, // Ch4: Ancient Horrors
CHAPTER_L_5X = 0x05, // Ch5x: Unbroken Heart
CHAPTER_L_5 = 0x06, // Ch5: The Empire's Reach
CHAPTER_L_6 = 0x07, // Ch6: Victims of War
CHAPTER_L_7 = 0x08, // Ch7: Waterside Renvall
CHAPTER_L_8 = 0x09, // Ch8: It's a Trap!
CHAPTER_E_9 = 0x0A, // Ch9: Distant Blade
CHAPTER_E_10 = 0x0B, // Ch10: Revolt at Carcino
CHAPTER_E_12 = 0x0C, // Ch12: Village of Silence
CHAPTER_E_13 = 0x0D, // Ch13: Hamill Canyon
CHAPTER_E_14 = 0x0E, // Ch14: Queen of White Dunes
CHAPTER_E_15 = 0x0F, // Ch15: Scorched Sand
CHAPTER_E_16 = 0x10, // Ch16: Ruled by Madness
CHAPTER_E_17 = 0x11, // Ch17: River of Regrets
CHAPTER_E_18 = 0x12, // Ch18: Two Faces of Evil
CHAPTER_E_19 = 0x13, // Ch19: Last Hope
CHAPTER_E_20 = 0x14, // Ch20: Darkling Woods
CHAPTER_E_21 = 0x15, // Ch21: Sacred Stone
CHAPTER_E_21X = 0x16, // Ch21x: Sacred Stone
CHAPTER_I_9 = 0x17, // Ch9: Fort Rigwald
CHAPTER_I_10 = 0x18, // Ch10: Turning Traitor
CHAPTER_I_12 = 0x19, // Ch12: Landing at Taizel
CHAPTER_I_13 = 0x1A, // Ch13: Fluorspar's Oath
CHAPTER_I_14 = 0x1B, // Ch14: Father and Son
CHAPTER_I_15 = 0x1C, // Ch15: Scorched Sand
CHAPTER_I_16 = 0x1D, // Ch16: Ruled by Madness
CHAPTER_I_17 = 0x1E, // Ch17: River of Regrets
CHAPTER_I_18 = 0x1F, // Ch18: Two Faces of Evil
CHAPTER_I_19 = 0x20, // Ch19: Last Hope
CHAPTER_I_20 = 0x21, // Ch20: Darkling Woods
CHAPTER_I_21 = 0x22, // Ch21: Sacred Stone
CHAPTER_I_21X = 0x23, // Ch21x: Sacred Stone
CHAPTER_T_01 = 0x24, // Tower of Valni 1
CHAPTER_T_02 = 0x25, // Tower of Valni 2
CHAPTER_T_03 = 0x26, // Tower of Valni 3
CHAPTER_T_04 = 0x27, // Tower of Valni 4
CHAPTER_T_05 = 0x28, // Tower of Valni 5
CHAPTER_T_06 = 0x29, // Tower of Valni 6
CHAPTER_T_07 = 0x2A, // Tower of Valni 7
CHAPTER_T_08 = 0x2B, // Tower of Valni 8
CHAPTER_2C = 0x2C,
CHAPTER_2D = 0x2D,
CHAPTER_R_01 = 0x2E, // Lagdou Ruins 1
CHAPTER_R_02 = 0x2F, // Lagdou Ruins 2
CHAPTER_R_03 = 0x30, // Lagdou Ruins 3
CHAPTER_R_04 = 0x31, // Lagdou Ruins 4
CHAPTER_R_05 = 0x32, // Lagdou Ruins 5
CHAPTER_R_06 = 0x33, // Lagdou Ruins 6
CHAPTER_R_07 = 0x34, // Lagdou Ruins 7
CHAPTER_R_08 = 0x35, // Lagdou Ruins 8
CHAPTER_R_09 = 0x36, // Lagdou Ruins 9
CHAPTER_R_10 = 0x37, // Lagdou Ruins 10
CHAPTER_CASTLE_FRELIA = 0x38,
CHAPTER_MALKAEN_COAST = 0x39,
CHAPTER_3A = 0x3A,
CHAPTER_3B = 0x3B,
CHAPTER_3C = 0x3C,
CHAPTER_E_11 = 0x3D, // Ch11: Creeping Darkness
CHAPTER_I_11 = 0x3E, // Ch11: Phantom Ship
CHAPTER_3F = 0x3F,
CHAPTER_40 = 0x40,
CHAPTER_41 = 0x41,
CHAPTER_42 = 0x42,
CHAPTER_43 = 0x43,
CHAPTER_44 = 0x44,
CHAPTER_45 = 0x45,
CHAPTER_46 = 0x46,
CHAPTER_47 = 0x47,
CHAPTER_48 = 0x48,
CHAPTER_49 = 0x49,
CHAPTER_4A = 0x4A,
CHAPTER_4B = 0x4B,
CHAPTER_4C = 0x4C,
CHAPTER_4D = 0x4D,
CHAPTER_4E = 0x4E,
};

View File

@ -40,6 +40,8 @@ enum song_idx {
SONG_43 = 0x43,
SONG_44 = 0x44,
SONG_45 = 0x45,
SONG_BGM_ED_AFTER = 0x046,
SONG_BGM_ED_STAFF_2 = 0x056,
SONG_5A = 0x5A,
SONG_5B = 0x5B,
SONG_5C = 0x5C,

View File

@ -1,14 +1,16 @@
#ifndef GUARD_ENDINGDETAILS_H
#define GUARD_ENDINGDETAILS_H
enum {
enum
{
CHARACTER_ENDING_NONE = 0,
CHARACTER_ENDING_SOLO = 1,
CHARACTER_ENDING_PAIRED = 2,
};
enum {
enum
{
DEFEAT_DIED = 0,
DEFEAT_WOUNDED_PARTEDWAYS = 1, // unused in FE8
DEFEAT_WOUNDED_REMAINED = 2,
@ -17,84 +19,100 @@ enum {
DEFEAT_TYPE_5 = 5,
};
struct EndingTitleEnt {
#define DEFEAT_SKIRMISH_FLAG_BIT 15
#define DEFEAT_SKIRMISH_MASK (1 << DEFEAT_SKIRMISH_FLAG_BIT)
#define SetDefeatDetails(defeatLocation, defeatSkirmish) ((defeatLocation) | ((defeatSkirmish) << DEFEAT_SKIRMISH_FLAG_BIT))
#define GetDefeatLocation(defeatDetails) ((defeatDetails) & ~DEFEAT_SKIRMISH_MASK)
#define IsSkirmishDefeat(defeatDetails) ((defeatDetails) & DEFEAT_SKIRMISH_MASK)
struct EndingTitleEnt
{
/* 00 */ u8 pid;
/* 04 */ int titleTextId;
};
struct EndingDefeatEnt {
struct EndingDefeatEnt
{
/* 00 */ u8 pid;
/* 01 */ u8 defeatType;
};
struct CharacterEndingEnt {
struct CharacterEndingEnt
{
/* 00 */ u8 type;
/* 01 */ u8 pidA;
/* 02 */ u8 pidB;
/* 04 */ int textId;
};
struct CharacterEndingProc {
struct CharacterEndingProc
{
/* 00 */ PROC_HEADER;
/* 29 */ u8 _pad[0x2E - 0x29];
/* 2E */ u16 unk_2e;
/* 30 */ struct CharacterEndingEnt* unk_30;
/* 34 */ struct CharacterEndingEnt* unk_34;
/* 38 */ struct Unit* unitA;
/* 3C */ struct Unit* unitB;
/* 40 */ u32 unk_40[8]; // flags for characters who have already been shown in an ending
/* 29 */ STRUCT_PAD(0x29, 0x2E);
/* 2E */ u16 unk_2e; // unused? Initialized and unreferenced after
/* 30 */ struct CharacterEndingEnt * pCharacterEnding;
/* 34 */ struct CharacterEndingEnt * pCharacterEndingBkp;
/* 38 */ struct Unit * unitA;
/* 3C */ struct Unit * unitB;
/* 40 */ u32 pidShownFlags[8]; // flags for characters who have already been shown in an ending
};
struct EndingBattleDisplayProc {
struct EndingBattleDisplayProc
{
/* 00 */ PROC_HEADER;
/* 2C */ struct Unit* units[2];
/* 34 */ int unk_34;
/* 38 */ struct CharacterEndingEnt* pCharacterEnding;
/* 2C */ struct Unit * units[2];
/* 34 */ int timer;
/* 38 */ struct CharacterEndingEnt * pCharacterEnding;
/* 3C */ u16 battleAmounts[2];
/* 40 */ u16 winAmounts[2];
/* 44 */ u16 lossAmounts[2];
};
struct EndingBattleTextProc {
struct EndingBattleTextProc
{
/* 00 */ PROC_HEADER;
/* 2C */ struct CharacterEndingEnt* pCharacterEnding;
/* 30 */ struct Unit* unitA;
/* 34 */ struct Unit* unitB;
/* 38 */ u32 unk_38;
/* 2C */ struct CharacterEndingEnt * pCharacterEnding;
/* 30 */ struct Unit * unitA;
/* 34 */ struct Unit * unitB;
/* 38 */ STRUCT_PAD(0x38, 0x3C);
/* 3C */ int pauseTimer;
/* 40 */ int defaultPauseDelay;
/* 44 */ const char* str;
/* 48 */ struct Text* Text;
/* 44 */ const char * str;
/* 48 */ struct Text * text;
};
struct FinScreenProc {
struct FinScreenProc
{
/* 00 */ PROC_HEADER;
/* 29 */ u8 _pad[0x4c-0x29];
/* 4C */ u16 unk_4c;
/* 4E */ u8 _pad2[0x58-0x4e];
/* 58 */ int unk_58;
/* 29 */ STRUCT_PAD(0x29, 0x4C);
/* 4C */ u16 blendTimer;
/* 4E */ STRUCT_PAD(0x4E, 0x58);
/* 58 */ int timer;
};
struct EndingTurnRecordProc {
struct EndingTurnRecordProc
{
/* 00 */ PROC_HEADER;
/* 2C */ int unk_2c;
/* 30 */ int unk_30;
/* 34 */ int unk_34;
/* 38 */ u8 unk_38;
/* 39 */ u8 unk_39;
/* 3A */ u8 _pad[0x4c-0x3a];
/* 2C */ int chapterId;
/* 30 */ int yPos;
/* 34 */ int yScrollAmt;
/* 38 */ u8 chapterStatsIdx;
/* 39 */ u8 displayId;
/* 3A */ STRUCT_PAD(0x3A, 0x4C);
/* 4C */ s16 unk_4c;
};
struct UnkProc {
struct UnkProc
{
/* 00 */ PROC_HEADER;
/* 29 */ u8 _pad[0x40-0x29];
/* 29 */ STRUCT_PAD(0x29, 0x40);
/* 40 */ u8 unk_40[12]; // size unknown
/* 4C */ u16 unk_4c[5];
};
@ -114,10 +132,10 @@ extern char * CONST_DATA gpDefeatedEndingLocString;
// ??? SetupCharacterEndingGfx(???);
// ??? sub_80B6810(???);
// ??? sub_80B689C(???);
// ??? sub_80B6920(???);
// ??? InitCharacterEndingText(???);
// ??? CharacterEnding_Init(???);
// ??? sub_80B69D4(???);
// ??? sub_80B6A10(???);
// ??? CharacterEnding_80B69D4(???);
// ??? GetUnitForCharacterEnding(???);
// ??? GetUnitASupporterPid(???);
// ??? DoesUnitHavePairedEnding(???);
// ??? LoadNextCharacterEnding(???);
@ -126,19 +144,19 @@ extern char * CONST_DATA gpDefeatedEndingLocString;
// ??? CharacterEnding_End(???);
// ??? CharacterEnding_Unused_80B6C74(???);
void StartCharacterEndings(ProcPtr parent);
// ??? sub_80B6CA8(???);
// ??? CharacterEnding_LoadUnitBattleStats(???);
// ??? SoloEndingBattleDisp_Init(???);
// ??? SoloEndingBattleDisp_Loop(???);
// ??? StartSoloEndingBattleDisplay(???);
// ??? sub_80B6F34(???);
// ??? sub_80B71DC(???);
// ??? sub_80B723C(???);
// ??? sub_80B7274(???);
// ??? StartPairedEndingBattleDisplay(???);
void StartSoloEndingBattleDisplay(struct CharacterEndingEnt *, struct Unit *, struct CharacterEndingProc *);
// ??? PairedEndingBattleDisp_Init(???);
// ??? PairedEndingBattleDisp_Loop_SlideIn(???);
// ??? PairedEndingBattleDisp_InitBlend(???);
// ??? PairedEndingBattleDisp_Loop_Blend(???);
void StartPairedEndingBattleDisplay(struct CharacterEndingEnt *, struct Unit *, struct Unit *, struct CharacterEndingProc *);
// ??? EndingBattleInitText(???);
// ??? EndingBattleText_Loop(???);
// ??? StartEndingBattleText(???);
// ??? EndEndingBattleText(???);
void StartEndingBattleText(struct CharacterEndingEnt *, struct Unit *, struct Unit *, struct CharacterEndingProc *);
void EndEndingBattleText(void);
// ??? SetupFinScreenGfx(???);
// ??? Fin_Init(???);
// ??? Fin_Loop_KeyListener(???);
@ -148,13 +166,13 @@ void StartCharacterEndings(ProcPtr parent);
void StartFinScreen(ProcPtr);
// ??? sub_80B75AC(???);
// ??? sub_80B7614(???);
// ??? sub_80B7648(???);
// ??? sub_80B770C(???);
// ??? sub_80B7800(???);
// ??? sub_80B7B30(???);
// ??? TurnRecord_Init(???);
// ??? TurnRecord_SetupText(???);
// ??? HandleTurnRecordText(???);
// ??? TurnRecord_Loop_Main(???);
// ??? sub_80B7BD8(???);
// ??? sub_80B8014(???);
// ??? sub_80B8168(???);
// ??? TurnRecord_SetupGfx(???);
// ??? TurnRecord_End(???);
void StartEndingTurnRecordScreen(ProcPtr parent);
#endif // GUARD_ENDINGDETAILS_H

View File

@ -145,7 +145,7 @@ int FaceBlinkProc_GenBlinkInterval(struct FaceBlinkProc* proc);
void sub_80064D4(struct FaceProc* proc, int unk);
void sub_80064DC(int slot, int unk);
struct FaceProc* StartFace2(int slot, int fid, int x, int y, int disp);
void sub_8006618(int slot, int x, int y);
void SetFacePosition(int slot, int x, int y);
void sub_800662C(struct UnkFaceProc* proc);
void sub_8006650(struct UnkFaceProc* proc);
void sub_80066A8(struct UnkFaceProc* proc);

View File

@ -461,7 +461,7 @@ extern u16 CONST_DATA Tsa_EventWarp[];
extern u8 gUnknown_085A638C[];
extern u16 gUnknown_085A643C[];
extern u8 gUnknown_085A647C[]; // tsa
extern u8 Tsa_PlayerRankFog[]; // tsa
extern u16 CONST_DATA Img_DanceringFx[];
extern u16 CONST_DATA Tsa_DanceringFx[];
@ -833,7 +833,7 @@ extern u16 gPal_08A07AD8[]; // pal
// extern ??? gUnknown_08A07C0A
extern u16 gPal_08A07C58[]; // pal
extern u16 CONST_DATA Img_ChapterIntroFog[];
extern u16 gUnknown_08A09A5C[]; // pal
extern u16 Pal_PlayerRankFog[]; // pal
extern u8 gGfx_08A09E4C[]; // gfx
// extern ??? gUnknown_08A0A4E8
extern u8 gTsa_08A0A9F8[]; // tsa
@ -997,19 +997,19 @@ extern u16 gUnknown_08A37300[]; // pal
// extern ??? gUnknown_08A3CB50
// extern ??? gCGDataTable
extern u16 gPal_CharacterEndingMenu[];
extern u8 gGfx_CharacterEndingMenu[];
extern u8 gUnknown_08A3FFEC[]; // tsa
extern u8 gUnknown_08A40068[]; // tsa
extern u16 Pal_CharacterEndingMenu[];
extern u8 Img_CharacterEndingMenu[];
extern u8 Tsa_CharacterEnding_TopBorder[]; // tsa
extern u8 Tsa_CharacterEnding_BottomBorder[]; // tsa
extern u8 gTsa_SoloEndingNameplate[];
extern u8 gTsa_SoloEndingWindow[];
extern u8 gTsa_PairedEndingNameplates[];
extern u8 gTsa_PairedEndingWindow[];
extern u16 gPal_FinScreen[];
extern u8 gGfx_FinScreen[];
extern u8 gTsa_FinScreen[];
extern u16 gUnknown_08A40AD4[]; // pal
extern u8 gUnknown_08A40B14[]; // tsa
extern u16 Pal_FinScreen[];
extern u8 Img_FinScreen[];
extern u8 Tsa_FinScreen[];
extern u16 Pal_08A40AD4[]; // pal
extern u8 Tsa_08A40B14[]; // tsa
extern u16 Pal_StaffReelEnt_08A40FC8[];
extern u8 Img_StaffReelEnt_08A40FE8[];
extern u8 Img_StaffReelEnt_08A41B30[];

File diff suppressed because it is too large Load Diff

View File

@ -1380,7 +1380,7 @@ struct FaceProc* StartFace2(int slot, int fid, int x, int y, int disp) {
}
//! FE8U = 0x08006618
void sub_8006618(int slot, int x, int y) {
void SetFacePosition(int slot, int x, int y) {
gFaces[slot]->xPos = x;
gFaces[slot]->yPos = y;

View File

@ -1508,7 +1508,7 @@ void UpdatePrepItemScreenFace(int slot, struct Unit* unit, u16 x, u16 y, u16 dis
}
} else {
if (unit != NULL) {
sub_8006618(slot, (s16)x, (s16)y);
SetFacePosition(slot, (s16)x, (s16)y);
SetFaceDisplayBitsById(slot, disp);
}
}