From adfa6276d60ceb3e84611892761450b9e87be7fb Mon Sep 17 00:00:00 2001 From: raygunpewpewpew Date: Fri, 27 Feb 2026 23:08:43 -0500 Subject: [PATCH] Add comments to source files --- src/agbmain.c | 10 +++++++--- src/intro.c | 5 ++++- src/menus/file_select.c | 28 ++++++++++++++-------------- src/sprites_ai/chozo_ball.c | 2 +- 4 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/agbmain.c b/src/agbmain.c index bf21ca4c7..28802b50a 100644 --- a/src/agbmain.c +++ b/src/agbmain.c @@ -11,6 +11,10 @@ #include "structs/game_state.h" #include "structs/display.h" +/** + * @brief 23C | 464 | Main loop of the game + * + */ void agbmain(void) { InitializeGame(); @@ -29,7 +33,7 @@ void agbmain(void) UpdateInput(); SoftResetCheck(); - + //Increment frame counters APPLY_DELTA_TIME_INC(gFrameCounter8Bit); APPLY_DELTA_TIME_INC(gFrameCounter16Bit); @@ -111,9 +115,9 @@ void agbmain(void) case GM_FILE_SELECT: if (FileSelectMenuMainLoop()) { - if (gSubGameMode2 == 1) + if (gSubGameMode2 == 1)//If Continuing File gMainGameMode = GM_INGAME; - else if (gSubGameMode2 == 2) + else if (gSubGameMode2 == 2)//If starting New File gMainGameMode = GM_INGAME; else if (gSubGameMode2 == 4) gMainGameMode = GM_FUSION_GALLERY; diff --git a/src/intro.c b/src/intro.c index f2a8ef27b..29708ae68 100644 --- a/src/intro.c +++ b/src/intro.c @@ -136,7 +136,10 @@ static void IntroInit(void) IntroVBlank(); } - +/** + * @brief 803b0 | 1A0 | Processes the OAM for the intro text + * + */ static void IntroTextProcessOam(void) { const u16* src; diff --git a/src/menus/file_select.c b/src/menus/file_select.c index 815c1354f..98733cba2 100644 --- a/src/menus/file_select.c +++ b/src/menus/file_select.c @@ -4379,11 +4379,11 @@ u32 FileSelectMenuMainLoop(void) switch (gSubGameMode1) { - case 0: + case 0: // Init gSubGameMode2 = 0; gCutsceneToSkip = 0; - FileSelectInit(); - gSubGameMode1--; + FileSelectInit();//sets SubGameMode1 to 2 + gSubGameMode1--;//Then decrease it to 1, so the next frame it will apply the fading break; case 1: @@ -5331,7 +5331,7 @@ static u8 FileSelectUpdateSubMenu(void) switch (FILE_SELECT_DATA.currentSubMenu) { - case 0: + case 0: // Main menu result = 0; #ifdef REGION_EU CheckForMaintainedInput(MAINTAINED_INPUT_SPEED_FAST); @@ -5407,10 +5407,10 @@ static u8 FileSelectUpdateSubMenu(void) } } - if (!result) + if (!result)// 0 = no input break; - if (result == 1) + if (result == 1)//1 = moved cursor { FileSelectUpdateCursor(CURSOR_POSE_MOVING, FILE_SELECT_DATA.fileSelectCursorPosition); if (FILE_SELECT_DATA.fileSelectCursorPosition < FILE_SELECT_CURSOR_POSITION_COPY) @@ -5418,7 +5418,7 @@ static u8 FileSelectUpdateSubMenu(void) else FileSelectPlayMenuSound(MENU_SOUND_REQUEST_SUB_MENU_CURSOR); } - else if (result == 2) + else if (result == 2)// 2 = pressed B, go back to title { FadeMusic(0); #ifdef REGION_JP @@ -5429,10 +5429,10 @@ static u8 FileSelectUpdateSubMenu(void) gLanguage = gSaveFilesInfo[FILE_SELECT_DATA.fileSelectCursorPosition].language; } #endif // REGION_JP - gSubGameMode2 = 3; + gSubGameMode2 = 3; // Go to title screen return TRUE; } - else if (result == 3) + else if (result == 3) // 3 = pressed A, open sub menu { result = FALSE; @@ -5487,7 +5487,7 @@ static u8 FileSelectUpdateSubMenu(void) } break; - case 1: + case 1: // File selection sub menu result = FileSelectProcessFileSelection(); if (result == FALSE) break; @@ -5624,7 +5624,7 @@ static u32 FileSelectCheckInputtingTimeAttackCode(void) } /** - * @brief 7d62c | dd0 | + * @brief 7d62c | dd0 | Handles File Sub Menu (CurrentSubMenu = 1) * * @return u8 Leaving, */ @@ -5642,7 +5642,7 @@ static u8 FileSelectProcessFileSelection(void) switch (FILE_SELECT_DATA.subMenuStage) { - case 0: + case 0: // Initialize File Sub Menu gMostRecentSaveFile = FILE_SELECT_DATA.fileSelectCursorPosition; offset = (FILE_SELECT_DATA.fileSelectCursorPosition + 1) * 3; @@ -5759,7 +5759,7 @@ static u8 FileSelectProcessFileSelection(void) FILE_SELECT_DATA.inputtedTimeAttack = FALSE; FILE_SELECT_DATA.subMenuStage = 7; - case 7: + case 7://"start game" Sub Menu action = UCHAR_MAX; if (gChangedInput & KEY_A) @@ -5801,7 +5801,7 @@ static u8 FileSelectProcessFileSelection(void) unk_7e3fc(0, (u8)action); break; - case 8: + case 8://start game pressed, check if continue or new if (gSaveFilesInfo[FILE_SELECT_DATA.fileSelectCursorPosition].exists || gSaveFilesInfo[FILE_SELECT_DATA.fileSelectCursorPosition].introPlayed) { if (gSaveFilesInfo[FILE_SELECT_DATA.fileSelectCursorPosition].timeAttack || FILE_SELECT_DATA.inputtedTimeAttack) diff --git a/src/sprites_ai/chozo_ball.c b/src/sprites_ai/chozo_ball.c index d98b767ba..834d76c6f 100644 --- a/src/sprites_ai/chozo_ball.c +++ b/src/sprites_ai/chozo_ball.c @@ -16,7 +16,7 @@ #define CHOZO_BALL_FLICKER_TIMER work0 /** - * 162b0 | 94 | Spawns an message banner depending on the chozo statue sprite ID + * @brief 162b0 | 94 | Spawns an message banner depending on the chozo statue sprite ID * * @param spriteId Chozo statue sprite ID */