Option: `NO_MAP_SELECT`

This commit is contained in:
Yanis42
2022-08-26 19:10:19 +02:00
parent 61ef4d8a90
commit e328c8393d
7 changed files with 44 additions and 2 deletions

View File

@@ -39,4 +39,18 @@
*/
#define NO_DEBUG_SCENES
/**
* Remove map select
*/
#define NO_MAP_SELECT
/**
* No map select on file 1 (enabled under certain conditions)
*/
// #define FILE_1_NORMAL
#if (defined BOOT_TO_SCENE && defined BOOT_TO_FILE_SELECT) || (defined NO_MAP_SELECT)
#define FILE_1_NORMAL
#endif
#endif

View File

@@ -3,6 +3,7 @@
#include "z64.h"
#include "macros.h"
#include "config.h"
f32 fabsf(f32 f);
#ifndef __sgi
@@ -2263,8 +2264,12 @@ void Setup_Init(GameState* thisx);
void Setup_Destroy(GameState* thisx);
void ConsoleLogo_Init(GameState* thisx);
void ConsoleLogo_Destroy(GameState* thisx);
#ifndef NO_MAP_SELECT
void MapSelect_Init(GameState* thisx);
void MapSelect_Destroy(GameState* thisx);
#endif
void TitleSetup_Init(GameState* thisx);
void TitleSetup_Destroy(GameState* thisx);
void FileSelect_Init(GameState* thisx);

View File

@@ -36,6 +36,7 @@
#include "padmgr.h"
#include "fault.h"
#include "sched.h"
#include "config.h"
#define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 240
@@ -1084,6 +1085,8 @@ typedef struct {
/* 0x01E2 */ char unk_1E2[0x06];
} ConsoleLogoState; // size = 0x1E8
#ifndef NO_MAP_SELECT
struct MapSelectState;
typedef struct {
@@ -1114,6 +1117,8 @@ typedef struct MapSelectState {
/* 0x0238 */ u8* staticSegment;
} MapSelectState; // size = 0x240
#endif
typedef struct {
/* 0x0000 */ GameState state;
/* 0x00A4 */ u8* staticSegment;

2
spec
View File

@@ -541,11 +541,13 @@ beginseg
include "build/src/overlays/gamestates/ovl_title/ovl_title_reloc.o"
endseg
#ifndef NO_MAP_SELECT
beginseg
name "ovl_select"
include "build/src/overlays/gamestates/ovl_select/z_select.o"
include "build/src/overlays/gamestates/ovl_select/ovl_select_reloc.o"
endseg
#endif
beginseg
name "ovl_opening"

View File

@@ -1,5 +1,6 @@
#include "global.h"
#include "vt.h"
#include "config.h"
#define GFXPOOL_HEAD_MAGIC 0x1234
#define GFXPOOL_TAIL_MAGIC 0x5678
@@ -105,9 +106,13 @@ GameStateOverlay* Graph_GetNextGameState(GameState* gameState) {
if (gameStateInitFunc == Setup_Init) {
return &gGameStateOverlayTable[0];
}
#ifndef NO_MAP_SELECT
if (gameStateInitFunc == MapSelect_Init) {
return &gGameStateOverlayTable[1];
}
#endif
if (gameStateInitFunc == ConsoleLogo_Init) {
return &gGameStateOverlayTable[2];
}
@@ -382,12 +387,14 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
sGraphUpdateTime = time;
}
#ifndef NO_MAP_SELECT
if (gIsCtrlr2Valid && CHECK_BTN_ALL(gameState->input[0].press.button, BTN_Z) &&
CHECK_BTN_ALL(gameState->input[0].cur.button, BTN_L | BTN_R)) {
gSaveContext.gameMode = GAMEMODE_NORMAL;
SET_NEXT_GAMESTATE(gameState, MapSelect_Init, MapSelectState);
gameState->running = false;
}
#endif
if (gIsCtrlr2Valid && PreNmiBuff_IsResetting(gAppNmiBufferPtr) && !gameState->unk_A0) {
// "To reset mode"

View File

@@ -1,4 +1,5 @@
#include "global.h"
#include "config.h"
#define GAMESTATE_OVERLAY(name, init, destroy, size) \
{ \
@@ -8,9 +9,17 @@
#define GAMESTATE_OVERLAY_INTERNAL(init, destroy, size) \
{ NULL, 0, 0, NULL, NULL, NULL, init, destroy, NULL, NULL, 0, size }
#define GAMESTATE_NONE { NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0 }
GameStateOverlay gGameStateOverlayTable[] = {
GAMESTATE_OVERLAY_INTERNAL(Setup_Init, Setup_Destroy, sizeof(SetupState)),
#ifndef NO_MAP_SELECT
GAMESTATE_OVERLAY(select, MapSelect_Init, MapSelect_Destroy, sizeof(MapSelectState)),
#else
GAMESTATE_NONE,
#endif
GAMESTATE_OVERLAY(title, ConsoleLogo_Init, ConsoleLogo_Destroy, sizeof(ConsoleLogoState)),
GAMESTATE_OVERLAY_INTERNAL(Play_Init, Play_Destroy, sizeof(PlayState)),
GAMESTATE_OVERLAY(opening, TitleSetup_Init, TitleSetup_Destroy, sizeof(TitleSetupState)),

View File

@@ -1441,7 +1441,7 @@ void FileSelect_LoadGame(GameState* thisx) {
u16 swordEquipValue;
s32 pad;
#if (!defined BOOT_TO_SCENE && !defined BOOT_TO_FILE_SELECT)
#ifndef FILE_1_NORMAL
if (this->buttonIndex == FS_BTN_SELECT_FILE_1) {
Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
@@ -1459,7 +1459,7 @@ void FileSelect_LoadGame(GameState* thisx) {
gSaveContext.gameMode = GAMEMODE_NORMAL;
SET_NEXT_GAMESTATE(&this->state, Play_Init, PlayState);
this->state.running = false;
#if (!defined BOOT_TO_SCENE && !defined BOOT_TO_FILE_SELECT)
#ifndef FILE_1_NORMAL
}
#endif