Skip to content

Use gamemode enum#5089

Merged
aMannus merged 2 commits intoHarbourMasters:developfrom
Archez:gamemode-enum
Feb 25, 2025
Merged

Use gamemode enum#5089
aMannus merged 2 commits intoHarbourMasters:developfrom
Archez:gamemode-enum

Conversation

@Archez
Copy link
Contributor

@Archez Archez commented Feb 20, 2025

Updates src to use the GAMEMODE enum.

Two spots had an explicit change that I will callout below. Everything else is just magic number -> matching enum value.

Build Artifacts

gSaveContext.seqId = (u8)NA_BGM_DISABLED;
gSaveContext.natureAmbienceId = 0xFF;
gSaveContext.gameMode = GAMEMODE_TITLE_SCREEN;
gSaveContext.gameMode = GAMEMODE_FILE_SELECT;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was incorrectly the wrong value, but was masked by a different src change below. This should be GAMEMODE_FILE_SELECT, which normally would be set by ovl_en_mag, but we are skipping the opening sequence so we set it here.

Comment on lines -3740 to -3742

// Originally this was only set when transitioning from the title screen, but gSkipLogoTitle skips that process so we're ensuring it's set here
gSaveContext.gameMode = GAMEMODE_FILE_SELECT;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was an old source change added because of the previous skip to file select enhancement. This can be dropped now that we have the improved boot sequence handling (which will guarantee the gamemode is set to GAMEMODE_FILE_SELECT before loading the file select state. (see my previous comment)

}

gSaveContext.gameMode = GAMEMODE_FILE_SELECT;
SET_NEXT_GAMESTATE(gGameState, FileChoose_Init, FileChooseContext);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add missing gameMode set here, and switching to use gGameState

Copy link
Contributor

@leggettc18 leggettc18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! I'm assuming decomp is using these already and we just hadn't updated until now?

@aMannus aMannus merged commit f023a46 into HarbourMasters:develop Feb 25, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants