summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnghelo Carvajal <angheloalf95@gmail.com>2023-06-06 08:54:18 -0400
committerGitHub <noreply@github.com>2023-06-06 08:54:18 -0400
commita0701c170b5861572eab29bc9f0aed92aa0e11d9 (patch)
tree6c058b279148e7d76e8a586c3bc4d5e1f5f183de /src
parent4cce44466170344b68b146cfbec6d9597d0910bb (diff)
`z64game.h` (#1250)
* z64game.h * grrrrr * fix missing stuff * Update include/z64game.h Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Update include/z64game.h Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * review * global.h to the top * reiew * fix --------- Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
Diffstat (limited to 'src')
-rw-r--r--src/code/game.c6
-rw-r--r--src/code/z_prenmi.c8
-rw-r--r--src/overlays/gamestates/ovl_daytelop/z_daytelop.c3
-rw-r--r--src/overlays/gamestates/ovl_daytelop/z_daytelop.h10
-rw-r--r--src/overlays/gamestates/ovl_file_choose/z_file_select.h5
-rw-r--r--src/overlays/gamestates/ovl_opening/z_opening.c3
-rw-r--r--src/overlays/gamestates/ovl_opening/z_opening.h14
-rw-r--r--src/overlays/gamestates/ovl_select/z_select.h7
-rw-r--r--src/overlays/gamestates/ovl_title/z_title.h8
9 files changed, 38 insertions, 26 deletions
diff --git a/src/code/game.c b/src/code/game.c
index c98241177..8f4e0f44d 100644
--- a/src/code/game.c
+++ b/src/code/game.c
@@ -11,9 +11,9 @@ f32 gFramerateDivisorThird = 1.0f / 3.0f;
void Game_UpdateFramerateVariables(s32 divisor) {
gFramerateDivisor = divisor;
- gFramerateDivisorF = (f32)divisor;
- gFramerateDivisorHalf = (f32)(divisor * 0.5f);
- gFramerateDivisorThird = (f32)(divisor / 3.0f);
+ gFramerateDivisorF = divisor;
+ gFramerateDivisorHalf = divisor / 2.0f;
+ gFramerateDivisorThird = divisor / 3.0f;
}
void Game_SetFramerateDivisor(GameState* gameState, s32 divisor) {
diff --git a/src/code/z_prenmi.c b/src/code/z_prenmi.c
index 94d235a37..097d4d946 100644
--- a/src/code/z_prenmi.c
+++ b/src/code/z_prenmi.c
@@ -1,3 +1,4 @@
+#include "global.h"
#include "z_prenmi.h"
void PreNMI_Stop(PreNMIState* this) {
@@ -9,10 +10,9 @@ void PreNMI_Update(PreNMIState* this) {
if (this->timer == 0) {
ViConfig_UpdateVi(1);
PreNMI_Stop(this);
- return;
+ } else {
+ this->timer--;
}
-
- this->timer--;
}
void PreNMI_Draw(PreNMIState* this) {
@@ -48,7 +48,7 @@ void PreNMI_Init(GameState* thisx) {
this->state.main = PreNMI_Main;
this->state.destroy = PreNMI_Destroy;
this->timer = 30;
- this->unkA8 = 10;
+ this->unk_A8 = 10;
Game_SetFramerateDivisor(&this->state, 1);
}
diff --git a/src/overlays/gamestates/ovl_daytelop/z_daytelop.c b/src/overlays/gamestates/ovl_daytelop/z_daytelop.c
index 108ccedcd..134c6457b 100644
--- a/src/overlays/gamestates/ovl_daytelop/z_daytelop.c
+++ b/src/overlays/gamestates/ovl_daytelop/z_daytelop.c
@@ -4,9 +4,10 @@
* Description: "Dawn of ... day" screen
*/
+#include "global.h"
#include "z_daytelop.h"
+#include "z64save.h"
#include "z64shrink_window.h"
-#include "z64view.h"
#include "misc/daytelop_static/daytelop_static.h"
#include "interface/icon_item_gameover_static/icon_item_gameover_static.h"
diff --git a/src/overlays/gamestates/ovl_daytelop/z_daytelop.h b/src/overlays/gamestates/ovl_daytelop/z_daytelop.h
index a7350e898..da49827c3 100644
--- a/src/overlays/gamestates/ovl_daytelop/z_daytelop.h
+++ b/src/overlays/gamestates/ovl_daytelop/z_daytelop.h
@@ -1,16 +1,13 @@
#ifndef Z64_DAYTELOP_H
#define Z64_DAYTELOP_H
-#include "global.h"
-
-void DayTelop_Init(GameState* thisx);
-void DayTelop_Destroy(GameState* thisx);
+#include "z64game.h"
+#include "z64view.h"
typedef struct {
/* 0x000 */ GameState state;
/* 0x0A4 */ void* daytelopStaticFile;
/* 0x0A8 */ void* gameoverStaticFile;
- /* 0x0AC */ UNK_TYPE1 unk_AC[0x4];
/* 0x0B0 */ View view;
/* 0x218 */ UNK_TYPE1 unk_218[0x28];
/* 0x240 */ s16 transitionCountdown;
@@ -24,4 +21,7 @@ typedef enum {
/* 2 */ DAYTELOP_HOURSTEXT_ON
} DaytelopFadeState;
+void DayTelop_Init(GameState* thisx);
+void DayTelop_Destroy(GameState* thisx);
+
#endif
diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_select.h b/src/overlays/gamestates/ovl_file_choose/z_file_select.h
index 7dcc72a9d..88236e63e 100644
--- a/src/overlays/gamestates/ovl_file_choose/z_file_select.h
+++ b/src/overlays/gamestates/ovl_file_choose/z_file_select.h
@@ -2,6 +2,11 @@
#define FILE_SELECT_H
#include "global.h"
+#include "z64game.h"
+#include "z64message.h"
+#include "z64skybox.h"
+#include "z64view.h"
+
// `sramCtx->noFlashSaveBuf` is never allocated space, so should never be used
// Slot offsets are also based on OoT SaveContext sizes, and contains incorrect sizes from MM
diff --git a/src/overlays/gamestates/ovl_opening/z_opening.c b/src/overlays/gamestates/ovl_opening/z_opening.c
index 9697b111f..84425cc73 100644
--- a/src/overlays/gamestates/ovl_opening/z_opening.c
+++ b/src/overlays/gamestates/ovl_opening/z_opening.c
@@ -4,9 +4,12 @@
* Description: Initializes the game into the title screen
*/
+#include "global.h"
#include "z_opening.h"
+#include "z64save.h"
#include "z64shrink_window.h"
#include "z64view.h"
+#include "regs.h"
void TitleSetup_SetupTitleScreen(TitleSetupState* this) {
static s32 sOpeningEntrances[] = { ENTRANCE(CUTSCENE, 0), ENTRANCE(CUTSCENE, 1) };
diff --git a/src/overlays/gamestates/ovl_opening/z_opening.h b/src/overlays/gamestates/ovl_opening/z_opening.h
index 36a01ffe9..530b069e1 100644
--- a/src/overlays/gamestates/ovl_opening/z_opening.h
+++ b/src/overlays/gamestates/ovl_opening/z_opening.h
@@ -1,15 +1,15 @@
-#ifndef _Z64_OPENING_H_
-#define _Z64_OPENING_H_
+#ifndef Z64_OPENING_H
+#define Z64_OPENING_H
-#include "global.h"
-
-void TitleSetup_Init(GameState* thisx);
-void TitleSetup_Destroy(GameState* thisx);
+#include "z64game.h"
+#include "z64view.h"
typedef struct {
/* 0x000 */ GameState state;
- /* 0x0A4 */ UNK_TYPE1 unk_A4[0x4];
/* 0x0A8 */ View view;
} TitleSetupState; // size = 0x210
+void TitleSetup_Init(GameState* thisx);
+void TitleSetup_Destroy(GameState* thisx);
+
#endif
diff --git a/src/overlays/gamestates/ovl_select/z_select.h b/src/overlays/gamestates/ovl_select/z_select.h
index 8b5974103..876c9e3ff 100644
--- a/src/overlays/gamestates/ovl_select/z_select.h
+++ b/src/overlays/gamestates/ovl_select/z_select.h
@@ -1,7 +1,8 @@
-#ifndef _Z64_SELECT_H_
-#define _Z64_SELECT_H_
+#ifndef Z64_SELECT_H
+#define Z64_SELECT_H
-#include "global.h"
+#include "z64game.h"
+#include "z64view.h"
struct MapSelectState;
diff --git a/src/overlays/gamestates/ovl_title/z_title.h b/src/overlays/gamestates/ovl_title/z_title.h
index 0cb19da1a..ee5d5c841 100644
--- a/src/overlays/gamestates/ovl_title/z_title.h
+++ b/src/overlays/gamestates/ovl_title/z_title.h
@@ -2,9 +2,8 @@
#define Z64_TITLE_H
#include "global.h"
-
-void ConsoleLogo_Init(GameState* thisx);
-void ConsoleLogo_Destroy(GameState* thisx);
+#include "z64game.h"
+#include "z64view.h"
typedef struct {
/* 0x000 */ GameState state;
@@ -20,4 +19,7 @@ typedef struct {
/* 0x244 */ u8 exit;
} ConsoleLogoState; // size = 0x248
+void ConsoleLogo_Init(GameState* thisx);
+void ConsoleLogo_Destroy(GameState* thisx);
+
#endif