diff --git a/spm-headers/.github/workflows/build.yml b/spm-headers/.github/workflows/build.yml index c7aeecc..8d6c16c 100644 --- a/spm-headers/.github/workflows/build.yml +++ b/spm-headers/.github/workflows/build.yml @@ -12,7 +12,7 @@ jobs: fail-fast: false matrix: region: [eu0, eu1, us0, us1, us2, jp0, jp1, kr0] - test: [mod_ctx, old_mod_ctx, decomp_ctx, mod_ctx_shuffle, test_mod_individual] + test: [mod_ctx, decomp_ctx, mod_ctx_shuffle, test_mod_individual] steps: - name: Checkout uses: actions/checkout@v3 diff --git a/spm-headers/.gitignore b/spm-headers/.gitignore index f862010..699f321 100644 --- a/spm-headers/.gitignore +++ b/spm-headers/.gitignore @@ -1,2 +1,6 @@ build build.ninja +*.bat +.vscode +.cache +compile_commands.json diff --git a/spm-headers/.gitrepo b/spm-headers/.gitrepo index 17688d6..9fac787 100644 --- a/spm-headers/.gitrepo +++ b/spm-headers/.gitrepo @@ -5,8 +5,8 @@ ; [subrepo] remote = https://github.com/SeekyCt/spm-headers.git - branch = decomp - commit = 4095228f03909bff88f65c58d092406050ec5ed6 - parent = a5c9015f88d01bf95c26b4bbd9a755e5dd698e2f + branch = master + commit = fd4c37f1f6d9d3c4d06c031738ead2e8d7106704 + parent = d443cf036b530e77ae8c249647c227a0656970f8 method = merge cmdver = 0.4.9 diff --git a/spm-headers/CONTRIBUTING.md b/spm-headers/CONTRIBUTING.md index f3e8fee..ac1b788 100644 --- a/spm-headers/CONTRIBUTING.md +++ b/spm-headers/CONTRIBUTING.md @@ -1,3 +1,14 @@ +## C++ notes +- Most headers are designed to be compileable in C and C++ +- The CPP_WRAPPER macro allows for the file's namespace to be dropped when compiling in C and for `extern "C"` to +be inserted when compiling in C++ +- The headers in the spm folder where the game used C++ features should still have C support + - These are rare, so it's less effort than supporting C++ in nw4r would be, and more useful + - Use `#ifdef __cplusplus` and padding where neccessary to achieve this +- The headers in the nw4r folder don't have C support since they were written in C++ originally + - They therefore don't use the CPP_WRAPPER macro + - They're named .hpp instead of .h to indicate this + ## Naming - Use official names when possible (from TTYD symbol map, asserts, etc.), and try to follow the style otherwise @@ -30,7 +41,7 @@ - Wrap files in CPP_WRAPPER from where includes finish to the end of the file - The name passed in should be `folder::filename` (for example, `spm::evtmgr`) - `common.h` and the variants of `evt_cmd.h` are exceptions to this - - This won't apply to nw4r headers' code they're done properly + - This doesn't apply to nw4r headers' as they're done with real C++ - Wrap file-local and function-local symbols in DECOMP_STATIC in headers (for example, `DECOMP_STATIC(evtmgr_work)`) - Add offset comments on the left of every struct member - Add value comments on the left of every enum member diff --git a/spm-headers/README.md b/spm-headers/README.md index 812a2c9..c1bb8e2 100644 --- a/spm-headers/README.md +++ b/spm-headers/README.md @@ -23,15 +23,13 @@ For use in decomp, the `include`, `include_cpp` and `decomp` folders should be a ## Mods -For use in mods, the `include`, `include_cpp` and `mod` folder should be added to the include path and an lst from `linker` should be used. If including your compiler's C++ standard library, the preprocessor define `USE_STL` should be used. +For use in mods, the `include` and `mod` folders should be added to the include path and an lst from `linker` should be used. Mods should include their compiler's standard library headers (do not use `-nostdinc`), though linking it is not required (so `-nostdlib` is fine). -## C - -For the cases where C is required (such as m2c or maybe some niche modding cases), omitting the `include_cpp` folder should be all that's neccessary. +**Warning**: NW4R headers are probably unsafe to use with GCC currently # Licensing -All code originally written for this project (everything under the `include`, `include_cpp`, `decomp` and `linker` directories) is available under the MIT license. +All code originally written for this project (everything under the `include`, `decomp` and `linker` directories) is available under the MIT license. Everything under the `mod` folder is available under the GPLv3 license as it's derived from other GPL code. diff --git a/spm-headers/configure.py b/spm-headers/configure.py index b18969f..ab40eab 100644 --- a/spm-headers/configure.py +++ b/spm-headers/configure.py @@ -9,7 +9,7 @@ parser = ArgumentParser() parser.add_argument("tests", type=str, nargs="*", help="Tests to run" \ - "(mod_ctx, old_mod_ctx, decomp_ctx, mod_ctx_shuffle, test_mod_individual)") + "(mod_ctx, decomp_ctx, mod_ctx_shuffle, test_mod_individual)") parser.add_argument("--regions", type=str, nargs="+", help="Regions to test") parser.add_argument("--seed", type=int, default=1, help="Shuffling seed") parser.add_argument("--shuffle", type=int, default=50, help="Number of randomised orders to test") @@ -231,14 +231,9 @@ def find_headers(dirname: str, base=None) -> List[str]: return ret -# Test the headers in the spm-utils modding setup +# Test the headers in the modding setup def test_mod_ctx(regions: List[str]): compile_regions(os.path.join("$builddir", "{region}", "mod.o"), "$mod_source", regions, - MOD_INCLUDES, ["USE_STL"]) - -# Test the headers in the old modding setup -def test_old_mod_ctx(regions: List[str]): - compile_regions(os.path.join("$builddir", "{region}", "old_mod.o"), "$mod_source", regions, MOD_INCLUDES, []) # Test the headers in the decomp setup @@ -254,7 +249,7 @@ def test_mod_ctx_shuffle(regions: List[str]): source = os.path.join("$builddir", f"shuffle_{args.seed}", f"{i}.cpp") incgen(source, MOD_INCLUDES, i) compile_regions(os.path.join("$builddir", "{region}", f"shuffle_mod_{args.seed}_{i}.o"), - source, regions, MOD_INCLUDES, ["USE_STL"]) + source, regions, MOD_INCLUDES, []) # Test individual headers def test_mod_individual(regions: List[str]): @@ -263,18 +258,17 @@ def test_mod_individual(regions: List[str]): source = os.path.join("$builddir", "individual", f"{name}.c") incgen_single(source, header) compile_regions(os.path.join("$builddir", "{region}", "individual", f"{name}.o"), source, - regions, MOD_INCLUDES, ["USE_STL", "SPM_EU0"]) + regions, MOD_INCLUDES, ["SPM_EU0"]) test_fns = { "mod_ctx" : test_mod_ctx, - "old_mod_ctx" : test_old_mod_ctx, "decomp_ctx" : test_decomp_ctx, "mod_ctx_shuffle" : test_mod_ctx_shuffle, "test_mod_individual" : test_mod_individual, } incgen("$mod_source", MOD_INCLUDES) -default_tests = ["mod_ctx", "old_mod_ctx"] +default_tests = ["mod_ctx"] if args.codewarrior: incgen("$decomp_source", DECOMP_INCLUDES) diff --git a/spm-headers/decomp/stdbool.h b/spm-headers/decomp/stdbool.h new file mode 100644 index 0000000..4539db3 --- /dev/null +++ b/spm-headers/decomp/stdbool.h @@ -0,0 +1,12 @@ +#pragma once + +#include + +#ifndef __cplusplus + +#define bool _Bool +#define true 1 +#define false 0 + +#endif + diff --git a/spm-headers/decomp/stddef.h b/spm-headers/decomp/stddef.h new file mode 100644 index 0000000..e8e6152 --- /dev/null +++ b/spm-headers/decomp/stddef.h @@ -0,0 +1,14 @@ +#pragma once + +#include + +#define NULL 0 + +typedef s32 ptrdiff_t; +typedef __typeof__(sizeof(0)) size_t; + +#define offsetof(type, member) ((size_t)&((type *)0)->member) + +#ifndef __cplusplus + typedef u16 wchar_t; +#endif diff --git a/spm-headers/include/common.h b/spm-headers/include/common.h index 5d15183..f2ff8a1 100644 --- a/spm-headers/include/common.h +++ b/spm-headers/include/common.h @@ -20,71 +20,11 @@ #define HAS_ATTRIBUTE(x) 0 #endif -// Basic types - -// Decomp needs long for matching, int is slightly more convenient for casting in mods -#ifdef DECOMP - #define INT_TYPE long -#else - #define INT_TYPE int -#endif - -typedef unsigned long long u64; -typedef unsigned INT_TYPE u32; -typedef unsigned short u16; -typedef unsigned char u8; - -typedef signed long long s64; -typedef signed INT_TYPE s32; -typedef signed short s16; -typedef signed char s8; - -#undef INT_TYPE - -typedef float f32; -typedef double f64; - -#ifdef USE_STL - #include - static_assert(sizeof(size_t) == 4, "Expected 32-bit size_t"); -#else - typedef u32 size_t; - #define NULL 0 - #if HAS_BUILTIN(__builtin_offsetof) - #define offsetof __builtin_offsetof - #else - #define offsetof(type, member) ((u32)&((type *)0)->member) - #endif -#endif - -typedef s32 BOOL; - -#ifndef __cplusplus - #define bool char - - #define true 1 - #define false 0 -#endif - -#ifndef __cplusplus - #define wchar_t s16 -#endif - -#ifdef DECOMP - typedef wchar_t wchar16_t; -#else - typedef s16 wchar16_t; -#endif - -// Unknown type -typedef u32 Unk; -typedef u32 Unk32; -typedef u16 Unk16; -typedef u8 unk8; - -// Use CW special static assert +// Use required static_assert keyword #ifdef __MWERKS__ - #define static_assert(cond, msg) __static_assert(cond, msg) + #define static_assert __static_assert +#elif !(defined __cplusplus) + #define static_assert _Static_assert #endif // Macro for quick size static assert @@ -152,7 +92,7 @@ typedef u8 unk8; #define ATTRIBUTE(x) #endif -#if HAS_ATTRIBUTE(noreturn) +#if HAS_ATTRIBUTE(noreturn) && (defined __cplusplus) // TODO: the usage sites are probabably what should be fixed here #define NORETURN ATTRIBUTE(noreturn) #else #define NORETURN @@ -166,6 +106,49 @@ typedef u8 unk8; #define ATTRIBUTE_FORMAT(...) #endif -#define SQUARE(x) ((x) * (x)) -#define CUBE(x) ((x) * (x) * (x)) -#define QUART(x) ((x) * (x) * (x) * (x)) +// Basic types + +// Decomp needs long for matching, int is slightly more convenient for casting in mods +#ifdef DECOMP + #define INT_TYPE long +#else + #define INT_TYPE int +#endif + +typedef unsigned long long u64; +typedef unsigned INT_TYPE u32; +typedef unsigned short u16; +typedef unsigned char u8; + +typedef signed long long s64; +typedef signed INT_TYPE s32; +typedef signed short s16; +typedef signed char s8; + +#undef INT_TYPE + +typedef float f32; +typedef double f64; + +typedef int BOOL; + +#ifdef M2C + #define wchar_t u16 + #define bool char +#endif + +#include +#include + +// wchar_t is 32-bit in GCC but 16-bit in CW +#ifdef DECOMP + typedef wchar_t wchar16_t; +#else + typedef u16 wchar16_t; +#endif + +// Unknown type +typedef u32 Unk; +typedef u32 Unk32; +typedef u16 Unk16; +typedef u8 unk8; diff --git a/spm-headers/include/msl/errno.h b/spm-headers/include/msl/errno.h new file mode 100644 index 0000000..e73f409 --- /dev/null +++ b/spm-headers/include/msl/errno.h @@ -0,0 +1,9 @@ +#pragma once + +#include + +CPP_WRAPPER(msl::errno) + +s32 errno; + +CPP_WRAPPER_END() diff --git a/spm-headers/include_cpp/msl/exception.h b/spm-headers/include/msl/exception similarity index 100% rename from spm-headers/include_cpp/msl/exception.h rename to spm-headers/include/msl/exception diff --git a/spm-headers/include/msl/math.h b/spm-headers/include/msl/math.h index 59aff47..6bb062c 100644 --- a/spm-headers/include/msl/math.h +++ b/spm-headers/include/msl/math.h @@ -4,6 +4,9 @@ CPP_WRAPPER(msl::math) +typedef float float_t; +typedef double double_t; + #define PI 3.141592653589793f #define PIx2 (PI * 2.0f) @@ -23,4 +26,7 @@ double sqrt(double x); #define fabsf(x) __fabsf(x) #define abs(x) __abs(x) +double ceil(double x); +#define ceilf(x) ((f32)ceil(x)) + CPP_WRAPPER_END() diff --git a/spm-headers/include_cpp/msl/new.h b/spm-headers/include/msl/new similarity index 94% rename from spm-headers/include_cpp/msl/new.h rename to spm-headers/include/msl/new index 5e559be..2d150ed 100644 --- a/spm-headers/include_cpp/msl/new.h +++ b/spm-headers/include/msl/new @@ -7,7 +7,7 @@ // TODO: does this actually need to be hidden for modding? #ifdef DECOMP -#include +#include namespace std { diff --git a/spm-headers/include_cpp/nw4r/db/panic.h b/spm-headers/include/nw4r/db/panic.hpp similarity index 100% rename from spm-headers/include_cpp/nw4r/db/panic.h rename to spm-headers/include/nw4r/db/panic.hpp diff --git a/spm-headers/include_cpp/nw4r/lyt/animation.h b/spm-headers/include/nw4r/lyt/animation.hpp similarity index 100% rename from spm-headers/include_cpp/nw4r/lyt/animation.h rename to spm-headers/include/nw4r/lyt/animation.hpp diff --git a/spm-headers/include_cpp/nw4r/lyt/arcResourceAccessor.h b/spm-headers/include/nw4r/lyt/arcResourceAccessor.hpp similarity index 91% rename from spm-headers/include_cpp/nw4r/lyt/arcResourceAccessor.h rename to spm-headers/include/nw4r/lyt/arcResourceAccessor.hpp index d40c2bb..37c4f3b 100644 --- a/spm-headers/include_cpp/nw4r/lyt/arcResourceAccessor.h +++ b/spm-headers/include/nw4r/lyt/arcResourceAccessor.hpp @@ -1,8 +1,8 @@ #pragma once #include -#include -#include +#include +#include namespace nw4r { namespace lyt { diff --git a/spm-headers/include_cpp/nw4r/lyt/drawInfo.h b/spm-headers/include/nw4r/lyt/drawInfo.hpp similarity index 87% rename from spm-headers/include_cpp/nw4r/lyt/drawInfo.h rename to spm-headers/include/nw4r/lyt/drawInfo.hpp index d0ea65f..a35bcb9 100644 --- a/spm-headers/include_cpp/nw4r/lyt/drawInfo.h +++ b/spm-headers/include/nw4r/lyt/drawInfo.hpp @@ -1,8 +1,8 @@ #pragma once #include -#include -#include +#include +#include namespace nw4r { namespace lyt { diff --git a/spm-headers/include_cpp/nw4r/lyt/layout.h b/spm-headers/include/nw4r/lyt/layout.hpp similarity index 86% rename from spm-headers/include_cpp/nw4r/lyt/layout.h rename to spm-headers/include/nw4r/lyt/layout.hpp index f13ee3b..fd461d9 100644 --- a/spm-headers/include_cpp/nw4r/lyt/layout.h +++ b/spm-headers/include/nw4r/lyt/layout.hpp @@ -2,11 +2,12 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include namespace nw4r { namespace lyt { diff --git a/spm-headers/include_cpp/nw4r/lyt/material.h b/spm-headers/include/nw4r/lyt/material.hpp similarity index 91% rename from spm-headers/include_cpp/nw4r/lyt/material.h rename to spm-headers/include/nw4r/lyt/material.hpp index 47edaee..1b5ffd5 100644 --- a/spm-headers/include_cpp/nw4r/lyt/material.h +++ b/spm-headers/include/nw4r/lyt/material.hpp @@ -2,7 +2,7 @@ #include #include -#include +#include namespace nw4r { namespace lyt { diff --git a/spm-headers/include_cpp/nw4r/lyt/pane.h b/spm-headers/include/nw4r/lyt/pane.hpp similarity index 91% rename from spm-headers/include_cpp/nw4r/lyt/pane.h rename to spm-headers/include/nw4r/lyt/pane.hpp index e628c28..42489b0 100644 --- a/spm-headers/include_cpp/nw4r/lyt/pane.h +++ b/spm-headers/include/nw4r/lyt/pane.hpp @@ -1,10 +1,10 @@ #pragma once #include -#include -#include -#include -#include +#include +#include +#include +#include namespace nw4r { namespace lyt { diff --git a/spm-headers/include_cpp/nw4r/lyt/resourceAccessor.h b/spm-headers/include/nw4r/lyt/resourceAccessor.hpp similarity index 100% rename from spm-headers/include_cpp/nw4r/lyt/resourceAccessor.h rename to spm-headers/include/nw4r/lyt/resourceAccessor.hpp diff --git a/spm-headers/include_cpp/nw4r/math/types.h b/spm-headers/include/nw4r/math/types.hpp similarity index 100% rename from spm-headers/include_cpp/nw4r/math/types.h rename to spm-headers/include/nw4r/math/types.hpp diff --git a/spm-headers/include_cpp/nw4r/snd.h b/spm-headers/include/nw4r/snd.hpp similarity index 100% rename from spm-headers/include_cpp/nw4r/snd.h rename to spm-headers/include/nw4r/snd.hpp diff --git a/spm-headers/include_cpp/nw4r/ut/linkList.h b/spm-headers/include/nw4r/ut/linkList.hpp similarity index 99% rename from spm-headers/include_cpp/nw4r/ut/linkList.h rename to spm-headers/include/nw4r/ut/linkList.hpp index cb446b8..1d0fdc1 100644 --- a/spm-headers/include_cpp/nw4r/ut/linkList.h +++ b/spm-headers/include/nw4r/ut/linkList.hpp @@ -5,7 +5,7 @@ #pragma once #include -#include +#include namespace nw4r { namespace ut { diff --git a/spm-headers/include_cpp/nw4r/ut/nonCopyable.h b/spm-headers/include/nw4r/ut/nonCopyable.hpp similarity index 100% rename from spm-headers/include_cpp/nw4r/ut/nonCopyable.h rename to spm-headers/include/nw4r/ut/nonCopyable.hpp diff --git a/spm-headers/include_cpp/nw4r/ut/rect.h b/spm-headers/include/nw4r/ut/rect.hpp similarity index 100% rename from spm-headers/include_cpp/nw4r/ut/rect.h rename to spm-headers/include/nw4r/ut/rect.hpp diff --git a/spm-headers/include/spm/evt_shop.h b/spm-headers/include/spm/evt_shop.h index 689bf2c..d5c9ceb 100644 --- a/spm-headers/include/spm/evt_shop.h +++ b/spm-headers/include/spm/evt_shop.h @@ -69,6 +69,8 @@ EVT_UNKNOWN_USER_FUNC(evt_shop_remove_item) EVT_UNKNOWN_USER_FUNC(evt_shop_handle_roten_item_flag) EVT_UNKNOWN_USER_FUNC(evt_shop_get_otoya_bgm) +EVT_DECLARE(saffronCookingScript) + // evt_shop_set_defs(EvtShopDef * defs, s32 count) EVT_DECLARE_USER_FUNC(evt_shop_set_defs, 2) diff --git a/spm-headers/include/spm/mario.h b/spm-headers/include/spm/mario.h index 02734e4..5c421af 100644 --- a/spm-headers/include/spm/mario.h +++ b/spm-headers/include/spm/mario.h @@ -85,8 +85,8 @@ typedef bool (MarioStatusMainFunc)(struct _MarioStatus * status, Vec3 * iconPos, /* Returns true if it should be deleted, false otherwise Return is ignored except in marioStatusDeleteAll -*/ -typedef bool (MarioStatusDeleteFunc)(struct _MarioStatus * status, s32 level); +*/ +typedef bool (MarioStatusDeleteFunc)(struct _MarioStatus * status, s32 level); /* Called on map change @@ -490,8 +490,6 @@ typedef struct } MarioMotFuncs; SIZE_ASSERT(MarioMotFuncs, 0x8) -extern MarioMotFuncs marioMotTbl[78]; // index motion id - DECOMP_STATIC(s64 mario_mainLastRunTime) // used to adjust marioGameSpeedScale for lag /* @@ -623,7 +621,7 @@ bool marioChkSts(u32 mask); /* Removes references to a HitObj from hitObjs1 & hitObjs2 */ -void marioResetHitObj(const char * name); +void marioResetHitObj(const char * name); /* Resets marioWork for a new save file @@ -854,7 +852,7 @@ UNKNOWN_FUNCTION(func_8012bb80); /* Changes the active pane boundaries and updates which pane the player is in */ -void marioSetPaneBoundaries(MarioPaneBoundary * boundaries); +void marioSetPaneBoundaries(MarioPaneBoundary * boundaries); /* Calculates the pane of a vector position @@ -926,4 +924,3 @@ UNKNOWN_FUNCTION(func_8012d9fc); bool func_8012dab0(); CPP_WRAPPER_END() - diff --git a/spm-headers/include/spm/mario_motion.h b/spm-headers/include/spm/mario_motion.h index f753f02..be03f79 100644 --- a/spm-headers/include/spm/mario_motion.h +++ b/spm-headers/include/spm/mario_motion.h @@ -1,9 +1,12 @@ #pragma once #include +#include CPP_WRAPPER(spm::mario_motion) +USING(spm::mario::MarioMotFuncs) + UNKNOWN_FUNCTION(marioMotion); void marioChgMot(s32 nextMotionId); UNKNOWN_FUNCTION(marioChgMotSub); @@ -92,4 +95,6 @@ UNKNOWN_FUNCTION(func_8014be7c); UNKNOWN_FUNCTION(mot_34); UNKNOWN_FUNCTION(mot_34_post); +extern MarioMotFuncs marioMotTbl[78]; // index motion id + CPP_WRAPPER_END() diff --git a/spm-headers/include/spm/mario_status.h b/spm-headers/include/spm/mario_status.h new file mode 100644 index 0000000..1ea434f --- /dev/null +++ b/spm-headers/include/spm/mario_status.h @@ -0,0 +1,30 @@ +#pragma once + +#include + +CPP_WRAPPER(spm::mario_status) + + +#define STATUS_POISION 0x1 +#define STATUS_SLOW 0x2 +#define STATUS_NO_SKILLS 0x4 +#define STATUS_NO_JUMP 0x8 +#define STATUS_FLIPPED_CONTROLS 0x10 +#define STATUS_HALF_DAMAGE 0x20 +#define STATUS_DOUBLE_ATTACK 0x40 +#define STATUS_ELECTRIFIED 0x80 +#define STATUS_HP_REGEN 0x100 +#define STATUS_BARRIER 0x200 +#define STATUS_FAST_FLOWER 0x400 +#define STATUS_SLOW_FLOWER 0x800 +#define STATUS_COIN_FLOWER 0x1000 +#define STATUS_PAL_PILLS 0x4000 +#define STATUS_GHOST_SHROOM 0x8000 +#define STATUS_DANGEROUS_DELIGHT 0x10000 + + +void marioStatusApplyStatuses(s32 status, s32 lv); + +// more + +CPP_WRAPPER_END() diff --git a/spm-headers/include/spm/memory.h b/spm-headers/include/spm/memory.h index 2049465..785c7d2 100644 --- a/spm-headers/include/spm/memory.h +++ b/spm-headers/include/spm/memory.h @@ -24,8 +24,16 @@ USING(wii::gx::GXTexObj) USING(wii::mem::MEMHeapHandle) #define MEM1_HEAP_COUNT 3 + +// Korean adds a 10th heap +#ifdef SPM_KR0 +#define MEM2_HEAP_COUNT 7 +#define HEAP_COUNT 10 +#else #define MEM2_HEAP_COUNT 6 #define HEAP_COUNT 9 +#endif + #define SMART_HEAP_ID 7 #define SMART_ALLOCATION_MAX 2048 @@ -39,7 +47,10 @@ enum Heap /* 0x5 */ HEAP_WPAD, /* 0x6 */ HEAP_SOUND, /* 0x7 */ HEAP_SMART, -/* 0x8 */ HEAP_MEM2_UNUSED +#ifdef SPM_KR0 +/* 0x8 */ HEAP_FONT, +#endif +/* 0x8 / 0x9 */ HEAP_MEM2_UNUSED }; enum HeapSizeType @@ -55,7 +66,7 @@ typedef struct } HeapSize; SIZE_ASSERT(HeapSize, 0x8) -DECOMP_STATIC(HeapSize memory_size_table[9]) +DECOMP_STATIC(HeapSize memory_size_table[HEAP_COUNT]) typedef struct { @@ -63,7 +74,11 @@ typedef struct /* 0x24 */ void * heapStart[HEAP_COUNT]; // pointer to the start of the heap /* 0x48 */ void * heapEnd[HEAP_COUNT]; // pointer to the end of the heap } MemWork; +#ifdef SPM_KR0 +SIZE_ASSERT(MemWork, 0x78) +#else SIZE_ASSERT(MemWork, 0x6c) +#endif DECOMP_STATIC(MemWork memory_work) DECOMP_STATIC(MemWork * memory_wp) diff --git a/spm-headers/include/spm/npcdrv.h b/spm-headers/include/spm/npcdrv.h index 8442e72..c4a51a7 100644 --- a/spm-headers/include/spm/npcdrv.h +++ b/spm-headers/include/spm/npcdrv.h @@ -38,13 +38,18 @@ SIZE_ASSERT(NPCTribeAnimDef, 0x8) typedef struct { /* 0x00 */ u16 id; -/* 0x02 */ u8 unknown_0x2[0x28 - 0x2]; +/* 0x02 */ s16 mode; +/* 0x04 */ s32 minimum_damage; +/* 0x08 */ Vec3 position; +/* 0x14 */ u32 flag14; // assigned to flag2c in NPCPart +/* 0x18 */ u32 flag18; // assigned to flag30 in NPCPart +/* 0x1c */ u8 unknown_0x1c[0x28 - 0x1c]; /* 0x28 */ NPCDefense * defenses; /* 0x2C */ Unk * unknown_0x2c; /* 0x30 */ NPCPartUpdateFunc * updateFunc; -/* 0x34 */ Unk * unknown_0x34; +/* 0x34 */ const char * animPoseName; /* 0x38 */ NPCTribeAnimDef * animDefs; -/* 0x3C */ u8 unknown_0x3c[0x48 - 0x3c]; +/* 0x3C */ Vec3 positionDelta; } NPCPartDef; SIZE_ASSERT(NPCPartDef, 0x48) @@ -94,7 +99,11 @@ OFFSET_ASSERT(NPCAnim, tribeAnims, 0x48) typedef struct _NPCPart { /* 0x000 */ u16 id; -/* 0x002 */ u8 unknown_0x2[0x2c - 0x2]; +/* 0x002 */ s16 mode; +/* 0x004 */ s32 minimum_damage; +/* 0x008 */ Vec3 position; +/* 0x014 */ Vec3 ownerPosLastAnimChange; +/* 0x020 */ Vec3 positionDelta; /* 0x02C */ u32 flag2c; /* 0x030 */ u32 flag30; /* 0x034 */ u8 unknown_0x34[0x378 - 0x34]; diff --git a/spm-headers/include/spm/rel/machi.h b/spm-headers/include/spm/rel/machi.h index abdf9d4..15d8cd7 100644 --- a/spm-headers/include/spm/rel/machi.h +++ b/spm-headers/include/spm/rel/machi.h @@ -2,7 +2,6 @@ #include #include - CPP_WRAPPER(spm::machi) typedef struct diff --git a/spm-headers/include/spm/seq_load_sub.h b/spm-headers/include/spm/seq_load_sub.h new file mode 100644 index 0000000..8d90ce0 --- /dev/null +++ b/spm-headers/include/spm/seq_load_sub.h @@ -0,0 +1,36 @@ +#pragma once + +#include +#include +#include +#include + +#include + +CPP_WRAPPER(spm::seq_load_sub) + +USING(spm::seqdrv::SeqWork) +USING(spm::evtmgr::EvtEntry) +USING(spm::filemgr::FileEntry) +USING(wii::gx::GXColor) + +typedef struct { + u32 flags; + u32 state; + FileEntry* fileselTpl; + s32 selectedSave; + u8 _10[0x2c-0x10]; + EvtEntry* saveUpdateEvt; + s32 saveUpdateEvtId; + u8 _34[0x48-0x34]; + GXColor bgGradientTop; + GXColor bgGradientBottom; + u8 _50[0x5c-0x50]; +} SeqLoadSubWork; +SIZE_ASSERT(SeqLoadSubWork, 0x5c) + +DECOMP_STATIC(SeqLoadSubWork* seq_load_sub_wp) + +s32 loadMain(); + +CPP_WRAPPER_END() diff --git a/spm-headers/include/spm/seq_title.h b/spm-headers/include/spm/seq_title.h index 8b118e0..7ba13ad 100644 --- a/spm-headers/include/spm/seq_title.h +++ b/spm-headers/include/spm/seq_title.h @@ -5,10 +5,10 @@ #include #ifdef __cplusplus -#include -#include -#include -#include +#include +#include +#include +#include #endif CPP_WRAPPER(spm::seq_title) diff --git a/spm-headers/include/wii/ipc.h b/spm-headers/include/wii/ipc.h index 4462d5f..1b7b2fc 100644 --- a/spm-headers/include/wii/ipc.h +++ b/spm-headers/include/wii/ipc.h @@ -52,7 +52,7 @@ s32 IOS_Close(s32 fd); UNKNOWN_FUNCTION(IOS_ReadAsync); s32 IOS_Read(s32 fd, void * dest, u32 length); UNKNOWN_FUNCTION(IOS_WriteAsync); -UNKNOWN_FUNCTION(IOS_Write); +s32 IOS_Write(s32 fd, const void * data, u32 length); UNKNOWN_FUNCTION(IOS_SeekAsync); UNKNOWN_FUNCTION(IOS_IoctlAsync); s32 IOS_Ioctl(s32 fd, s32 command, void * buf, u32 bufSize, void * ioBuf, u32 ioBufSize); diff --git a/spm-headers/include/wii/os/OSModule.h b/spm-headers/include/wii/os/OSModule.h index 2e89b30..a3cb898 100644 --- a/spm-headers/include/wii/os/OSModule.h +++ b/spm-headers/include/wii/os/OSModule.h @@ -6,6 +6,16 @@ CPP_WRAPPER(wii::os) typedef void (RelExportFunc)(); +typedef struct +{ + union + { + u32 offset; + void * address; + }; + u32 size; +} RelSection; + // Unions are offsets in file then pointers after OSLink typedef struct _RelHeader { @@ -16,7 +26,7 @@ typedef struct _RelHeader union { u32 sectionInfoOffset; - void * sectionInfo; + RelSection * sectionInfo; }; union { diff --git a/spm-headers/include/wii/os/OSMutex.h b/spm-headers/include/wii/os/OSMutex.h index f28a2a4..da99b1b 100644 --- a/spm-headers/include/wii/os/OSMutex.h +++ b/spm-headers/include/wii/os/OSMutex.h @@ -1,18 +1,24 @@ #pragma once #include +#include CPP_WRAPPER(wii::os) -typedef struct +USING(wii::os::OSThread) + +typedef struct _OSMutex { - u8 unknown_0x0[0x18 - 0x0]; + u8 unknown_0x0[0x8 - 0x0]; + OSThread * thread; + s32 count; + u8 unknown_0x10[0x10 - 0x8]; } OSMutex; SIZE_ASSERT(OSMutex, 0x18) void OSInitMutex(OSMutex * mutex); -UNKNOWN_FUNCTION(OSLockMutex); -UNKNOWN_FUNCTION(OSUnlockMutex); +void OSLockMutex(OSMutex * mutex); +void OSUnlockMutex(OSMutex * mutex); UNKNOWN_FUNCTION(__OSUnlockAllMutex); CPP_WRAPPER_END() diff --git a/spm-headers/include/wii/os/OSThread.h b/spm-headers/include/wii/os/OSThread.h index 650259f..64b97e7 100644 --- a/spm-headers/include/wii/os/OSThread.h +++ b/spm-headers/include/wii/os/OSThread.h @@ -7,25 +7,57 @@ CPP_WRAPPER(wii::os) USING(wii::os::OSContext) -typedef struct _OSThread +struct _OSMutex; +struct _OSThread; + +typedef struct { - OSContext context; - u8 unknown_0x2c8[0x2fc - 0x2c8]; - struct _OSThread * next; - struct _OSThread * prev; - u8 unknown_0x304[0x318 - 0x304]; -} OSThread; -SIZE_ASSERT(OSThread, 0x318) +/* 0x0 */ struct _OSThread * next; +/* 0x4 */ struct _OSThread * prev; +} OSThreadLink; +SIZE_ASSERT(OSThreadLink, 0x8) typedef struct { -/* 0x0 */ u8 unknown_0x0[0x8 - 0x0]; +/* 0x0 */ struct _OSThread * head; +/* 0x4 */ struct _OSThread * tail; } OSThreadQueue; SIZE_ASSERT(OSThreadQueue, 0x8) -FIXED_ADDR(OSThread *, currentThread, 0x800000e4); +typedef struct _OSThread +{ +/* 0x000 */ OSContext context; +/* 0x2C8 */ u16 state; +/* 0x2CA */ u16 attr; +/* 0x2CC */ s32 suspend; +/* 0x2D0 */ s32 priority; +/* 0x2D4 */ s32 base; +/* 0x2D8 */ void * val; +/* 0x2DC */ OSThreadQueue * queue; +/* 0x2E0 */ OSThreadLink link; +/* 0x2E8 */ OSThreadQueue queueJoin; +/* 0x2F0 */ struct _OSMutex * mutex; +/* 0x2F4 */ u8 unknown_0x2f4[0x2fc - 0x2f4]; +/* 0x2FC */ OSThreadLink linkActive; +/* 0x304 */ u8 * stackBase; +/* 0x308 */ u32 * stackEnd; +/* 0x30C */ s32 error; +/* 0x310 */ void * specific[2]; +} OSThread; +SIZE_ASSERT(OSThread, 0x318) + +FIXED_ADDR(OSThread *, OS_CURRENT_THREAD, 0x800000e4); +FIXED_ADDR(OSThreadQueue, OS_THREAD_QUEUE, 0x800000dc); + +typedef void * (ThreadFunc)(void *); + +#define OS_THREAD_DETACHED 1 -typedef void (*ThreadFunc)(); +#define OS_THREAD_STATE_EXITED 0 +#define OS_THREAD_STATE_READY 1 +#define OS_THREAD_STATE_RUNNING 2 +#define OS_THREAD_STATE_SLEEPING 4 +#define OS_THREAD_STATE_MORIBUND 8 UNKNOWN_FUNCTION(DefaultSwitchThreadCallback); UNKNOWN_FUNCTION(__OSThreadInit); @@ -40,11 +72,11 @@ UNKNOWN_FUNCTION(__OSPromoteThread); UNKNOWN_FUNCTION(SelectThread); UNKNOWN_FUNCTION(__OSReschedule); void OSYieldThread(); -s32 OSCreateThread(OSThread * thread, ThreadFunc * func, void * funcParam, void * stackTop, - u32 stackSize, s32 priority, u16 param_7); -UNKNOWN_FUNCTION(OSExitThread); +BOOL OSCreateThread(OSThread * thread, ThreadFunc * func, void * funcParam, void * stackTop, + u32 stackSize, s32 priority, u16 attr); +void OSExitThread(void * val); void OSCancelThread(OSThread * thread); -UNKNOWN_FUNCTION(OSJoinThread); +BOOL OSJoinThread(OSThread * thread, void ** outVal); s32 OSResumeThread(OSThread * thread); s32 OSSuspendThread(OSThread * thread); void OSSleepThread(OSThreadQueue * thread); diff --git a/spm-headers/include_cpp/nw4r/ut/color.h b/spm-headers/include_cpp/nw4r/ut/color.h deleted file mode 100644 index 157cda9..0000000 --- a/spm-headers/include_cpp/nw4r/ut/color.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - Based on the decompilation in ogws by kiwi515 -*/ - -#pragma once - -#include -#include - -namespace nw4r { -namespace ut { - -USING(wii::gx::GXColor) - -class Color : public GXColor { -public: - Color() { *this = 0xFFFFFFFF; } - Color(u32 color) { *this = color; } - Color(int red, int green, int blue, int alpha) { - Set(red, green, blue, alpha); - } - ~Color() {} - - void Set(int red, int green, int blue, int alpha) { - r = red; - g = green; - b = blue; - a = alpha; - } - - Color& operator=(u32 color) { - ToU32ref() = color; - return *this; - } - - Color operator|(u32 color) { return Color(ToU32() | color); } - Color operator&(u32 color) { return Color(ToU32() & color); } - - u32& ToU32ref() { return *reinterpret_cast(this); } - const u32& ToU32ref() const { return *reinterpret_cast(this); } - - u32 ToU32() const { return ToU32ref(); } - - operator u32() const { return ToU32ref(); } -}; - -} // namespace ut -} // namespace nw4r diff --git a/spm-headers/linker/spm.eu0.lst b/spm-headers/linker/spm.eu0.lst index 47e6d90..d013e05 100644 --- a/spm-headers/linker/spm.eu0.lst +++ b/spm-headers/linker/spm.eu0.lst @@ -1,6 +1,7 @@ /* OS Globals */ -800000e4:currentThread +800000dc:OS_THREAD_QUEUE +800000e4:OS_CURRENT_THREAD 800030c8:firstRel 800030cc:lastRel // more @@ -139,6 +140,7 @@ // somewhere 800b426c:func_800b426c 800cd554:func_800cd554 +805aea50:errno // eff_nice.c 800CC01C:effNiceEntry @@ -191,6 +193,7 @@ // evtmgr.c 800d87e4:evtGetWork 800d890c:make_jump_table +800D8B2C:evtmgrReInit 800d8b88:evtEntry 800d8df4:evtEntryType 800d9060:evtChildEntry @@ -393,6 +396,7 @@ // evt_shop.c 80111d1c:evt_shop_set_defs +804220D0:saffronCookingScript // more // mario.c @@ -409,6 +413,7 @@ // mario_motion.c 801433dc:marioChgMot 80146f0c:func_80146f0c +80426bb8:marioMotTbl // more // mario_pouch.c @@ -443,6 +448,10 @@ // bss 80511a28:mario_pouch_work +// mario_status.c +80154f3c:marioStatusApplyStatuses +// more + // seq_logo.c 80179140:seq_logoMain // more @@ -453,6 +462,7 @@ // more // seq_title.c +8017b250:seq_titleMain 8017bc4c:getNextDanMapname // more @@ -469,6 +479,13 @@ // data 80512360:seqWork +//seq_load_sub.c +// text +8017d1ac:loadMain +// data +805ae0d0:seq_load_sub_wp + + // pausewin.c // text 80184c18:pausewinEntry @@ -569,7 +586,7 @@ 801a62f0:__memFree 801a6e34:__dl__FPv // data -8042a408:size_table +8042a408:memory_size_table // sdata 805ae168:memory_wp 805ae16c:memory_swp @@ -667,6 +684,8 @@ 8023edcc:nandUpdateSave 8023efe0:nandLoadSave // more +// data +805ae1b0:nandmgr_wp // homebuttondrv.c // text @@ -683,7 +702,6 @@ // runtime.c 802560a4:__div2i // more - // MSL_C.PPCEABI.bare.H.a // printf.c 8025cf40:vsprintf @@ -694,9 +712,9 @@ // string.c 8025ec04:strstr // more - // string.c 8025a874:memmove +8025a998:memcmp 8025e8fc:strcpy 8025e9bc:strncpy 8025ea00:strcat @@ -705,10 +723,8 @@ 8025ebd4:strchr 80267018:strlen // more - // s_cos.c 80263ea0:cos - // s_sin.c 802642ac:sin @@ -757,13 +773,23 @@ 80276198:OSRestart // more // OSThread.c +80277154:OSGetCurrentThread +802776c0:OSYieldThread +802776fc:OSCreateThread +80277968:OSExitThread +80277a4c:OSCancelThread +80277d64:OSResumeThread 80277ffc:OSSuspendThread 80278190:OSSleepThread 8027827c:OSWakeupThread // more -// OSTime +// OSTime.c 80278370:OSGetTime // more +// OSMutex.c +80275a50:OSInitMutex +80275a88:OSLockMutex +80275b64:OSUnlockMutex // mtx.a // mtx.c @@ -848,11 +874,21 @@ // ipc.a // text 80297f04:__ios_Ipc2 +80298150:IOS_OpenAsync 80298268:IOS_Open +80298388:IOS_CloseAsync 80298448:IOS_Close +802984f0:IOS_ReadAsync 802985f0:IOS_Read +802986f8:IOS_WriteAsync +802987f8:IOS_Write +80298900:IOS_SeekAsync +8029902c:iosCreateHeap +802989e0:IOS_IoctlAsync 80298b18:IOS_Ioctl +80298d84:IOS_IoctlvAsync 80298e68:IOS_Ioctlv +8029915c:iosAlloc 80299360:iosAllocAligned // sdata 805ae3b4:ipc_lbl_805ae3b4 diff --git a/spm-headers/linker/spm.jp0.lst b/spm-headers/linker/spm.jp0.lst index d721cf4..983dd4a 100644 --- a/spm-headers/linker/spm.jp0.lst +++ b/spm-headers/linker/spm.jp0.lst @@ -1,5 +1,5 @@ // OS Globals -800000e4:currentThread +800000e4:OS_CURRENT_THREAD 800030c8:firstRel 800030cc:lastRel @@ -128,7 +128,7 @@ 803BE018:seq_data 801A5624:__memAlloc 801A56A8:__memFree -803BFC68:size_table +803BFC68:memory_size_table 80542488:memory_wp 8054248C:memory_swp 80235060:wpadGetButtonsHeld @@ -635,7 +635,7 @@ 80542e90:SaveStart 80542e94:SaveEnd -// new to SPM-Hard-Mode +// new to SPM-Hard-Mode: Rubies and Magic 8014C8A0:pouchSetAttack 8014C8D4:pouchGetAttack 8014C8E4:pouchAddAttack @@ -656,3 +656,31 @@ 800D9B14:evtDelete 803F0E88:superDimentioHeadDefenses 803F0EA0:superDimentioBodyDefenses +800D8CFC:evtmgrReInit +803BC458:marioMotTbl +803B7970:saffronCookingScript +804A3D28:marioStatusApplyStatuses + +// 2023-09-02 +802957E4:IOS_OpenAsync +80295A1C:IOS_CloseAsync +80295B84:IOS_ReadAsync +80295D8C:IOS_WriteAsync +80295E8C:IOS_Write +80295F94:IOS_SeekAsync +802966C0:iosCreateHeap +80296074:IOS_IoctlAsync +80296418:IOS_IoctlvAsync +802964FC:IOS_Ioctlv +802967F0:iosAlloc +80542D70:errno +80274E50:OSCreateThread +80274E14:OSYieldThread +80275378:OSResumeThread +802580F0:memcmp + +// new to v10 +805423F0:seq_load_sub_wp +805424D0:nandmgr_wp +80238A9C:spsndSFXOn +8017C4F0:loadMain diff --git a/spm-headers/linker/spm.jp1.lst b/spm-headers/linker/spm.jp1.lst index df7ff6b..d6161a5 100644 --- a/spm-headers/linker/spm.jp1.lst +++ b/spm-headers/linker/spm.jp1.lst @@ -1,5 +1,5 @@ // OS Globals -800000e4:currentThread +800000e4:OS_CURRENT_THREAD 800030c8:firstRel 800030cc:lastRel @@ -127,7 +127,7 @@ 803BF198:seq_data 801A566C:__memAlloc 801A56F0:__memFree -803C0DE8:size_table +803C0DE8:memory_size_table 80541A68:memory_wp 80541A6C:memory_swp 8023570C:wpadGetButtonsHeld @@ -469,3 +469,9 @@ 8026F1F8:Run 80542470:SaveStart 80542474:SaveEnd + +// new to v10 +805419D0:seq_load_sub_wp +80541AB0:nandmgr_wp +80239148:spsndSFXOn +8017C538:loadMain diff --git a/spm-headers/linker/spm.kr0.lst b/spm-headers/linker/spm.kr0.lst index 5f4cfbc..3070f90 100644 --- a/spm-headers/linker/spm.kr0.lst +++ b/spm-headers/linker/spm.kr0.lst @@ -1,5 +1,5 @@ // OS Globals -800000e4:currentThread +800000e4:OS_CURRENT_THREAD 800030c8:firstRel 800030cc:lastRel @@ -117,7 +117,7 @@ 804597B8:seq_data 8019EB44:__memAlloc 8019EBC8:__memFree -8045B3C8:size_table +8045B3C8:memory_size_table 805D7968:memory_wp 805D796C:memory_swp 8022FEF8:wpadGetButtonsHeld @@ -459,3 +459,9 @@ 80273B28:Run 805d8308:SaveStart 805d830c:SaveEnd + +// new to v10 +805D78D0:seq_load_sub_wp +805d79b0:nandmgr_wp +80233884:spsndSFXOn +80178EFC:loadMain diff --git a/spm-headers/linker/spm.us0.lst b/spm-headers/linker/spm.us0.lst index 85a42e2..fac9cf8 100644 --- a/spm-headers/linker/spm.us0.lst +++ b/spm-headers/linker/spm.us0.lst @@ -1,5 +1,5 @@ // OS Globals -800000e4:currentThread +800000e4:OS_CURRENT_THREAD 800030c8:firstRel 800030cc:lastRel @@ -127,7 +127,7 @@ 803E8DC8:seq_data 801A5634:__memAlloc 801A56B8:__memFree -803EAA08:size_table +803EAA08:memory_size_table 8056D188:memory_wp 8056D18C:memory_swp 802350B8:wpadGetButtonsHeld @@ -576,7 +576,7 @@ 80056948:cam3dMain 804C8580:camPtrTbl 801797CC:seq_mapChangeMain -800250EC:getItemUseEvt +80025074:getItemUseEvt 8002F240:msgUnLoad 8002F014:msgLoad 1,1,27204:rpg_screen_draw @@ -634,7 +634,7 @@ 8056db90:SaveStart 8056db94:SaveEnd -// new to SPM-Hard-Mode +// new to SPM-Hard-Mode: Rubies and Magic 8014C8A0:pouchSetAttack 8014C8D4:pouchGetAttack 8014C8E4:pouchAddAttack @@ -655,3 +655,31 @@ 800d9b14:evtDelete 8041BC28:superDimentioHeadDefenses 8041BC40:superDimentioBodyDefenses +800d8cfc:evtmgrReInit +803E71D8:marioMotTbl +803E26F0:saffronCookingScript +804CEA28:marioStatusApplyStatuses + +// 2023-09-02 +80295834:IOS_OpenAsync +80295A6C:IOS_CloseAsync +80295BD4:IOS_ReadAsync +80295DDC:IOS_WriteAsync +80295EDC:IOS_Write +80295FE4:IOS_SeekAsync +80296710:iosCreateHeap +802960C4:IOS_IoctlAsync +80296468:IOS_IoctlvAsync +8029654C:IOS_Ioctlv +80296840:iosAlloc +8056DA70:errno +80274EA0:OSCreateThread +80274E64:OSYieldThread +802753C8:OSResumeThread +80258148:memcmp + +// new to v10 +8017c500:loadMain +8056d0f0:seq_load_sub_wp +8056d1d0:nandmgr_wp +80238af4:spsndSFXOn diff --git a/spm-headers/linker/spm.us1.lst b/spm-headers/linker/spm.us1.lst index f410a7c..855903d 100644 --- a/spm-headers/linker/spm.us1.lst +++ b/spm-headers/linker/spm.us1.lst @@ -1,5 +1,5 @@ // OS Globals -800000e4:currentThread +800000e4:OS_CURRENT_THREAD 800030c8:firstRel 800030cc:lastRel @@ -127,7 +127,7 @@ 803EA128:seq_data 801A5690:__memAlloc 801A5714:__memFree -803EBD68:size_table +803EBD68:memory_size_table 8056C9E8:memory_wp 8056C9EC:memory_swp 80235778:wpadGetButtonsHeld @@ -469,3 +469,9 @@ 8026F298:Run 8056d3f0:SaveStart 8056d3f4:SaveEnd + +// new to v10 +8056C950:seq_load_sub_wp +8056CA30:nandmgr_wp +802391E0:spsndSFXOn +8017C55C:loadMain diff --git a/spm-headers/linker/spm.us2.lst b/spm-headers/linker/spm.us2.lst index f42a1ad..1b98054 100644 --- a/spm-headers/linker/spm.us2.lst +++ b/spm-headers/linker/spm.us2.lst @@ -1,5 +1,5 @@ // OS Globals -800000e4:currentThread +800000e4:OS_CURRENT_THREAD 800030c8:firstRel 800030cc:lastRel @@ -127,7 +127,7 @@ 803EA308:seq_data 801A59A8:__memAlloc 801A5A2C:__memFree -803EBF48:size_table +803EBF48:memory_size_table 8056CB68:memory_wp 8056CB6C:memory_swp 80235A90:wpadGetButtonsHeld @@ -634,7 +634,7 @@ 8056d570:SaveStart 8056d574:SaveEnd -// new to SPM-Hard-Mode +// new to SPM-Hard-Mode: Rubies and Magic 8014CCF8:pouchSetAttack 8014CD2C:pouchGetAttack 8014CD3C:pouchAddAttack @@ -655,3 +655,31 @@ 800D9A98:evtDelete 8041D258:superDimentioHeadDefenses 8041D270:superDimentioBodyDefenses +800D8C80:evtmgrReInit +803E8718:marioMotTbl +803E3C30:saffronCookingScript + +// 2023-09-02 +802960A0:IOS_OpenAsync +802962D8:IOS_CloseAsync +80296440:IOS_ReadAsync +80296648:IOS_WriteAsync +80296748:IOS_Write +80296850:IOS_SeekAsync +80296F7C:iosCreateHeap +80296930:IOS_IoctlAsync +80296CD4:IOS_IoctlvAsync +80296DB8:IOS_Ioctlv +802970AC:iosAlloc +1,5,18fa8:mac_02_init_evt +8056D450:errno +8027564C:OSCreateThread +80275610:OSYieldThread +80275CB4:OSResumeThread +802588e8:memcmp + +// new to v10 +8056CAD0:seq_load_sub_wp +8056CBB0:nandmgr_wp +8023950C:spsndSFXOn +8017C96C:loadMain diff --git a/spm-headers/mod/ogc/gx.h b/spm-headers/mod/ogc/gx.h index 6cd288d..8261104 100644 --- a/spm-headers/mod/ogc/gx.h +++ b/spm-headers/mod/ogc/gx.h @@ -1,4 +1,5 @@ #pragma once +#include #include #include diff --git a/spm-headers/mod/ogc/gxdefines.h b/spm-headers/mod/ogc/gxdefines.h index eb012e9..93030ea 100644 --- a/spm-headers/mod/ogc/gxdefines.h +++ b/spm-headers/mod/ogc/gxdefines.h @@ -18,9 +18,6 @@ #define GX_FIFO_HIWATERMARK (16*1024) /*!< Default hi watermark for FIFO buffer control. */ #define GX_FIFO_OBJSIZE 128 -#define GX_PERSPECTIVE 0 -#define GX_ORTHOGRAPHIC 1 - #define GX_MT_NULL 0 #define GX_MT_XF_FLUSH 1 #define GX_MT_DL_SAVE_CTX 2