diff --git a/mm/2s2h/BenGui/BenGui.cpp b/mm/2s2h/BenGui/BenGui.cpp index cb6ac34a6..2877c7b21 100644 --- a/mm/2s2h/BenGui/BenGui.cpp +++ b/mm/2s2h/BenGui/BenGui.cpp @@ -19,7 +19,6 @@ #include "include/global.h" #include "include/z64audio.h" -#include "libultraship/libultraship.h" bool ShouldClearTextureCacheAtEndOfFrame = false; diff --git a/mm/2s2h/DeveloperTools/ActorViewer.cpp b/mm/2s2h/DeveloperTools/ActorViewer.cpp index 4c537dbeb..35ab36206 100644 --- a/mm/2s2h/DeveloperTools/ActorViewer.cpp +++ b/mm/2s2h/DeveloperTools/ActorViewer.cpp @@ -1,11 +1,6 @@ #include "ActorViewer.h" #include "2s2h/BenGui/UIWidgets.hpp" - -extern "C" { - #include "global.h" - extern PlayState* gPlayState; - -} +#include "global.h" typedef struct ActorInfo { u16 id; diff --git a/mm/2s2h/DeveloperTools/BetterMapSelect.c b/mm/2s2h/DeveloperTools/BetterMapSelect.c index 643d69efd..cc62e0bdc 100644 --- a/mm/2s2h/DeveloperTools/BetterMapSelect.c +++ b/mm/2s2h/DeveloperTools/BetterMapSelect.c @@ -3,7 +3,7 @@ #include "overlays/gamestates/ovl_file_choose/z_file_select.h" #include "overlays/gamestates/ovl_select/z_select.h" -#include "libultraship/libultraship.h" +#include extern SceneSelectEntry sScenes[143]; diff --git a/mm/2s2h/z_message_OTR.cpp b/mm/2s2h/z_message_OTR.cpp index c2ec4db47..7614dfbb1 100644 --- a/mm/2s2h/z_message_OTR.cpp +++ b/mm/2s2h/z_message_OTR.cpp @@ -3,7 +3,6 @@ #include "2s2h/resource/type/Scene.h" #include #include "global.h" -#include "vt.h" #include "2s2h/resource/type/TextMM.h" #include #include diff --git a/mm/2s2h/z_play_2SH.cpp b/mm/2s2h/z_play_2SH.cpp index 5679a15cc..5cd2296c7 100644 --- a/mm/2s2h/z_play_2SH.cpp +++ b/mm/2s2h/z_play_2SH.cpp @@ -5,9 +5,9 @@ #include extern "C" { #include "global.h" -#include "vt.h" -#include +extern uintptr_t gSegments[NUM_SEGMENTS]; } + LUS::IResource* OTRPlay_LoadFile(PlayState* play, const char* fileName) { auto res = LUS::Context::GetInstance()->GetResourceManager()->LoadResource(fileName); return res.get(); diff --git a/mm/2s2h/z_scene_2SH.cpp b/mm/2s2h/z_scene_2SH.cpp index 6cafbf184..5d229f013 100644 --- a/mm/2s2h/z_scene_2SH.cpp +++ b/mm/2s2h/z_scene_2SH.cpp @@ -1,10 +1,6 @@ #include "BenPort.h" -extern "C" { -#include "z64.h" -#include "vt.h" -#include "global.h" -} #include +#include "global.h" #include #include #include diff --git a/mm/include/functions.h b/mm/include/functions.h index 6b37938dd..e9e64ec5e 100644 --- a/mm/include/functions.h +++ b/mm/include/functions.h @@ -9,6 +9,7 @@ extern "C" { #include "z64.h" #include "BenPort.h" #include "libultraship/luslog.h" +#include void bootproc(void); void ViConfig_UpdateVi(u32 black); diff --git a/mm/include/variables.h b/mm/include/variables.h index ed3c48fef..43d20b140 100644 --- a/mm/include/variables.h +++ b/mm/include/variables.h @@ -5,6 +5,11 @@ #include "segment_symbols.h" #include "macros.h" +#ifdef __cplusplus +extern "C" +{ +#endif + // pre-boot variables extern u16 gFramebuffer1[SCREEN_HEIGHT][SCREEN_WIDTH]; // at 0x80000500 extern u8 D_80025D00[]; @@ -1762,5 +1767,8 @@ extern u16 D_0F000000[]; extern PlayState* gPlayState; // #endregion +#ifdef __cplusplus +}; +#endif #endif diff --git a/mm/src/code/graph.c b/mm/src/code/graph.c index ab77211d6..23a382b5b 100644 --- a/mm/src/code/graph.c +++ b/mm/src/code/graph.c @@ -3,8 +3,7 @@ #include "regs.h" #include "functions.h" #include "fault.h" -#include "gfxdebuggerbridge.h" -#include "libultraship/libultraship.h" +#include #include // Variables are put before most headers as a hacky way to bypass bss reordering diff --git a/mm/src/code/z_bgcheck.c b/mm/src/code/z_bgcheck.c index cf67125ca..783f2c4cc 100644 --- a/mm/src/code/z_bgcheck.c +++ b/mm/src/code/z_bgcheck.c @@ -4,7 +4,6 @@ #include "fixed_point.h" #include "vt.h" #include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h" -#include "libultraship/libultraship.h" #include #define DYNA_RAYCAST_FLOORS 1 diff --git a/mm/src/code/z_lib.c b/mm/src/code/z_lib.c index 773702c3f..a5a00a26c 100644 --- a/mm/src/code/z_lib.c +++ b/mm/src/code/z_lib.c @@ -1,5 +1,5 @@ #include "global.h" -#include +#include f32 Math_CosS(s16 angle) { return coss(angle) * SHT_MINV; @@ -676,7 +676,6 @@ f32 Math_Vec3f_StepTo(Vec3f* start, Vec3f* target, f32 speed) { void Lib_Nop801004FC(void) { } -int ResourceMgr_OTRSigCheck(char* imgData); void* Lib_SegmentedToVirtual(void* ptr) { if (ResourceMgr_OTRSigCheck(ptr)) { return ResourceGetDataByName(ptr); // SEGMENTED_TO_VIRTUAL(ptr); diff --git a/mm/src/code/z_message.c b/mm/src/code/z_message.c index 5db70fbf2..4e5f35189 100644 --- a/mm/src/code/z_message.c +++ b/mm/src/code/z_message.c @@ -6,7 +6,6 @@ #include "interface/parameter_static/parameter_static.h" #include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h" #include "BenPort.h" -#include #include "assets/archives/schedule_dma_static/schedule_dma_static_yar.h" #include "assets/archives/icon_item_static/icon_item_static_yar.h" #include "assets/archives/icon_item_24_static/icon_item_24_static_yar.h" diff --git a/mm/src/code/z_parameter.c b/mm/src/code/z_parameter.c index 71653fc4c..0594153aa 100644 --- a/mm/src/code/z_parameter.c +++ b/mm/src/code/z_parameter.c @@ -15,7 +15,6 @@ #include "interface/week_static/week_static.h" #include "BenPort.h" #include -#include "libultraship/libultraship.h" #include "BenGui/HudEditor.h" // #region 2S2H [Port] Asset tables we can pull from instead of from ROM diff --git a/mm/src/code/z_pause.c b/mm/src/code/z_pause.c index c55cb6450..7e094cfc1 100644 --- a/mm/src/code/z_pause.c +++ b/mm/src/code/z_pause.c @@ -23,7 +23,7 @@ #include "libc/stdbool.h" #include "padutils.h" #include "macros.h" -#include "libultraship/libultraship.h" +#include void FrameAdvance_Init(FrameAdvanceContext* frameAdvCtx) { frameAdvCtx->timer = 0; diff --git a/mm/src/code/z_scene.c b/mm/src/code/z_scene.c index 38b031e83..3a7a4dfc9 100644 --- a/mm/src/code/z_scene.c +++ b/mm/src/code/z_scene.c @@ -1,5 +1,4 @@ #include "global.h" -#include /** * Spawn an object file of a specified ID that will persist through room changes. diff --git a/mm/src/overlays/gamestates/ovl_select/z_select.c b/mm/src/overlays/gamestates/ovl_select/z_select.c index 44791a822..8ecc65874 100644 --- a/mm/src/overlays/gamestates/ovl_select/z_select.c +++ b/mm/src/overlays/gamestates/ovl_select/z_select.c @@ -9,7 +9,7 @@ #include "z64view.h" #include "libc/alloca.h" #include "overlays/gamestates/ovl_title/z_title.h" -#include "libultraship/libultraship.h" +#include #include "2s2h/DeveloperTools/BetterMapSelect.h" void MapSelect_LoadConsoleLogo(MapSelectState* this) { diff --git a/mm/src/overlays/gamestates/ovl_title/z_title.c b/mm/src/overlays/gamestates/ovl_title/z_title.c index d6ff3765d..a6360ff3e 100644 --- a/mm/src/overlays/gamestates/ovl_title/z_title.c +++ b/mm/src/overlays/gamestates/ovl_title/z_title.c @@ -13,7 +13,6 @@ #include "overlays/gamestates/ovl_select/z_select.h" #include #include "BenPort.h" -#include "libultraship/libultraship.h" void ConsoleLogo_UpdateCounters(ConsoleLogoState* this) { if ((this->coverAlpha == 0) && (this->visibleDuration != 0)) {