From f14ca94607588de36dab73334660f81d9b769d14 Mon Sep 17 00:00:00 2001 From: Henrique Gemignani Passos Lima Date: Mon, 10 Oct 2022 12:46:24 +0300 Subject: [PATCH] Fix building `ninja all_source` --- configure.py | 8 ++++++-- include/MetroidPrime/CArchitectureQueue.hpp | 1 + include/WorldFormat/CWorldLight.hpp | 2 +- include/musyx/synth.h | 4 ++-- include/rstl/list.hpp | 1 + src/Dolphin/os/OSReset.c | 4 ++++ src/MetroidPrime/ScriptObjects/CScriptPlatform.cpp | 2 +- src/MetroidPrime/main.cpp | 2 +- src/WorldFormat/CWorldLight.cpp | 6 +++--- 9 files changed, 20 insertions(+), 10 deletions(-) diff --git a/configure.py b/configure.py index bd629f81..05e2070e 100755 --- a/configure.py +++ b/configure.py @@ -914,7 +914,7 @@ LIBS = [ "musyx/seq", "musyx/synth", ["musyx/seq_api", True], - "musyx/snd_synthapi", + ["musyx/snd_synthapi", False, False], "musyx/stream", "musyx/synthdata", "musyx/synthmacros", @@ -1141,7 +1141,10 @@ for lib in LIBS: n.comment("Loose files") for object in lib["objects"]: completed = False + add_to_all = True if type(object) is list: + if len(object) > 2: + add_to_all = object[2] completed = object[1] object = object[0] @@ -1163,7 +1166,8 @@ for lib in LIBS: "basedir": os.path.dirname(f"$builddir/src/{object}"), "basefile": f"$builddir/src/{object}" }) - all_source_files.append(f"$builddir/src/{object}.o") + if add_to_all: + all_source_files.append(f"$builddir/src/{object}.o") if os.path.exists(os.path.join("asm", f"{object}.s")): n.build(f"$builddir/asm/{object}.o", "as", f"asm/{object}.s") if completed: diff --git a/include/MetroidPrime/CArchitectureQueue.hpp b/include/MetroidPrime/CArchitectureQueue.hpp index e44e40ad..76198e68 100644 --- a/include/MetroidPrime/CArchitectureQueue.hpp +++ b/include/MetroidPrime/CArchitectureQueue.hpp @@ -11,6 +11,7 @@ class CArchitectureQueue { public: bool Push(const CArchitectureMessage& msg) { x0_queue.push_back(msg); + return false; // TODO } void Pop(); // TODO void Clear(); // TODO diff --git a/include/WorldFormat/CWorldLight.hpp b/include/WorldFormat/CWorldLight.hpp index 964b5d7c..39ef98cb 100644 --- a/include/WorldFormat/CWorldLight.hpp +++ b/include/WorldFormat/CWorldLight.hpp @@ -34,7 +34,7 @@ public: float x30_; bool x34_castShadows; float x38_; - EFalloffType x3c_falloff; + EFallofType x3c_falloff; float x40_; }; diff --git a/include/musyx/synth.h b/include/musyx/synth.h index 67ecc707..979996f0 100644 --- a/include/musyx/synth.h +++ b/include/musyx/synth.h @@ -2,7 +2,7 @@ #define _MUSYX_SYNTH #include "musyx/musyx_priv.h" -#ifndef __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -40,7 +40,7 @@ void synthVolume(u8 volume, u16 time, u8 volgroup2, s32, s32); /* TODO: Move this where it belongs */ void hwSetAUXProcessingCallbacks(u8 studio, SND_AUX_CALLBACK auxA, void* userA, SND_AUX_CALLBACK auxB, void* userB); -#ifndef __cplusplus +#ifdef __cplusplus } #endif diff --git a/include/rstl/list.hpp b/include/rstl/list.hpp index edf451ba..f3947627 100644 --- a/include/rstl/list.hpp +++ b/include/rstl/list.hpp @@ -18,6 +18,7 @@ public: cur = cur->get_next(); } } + void push_back(const T&); private: struct node { diff --git a/src/Dolphin/os/OSReset.c b/src/Dolphin/os/OSReset.c index 68e77941..8bc8d9e9 100644 --- a/src/Dolphin/os/OSReset.c +++ b/src/Dolphin/os/OSReset.c @@ -1,3 +1,5 @@ +#include "dolphin/os/OSReset.h" + volatile u8 DAT_800030e2 : 0x800030e2; typedef struct Unk { u8 pad[0x24]; @@ -17,6 +19,8 @@ typedef struct OSResetQueue { OSResetFunctionInfo* last; } OSResetQueue; +OSResetQueue ResetFunctionQueue; + void OSRegisterResetFunction(OSResetFunctionInfo* func) { OSResetFunctionInfo* tmp; OSResetFunctionInfo* iter; diff --git a/src/MetroidPrime/ScriptObjects/CScriptPlatform.cpp b/src/MetroidPrime/ScriptObjects/CScriptPlatform.cpp index 010fe9ed..906271dd 100644 --- a/src/MetroidPrime/ScriptObjects/CScriptPlatform.cpp +++ b/src/MetroidPrime/ScriptObjects/CScriptPlatform.cpp @@ -20,7 +20,7 @@ struct GXData { extern GXData* __GXData; static inline void write_bp_cmd(u32 cmd) { - GXWGFifo.uchar = GX_LOAD_BP_REG; + GXWGFifo.u8 = GX_LOAD_BP_REG; GXWGFifo.u32 = cmd; __GXData->cpCRreg = 0; } diff --git a/src/MetroidPrime/main.cpp b/src/MetroidPrime/main.cpp index 23e63bcb..a012a1ba 100644 --- a/src/MetroidPrime/main.cpp +++ b/src/MetroidPrime/main.cpp @@ -75,7 +75,7 @@ unkptr gpDefaultFont; unkptr lbl_805A8C50; unkptr lbl_805A8C54; bool COsContext::mProgressiveMode; -uint sARAMMemArray[2]; +u32 sARAMMemArray[2]; float sInfiniteLoopTime; #define GRAPHICS_FIFO_SIZE 0x60000 diff --git a/src/WorldFormat/CWorldLight.cpp b/src/WorldFormat/CWorldLight.cpp index 76073844..6dade742 100644 --- a/src/WorldFormat/CWorldLight.cpp +++ b/src/WorldFormat/CWorldLight.cpp @@ -1,11 +1,11 @@ #include "WorldFormat/CWorldLight.hpp" #include "Kyoto/Streams/CInputStream.hpp" -#include +// #include #include const CVector3f CWorldLight::kDefaultPosition = CVector3f(0.f, 0.f, 0.f); -FORCEPADDING(sizeof(CVector3f)) kPadding; +// FORCEPADDING(sizeof(CVector3f)) kPadding; const CVector3f CWorldLight::kDefaultDirection = CVector3f(0.f, 1.f, 0.f); CWorldLight::CWorldLight(CInputStream& in) @@ -18,7 +18,7 @@ CWorldLight::CWorldLight(CInputStream& in) , x30_(in.Get< float >()) , x34_castShadows(in.Get< bool >()) , x38_(in.Get< float >()) -, x3c_falloff((EFalloffType)in.Get< uint >()) +, x3c_falloff((EFallofType)in.Get< uint >()) , x40_(in.Get< float >()) {} CLight CWorldLight::GetAsCGraphicsLight() const {