summaryrefslogtreecommitdiff
path: root/src/code
diff options
context:
space:
mode:
Diffstat (limited to 'src/code')
-rw-r--r--src/code/PreRender.c1
-rw-r--r--src/code/TwoHeadArena.c1
-rw-r--r--src/code/TwoHeadGfxArena.c1
-rw-r--r--src/code/cutscene_camera.c31
-rw-r--r--src/code/flg_set.c3
-rw-r--r--src/code/graph.c5
-rw-r--r--src/code/main.c2
-rw-r--r--src/code/object_table.c19
-rw-r--r--src/code/su_mtx.c3
-rw-r--r--src/code/sys_cfb.c2
-rw-r--r--src/code/sys_cmpdma.c6
-rw-r--r--src/code/sys_initial_check.c8
-rw-r--r--src/code/sys_ucode.c3
-rw-r--r--src/code/title_setup.c2
-rw-r--r--src/code/z_DLF.c2
-rw-r--r--src/code/z_actor.c1
-rw-r--r--src/code/z_actor_dlftbls.c11
-rw-r--r--src/code/z_bgcheck.c2
-rw-r--r--src/code/z_camera.c1
-rw-r--r--src/code/z_eff_footmark.c2
-rw-r--r--src/code/z_game_over.c1
-rw-r--r--src/code/z_jpeg.c8
-rw-r--r--src/code/z_kaleido_scope_call.c1
-rw-r--r--src/code/z_kanfont.c7
-rw-r--r--src/code/z_lifemeter.c6
-rw-r--r--src/code/z_message.c1
-rw-r--r--src/code/z_nmi_buff.c6
-rw-r--r--src/code/z_parameter.c2
-rw-r--r--src/code/z_path.c3
-rw-r--r--src/code/z_play.c2
-rw-r--r--src/code/z_play_hireso.c1
-rw-r--r--src/code/z_room.c1
-rw-r--r--src/code/z_scene.c32
-rw-r--r--src/code/z_sram_NES.c3
-rw-r--r--src/code/z_visfbuf.c1
35 files changed, 121 insertions, 60 deletions
diff --git a/src/code/PreRender.c b/src/code/PreRender.c
index 936efbcb2..fa8805b41 100644
--- a/src/code/PreRender.c
+++ b/src/code/PreRender.c
@@ -18,6 +18,7 @@
#include "slowly.h"
#include "stack.h"
#include "stackcheck.h"
+#include "sys_ucode.h"
/**
* Assigns the "save" values in PreRender
diff --git a/src/code/TwoHeadArena.c b/src/code/TwoHeadArena.c
index c6a802e04..49b746ec0 100644
--- a/src/code/TwoHeadArena.c
+++ b/src/code/TwoHeadArena.c
@@ -12,7 +12,6 @@
#include "tha.h"
#include "alignment.h"
-#include "functions.h"
void* THA_GetHead(TwoHeadArena* tha) {
return tha->head;
diff --git a/src/code/TwoHeadGfxArena.c b/src/code/TwoHeadGfxArena.c
index 3811bbd12..cd1394001 100644
--- a/src/code/TwoHeadGfxArena.c
+++ b/src/code/TwoHeadGfxArena.c
@@ -11,7 +11,6 @@
#include "thga.h"
#include "alignment.h"
-#include "functions.h"
void THGA_Init(TwoHeadGfxArena* thga, void* start, size_t size) {
THA_Init(&thga->tha, start, size);
diff --git a/src/code/cutscene_camera.c b/src/code/cutscene_camera.c
index e2d4bdd0a..f225651fe 100644
--- a/src/code/cutscene_camera.c
+++ b/src/code/cutscene_camera.c
@@ -1,7 +1,8 @@
+#include "prevent_bss_reordering.h"
#include "global.h"
#include "libc/string.h"
-static CutsceneCamera* sCurCsCamera;
+CutsceneCamera* sCurCsCamera;
typedef s16 (*CsCamInterpolateCallback)(Vec3f*, f32*, s16*, CsCmdCamPoint*, CsCmdCamMisc*, CutsceneCameraInterp*);
@@ -789,16 +790,16 @@ s16 CutsceneCamera_Interp_MultiPointCubic(Vec3f* camPos, f32* camFov, s16* camRo
return 0;
}
-static f32 sKnots[38];
+f32 sCsCamKnots[38];
// Only used by unused CutsceneCamera_Interp_Unused
void func_80162FF8(s16 arg0) {
f32 val = 0.0f;
s32 i;
- sKnots[0] = 0.0f;
- sKnots[1] = 0.0f;
- sKnots[2] = 0.0f;
+ sCsCamKnots[0] = 0.0f;
+ sCsCamKnots[1] = 0.0f;
+ sCsCamKnots[2] = 0.0f;
for (i = 3; i < arg0; i++) {
if (i == 3) {
@@ -809,13 +810,13 @@ void func_80162FF8(s16 arg0) {
val += 0.3f;
}
- sKnots[i] = val;
+ sCsCamKnots[i] = val;
}
val += 0.9f;
- sKnots[i++] = val;
- sKnots[i++] = val;
- sKnots[i++] = val;
+ sCsCamKnots[i++] = val;
+ sCsCamKnots[i++] = val;
+ sCsCamKnots[i++] = val;
}
#define FUNC_801631DC_ORDER 3
@@ -837,15 +838,17 @@ void func_801631DC(f32 progress, s32 arg2, f32* coeff) {
for (i = 1; i < FUNC_801631DC_ORDER; i++) {
for (j = arg2 - i, k = (FUNC_801631DC_ORDER - 1) - i; j <= arg2; j++, k++) {
- if (sKnots[j + i] != sKnots[j]) {
- coeffTemp[i][k] = ((progress - sKnots[j]) / (sKnots[j + i] - sKnots[j])) * coeffTemp[i - 1][k];
+ if (sCsCamKnots[j + i] != sCsCamKnots[j]) {
+ coeffTemp[i][k] =
+ ((progress - sCsCamKnots[j]) / (sCsCamKnots[j + i] - sCsCamKnots[j])) * coeffTemp[i - 1][k];
} else {
coeffTemp[i][k] = 0.0f;
}
- if (sKnots[j + i + 1] != sKnots[j + 1]) {
+ if (sCsCamKnots[j + i + 1] != sCsCamKnots[j + 1]) {
coeffTemp[i][k] +=
- ((sKnots[j + i + 1] - progress) / (sKnots[j + i + 1] - sKnots[j + 1])) * coeffTemp[i - 1][k + 1];
+ ((sCsCamKnots[j + i + 1] - progress) / (sCsCamKnots[j + i + 1] - sCsCamKnots[j + 1])) *
+ coeffTemp[i - 1][k + 1];
}
}
}
@@ -869,7 +872,7 @@ s16 CutsceneCamera_Interp_Unused(Vec3f* camPos, f32* camFov, s16* camRoll, CsCmd
}
index = interpState->waypoint + 2;
- func_801631DC(F32_LERPIMP(sKnots[index], sKnots[index + 1],
+ func_801631DC(F32_LERPIMP(sCsCamKnots[index], sCsCamKnots[index + 1],
(f32)interpState->curFrame / miscCmd[interpState->waypoint].unused0),
index, coeff);
diff --git a/src/code/flg_set.c b/src/code/flg_set.c
index 138aa0254..b964bba80 100644
--- a/src/code/flg_set.c
+++ b/src/code/flg_set.c
@@ -10,8 +10,11 @@
* Hold Start and press B: clear all weekEventReg and eventInf flags
*/
+#include "flg_set.h"
#include "global.h"
+#include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h"
+
typedef struct FlagSetEntry {
/* 0x0 */ u8* value;
/* 0x4 */ const char* name;
diff --git a/src/code/graph.c b/src/code/graph.c
index a48dd61bd..ee0f5671e 100644
--- a/src/code/graph.c
+++ b/src/code/graph.c
@@ -1,6 +1,5 @@
#include "z64.h"
#include "regs.h"
-#include "functions.h"
#include "fault.h"
// Variables are put before most headers as a hacky way to bypass bss reordering
@@ -10,13 +9,15 @@ GfxMasterList* gGfxMasterDL;
CfbInfo sGraphCfbInfos[3];
OSTime sGraphPrevUpdateEndTime;
-#include "variables.h"
#include "macros.h"
#include "buffers.h"
#include "idle.h"
#include "sys_cfb.h"
+#include "sys_ucode.h"
#include "libc64/malloc.h"
+#include "z64DLF.h"
#include "z64speed_meter.h"
+
#include "overlays/gamestates/ovl_daytelop/z_daytelop.h"
#include "overlays/gamestates/ovl_file_choose/z_file_select.h"
#include "overlays/gamestates/ovl_opening/z_opening.h"
diff --git a/src/code/main.c b/src/code/main.c
index 09b750dd2..7b896c7b8 100644
--- a/src/code/main.c
+++ b/src/code/main.c
@@ -32,7 +32,9 @@ PadMgr gPadMgr;
#include "main.h"
#include "buffers.h"
#include "global.h"
+#include "sys_initial_check.h"
#include "system_heap.h"
+#include "z64nmi_buff.h"
#include "z64thread.h"
s32 gScreenWidth = SCREEN_WIDTH;
diff --git a/src/code/object_table.c b/src/code/object_table.c
index 87c4069fe..4ecdfa293 100644
--- a/src/code/object_table.c
+++ b/src/code/object_table.c
@@ -10,10 +10,21 @@ s16 gPlayerFormObjectIds[PLAYER_FORM_MAX] = {
ObjectId gObjectTableSize = OBJECT_ID_MAX;
+// Segment declarations (also used in the table below)
+#define DEFINE_OBJECT(name, _enumValue) DECLARE_ROM_SEGMENT(name)
+#define DEFINE_OBJECT_UNSET(_enumValue)
+#define DEFINE_OBJECT_EMPTY(_name, _enumValue)
+
+#include "tables/object_table.h"
+
+#undef DEFINE_OBJECT
+#undef DEFINE_OBJECT_UNSET
+#undef DEFINE_OBJECT_EMPTY
+
// Object Table definition
-#define DEFINE_OBJECT(name, _enumValue) { SEGMENT_ROM_START(name), SEGMENT_ROM_END(name) },
-#define DEFINE_OBJECT_UNSET(_enumValue) { 0, 0 },
-#define DEFINE_OBJECT_SIZE_ZERO(name, _enumValue) { SEGMENT_ROM_START(name), SEGMENT_ROM_START(name) },
+#define DEFINE_OBJECT(name, _enumValue) ROM_FILE(name),
+#define DEFINE_OBJECT_UNSET(_enumValue) ROM_FILE_UNSET,
+#define DEFINE_OBJECT_EMPTY(name, _enumValue) ROM_FILE_EMPTY(name),
RomFile gObjectTable[] = {
#include "tables/object_table.h"
@@ -21,4 +32,4 @@ RomFile gObjectTable[] = {
#undef DEFINE_OBJECT
#undef DEFINE_OBJECT_UNSET
-#undef DEFINE_OBJECT_SIZE_ZERO
+#undef DEFINE_OBJECT_EMPTY
diff --git a/src/code/su_mtx.c b/src/code/su_mtx.c
index 29f035161..27173a4ab 100644
--- a/src/code/su_mtx.c
+++ b/src/code/su_mtx.c
@@ -49,7 +49,8 @@
* @remark Name inferred from shared Animal Forest functions, meaning of "su" is unclear.
*/
-#include "global.h"
+#include "su_mtx.h"
+#include "z64math.h"
/**
* Constructs a matrix \$f ST \$f, i.e. a scaling \$f S \$f followed by a translation \$f T \$f.
diff --git a/src/code/sys_cfb.c b/src/code/sys_cfb.c
index 71da5e73d..a16a6b5c1 100644
--- a/src/code/sys_cfb.c
+++ b/src/code/sys_cfb.c
@@ -1,7 +1,6 @@
#include "z64.h"
#include "buffers.h"
#include "regs.h"
-#include "functions.h"
#include "macros.h"
// Variables are put before most headers as a hacky way to bypass bss reordering
@@ -34,7 +33,6 @@ s16 gCfbUpperAdjust;
u8 gSysCfbHiResEnabled;
-#include "variables.h"
#include "sys_cfb.h"
#include "libc/stdbool.h"
#include "buffers.h"
diff --git a/src/code/sys_cmpdma.c b/src/code/sys_cmpdma.c
index d0c05ad04..adf41de49 100644
--- a/src/code/sys_cmpdma.c
+++ b/src/code/sys_cmpdma.c
@@ -1,7 +1,7 @@
-#include "global.h"
-#include "libc64/malloc.h"
-#include "yaz0.h"
+#include "sys_cmpdma.h"
+#include "libc64/malloc.h"
+#include "color.h"
#include "yaz0.h"
#include "z64dma.h"
diff --git a/src/code/sys_initial_check.c b/src/code/sys_initial_check.c
index 4e4326e82..59d34aed4 100644
--- a/src/code/sys_initial_check.c
+++ b/src/code/sys_initial_check.c
@@ -6,8 +6,14 @@
* These checks are some of the first functions run in Main, before even setting up the system heap, and any image files
* are DMA'd directly to fixed RAM addresses.
*/
+
+#include "sys_initial_check.h"
#include "global.h"
+
+#include "color.h"
#include "fault.h"
+#include "segment_symbols.h"
+
#include "misc/locerrmsg/locerrmsg.h"
#include "misc/memerrmsg/memerrmsg.h"
@@ -28,7 +34,7 @@
void Check_WriteRGBA16Pixel(u16* buffer, u32 x, u32 y, u32 value) {
if (value & RGBA16_PIXEL_OPAQUE) {
- (&buffer[x])[y * SCREEN_WIDTH] = value;
+ buffer[x + y * SCREEN_WIDTH] = value;
}
}
diff --git a/src/code/sys_ucode.c b/src/code/sys_ucode.c
index df59275e2..068afb4cc 100644
--- a/src/code/sys_ucode.c
+++ b/src/code/sys_ucode.c
@@ -2,7 +2,8 @@
* File: sys_ucode.c
* Description: Functions for obtaining locations and sizes of microcode
*/
-#include "global.h"
+
+#include "sys_ucode.h"
u64* initialgspUcodeText = gspF3DZEX2_NoN_PosLight_fifoTextStart;
u64* initialgspUcodeData = gspF3DZEX2_NoN_PosLight_fifoDataStart;
diff --git a/src/code/title_setup.c b/src/code/title_setup.c
index 83b16f87e..0859c52d4 100644
--- a/src/code/title_setup.c
+++ b/src/code/title_setup.c
@@ -1,4 +1,6 @@
#include "z_title_setup.h"
+#include "sys_flashrom.h"
+
#include "overlays/gamestates/ovl_title/z_title.h"
void Setup_InitRegs(void) {
diff --git a/src/code/z_DLF.c b/src/code/z_DLF.c
index 1e03cead7..14031d3d3 100644
--- a/src/code/z_DLF.c
+++ b/src/code/z_DLF.c
@@ -1,4 +1,6 @@
+#include "z64DLF.h"
#include "global.h"
+
#include "libc64/malloc.h"
#include "loadfragment.h"
diff --git a/src/code/z_actor.c b/src/code/z_actor.c
index 845215c5e..bd4457671 100644
--- a/src/code/z_actor.c
+++ b/src/code/z_actor.c
@@ -2,6 +2,7 @@
* File: z_actor.c
* Description:
*/
+
#include "fault.h"
#include "sys_cfb.h"
#include "loadfragment.h"
diff --git a/src/code/z_actor_dlftbls.c b/src/code/z_actor_dlftbls.c
index 866d99c3f..d3d925fbc 100644
--- a/src/code/z_actor_dlftbls.c
+++ b/src/code/z_actor_dlftbls.c
@@ -1,9 +1,12 @@
-#include "global.h"
+#include "z64actor_dlftbls.h"
+
#include "fault.h"
-// Init Vars declarations (also used in the table below)
-#define DEFINE_ACTOR(name, _enumValue, _allocType, _debugName) extern ActorInit name##_InitVars;
-#define DEFINE_ACTOR_INTERNAL(name, _enumValue, _allocType, _debugName) extern ActorInit name##_InitVars;
+// Segment and InitVars declarations (also used in the table below)
+#define DEFINE_ACTOR(name, _enumValue, _allocType, _debugName) \
+ extern struct ActorInit name##_InitVars; \
+ DECLARE_OVERLAY_SEGMENT(name)
+#define DEFINE_ACTOR_INTERNAL(name, _enumValue, _allocType, _debugName) extern struct ActorInit name##_InitVars;
#define DEFINE_ACTOR_UNSET(_enumValue)
#include "tables/actor_table.h"
diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c
index b27310b3f..3bf910726 100644
--- a/src/code/z_bgcheck.c
+++ b/src/code/z_bgcheck.c
@@ -1,3 +1,5 @@
+#include "prevent_bss_reordering.h"
+
#include "z64bgcheck.h"
#include "global.h"
diff --git a/src/code/z_camera.c b/src/code/z_camera.c
index d33864f34..609e035b1 100644
--- a/src/code/z_camera.c
+++ b/src/code/z_camera.c
@@ -43,6 +43,7 @@
*
*/
+#include "prevent_bss_reordering.h"
#include "global.h"
#include "libc/string.h"
#include "z64malloc.h"
diff --git a/src/code/z_eff_footmark.c b/src/code/z_eff_footmark.c
index 806cc45e0..e0dc258f8 100644
--- a/src/code/z_eff_footmark.c
+++ b/src/code/z_eff_footmark.c
@@ -1,7 +1,7 @@
#include "z64eff_footmark.h"
+
#include "z64.h"
#include "macros.h"
-#include "functions.h"
#include "assets/code/eff_footmark/eff_footmark.c"
diff --git a/src/code/z_game_over.c b/src/code/z_game_over.c
index 003f5dd7b..8340e8397 100644
--- a/src/code/z_game_over.c
+++ b/src/code/z_game_over.c
@@ -1,4 +1,5 @@
#include "z64game_over.h"
+
#include "z64rumble.h"
#include "z64shrink_window.h"
#include "z64.h"
diff --git a/src/code/z_jpeg.c b/src/code/z_jpeg.c
index 222e80173..cc2f24ee0 100644
--- a/src/code/z_jpeg.c
+++ b/src/code/z_jpeg.c
@@ -1,7 +1,9 @@
#include "z64jpeg.h"
+
#include "libc/stdbool.h"
-#include "variables.h"
-#include "functions.h"
+#include "main.h"
+#include "sys_ucode.h"
+#include "macros.h"
#define MARKER_ESCAPE 0x00
#define MARKER_SOI 0xD8
@@ -107,7 +109,7 @@ void Jpeg_CopyToZbuffer(u16* src, u16* zbuffer, s32 x, s32 y) {
* unaligned values in JPEG header files.
*/
u16 Jpeg_GetUnalignedU16(u8* ptr) {
- if (((u32)ptr & 1) == 0) {
+ if (((uintptr_t)ptr & 1) == 0) {
// Read the value normally if it's aligned to a 16-bit address.
return *(u16*)ptr;
} else {
diff --git a/src/code/z_kaleido_scope_call.c b/src/code/z_kaleido_scope_call.c
index 34e55f244..dd409a462 100644
--- a/src/code/z_kaleido_scope_call.c
+++ b/src/code/z_kaleido_scope_call.c
@@ -1,3 +1,4 @@
+#include "prevent_bss_reordering.h"
#include "z64pause_menu.h"
#include "z64.h"
diff --git a/src/code/z_kanfont.c b/src/code/z_kanfont.c
index 60346cb6f..18fd232a0 100644
--- a/src/code/z_kanfont.c
+++ b/src/code/z_kanfont.c
@@ -1,4 +1,9 @@
-#include "global.h"
+#include "z64font.h"
+
+#include "segment_symbols.h"
+#include "z64message.h"
+
+#include "z64.h"
// stubbed in NTSC-U
void Font_LoadChar(PlayState* play, u16 codePointIndex, s32 offset) {
diff --git a/src/code/z_lifemeter.c b/src/code/z_lifemeter.c
index 9f4f6c47e..ec2774b4b 100644
--- a/src/code/z_lifemeter.c
+++ b/src/code/z_lifemeter.c
@@ -1,5 +1,11 @@
#include "prevent_bss_reordering.h"
+#include "z64lifemeter.h"
+
#include "global.h"
+#include "su_mtx.h"
+
+#include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h"
+
#include "interface/parameter_static/parameter_static.h"
s16 sHeartsPrimColors[3][3] = { { 255, 70, 50 }, { 255, 190, 0 }, { 100, 100, 255 } };
diff --git a/src/code/z_message.c b/src/code/z_message.c
index 3d75d5325..945aacb65 100644
--- a/src/code/z_message.c
+++ b/src/code/z_message.c
@@ -3,6 +3,7 @@
#include "message_data_static.h"
#include "padmgr.h"
+#include "sys_cmpdma.h"
#include "segment_symbols.h"
#include "z64actor.h"
#include "z64horse.h"
diff --git a/src/code/z_nmi_buff.c b/src/code/z_nmi_buff.c
index 840345932..dc9a1aab1 100644
--- a/src/code/z_nmi_buff.c
+++ b/src/code/z_nmi_buff.c
@@ -4,8 +4,8 @@
#define NMI 1
typedef struct {
- /* 0x00 */ u32 resetting;
- /* 0x04 */ u32 resetCount;
+ /* 0x00 */ s32 resetting;
+ /* 0x04 */ s32 resetCount;
/* 0x08 */ OSTime duration;
/* 0x10 */ OSTime resetTime;
} NmiBuff; // size >= 0x18
@@ -32,6 +32,6 @@ void Nmi_SetPrenmiStart(void) {
gNMIBuffer->resetTime = osGetTime();
}
-u32 Nmi_GetPrenmiHasStarted(void) {
+s32 Nmi_GetPrenmiHasStarted(void) {
return gNMIBuffer->resetting;
}
diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c
index 8b2284fde..3a30fb1a3 100644
--- a/src/code/z_parameter.c
+++ b/src/code/z_parameter.c
@@ -1,6 +1,8 @@
#include "global.h"
#include "PR/gs2dex.h"
#include "sys_cfb.h"
+#include "sys_ucode.h"
+#include "z64lifemeter.h"
#include "z64malloc.h"
#include "z64snap.h"
#include "z64view.h"
diff --git a/src/code/z_path.c b/src/code/z_path.c
index 76d7ce144..7b33c1f83 100644
--- a/src/code/z_path.c
+++ b/src/code/z_path.c
@@ -1,5 +1,8 @@
+#include "z64path.h"
#include "global.h"
+#include "z64lib.h"
+
Path* Path_GetByIndex(PlayState* play, s16 index, s16 indexNone) {
Path* path;
diff --git a/src/code/z_play.c b/src/code/z_play.c
index 4824769c9..61582ca0b 100644
--- a/src/code/z_play.c
+++ b/src/code/z_play.c
@@ -1,6 +1,5 @@
#include "z64.h"
#include "regs.h"
-#include "functions.h"
#include "z64malloc.h"
#include "z64vis.h"
#include "z64visfbuf.h"
@@ -18,7 +17,6 @@ BombersNotebook sBombersNotebook;
u8 sBombersNotebookOpen;
u8 sMotionBlurStatus;
-#include "variables.h"
#include "macros.h"
#include "buffers.h"
#include "idle.h"
diff --git a/src/code/z_play_hireso.c b/src/code/z_play_hireso.c
index eee85e07d..355256412 100644
--- a/src/code/z_play_hireso.c
+++ b/src/code/z_play_hireso.c
@@ -1,5 +1,6 @@
#include "global.h"
#include "sys_cfb.h"
+#include "sys_cmpdma.h"
#include "z64bombers_notebook.h"
#include "z64malloc.h"
diff --git a/src/code/z_room.c b/src/code/z_room.c
index a26f81980..1e8700e09 100644
--- a/src/code/z_room.c
+++ b/src/code/z_room.c
@@ -1,6 +1,7 @@
#include "global.h"
#include "PR/gs2dex.h"
#include "debug.h"
+#include "sys_ucode.h"
void Room_Noop(PlayState* play, Room* room, Input* input, s32 arg3) {
}
diff --git a/src/code/z_scene.c b/src/code/z_scene.c
index acfc182e5..bb7aec737 100644
--- a/src/code/z_scene.c
+++ b/src/code/z_scene.c
@@ -233,9 +233,9 @@ void Scene_CommandEntranceList(PlayState* play, SceneCmd* cmd) {
void Scene_CommandSpecialFiles(PlayState* play, SceneCmd* cmd) {
// @note These quest hint files are identical to OoT's.
// They are not relevant in this game and the system to process these scripts has been removed.
- static RomFile naviQuestHintFiles[2] = {
- { SEGMENT_ROM_START(elf_message_field), SEGMENT_ROM_END(elf_message_field) },
- { SEGMENT_ROM_START(elf_message_ydan), SEGMENT_ROM_END(elf_message_ydan) },
+ static RomFile sNaviQuestHintFiles[2] = {
+ ROM_FILE(elf_message_field),
+ ROM_FILE(elf_message_ydan),
};
if (cmd->specialFiles.subKeepId != 0) {
@@ -245,7 +245,7 @@ void Scene_CommandSpecialFiles(PlayState* play, SceneCmd* cmd) {
}
if (cmd->specialFiles.naviQuestHintFileId != NAVI_QUEST_HINTS_NONE) {
- play->naviQuestHints = Play_LoadFile(play, &naviQuestHintFiles[cmd->specialFiles.naviQuestHintFileId - 1]);
+ play->naviQuestHints = Play_LoadFile(play, &sNaviQuestHintFiles[cmd->specialFiles.naviQuestHintFileId - 1]);
}
}
@@ -356,19 +356,19 @@ void Scene_CommandEnvLightSettings(PlayState* play, SceneCmd* cmd) {
* These later are stored in segment 0x06, and used in maps.
*/
void Scene_LoadAreaTextures(PlayState* play, s32 fileIndex) {
- static RomFile sceneTextureFiles[9] = {
- { 0, 0 }, // Default
- { SEGMENT_ROM_START(scene_texture_01), SEGMENT_ROM_END(scene_texture_01) },
- { SEGMENT_ROM_START(scene_texture_02), SEGMENT_ROM_END(scene_texture_02) },
- { SEGMENT_ROM_START(scene_texture_03), SEGMENT_ROM_END(scene_texture_03) },
- { SEGMENT_ROM_START(scene_texture_04), SEGMENT_ROM_END(scene_texture_04) },
- { SEGMENT_ROM_START(scene_texture_05), SEGMENT_ROM_END(scene_texture_05) },
- { SEGMENT_ROM_START(scene_texture_06), SEGMENT_ROM_END(scene_texture_06) },
- { SEGMENT_ROM_START(scene_texture_07), SEGMENT_ROM_END(scene_texture_07) },
- { SEGMENT_ROM_START(scene_texture_08), SEGMENT_ROM_END(scene_texture_08) },
+ static RomFile sSceneTextureFiles[9] = {
+ ROM_FILE_UNSET, // Default
+ ROM_FILE(scene_texture_01),
+ ROM_FILE(scene_texture_02),
+ ROM_FILE(scene_texture_03),
+ ROM_FILE(scene_texture_04),
+ ROM_FILE(scene_texture_05),
+ ROM_FILE(scene_texture_06),
+ ROM_FILE(scene_texture_07),
+ ROM_FILE(scene_texture_08),
};
- uintptr_t vromStart = sceneTextureFiles[fileIndex].vromStart;
- size_t size = sceneTextureFiles[fileIndex].vromEnd - vromStart;
+ uintptr_t vromStart = sSceneTextureFiles[fileIndex].vromStart;
+ size_t size = sSceneTextureFiles[fileIndex].vromEnd - vromStart;
if (size != 0) {
play->roomCtx.unk74 = THA_AllocTailAlign16(&play->state.tha, size);
diff --git a/src/code/z_sram_NES.c b/src/code/z_sram_NES.c
index b59fda829..66fb14869 100644
--- a/src/code/z_sram_NES.c
+++ b/src/code/z_sram_NES.c
@@ -1,4 +1,7 @@
+#include "z64save.h"
#include "global.h"
+
+#include "sys_flashrom.h"
#include "z64horse.h"
#include "overlays/gamestates/ovl_file_choose/z_file_select.h"
diff --git a/src/code/z_visfbuf.c b/src/code/z_visfbuf.c
index 63d2cd8c5..86a8c0d31 100644
--- a/src/code/z_visfbuf.c
+++ b/src/code/z_visfbuf.c
@@ -13,6 +13,7 @@
#include "global.h"
#include "z64visfbuf.h"
#include "sys_cfb.h"
+#include "sys_ucode.h"
#define SCALE_MIN 0.032f
#define SCALE_MAX 1.0f //!< also unchanged scale