From 63df4ed6b2773a742d3da6207f0a4e3790bb4966 Mon Sep 17 00:00:00 2001 From: shibbo Date: Tue, 26 Nov 2024 19:30:37 -0500 Subject: [PATCH] remove `-ipa file` and do some other small changes to match some actors properly --- config/RMGK01/splits.txt | 4 ++-- configure.py | 11 +++++----- include/Game/LiveActor/Nerve.hpp | 9 ++++---- include/Game/MapObj/AstroMapBoard.hpp | 4 ---- include/Game/MapObj/MapObjActor.hpp | 21 +++---------------- include/Game/Player/J3DModelX.hpp | 3 ++- include/Game/Util/MathUtil.hpp | 6 ------ .../include/JSystem/JGeometry/TUtil.hpp | 4 +++- .../JSupport/JSUMemoryOutputStream.hpp | 6 +++--- .../JSystem/JSupport/JSURandomInputStream.hpp | 6 ++---- .../JSupport/JSURandomOutputStream.hpp | 4 +++- libs/RVL_SDK/include/revolution/gd.h | 3 +-- libs/RVL_SDK/include/revolution/gx.h | 3 +-- .../include/revolution/gx/GXGeometry.h | 4 ++-- src/Game/Map/OceanRingDrawer.cpp | 3 +-- src/Game/MapObj/AstroMapBoard.cpp | 6 +++++- src/Game/MapObj/MapObjActor.cpp | 11 ++++++++++ src/Game/MapObj/SpinDriverPathDrawer.cpp | 5 ++--- src/Game/Screen/THPDraw.c | 1 + src/Game/Util/MathUtil.cpp | 3 +++ src/RVL_SDK/gd/GDBase.c | 4 ++-- 21 files changed, 57 insertions(+), 64 deletions(-) diff --git a/config/RMGK01/splits.txt b/config/RMGK01/splits.txt index fe73b09c9..50ca4e8ed 100644 --- a/config/RMGK01/splits.txt +++ b/config/RMGK01/splits.txt @@ -4106,14 +4106,14 @@ Game/MapObj/AstroDomeSky.cpp: .text start:0x801AE3F8 end:0x801AEE08 .ctors start:0x8052EC40 end:0x8052EC44 .rodata start:0x80533018 end:0x80533048 - .data start:0x8058E9B8 end:0x8058EBA0 + .data start:0x8058E9B8 end:0x8058EB60 .sbss start:0x806B4DF8 end:0x806B4E18 .sdata2 start:0x806BC758 end:0x806BC780 Game/MapObj/AstroMapBoard.cpp: .text start:0x801AEE08 end:0x801AEFF4 .ctors start:0x8052EC44 end:0x8052EC48 - .data start:0x8058EBA0 end:0x8058EC40 + .data start:0x8058EB60 end:0x8058EC40 .sdata start:0x806B1D38 end:0x806B1D40 .sbss start:0x806B4E18 end:0x806B4E20 .sdata2 start:0x806BC780 end:0x806BC788 diff --git a/configure.py b/configure.py index ff03ac7f6..1db76d7dd 100644 --- a/configure.py +++ b/configure.py @@ -218,7 +218,6 @@ "-fp_contract on", "-str reuse", "-enc SJIS", - "-ipa file", "-i include", "-i libs/JSystem/include", "-i libs/MSL_C++/include", @@ -446,11 +445,11 @@ def JSysLib(lib_name: str, objects: List[Object]) -> Dict[str, Any]: "progress_category": "sdk", # str | List[str] "objects": [ Object(NonMatching, "Runtime/__mem.c"), - Object(NonMatching, "Runtime/__va_arg.c"), + Object(Matching, "Runtime/__va_arg.c"), Object(NonMatching, "Runtime/global_destructor_chain.c"), Object(NonMatching, "Runtime/NMWException.cpp"), Object(NonMatching, "Runtime/ptmf.c"), - Object(NonMatching, "Runtime/runtime.c"), + Object(Matching, "Runtime/runtime.c"), Object(NonMatching, "Runtime/__init_cpp_exceptions.cpp"), Object(NonMatching, "Runtime/Gecko_ExceptionPPC.cpp"), Object(NonMatching, "Runtime/GCN_mem_alloc.c") @@ -2141,9 +2140,9 @@ def JSysLib(lib_name: str, objects: List[Object]) -> Dict[str, Any]: Object(NonMatching, "Game/System/WPadStick.cpp"), Object(NonMatching, "Game/System/HomeButtonMenuWrapper.cpp"), Object(NonMatching, "Game/System/HomeButtonStateNotifier.cpp"), - Object(Matching, "Game/System/ConfigDataHolder.cpp"), - Object(Matching, "Game/System/ConfigDataMii.cpp"), - Object(Matching, "Game/System/ConfigDataMisc.cpp"), + Object(NonMatching, "Game/System/ConfigDataHolder.cpp"), + Object(NonMatching, "Game/System/ConfigDataMii.cpp"), + Object(NonMatching, "Game/System/ConfigDataMisc.cpp"), Object(NonMatching, "Game/System/FindingLuigiEventScheduler.cpp"), Object(NonMatching, "Game/System/GalaxyCometScheduler.cpp"), Object(NonMatching, "Game/System/GalaxyCometState.cpp"), diff --git a/include/Game/LiveActor/Nerve.hpp b/include/Game/LiveActor/Nerve.hpp index d977a511a..46170b076 100644 --- a/include/Game/LiveActor/Nerve.hpp +++ b/include/Game/LiveActor/Nerve.hpp @@ -99,9 +99,10 @@ public:\ class name : public Nerve\ {\ public:\ - name() NO_INLINE {\ - };\ - virtual void execute(Spine *pSpine) const {\ - };\ + name() NO_INLINE {}\ + virtual void execute(Spine *pSpine) const {}\ + inline static name* get() {\ + return &sInstance;\ + }\ static name sInstance;\ };\ diff --git a/include/Game/MapObj/AstroMapBoard.hpp b/include/Game/MapObj/AstroMapBoard.hpp index 8f8363f32..940ce19d6 100644 --- a/include/Game/MapObj/AstroMapBoard.hpp +++ b/include/Game/MapObj/AstroMapBoard.hpp @@ -11,7 +11,3 @@ class AstroMapBoard : public MapObjActor { virtual void initAfterPlacement(); virtual void connectToScene(const MapObjActorInitInfo &); }; - -namespace NrvAstroMapBoard { - NERVE_DECL_NULL(AstroMapBoardNrvWait); -}; \ No newline at end of file diff --git a/include/Game/MapObj/MapObjActor.hpp b/include/Game/MapObj/MapObjActor.hpp index fb781a0d8..362745440 100644 --- a/include/Game/MapObj/MapObjActor.hpp +++ b/include/Game/MapObj/MapObjActor.hpp @@ -19,25 +19,12 @@ namespace NrvMapObjActor { NERVE(HostTypeDone); }; -namespace { - const char* cBrkNameColorChange = "ColorChange"; - const char* cBtpNameTexChange = "TexChange"; - const char* cBtkNameTexChange = "TexChange"; - const char* cEffectNameAppear = "Appear"; - const char* cBckNameMove = "Move"; - const char* cFollowJointName = "Move"; - const char* cEffectNameBreak = "Break"; - const char* cBckNameBreak = "Break"; -}; - class MapObjActor : public LiveActor { public: MapObjActor(const char *); MapObjActor(const char *, const char *); - virtual ~MapObjActor() { - - } + inline virtual ~MapObjActor(); virtual void init(const JMapInfoIter &); virtual void initAfterPlacement(); @@ -52,9 +39,7 @@ class MapObjActor : public LiveActor { virtual void initCaseNoUseSwitchA(const MapObjActorInitInfo &); virtual void initCaseUseSwitchB(const MapObjActorInitInfo &); virtual void initCaseNoUseSwitchB(const MapObjActorInitInfo &); - virtual void makeSubModels(const JMapInfoIter &, const MapObjActorInitInfo &) { - - } + virtual void makeSubModels(const JMapInfoIter &, const MapObjActorInitInfo &); void initialize(const JMapInfoIter &, const MapObjActorInitInfo &); bool isObjectName(const char *) const; @@ -121,4 +106,4 @@ class MapObjActorUtil { static void setupInitInfoColorChangeArg0(MapObjActorInitInfo *, const JMapInfoIter &); static void setupInitInfoTextureChangeArg1(MapObjActorInitInfo *, const JMapInfoIter &); static void setupInitInfoShadowLengthArg2(MapObjActorInitInfo *, const JMapInfoIter &); -}; \ No newline at end of file +}; diff --git a/include/Game/Player/J3DModelX.hpp b/include/Game/Player/J3DModelX.hpp index 3be1e2bce..5d10741f3 100644 --- a/include/Game/Player/J3DModelX.hpp +++ b/include/Game/Player/J3DModelX.hpp @@ -1,6 +1,7 @@ #pragma once #include +#include class J3DShapeX; class J3DShapePacketX; @@ -91,4 +92,4 @@ class J3DModelX : public J3DModel { s32 _1E0; u8 _1E4; u8 _1E5; -}; \ No newline at end of file +}; diff --git a/include/Game/Util/MathUtil.hpp b/include/Game/Util/MathUtil.hpp index c882f1f8f..f4b16d4fc 100644 --- a/include/Game/Util/MathUtil.hpp +++ b/include/Game/Util/MathUtil.hpp @@ -4,13 +4,7 @@ #include #include "JSystem/JGeometry.hpp" -static f32 minDegree = 0.0f; -static f32 maxDegree = 360.0f; - -static f32 flt_8060FC80[1816]; - namespace MR { - void initAcosTable(); template diff --git a/libs/JSystem/include/JSystem/JGeometry/TUtil.hpp b/libs/JSystem/include/JSystem/JGeometry/TUtil.hpp index 716b4f2e8..3b17073db 100644 --- a/libs/JSystem/include/JSystem/JGeometry/TUtil.hpp +++ b/libs/JSystem/include/JSystem/JGeometry/TUtil.hpp @@ -30,6 +30,8 @@ namespace JGeometry { } static f32 asin(f32 val) NO_INLINE { + + if (val >= 1.0f) { return 1.5707964f; } @@ -52,4 +54,4 @@ namespace JGeometry { static T clamp(T, T, T); static T inv_sqrt(T); }; -}; \ No newline at end of file +}; diff --git a/libs/JSystem/include/JSystem/JSupport/JSUMemoryOutputStream.hpp b/libs/JSystem/include/JSystem/JSupport/JSUMemoryOutputStream.hpp index 5e224e89c..c0ebfe6de 100644 --- a/libs/JSystem/include/JSystem/JSupport/JSUMemoryOutputStream.hpp +++ b/libs/JSystem/include/JSystem/JSupport/JSUMemoryOutputStream.hpp @@ -4,8 +4,8 @@ class JSUMemoryOutputStream : public JSURandomOutputStream { public: - JSUMemoryOutputStream() { - + inline JSUMemoryOutputStream() { + } virtual ~JSUMemoryOutputStream(); @@ -19,4 +19,4 @@ class JSUMemoryOutputStream : public JSURandomOutputStream { void* mBuffer; // 0x8 s32 mLength; // 0xC s32 mPosition; // 0x10 -}; \ No newline at end of file +}; diff --git a/libs/JSystem/include/JSystem/JSupport/JSURandomInputStream.hpp b/libs/JSystem/include/JSystem/JSupport/JSURandomInputStream.hpp index 2e87b0510..4df96553d 100644 --- a/libs/JSystem/include/JSystem/JSupport/JSURandomInputStream.hpp +++ b/libs/JSystem/include/JSystem/JSupport/JSURandomInputStream.hpp @@ -6,9 +6,7 @@ enum JSUStreamSeekFrom; class JSURandomInputStream : public JSUInputStream { public: - JSURandomInputStream() : JSUInputStream() { - - } + inline JSURandomInputStream(); virtual ~JSURandomInputStream(); @@ -23,4 +21,4 @@ class JSURandomInputStream : public JSUInputStream { virtual s32 seekPos(s32, JSUStreamSeekFrom) = 0; s32 seek(s32, JSUStreamSeekFrom); -}; \ No newline at end of file +}; diff --git a/libs/JSystem/include/JSystem/JSupport/JSURandomOutputStream.hpp b/libs/JSystem/include/JSystem/JSupport/JSURandomOutputStream.hpp index 316774064..20f826996 100644 --- a/libs/JSystem/include/JSystem/JSupport/JSURandomOutputStream.hpp +++ b/libs/JSystem/include/JSystem/JSupport/JSURandomOutputStream.hpp @@ -4,9 +4,11 @@ class JSURandomOutputStream : public JSUOutputStream { public: + inline JSURandomOutputStream(); + virtual s32 writeData(const void *, s32) = 0; virtual s32 getLength() const = 0; virtual s32 getPosition() const = 0; virtual void seek(s32, JSUStreamSeekFrom); virtual s32 getAvailable() const; -}; \ No newline at end of file +}; diff --git a/libs/RVL_SDK/include/revolution/gd.h b/libs/RVL_SDK/include/revolution/gd.h index c283a8e3b..0953db595 100644 --- a/libs/RVL_SDK/include/revolution/gd.h +++ b/libs/RVL_SDK/include/revolution/gd.h @@ -1,2 +1 @@ -#include "revolution/gd/GDBase.h" -#include "revolution/gd/GDGeometry.h" \ No newline at end of file +#include "revolution/gd/GDGeometry.h" diff --git a/libs/RVL_SDK/include/revolution/gx.h b/libs/RVL_SDK/include/revolution/gx.h index 2be4108ca..31886dcd5 100644 --- a/libs/RVL_SDK/include/revolution/gx.h +++ b/libs/RVL_SDK/include/revolution/gx.h @@ -21,7 +21,6 @@ extern "C" { #include "revolution/gx/GXTexture.h" #include "revolution/gx/GXTransform.h" #include "revolution/gx/GXTypes.h" -#include "revolution/gx/GXVert.h" #include "revolution/types.h" @@ -29,4 +28,4 @@ extern "C" { } #endif -#endif // GX_H \ No newline at end of file +#endif // GX_H diff --git a/libs/RVL_SDK/include/revolution/gx/GXGeometry.h b/libs/RVL_SDK/include/revolution/gx/GXGeometry.h index 8c725abc4..eaf4baae9 100644 --- a/libs/RVL_SDK/include/revolution/gx/GXGeometry.h +++ b/libs/RVL_SDK/include/revolution/gx/GXGeometry.h @@ -22,8 +22,8 @@ void GXSetTexCoordGen2(GXTexCoordID, GXTexGenType, GXTexGenSrc, u32, GXBool, u32 void GXSetNumTexGens(u8); -static void GXEnd(void) { - +static inline void GXEnd(void) { + } void __GXSetSUTexRegs(void); diff --git a/src/Game/Map/OceanRingDrawer.cpp b/src/Game/Map/OceanRingDrawer.cpp index 0e1e9b52f..019fbbfe7 100644 --- a/src/Game/Map/OceanRingDrawer.cpp +++ b/src/Game/Map/OceanRingDrawer.cpp @@ -1,8 +1,7 @@ #include "Game/Map/OceanRingDrawer.hpp" #include "Game/Map/OceanRing.hpp" #include "Game/Map/WaterAreaHolder.hpp" -#include "Game/Util.hpp" - +#include static u8 unknownVal = 1; static GXColor color1 = { 0x28, 0x28, 0x28, 0x14 }; diff --git a/src/Game/MapObj/AstroMapBoard.cpp b/src/Game/MapObj/AstroMapBoard.cpp index 32cc47bbb..8690c7bf2 100644 --- a/src/Game/MapObj/AstroMapBoard.cpp +++ b/src/Game/MapObj/AstroMapBoard.cpp @@ -5,6 +5,10 @@ namespace { static const char* cDummyTexName = "MapDummy"; }; +namespace NrvAstroMapBoard { + NERVE_DECL_NULL(AstroMapBoardNrvWait); +}; + AstroMapBoard::AstroMapBoard(const char *pName) : MapObjActor(pName) { } @@ -14,7 +18,7 @@ void AstroMapBoard::init(const JMapInfoIter &rIter) { MapObjActorInitInfo info; MapObjActorUtil::setupInitInfoSimpleMapObj(&info); info.setupPrepareChangeDummyTexture(cDummyTexName); - info.setupNerve(&NrvAstroMapBoard::AstroMapBoardNrvWait::sInstance); + info.setupNerve(NrvAstroMapBoard::AstroMapBoardNrvWait::get()); info.setupFarClipping(-1.0f); info.setupNoAppearRiddleSE(); initialize(rIter, info); diff --git a/src/Game/MapObj/MapObjActor.cpp b/src/Game/MapObj/MapObjActor.cpp index 9960796ee..753809a9e 100644 --- a/src/Game/MapObj/MapObjActor.cpp +++ b/src/Game/MapObj/MapObjActor.cpp @@ -17,6 +17,17 @@ NrvMapObjActor::HostTypeDone NrvMapObjActor::HostTypeDone::sInstance; NrvMapObjActor::HostTypeMove NrvMapObjActor::HostTypeMove::sInstance; NrvMapObjActor::HostTypeWait NrvMapObjActor::HostTypeWait::sInstance; +namespace { + const char* cBrkNameColorChange = "ColorChange"; + const char* cBtpNameTexChange = "TexChange"; + const char* cBtkNameTexChange = "TexChange"; + const char* cEffectNameAppear = "Appear"; + const char* cBckNameMove = "Move"; + const char* cFollowJointName = "Move"; + const char* cEffectNameBreak = "Break"; + const char* cBckNameBreak = "Break"; +}; + MapObjActor::MapObjActor(const char *pName) : LiveActor(pName) { mObjectName = 0; mPlanetLodCtrl = 0; diff --git a/src/Game/MapObj/SpinDriverPathDrawer.cpp b/src/Game/MapObj/SpinDriverPathDrawer.cpp index 097c4cb6f..3f3bb0242 100644 --- a/src/Game/MapObj/SpinDriverPathDrawer.cpp +++ b/src/Game/MapObj/SpinDriverPathDrawer.cpp @@ -1,7 +1,6 @@ #include "Game/MapObj/SpinDriverPathDrawer.hpp" #include "Game/Scene/SceneObjHolder.hpp" -#include "Game/Util.hpp" -#include "Game/Util/DirectDraw.hpp" +#include SpinDriverPathDrawInit::SpinDriverPathDrawInit() : NameObj("スピンドライバーレール描画初期化"), @@ -206,4 +205,4 @@ SpinDriverPathDrawer::~SpinDriverPathDrawer() { SpinDriverPathDrawInit::~SpinDriverPathDrawInit() { -} \ No newline at end of file +} diff --git a/src/Game/Screen/THPDraw.c b/src/Game/Screen/THPDraw.c index 2e1176e34..f9f4cbdc5 100644 --- a/src/Game/Screen/THPDraw.c +++ b/src/Game/Screen/THPDraw.c @@ -1,4 +1,5 @@ #include +#include #ifdef __cplusplus extern "C" { diff --git a/src/Game/Util/MathUtil.cpp b/src/Game/Util/MathUtil.cpp index 053dece75..e9790ef5a 100644 --- a/src/Game/Util/MathUtil.cpp +++ b/src/Game/Util/MathUtil.cpp @@ -7,6 +7,9 @@ #include +static f32 minDegree = 0.0f; +static f32 maxDegree = 360.0f; + namespace MR { f32 getRandom(f32 min, f32 max) { return (min + ((max - min) * getRandom())); diff --git a/src/RVL_SDK/gd/GDBase.c b/src/RVL_SDK/gd/GDBase.c index 6b43f5dea..789e22d5e 100644 --- a/src/RVL_SDK/gd/GDBase.c +++ b/src/RVL_SDK/gd/GDBase.c @@ -1,4 +1,4 @@ -#include +#include GDLObj* __GDCurrentDL = NULL; static GDOverflowCallback overflowcb = NULL; @@ -27,4 +27,4 @@ void GDOverflowed() { if (overflowcb) { (*overflowcb)(); } -} \ No newline at end of file +}