From 01dda178d58bfea09687cc7e23ec848f4257d5fc Mon Sep 17 00:00:00 2001 From: Dean Southwood Date: Mon, 16 Dec 2024 15:00:31 +1100 Subject: [PATCH] Update progress categories --- configure.py | 20 +++++++ include/ParaParameters.h | 17 +++++- include/TekiPersonality.h | 1 + src/plugPikiKando/memStat.cpp | 12 +--- src/plugPikiNakata/tekipersonality.cpp | 80 ++++++++++++++++++++++---- 5 files changed, 109 insertions(+), 21 deletions(-) diff --git a/configure.py b/configure.py index 1b808639..0b01b12d 100755 --- a/configure.py +++ b/configure.py @@ -310,6 +310,7 @@ def MatchingFor(*versions): "lib": "sysBootup", "cflags": cflags_pikmin, "mw_version": "GC/1.2.5n", + "progress_category" : "game", "objects": [ Object(Matching, "sysBootup.cpp"), ], @@ -318,6 +319,7 @@ def MatchingFor(*versions): "lib": "jaudio", "cflags": cflags_jaudio, "mw_version": "GC/1.2.5n", + "progress_category" : "jaudio", "objects": [ Object(Matching, "jaudio/dummyprobe.c"), Object(NonMatching, "jaudio/memory.c"), @@ -385,6 +387,7 @@ def MatchingFor(*versions): "lib": "hvqm4dec", "cflags": cflags_base, "mw_version": "GC/1.2.5", + "progress_category" : "hvqm4dec", "objects": [ Object(NonMatching, "hvqm4dec/hvqm4dec.c"), ], @@ -393,6 +396,7 @@ def MatchingFor(*versions): "lib": "sysCommon", "cflags": cflags_pikmin, "mw_version": "GC/1.2.5n", + "progress_category" : "game", "objects": [ Object(NonMatching, "sysCommon/ayuStack.cpp"), Object(Matching, "sysCommon/baseApp.cpp"), @@ -421,6 +425,7 @@ def MatchingFor(*versions): "lib": "sysDolphin", "cflags": cflags_pikmin, "mw_version": "GC/1.2.5n", + "progress_category" : "game", "objects": [ Object(NonMatching, "sysDolphin/texture.cpp"), Object(NonMatching, "sysDolphin/system.cpp"), @@ -434,6 +439,7 @@ def MatchingFor(*versions): "lib": "plugPikiColin", "cflags": cflags_pikmin, "mw_version": "GC/1.2.5n", + "progress_category" : "game", "objects": [ Object(NonMatching, "plugPikiColin/cardutil.cpp"), Object(NonMatching, "plugPikiColin/dynsimulator.cpp"), @@ -467,6 +473,7 @@ def MatchingFor(*versions): "lib": "plugPikiKando", "cflags": cflags_pikmin, "mw_version": "GC/1.2.5n", + "progress_category" : "game", "objects": [ Object(NonMatching, "plugPikiKando/omake.cpp"), Object(Matching, "plugPikiKando/radarInfo.cpp"), @@ -606,6 +613,7 @@ def MatchingFor(*versions): "lib": "plugPikiNakata", "cflags": cflags_pikmin, "mw_version": "GC/1.2.5n", + "progress_category" : "game", "objects": [ Object(Matching, "plugPikiNakata/genteki.cpp"), Object(Matching, "plugPikiNakata/nakatacode.cpp"), @@ -668,6 +676,7 @@ def MatchingFor(*versions): "lib": "plugPikiNishimura", "cflags": cflags_pikmin, "mw_version": "GC/1.2.5n", + "progress_category" : "game", "host": True, "objects": [ Object(NonMatching, "plugPikiNishimura/genBoss.cpp"), @@ -710,6 +719,7 @@ def MatchingFor(*versions): "lib": "plugPikiOgawa", "cflags": cflags_pikmin, "mw_version": "GC/1.2.5n", + "progress_category" : "game", "host": True, "objects": [ Object(NonMatching, "plugPikiOgawa/ogTest.cpp"), @@ -742,6 +752,7 @@ def MatchingFor(*versions): "lib": "plugPikiYamashita", "cflags": cflags_pikmin, "mw_version": "GC/1.2.5n", + "progress_category" : "game", "objects": [ Object(NonMatching, "plugPikiYamashita/gameCourseClear.cpp"), Object(Matching, "plugPikiYamashita/gameStageClear.cpp"), @@ -976,6 +987,7 @@ def MatchingFor(*versions): { "lib": "Runtime.PPCEABI.H", "mw_version": "GC/1.2.5", + "progress_category" : "sdk", "cflags": [*cflags_runtime, "-inline deferred"], "objects": [ Object(NonMatching, "Runtime/PPCEABI/H/__mem.c"), @@ -992,6 +1004,7 @@ def MatchingFor(*versions): { "lib": "MSL_C.PPCEABI.bare.H", "mw_version": "GC/1.2.5", + "progress_category" : "sdk", "cflags": cflags_base, "objects": [ Object(NonMatching, "MSL_C/PPCEABI/bare/H/abort_exit.c"), @@ -1037,6 +1050,7 @@ def MatchingFor(*versions): { "lib": "TRK_MINNOW_DOLPHIN", "mw_version": "GC/1.2.5", + "progress_category" : "sdk", "cflags": cflags_base, "objects": [ Object(NonMatching, "TRK_MINNOW_DOLPHIN/mainloop.c"), @@ -1065,6 +1079,7 @@ def MatchingFor(*versions): { "lib": "amcExi2", "mw_version": "GC/1.2.5", + "progress_category" : "sdk", "cflags": cflags_base, "objects": [ Object(NonMatching, "amcExi2/AmcExi.c"), @@ -1074,6 +1089,7 @@ def MatchingFor(*versions): { "lib": "amcnotstub", "mw_version": "GC/1.2.5", + "progress_category" : "sdk", "cflags": cflags_base, "objects": [ Object(Matching, "amcnotstub/amcnotstub.c"), @@ -1082,6 +1098,7 @@ def MatchingFor(*versions): { "lib": "OdemuExi2", "mw_version": "GC/1.2.5", + "progress_category" : "sdk", "cflags": cflags_base, "objects": [ Object(NonMatching, "OdemuExi2/DebuggerDriver.c"), @@ -1090,6 +1107,7 @@ def MatchingFor(*versions): { "lib": "odenotstub", "mw_version": "GC/1.2.5", + "progress_category" : "sdk", "cflags": cflags_base, "objects": [ Object(Matching, "odenotstub/odenotstub.c"), @@ -1102,6 +1120,8 @@ def MatchingFor(*versions): config.progress_categories = [ ProgressCategory("game", "Game Code"), ProgressCategory("sdk", "SDK Code"), + ProgressCategory("jaudio", "JAudio Code"), + ProgressCategory("hvqm4dec", "HVQM4 Decoder Code"), ] config.progress_each_module = args.verbose diff --git a/include/ParaParameters.h b/include/ParaParameters.h index 4403169c..bd10a85d 100644 --- a/include/ParaParameters.h +++ b/include/ParaParameters.h @@ -55,6 +55,13 @@ struct ParaParameters { } } + inline void readIn(RandomAccessStream& input, int count) + { + for (int i = 0; i <= count; i++) { + mParameters[i] = input.readInt(); + } + } + // _0C = VTBL T* mParameters; // _00 int mParaCount; // _04 @@ -105,6 +112,10 @@ struct ParaParameterInfoF : public ParaParameterInfo { mMax = 0.0f; } + inline void set(char* name, f32 min, f32 max) { + ParaParameterInfo::set(name, min, max); + } + // TODO: members }; @@ -128,9 +139,10 @@ struct ParaMultiParameters { ParaMultiParameters(int, ParaParameterInfoI*, int, ParaParameterInfoF*); void input(ParaMultiParameters&); - f32 getF(int idx) { return mFloatParams->get(idx); } + f32 getF(int idx) { return mFloatParams->get(idx); } int getI(int idx) { return mIntParams->get(idx); } + void setF(int idx, f32 val) { mFloatParams->set(idx, val); } void setI(int idx, int val) { mIntParams->set(idx, val); } @@ -147,4 +159,7 @@ struct ParaMultiParameters { virtual void print(); // _10 }; +#define PARA_SET_INT(_PARA, _NAME, _MIN, _MAX) \ + (_PARA)->set(_NAME, _MIN, _MAX); + #endif diff --git a/include/TekiPersonality.h b/include/TekiPersonality.h index 2145133f..f8d371b1 100644 --- a/include/TekiPersonality.h +++ b/include/TekiPersonality.h @@ -37,6 +37,7 @@ struct TekiPersonality { void input(TekiPersonality&); f32 getF(int idx) { return mParams->getF(idx); } + int getI(int idx) { return mParams->getI(idx); } inline void init() { diff --git a/src/plugPikiKando/memStat.cpp b/src/plugPikiKando/memStat.cpp index 783c74a6..626847d6 100644 --- a/src/plugPikiKando/memStat.cpp +++ b/src/plugPikiKando/memStat.cpp @@ -3,6 +3,7 @@ #include "system.h" #include "sysNew.h" #include "stl/string.h" +#include "DebugLog.h" MemStat* memStat; @@ -11,21 +12,14 @@ MemStat* memStat; * Address: ........ * Size: 00009C */ -static void _Error(char* fmt, ...) -{ - OSPanic(__FILE__, __LINE__, fmt); - // UNUSED FUNCTION -} +DEFINE_ERROR(); /* * --INFO-- * Address: ........ * Size: 0000F0 */ -static void _Print(char*, ...) -{ - // UNUSED FUNCTION -} +DEFINE_PRINT("memStat"); /* * --INFO-- diff --git a/src/plugPikiNakata/tekipersonality.cpp b/src/plugPikiNakata/tekipersonality.cpp index b666c553..10eaf0bb 100644 --- a/src/plugPikiNakata/tekipersonality.cpp +++ b/src/plugPikiNakata/tekipersonality.cpp @@ -1,26 +1,21 @@ #include "TekiPersonality.h" #include "sysNew.h" #include "ParaParameters.h" +#include "DebugLog.h" /* * --INFO-- * Address: ........ * Size: 00009C */ -static void _Error(char*, ...) -{ - // UNUSED FUNCTION -} +DEFINE_ERROR(); /* * --INFO-- * Address: ........ * Size: 0000F4 */ -static void _Print(char*, ...) -{ - // UNUSED FUNCTION -} +DEFINE_PRINT("tekipersonality"); /* * --INFO-- @@ -31,20 +26,22 @@ TekiPersonality::TekiPersonality() { int i = INT_ParamCount; ParaParameterInfoI* intParams = new ParaParameterInfoI[i]; + intParams[0].set("PELLET_MIN_COUNT", -128, 127); intParams[1].set("PELLET_MAX_COUNT", -128, 127); intParams[2].set("WATER_MIN_COUNT", -128, 127); intParams[3].set("WATER_MAX_COUNT", -128, 127); - intParams[4].set("WATER_MAX_COUNT", -128, 127); + intParams[4].set("PARAMETER_0", -128, 127); ParaParameterInfoF* floatParams = new ParaParameterInfoF[i]; + floatParams[0].set("SIZE", 0.1f, 10.0f); floatParams[1].set("STRENGTH", 0.0f, 100.0f); floatParams[2].set("TERRITORY_RANGE", 0.0f, 10000.0f); floatParams[3].set("PELLET_APPEARANCE_PROBABILITY", 0.0f, 1.0f); floatParams[4].set("WATER_APPEARANCE_PROBABILITY", 0.0f, 1.0f); - mParams = new ParaMultiParameters(5, intParams, 5, floatParams); + mParams = new ParaMultiParameters(INT_ParamCount, intParams, 5, floatParams); reset(); /* .loc_0x0: @@ -265,8 +262,69 @@ void TekiPersonality::input(TekiPersonality&) * Address: 8014CE24 * Size: 0002F0 */ -void TekiPersonality::read(RandomAccessStream&, int) +void TekiPersonality::read(RandomAccessStream& input, int version) { + if (false) { + PRINT("TekiPersonality::read:%d\n", version); + } + + ParaMultiParameters* params = mParams; + + if (version <= 7) { + ERROR("TekiPersonality::read:too old version:%d\n", version); + _20 = input.readInt(); + _24 = input.readInt(); + mID.setID('none'); + params->read(input); + return; + } + + if (version <= 8) { + _20 = input.readInt(); + _24 = input.readInt(); + mID.read(input); + + for (int i = 0; i <= 2; i++) { + params->mIntParams->mParameters[i] = input.readInt(); + } + + params->setI(4, params->getI(2)); + params->setI(2, 0); + params->setI(3, 0); + + for (int i = 0; i <= 3; i++) { + params->mFloatParams->mParameters[i] = input.readFloat(); + } + + params->setF(4, 0.0f); + return; + } + + if (version <= 9) { + _20 = input.readByte(); + _24 = input.readByte(); + mID.read(input); + + for (int i = 0; i <= 2; i++) { + params->mIntParams->mParameters[i] = input.readInt(); + } + + params->setI(4, params->getI(2)); + params->setI(2, 0); + params->setI(3, 0); + + for (int i = 0; i <= 3; i++) { + params->mFloatParams->mParameters[i] = input.readFloat(); + } + + params->setF(4, 0.0f); + return; + } + + _20 = input.readByte(); + _24 = input.readByte(); + mID.read(input); + params->read(input); /* .loc_0x0: mflr r0