summaryrefslogtreecommitdiff
path: root/src/engine/fox_game.c
diff options
context:
space:
mode:
authorpetrie911 <69443847+petrie911@users.noreply.github.com>2024-05-08 13:57:11 -0500
committerGitHub <noreply@github.com>2024-05-08 15:57:11 -0300
commit7eff38a5f9f968994a964501d39232a312e6cb22 (patch)
tree836184e27e877514446586da53b2d3f9c637c770 /src/engine/fox_game.c
parent182eb5c65ae3ba92ec02f62f3be1b92613b9838e (diff)
Add quick boot and add ram editing to object ram watch (#236)
* upgrades * one cleanup * streamlining * whoops mods * more ub * cast cleanup
Diffstat (limited to 'src/engine/fox_game.c')
-rw-r--r--src/engine/fox_game.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/engine/fox_game.c b/src/engine/fox_game.c
index 5c9769f7..3852212e 100644
--- a/src/engine/fox_game.c
+++ b/src/engine/fox_game.c
@@ -2,6 +2,7 @@
#include "global.h"
#include "sf64dma.h"
#include "assets/ast_logo.h"
+#include "mods.h"
f32 D_game_80161A10;
f32 D_game_80161A14;
@@ -54,6 +55,18 @@ void Game_Initialize(void) {
Rand_Init();
Rand_SetSeed(1, 29000, 9876);
gGameState = GSTATE_BOOT;
+#ifdef MODS_BOOT_STATE
+ gNextGameState = GSTATE_INIT;
+ if (Save_Read() != 0) {
+#ifdef AVOID_UB
+ gSaveFile.save = gDefaultSave;
+ gSaveFile.backup = gDefaultSave;
+#else
+ gSaveFile = *((SaveFile*) &gDefaultSave);
+#endif
+ Save_Write();
+ }
+#endif
gNextGameStateTimer = 0;
gBgColor = 0;
gBlurAlpha = 255;
@@ -361,7 +374,12 @@ void Game_Update(void) {
break;
case GSTATE_CHECK_SAVE:
if (Save_Read() != 0) {
+#ifdef AVOID_UB
+ gSaveFile.save = gDefaultSave;
+ gSaveFile.backup = gDefaultSave;
+#else
gSaveFile = *((SaveFile*) &gDefaultSave);
+#endif
Save_Write();
}
gGameState++;
@@ -396,6 +414,9 @@ void Game_Update(void) {
gFillScreenAlpha = 0;
gNextGameState = D_ctx_80177C94 = D_ctx_80177CAC = D_ctx_80177CB4 = D_ctx_80177CBC = D_ctx_80177CC4 =
D_ctx_80177C9C = D_ctx_80177CA4 = D_play_80161A5C = D_game_80161A34 = 0;
+#ifdef MODS_BOOT_STATE
+ gNextGameState = MODS_BOOT_STATE;
+#endif
for (i = 0; i < 4; i++) {
gBoostButton[i] = L_CBUTTONS;
gBrakeButton[i] = D_CBUTTONS;
@@ -553,9 +574,22 @@ void Game_Update(void) {
gFillScreenGreen, gFillScreenBlue, gFillScreenAlpha);
}
Audio_dummy_80016A50();
+#if MODS_OBJECT_RAM == 1
+ ObjectRam_Update();
+#endif
+#if MODS_FPS_COUNTER == 1
+ Play_RenderFps();
+#endif
}
}
+#if MODS_FPS_COUNTER == 1
+#include "../mods/fpscounter.c"
+#endif
+#if MODS_OBJECT_RAM == 1
+#include "../mods/object_ram.c"
+#endif
+
Actor* Game_SpawnActor(ObjectId objId) {
Actor* actor = gActors;
s32 i;