diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index b8873675..4a46d387 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -61,6 +61,10 @@ toBeSorted/unk_flag_stuff.cpp: toBeSorted/bitwise_flag_helper.cpp: .text start:0x800BF200 end:0x800BF264 +m/m_mtx.cpp: + .text start:0x802F1660 end:0x802F1F20 + .ctors start:0x804DB8D4 end:0x804DB8D8 + rvl/CX/cx.c: .text start:0x803CEE90 end:0x803D0B20 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 6dd47b65..d765a39e 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -17847,10 +17847,10 @@ fn_802F19E0 = .text:0x802F19E0; // type:function size:0x60 fn_802F1A40 = .text:0x802F1A40; // type:function size:0x60 fn_802F1AA0 = .text:0x802F1AA0; // type:function size:0x60 fn_802F1B00 = .text:0x802F1B00; // type:function size:0x60 -fn_802F1B60 = .text:0x802F1B60; // type:function size:0xDC +toRot__6mMtx_cCFR7mAng3_c = .text:0x802F1B60; // type:function size:0xDC fn_802F1C40 = .text:0x802F1C40; // type:function size:0x220 fn_802F1E60 = .text:0x802F1E60; // type:function size:0x58 -fn_802F1EC0 = .text:0x802F1EC0; // type:function size:0x58 +__sinit_\m_mtx_cpp = .text:0x802F1EC0; // type:function size:0x58 fn_802F1F20 = .text:0x802F1F20; // type:function size:0x30 fn_802F1F50 = .text:0x802F1F50; // type:function size:0x1E4 fn_802F2140 = .text:0x802F2140; // type:function size:0x14 @@ -36949,7 +36949,7 @@ lbl_8056BED8 = .data:0x8056BED8; // type:object size:0x60 lbl_8056BF38 = .data:0x8056BF38; // type:object size:0xC data:4byte lbl_8056BF44 = .data:0x8056BF44; // type:object size:0x5C lbl_8056BFA0 = .data:0x8056BFA0; // type:object size:0x60 -lbl_8056C000 = .data:0x8056C000; // type:object size:0x10 +twiceBit__Q24nw4r2db = .data:0x8056C000; // type:object size:0x10 scope:local lbl_8056C010 = .data:0x8056C010; // type:object size:0x10 lbl_8056C020 = .data:0x8056C020; // type:object size:0x18 lbl_8056C038 = .data:0x8056C038; // type:object size:0x10 @@ -40819,7 +40819,7 @@ lbl_805765D8 = .sbss:0x805765D8; // type:object size:0x4 data:4byte lbl_805765DC = .sbss:0x805765DC; // type:object size:0x4 lbl_805765E0 = .sbss:0x805765E0; // type:object size:0x1 data:byte lbl_805765E1 = .sbss:0x805765E1; // type:object size:0x7 data:byte -sInitialized__Q24nw4r2db = .sbss:0x805765E8; // type:object size:0x4 data:4byte +sInitialized__Q24nw4r2db = .sbss:0x805765E8; // type:object size:0x4 scope:local data:4byte lbl_805765F0 = .sbss:0x805765F0; // type:object size:0x4 data:4byte lbl_805765F4 = .sbss:0x805765F4; // type:object size:0x1 data:byte lbl_805765F8 = .sbss:0x805765F8; // type:object size:0x8 diff --git a/configure.py b/configure.py index 30822ba5..1d205579 100644 --- a/configure.py +++ b/configure.py @@ -131,7 +131,7 @@ config.linker_version = "Wii/1.7" config.ldflags = [ "-fp hardware", "-nodefaults", - # "-listclosure", # Uncomment for Wii linkers + "-listclosure", # Uncomment for Wii linkers ] # Base flags, common to most GC/Wii games. @@ -170,7 +170,7 @@ cflags_runtime = [ "-str reuse,pool,readonly", "-gccinc", "-common off", - "-inline auto", + "-inline auto", ] # Dolphin library flags @@ -220,8 +220,9 @@ def Rel(status, rel_name, cpp_name, extra_cflags=[]): ], } + # From tww. IDK if it needs changing for Wii (probably) -# Helper function for Dolphin libraries +# Helper function for Dolphin libraries def DolphinLib(lib_name, objects): return { "lib": lib_name, @@ -231,6 +232,7 @@ def DolphinLib(lib_name, objects): "objects": objects, } + def EGGLib(lib_name, objects): return { "lib": lib_name, @@ -240,6 +242,7 @@ def EGGLib(lib_name, objects): "objects": objects, } + def nw4rLib(lib_name, objects): return { "lib": lib_name, @@ -249,36 +252,35 @@ def nw4rLib(lib_name, objects): "objects": objects, } + Matching = True NonMatching = False config.warn_missing_config = False -config.warn_missing_source = False # TODO +config.warn_missing_source = False # TODO config.libs = [ { "lib": "framework", "mw_version": "Wii/1.7", "cflags": cflags_framework, "host": False, - "objects": [ + "objects": [ # machine (m_name Object(NonMatching, "Runtime/__init_cpp_exceptions.cpp"), Object(Matching, "toBeSorted/unk_flag_stuff.cpp"), Object(Matching, "toBeSorted/bitwise_flag_helper.cpp"), Object(Matching, "toBeSorted/sceneflag_manager.cpp"), - Object(NonMatching, "toBeSorted/flag_space.cpp"), - Object(NonMatching, "toBeSorted/misc_flag_managers.cpp"), + Object(NonMatching, "toBeSorted/flag_space.cpp"), + Object(NonMatching, "toBeSorted/misc_flag_managers.cpp"), Object(Matching, "d/d_base.cpp"), Object(NonMatching, "d/a/d_a_base.cpp"), - Object(NonMatching,"d/a/obj/d_a_obj_base.cpp"), - Object(Matching,"toBeSorted/save_file.cpp"), - Object(NonMatching,"toBeSorted/file_manager.cpp"), - Object(NonMatching,"toBeSorted/save_manager.cpp"), - + Object(NonMatching, "d/a/obj/d_a_obj_base.cpp"), + Object(Matching, "toBeSorted/save_file.cpp"), + Object(NonMatching, "toBeSorted/file_manager.cpp"), + Object(NonMatching, "toBeSorted/save_manager.cpp"), + Object(NonMatching, "m/m_mtx.cpp"), # framework (f_name) - # d stuff (d_name) - ], }, # DolphinLib( @@ -292,15 +294,13 @@ config.libs = [ # "host": False, # "objects": [ ], # }, - - #NW4R + # NW4R nw4rLib( "db", [ Object(NonMatching, "nw4r/db/db_directPrint.cpp"), - ] + ], ), - # EGG EGGLib( "core", @@ -318,15 +318,15 @@ config.libs = [ Object(NonMatching, "egg/core/eggThread.cpp"), Object(NonMatching, "egg/core/eggUnk.cpp"), Object(NonMatching, "egg/core/eggSystem.cpp"), - Object( Matching, "egg/core/eggDisplay.cpp"), + Object(Matching, "egg/core/eggDisplay.cpp"), Object(NonMatching, "egg/core/eggColorFader.cpp"), - Object(NonMatching, "egg/core/eggAsyncDisplay.cpp"), + Object(NonMatching, "egg/core/eggAsyncDisplay.cpp"), Object(NonMatching, "egg/core/eggVideo.cpp"), Object(NonMatching, "egg/core/eggXfb.cpp"), Object(NonMatching, "egg/core/eggXfbManager.cpp"), - Object(NonMatching, "egg/core/eggGraphicsFifo.cpp"), + Object(NonMatching, "egg/core/eggGraphicsFifo.cpp"), Object(NonMatching, "egg/core/eggController.cpp"), - ] + ], ), EGGLib( "math", @@ -334,14 +334,14 @@ config.libs = [ Object(NonMatching, "egg/math/eggMath.cpp"), Object(NonMatching, "egg/math/eggMatrix.cpp"), Object(NonMatching, "egg/math/eggQuat.cpp"), - Object( Matching, "egg/math/eggVector.cpp"), - ] + Object(Matching, "egg/math/eggVector.cpp"), + ], ), EGGLib( "prim", [ Object(NonMatching, "egg/prim/eggAssert.cpp"), - ] + ], ), # { # "lib": "MSL_C", @@ -359,7 +359,6 @@ config.libs = [ # "objects": [ # ], # }, - # Begin RELs # { # "lib": "REL", diff --git a/include/MSL_C/MSL_Common/Src/float.h b/include/MSL_C/MSL_Common/Src/float.h index 18769583..0f3e5cd4 100644 --- a/include/MSL_C/MSL_Common/Src/float.h +++ b/include/MSL_C/MSL_Common/Src/float.h @@ -16,10 +16,10 @@ #define signbit(x) ((sizeof(x) == sizeof(float)) ? __signbitf(x) : __signbitd(x)) #define isfinite(x) ((fpclassify(x) > 2)) -#define __signbitf(x) ((*(unsigned char*)&(x)) & 0x80) +#define __signbitf(x) ((*(unsigned char *)&(x)) & 0x80) // TODO: OK? -#define __signbitd(x) ((*(unsigned char*)&(x)) & 0x80) +#define __signbitd(x) ((*(unsigned char *)&(x)) & 0x80) extern unsigned long __float_nan[]; extern unsigned long __float_huge[]; @@ -27,7 +27,7 @@ extern unsigned long __float_max[]; extern unsigned long __float_epsilon[]; inline int __fpclassifyf(float __value) { - unsigned long integer = *(unsigned long*)&__value; + unsigned long integer = *(unsigned long *)&__value; switch (integer & 0x7f800000) { case 0x7f800000: @@ -49,17 +49,19 @@ inline int __fpclassifyf(float __value) { inline int __fpclassifyd(double __value) { switch (__HI(__value) & 0x7ff00000) { case 0x7ff00000: { - if ((__HI(__value) & 0x000fffff) || (__LO(__value) & 0xffffffff)) + if ((__HI(__value) & 0x000fffff) || (__LO(__value) & 0xffffffff)) { return FP_QNAN; - else + } else { return FP_INFINITE; + } break; } case 0: { - if ((__HI(__value) & 0x000fffff) || (__LO(__value) & 0xffffffff)) + if ((__HI(__value) & 0x000fffff) || (__LO(__value) & 0xffffffff)) { return FP_SUBNORMAL; - else + } else { return FP_ZERO; + } break; } } diff --git a/include/MSL_C/MSL_Common/Src/printf.h b/include/MSL_C/MSL_Common/Src/printf.h index 997e0018..5b1a7ccd 100644 --- a/include/MSL_C/MSL_Common/Src/printf.h +++ b/include/MSL_C/MSL_Common/Src/printf.h @@ -2,18 +2,18 @@ #define MSL_COMMON_SRC_PRINTF_H #include "MSL_C/MSL_Common/Src/ansi_files.h" -#include "Runtime/__va_arg.h" +#include "Runtime.PPCEABI.H/__va_arg.h" #ifdef __cplusplus extern "C" { #endif -int fprintf(FILE *stream, const char *format, ...); -int printf(const char *format, ...); -int sprintf(const char *str, const char *format, ...); -int snprintf(const char *str, size_t n, const char *format, ...); -int vsnprintf(char *str, size_t n, const char *format, va_list arg); -int vprintf(const char *format, va_list arg); +int fprintf(FILE* stream, const char* format, ...); +int printf(const char* format, ...); +int sprintf(const char* str, const char* format, ...); +int snprintf(const char* str, size_t n, const char* format, ...); +int vsnprintf(char* str, size_t n, const char* format, va_list arg); +int vprintf(const char* format, va_list arg); #ifdef __cplusplus } diff --git a/include/MSL_C/new.h b/include/MSL_C/new.h new file mode 100644 index 00000000..17053c7f --- /dev/null +++ b/include/MSL_C/new.h @@ -0,0 +1,10 @@ +#ifndef MSL_NEW_H_ +#define MSL_NEW_H_ + +#include "MSL_C/MSL_Common/Src/stddef.h" + +inline void* operator new(size_t size, void* ptr) { + return ptr; +} + +#endif diff --git a/include/MSL_C/string.h b/include/MSL_C/string.h index ea08c98f..418cdc48 100644 --- a/include/MSL_C/string.h +++ b/include/MSL_C/string.h @@ -4,5 +4,6 @@ #include "MSL_C/MSL_Common/Src/extras.h" #include "MSL_C/MSL_Common/Src/mem.h" #include "MSL_C/MSL_Common/Src/string.h" +#include "MSL_C/MSL_Common/Src/printf.h" #endif diff --git a/include/Runtime.PPCEABI.H/CPlusLibPPC.h b/include/Runtime.PPCEABI.H/CPlusLibPPC.h new file mode 100644 index 00000000..16065292 --- /dev/null +++ b/include/Runtime.PPCEABI.H/CPlusLibPPC.h @@ -0,0 +1,6 @@ +#ifndef CPLUSLIBPPC_H +#define CPLUSLIBPPC_H + +#include + +#endif /* CPLUSLIBPPC_H */ diff --git a/include/Runtime.PPCEABI.H/GCN_mem_alloc.h b/include/Runtime.PPCEABI.H/GCN_mem_alloc.h new file mode 100644 index 00000000..0b880b91 --- /dev/null +++ b/include/Runtime.PPCEABI.H/GCN_mem_alloc.h @@ -0,0 +1,4 @@ +#ifndef GCN_MEM_ALLOC_H +#define GCN_MEM_ALLOC_H + +#endif /* GCN_MEM_ALLOC_H */ diff --git a/include/Runtime.PPCEABI.H/Gecko_ExceptionPPC.h b/include/Runtime.PPCEABI.H/Gecko_ExceptionPPC.h new file mode 100644 index 00000000..d4ba9ec8 --- /dev/null +++ b/include/Runtime.PPCEABI.H/Gecko_ExceptionPPC.h @@ -0,0 +1,4 @@ +#ifndef GECKO_EXCEPTIONPPC_H +#define GECKO_EXCEPTIONPPC_H + +#endif /* GECKO_EXCEPTIONPPC_H */ diff --git a/include/Runtime.PPCEABI.H/NMWException.h b/include/Runtime.PPCEABI.H/NMWException.h new file mode 100644 index 00000000..f5c04a3a --- /dev/null +++ b/include/Runtime.PPCEABI.H/NMWException.h @@ -0,0 +1,29 @@ +#ifndef _NMWEXCEPTION +#define _NMWEXCEPTION + +#include "Runtime.PPCEABI.H/__ppc_eabi_linker.h" +#include + + +#ifdef __cplusplus +extern "C" { +#endif + +#define DTORCALL(dtor, objptr) (((void (*)(void *, int))dtor)(objptr, -1)) + +typedef struct DestructorChain { + struct DestructorChain *next; + void *destructor; + void *object; +} DestructorChain; + +void __unregister_fragment(int fragmentID); +int __register_fragment(struct __eti_init_info *info, char *TOC); +void *__register_global_object(void *object, void *destructor, void *regmem); +void __destroy_global_chain(void); + +#ifdef __cplusplus +} +#endif + +#endif // _NMWEXCEPTION diff --git a/include/Runtime.PPCEABI.H/__init_cpp_exceptions.h b/include/Runtime.PPCEABI.H/__init_cpp_exceptions.h new file mode 100644 index 00000000..525612aa --- /dev/null +++ b/include/Runtime.PPCEABI.H/__init_cpp_exceptions.h @@ -0,0 +1,6 @@ +#ifndef __INIT_CPP_EXCEPTIONS_H +#define __INIT_CPP_EXCEPTIONS_H + +#include + +#endif /* __INIT_CPP_EXCEPTIONS_H */ diff --git a/include/Runtime.PPCEABI.H/__mem.h b/include/Runtime.PPCEABI.H/__mem.h new file mode 100644 index 00000000..ab53e58f --- /dev/null +++ b/include/Runtime.PPCEABI.H/__mem.h @@ -0,0 +1,16 @@ +#ifndef RUNTIME_MEM_H +#define RUNTIME_MEM_H + +#ifdef __cplusplus +extern "C" { +#endif + +__declspec(section ".init") void* memcpy(void* dest, const void* src, size_t n); +__declspec(section ".init") void __fill_mem(void* dest, int val, size_t count); +__declspec(section ".init") void* memset(void* dest, int val, size_t count); + +#ifdef __cplusplus +} +#endif + +#endif /* RUNTIME_MEM_H */ diff --git a/include/Runtime.PPCEABI.H/__ppc_eabi_linker.h b/include/Runtime.PPCEABI.H/__ppc_eabi_linker.h new file mode 100644 index 00000000..068488e0 --- /dev/null +++ b/include/Runtime.PPCEABI.H/__ppc_eabi_linker.h @@ -0,0 +1,71 @@ +#ifndef __PPC_EABI_LINKER +#define __PPC_EABI_LINKER + +extern char _stack_addr[]; +extern char _stack_end[]; +extern char _heap_addr[]; +extern char _heap_end[]; +extern const char _fextabindex_rom[]; +extern char _fextabindex[]; +extern char _eextabindex[]; + +extern char _SDA_BASE_[]; +extern char _SDA2_BASE_[]; + +typedef struct __rom_copy_info { + char* rom; + char* addr; + unsigned int size; +} __rom_copy_info; + +extern __rom_copy_info _rom_copy_info[]; + +typedef struct __bss_init_info { + char* addr; + unsigned int size; +} __bss_init_info; + +extern __bss_init_info _bss_init_info[]; + +typedef struct __eti_init_info { + void* eti_start; + void* eti_end; + void* code_start; + unsigned long code_size; +} __eti_init_info; + +extern __eti_init_info _eti_init_info[]; +extern const char _f_init_rom[]; +extern char _f_init[]; +extern char _e_init[]; +extern const char _f_text_rom[]; +extern char _f_text[]; +extern char _e_text[]; +extern const char _f_rodata_rom[]; +extern char _f_rodata[]; +extern char _e_rodata[]; +extern const char _fextab_rom[]; +extern char _fextab[]; +extern char _eextab[]; +extern const char _f_data_rom[]; +extern char _f_data[]; +extern char _e_data[]; +extern char _f_bss[]; +extern char _e_bss[]; +extern const char _f_sdata_rom[]; +extern char _f_sdata[]; +extern char _e_sdata[]; +extern char _f_sbss[]; +extern char _e_sbss[]; +extern const char _f_sdata2_rom[]; +extern char _f_sdata2[]; +extern char _e_sdata2[]; +extern char _f_sbss2[]; +extern char _e_sbss2[]; +extern const char _f_PPC_EMB_sdata0_rom[]; +extern char _f_PPC_EMB_sdata0[]; +extern char _e_PPC_EMB_sdata0[]; +extern char _f_PPC_EMB_sbss0[]; +extern char _e_PPC_EMB_sbss0[]; + +#endif // __PPC_EABI_LINKER diff --git a/include/Runtime/__va_arg.h b/include/Runtime.PPCEABI.H/__va_arg.h similarity index 80% rename from include/Runtime/__va_arg.h rename to include/Runtime.PPCEABI.H/__va_arg.h index 1e06d49b..d3600d51 100644 --- a/include/Runtime/__va_arg.h +++ b/include/Runtime.PPCEABI.H/__va_arg.h @@ -1,6 +1,7 @@ -#ifndef _RUNTIME_VA_ARG_H -#define _RUNTIME_VA_ARG_H -#include "types.h" +#ifndef __VA_ARG_H +#define __VA_ARG_H + +#include typedef struct __va_list_struct { char gpr; @@ -27,13 +28,13 @@ void *__va_arg(_va_list_struct *, int); // __builtin_va_info: initialize the __va_list_struct // _var_arg_typeof: convert type to integer for __va_arg #define __va_start(list, fmt) __builtin_va_info(&list) -#define __va_arg(list, type) (*((type *)__va_arg(ap, _var_arg_typeof(type)))) +// #define __va_arg(list, type) (*((type*)__va_arg(ap, _var_arg_typeof(type)))) #define va_start __va_start -#define va_arg __va_arg +// #define va_arg __va_arg #define va_end __va_end #define va_list __va_list #define __va_end(list) ((void)0) #define __va_copy(a, b) (*(a) = *(b)) -#endif \ No newline at end of file +#endif /* __VA_ARG_H */ diff --git a/include/Runtime.PPCEABI.H/global_destructor_chain.h b/include/Runtime.PPCEABI.H/global_destructor_chain.h new file mode 100644 index 00000000..1f568e35 --- /dev/null +++ b/include/Runtime.PPCEABI.H/global_destructor_chain.h @@ -0,0 +1,4 @@ +#ifndef GLOBAL_DESTRUCTOR_CHAIN_H +#define GLOBAL_DESTRUCTOR_CHAIN_H + +#endif /* GLOBAL_DESTRUCTOR_CHAIN_H */ diff --git a/include/Runtime.PPCEABI.H/ptmf.h b/include/Runtime.PPCEABI.H/ptmf.h new file mode 100644 index 00000000..cc22aa42 --- /dev/null +++ b/include/Runtime.PPCEABI.H/ptmf.h @@ -0,0 +1,18 @@ +#ifndef PTMF_H +#define PTMF_H + +typedef struct __ptmf { + long this_delta; // self-explanatory + long v_offset; // vtable offset + union { + void* f_addr; // function address + long ve_offset; // virtual function entry offset (of vtable) + } f_data; +} __ptmf; + +const __ptmf __ptmf_null; +long __ptmf_test(__ptmf* ptmf); +void __ptmf_cmpr(register __ptmf* this, register __ptmf* other); +void __ptmf_scall(...); + +#endif /* PTMF_H */ diff --git a/include/Runtime.PPCEABI.H/runtime.h b/include/Runtime.PPCEABI.H/runtime.h new file mode 100644 index 00000000..be485275 --- /dev/null +++ b/include/Runtime.PPCEABI.H/runtime.h @@ -0,0 +1,6 @@ +#ifndef RUNTIME_H +#define RUNTIME_H + +#include + +#endif /* RUNTIME_H */ diff --git a/include/Runtime/__init_cpp_exception.h b/include/Runtime/__init_cpp_exception.h deleted file mode 100644 index 969d43da..00000000 --- a/include/Runtime/__init_cpp_exception.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef _RUNTIME_INIT_CPP_EXCEPTIONS_H -#define _RUNTIME_INIT_CPP_EXCEPTIONS_H - -#include "types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void __init_cpp_exceptions(void); -void __fini_cpp_exceptions(void); - -#ifdef __cplusplus -} -#endif - -#endif \ No newline at end of file diff --git a/include/Runtime/exception.h b/include/Runtime/exception.h deleted file mode 100644 index c2d2f179..00000000 --- a/include/Runtime/exception.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef _EXCEPTION -#define _EXCEPTION - -namespace std { -class exception { -public: - exception() {} - virtual ~exception() {} - virtual const char *what() const { - return "exception"; - } -}; - -class bad_exception : public exception { -public: - bad_exception() {} - virtual ~bad_exception() {} - virtual const char *what() const { - return "bad_exception"; - } -}; - -typedef void (*unexpected_handler)(); -unexpected_handler set_unexpected(unexpected_handler handler); -void unexpected(); - -typedef void (*terminate_handler)(); -terminate_handler set_terminate(terminate_handler handler); -void terminate(); - -} // namespace std - -using std::bad_exception; -using std::exception; -using std::set_terminate; -using std::set_unexpected; -using std::terminate; -using std::terminate_handler; -using std::unexpected; -using std::unexpected_handler; - -#endif \ No newline at end of file diff --git a/include/Runtime/global_destructor_chain.h b/include/Runtime/global_destructor_chain.h deleted file mode 100644 index b42af03c..00000000 --- a/include/Runtime/global_destructor_chain.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef _GLOBALDESTRUCTORCHAIN -#define _GLOBALDESTRUCTORCHAIN - -#include "types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define CTORARG_TYPE int -#define CTORARG_PARTIAL (0) -#define CTORARG_COMPLETE (1) - -#define CTORCALL_COMPLETE(ctor, objptr) \ - (((void (*)(void *, CTORARG_TYPE))ctor)(objptr, CTORARG_COMPLETE)) - -#define DTORARG_TYPE int - -#define DTORCALL_COMPLETE(dtor, objptr) (((void (*)(void *, DTORARG_TYPE))dtor)(objptr, -1)) - -typedef struct DestructorChain { - struct DestructorChain *next; - void *destructor; - void *object; -} DestructorChain; - -void *__register_global_object(void *object, void *destructor, void *registration); - -void __destroy_global_chain(void); - -int __register_atexit(void (*)(void)); - -#ifdef __cplusplus -} -#endif - -#endif \ No newline at end of file diff --git a/include/Runtime/ptmf.h b/include/Runtime/ptmf.h deleted file mode 100644 index cef21722..00000000 --- a/include/Runtime/ptmf.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef PTMF_H -#define PTMF_H - -typedef struct __ptmf { - long this_delta; // self-explanatory - long v_offset; // vtable offset - union { - void *f_addr; // function address - long ve_offset; // virtual function entry offset (of vtable) - } f_data; -} __ptmf; - -#endif /* PTMF_H */ \ No newline at end of file diff --git a/include/Runtime/runtime.h b/include/Runtime/runtime.h deleted file mode 100644 index b8793650..00000000 --- a/include/Runtime/runtime.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef _DOLPHIN_RUNTIME_H -#define _DOLPHIN_RUNTIME_H - -#include "types.h" - -#ifdef __cplusplus -extern "C" { -#endif // ifdef __cplusplus - -u32 __cvt_fp2unsigned(f64); -// TODO: The rest - -void *__copy(char *, char *, size_t); - -#ifdef __cplusplus -}; -#endif // ifdef __cplusplus - -#endif \ No newline at end of file diff --git a/include/UnknownTypeBelongings.h b/include/UnknownTypeBelongings.h index 18341ba9..4d89820d 100644 --- a/include/UnknownTypeBelongings.h +++ b/include/UnknownTypeBelongings.h @@ -1,31 +1,27 @@ #pragma once -#include "types.h" - +#include // MOST LIKELY mVEC -struct Vec3f -{ +struct Vec3f { f32 x, y, z; }; -struct Vec2f -{ +struct Vec2f { f32 x, y; }; -struct Vec3s -{ +struct Vec3s { s16 x, y, z; }; struct ObjInfo { - /* 0x00 */ char* name; + /* 0x00 */ char *name; /* 0x04 */ u16 obj_id; /* 0x06 */ u16 obj_id2; /* 0x08 */ u16 fiTextEntryId; - /* 0x0A */ u8 unk_0xA; - /* 0x0B */ u8 subtype; + /* 0x0A */ u8 unk_0xA; + /* 0x0B */ u8 subtype; }; // is now fLiNdBa_c @@ -35,6 +31,4 @@ struct ObjInfo { // fBase_c* link; // }; -class UnkCollider { - -}; \ No newline at end of file +class UnkCollider {}; diff --git a/include/c/c_list.h b/include/c/c_list.h index 6f00c681..e693213e 100644 --- a/include/c/c_list.h +++ b/include/c/c_list.h @@ -2,7 +2,7 @@ // This file was ported from https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/cLib/c_list.hpp -#include "types.h" +#include /// @brief A doubly-linked list node. See cListMg_c. /// @note Unofficial name. @@ -11,8 +11,12 @@ public: /// @brief Constructs a new list node. cListNd_c() : mpPrev(nullptr), mpNext(nullptr) {} - cListNd_c *getPrev() const { return mpPrev; } - cListNd_c *getNext() const { return mpNext; } + cListNd_c *getPrev() const { + return mpPrev; + } + cListNd_c *getNext() const { + return mpNext; + } protected: cListNd_c *mpPrev; ///< The previous node. @@ -24,8 +28,8 @@ protected: class cListMg_c { public: /* 802e2be0 */ cListMg_c() : mpFirst(nullptr), mpLast(nullptr) {} - // /* 802e2880 */ ~cListMg_c(); - + // /* 802e2880 */ ~cListMg_c(); + bool insertAfter(cListNd_c *node, cListNd_c *prevNode); /** @@ -52,10 +56,14 @@ public: */ bool prepend(cListNd_c *node); - cListNd_c *getFirst() const { return mpFirst; } - cListNd_c *getLast() const { return mpLast; } + cListNd_c *getFirst() const { + return mpFirst; + } + cListNd_c *getLast() const { + return mpLast; + } protected: cListNd_c *mpFirst; ///< The first node in the list. - cListNd_c *mpLast; ///< The last node in the list. -}; \ No newline at end of file + cListNd_c *mpLast; ///< The last node in the list. +}; diff --git a/include/c/c_math.h b/include/c/c_math.h new file mode 100644 index 00000000..e192fa20 --- /dev/null +++ b/include/c/c_math.h @@ -0,0 +1,10 @@ +#ifndef C_LIB_CMATH +#define C_LIB_CMATH + +#include + +namespace cM { +static s16 atan2s(f32, f32); +} // namespace cM + +#endif diff --git a/include/c/c_owner_set.h b/include/c/c_owner_set.h index e7446b25..7bba2369 100644 --- a/include/c/c_owner_set.h +++ b/include/c/c_owner_set.h @@ -1,20 +1,25 @@ #pragma once -// This file was ported from https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/cLib/c_owner_set.hpp +// This file was ported from +// https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/cLib/c_owner_set.hpp -#include "types.h" +#include /// @file /// @brief A set node with a pointer to the owning container. See cOwnerSetMg_c. /// @note Unofficial name. class cOwnerSetNd_c { public: - void *getOwner() const { return mpOwner; } - cOwnerSetNd_c *getNext() const { return mpNext; } + void *getOwner() const { + return mpOwner; + } + cOwnerSetNd_c *getNext() const { + return mpNext; + } private: - void* mpOwner; ///< The set that contains this node. - cOwnerSetNd_c* mpNext; ///< The next node in the set. + void *mpOwner; ///< The set that contains this node. + cOwnerSetNd_c *mpNext; ///< The next node in the set. friend class cOwnerSetMg_c; }; @@ -28,7 +33,9 @@ public: cOwnerSetMg_c() : mpRoot(nullptr) {} /// @brief Destroys the set. - ~cOwnerSetMg_c() { clear(); }; + ~cOwnerSetMg_c() { + clear(); + }; /** * @brief Adds a node to the set. @@ -50,5 +57,5 @@ private: /// @brief Clears out the set and unlinks all child nodes. void clear(); - cOwnerSetNd_c* mpRoot; ///< The first element of the set. + cOwnerSetNd_c *mpRoot; ///< The first element of the set. }; diff --git a/include/c/c_tree.h b/include/c/c_tree.h index ba74fbfa..82dd8219 100644 --- a/include/c/c_tree.h +++ b/include/c/c_tree.h @@ -2,7 +2,7 @@ // This file was ported from https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/cLib/c_tree.hpp -#include "types.h" +#include /// @brief A tree node. See cTreeMg_c. /// @details The tree is represented as a doubly-linked LCRS tree. @@ -17,19 +17,27 @@ public: /// @brief Gets the next node in preorder traversal order, excluding the node's children. cTreeNd_c *getTreeNextNotChild() const; - cTreeNd_c *getParent() const { return mpParent; } - cTreeNd_c *getChild() const { return mpChild; } - cTreeNd_c *getBrPrev() const { return mpPrev; } - cTreeNd_c *getBrNext() const { return mpNext; } + cTreeNd_c *getParent() const { + return mpParent; + } + cTreeNd_c *getChild() const { + return mpChild; + } + cTreeNd_c *getBrPrev() const { + return mpPrev; + } + cTreeNd_c *getBrNext() const { + return mpNext; + } protected: /// @brief Clears all fields. void forcedClear(); cTreeNd_c *mpParent; ///< The parent node. - cTreeNd_c *mpChild; ///< The child node. - cTreeNd_c *mpPrev; ///< The previous sibling node. - cTreeNd_c *mpNext; ///< The next sibling node. + cTreeNd_c *mpChild; ///< The child node. + cTreeNd_c *mpPrev; ///< The previous sibling node. + cTreeNd_c *mpNext; ///< The next sibling node. friend class cTreeMg_c; }; @@ -59,4 +67,4 @@ public: protected: cTreeNd_c *mpRootNode; ///< The root node of the tree. -}; \ No newline at end of file +}; diff --git a/include/rvl/macros.h b/include/common.h similarity index 57% rename from include/rvl/macros.h rename to include/common.h index d18f7408..102058f7 100644 --- a/include/rvl/macros.h +++ b/include/common.h @@ -1,4 +1,5 @@ #pragma once + #define MAX(x, y) ((x) > (y) ? (x) : (y)) #define MIN(x, y) ((x) < (y) ? (x) : (y)) @@ -47,3 +48,66 @@ #define __attribute__(x) #define __declspec(x) #endif + +typedef signed char s8; +typedef signed short s16; +typedef signed int s32; +typedef signed long long s64; + +typedef unsigned char u8; +typedef unsigned short u16; +typedef unsigned int u32; +typedef unsigned long long u64; +typedef float f32; +typedef double f64; + +typedef int UNKWORD; +typedef void UNKTYPE; + +enum { FALSE, TRUE }; +typedef int BOOL; + +#ifdef __CWCC__ +typedef unsigned long size_t; +#endif + +typedef u8 undefined1; +typedef u16 undefined2; +typedef u32 undefined4; + +typedef volatile u8 vu8; +typedef volatile u16 vu16; +typedef volatile u32 vu32; +typedef volatile u64 vu64; +typedef volatile s8 vs8; +typedef volatile s16 vs16; +typedef volatile s32 vs32; +typedef volatile s64 vs64; + +typedef volatile f32 vf32; +typedef volatile f64 vf64; + +// Necesary for CW +#if __cplusplus < 201103L && !defined(_WIN32) +#define override +#define noexcept +#define nullptr NULL +#endif + +#ifndef NULL +#define NULL 0 +#endif +#define nullptr NULL + +// taken from mkw +#ifdef __cplusplus +#define restrict + +class NonCopyable { +public: + inline NonCopyable() {} + +private: + inline NonCopyable(const NonCopyable &) {} +}; +#endif diff --git a/include/egg/core/eggAllocator.h b/include/egg/core/eggAllocator.h index c5c6e72c..ddcf449b 100644 --- a/include/egg/core/eggAllocator.h +++ b/include/egg/core/eggAllocator.h @@ -1,24 +1,28 @@ #pragma once -#include "types.h" -#include "rvl/MEM.h" #include "egg/core/eggHeap.h" +#include "rvl/MEM.h" +#include + // /* 80495310 */ MEMInitAllocatorFor_Heap(MEMAllocator* alloc, s32 align, void* heap); // /* 804952f0 */ MEM_AllocFor_Heap(MEMAllocator* alloc, void* block); // /* 804952d0 */ MEM_AllocFor_Heap(MEMAllocator* alloc, u32 size, s32 align); namespace EGG { - class Heap; - class Allocator : public MEMAllocator { - public: - /* 80495330 */ Allocator(Heap* heap, s32 align); - public: - /* vt 0x08 | 80495380 */ virtual ~Allocator(); - /* vt 0x0C | 804953c0 */ virtual void* alloc(u32 size); - /* vt 0x10 | 804953e0 */ virtual void free(void* block); +class Heap; +class Allocator : public MEMAllocator { +public: + /* 80495330 */ Allocator(Heap *heap, s32 align); - inline MEMAllocator* getHandle() { return static_cast(this); } - /* 0x14 */ Heap* mHeap; - /* 0x18 */ s32 align; - }; -}; \ No newline at end of file +public: + /* vt 0x08 | 80495380 */ virtual ~Allocator(); + /* vt 0x0C | 804953c0 */ virtual void *alloc(u32 size); + /* vt 0x10 | 804953e0 */ virtual void free(void *block); + + inline MEMAllocator *getHandle() { + return static_cast(this); + } + /* 0x14 */ Heap *mHeap; + /* 0x18 */ s32 align; +}; +}; // namespace EGG diff --git a/include/egg/core/eggArchive.h b/include/egg/core/eggArchive.h index 1f1f0a1c..23dc4b27 100644 --- a/include/egg/core/eggArchive.h +++ b/include/egg/core/eggArchive.h @@ -1,16 +1,16 @@ #pragma once -#include "types.h" +#include "egg/core/eggDisposer.h" #include "rvl/ARC.h" #include "rvl/NAND.h" -#include "egg/core/eggDisposer.h" +#include -typedef void (*FileCallbackFunc)(void*, void*, const ARCDirEntry*, const char*); -namespace EGG -{ +typedef void (*FileCallbackFunc)(void *, void *, const ARCDirEntry *, const char *); + +namespace EGG { // Functions that need a proper home: -/* 80493510 */ void readNANDFile(NANDFileInfo* info, void* buf, u32 len, s32 offs); +/* 80493510 */ void readNANDFile(NANDFileInfo *info, void *buf, u32 len, s32 offs); class Archive : public Disposer { public: @@ -19,42 +19,44 @@ public: u32 mArcLength; }; enum MountType { // enum name is correct, values arent official - NOT_LOADED, LOADED_CAN_FAST_READ, NAND_File, + NOT_LOADED, + LOADED_CAN_FAST_READ, + NAND_File, }; /* 0x10 */ MountType mMountType; /* 0x14 */ u32 mRefCount; /* 0x18 */ ARCHandle mHandle; /* 0x34 */ s32 mDvdEntryNum; // gets put into first param of DVDFastOpen - /* 0x38 */ s32 mNandFile; // pointer to NANDFileInfo (was allocated) + /* 0x38 */ s32 mNandFile; // pointer to NANDFileInfo (was allocated) /* 0x3C */ nw4r::ut::Node mLink; + public: /* 804935f0 */ virtual ~Archive(); + public: /* 80493580 */ Archive(); - /* 80493660 */ void initHandle(void* data, MountType mountType); - /* 804936d0 */ static Archive* findArchive(void* data); - /* 80493760 */ static Archive* findArchive(NANDFileInfo* file); - /* 804937f0 */ static void appendList(Archive*); // prob private - /* 80493850 */ static void removeList(Archive*); - /* 80493860 */ static Archive* mount(void* data, Heap* heap, s32 align); - /* 80493950 */ static Archive* mountFST(void* data, Heap* heap, s32 align); - /* 80493a40 */ static Archive* mountNandFile(NANDFileInfo* , Heap* heap, s32 align); - /* 80493ac0 */ static Archive* loadFST(const char* fileName, Heap* heap, s32 align); + /* 80493660 */ void initHandle(void *data, MountType mountType); + /* 804936d0 */ static Archive *findArchive(void *data); + /* 80493760 */ static Archive *findArchive(NANDFileInfo *file); + /* 804937f0 */ static void appendList(Archive *); // prob private + /* 80493850 */ static void removeList(Archive *); + /* 80493860 */ static Archive *mount(void *data, Heap *heap, s32 align); + /* 80493950 */ static Archive *mountFST(void *data, Heap *heap, s32 align); + /* 80493a40 */ static Archive *mountNandFile(NANDFileInfo *, Heap *heap, s32 align); + /* 80493ac0 */ static Archive *loadFST(const char *fileName, Heap *heap, s32 align); /* 80493b80 */ void unmount(); - /* 80493c20 */ u32 getFile(const char* name, FileInfo* out); - /* 80493cf0 */ long convertPathToEntryID(const char* path); - /* 80493d00 */ void* getFileFast(long entryId, FileInfo* fileinfo); - /* 80493dc0 */ void* getFileFast(long entryId, Heap* heap, s32 align); + /* 80493c20 */ u32 getFile(const char *name, FileInfo *out); + /* 80493cf0 */ long convertPathToEntryID(const char *path); + /* 80493d00 */ void *getFileFast(long entryId, FileInfo *fileinfo); + /* 80493dc0 */ void *getFileFast(long entryId, Heap *heap, s32 align); /* 80493f30 */ s32 countFile(); - /* 804940c0 */ void searchInside(FileCallbackFunc, void*); - /* 80494140 */ static void* loadFromNAND(NANDFileInfo* fileInfo, Heap* heap, s32 align); + /* 804940c0 */ void searchInside(FileCallbackFunc, void *); + /* 80494140 */ static void *loadFromNAND(NANDFileInfo *fileInfo, Heap *heap, s32 align); public: /* 80576728 */ static bool sIsArchiveListInitialized; /* 80673ac8 */ static nw4r::ut::List sArchiveList; }; -/* 80493f10 */ void countFileCallbackFunc(void*, void*, const ARCDirEntry*, const char*); -/* 80493f70 */ void searchInsideWithPath( - Archive* arc, ARCHandle* handle, FileCallbackFunc, void*, char* outPath, u32 -); +/* 80493f10 */ void countFileCallbackFunc(void *, void *, const ARCDirEntry *, const char *); +/* 80493f70 */ void searchInsideWithPath(Archive *arc, ARCHandle *handle, FileCallbackFunc, void *, char *outPath, u32); } // namespace EGG diff --git a/include/egg/core/eggAssertHeap.h b/include/egg/core/eggAssertHeap.h index 1528edb1..22a642f6 100644 --- a/include/egg/core/eggAssertHeap.h +++ b/include/egg/core/eggAssertHeap.h @@ -1,7 +1,8 @@ #pragma once -#include "types.h" #include "egg/core/eggHeap.h" +#include + namespace EGG { @@ -10,18 +11,19 @@ public: // vtable at 0x0 | 8056ea00 /* vt 0x08 | 804963e0 */ virtual ~AssertHeap(); /* vt 0x0C | 80496820 */ virtual eHeapKind getHeapKind() const; - /* vt 0x14 | 804966b0 */ virtual void* alloc(u32 size, s32 align); - /* vt 0x18 | 80496710 */ virtual void free(void* block); - /* vt 0x1C | 80496620 */ virtual void destroy(); - /* vt 0x20 | 80496760 */ virtual u32 resizeForMBlock(void* block, u32 size); + /* vt 0x14 | 804966b0 */ virtual void *alloc(u32 size, s32 align); + /* vt 0x18 | 80496710 */ virtual void free(void *block); + /* vt 0x1C | 80496620 */ virtual void destroy(); + /* vt 0x20 | 80496760 */ virtual u32 resizeForMBlock(void *block, u32 size); /* vt 0x24 | 80496770 */ virtual u32 getTotalFreeSize(); - /* vt 0x28 | 80496780 */ virtual u32 getAllocatableSize(s32 align); + /* vt 0x28 | 80496780 */ virtual u32 getAllocatableSize(s32 align); /* vt 0x2C | 80496790 */ virtual u32 adjust(); + public: - /* 804963a0 */ AssertHeap(MEMiHeapHead* heapHead); - /* 80496460 */ static AssertHeap* create(void* block, u32 size, u16 attr); - /* 80496530 */ static AssertHeap* create(u32 size, Heap* heap); + /* 804963a0 */ AssertHeap(MEMiHeapHead *heapHead); + /* 80496460 */ static AssertHeap *create(void *block, u32 size, u16 attr); + /* 80496530 */ static AssertHeap *create(u32 size, Heap *heap); /* 80496810 */ static u32 getSize(); // returns 0x7C }; -} // namespace EGG \ No newline at end of file +} // namespace EGG diff --git a/include/egg/core/eggAsyncDisplay.h b/include/egg/core/eggAsyncDisplay.h index cfe11378..5349ad27 100644 --- a/include/egg/core/eggAsyncDisplay.h +++ b/include/egg/core/eggAsyncDisplay.h @@ -1,11 +1,11 @@ #pragma once -#include "types.h" #include "egg/core/eggDisplay.h" +#include + + +namespace EGG { -namespace EGG -{ - class AsyncDisplay : public Display { public: // vtable at 0x04 | 8056eb60 @@ -14,12 +14,13 @@ public: /* vt 0x14 | 804980c0 */ virtual void endFrame(); /* vt 0x18 | 804982d0 */ virtual u32 getTickPerFrame(); /* vt 0x1C | 80498100 */ virtual void preVRetrace(); + public: - /* 0x2C */ char field_0x2C[0x60-0x2C]; + /* 0x2C */ char field_0x2C[0x60 - 0x2C]; /* 0x60 */ OSThreadQueue mThreadQueue; /* 0x68 */ OSMessageQueue mMesgQueue; /* 0x88 */ OSMessage mMesg; - /* 0x8C */ char field_0x8C[0x98-0x8C]; + /* 0x8C */ char field_0x8C[0x98 - 0x8C]; /* 0x98 */ s32 field_0x98; /* 0x9C */ f32 field_0x9C; /* 0xA0 */ f32 field_0xA0; @@ -30,6 +31,7 @@ public: /* 0xB4 */ s32 field_0xB4; /* 0xB8 */ u32 field_0xB8; /* 0xBC */ u32 field_0xBC; + public: /* 80497e40 */ AsyncDisplay(u8 maxRetrace); /* 80497ec0 */ void calcS(); @@ -42,7 +44,7 @@ public: #ifdef __cplusplus extern "C" { #endif - /* 80576790 */ static EGG::AsyncDisplay* spSelector; +/* 80576790 */ static EGG::AsyncDisplay *spSelector; #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/include/egg/core/eggColorFader.h b/include/egg/core/eggColorFader.h index fae8a4b1..9f23f692 100644 --- a/include/egg/core/eggColorFader.h +++ b/include/egg/core/eggColorFader.h @@ -1,12 +1,12 @@ #pragma once -#include "types.h" -#include "nw4r/ut/Color.h" #include "egg/core/eggFader.h" #include "egg/prim/eggBitFlag.h" +#include "nw4r/ut/Color.h" +#include -namespace EGG -{ + +namespace EGG { class ColorFader : public Fader { public: @@ -18,6 +18,7 @@ public: /* vt 0x18 | 80497ab0 */ virtual bool calc(); /* vt 0x1C | 80497ba0 */ virtual bool draw(); /* vt 0x1C | 80131b70 */ virtual ~ColorFader(); + public: /* 0x04 */ EStatus mStatus; /* 0x08 */ TBitFlag mFlags; @@ -29,10 +30,9 @@ public: /* 0x18 */ f32 mStartY; /* 0x1C */ f32 mEndX; /* 0x20 */ f32 mEndY; + public: - /* 80497930 */ ColorFader( - f32 startX, f32 startY, f32 lengthX, f32 lengthY, - nw4r::ut::Color color,EStatus status); + /* 80497930 */ ColorFader(f32 startX, f32 startY, f32 lengthX, f32 lengthY, nw4r::ut::Color color, EStatus status); /* 804979e0 */ void setFrame(u16 frame); /* 804979f0 */ void setColor(nw4r::ut::Color); }; diff --git a/include/egg/core/eggController.h b/include/egg/core/eggController.h index adb42039..d3a2a2e9 100644 --- a/include/egg/core/eggController.h +++ b/include/egg/core/eggController.h @@ -1,27 +1,26 @@ #pragma once -#include "types.h" +#include -#include "egg/math/eggMatrix.h" #include "egg/math/eggMath.h" +#include "egg/math/eggMatrix.h" #include "egg/math/eggVector.h" #include "egg/prim/eggBitFlag.h" #include "egg/prim/eggBuffer.h" #include "rvl/PAD.h" -namespace EGG -{ + +namespace EGG { class ControllerRumbleMgr; - // To Be Filled out -enum eCoreDevType { -}; +enum eCoreDevType {}; class CoreStatus { public: /* 0x00 */ u8 field_0x00[0xF0]; + public: /* 80498f90 */ void init(); /* 80498fa0 */ u32 getFSStickButton() const; @@ -40,8 +39,9 @@ public: /* vt 0x24 | 800599e0 */ virtual bool isReleased(); /* vt 0x28 | 80059840 */ virtual bool isAllPressed(); /* vt 0x2C | 80059a80 */ virtual bool isNotPressed(); - /* vt 0x30 | 80499660 */ virtual void beginFrame(void* padStatus); // Really needs to be PADStatus + /* vt 0x30 | 80499660 */ virtual void beginFrame(void *padStatus); // Really needs to be PADStatus /* vt 0x34 | 80499a60 */ virtual void endFrame(); + public: /* 0x004 */ s32 mChannelID; /* 0x008 */ u32 mButtonHeld; // these fields may need a slight amount of work @@ -59,7 +59,7 @@ public: /* 0xf40 */ s32 mMotorFrameDuration; /* 0xf44 */ u8 mMotorPatternLength; /* 0xf45 */ u8 mMotorPatternPos; - /* 0xf48 */ ControllerRumbleMgr* mRumbleMgr; + /* 0xf48 */ ControllerRumbleMgr *mRumbleMgr; /* 0xf4c */ Matrix34f mPostureMatrix; /* 0xf7c */ Matrix34f mPostureMatrixPrev; /* 0xfac */ TBitFlag mAccelFlags; @@ -68,7 +68,8 @@ public: /* 0xfb8 */ s32 mAccelFrameTimeY; /* 0xfbc */ s32 mAccelFrameTimeZ; /* 0xfc0 */ f32 mMaxAccelDiff; - /* 0xfc4 */ Vector3f mPrevAccel; + /* 0xfc4 */ Vector3f mPrevAccel; + public: /* 80499050 */ CoreController(); /* 804990b0 */ void sceneReset(); @@ -77,10 +78,10 @@ public: /* 804991a0 */ void startMotor(); /* 804991b0 */ void stopMotor(); /* 804991c0 */ void createRumberMgr(u8); - /* 80499220 */ void startPatternRumble(const char*, int, bool); + /* 80499220 */ void startPatternRumble(const char *, int, bool); /* 80499240 */ void stopRumbleMgr(); - /* 80499260 */ CoreStatus* getCoreStatus(s32 idx); - /* 8056ebf8 */ void calc_posture_matrix(Matrix34f& mat, bool); + /* 80499260 */ CoreStatus *getCoreStatus(s32 idx); + /* 8056ebf8 */ void calc_posture_matrix(Matrix34f &mat, bool); /* 80499ac0 */ f32 getFreeStickX(); /* 80499ae0 */ f32 getFreeStickY(); }; @@ -88,25 +89,26 @@ public: class NullController : public CoreController { public: // idk this has NO effect on anything - u8 unk[0x80674c00-0x80674b10]; + u8 unk[0x80674c00 - 0x80674b10]; }; class ControllerRumbleUnit { public: // 0x00 vtable | 8056ebb4 /* vt 0x08 | 8049a8e0 */ virtual ~ControllerRumbleUnit(); + public: - /* 0x04 */ char* mPattern; - /* 0x08 */ char* mPatternPos; - /* 0x0C */ s32 mTimer; // guess - /* 0x10 */ f32 mRampUp; // guess - /* 0x14 */ f32 mIntesity; // guess + /* 0x04 */ char *mPattern; + /* 0x08 */ char *mPatternPos; + /* 0x0C */ s32 mTimer; // guess + /* 0x10 */ f32 mRampUp; // guess + /* 0x14 */ f32 mIntesity; // guess /* 0x18 */ TBitFlag mFlag; /* 0x1C */ nw4r::ut::Node mNode; - /* 0x24 */ u32 field_0x24; // could just be part of the node (List) + /* 0x24 */ u32 field_0x24; // could just be part of the node (List) public: /* 8049a3b0 */ void init(); - /* 8049a3e0 */ void startPattern(const char* patter, int); + /* 8049a3e0 */ void startPattern(const char *patter, int); /* 8049a440 */ f32 calc(); }; @@ -114,24 +116,26 @@ class ControllerRumbleMgr { public: // 0x00 vtable | 8056eba8 /* vt 0x08 | 8049a8a0 */ virtual ~ControllerRumbleMgr(); + public: /* 0x04 */ nw4r::ut::List mActiveUnitList; /* 0x10 */ nw4r::ut::List mInactiveUnitList; - /* 0x1C */ CoreController* mController; + /* 0x1C */ CoreController *mController; + public: /* 8049a530 */ ControllerRumbleMgr(); - /* 8049a590 */ void createUnit(u8 numUnits, CoreController* controller); + /* 8049a590 */ void createUnit(u8 numUnits, CoreController *controller); /* 8049a620 */ void stop(); /* 8049a690 */ void calc(); - /* 8049a7a0 */ void startPattern(const char* pattern, int, bool); - /* 8049a7f0 */ ControllerRumbleUnit* getUnitFromList(bool bGrabActive); + /* 8049a7a0 */ void startPattern(const char *pattern, int, bool); + /* 8049a7f0 */ ControllerRumbleUnit *getUnitFromList(bool bGrabActive); }; class CoreControllerMgr { public: struct T__Disposer { Disposer mDisposer; /* vt 0x08 | 80499b00 */ virtual ~T__Disposer(); - /* 805767ac */ static T__Disposer* sStaticDisposer; + /* 805767ac */ static T__Disposer *sStaticDisposer; }; // Disposer Vtable: 8056ec40 /* 0x0000 */ T__Disposer mDisposer; // for the static T__Disposer @@ -139,33 +143,34 @@ public: // 0x0010 vtable | 8056ebf8 /* vt 0x08 | 8049a130 */ void beginFrame(); /* vt 0x0C | 8049a1e0 */ void endFrame(); + public: - /* 0x0014 */ TBuffer mControllers; + /* 0x0014 */ TBuffer mControllers; /* 0x0020 */ u8 field_0x20[0x10a4 - 0x0020]; /* 0x10A4 */ TBuffer mDevTypes; /* 0x10b0 */ u8 field_0x10B0[0x10e0 - 0x10b0]; + public: /* 80499b80 */ static void createInstance(); /* 80499bd0 */ static void deleteInstance(); /* 80499cd0 */ void connectCallback(s32, s32); /* 80499d10 */ CoreControllerMgr(); + public: - /* 805767a8 */ static CoreControllerMgr* sInstance; - /* 805767b0 */ static CoreController* (*sCoreControllerFactory)(); - /* 805767b4 */ static void (*sConnectCallback)(s32, s32); + /* 805767a8 */ static CoreControllerMgr *sInstance; + /* 805767b0 */ static CoreController *(*sCoreControllerFactory)(); + /* 805767b4 */ static void (*sConnectCallback)(s32, s32); /* 805767b8 */ static bool sUnk; // /* 805767bc */ static sAllocator; // defined in cpp file - -// Other Stuff thats autogen (buffers/sinit/etc) -// /* 8049a950 */ void TBuffer::allocate(int, int); -// /* 8049a9a0 */ void TBuffer::allocate(int, Heap*, int); -// /* 8049aa20 */ void TBuffer::onAllocate(Heap*); -// /* 8049aa30 */ void TBuffer::allocate(int, int); -// /* 8049aa80 */ void TBuffer::allocate(int, Heap*, int); -// /* 8049ab00 */ void TBuffer::onAllocate(Heap*); -// /* 8049ab10 */ void sinit(); // NULL CONTROLLER - + // Other Stuff thats autogen (buffers/sinit/etc) + // /* 8049a950 */ void TBuffer::allocate(int, int); + // /* 8049a9a0 */ void TBuffer::allocate(int, Heap*, int); + // /* 8049aa20 */ void TBuffer::onAllocate(Heap*); + // /* 8049aa30 */ void TBuffer::allocate(int, int); + // /* 8049aa80 */ void TBuffer::allocate(int, Heap*, int); + // /* 8049ab00 */ void TBuffer::onAllocate(Heap*); + // /* 8049ab10 */ void sinit(); // NULL CONTROLLER }; } // namespace EGG diff --git a/include/egg/core/eggDecomp.h b/include/egg/core/eggDecomp.h index 77975a41..aa98dadc 100644 --- a/include/egg/core/eggDecomp.h +++ b/include/egg/core/eggDecomp.h @@ -1,75 +1,82 @@ #pragma once -#include "types.h" #include "rvl/CX/cx.h" +#include + // NOTE: I put StreamDecomp stuff here. im unsure of the correct place -namespace EGG -{ +namespace EGG { class StreamDecomp { public: - /* vt 0x08 */ virtual bool init(void* dest, u32 maxCompressedSize); - /* vt 0x0C */ virtual bool decomp(const void* src, u32 len); + /* vt 0x08 */ virtual bool init(void *dest, u32 maxCompressedSize); + /* vt 0x0C */ virtual bool decomp(const void *src, u32 len); /* vt 0x10 */ virtual u32 getHeaderSize(); - /* vt 0x14 */ virtual u32 getUncompressedSize(const void* src); + /* vt 0x14 */ virtual u32 getUncompressedSize(const void *src); + public: - /* 0x04 */ void* dest; + /* 0x04 */ void *dest; /* 0x08 */ u32 maxCompressedSize; }; class StreamDecompLZ : public StreamDecomp { public: - /* vt 0x08 | 80494c80 */ virtual bool init(void* dest, u32 maxCompressedSize); - /* vt 0x0C | 80494cb0 */ virtual bool decomp(const void* src, u32 len); + /* vt 0x08 | 80494c80 */ virtual bool init(void *dest, u32 maxCompressedSize); + /* vt 0x0C | 80494cb0 */ virtual bool decomp(const void *src, u32 len); /* vt 0x10 | 804952c0 */ virtual u32 getHeaderSize(); - /* vt 0x14 | 804952b0 */ virtual u32 getUncompressedSize(const void* src); + /* vt 0x14 | 804952b0 */ virtual u32 getUncompressedSize(const void *src); + public: /* 0x0C */ CXUncompContextLZ context; }; class StreamDecompRL : public StreamDecomp { public: - /* vt 0x08 | 80494ce0 */ virtual bool init(void* dest, u32 maxCompressedSize); - /* vt 0x0C | 80494d10 */ virtual bool decomp(const void* src, u32 len); + /* vt 0x08 | 80494ce0 */ virtual bool init(void *dest, u32 maxCompressedSize); + /* vt 0x0C | 80494d10 */ virtual bool decomp(const void *src, u32 len); /* vt 0x10 | 804952a0 */ virtual u32 getHeaderSize(); - /* vt 0x14 | 80495290 */ virtual u32 getUncompressedSize(const void* src); + /* vt 0x14 | 80495290 */ virtual u32 getUncompressedSize(const void *src); + public: /* 0x0C */ CXUncompContextRL context; }; class StreamDecompLH : public StreamDecomp { public: - /* vt 0x08 | 80494d40 */ virtual bool init(void* dest, u32 maxCompressedSize); - /* vt 0x0C | 80494d70 */ virtual bool decomp(const void* src, u32 len); + /* vt 0x08 | 80494d40 */ virtual bool init(void *dest, u32 maxCompressedSize); + /* vt 0x0C | 80494d70 */ virtual bool decomp(const void *src, u32 len); /* vt 0x10 | 80495280 */ virtual u32 getHeaderSize(); - /* vt 0x14 | 80495270 */ virtual u32 getUncompressedSize(const void* src); + /* vt 0x14 | 80495270 */ virtual u32 getUncompressedSize(const void *src); + public: /* 0x0C */ CXUncompContextLH context; }; class StreamDecompLRC : public StreamDecomp { public: - /* vt 0x08 | 80494da0 */ virtual bool init(void* dest, u32 maxCompressedSize); - /* vt 0x0C | 80494dd0 */ virtual bool decomp(const void* src, u32 len); + /* vt 0x08 | 80494da0 */ virtual bool init(void *dest, u32 maxCompressedSize); + /* vt 0x0C | 80494dd0 */ virtual bool decomp(const void *src, u32 len); /* vt 0x10 | 80495260 */ virtual u32 getHeaderSize(); - /* vt 0x14 | 80495250 */ virtual u32 getUncompressedSize(const void* src); + /* vt 0x14 | 80495250 */ virtual u32 getUncompressedSize(const void *src); + public: /* 0x0C */ CXUncompContextLRC context; }; class StreamDecompSZS : public StreamDecomp { public: - /* vt 0x08 | 804951d0 */ virtual bool init(void* dest, u32 maxCompressedSize); - /* vt 0x0C | 80495200 */ virtual bool decomp(const void* src, u32 len); + /* vt 0x08 | 804951d0 */ virtual bool init(void *dest, u32 maxCompressedSize); + /* vt 0x0C | 80495200 */ virtual bool decomp(const void *src, u32 len); /* vt 0x10 | 80495240 */ virtual u32 getHeaderSize(); - /* vt 0x14 | 80495230 */ virtual u32 getUncompressedSize(const void* src); + /* vt 0x14 | 80495230 */ virtual u32 getUncompressedSize(const void *src); + private: // NON-OFFICIAL struct SZSCompContext { u8 _[0x18]; - /* 80494e00 */ static u32 getUncompressedSize(const void* src); + /* 80494e00 */ static u32 getUncompressedSize(const void *src); /* 80494e30 */ void init(u32 maxCompSize); /* 80494e60 */ static int readSzsHeader(/* unk params*/); - /* 80494f60 */ void* decomp(const void* src, u32 len); + /* 80494f60 */ void *decomp(const void *src, u32 len); }; + public: /* 0x0C */ SZSCompContext context; }; diff --git a/include/egg/core/eggDisplay.h b/include/egg/core/eggDisplay.h index e86db9e7..fa771035 100644 --- a/include/egg/core/eggDisplay.h +++ b/include/egg/core/eggDisplay.h @@ -1,23 +1,21 @@ #pragma once - -#include "types.h" -#include "rvl/VI.h" -#include "nw4r/ut/Color.h" -#include "egg/prim/eggBitFlag.h" #include "egg/core/eggSystem.h" // for BaseSystem config #include "egg/core/eggVideo.h" - +#include "egg/prim/eggBitFlag.h" +#include "nw4r/ut/Color.h" +#include "rvl/VI.h" +#include /* 80497530 */ // void PreRetraceCallback(void); -namespace EGG -{ +namespace EGG { class Display { public: enum EFlagBits { mFlag_SetClear, mFlag_WaitForRetrace }; /* 0x00*/ TBitFlag mFlag; + public: // vtable at 0x04 | 8056eac8 /* vt 0x08 | 80497600 */ virtual void beginFrame(); @@ -26,6 +24,7 @@ public: /* vt 0x14 | 804976e0 */ virtual void endFrame(); /* vt 0x18 | 804975f0 */ virtual u32 getTickPerFrame(); /* vt 0x1C | 804976f0 */ virtual void preVRetrace(); + public: /* 0x08 */ u8 mMaxRetraces; enum EScreenStateBits { mScreenStateFlag_SetBlack }; @@ -38,11 +37,13 @@ public: /* 0x20 */ s32 mLastTick; // new /* 0x24 */ s32 mDeltaTick; /* 0x28 */ f32 mFrequency; + public: /* 80497570 */ Display(u8 maxRetrace); /* 804977d0 */ void copyEFBtoXFB(); /* 80497870 */ void calcFrequency(); /* inline */ void setBlack(bool b) {} + public: /* 80497900 */ static u32 sTickPeriod; }; diff --git a/include/egg/core/eggDisposer.h b/include/egg/core/eggDisposer.h index 68a48176..adf6ebd3 100644 --- a/include/egg/core/eggDisposer.h +++ b/include/egg/core/eggDisposer.h @@ -1,34 +1,33 @@ #pragma once -// This file was adapted from https://github.com/riidefi/mkw/blob/master/source/egg/core/eggDisposer.hpp +// This file was adapted from https://github.com/riidefi/mkw/blob/master/source/egg/core/eggDisposer.hpp #include "nw4r/ut/List.h" -#include "types.h" +#include namespace EGG { class Heap; class Disposer : private NonCopyable { friend class Heap; + protected: /* vt 0x08 | 80496890 */ virtual ~Disposer(); /* 80496830 */ Disposer(); + public: - enum eLifetime { - LIFETIME_UNMANAGED, - LIFETIME_HEAP_GC - }; + enum eLifetime { LIFETIME_UNMANAGED, LIFETIME_HEAP_GC }; inline eLifetime getLifetime() const { return mContainHeap != nullptr ? LIFETIME_HEAP_GC : LIFETIME_UNMANAGED; } private: - /* 0x04 */ Heap* mContainHeap; + /* 0x04 */ Heap *mContainHeap; /* 0x08 */ nw4r::ut::Node mList; }; -// TODO: Add singleton define for the T__Disposer stuff. -// see https://github.com/open-ead/sead/blob/master/include/heap/seadDisposer.h +// TODO: Add singleton define for the T__Disposer stuff. +// see https://github.com/open-ead/sead/blob/master/include/heap/seadDisposer.h // for reference -}; \ No newline at end of file +}; // namespace EGG diff --git a/include/egg/core/eggDvdFile.h b/include/egg/core/eggDvdFile.h index 4295f41a..07c8afab 100644 --- a/include/egg/core/eggDvdFile.h +++ b/include/egg/core/eggDvdFile.h @@ -1,44 +1,48 @@ #pragma once -#include "types.h" -#include "rvl/OS.h" -#include "rvl/DVD.h" -#include "nw4r/ut/List.h" #include "egg/core/eggFile.h" +#include "nw4r/ut/List.h" +#include "rvl/DVD.h" +#include "rvl/OS.h" +#include -namespace EGG -{ + +namespace EGG { class DvdFile : public File { public: - struct FileInfo : public DVDFileInfo { - DvdFile* dvdFile; - }; + struct FileInfo : public DVDFileInfo { + DvdFile *dvdFile; + }; + public: /* 0x08 */ OSMutex mMutex; - /* 0x20 */ OSMutex mMutexUnused; + /* 0x20 */ OSMutex mMutexUnused; /* 0x38 */ u32 field_0x38; /* 0x3c */ FileInfo mFileInfo; /* 0x7c */ OSMessageQueue mMsgQueueUnsued; /* 0x9c */ OSMessage mMsgUnused; /* 0xa0 */ OSMessageQueue mMsgQueue; /* 0xc0 */ OSMessage mMsg; - /* 0xc4 */ OSThread* mThread; + /* 0xc4 */ OSThread *mThread; /* 0xc8 */ nw4r::ut::Node mNode; + public: /* vt 0x08 | 804942f0 */ virtual ~DvdFile(); - /* vt 0x0C | 80494450 */ virtual bool open(const char* path); + /* vt 0x0C | 80494450 */ virtual bool open(const char *path); /* vt 0x10 | 804944b0 */ virtual void close(); - /* vt 0x14 | 80494510 */ virtual s32 readData(void* buffer, s32 length, s32 offset); - /* vt 0x18 | 804945e0 */ virtual s32 writeData(void* buffer, s32 length, s32 offset); + /* vt 0x14 | 80494510 */ virtual s32 readData(void *buffer, s32 length, s32 offset); + /* vt 0x18 | 804945e0 */ virtual s32 writeData(void *buffer, s32 length, s32 offset); /* vt 0x1C | 80494670 */ virtual u32 getFileSize(); /* vt 0x20 | 804943d0 */ virtual bool open(s32 entryNum); - /* vt 0x24 | 804944a0 */ virtual bool open(const char* path, void*); + /* vt 0x24 | 804944a0 */ virtual bool open(const char *path, void *); + public: /* 804942a0 */ DvdFile(); /* 80494360 */ void initiate(); /* 804945f0 */ s32 sync(); - /* 80494650 */ static void doneProcess(s32 result, DVDFileInfo* fileInfo); + /* 80494650 */ static void doneProcess(s32 result, DVDFileInfo *fileInfo); + public: /* 80576730 */ static bool sIsInitialized; /* 80673ad8 */ static nw4r::ut::List sDvdList; diff --git a/include/egg/core/eggDvdRipper.h b/include/egg/core/eggDvdRipper.h index 6a36ffdc..fdcae89f 100644 --- a/include/egg/core/eggDvdRipper.h +++ b/include/egg/core/eggDvdRipper.h @@ -1,40 +1,29 @@ #pragma once -#include "types.h" -#include "egg/core/eggHeap.h" -#include "egg/core/eggDvdFile.h" #include "egg/core/eggDecomp.h" +#include "egg/core/eggDvdFile.h" +#include "egg/core/eggHeap.h" +#include + + +namespace EGG { -namespace EGG -{ - class DvdRipper { public: - enum EAllocDirection { - ALLOC_CIR_PAD, - ALLOC_DIR_TOP, - ALLOC_DIR_BOTTOM - }; + enum EAllocDirection { ALLOC_CIR_PAD, ALLOC_DIR_TOP, ALLOC_DIR_BOTTOM }; + public: - /* 80494680 */ static u8* loadToMainRAM( s32 entryNum, - u8* dst, Heap* heap, EAllocDirection allocDir, - u32 offset, u32* amountRead, u32* fileSize - ); - /* 80494730 */ static u8* loadToMainRAM( const char* path, - u8* dst, Heap* heap, EAllocDirection allocDir, - u32 offset, u32* amountRead, u32* fileSize - ); - /* 804947e0 */ static u8* loadToMainRAM( DvdFile* file, - u8* dst, Heap* heap, EAllocDirection allocDir, - u32 offset, u32* amountRead, u32* fileSize - ); - /* 804949b0 */ static void* loadToMainRAMDecomp( DvdFile* file, - StreamDecomp* decompressor, u8* dst, Heap* heap, - EAllocDirection allocDir, u32 offset, s32 size, - u32 maxChunkSize, u32* amountRead, u32* fileSize - ); + /* 80494680 */ static u8 *loadToMainRAM(s32 entryNum, u8 *dst, Heap *heap, EAllocDirection allocDir, u32 offset, + u32 *amountRead, u32 *fileSize); + /* 80494730 */ static u8 *loadToMainRAM(const char *path, u8 *dst, Heap *heap, EAllocDirection allocDir, u32 offset, + u32 *amountRead, u32 *fileSize); + /* 804947e0 */ static u8 *loadToMainRAM(DvdFile *file, u8 *dst, Heap *heap, EAllocDirection allocDir, u32 offset, + u32 *amountRead, u32 *fileSize); + /* 804949b0 */ static void *loadToMainRAMDecomp(DvdFile *file, StreamDecomp *decompressor, u8 *dst, Heap *heap, + EAllocDirection allocDir, u32 offset, s32 size, u32 maxChunkSize, u32 *amountRead, u32 *fileSize); + public: - /* 80574ed0 */ static bool sErrorRetry; + /* 80574ed0 */ static bool sErrorRetry; /* */ // static sCallback; }; diff --git a/include/egg/core/eggExpHeap.h b/include/egg/core/eggExpHeap.h index c7dcf96d..d0cdedcf 100644 --- a/include/egg/core/eggExpHeap.h +++ b/include/egg/core/eggExpHeap.h @@ -1,29 +1,30 @@ #pragma once -#include "types.h" #include "egg/core/eggHeap.h" +#include + + +namespace EGG { -namespace EGG -{ - class ExpHeap : public Heap { public: // vtable at 0x0 | 8056e980 /* vt 0x08 | 80495af0 */ virtual ~ExpHeap(); /* vt 0x0C | 80495f90 */ virtual eHeapKind getHeapKind() const; - /* vt 0x14 | 80495d90 */ virtual void* alloc(u32 size, s32 align); - /* vt 0x18 | 80495e50 */ virtual void free(void* block); - /* vt 0x1C | 80495d00 */ virtual void destroy(); - /* vt 0x20 | 80495ec0 */ virtual u32 resizeForMBlock(void* block, u32 size); + /* vt 0x14 | 80495d90 */ virtual void *alloc(u32 size, s32 align); + /* vt 0x18 | 80495e50 */ virtual void free(void *block); + /* vt 0x1C | 80495d00 */ virtual void destroy(); + /* vt 0x20 | 80495ec0 */ virtual u32 resizeForMBlock(void *block, u32 size); /* vt 0x24 | 80495ed0 */ virtual u32 getTotalFreeSize(); - /* vt 0x28 | 80495ee0 */ virtual u32 getAllocatableSize(s32 align); + /* vt 0x28 | 80495ee0 */ virtual u32 getAllocatableSize(s32 align); /* vt 0x2C | 80495f00 */ virtual u32 adjust(); + public: - /* 80495ab0 */ ExpHeap(MEMiHeapHead* heapHead); - /* 80495b70 */ static ExpHeap* create(void* block, u32 size, u16 attr); - /* 80495c30 */ static ExpHeap* create(u32 size, Heap* heap, u16 attr); + /* 80495ab0 */ ExpHeap(MEMiHeapHead *heapHead); + /* 80495b70 */ static ExpHeap *create(void *block, u32 size, u16 attr); + /* 80495c30 */ static ExpHeap *create(u32 size, Heap *heap, u16 attr); /* 80495d00 */ void setGroupID(u16 groupId); - /* 80495f80 */ u32 getSizeForMBlock(const void* block); + /* 80495f80 */ u32 getSizeForMBlock(const void *block); }; } // namespace EGG diff --git a/include/egg/core/eggFader.h b/include/egg/core/eggFader.h index 581bf249..844c5bf3 100644 --- a/include/egg/core/eggFader.h +++ b/include/egg/core/eggFader.h @@ -1,9 +1,8 @@ #pragma once -#include "types.h" +#include -namespace EGG -{ +namespace EGG { class Fader { public: @@ -13,6 +12,7 @@ public: STATUS_FADE_IN, STATUS_FADE_OUT, }; + public: // vtable at 0x00 /* vt 0x08 | 00000000 */ virtual void setStatus(EStatus) = 0; diff --git a/include/egg/core/eggFile.h b/include/egg/core/eggFile.h index 8a0a70c3..c8b97648 100644 --- a/include/egg/core/eggFile.h +++ b/include/egg/core/eggFile.h @@ -1,24 +1,25 @@ #pragma once -#include "types.h" +#include + +namespace EGG { -namespace EGG -{ - class File { public: File() : mIsOpen(false) {} + public: /* vt 0x08 */ virtual ~File() {} - /* vt 0x0C */ virtual bool open(const char* path) = 0; + /* vt 0x0C */ virtual bool open(const char *path) = 0; /* vt 0x10 */ virtual void close() = 0; - /* vt 0x14 */ virtual s32 readData(void* buffer, s32 length, s32 offset) = 0; - /* vt 0x18 */ virtual s32 writeData(const void* buffer, s32 length, s32 offset) = 0; + /* vt 0x14 */ virtual s32 readData(void *buffer, s32 length, s32 offset) = 0; + /* vt 0x18 */ virtual s32 writeData(const void *buffer, s32 length, s32 offset) = 0; /* vt 0x1C */ virtual u32 getFileSize() const = 0; /* 0x4 */ bool mIsOpen; - - private: u8 pad[3]; + +private: + u8 pad[3]; }; } // namespace EGG diff --git a/include/egg/core/eggFrmHeap.h b/include/egg/core/eggFrmHeap.h index 91791dd1..ff5a3b58 100644 --- a/include/egg/core/eggFrmHeap.h +++ b/include/egg/core/eggFrmHeap.h @@ -1,7 +1,8 @@ #pragma once -#include "types.h" #include "egg/core/eggHeap.h" +#include + namespace EGG { @@ -10,19 +11,20 @@ public: // vtable at 0x0 | 8056e9d0 /* vt 0x08 | 80495fe0 */ virtual ~FrmHeap(); /* vt 0x0C | 80496390 */ virtual eHeapKind getHeapKind() const; - /* vt 0x14 | 804961c0 */ virtual void* alloc(u32 size, s32 align); - /* vt 0x18 | 80496250 */ virtual void free(void* block); - /* vt 0x1C | 80496130 */ virtual void destroy(); - /* vt 0x20 | 804962b0 */ virtual u32 resizeForMBlock(void* block, u32 size); + /* vt 0x14 | 804961c0 */ virtual void *alloc(u32 size, s32 align); + /* vt 0x18 | 80496250 */ virtual void free(void *block); + /* vt 0x1C | 80496130 */ virtual void destroy(); + /* vt 0x20 | 804962b0 */ virtual u32 resizeForMBlock(void *block, u32 size); /* vt 0x24 | 804962c0 */ virtual u32 getTotalFreeSize(); - /* vt 0x28 | 804962e0 */ virtual u32 getAllocatableSize(s32 align); + /* vt 0x28 | 804962e0 */ virtual u32 getAllocatableSize(s32 align); /* vt 0x2C | 804962f0 */ virtual u32 adjust(); + public: - /* 80495fa0 */ FrmHeap(MEMiHeapHead* heapHead); - /* 80496060 */ static FrmHeap* create(void* block, u32 size, u16 attr); + /* 80495fa0 */ FrmHeap(MEMiHeapHead *heapHead); + /* 80496060 */ static FrmHeap *create(void *block, u32 size, u16 attr); /* 804962a0 */ void free(u32 flags); /* 80496370 */ void recordState(u32 id); // non official for now - /* 80496380 */ void freeState(u32 id); // non official for now + /* 80496380 */ void freeState(u32 id); // non official for now }; -} // namespace EGG \ No newline at end of file +} // namespace EGG diff --git a/include/egg/core/eggGraphicsFifo.h b/include/egg/core/eggGraphicsFifo.h index 497eaff9..335b5edc 100644 --- a/include/egg/core/eggGraphicsFifo.h +++ b/include/egg/core/eggGraphicsFifo.h @@ -1,24 +1,27 @@ #pragma once -#include "types.h" #include "egg/core/eggHeap.h" +#include + + +namespace EGG { -namespace EGG -{ - class GraphicsFifo { public: // vtable 0x00 | 8056eb80 /* vt 0x08 | 80498e90*/ virtual ~GraphicsFifo(); + public: - /* 0x04 */ void* mGxInitData; - /* 0x08 */ void* mBuffBase; - /* 0x0C */ u32 mBufSize; + /* 0x04 */ void *mGxInitData; + /* 0x08 */ void *mBuffBase; + /* 0x0C */ u32 mBufSize; + public: - /* 80498e20 */ static void create(u32 size, Heap* heap); - /* 80498f30 */ GraphicsFifo(u32 size, Heap* heap); + /* 80498e20 */ static void create(u32 size, Heap *heap); + /* 80498f30 */ GraphicsFifo(u32 size, Heap *heap); + public: - /* 80576798 */ static GraphicsFifo* sGraphicsFifo; + /* 80576798 */ static GraphicsFifo *sGraphicsFifo; /* 8057679c */ static bool sGpStatus[4]; }; diff --git a/include/egg/core/eggHeap.h b/include/egg/core/eggHeap.h index f9fbfa3c..4ee76380 100644 --- a/include/egg/core/eggHeap.h +++ b/include/egg/core/eggHeap.h @@ -2,14 +2,15 @@ // This file is ported from https://github.com/riidefi/mkw/blob/master/source/egg/core/eggHeap.hpp -#include "types.h" -#include "rvl/MEM.h" -#include "rvl/OS.h" #include "egg/core/eggAllocator.h" #include "egg/core/eggDisposer.h" #include "egg/core/eggThread.h" -#include "nw4r/ut/List.h" #include "egg/prim/eggBitFlag.h" +#include "nw4r/ut/List.h" +#include "rvl/MEM.h" +#include "rvl/OS.h" +#include + namespace EGG { @@ -17,133 +18,143 @@ namespace EGG { class Allocator; struct HeapAllocArg { - int userArg; // 00 - u32 size; // 04 - int align; // 08 - Heap* heap; // 0C heap to allocate in + int userArg; // 00 + u32 size; // 04 + int align; // 08 + Heap *heap; // 0C heap to allocate in - inline HeapAllocArg() : userArg(0), size(0), align(0), heap(nullptr) {} + inline HeapAllocArg() : userArg(0), size(0), align(0), heap(nullptr) {} }; -typedef void (*HeapAllocCallback)(HeapAllocArg& arg); +typedef void (*HeapAllocCallback)(HeapAllocArg &arg); struct HeapErrorArg { - const char* msg; - void* userdata; + const char *msg; + void *userdata; - inline HeapErrorArg() {} + inline HeapErrorArg() {} }; -typedef void (*ErrorCallback)(void*); +typedef void (*ErrorCallback)(void *); struct HeapFreeArg { - u32 arg1; // Idk the args - u32 arg2; + u32 arg1; // Idk the args + u32 arg2; }; -typedef void (*HeapFreeCallback)(void*); +typedef void (*HeapFreeCallback)(void *); -typedef void (*HeapCreateCallback)(void*); -typedef void (*HeapDestroyCallback)(void*); +typedef void (*HeapCreateCallback)(void *); +typedef void (*HeapDestroyCallback)(void *); class Heap : public Disposer { -public: - enum eHeapKind { - HEAP_KIND_NONE = 0, - HEAP_KIND_EXPANDED, - HEAP_KIND_FRAME, - HEAP_KIND_UNIT, - HEAP_KIND_ASSERT, - }; - // vtable at 0x0 | 8056e950 - /* vt 0x08 | 804954c0 */ virtual ~Heap(); - /* vt 0x0C | 00000000 */ virtual eHeapKind getHeapKind() const = 0; - /* vt 0x10 | 80495a40 */ virtual void initAllocator(Allocator* allocator, s32 align) = 0; - /* vt 0x14 | 00000000 */ virtual void* alloc(u32 size, s32 align) = 0; - /* vt 0x18 | 00000000 */ virtual void free(void* block) = 0; - /* vt 0x1C | 00000000 */ virtual void destroy() = 0; - /* vt 0x20 | 00000000 */ virtual u32 resizeForMBlock(void* block, u32 size) = 0; - /* vt 0x24 | 00000000 */ virtual u32 getTotalFreeSize() = 0; - /* vt 0x24 | 00000000 */ virtual u32 getAllocatableSize(s32 align) = 0; - /* vt 0x28 | 00000000 */ virtual u32 adjust() = 0; +public: + enum eHeapKind { + HEAP_KIND_NONE = 0, + HEAP_KIND_EXPANDED, + HEAP_KIND_FRAME, + HEAP_KIND_UNIT, + HEAP_KIND_ASSERT, + }; + // vtable at 0x0 | 8056e950 + /* vt 0x08 | 804954c0 */ virtual ~Heap(); + /* vt 0x0C | 00000000 */ virtual eHeapKind getHeapKind() const = 0; + /* vt 0x10 | 80495a40 */ virtual void initAllocator(Allocator *allocator, s32 align) = 0; + /* vt 0x14 | 00000000 */ virtual void *alloc(u32 size, s32 align) = 0; + /* vt 0x18 | 00000000 */ virtual void free(void *block) = 0; + /* vt 0x1C | 00000000 */ virtual void destroy() = 0; + /* vt 0x20 | 00000000 */ virtual u32 resizeForMBlock(void *block, u32 size) = 0; + /* vt 0x24 | 00000000 */ virtual u32 getTotalFreeSize() = 0; + /* vt 0x24 | 00000000 */ virtual u32 getAllocatableSize(s32 align) = 0; + /* vt 0x28 | 00000000 */ virtual u32 adjust() = 0; public: - inline bool isExpHeap() { return getHeapKind() == HEAP_KIND_EXPANDED; } -// inline Heap* getParentHeap() { return mParentHeap; } // not part of ss - inline void* getStartAddress() { return this; } - -public: - // members - /* 0x10 */ MEMiHeapHead* mHeapHandle; - /* 0x14 */ void* mParentBlock; - /* 0x18 */ TBitFlag mFlag; - /* 0x1C */ nw4r::ut::Node mNode; - /* 0x24 */ nw4r::ut::List mChildren; - /* 0x30 */ const char* mName; // set to "NoName" in ctor - - enum HeapFlag { - // tstDisableAllocation, enableAllocation, disableAllocation - // setBit__Q23EGG12TBitFlagFUc - HEAP_FLAG_LOCKED = (1 << 0) - }; + inline bool isExpHeap() { + return getHeapKind() == HEAP_KIND_EXPANDED; + } + // inline Heap* getParentHeap() { return mParentHeap; } // not part of ss + inline void *getStartAddress() { + return this; + } public: - /* 804953f0 */ static void initialize(); - /* 80495430 */ Heap(MEMiHeapHead* heapHandle); - /* 80495690 */ static Heap* findHeap(MEMiHeapHead* heapHandle); - /* 80495730 */ Heap* findParentHeap(); - /* 80495780 */ static Heap* findContainHeap(const void* memBlock); - /* 80495560 */ static void* alloc(u32 size, int align, Heap* heap); - /* 804957c0 */ static void free(void* memBlock, Heap* heap); - /* 80495830 */ void dispose(); - /* 804958a0 */ void dump(); - /* 804958b0 */ void dumpAll(); - /* 804959a0 */ Heap* becomeCurrentHeap(); - /* 80495a00 */ Heap* _becomeCurrentHeapWithoutLock(); - + // members + /* 0x10 */ MEMiHeapHead *mHeapHandle; + /* 0x14 */ void *mParentBlock; + /* 0x18 */ TBitFlag mFlag; + /* 0x1C */ nw4r::ut::Node mNode; + /* 0x24 */ nw4r::ut::List mChildren; + /* 0x30 */ const char *mName; // set to "NoName" in ctor + + enum HeapFlag { + // tstDisableAllocation, enableAllocation, disableAllocation + // setBit__Q23EGG12TBitFlagFUc + HEAP_FLAG_LOCKED = (1 << 0) + }; + public: - template static T* alloc(u32 count, Heap* heap, int align = 4) { - return reinterpret_cast(alloc(count * sizeof(T), align, heap)); - } - template static T* alloc(Heap* heap, int align = 4) { - return reinterpret_cast(alloc(sizeof(T), align, heap)); - } - + /* 804953f0 */ static void initialize(); + /* 80495430 */ Heap(MEMiHeapHead *heapHandle); + /* 80495690 */ static Heap *findHeap(MEMiHeapHead *heapHandle); + /* 80495730 */ Heap *findParentHeap(); + /* 80495780 */ static Heap *findContainHeap(const void *memBlock); + /* 80495560 */ static void *alloc(u32 size, int align, Heap *heap); + /* 804957c0 */ static void free(void *memBlock, Heap *heap); + /* 80495830 */ void dispose(); + /* 804958a0 */ void dump(); + /* 804958b0 */ void dumpAll(); + /* 804959a0 */ Heap *becomeCurrentHeap(); + /* 80495a00 */ Heap *_becomeCurrentHeapWithoutLock(); + public: - static void* addOffset(void* begin, u32 size) { - return reinterpret_cast(begin) + size; - } + template + static T *alloc(u32 count, Heap *heap, int align = 4) { + return reinterpret_cast(alloc(count * sizeof(T), align, heap)); + } + template + static T *alloc(Heap *heap, int align = 4) { + return reinterpret_cast(alloc(sizeof(T), align, heap)); + } - inline void appendDisposer(Disposer* disposer) { - nw4r::ut::List_Append(&mChildren, disposer); - } - inline void removeDisposer(Disposer* disposer) { - nw4r::ut::List_Remove(&mChildren, disposer); - } +public: + static void *addOffset(void *begin, u32 size) { + return reinterpret_cast(begin) + size; + } - inline MEMiHeapHead* getHeapHandle() { return mHeapHandle; } + inline void appendDisposer(Disposer *disposer) { + nw4r::ut::List_Append(&mChildren, disposer); + } + inline void removeDisposer(Disposer *disposer) { + nw4r::ut::List_Remove(&mChildren, disposer); + } - static inline Heap* getCurrentHeap() { return sCurrentHeap; } + inline MEMiHeapHead *getHeapHandle() { + return mHeapHandle; + } - inline int getArenaEnd() { - return (int)mHeapHandle->end; - } - /* 80673ae8 */ static nw4r::ut::List sHeapList; - /* 80673af8 */ static OSMutex sRootMutex; - /* 80576740 */ static Heap* sCurrentHeap; - /* 80576744 */ static int sIsHeapListInitialized; - /* 80576748 */ static Heap* sAllocatableHeap; - /* 8057674c */ static ErrorCallback sErrorCallback; - /* 80576750 */ static HeapAllocCallback sAllocCallback; - /* 80576754 */ static HeapFreeCallback sFreeCallback; - /* 80576758 */ static void* sErrorCallbackArg; - /* 8057675c */ static void* sAllocCallbackArg; - /* 80576760 */ static void* sFreeCallbackArg; - /* 80576764 */ static HeapCreateCallback sCreateCallback; - /* 80576764 */ static HeapDestroyCallback sDestroyCallback; + static inline Heap *getCurrentHeap() { + return sCurrentHeap; + } + + inline int getArenaEnd() { + return (int)mHeapHandle->end; + } + /* 80673ae8 */ static nw4r::ut::List sHeapList; + /* 80673af8 */ static OSMutex sRootMutex; + /* 80576740 */ static Heap *sCurrentHeap; + /* 80576744 */ static int sIsHeapListInitialized; + /* 80576748 */ static Heap *sAllocatableHeap; + /* 8057674c */ static ErrorCallback sErrorCallback; + /* 80576750 */ static HeapAllocCallback sAllocCallback; + /* 80576754 */ static HeapFreeCallback sFreeCallback; + /* 80576758 */ static void *sErrorCallbackArg; + /* 8057675c */ static void *sAllocCallbackArg; + /* 80576760 */ static void *sFreeCallbackArg; + /* 80576764 */ static HeapCreateCallback sCreateCallback; + /* 80576764 */ static HeapDestroyCallback sDestroyCallback; }; } // namespace EGG -/* 80495a60 */ void* operator new(size_t, void* p); -/* 80495a70 */ void* operator new(size_t size, EGG::Heap* heap, u32 align); -/* 80495a80 */ void* operator new(size_t size, EGG::Allocator* alloc); -/* 80495a90 */ void* operator new[](size_t size, u32 align); -/* 80495aa0 */ void* operator new[](size_t size, EGG::Heap* heap, int align); +/* 80495a60 */ void *operator new(size_t, void *p); +/* 80495a70 */ void *operator new(size_t size, EGG::Heap *heap, u32 align); +/* 80495a80 */ void *operator new(size_t size, EGG::Allocator *alloc); +/* 80495a90 */ void *operator new[](size_t size, u32 align); +/* 80495aa0 */ void *operator new[](size_t size, EGG::Heap *heap, int align); diff --git a/include/egg/core/eggSystem.h b/include/egg/core/eggSystem.h index 0280d8a4..c8c4765e 100644 --- a/include/egg/core/eggSystem.h +++ b/include/egg/core/eggSystem.h @@ -1,22 +1,22 @@ #pragma once -#include "types.h" #include "egg/core/eggHeap.h" +#include -namespace EGG -{ + +namespace EGG { class Display; class XfbManager; class Video; class ConfigurationData { -public: +public: // vtable at 0x0 | 8056ea8c - /* vt 0x08 | 00000000 */ virtual Video* getVideo() = 0; - /* vt 0x0C | 00000000 */ virtual Heap* getSystemHeap() = 0; - /* vt 0x10 | 00000000 */ virtual Display* getDisplay() = 0; - /* vt 0x14 | 00000000 */ virtual XfbManager* getXfbMgr() = 0; + /* vt 0x08 | 00000000 */ virtual Video *getVideo() = 0; + /* vt 0x0C | 00000000 */ virtual Heap *getSystemHeap() = 0; + /* vt 0x10 | 00000000 */ virtual Display *getDisplay() = 0; + /* vt 0x14 | 00000000 */ virtual XfbManager *getXfbMgr() = 0; /* vt 0x18 | 00000000 */ virtual void getPerfView() = 0; /* vt 0x1C | 00000000 */ virtual void getScnMgr() = 0; /* vt 0x20 | 00000000 */ virtual void getAudioMgr() = 0; @@ -25,29 +25,36 @@ public: /* vt 0x2C | 80064ea0 */ virtual void initRenderMode(); /* vt 0x30 | 80497170 */ virtual void initMemory(); /* vt 0x34 | 804972f0 */ virtual void run(); + public: /* 0x04 */ u32 mRoot1HeapStart; /* 0x08 */ u32 mRoot1HeapEnd; /* 0x0C */ u32 mRoot2HeapStart; /* 0x10 */ u32 mRoot2HeapEnd; /* 0x14 */ u32 mMemSize; - /* 0x18 */ Heap* mRootHeapMem1; - /* 0x1C */ Heap* mRootHeapMem2; - /* 0x20 */ Heap* mRootHeapDebug; - /* 0x24 */ Heap* mSystemHeap; - /* 0x28 */ Thread* mSystemThread; + /* 0x18 */ Heap *mRootHeapMem1; + /* 0x1C */ Heap *mRootHeapMem2; + /* 0x20 */ Heap *mRootHeapDebug; + /* 0x24 */ Heap *mSystemHeap; + /* 0x28 */ Thread *mSystemThread; /* 0x2C */ u32 field_0x2C; - /* 0x30 */ u32 mSystemHeapStart; + /* 0x30 */ u32 mSystemHeapStart; /* 0x34 */ u32 mSystemHeapSize; /* 0x38 */ u32 mGraphicsFifoSize; /* 0x3C */ u32 field_0x3C; }; class BaseSystem { public: - /* 80576780 */ static ConfigurationData* mConfigData; - static XfbManager* getXfbMgr() { return mConfigData->getXfbMgr(); } - static Display* getDisplay() { return mConfigData->getDisplay(); } - static Video* getVideo() { return mConfigData->getVideo(); } + /* 80576780 */ static ConfigurationData *mConfigData; + static XfbManager *getXfbMgr() { + return mConfigData->getXfbMgr(); + } + static Display *getDisplay() { + return mConfigData->getDisplay(); + } + static Video *getVideo() { + return mConfigData->getVideo(); + } }; -} // namespace EGG \ No newline at end of file +} // namespace EGG diff --git a/include/egg/core/eggThread.h b/include/egg/core/eggThread.h index ec9dd82a..117b0677 100644 --- a/include/egg/core/eggThread.h +++ b/include/egg/core/eggThread.h @@ -1,42 +1,45 @@ #pragma once -#include "types.h" -#include "rvl/OS.h" -#include "nw4r/ut/List.h" #include "egg/core/eggHeap.h" +#include "nw4r/ut/List.h" +#include "rvl/OS.h" +#include + namespace EGG { class Thread { public: // vtable: 0x00 | 8056ea40 /* 0x08 | 80496a60 */ virtual ~Thread(); - /* 0x0C | 80496dd0 */ virtual void* run(); + /* 0x0C | 80496dd0 */ virtual void *run(); /* 0x10 | 800bd600 */ virtual void onEnter(); /* 0x14 | 800bd5f0 */ virtual void onExit(); + public: - /* 0x04 */ Heap* mContainingHeap; - /* 0x08 */ OSThread* mOSThread; + /* 0x04 */ Heap *mContainingHeap; + /* 0x08 */ OSThread *mOSThread; /* 0x0C */ OSMessageQueue mMesgQueue; - /* 0x2C */ OSMessage* mMesgBuffer; + /* 0x2C */ OSMessage *mMesgBuffer; /* 0x30 */ int mMesgCount; - /* 0x34 */ void* mStackMemory; + /* 0x34 */ void *mStackMemory; /* 0x38 */ u32 mStackSize; - /* 0x3C */ Heap* mAllocatableHeap; - /* 0x40 */ Heap* mCurrentHeap; + /* 0x3C */ Heap *mAllocatableHeap; + /* 0x40 */ Heap *mCurrentHeap; /* 0x44 */ nw4r::ut::Node mLink; + public: - /* 80496910 */ Thread(u32 stackSize, int msgCount, int priority, Heap* heap); - /* 804969e0 */ Thread(OSThread* osThread, int msgCount); - /* 80496b20 */ static Thread* findThread(OSThread* thread); + /* 80496910 */ Thread(u32 stackSize, int msgCount, int priority, Heap *heap); + /* 804969e0 */ Thread(OSThread *osThread, int msgCount); + /* 80496b20 */ static Thread *findThread(OSThread *thread); /* 80496b90 */ static void initialize(); - /* 80496bd0 */ void setThreadCurrentHeap(Heap* heap); - /* 80496c70 */ static void switchThreadCallback(OSThread* from, OSThread* to); - /* 80496d60 */ void setCommonMesgQueue(int mesgCount, Heap* heap); - /* 80496dc0 */ static void* start(void* thread); + /* 80496bd0 */ void setThreadCurrentHeap(Heap *heap); + /* 80496c70 */ static void switchThreadCallback(OSThread *from, OSThread *to); + /* 80496d60 */ void setCommonMesgQueue(int mesgCount, Heap *heap); + /* 80496dc0 */ static void *start(void *thread); public: /* 80673b10 */ static nw4r::ut::List sThreadList; - /* 80576770 */ static void (*sOldSwitchThreadCallback)(OSThread*, OSThread*); + /* 80576770 */ static void (*sOldSwitchThreadCallback)(OSThread *, OSThread *); }; -} // namespace EGG \ No newline at end of file +} // namespace EGG diff --git a/include/egg/core/eggUnk.h b/include/egg/core/eggUnk.h index acb3ab96..f1122cee 100644 --- a/include/egg/core/eggUnk.h +++ b/include/egg/core/eggUnk.h @@ -1,7 +1,8 @@ #pragma once -#include "types.h" #include "rvl/OS.h" +#include + // This is seen in Animal Crossing: City Folk also. Idk where it belongs @@ -9,14 +10,13 @@ // dSysNandThread (or NandRequestThread ) inherits from eggThread, // with part of that thread referencing tsome of these funcs -namespace EGG -{ - class Unknown { - public: - u8 _[0xfC-0x00]; // size unsure, but this is the limit seen - /* 80496de0 */ void fn_80496de0(OSThread*); - /* 80496e30 */ void fn_80496e30(OSThread*); - /* 80496f10 */ void fn_80496f10(); - /* 804970e0 */ void fn_804970e0(OSThread*, u8*); - }; +namespace EGG { +class Unknown { +public: + u8 _[0xfC - 0x00]; // size unsure, but this is the limit seen + /* 80496de0 */ void fn_80496de0(OSThread *); + /* 80496e30 */ void fn_80496e30(OSThread *); + /* 80496f10 */ void fn_80496f10(); + /* 804970e0 */ void fn_804970e0(OSThread *, u8 *); +}; } // namespace EGG diff --git a/include/egg/core/eggVideo.h b/include/egg/core/eggVideo.h index 18fca771..2713ce4f 100644 --- a/include/egg/core/eggVideo.h +++ b/include/egg/core/eggVideo.h @@ -1,29 +1,32 @@ #pragma once -#include "types.h" +#include "egg/prim/eggBitFlag.h" #include "rvl/GX.h" #include "rvl/VI.h" -#include "egg/prim/eggBitFlag.h" +#include -namespace EGG -{ + +namespace EGG { class Video { public: struct RenderModeObjSet { - GXRenderModeObj* table[10]; + GXRenderModeObj *table[10]; }; + public: - /* 0x00 */ GXRenderModeObj const* pRenderMode; + /* 0x00 */ GXRenderModeObj const *pRenderMode; /* 0x04 */ TBitFlag mFlag; /* 0x08 */ u32 mConfiguredTime; + public: - /* inline */ Video() : pRenderMode(0), mFlag(), mConfiguredTime() {}; - /* 80498690 */ void initialize(GXRenderModeObj*, const RenderModeObjSet*); - /* 804986f0 */ void configure(GXRenderModeObj*, const RenderModeObjSet*); + /* inline */ Video() : pRenderMode(0), mFlag(), mConfiguredTime(){}; + /* 80498690 */ void initialize(GXRenderModeObj *, const RenderModeObjSet *); + /* 804986f0 */ void configure(GXRenderModeObj *, const RenderModeObjSet *); /* 80498800 */ static u32 getTickPerVRetrace(u32 tvFormat); /* 80498860 */ static u32 getTickPerVRetrace(); - /* 80498890 */ static GXRenderModeObj* getStandardRenderModeObj(RenderModeObjSet*); + /* 80498890 */ static GXRenderModeObj *getStandardRenderModeObj(RenderModeObjSet *); + public: /* inline */ void setBlack(bool b) { VISetBlack(!mFlag.onBit(0)); diff --git a/include/egg/core/eggXfb.h b/include/egg/core/eggXfb.h index ac550678..be037f4f 100644 --- a/include/egg/core/eggXfb.h +++ b/include/egg/core/eggXfb.h @@ -1,29 +1,30 @@ #pragma once -#include "types.h" #include "egg/core/eggHeap.h" +#include + + +namespace EGG { -namespace EGG -{ - class Xfb { public: // Non-Official assumed based on actions - enum XFBState{ + enum XFBState { XFB_UNPROCESSED, XFB_COPIED, XFB_SHOWN, }; + public: /* 0x00 */ u16 mWidth; /* 0x02 */ u16 mHeight; - /* 0x04 */ u8* mBuffer; + /* 0x04 */ u8 *mBuffer; /* 0x08 */ XFBState mState; - /* 0x0C */ Xfb* mNext; // idk the actual order, but they always link to each other - /* 0x10 */ Xfb* mPrev; // idk the actual order, but they always link to each other + /* 0x0C */ Xfb *mNext; // idk the actual order, but they always link to each other + /* 0x10 */ Xfb *mPrev; // idk the actual order, but they always link to each other public: - /* 804989e0 */ void init(u16 width, u16 height, Heap* heap); - /* 80498a60 */ Xfb(Heap* heap); + /* 804989e0 */ void init(u16 width, u16 height, Heap *heap); + /* 80498a60 */ Xfb(Heap *heap); /* 80498ad0 */ static u32 calcBufferSize(u16 width, u16 height); }; diff --git a/include/egg/core/eggXfbManager.h b/include/egg/core/eggXfbManager.h index c70b6a7e..262c6c7c 100644 --- a/include/egg/core/eggXfbManager.h +++ b/include/egg/core/eggXfbManager.h @@ -1,21 +1,21 @@ #pragma once -#include "types.h" #include "egg/core/eggXfb.h" +#include -namespace EGG -{ + +namespace EGG { class XfbManager { public: - /* 0x0 */ Xfb* mNextXfb; // next xfb to process? - /* 0x4 */ Xfb* mToCopyXfb; // current xfb to use in copyEFB - /* 0x8 */ Xfb* mToShowXfb; // current xfb to use in setNextFrameBuffer - /* 0xC */ u8 mNumXfbs; // Total number of Xfbs ever attached - /* 0xD */ u8 mNumXfbs_Copy; // Unsure of purpose yet, but showing wont proceed until its under 3 + /* 0x0 */ Xfb *mNextXfb; // next xfb to process? + /* 0x4 */ Xfb *mToCopyXfb; // current xfb to use in copyEFB + /* 0x8 */ Xfb *mToShowXfb; // current xfb to use in setNextFrameBuffer + /* 0xC */ u8 mNumXfbs; // Total number of Xfbs ever attached + /* 0xD */ u8 mNumXfbs_Copy; // Unsure of purpose yet, but showing wont proceed until its under 3 public: - /* 80498af0 */ bool isRegisterd(Xfb* xfb) const; // yes. this is correct spelling - /* 80498b30 */ bool attach(Xfb* xfb); + /* 80498af0 */ bool isRegisterd(Xfb *xfb) const; // yes. this is correct spelling + /* 80498b30 */ bool attach(Xfb *xfb); /* 80498c10 */ void copyEFB(bool); /* 80498d00 */ void setNextFrameBuffer(); }; diff --git a/include/egg/egg_types.h b/include/egg/egg_types.h index f5fbf721..1209967d 100644 --- a/include/egg/egg_types.h +++ b/include/egg/egg_types.h @@ -1,93 +1,95 @@ #pragma once -#include "types.h" +#include // Types pulled from ogws // May need to remove/add later -namespace EGG -{ - // gfx - class CapTexture; - class CpuTexture; - class DrawGX; - class DrawPathBase; - class DrawPathBloom; - class DrawPathDOF; - class DrawPathHDR; - class DrawPathLightMap; - class DrawPathShadowVolume; - class Fog; - class FogManager; - class G3DUtility; - class GfxEngine; - class GXUtility; - class IDrawGX; - class IScnProc; - class IScnProcModel; - class LightObj; - class LightManager; - class LightTexture; - class LightTextureManager; - class ModelBoundingInfo; - class ModelEx; - class ModelSnapshot; - class PostEffectBase; - class PostEffectBlur; - class PostEffectBlurGather; - class PostEffectHDR; - class PostEffectSimple; - class ResTIMG; - class ScnRenderer; - class ScnRootEx; - class Screen; - class ScreenEffectBase; - class ShadowTextureManager; - class ShadowTexture; - class StateGX; - class StateGX; - class TextureBuffer; +namespace EGG { +// gfx +class CapTexture; +class CpuTexture; +class DrawGX; +class DrawPathBase; +class DrawPathBloom; +class DrawPathDOF; +class DrawPathHDR; +class DrawPathLightMap; +class DrawPathShadowVolume; +class Fog; +class FogManager; +class G3DUtility; +class GfxEngine; +class GXUtility; +class IDrawGX; +class IScnProc; +class IScnProcModel; +class LightObj; +class LightManager; +class LightTexture; +class LightTextureManager; +class ModelBoundingInfo; +class ModelEx; +class ModelSnapshot; +class PostEffectBase; +class PostEffectBlur; +class PostEffectBlurGather; +class PostEffectHDR; +class PostEffectSimple; +class ResTIMG; +class ScnRenderer; +class ScnRootEx; +class Screen; +class ScreenEffectBase; +class ShadowTextureManager; +class ShadowTexture; +class StateGX; +class StateGX; +class TextureBuffer; - // math - template class Math; - class Matrix33f; - class Matrix34f; - class Matrix44f; - class Quatf; - class Vector2f; - class Vector3f; +// math +template +class Math; +class Matrix33f; +class Matrix34f; +class Matrix44f; +class Quatf; +class Vector2f; +class Vector3f; - // core - class Allocator; - class Archive; - class AsyncDisplay; - template class IBinary; - template class TBitFlag; - class CntFile; - class ColorFader; - class Decomp; - class Display; - class Disposer; - class DvdFile; - class DvdRipper; - class ExpHeap; - class Fader; - class Heap; - class FrmHeap; - class Scene; - class SceneManager; - class Thread; - class Video; - class Xfb; - class XfbManager; +// core +class Allocator; +class Archive; +class AsyncDisplay; +template +class IBinary; +template +class TBitFlag; +class CntFile; +class ColorFader; +class Decomp; +class Display; +class Disposer; +class DvdFile; +class DvdRipper; +class ExpHeap; +class Fader; +class Heap; +class FrmHeap; +class Scene; +class SceneManager; +class Thread; +class Video; +class Xfb; +class XfbManager; - // audio - class ArcPlayer; - class IAudioMgr; - class SimpleAudioMgr; - class SoundHeapMgr; +// audio +class ArcPlayer; +class IAudioMgr; +class SimpleAudioMgr; +class SoundHeapMgr; - // util - class Exception; - class MsgRes; +// util +class Exception; +class MsgRes; } // namespace EGG diff --git a/include/egg/math/eggMath.h b/include/egg/math/eggMath.h index 1a5a40c6..ebef6d9c 100644 --- a/include/egg/math/eggMath.h +++ b/include/egg/math/eggMath.h @@ -1,6 +1,6 @@ #pragma once -#include "types.h" +#include namespace EGG { diff --git a/include/egg/math/eggMatrix.h b/include/egg/math/eggMatrix.h index d15c6c08..9e4112c4 100644 --- a/include/egg/math/eggMatrix.h +++ b/include/egg/math/eggMatrix.h @@ -2,7 +2,7 @@ #include "egg/math/eggQuat.h" #include "egg/math/eggVector.h" -#include "types.h" +#include namespace EGG { diff --git a/include/egg/math/eggQuat.h b/include/egg/math/eggQuat.h index 542ecc0a..d99f925c 100644 --- a/include/egg/math/eggQuat.h +++ b/include/egg/math/eggQuat.h @@ -1,7 +1,7 @@ #pragma once #include "egg/math/eggVector.h" -#include "types.h" +#include namespace EGG { diff --git a/include/egg/math/eggVector.h b/include/egg/math/eggVector.h index b590324b..000e5be0 100644 --- a/include/egg/math/eggVector.h +++ b/include/egg/math/eggVector.h @@ -3,7 +3,7 @@ #include "MSL_C/float.h" #include "egg/math/eggMath.h" #include "nw4r/math/vec.h" -#include "types.h" +#include namespace EGG { diff --git a/include/egg/prim/eggAssert.h b/include/egg/prim/eggAssert.h index b475f5dc..78745a00 100644 --- a/include/egg/prim/eggAssert.h +++ b/include/egg/prim/eggAssert.h @@ -1,19 +1,17 @@ #pragma once -#include "types.h" +#include -namespace EGG -{ +namespace EGG { // All this is guess // TODO: Fixup funtions -namespace Assert -{ +namespace Assert { /* 8049bf90 */ void wait(u32 time); /* 8049c010 */ void system_print(); /* 8049c010 */ void system_report(); -/* 8049c0a0 */ s32 getPeriodPos(char*); -/* 8049c100 */ char* getMapSymbol(); +/* 8049c0a0 */ s32 getPeriodPos(char *); +/* 8049c100 */ char *getMapSymbol(); /* 8049c150 */ bool isOutsideMEM1(u32 addr); /* 8049c190 */ void system_halt(); /* 8049c530 */ void assert(); diff --git a/include/egg/prim/eggBitFlag.h b/include/egg/prim/eggBitFlag.h index 52d7eb61..c52dca96 100644 --- a/include/egg/prim/eggBitFlag.h +++ b/include/egg/prim/eggBitFlag.h @@ -2,12 +2,12 @@ // Pulled from ogws -#include "types.h" +#include -namespace EGG -{ - -template class TBitFlag { +namespace EGG { + +template +class TBitFlag { public: T value; inline void makeAllZero() { @@ -44,16 +44,18 @@ public: reset(makeMask(bit)); } inline void toggleBit(u8 bit) { - if (!onBit(bit)) + if (!onBit(bit)) { setBit(bit); - else + } else { resetBit(bit); + } } inline void changeBit(u8 bit, bool b) { - if (b) + if (b) { setBit(bit); - else + } else { resetBit(bit); + } } inline T getDirect() { return value; diff --git a/include/egg/prim/eggBuffer.h b/include/egg/prim/eggBuffer.h index ab536266..0c9d1d91 100644 --- a/include/egg/prim/eggBuffer.h +++ b/include/egg/prim/eggBuffer.h @@ -1,39 +1,43 @@ #pragma once -#include "types.h" #include "egg/core/eggHeap.h" +#include -namespace EGG -{ + +namespace EGG { template class TBuffer { public: // vtable 0x00 - /* vt 0x08 */ virtual ~TBuffer(){ + /* vt 0x08 */ virtual ~TBuffer() { delete[] mBuffer; mBuffer = nullptr; } - /* vt 0x0C */ virtual void allocate(int n, int){ + /* vt 0x0C */ virtual void allocate(int n, int) { mSize = n; mBuffer = new T[n]; onAllocate(nullptr); } - /* vt 0x10 */ virtual void allocate(int n, Heap* heap, int){ + /* vt 0x10 */ virtual void allocate(int n, Heap *heap, int) { mSize = n; - if (heap == nullptr) heap = Heap::sCurrentHeap; - mBuffer = new(heap, 4) T[n]; + if (heap == nullptr) { + heap = Heap::sCurrentHeap; + } + mBuffer = new (heap, 4) T[n]; onAllocate(heap); } - /* vt 0x14 */ virtual void onAllocate(Heap*){ + /* vt 0x14 */ virtual void onAllocate(Heap *) { return; } - /* vt 0x18 */ virtual void errRangeOver(){ + /* vt 0x18 */ virtual void errRangeOver() { return; } + public: /* 0x08 */ s32 mSize; - /* 0x0C */ T* mBuffer; + /* 0x0C */ T *mBuffer; + public: inline TBuffer() : mSize(0), mBuffer(nullptr) {} @@ -45,11 +49,13 @@ public: errRangeOver(); } } - inline T& operator()(int i) { + inline T &operator()(int i) { checkRange(i); return mBuffer[i]; } - inline s32 getSize() { return mSize; } + inline s32 getSize() { + return mSize; + } }; } // namespace EGG diff --git a/include/f/f_base.h b/include/f/f_base.h index 76be2c8b..a9ae3f82 100644 --- a/include/f/f_base.h +++ b/include/f/f_base.h @@ -1,57 +1,69 @@ #pragma once -// This file is adapted from https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_base.hpp -// and the Skyward Sword Ghidra database. Comments and docs can be seen above. stripped in this file for easier looking +// This file is adapted from +// https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_base.hpp and the Skyward Sword +// Ghidra database. Comments and docs can be seen above. stripped in this file for easier looking -#include "types.h" #include "egg/core/eggFrmHeap.h" -#include "f/f_profile.h" #include "f/f_base_id.h" #include "f/f_helper_unk.h" -#include "f/f_manager.h" #include "f/f_list_mg.h" +#include "f/f_manager.h" +#include "f/f_profile.h" +#include + // Ghidra: fBase // size: 0x64 // official name class fBase_c { public: - /* 0x00 */ fBaseID_e unique_ID; - /* 0x04 */ u32 params1; // params1 - /* 0x08 */ ProfileName profile_name; // Actor Id - /* 0x0A */ u8 lifecycle_state; - /* 0x0B */ bool delete_request; - /* 0x0C */ bool update_request; - /* 0x0D */ bool retry_create; - /* 0x0E */ u8 group_type; - /* 0x0F */ u8 proc_control; - /* 0x10 */ fManager_c manager; - /* 0x50 */ fBaHelper_c* p_unused_helper; - /* 0x54 */ fLiMgBa_c unused_list; - /* 0x5C */ EGG::FrmHeap* p_heap; + /* 0x00 */ fBaseID_e unique_ID; + /* 0x04 */ u32 params1; // params1 + /* 0x08 */ ProfileName profile_name; // Actor Id + /* 0x0A */ u8 lifecycle_state; + /* 0x0B */ bool delete_request; + /* 0x0C */ bool update_request; + /* 0x0D */ bool retry_create; + /* 0x0E */ u8 group_type; + /* 0x0F */ u8 proc_control; + /* 0x10 */ fManager_c manager; + /* 0x50 */ fBaHelper_c *p_unused_helper; + /* 0x54 */ fLiMgBa_c unused_list; + /* 0x5C */ EGG::FrmHeap *p_heap; /* 0x60 */ // vtable public: enum LIFECYCLE_e { WAITING_FOR_CREATE, ACTIVE, TO_BE_DELETED }; - enum GROUP_TYPE_e { OTHER, SCENE, ACTOR, STAGE, }; - enum MAIN_STATE_e { CANCELED, ERROR, SUCCESS, WAITING }; - enum PACK_RESULT_e { NOT_READY, SUCCEEDED, FAILED, }; - enum PROC_DISABLE_e { - ROOT_DISABLE_EXECUTE = 1, - DISABLE_EXECUTE = 2, - ROOT_DISABLE_DRAW = 4, - DISABLE_DRAW = 8 + enum GROUP_TYPE_e { + OTHER, + SCENE, + ACTOR, + STAGE, }; + enum MAIN_STATE_e { CANCELED, ERROR, SUCCESS, WAITING }; + enum PACK_RESULT_e { + NOT_READY, + SUCCEEDED, + FAILED, + }; + enum PROC_DISABLE_e { ROOT_DISABLE_EXECUTE = 1, DISABLE_EXECUTE = 2, ROOT_DISABLE_DRAW = 4, DISABLE_DRAW = 8 }; -// Inlines - bool isProcControlFlag(u8 flag) const { return (proc_control & flag) != 0; } - void setProcControlFlag(u8 flag) { proc_control |= flag; } - void clearProcControlFlag(u8 flag) { proc_control &= ~flag; } + // Inlines + bool isProcControlFlag(u8 flag) const { + return (proc_control & flag) != 0; + } + void setProcControlFlag(u8 flag) { + proc_control |= flag; + } + void clearProcControlFlag(u8 flag) { + proc_control &= ~flag; + } public: /* 802e12f0 */ fBase_c(); /* 802e23b0 */ static void *operator new(size_t); /* 802e2410 */ static void operator delete(void *); - + public: // vtable 0x60 /* 0x08 | 802E15C0 */ virtual int create(); /* 0x0C | 802E15D0 */ virtual int preCreate(); @@ -68,11 +80,12 @@ public: // vtable 0x60 /* 0x38 | 802E1B90 */ virtual void deleteReady(); /* 0x3C | 802E20E0 */ virtual bool entryFrmHeap(unsigned long size, EGG::Heap *parentHeap); /* 0x40 | 802E22E0 */ virtual bool entryFrmHeapNonAdjust(unsigned long size, EGG::Heap *parentHeap); - /* 0x44 | 802E23A0 */ virtual bool createHeap(); + /* 0x44 | 802E23A0 */ virtual bool createHeap(); /* 0x48 | 802E1480 */ virtual ~fBase_c(); public: - /* 802e1500 */ int commonPack(int (fBase_c::*doFunc)(), int (fBase_c::*preFunc)(), void (fBase_c::*postFunc)(MAIN_STATE_e)); + /* 802e1500 */ int commonPack(int (fBase_c::*doFunc)(), int (fBase_c::*preFunc)(), + void (fBase_c::*postFunc)(MAIN_STATE_e)); /* 802e1680 */ int createPack(); /* 802e1860 */ int deletePack(); /* 802e1960 */ int executePack(); @@ -82,16 +95,19 @@ public: /* 802e1f90 */ fBase_c *getConnectParent() const; /* 802e1fb0 */ fBase_c *getConnectChild() const; /* 802e1fd0 */ fBase_c *getConnectBrNext() const; - /* 802e2090 */ bool setConnectChild(fBase_c* child); + /* 802e2090 */ bool setConnectChild(fBase_c *child); /* 802e2420 */ void runCreate(); /* 802e24a0 */ fBase_c *getChildProcessCreateState() const; /* 802e2510 */ bool checkChildProcessCreateState() const; public: - /* 802e2540 */ static void setTmpCtData(ProfileName profName, fTrNdBa_c *connectParent, unsigned long param, u8 groupType); - /* 802e2560 */ static fBase_c *fBase_make(ProfileName profName, fTrNdBa_c *connectParent, unsigned long param, u8 groupType); + /* 802e2540 */ static void setTmpCtData(ProfileName profName, fTrNdBa_c *connectParent, unsigned long param, + u8 groupType); + /* 802e2560 */ static fBase_c *fBase_make(ProfileName profName, fTrNdBa_c *connectParent, unsigned long param, + u8 groupType); /* 802e2640 */ static fBase_c *createRoot(ProfileName profName, unsigned long param, u8 groupType); - /* 802e2600 */ static fBase_c *createChild(ProfileName profName, fBase_c *parent, unsigned long param, u8 groupType); + /* 802e2600 */ static fBase_c *createChild(ProfileName profName, fBase_c *parent, unsigned long param, + u8 groupType); public: /* 80575ba8 */ static fLiMgBa_c m_additional_actors; @@ -108,4 +124,4 @@ private: friend class fManager_c; friend class fLiNdBa_c; friend class fTrMgBa_c; -}; \ No newline at end of file +}; diff --git a/include/f/f_helper_unk.h b/include/f/f_helper_unk.h index d25f927a..af9f5b6e 100644 --- a/include/f/f_helper_unk.h +++ b/include/f/f_helper_unk.h @@ -1,8 +1,9 @@ #pragma once -// This file was ported from https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_helper_unk.hpp +// This file was ported from +// https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_helper_unk.hpp -#include "types.h" +#include /// @brief [A helper class for fBase_c with unknown purpose]. /// @note Unofficial name. @@ -14,12 +15,12 @@ class fBaHelper_c { s16 filler2; s16 mUnknown; - virtual void vf_0x8(); ///< [Stripped out of binary]. - virtual int vf_0xc(void *); ///< [Stripped out of binary]. + virtual void vf_0x8(); ///< [Stripped out of binary]. + virtual int vf_0xc(void *); ///< [Stripped out of binary]. virtual void vf_0x10(void *); ///< [Stripped out of binary]. public: - void Delete(); ///< @todo Document this method. - int Load(int); ///< @todo Document this method. + void Delete(); ///< @todo Document this method. + int Load(int); ///< @todo Document this method. bool LoadOnlyOne(); ///< @todo Document this method. -}; \ No newline at end of file +}; diff --git a/include/f/f_list_mg.h b/include/f/f_list_mg.h index 55529b22..99ab7a8d 100644 --- a/include/f/f_list_mg.h +++ b/include/f/f_list_mg.h @@ -1,12 +1,14 @@ #pragma once -// This file was ported from https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_list_mg.hpp +// This file was ported from +// https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_list_mg.hpp -#include "types.h" -#include "f/f_profile.h" #include "c/c_list.h" #include "f/f_base_id.h" #include "f/f_list_nd.h" +#include "f/f_profile.h" +#include + class fBase_c; @@ -22,15 +24,15 @@ public: int countNodeByProfName(ProfileName profName) const; /* 802e2760 */ const fLiNdBa_c *searchNodeByID(fBaseID_e id) const; - /* 802e2790 */ const fLiNdBa_c *searchNodeByID(fBaseID_e id, fLiMgBa_c* start) const; - /* 802e27d0 */ void link(fLiNdBa_c&, fBase_c*); - /* 802e2830 */ void unlink(fLiNdBa_c&); + /* 802e2790 */ const fLiNdBa_c *searchNodeByID(fBaseID_e id, fLiMgBa_c *start) const; + /* 802e27d0 */ void link(fLiNdBa_c &, fBase_c *); + /* 802e2830 */ void unlink(fLiNdBa_c &); inline fLiNdBa_c *getFirst() const { - return (fLiNdBa_c *) cListMg_c::getFirst(); + return (fLiNdBa_c *)cListMg_c::getFirst(); } inline fLiNdBa_c *getLast() const { - return (fLiNdBa_c *) cListMg_c::getLast(); + return (fLiNdBa_c *)cListMg_c::getLast(); } -}; \ No newline at end of file +}; diff --git a/include/f/f_list_mg_ptmf.h b/include/f/f_list_mg_ptmf.h index e2f197c9..27e48144 100644 --- a/include/f/f_list_mg_ptmf.h +++ b/include/f/f_list_mg_ptmf.h @@ -1,8 +1,9 @@ #pragma once -// This file was ported from https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_list_mg_ptmf.hpp +// This file was ported from +// https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_list_mg_ptmf.hpp -#include "types.h" +#include #include "f/f_list_mg.h" #include "f/f_list_nd_prio.h" @@ -18,13 +19,13 @@ public: /* 802e26e0 */ bool walkPack(); fLiNdPrio_c *getFirst() const { - return (fLiNdPrio_c *) fLiMgBa_c::getFirst(); + return (fLiNdPrio_c *)fLiMgBa_c::getFirst(); } fLiNdPrio_c *getLast() const { - return (fLiNdPrio_c *) fLiMgBa_c::getLast(); + return (fLiNdPrio_c *)fLiMgBa_c::getLast(); } private: int (fBase_c::*mpProcFunc)(); ///< The process function for the list. -}; \ No newline at end of file +}; diff --git a/include/f/f_list_nd.h b/include/f/f_list_nd.h index 14d5f6f4..922ca5ee 100644 --- a/include/f/f_list_nd.h +++ b/include/f/f_list_nd.h @@ -1,25 +1,26 @@ #pragma once -// This file was ported from https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_list_nd.hpp +// This file was ported from +// https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_list_nd.hpp -#include "types.h" #include "c/c_list.h" +#include + class fBase_c; class fLiNdBa_c : public cListNd_c { public: - fLiNdBa_c() : p_owner(nullptr) {} fLiNdBa_c(fBase_c *owner) : p_owner(owner) {} inline fLiNdBa_c *getPrev() const { - return (fLiNdBa_c *) cListNd_c::getPrev(); + return (fLiNdBa_c *)cListNd_c::getPrev(); } inline fLiNdBa_c *getNext() const { - return (fLiNdBa_c *) cListNd_c::getNext(); + return (fLiNdBa_c *)cListNd_c::getNext(); } fBase_c *p_owner; -}; \ No newline at end of file +}; diff --git a/include/f/f_list_nd_prio.h b/include/f/f_list_nd_prio.h index d5bc5c2f..1255c68e 100644 --- a/include/f/f_list_nd_prio.h +++ b/include/f/f_list_nd_prio.h @@ -1,10 +1,12 @@ #pragma once -// This file was ported from https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_list_nd_prio.hpp +// This file was ported from +// https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_list_nd_prio.hpp -#include "types.h" -#include "f/f_profile.h" #include "f/f_list_nd.h" +#include "f/f_profile.h" +#include + /// @brief A list node with priority fields for an order in a list. /// @note Unofficial name. @@ -15,11 +17,11 @@ public: fLiNdPrio_c(fBase_c *owner) : fLiNdBa_c(owner), mOrder(0), mNewOrder(0) {} fLiNdPrio_c *getPrev() const { - return (fLiNdPrio_c *) fLiNdBa_c::getPrev(); + return (fLiNdPrio_c *)fLiNdBa_c::getPrev(); } fLiNdPrio_c *getNext() const { - return (fLiNdPrio_c *) fLiNdBa_c::getNext(); + return (fLiNdPrio_c *)fLiNdBa_c::getNext(); } u16 getOrder() const { @@ -30,6 +32,6 @@ public: return mNewOrder; } - u16 mOrder; ///< The priority of this node. + u16 mOrder; ///< The priority of this node. u16 mNewOrder; ///< The priority the node should change to if it differs from ::mOrder. -}; \ No newline at end of file +}; diff --git a/include/f/f_profile_name.h b/include/f/f_profile_name.h index 5de6481b..4287b6a3 100644 --- a/include/f/f_profile_name.h +++ b/include/f/f_profile_name.h @@ -1,714 +1,714 @@ #pragma once -#include "types.h" +#include namespace fProfile { - - enum PROFILE_NAME_e { - /* 000 (0x000) */ TITLE, - /* 001 (0x001) */ E3_TITLE, - /* 002 (0x002) */ E3_GAMEEND, - /* 003 (0x003) */ THPPLAYER, - /* 004 (0x004) */ GAME, - /* 005 (0x005) */ STAGE_MANAGER, - /* 006 (0x006) */ STAGE, - /* 007 (0x007) */ STAGE_SELECT, - /* 008 (0x008) */ VIEW_CLIP_TAG, - /* 009 (0x009) */ START_TAG, - /* 010 (0x00A) */ MAP_AREA_TAG, - /* 011 (0x00B) */ TRUCK_RAIL, - /* 012 (0x00C) */ TAG_STREAM, - /* 013 (0x00D) */ COL_BOMSLD, - /* 014 (0x00E) */ OBJ_STAGE_KRAKEN, - /* 015 (0x00F) */ OBJ_STAGE_KRAKEN_PARTS, - /* 016 (0x010) */ OBJ_TIME_STONE, - /* 017 (0x011) */ OBJ_SW, - /* 018 (0x012) */ OBJ_BLOCK_ROPE, - /* 019 (0x013) */ OBJ_PUSH_BLOCK, - /* 020 (0x014) */ OBJ_KIBAKO, - /* 021 (0x015) */ OBJ_LOG, - /* 022 (0x016) */ OBJ_LOG_WATER, - /* 023 (0x017) */ OBJ_BELT_CVR, - /* 024 (0x018) */ OBJ_DRUM, - /* 025 (0x019) */ OBJ_BELT_OBSTACLE, - /* 026 (0x01A) */ OBJ_HIMO, - /* 027 (0x01B) */ OBJ_SPIDER_LINE, - /* 028 (0x01C) */ OBJ_WIND, - /* 029 (0x01D) */ OBJ_WIND03, - /* 030 (0x01E) */ OBJ_WIND04, - /* 031 (0x01F) */ OBJ_TORNADO, - /* 032 (0x020) */ OBJ_SWITCH_WALL, - /* 033 (0x021) */ OBJ_TOWER_D101, - /* 034 (0x022) */ OBJ_DOOR_DUNGEON_D200, - /* 035 (0x023) */ OBJ_DOOR_DUNGEON, - /* 036 (0x024) */ OBJ_WOOD_BOARD, - /* 037 (0x025) */ OBJ_CLAW_SHOT_TG, - /* 038 (0x026) */ OBJ_BULB_SWITCH, - /* 039 (0x027) */ OBJ_SIDE_SHUTTER, - /* 040 (0x028) */ OBJ_HIT_LEVER_SW, - /* 041 (0x029) */ OBJ_FENCE_IRON, - /* 042 (0x02A) */ OBJ_UPDOWN_LAVA, - /* 043 (0x02B) */ OBJ_BB_OBJECTS, - /* 044 (0x02C) */ OBJ_BRIDGE_BUILDING, - /* 045 (0x02D) */ OBJ_CANNON, - /* 046 (0x02E) */ OBJ_ROULETTE_ISLAND_C, - /* 047 (0x02F) */ OBJ_ROULETTE_ISLAND_R, - /* 048 (0x030) */ OBJ_BRIDGE_STRETCH, - /* 049 (0x031) */ OBJ_IRON_STAGE, - /* 050 (0x032) */ OBJ_UTAJIMA_STOPPER, - /* 051 (0x033) */ OBJ_UTAJIMA_MAIN_MECHA, - /* 052 (0x034) */ OBJ_UTAJIMA_PEDESTAL, - /* 053 (0x035) */ OBJ_UTAJIMA_ISLAND, - /* 054 (0x036) */ OBJ_CANNON_COVER, - /* 055 (0x037) */ OBJ_UTAJIMA, - /* 056 (0x038) */ OBJ_UTAJIMA_LV2, - /* 057 (0x039) */ OBJ_PUZZLE_ISLAND, - /* 058 (0x03A) */ OBJ_FENCE_BOKO, - /* 059 (0x03B) */ OBJ_FENCE_BOKO2, - /* 060 (0x03C) */ OBJ_WINDMILL, - /* 061 (0x03D) */ OBJ_PINWHEEL, - /* 062 (0x03E) */ OBJ_LIGHTHOUSE_HARP, - /* 063 (0x03F) */ OBJ_FENCE_KONSAI, - /* 064 (0x040) */ OBJ_STAGE_SINK, - /* 065 (0x041) */ OBJ_STAGE_WATER, - /* 066 (0x042) */ OBJ_STAGE_COVER, - /* 067 (0x043) */ OBJ_STAGE_CRACK, - /* 068 (0x044) */ OBJ_TERRY_ISLAND, - /* 069 (0x045) */ OBJ_INSECT_ISLAND, - /* 070 (0x046) */ OBJ_SHRINE_AFTER, - /* 071 (0x047) */ OBJ_SHRINE_BEFORE, - /* 072 (0x048) */ OBJ_SHIP_WINDOW, - /* 073 (0x049) */ OBJ_WATER_SURFACE, - /* 074 (0x04A) */ OBJ_PUMPKIN_BAR, - /* 075 (0x04B) */ OBJ_TREASURE_ISLAND, - /* 076 (0x04C) */ OBJ_SEALED_DOOR, - /* 077 (0x04D) */ OBJ_EVIL_FIELD, - /* 078 (0x04E) */ OBJ_MEGAMI_ISLAND, - /* 079 (0x04F) */ OBJ_CITY, - /* 080 (0x050) */ OBJ_BAMBOO_ISLAND, - /* 081 (0x051) */ OBJ_STREAM_LAVA, - /* 082 (0x052) */ OBJ_DOWN_LAVA, - /* 083 (0x053) */ OBJ_APPEAR_BRIDGE, - /* 084 (0x054) */ OBJ_TRUCK_STOPPER, - /* 085 (0x055) */ OBJ_ISLAND_NUSI, - /* 086 (0x056) */ OBJ_ROCK_SKY, - /* 087 (0x057) */ OBJ_TREASURE_ISLAND_B, - /* 088 (0x058) */ OBJ_WATER_F100, - /* 089 (0x059) */ OBJ_BELL, - /* 090 (0x05A) */ OBJ_SHRINE_BEF_INSIDE, - /* 091 (0x05B) */ OBJ_WINDMILL_DESERT, - /* 092 (0x05C) */ OBJ_CITY_WATER, - /* 093 (0x05D) */ OBJ_MOLE_COVER, - /* 094 (0x05E) */ OBJ_DESERT_DEBRIS, - /* 095 (0x05F) */ OBJ_BB_BROKEN_PARTS, - /* 096 (0x060) */ OBJ_KUMITE_WALL, - /* 097 (0x061) */ OBJ_WATER_SHIELD, - /* 098 (0x062) */ OBJ_BSTONE, - /* 099 (0x063) */ OBJ_WIND02, - /* 100 (0x064) */ OBJ_LEAF_SWING, - /* 101 (0x065) */ RIDE_ROCK_SET_TAG, - /* 102 (0x066) */ OBJ_RIDE_ROCK, - /* 103 (0x067) */ OBJ_MOVE_LIFT_VOL, - /* 104 (0x068) */ OBJ_TRUCK, - /* 105 (0x069) */ OBJ_TERRY_SHOP, - /* 106 (0x06A) */ OBJ_TRAP_ROCK_1, - /* 107 (0x06B) */ OBJ_STOPPER_ROCK, - /* 108 (0x06C) */ OBJ_SHUTTER_FENCE, - /* 109 (0x06D) */ OBJ_SINK_FLOOR_F, - /* 110 (0x06E) */ E_GUMARM, - /* 111 (0x06F) */ OBJ_STEP_GUMARM, - /* 112 (0x070) */ OBJ_BRIDGE_FALL, - /* 113 (0x071) */ OBJ_BRIDGE_STEP, - /* 114 (0x072) */ OBJ_BRIDGE_BONE, - /* 115 (0x073) */ OBJ_BB_BRIDGE, - /* 116 (0x074) */ OBJ_BRIDGE_TIME, - /* 117 (0x075) */ OBJ_BOAT, - /* 118 (0x076) */ OBJ_BALLISTA, - /* 119 (0x077) */ OBJ_BALLISTA_F3, - /* 120 (0x078) */ OBJ_TIME_BOAT, - /* 121 (0x079) */ OBJ_GODDESS_STATUE, - /* 122 (0x07A) */ OBJ_STONE_STAND, - /* 123 (0x07B) */ OBJ_TIME_STAGE_BG, - /* 124 (0x07C) */ OBJ_WARP_HOLE, - /* 125 (0x07D) */ OBJ_GEAR, - /* 126 (0x07E) */ OBJ_DESERT, - /* 127 (0x07F) */ OBJ_D300, - /* 128 (0x080) */ OBJ_SEA_F301, - /* 129 (0x081) */ OBJ_DESERT_AGO, - /* 130 (0x082) */ OBJ_DESERT_METER, - /* 131 (0x083) */ OBJ_NEEDLE_DESERT, - /* 132 (0x084) */ OBJ_LOTUS, - /* 133 (0x085) */ OBJ_TARZAN_POLE, - /* 134 (0x086) */ OBJ_STEP_TIME_SLIP, - /* 135 (0x087) */ OBJ_TIME_BASE, - /* 136 (0x088) */ OBJ_SWITCH_SHUTTER, - /* 137 (0x089) */ OBJ_WATERFALL_D101, - /* 138 (0x08A) */ OBJ_ROLL_PILLAR, - /* 139 (0x08B) */ OBJ_CHEST, - /* 140 (0x08C) */ OBJ_ROCK_BOAT, - /* 141 (0x08D) */ OBJ_BLOCK_UNDERGROUND, - /* 142 (0x08E) */ OBJ_UNDERGROUND, - /* 143 (0x08F) */ OBJ_TROLLEY, - /* 144 (0x090) */ OBJ_LAVA_PLATE, - /* 145 (0x091) */ OBJ_SAND_FLOOR, - /* 146 (0x092) */ OBJ_SW_SYAKO, - /* 147 (0x093) */ OBJ_SYAKO_SHUTTER, - /* 148 (0x094) */ OBJ_DUNGEON_SHIP, - /* 149 (0x095) */ OBJ_NEEDLE_UNDERGROUND, - /* 150 (0x096) */ OBJ_STEP_STATUE, - /* 151 (0x097) */ OBJ_GRAVE, - /* 152 (0x098) */ OBJ_SHED, - /* 153 (0x099) */ OBJ_GIRAHIMU_FLOOR, - /* 154 (0x09A) */ OBJ_TENIJIMA, - /* 155 (0x09B) */ OBJ_SAND_D301, - /* 156 (0x09C) */ OBJ_DOOR_BOSSD101, - /* 157 (0x09D) */ OBJ_BOXCAGE_F300, - /* 158 (0x09E) */ OBJ_TOWER_HAND_D101, - /* 159 (0x09F) */ OBJ_DORMITORY_GATE, - /* 160 (0x0A0) */ OBJ_PISTON, - /* 161 (0x0A1) */ OBJ_FRUIT_TREE, - /* 162 (0x0A2) */ OBJ_FARMLAND, - /* 163 (0x0A3) */ OBJ_PROPELLER_LIFT, - /* 164 (0x0A4) */ OBJ_D3_DUMMY, - /* 165 (0x0A5) */ B_BIGBOSS_BASE, - /* 166 (0x0A6) */ B_BIGBOSS, - /* 167 (0x0A7) */ B_BIGBOSS2, - /* 168 (0x0A8) */ B_BIGBOSS3, - /* 169 (0x0A9) */ B_VD, - /* 170 (0x0AA) */ OBJ_VDB, - /* 171 (0x0AB) */ E_CAPTAIN, - /* 172 (0x0AC) */ OBJ_TRUCK_RAIL_COL, - /* 173 (0x0AD) */ BIRD, - /* 174 (0x0AE) */ BIRD_TARGET, - /* 175 (0x0AF) */ BIRD_NPC, - /* 176 (0x0B0) */ BIRD_KOBUNA, - /* 177 (0x0B1) */ BIRD_KOBUNB, - /* 178 (0x0B2) */ BIRD_RIVAL, - /* 179 (0x0B3) */ BIRD_ZELDA_TRAINING, - /* 180 (0x0B4) */ AVATER_RACE_MNG, - /* 181 (0x0B5) */ AVATER_BULLET, - /* 182 (0x0B6) */ NUSI_BASE, - /* 183 (0x0B7) */ NUSI_NPC, - /* 184 (0x0B8) */ B_NUSI, - /* 185 (0x0B9) */ B_NUSI_TENTAKLE, - /* 186 (0x0BA) */ B_NUSI_BULLET, - /* 187 (0x0BB) */ OBJ_LIGHT_LINE, - /* 188 (0x0BC) */ OBJ_LIGHT_SHAFT_SMALL, - /* 189 (0x0BD) */ TAG_LIGHT_SHAFT_EFF, - /* 190 (0x0BE) */ MEGAMI_DIVING_TAG, - /* 191 (0x0BF) */ COMMON_BULLET, - /* 192 (0x0C0) */ E_SYAKOMAITO, - /* 193 (0x0C1) */ E_MR, - /* 194 (0x0C2) */ E_PH, - /* 195 (0x0C3) */ B_KR, - /* 196 (0x0C4) */ B_KRH, - /* 197 (0x0C5) */ B_KRA, - /* 198 (0x0C6) */ OBJ_FLYING_CLAWSHOT_TARGET, - /* 199 (0x0C7) */ OBJ_DIS_SHIP, - /* 200 (0x0C8) */ PLAYER, - /* 201 (0x0C9) */ TAG_SHUTTER_FENCE_PERMISSION, - /* 202 (0x0CA) */ SHUTTER, - /* 203 (0x0CB) */ OBJ_SHUTTER_CHANGE_SCENE, - /* 204 (0x0CC) */ OBJ_DOOR_BOSS, - /* 205 (0x0CD) */ OBJ_DOOR, - /* 206 (0x0CE) */ OBJ_FENCE, - /* 207 (0x0CF) */ TAG_SHUTTER_FENCE_FORBIDDANCE, - /* 208 (0x0D0) */ OBJ_TROLLEY_SHUTTER, - /* 209 (0x0D1) */ OBJ_TR_SHUTTER_CS, - /* 210 (0x0D2) */ OBJ_BG, - /* 211 (0x0D3) */ BOOMERANG, - /* 212 (0x0D4) */ GENKI_MGR_TAG, - /* 213 (0x0D5) */ TAG_MIECHAN, - /* 214 (0x0D6) */ DEMO_NPC_BIRD, - /* 215 (0x0D7) */ NPC_RVL, - /* 216 (0x0D8) */ NPC_RIVAL_LOD, - /* 217 (0x0D9) */ NPC_KBN, - /* 218 (0x0DA) */ NPC_KBN2, - /* 219 (0x0DB) */ NPC_KOBUN_B_NIGHT, - /* 220 (0x0DC) */ NPC_SKN, - /* 221 (0x0DD) */ NPC_SKN2, - /* 222 (0x0DE) */ NPC_GZL, - /* 223 (0x0DF) */ NPC_ZLD, - /* 224 (0x0E0) */ NPC_DSK, - /* 225 (0x0E1) */ NPC_DRB, - /* 226 (0x0E2) */ NPC_DRBC, - /* 227 (0x0E3) */ NPC_CE_FRIEND, - /* 228 (0x0E4) */ NPC_CE_LADY, - /* 229 (0x0E5) */ NPC_TOILET_GHOST, - /* 230 (0x0E6) */ NPC_SORAJIMA_FATHER, - /* 231 (0x0E7) */ NPC_SORAJIMA_MOTHER, - /* 232 (0x0E8) */ NPC_SORAJIMA_GIRL, - /* 233 (0x0E9) */ NPC_KYUI_WIZARD, - /* 234 (0x0EA) */ NPC_KYUI_FIRST, - /* 235 (0x0EB) */ NPC_ORD_KYUI, - /* 236 (0x0EC) */ NPC_KYUI_ELDER, - /* 237 (0x0ED) */ NPC_KYUI_THIRD, - /* 238 (0x0EE) */ NPC_KYUI4, - /* 239 (0x0EF) */ NPC_TMN, - /* 240 (0x0F0) */ NPC_SALESMAN_S, - /* 241 (0x0F1) */ NPC_DOUGUYA_NIGHT, - /* 242 (0x0F2) */ NPC_MED_WIFE_NIGHT, - /* 243 (0x0F3) */ NPC_MED_HUS_NIGHT, - /* 244 (0x0F4) */ NPC_JUNK_NIGHT, - /* 245 (0x0F5) */ NPC_AZUKARIYA_NIGHT, - /* 246 (0x0F6) */ NPC_DOUGUYA_MOTHER, - /* 247 (0x0F7) */ NPC_DOUGUYA_MOTHER_LOD, - /* 248 (0x0F8) */ NPC_JUNK_MOTHER, - /* 249 (0x0F9) */ NPC_JUNK_MOTHER_LOD, - /* 250 (0x0FA) */ NPC_SENPAIA_MOTHER, - /* 251 (0x0FB) */ NPC_SENPAIA_MOTHER_LOD, - /* 252 (0x0FC) */ NPC_SORAJIMA_MAN_E, - /* 253 (0x0FD) */ NPC_SORAJIMA_MAN_D, - /* 254 (0x0FE) */ NPC_AZUKARIYA_FATHER, - /* 255 (0x0FF) */ NPC_DAISHINKAN_N, - /* 256 (0x100) */ NPC_SORAJIMA_MALE, - /* 257 (0x101) */ NPC_BDSW, - /* 258 (0x102) */ NPC_SORAJIMA_FEMALE, - /* 259 (0x103) */ NPC_KENSEI, - /* 260 (0x104) */ NPC_TALK_KENSEI, - /* 261 (0x105) */ NPC_BDZ, - /* 262 (0x106) */ NPC_OIM, - /* 263 (0x107) */ NPC_YIM, - /* 264 (0x108) */ NPC_BGR, - /* 265 (0x109) */ NPC_SLTK, - /* 266 (0x10A) */ NPC_SLB2, - /* 267 (0x10B) */ NPC_SMA3, - /* 268 (0x10C) */ NPC_SMA2, - /* 269 (0x10D) */ NPC_PMA, - /* 270 (0x10E) */ NPC_PDU, - /* 271 (0x10F) */ NPC_ICGK, - /* 272 (0x110) */ NPC_PCS, - /* 273 (0x111) */ NPC_FDR, - /* 274 (0x112) */ NPC_TDR, - /* 275 (0x113) */ NPC_TDS, - /* 276 (0x114) */ NPC_TDRB, - /* 277 (0x115) */ TAG_SWORD_BATTLE_GAME, - /* 278 (0x116) */ TAG_SIREN_TIME_ATTACK, - /* 279 (0x117) */ NPC_ADR, - /* 280 (0x118) */ NPC_GHM, - /* 281 (0x119) */ NPC_SHA, - /* 282 (0x11A) */ NPC_GRA, - /* 283 (0x11B) */ NPC_GRC, - /* 284 (0x11C) */ NPC_GRD, - /* 285 (0x11D) */ NPC_SORAJIMA_BOY, - /* 286 (0x11E) */ NPC_AKUMAKUN, - /* 287 (0x11F) */ NPC_AKU_HUMAN, - /* 288 (0x120) */ NPC_SUISEI, - /* 289 (0x121) */ NPC_SUISEI_SUB, - /* 290 (0x122) */ NPC_SUISEI_NORMAL, - /* 291 (0x123) */ MOLE_MGR_TAG, - /* 292 (0x124) */ NPC_MOLE_MG, - /* 293 (0x125) */ NPC_MOLE, - /* 294 (0x126) */ NPC_MOLE_NORMAL, - /* 295 (0x127) */ NPC_MOLE_NORMAL2, - /* 296 (0x128) */ NPC_MOLE_ES_NML, - /* 297 (0x129) */ NPC_MOLE_TACKLE, - /* 298 (0x12A) */ NPC_MOLE_TACKLE2, - /* 299 (0x12B) */ NPC_CHEF, - /* 300 (0x12C) */ NPC_SLFB, - /* 301 (0x12D) */ NPC_SLRP, - /* 302 (0x12E) */ NPC_SLFL, - /* 303 (0x12F) */ NPC_TERRY, - /* 304 (0x130) */ NPC_DIVE_GAME_JUDGE, - /* 305 (0x131) */ KNIGHT_LEADER_BIRD, - /* 306 (0x132) */ NPC_KNIGHT_LEADER, - /* 307 (0x133) */ NPC_SENPAI, - /* 308 (0x134) */ NPC_SENPAI_B, - /* 309 (0x135) */ NPC_REGRET_RIVAL, - /* 310 (0x136) */ NPC_RESCUE, - /* 311 (0x137) */ NPC_SLB, - /* 312 (0x138) */ FLY_SLB, - /* 313 (0x139) */ OBJ_PROPERA, - /* 314 (0x13A) */ OBJ_ROULETTE, - /* 315 (0x13B) */ NPC_MOLE_ELDER, - /* 316 (0x13C) */ NPC_SALBAGE_MORRY, - /* 317 (0x13D) */ NPC_MOLE_SAL, - /* 318 (0x13E) */ OBJ_POT_SAL, - /* 319 (0x13F) */ OBJ_MOLE_SOIL, - /* 320 (0x140) */ LITTLE_BIRD_MGR, - /* 321 (0x141) */ LITTLE_BIRD, - /* 322 (0x142) */ FISH_MGR, - /* 323 (0x143) */ FISH, - /* 324 (0x144) */ EEL, - /* 325 (0x145) */ JSTUDIO_SYSOBJ, - /* 326 (0x146) */ JSTUDIO_ACTOR, - /* 327 (0x147) */ B_BBSHWV, - /* 328 (0x148) */ NPC_BBRVL, - /* 329 (0x149) */ OBJ_BIGBOMB_FLOWER, - /* 330 (0x14A) */ OBJ_BBLARGEBOMB, - /* 331 (0x14B) */ OBJ_BSTN, - /* 332 (0x14C) */ B_MG, - /* 333 (0x14D) */ B_LASTBOSS, - /* 334 (0x14E) */ J_TEST, - /* 335 (0x14F) */ E_AM, - /* 336 (0x150) */ T_QUAKE, - /* 337 (0x151) */ T_KUMITE, - /* 338 (0x152) */ GROUP_TEST, - /* 339 (0x153) */ GROUP_SUMMON, - /* 340 (0x154) */ T_BCAL, - /* 341 (0x155) */ E_SM, - /* 342 (0x156) */ E_BEAMOS, - /* 343 (0x157) */ GEKO_TAG, - /* 344 (0x158) */ E_GEKO, - /* 345 (0x159) */ E_SIREN, - /* 346 (0x15A) */ E_PO, - /* 347 (0x15B) */ OBJ_RING, - /* 348 (0x15C) */ E_OR, - /* 349 (0x15D) */ E_OR_CANNON, - /* 350 (0x15E) */ OR_CANN_BULLET, - /* 351 (0x15F) */ E_EYE, - /* 352 (0x160) */ OBJ_HOLE, - /* 353 (0x161) */ OBJ_INTO_HOLE, - /* 354 (0x162) */ E_SPARK, - /* 355 (0x163) */ E_MAGMA, - /* 356 (0x164) */ E_MAGUPPO, - /* 357 (0x165) */ MAGUPPO_BULLET, - /* 358 (0x166) */ E_BS, - /* 359 (0x167) */ E_SF, - /* 360 (0x168) */ E_SF4, - /* 361 (0x169) */ E_ST, - /* 362 (0x16A) */ E_ST_WIRE, - /* 363 (0x16B) */ ENEMY_CONTROL, - /* 364 (0x16C) */ KIESU_TAG, - /* 365 (0x16D) */ E_KS, - /* 366 (0x16E) */ E_HB, - /* 367 (0x16F) */ E_HB_LEAF, - /* 368 (0x170) */ E_REMLY, - /* 369 (0x171) */ E_LIZARUFOS, - /* 370 (0x172) */ E_LIZA_TAIL, - /* 371 (0x173) */ E_HIDOKARI, - /* 372 (0x174) */ E_HIDOKARIS, - /* 373 (0x175) */ E_HYDRA, - /* 374 (0x176) */ E_GUNHO, - /* 375 (0x177) */ E_GUNHOB, - /* 376 (0x178) */ E_BFISH, - /* 377 (0x179) */ E_CACTUS, - /* 378 (0x17A) */ E_HOC, - /* 379 (0x17B) */ E_OC, - /* 380 (0x17C) */ E_KGIRA, - /* 381 (0x17D) */ OBJ_PIPE, - /* 382 (0x17E) */ E_BC, - /* 383 (0x17F) */ E_BCE, - /* 384 (0x180) */ E_BCAL, - /* 385 (0x181) */ E_BCARROW, - /* 386 (0x182) */ E_BCALARROW, - /* 387 (0x183) */ BCZ_TAG, - /* 388 (0x184) */ E_BCZ, - /* 389 (0x185) */ E_SKYTAIL, - /* 390 (0x186) */ E_HP, - /* 391 (0x187) */ E_CHB, - /* 392 (0x188) */ E_GUE, - /* 393 (0x189) */ GUE_BULLET, - /* 394 (0x18A) */ E_GE, - /* 395 (0x18B) */ E_RUPEE_GUE, - /* 396 (0x18C) */ E_GEROCK, - /* 397 (0x18D) */ E_TN2, - /* 398 (0x18E) */ E_HIDORY, - /* 399 (0x18F) */ HIDORY_FIRE, - /* 400 (0x190) */ E_WS, - /* 401 (0x191) */ NPC_BIRD, - /* 402 (0x192) */ B_GIRAHIMU_BASE, - /* 403 (0x193) */ B_GIRAHIMU, - /* 404 (0x194) */ B_GIRAHIMU2, - /* 405 (0x195) */ B_GIRAHIMU3_BASE, - /* 406 (0x196) */ B_GIRAHIMU3_FIRST, - /* 407 (0x197) */ B_GIRAHIMU3_SECOND, - /* 408 (0x198) */ B_GIRAHIMU3_THIRD, - /* 409 (0x199) */ OBJ_GH_SW_L, - /* 410 (0x19A) */ OBJ_GH_KNIFE, - /* 411 (0x19B) */ OBJ_BIRD_SP_UP, - /* 412 (0x19C) */ GH_SWORD_BEAM, - /* 413 (0x19D) */ B_ASURA, - /* 414 (0x19E) */ ASURA_ARM, - /* 415 (0x19F) */ ASURA_FOOT, - /* 416 (0x1A0) */ ASURA_BULLET, - /* 417 (0x1A1) */ ASURA_SWORD, - /* 418 (0x1A2) */ ASURA_PILLAR, - /* 419 (0x1A3) */ INVISIBLE, - /* 420 (0x1A4) */ E_MR_SHIELD, - /* 421 (0x1A5) */ E_KG, - /* 422 (0x1A6) */ NPC_HONEYCOMB, - /* 423 (0x1A7) */ NPC_BEE, - /* 424 (0x1A8) */ HEART_FLOWER, - /* 425 (0x1A9) */ BOMBF, - /* 426 (0x1AA) */ BOMB, - /* 427 (0x1AB) */ OBJ_CARRY_STONE, - /* 428 (0x1AC) */ OBJ_ROLL_ROCK, - /* 429 (0x1AD) */ COL_STP, - /* 430 (0x1AE) */ KANBAN, - /* 431 (0x1AF) */ OBJ_BAMBOO, - /* 432 (0x1B0) */ OBJ_SWHIT, - /* 433 (0x1B1) */ OBJ_SW_SWORD_BEAM, - /* 434 (0x1B2) */ OBJ_SW_HARP, - /* 435 (0x1B3) */ OBJ_SIREN_BARRIER, - /* 436 (0x1B4) */ OBJ_TOGE_TRAP, - /* 437 (0x1B5) */ PUMPKIN, - /* 438 (0x1B6) */ OBJ_PUMPKIN_LEAF, - /* 439 (0x1B7) */ OBJ_WATER_NUT_LEAF, - /* 440 (0x1B8) */ OBJ_WATER_NUT, - /* 441 (0x1B9) */ OBJ_TABLEWARE, - /* 442 (0x1BA) */ OBJ_SW_WHIPLEVER, - /* 443 (0x1BB) */ OBJ_MUSHROOM, - /* 444 (0x1BC) */ WOODAREA_TAG, - /* 445 (0x1BD) */ OBJ_FRUIT, - /* 446 (0x1BE) */ OBJ_SKULL, - /* 447 (0x1BF) */ SOUND_TAG, - /* 448 (0x1C0) */ OBJ_ROCK_DRAGON, - /* 449 (0x1C1) */ TAG_INSECT, - /* 450 (0x1C2) */ INSECT_LADYBUG, - /* 451 (0x1C3) */ INSECT_DRAGONFLY, - /* 452 (0x1C4) */ INSECT_BEETLE, - /* 453 (0x1C5) */ INSECT_GRASSHOPPER, - /* 454 (0x1C6) */ INSECT_CICADA, - /* 455 (0x1C7) */ INSECT_ANT, - /* 456 (0x1C8) */ INSECT_BUTTERFLY, - /* 457 (0x1C9) */ INSECT_SCARAB, - /* 458 (0x1CA) */ INSECT_FIREFLY, - /* 459 (0x1CB) */ OBJ_SAIL, - /* 460 (0x1CC) */ OBJ_LOTUS_FLOWER, - /* 461 (0x1CD) */ OBJ_LOTUS_SEED, - /* 462 (0x1CE) */ OBJ_SHUTTER_LOCK, - /* 463 (0x1CF) */ OBJ_LAMP, - /* 464 (0x1D0) */ TAG_ROCK_BOAT, - /* 465 (0x1D1) */ OBJ_TOWER_GEAR_D101, - /* 466 (0x1D2) */ OBJ_SHUTTER_WATER_D101, - /* 467 (0x1D3) */ OBJ_ANCIENT_JEWELS, - /* 468 (0x1D4) */ OBJ_MG_PUMPKIN, - /* 469 (0x1D5) */ OBJ_FLAG, - /* 470 (0x1D6) */ OBJ_CHANDELIER, - /* 471 (0x1D7) */ TAG_PUMPKIN_CLAY, - /* 472 (0x1D8) */ TAG_REACTION, - /* 473 (0x1D9) */ OBJ_SPORE, - /* 474 (0x1DA) */ OBJ_FRUIT_B, - /* 475 (0x1DB) */ OBJ_DIVINER_CRYSTAL, - /* 476 (0x1DC) */ TAG_NOEFFECT_AREA, - /* 477 (0x1DD) */ TAG_D3_SCENE_CHANGE, - /* 478 (0x1DE) */ OBJ_DECOA, - /* 479 (0x1DF) */ OBJ_DECOB, - /* 480 (0x1E0) */ OBJ_SANDBAG, - /* 481 (0x1E1) */ OBJ_PAINT, - /* 482 (0x1E2) */ OBJ_CONTROL_PANEL, - /* 483 (0x1E3) */ OBJ_UG_SWITCH, - /* 484 (0x1E4) */ OBJ_CLEARNESS_WALL, - /* 485 (0x1E5) */ OBJ_RUINED_SAVE, - /* 486 (0x1E6) */ OBJ_TRIFORCE, - /* 487 (0x1E7) */ OBJ_KANBAN_STONE, - /* 488 (0x1E8) */ TBOX, - /* 489 (0x1E9) */ OBJ_BUBBLE, - /* 490 (0x1EA) */ OBJ_VSD, - /* 491 (0x1EB) */ OBJ_SOIL, - /* 492 (0x1EC) */ OBJ_IVY_ROPE, - /* 493 (0x1ED) */ OBJ_GRASS_COIL, - /* 494 (0x1EE) */ OBJ_ROPE_IGAIGA, - /* 495 (0x1EF) */ OBJ_FIRE, - /* 496 (0x1F0) */ OBJ_TUBO, - /* 497 (0x1F1) */ OBJ_TUBO_BIG, - /* 498 (0x1F2) */ OBJ_CHAIR, - /* 499 (0x1F3) */ TIME_AREA, - /* 500 (0x1F4) */ OBJ_BLAST_ROCK, - /* 501 (0x1F5) */ OBJ_SW_DIR, - /* 502 (0x1F6) */ OBJ_SW_DIR_DOOR, - /* 503 (0x1F7) */ OBJ_SW_BANK, - /* 504 (0x1F8) */ OBJ_SW_BANK_SMALL, - /* 505 (0x1F9) */ T_FAIRY, - /* 506 (0x1FA) */ OBJ_FAIRY, - /* 507 (0x1FB) */ BIRD_MOB, - /* 508 (0x1FC) */ OBJ_BALLISTA_HANDLE, - /* 509 (0x1FD) */ OBJ_TIME_BOAT_BULLET, - /* 510 (0x1FE) */ OBJ_TIME_DOOR, - /* 511 (0x1FF) */ OBJ_TIME_DOOR_BEFORE, - /* 512 (0x200) */ TAG_TIME_DOOR_BEAM, - /* 513 (0x201) */ OBJ_COL, - /* 514 (0x202) */ OBJ_DAYNIGHT, - /* 515 (0x203) */ OBJ_BUILDING, - /* 516 (0x204) */ OBJ_OCT_GRASS, - /* 517 (0x205) */ OBJ_OCT_GRASS_LEAF, - /* 518 (0x206) */ OBJ_TUMBLE_WEED, - /* 519 (0x207) */ TUMBLE_WEED_TAG, - /* 520 (0x208) */ OBJ_FLOWER_ANCIENT, - /* 521 (0x209) */ OBJ_BARREL, - /* 522 (0x20A) */ OBJ_WARP, - /* 523 (0x20B) */ OBJ_WATER_MARK, - /* 524 (0x20C) */ OBJ_WATER_JAR, - /* 525 (0x20D) */ OBJ_STOPPING_ROPE, - /* 526 (0x20E) */ OBJ_TRAP_BIRD_WOOD, - /* 527 (0x20F) */ OBJ_TACKLE, - /* 528 (0x210) */ TACKLE_TAG, - /* 529 (0x211) */ OBJ_VORTEX, - /* 530 (0x212) */ OBJ_TOWER_BOMB, - /* 531 (0x213) */ OBJ_SEAT_SWORD, - /* 532 (0x214) */ OBJ_POLE_STONY, - /* 533 (0x215) */ OBJ_SWORD_CANDLE, - /* 534 (0x216) */ OBJ_SAVE, - /* 535 (0x217) */ OBJ_POOL_COCK, - /* 536 (0x218) */ OBJ_FIREWALL, - /* 537 (0x219) */ HARP_TAG, - /* 538 (0x21A) */ OBJ_SWORD_STAB, - /* 539 (0x21B) */ OBJ_GODDESS_CUBE, - /* 540 (0x21C) */ OBJ_TIME_BLOCK, - /* 541 (0x21D) */ OBJ_MOVE_ELEC, - /* 542 (0x21E) */ OBJ_LAVA_D201, - /* 543 (0x21F) */ OBJ_HARP_HINT, - /* 544 (0x220) */ OBJ_F302_LIGHT, - /* 545 (0x221) */ OBJ_TOD3_STONE, - /* 546 (0x222) */ OBJ_B300_SAND, - /* 547 (0x223) */ T_DOWSING, - /* 548 (0x224) */ T_MAP_MARK, - /* 549 (0x225) */ BEETLE_TAG, - /* 550 (0x226) */ EFFECT_GEN_TAG, - /* 551 (0x227) */ TAG_TIME_AREA_CHECK, - /* 552 (0x228) */ TAG_RESTART_TIME_STONE, - /* 553 (0x229) */ SHOP_SAMPLE, - /* 554 (0x22A) */ OBJ_TERRY_GIMMICK, - /* 555 (0x22B) */ OBJ_TERRY_SWITCH, - /* 556 (0x22C) */ OBJ_TERRY_HOLE, - /* 557 (0x22D) */ OBJ_TERRY_BIKE, - /* 558 (0x22E) */ OBJ_JUNK_REPAIR, - /* 559 (0x22F) */ CO_TEST, - /* 560 (0x230) */ OBJ_ARROW_SWITCH, - /* 561 (0x231) */ OBJ_VENT_FAN, - /* 562 (0x232) */ OBJ_ELECTRIC_LIGHT, - /* 563 (0x233) */ OBJ_WATER_SWITCH, - /* 564 (0x234) */ OBJ_ROTATION_LIGHT, - /* 565 (0x235) */ OBJ_HOLE_MINIGAME, - /* 566 (0x236) */ OBJ_CLOUD_DIVE, - /* 567 (0x237) */ OBJ_MUSASABI, - /* 568 (0x238) */ OBJ_FORTUNE_RING, - /* 569 (0x239) */ OBJ_BLOW_COAL, - /* 570 (0x23A) */ OBJ_SPIKE, - /* 571 (0x23B) */ OBJ_WATER_SPOUT, - /* 572 (0x23C) */ OBJ_SMOKE, - /* 573 (0x23D) */ OBJ_LIGHTHOUSE_LIGHT, - /* 574 (0x23E) */ OBJ_WATER_IGAIGA, - /* 575 (0x23F) */ OBJ_BLADE, - /* 576 (0x240) */ OBJ_FIRE_OBSTACLE, - /* 577 (0x241) */ OBJ_FIRE_PILLAR, - /* 578 (0x242) */ OBJ_GUARD_LOG, - /* 579 (0x243) */ OBJ_SLICE_LOG, - /* 580 (0x244) */ OBJ_SLICE_LOG_PARTS, - /* 581 (0x245) */ OBJ_STAGE_DEBRIS, - /* 582 (0x246) */ OBJ_GROUND_COVER, - /* 583 (0x247) */ OBJ_CUMUL_CLOUD, - /* 584 (0x248) */ OBJ_UNDER_CLOUD, - /* 585 (0x249) */ OBJ_WATERFALL_F102, - /* 586 (0x24A) */ OBJ_GOD_MARK, - /* 587 (0x24B) */ OBJ_IMPA_DOOR, - /* 588 (0x24C) */ OBJ_WATERFALL_D100, - /* 589 (0x24D) */ OBJ_GIRAHIM_FOOT, - /* 590 (0x24E) */ OBJ_ISLAND_LOD, - /* 591 (0x24F) */ OBJ_UTA_DEMO_PEDEST, - /* 592 (0x250) */ OBJ_LAVA_F200, - /* 593 (0x251) */ OBJ_ROPE_BASE, - /* 594 (0x252) */ OBJ_SUN_LIGHT, - /* 595 (0x253) */ OBJ_SIREN_2DMAP, - /* 596 (0x254) */ OBJ_DISPLAY_ONLY_NBS, - /* 597 (0x255) */ OBJ_AMBER, - /* 598 (0x256) */ OBJ_BIRD_STATUE, - /* 599 (0x257) */ OBJ_F400_GATE_LEAF, - /* 600 (0x258) */ OBJ_F400_GATE_SEAL, - /* 601 (0x259) */ OBJ_MAPPARTS, - /* 602 (0x25A) */ OBJ_RO_AT_TARGET, - /* 603 (0x25B) */ RO_AT_TAR_MANAGER_TAG, - /* 604 (0x25C) */ TAG_MUSASABI, - /* 605 (0x25D) */ TAG_MAP_INST, - /* 606 (0x25E) */ TAG_AUTO_MESSAGE, - /* 607 (0x25F) */ TAG_SHIP_SLOPE, - /* 608 (0x260) */ TAG_SHIP_FLOOD, - /* 609 (0x261) */ TAG_BARREL, - /* 610 (0x262) */ TAG_BARREL_POS, - /* 611 (0x263) */ TAG_HEAT_RESIST, - /* 612 (0x264) */ TAG_HOLY_WATER, - /* 613 (0x265) */ TAG_BELT_OBSTACLE, - /* 614 (0x266) */ TAG_DRUM, - /* 615 (0x267) */ TAG_ROLL_ATTACK_LOG, - /* 616 (0x268) */ TAG_SHIP_WINDOW, - /* 617 (0x269) */ ARROW, - /* 618 (0x26A) */ MASS_OBJ_TAG, - /* 619 (0x26B) */ SOUND_AREA_MGR, - /* 620 (0x26C) */ TAG_SOUND_AREA, - /* 621 (0x26D) */ ATT_TAG, - /* 622 (0x26E) */ TLP_TAG, - /* 623 (0x26F) */ SKYENEMY_T, - /* 624 (0x270) */ TOUCH_TAG, - /* 625 (0x271) */ CAMERA_TAG, - /* 626 (0x272) */ CAMERA2_TAG, - /* 627 (0x273) */ ACTION_TAG, - /* 628 (0x274) */ SC_CHANGE_TAG, - /* 629 (0x275) */ GATE2GND_TAG, - /* 630 (0x276) */ ALLDIE_TAG, - /* 631 (0x277) */ SW_TAG, - /* 632 (0x278) */ PL_RESTART, - /* 633 (0x279) */ SW_AREA_TAG, - /* 634 (0x27A) */ SIREN_TAG, - /* 635 (0x27B) */ TAG_TKEVNT, - /* 636 (0x27C) */ MOLE_PROHIBIT_TAG, - /* 637 (0x27D) */ TAG_DEFEAT_BOSS, - /* 638 (0x27E) */ TAG_TIMER, - /* 639 (0x27F) */ TAG_FENCE_SYNCHRONIZER, - /* 640 (0x280) */ TAG_GENKI_DOWSING_TARGET, - /* 641 (0x281) */ ITEM, - /* 642 (0x282) */ OBJ_ITEM_HEART_CONTAINER, - /* 643 (0x283) */ OBJ_CLEF, - /* 644 (0x284) */ OBJ_FRUIT_GUTS_LEAF, - /* 645 (0x285) */ OBJ_SWRD_PRJ, - /* 646 (0x286) */ OBJ_VACU_DUST_PARTS, - /* 647 (0x287) */ OBJ_VACU_DUST, - /* 648 (0x288) */ OBJ_RAIL_POST, - /* 649 (0x289) */ OBJ_RAIL_END, - /* 650 (0x28A) */ OBJ_TENI_RAIL, - /* 651 (0x28B) */ OBJ_TENI_RAIL_POST, - /* 652 (0x28C) */ OBJ_FORCE_SIGN, - /* 653 (0x28D) */ TAG_FORCE_GET_FLAG, - /* 654 (0x28E) */ TAG_CLEF_MANAGER, - /* 655 (0x28F) */ TAG_CLEF_GAME, - /* 656 (0x290) */ TAG_MINIGAME_INSECT_CAPTURE, - /* 657 (0x291) */ CAMERA, - /* 658 (0x292) */ WEATHER_TAG, - /* 659 (0x293) */ SPORE_TAG, - /* 660 (0x294) */ MIST_TAG, - /* 661 (0x295) */ SPARKS_TAG, - /* 662 (0x296) */ SPARKS2_TAG, - /* 663 (0x297) */ KYTAG_TAG, - /* 664 (0x298) */ LBTHUNDER_TAG, - /* 665 (0x299) */ PLTCHG_TAG, - /* 666 (0x29A) */ PLIGHT_TAG, - /* 667 (0x29B) */ VRBOX_TAG, - /* 668 (0x29C) */ NPC_INV, - /* 669 (0x29D) */ NPC_TKE, - /* 670 (0x29E) */ NPC_STR, - /* 671 (0x29F) */ MESSAGE_ACTOR, - /* 672 (0x2A0) */ LIGHT_OBJECT, - /* 673 (0x2A1) */ MESSAGE, - /* 674 (0x2A2) */ LYT_CONTROL_GAME, - /* 675 (0x2A3) */ LYT_DEMO_DOWSING, - /* 676 (0x2A4) */ LYT_CONTROL_TITLE, - /* 677 (0x2A5) */ LYT_DROP_LINE, - /* 678 (0x2A6) */ LYT_FORCE_LINE, - /* 679 (0x2A7) */ LYT_ENEMY_ICON, - /* 680 (0x2A8) */ LYT_MINI_GAME, - /* 681 (0x2A9) */ LYT_SUIRYU_SCORE, - /* 682 (0x2AA) */ LYT_SUIRYU_SCORE_COMP, - /* 683 (0x2AB) */ LYT_BOSS_CAPTION, - /* 684 (0x2AC) */ LYT_PAUSE, - /* 685 (0x2AD) */ LYT_GAMEOVER_MGR, - /* 686 (0x2AE) */ LYT_SAVE_MGR, - /* 687 (0x2AF) */ TITLE_MANAGER, - /* 688 (0x2B0) */ LYT_TITLE_BG, - /* 689 (0x2B1) */ LYT_SHOP, - /* 690 (0x2B2) */ LYT_DEPOSIT, - /* 691 (0x2B3) */ LYT_DEMO_TITLE, - /* 692 (0x2B4) */ LYT_END_ROLL, - /* 693 (0x2B5) */ LYT_SEEKER_STONE, - /* 694 (0x2B6) */ LYT_FILESELECT, - /* 695 (0x2B7) */ SKB, - /* 696 (0x2B8) */ EVENT_TAG, - /* 697 (0x2B9) */ EVENTF_TAG, - /* 698 (0x2BA) */ C_GAME, - /* 699 (0x2BB) */ C_BASE, - /* 700 (0x2BC) */ BOOT, - /* 701 (0x2BD) */ ROOM, - /* 702 (0x2BE) */ LAST, - /* 703 */ NUMBER_OF_ACTORS, - INVALID, - }; -}; \ No newline at end of file + +enum PROFILE_NAME_e { + /* 000 (0x000) */ TITLE, + /* 001 (0x001) */ E3_TITLE, + /* 002 (0x002) */ E3_GAMEEND, + /* 003 (0x003) */ THPPLAYER, + /* 004 (0x004) */ GAME, + /* 005 (0x005) */ STAGE_MANAGER, + /* 006 (0x006) */ STAGE, + /* 007 (0x007) */ STAGE_SELECT, + /* 008 (0x008) */ VIEW_CLIP_TAG, + /* 009 (0x009) */ START_TAG, + /* 010 (0x00A) */ MAP_AREA_TAG, + /* 011 (0x00B) */ TRUCK_RAIL, + /* 012 (0x00C) */ TAG_STREAM, + /* 013 (0x00D) */ COL_BOMSLD, + /* 014 (0x00E) */ OBJ_STAGE_KRAKEN, + /* 015 (0x00F) */ OBJ_STAGE_KRAKEN_PARTS, + /* 016 (0x010) */ OBJ_TIME_STONE, + /* 017 (0x011) */ OBJ_SW, + /* 018 (0x012) */ OBJ_BLOCK_ROPE, + /* 019 (0x013) */ OBJ_PUSH_BLOCK, + /* 020 (0x014) */ OBJ_KIBAKO, + /* 021 (0x015) */ OBJ_LOG, + /* 022 (0x016) */ OBJ_LOG_WATER, + /* 023 (0x017) */ OBJ_BELT_CVR, + /* 024 (0x018) */ OBJ_DRUM, + /* 025 (0x019) */ OBJ_BELT_OBSTACLE, + /* 026 (0x01A) */ OBJ_HIMO, + /* 027 (0x01B) */ OBJ_SPIDER_LINE, + /* 028 (0x01C) */ OBJ_WIND, + /* 029 (0x01D) */ OBJ_WIND03, + /* 030 (0x01E) */ OBJ_WIND04, + /* 031 (0x01F) */ OBJ_TORNADO, + /* 032 (0x020) */ OBJ_SWITCH_WALL, + /* 033 (0x021) */ OBJ_TOWER_D101, + /* 034 (0x022) */ OBJ_DOOR_DUNGEON_D200, + /* 035 (0x023) */ OBJ_DOOR_DUNGEON, + /* 036 (0x024) */ OBJ_WOOD_BOARD, + /* 037 (0x025) */ OBJ_CLAW_SHOT_TG, + /* 038 (0x026) */ OBJ_BULB_SWITCH, + /* 039 (0x027) */ OBJ_SIDE_SHUTTER, + /* 040 (0x028) */ OBJ_HIT_LEVER_SW, + /* 041 (0x029) */ OBJ_FENCE_IRON, + /* 042 (0x02A) */ OBJ_UPDOWN_LAVA, + /* 043 (0x02B) */ OBJ_BB_OBJECTS, + /* 044 (0x02C) */ OBJ_BRIDGE_BUILDING, + /* 045 (0x02D) */ OBJ_CANNON, + /* 046 (0x02E) */ OBJ_ROULETTE_ISLAND_C, + /* 047 (0x02F) */ OBJ_ROULETTE_ISLAND_R, + /* 048 (0x030) */ OBJ_BRIDGE_STRETCH, + /* 049 (0x031) */ OBJ_IRON_STAGE, + /* 050 (0x032) */ OBJ_UTAJIMA_STOPPER, + /* 051 (0x033) */ OBJ_UTAJIMA_MAIN_MECHA, + /* 052 (0x034) */ OBJ_UTAJIMA_PEDESTAL, + /* 053 (0x035) */ OBJ_UTAJIMA_ISLAND, + /* 054 (0x036) */ OBJ_CANNON_COVER, + /* 055 (0x037) */ OBJ_UTAJIMA, + /* 056 (0x038) */ OBJ_UTAJIMA_LV2, + /* 057 (0x039) */ OBJ_PUZZLE_ISLAND, + /* 058 (0x03A) */ OBJ_FENCE_BOKO, + /* 059 (0x03B) */ OBJ_FENCE_BOKO2, + /* 060 (0x03C) */ OBJ_WINDMILL, + /* 061 (0x03D) */ OBJ_PINWHEEL, + /* 062 (0x03E) */ OBJ_LIGHTHOUSE_HARP, + /* 063 (0x03F) */ OBJ_FENCE_KONSAI, + /* 064 (0x040) */ OBJ_STAGE_SINK, + /* 065 (0x041) */ OBJ_STAGE_WATER, + /* 066 (0x042) */ OBJ_STAGE_COVER, + /* 067 (0x043) */ OBJ_STAGE_CRACK, + /* 068 (0x044) */ OBJ_TERRY_ISLAND, + /* 069 (0x045) */ OBJ_INSECT_ISLAND, + /* 070 (0x046) */ OBJ_SHRINE_AFTER, + /* 071 (0x047) */ OBJ_SHRINE_BEFORE, + /* 072 (0x048) */ OBJ_SHIP_WINDOW, + /* 073 (0x049) */ OBJ_WATER_SURFACE, + /* 074 (0x04A) */ OBJ_PUMPKIN_BAR, + /* 075 (0x04B) */ OBJ_TREASURE_ISLAND, + /* 076 (0x04C) */ OBJ_SEALED_DOOR, + /* 077 (0x04D) */ OBJ_EVIL_FIELD, + /* 078 (0x04E) */ OBJ_MEGAMI_ISLAND, + /* 079 (0x04F) */ OBJ_CITY, + /* 080 (0x050) */ OBJ_BAMBOO_ISLAND, + /* 081 (0x051) */ OBJ_STREAM_LAVA, + /* 082 (0x052) */ OBJ_DOWN_LAVA, + /* 083 (0x053) */ OBJ_APPEAR_BRIDGE, + /* 084 (0x054) */ OBJ_TRUCK_STOPPER, + /* 085 (0x055) */ OBJ_ISLAND_NUSI, + /* 086 (0x056) */ OBJ_ROCK_SKY, + /* 087 (0x057) */ OBJ_TREASURE_ISLAND_B, + /* 088 (0x058) */ OBJ_WATER_F100, + /* 089 (0x059) */ OBJ_BELL, + /* 090 (0x05A) */ OBJ_SHRINE_BEF_INSIDE, + /* 091 (0x05B) */ OBJ_WINDMILL_DESERT, + /* 092 (0x05C) */ OBJ_CITY_WATER, + /* 093 (0x05D) */ OBJ_MOLE_COVER, + /* 094 (0x05E) */ OBJ_DESERT_DEBRIS, + /* 095 (0x05F) */ OBJ_BB_BROKEN_PARTS, + /* 096 (0x060) */ OBJ_KUMITE_WALL, + /* 097 (0x061) */ OBJ_WATER_SHIELD, + /* 098 (0x062) */ OBJ_BSTONE, + /* 099 (0x063) */ OBJ_WIND02, + /* 100 (0x064) */ OBJ_LEAF_SWING, + /* 101 (0x065) */ RIDE_ROCK_SET_TAG, + /* 102 (0x066) */ OBJ_RIDE_ROCK, + /* 103 (0x067) */ OBJ_MOVE_LIFT_VOL, + /* 104 (0x068) */ OBJ_TRUCK, + /* 105 (0x069) */ OBJ_TERRY_SHOP, + /* 106 (0x06A) */ OBJ_TRAP_ROCK_1, + /* 107 (0x06B) */ OBJ_STOPPER_ROCK, + /* 108 (0x06C) */ OBJ_SHUTTER_FENCE, + /* 109 (0x06D) */ OBJ_SINK_FLOOR_F, + /* 110 (0x06E) */ E_GUMARM, + /* 111 (0x06F) */ OBJ_STEP_GUMARM, + /* 112 (0x070) */ OBJ_BRIDGE_FALL, + /* 113 (0x071) */ OBJ_BRIDGE_STEP, + /* 114 (0x072) */ OBJ_BRIDGE_BONE, + /* 115 (0x073) */ OBJ_BB_BRIDGE, + /* 116 (0x074) */ OBJ_BRIDGE_TIME, + /* 117 (0x075) */ OBJ_BOAT, + /* 118 (0x076) */ OBJ_BALLISTA, + /* 119 (0x077) */ OBJ_BALLISTA_F3, + /* 120 (0x078) */ OBJ_TIME_BOAT, + /* 121 (0x079) */ OBJ_GODDESS_STATUE, + /* 122 (0x07A) */ OBJ_STONE_STAND, + /* 123 (0x07B) */ OBJ_TIME_STAGE_BG, + /* 124 (0x07C) */ OBJ_WARP_HOLE, + /* 125 (0x07D) */ OBJ_GEAR, + /* 126 (0x07E) */ OBJ_DESERT, + /* 127 (0x07F) */ OBJ_D300, + /* 128 (0x080) */ OBJ_SEA_F301, + /* 129 (0x081) */ OBJ_DESERT_AGO, + /* 130 (0x082) */ OBJ_DESERT_METER, + /* 131 (0x083) */ OBJ_NEEDLE_DESERT, + /* 132 (0x084) */ OBJ_LOTUS, + /* 133 (0x085) */ OBJ_TARZAN_POLE, + /* 134 (0x086) */ OBJ_STEP_TIME_SLIP, + /* 135 (0x087) */ OBJ_TIME_BASE, + /* 136 (0x088) */ OBJ_SWITCH_SHUTTER, + /* 137 (0x089) */ OBJ_WATERFALL_D101, + /* 138 (0x08A) */ OBJ_ROLL_PILLAR, + /* 139 (0x08B) */ OBJ_CHEST, + /* 140 (0x08C) */ OBJ_ROCK_BOAT, + /* 141 (0x08D) */ OBJ_BLOCK_UNDERGROUND, + /* 142 (0x08E) */ OBJ_UNDERGROUND, + /* 143 (0x08F) */ OBJ_TROLLEY, + /* 144 (0x090) */ OBJ_LAVA_PLATE, + /* 145 (0x091) */ OBJ_SAND_FLOOR, + /* 146 (0x092) */ OBJ_SW_SYAKO, + /* 147 (0x093) */ OBJ_SYAKO_SHUTTER, + /* 148 (0x094) */ OBJ_DUNGEON_SHIP, + /* 149 (0x095) */ OBJ_NEEDLE_UNDERGROUND, + /* 150 (0x096) */ OBJ_STEP_STATUE, + /* 151 (0x097) */ OBJ_GRAVE, + /* 152 (0x098) */ OBJ_SHED, + /* 153 (0x099) */ OBJ_GIRAHIMU_FLOOR, + /* 154 (0x09A) */ OBJ_TENIJIMA, + /* 155 (0x09B) */ OBJ_SAND_D301, + /* 156 (0x09C) */ OBJ_DOOR_BOSSD101, + /* 157 (0x09D) */ OBJ_BOXCAGE_F300, + /* 158 (0x09E) */ OBJ_TOWER_HAND_D101, + /* 159 (0x09F) */ OBJ_DORMITORY_GATE, + /* 160 (0x0A0) */ OBJ_PISTON, + /* 161 (0x0A1) */ OBJ_FRUIT_TREE, + /* 162 (0x0A2) */ OBJ_FARMLAND, + /* 163 (0x0A3) */ OBJ_PROPELLER_LIFT, + /* 164 (0x0A4) */ OBJ_D3_DUMMY, + /* 165 (0x0A5) */ B_BIGBOSS_BASE, + /* 166 (0x0A6) */ B_BIGBOSS, + /* 167 (0x0A7) */ B_BIGBOSS2, + /* 168 (0x0A8) */ B_BIGBOSS3, + /* 169 (0x0A9) */ B_VD, + /* 170 (0x0AA) */ OBJ_VDB, + /* 171 (0x0AB) */ E_CAPTAIN, + /* 172 (0x0AC) */ OBJ_TRUCK_RAIL_COL, + /* 173 (0x0AD) */ BIRD, + /* 174 (0x0AE) */ BIRD_TARGET, + /* 175 (0x0AF) */ BIRD_NPC, + /* 176 (0x0B0) */ BIRD_KOBUNA, + /* 177 (0x0B1) */ BIRD_KOBUNB, + /* 178 (0x0B2) */ BIRD_RIVAL, + /* 179 (0x0B3) */ BIRD_ZELDA_TRAINING, + /* 180 (0x0B4) */ AVATER_RACE_MNG, + /* 181 (0x0B5) */ AVATER_BULLET, + /* 182 (0x0B6) */ NUSI_BASE, + /* 183 (0x0B7) */ NUSI_NPC, + /* 184 (0x0B8) */ B_NUSI, + /* 185 (0x0B9) */ B_NUSI_TENTAKLE, + /* 186 (0x0BA) */ B_NUSI_BULLET, + /* 187 (0x0BB) */ OBJ_LIGHT_LINE, + /* 188 (0x0BC) */ OBJ_LIGHT_SHAFT_SMALL, + /* 189 (0x0BD) */ TAG_LIGHT_SHAFT_EFF, + /* 190 (0x0BE) */ MEGAMI_DIVING_TAG, + /* 191 (0x0BF) */ COMMON_BULLET, + /* 192 (0x0C0) */ E_SYAKOMAITO, + /* 193 (0x0C1) */ E_MR, + /* 194 (0x0C2) */ E_PH, + /* 195 (0x0C3) */ B_KR, + /* 196 (0x0C4) */ B_KRH, + /* 197 (0x0C5) */ B_KRA, + /* 198 (0x0C6) */ OBJ_FLYING_CLAWSHOT_TARGET, + /* 199 (0x0C7) */ OBJ_DIS_SHIP, + /* 200 (0x0C8) */ PLAYER, + /* 201 (0x0C9) */ TAG_SHUTTER_FENCE_PERMISSION, + /* 202 (0x0CA) */ SHUTTER, + /* 203 (0x0CB) */ OBJ_SHUTTER_CHANGE_SCENE, + /* 204 (0x0CC) */ OBJ_DOOR_BOSS, + /* 205 (0x0CD) */ OBJ_DOOR, + /* 206 (0x0CE) */ OBJ_FENCE, + /* 207 (0x0CF) */ TAG_SHUTTER_FENCE_FORBIDDANCE, + /* 208 (0x0D0) */ OBJ_TROLLEY_SHUTTER, + /* 209 (0x0D1) */ OBJ_TR_SHUTTER_CS, + /* 210 (0x0D2) */ OBJ_BG, + /* 211 (0x0D3) */ BOOMERANG, + /* 212 (0x0D4) */ GENKI_MGR_TAG, + /* 213 (0x0D5) */ TAG_MIECHAN, + /* 214 (0x0D6) */ DEMO_NPC_BIRD, + /* 215 (0x0D7) */ NPC_RVL, + /* 216 (0x0D8) */ NPC_RIVAL_LOD, + /* 217 (0x0D9) */ NPC_KBN, + /* 218 (0x0DA) */ NPC_KBN2, + /* 219 (0x0DB) */ NPC_KOBUN_B_NIGHT, + /* 220 (0x0DC) */ NPC_SKN, + /* 221 (0x0DD) */ NPC_SKN2, + /* 222 (0x0DE) */ NPC_GZL, + /* 223 (0x0DF) */ NPC_ZLD, + /* 224 (0x0E0) */ NPC_DSK, + /* 225 (0x0E1) */ NPC_DRB, + /* 226 (0x0E2) */ NPC_DRBC, + /* 227 (0x0E3) */ NPC_CE_FRIEND, + /* 228 (0x0E4) */ NPC_CE_LADY, + /* 229 (0x0E5) */ NPC_TOILET_GHOST, + /* 230 (0x0E6) */ NPC_SORAJIMA_FATHER, + /* 231 (0x0E7) */ NPC_SORAJIMA_MOTHER, + /* 232 (0x0E8) */ NPC_SORAJIMA_GIRL, + /* 233 (0x0E9) */ NPC_KYUI_WIZARD, + /* 234 (0x0EA) */ NPC_KYUI_FIRST, + /* 235 (0x0EB) */ NPC_ORD_KYUI, + /* 236 (0x0EC) */ NPC_KYUI_ELDER, + /* 237 (0x0ED) */ NPC_KYUI_THIRD, + /* 238 (0x0EE) */ NPC_KYUI4, + /* 239 (0x0EF) */ NPC_TMN, + /* 240 (0x0F0) */ NPC_SALESMAN_S, + /* 241 (0x0F1) */ NPC_DOUGUYA_NIGHT, + /* 242 (0x0F2) */ NPC_MED_WIFE_NIGHT, + /* 243 (0x0F3) */ NPC_MED_HUS_NIGHT, + /* 244 (0x0F4) */ NPC_JUNK_NIGHT, + /* 245 (0x0F5) */ NPC_AZUKARIYA_NIGHT, + /* 246 (0x0F6) */ NPC_DOUGUYA_MOTHER, + /* 247 (0x0F7) */ NPC_DOUGUYA_MOTHER_LOD, + /* 248 (0x0F8) */ NPC_JUNK_MOTHER, + /* 249 (0x0F9) */ NPC_JUNK_MOTHER_LOD, + /* 250 (0x0FA) */ NPC_SENPAIA_MOTHER, + /* 251 (0x0FB) */ NPC_SENPAIA_MOTHER_LOD, + /* 252 (0x0FC) */ NPC_SORAJIMA_MAN_E, + /* 253 (0x0FD) */ NPC_SORAJIMA_MAN_D, + /* 254 (0x0FE) */ NPC_AZUKARIYA_FATHER, + /* 255 (0x0FF) */ NPC_DAISHINKAN_N, + /* 256 (0x100) */ NPC_SORAJIMA_MALE, + /* 257 (0x101) */ NPC_BDSW, + /* 258 (0x102) */ NPC_SORAJIMA_FEMALE, + /* 259 (0x103) */ NPC_KENSEI, + /* 260 (0x104) */ NPC_TALK_KENSEI, + /* 261 (0x105) */ NPC_BDZ, + /* 262 (0x106) */ NPC_OIM, + /* 263 (0x107) */ NPC_YIM, + /* 264 (0x108) */ NPC_BGR, + /* 265 (0x109) */ NPC_SLTK, + /* 266 (0x10A) */ NPC_SLB2, + /* 267 (0x10B) */ NPC_SMA3, + /* 268 (0x10C) */ NPC_SMA2, + /* 269 (0x10D) */ NPC_PMA, + /* 270 (0x10E) */ NPC_PDU, + /* 271 (0x10F) */ NPC_ICGK, + /* 272 (0x110) */ NPC_PCS, + /* 273 (0x111) */ NPC_FDR, + /* 274 (0x112) */ NPC_TDR, + /* 275 (0x113) */ NPC_TDS, + /* 276 (0x114) */ NPC_TDRB, + /* 277 (0x115) */ TAG_SWORD_BATTLE_GAME, + /* 278 (0x116) */ TAG_SIREN_TIME_ATTACK, + /* 279 (0x117) */ NPC_ADR, + /* 280 (0x118) */ NPC_GHM, + /* 281 (0x119) */ NPC_SHA, + /* 282 (0x11A) */ NPC_GRA, + /* 283 (0x11B) */ NPC_GRC, + /* 284 (0x11C) */ NPC_GRD, + /* 285 (0x11D) */ NPC_SORAJIMA_BOY, + /* 286 (0x11E) */ NPC_AKUMAKUN, + /* 287 (0x11F) */ NPC_AKU_HUMAN, + /* 288 (0x120) */ NPC_SUISEI, + /* 289 (0x121) */ NPC_SUISEI_SUB, + /* 290 (0x122) */ NPC_SUISEI_NORMAL, + /* 291 (0x123) */ MOLE_MGR_TAG, + /* 292 (0x124) */ NPC_MOLE_MG, + /* 293 (0x125) */ NPC_MOLE, + /* 294 (0x126) */ NPC_MOLE_NORMAL, + /* 295 (0x127) */ NPC_MOLE_NORMAL2, + /* 296 (0x128) */ NPC_MOLE_ES_NML, + /* 297 (0x129) */ NPC_MOLE_TACKLE, + /* 298 (0x12A) */ NPC_MOLE_TACKLE2, + /* 299 (0x12B) */ NPC_CHEF, + /* 300 (0x12C) */ NPC_SLFB, + /* 301 (0x12D) */ NPC_SLRP, + /* 302 (0x12E) */ NPC_SLFL, + /* 303 (0x12F) */ NPC_TERRY, + /* 304 (0x130) */ NPC_DIVE_GAME_JUDGE, + /* 305 (0x131) */ KNIGHT_LEADER_BIRD, + /* 306 (0x132) */ NPC_KNIGHT_LEADER, + /* 307 (0x133) */ NPC_SENPAI, + /* 308 (0x134) */ NPC_SENPAI_B, + /* 309 (0x135) */ NPC_REGRET_RIVAL, + /* 310 (0x136) */ NPC_RESCUE, + /* 311 (0x137) */ NPC_SLB, + /* 312 (0x138) */ FLY_SLB, + /* 313 (0x139) */ OBJ_PROPERA, + /* 314 (0x13A) */ OBJ_ROULETTE, + /* 315 (0x13B) */ NPC_MOLE_ELDER, + /* 316 (0x13C) */ NPC_SALBAGE_MORRY, + /* 317 (0x13D) */ NPC_MOLE_SAL, + /* 318 (0x13E) */ OBJ_POT_SAL, + /* 319 (0x13F) */ OBJ_MOLE_SOIL, + /* 320 (0x140) */ LITTLE_BIRD_MGR, + /* 321 (0x141) */ LITTLE_BIRD, + /* 322 (0x142) */ FISH_MGR, + /* 323 (0x143) */ FISH, + /* 324 (0x144) */ EEL, + /* 325 (0x145) */ JSTUDIO_SYSOBJ, + /* 326 (0x146) */ JSTUDIO_ACTOR, + /* 327 (0x147) */ B_BBSHWV, + /* 328 (0x148) */ NPC_BBRVL, + /* 329 (0x149) */ OBJ_BIGBOMB_FLOWER, + /* 330 (0x14A) */ OBJ_BBLARGEBOMB, + /* 331 (0x14B) */ OBJ_BSTN, + /* 332 (0x14C) */ B_MG, + /* 333 (0x14D) */ B_LASTBOSS, + /* 334 (0x14E) */ J_TEST, + /* 335 (0x14F) */ E_AM, + /* 336 (0x150) */ T_QUAKE, + /* 337 (0x151) */ T_KUMITE, + /* 338 (0x152) */ GROUP_TEST, + /* 339 (0x153) */ GROUP_SUMMON, + /* 340 (0x154) */ T_BCAL, + /* 341 (0x155) */ E_SM, + /* 342 (0x156) */ E_BEAMOS, + /* 343 (0x157) */ GEKO_TAG, + /* 344 (0x158) */ E_GEKO, + /* 345 (0x159) */ E_SIREN, + /* 346 (0x15A) */ E_PO, + /* 347 (0x15B) */ OBJ_RING, + /* 348 (0x15C) */ E_OR, + /* 349 (0x15D) */ E_OR_CANNON, + /* 350 (0x15E) */ OR_CANN_BULLET, + /* 351 (0x15F) */ E_EYE, + /* 352 (0x160) */ OBJ_HOLE, + /* 353 (0x161) */ OBJ_INTO_HOLE, + /* 354 (0x162) */ E_SPARK, + /* 355 (0x163) */ E_MAGMA, + /* 356 (0x164) */ E_MAGUPPO, + /* 357 (0x165) */ MAGUPPO_BULLET, + /* 358 (0x166) */ E_BS, + /* 359 (0x167) */ E_SF, + /* 360 (0x168) */ E_SF4, + /* 361 (0x169) */ E_ST, + /* 362 (0x16A) */ E_ST_WIRE, + /* 363 (0x16B) */ ENEMY_CONTROL, + /* 364 (0x16C) */ KIESU_TAG, + /* 365 (0x16D) */ E_KS, + /* 366 (0x16E) */ E_HB, + /* 367 (0x16F) */ E_HB_LEAF, + /* 368 (0x170) */ E_REMLY, + /* 369 (0x171) */ E_LIZARUFOS, + /* 370 (0x172) */ E_LIZA_TAIL, + /* 371 (0x173) */ E_HIDOKARI, + /* 372 (0x174) */ E_HIDOKARIS, + /* 373 (0x175) */ E_HYDRA, + /* 374 (0x176) */ E_GUNHO, + /* 375 (0x177) */ E_GUNHOB, + /* 376 (0x178) */ E_BFISH, + /* 377 (0x179) */ E_CACTUS, + /* 378 (0x17A) */ E_HOC, + /* 379 (0x17B) */ E_OC, + /* 380 (0x17C) */ E_KGIRA, + /* 381 (0x17D) */ OBJ_PIPE, + /* 382 (0x17E) */ E_BC, + /* 383 (0x17F) */ E_BCE, + /* 384 (0x180) */ E_BCAL, + /* 385 (0x181) */ E_BCARROW, + /* 386 (0x182) */ E_BCALARROW, + /* 387 (0x183) */ BCZ_TAG, + /* 388 (0x184) */ E_BCZ, + /* 389 (0x185) */ E_SKYTAIL, + /* 390 (0x186) */ E_HP, + /* 391 (0x187) */ E_CHB, + /* 392 (0x188) */ E_GUE, + /* 393 (0x189) */ GUE_BULLET, + /* 394 (0x18A) */ E_GE, + /* 395 (0x18B) */ E_RUPEE_GUE, + /* 396 (0x18C) */ E_GEROCK, + /* 397 (0x18D) */ E_TN2, + /* 398 (0x18E) */ E_HIDORY, + /* 399 (0x18F) */ HIDORY_FIRE, + /* 400 (0x190) */ E_WS, + /* 401 (0x191) */ NPC_BIRD, + /* 402 (0x192) */ B_GIRAHIMU_BASE, + /* 403 (0x193) */ B_GIRAHIMU, + /* 404 (0x194) */ B_GIRAHIMU2, + /* 405 (0x195) */ B_GIRAHIMU3_BASE, + /* 406 (0x196) */ B_GIRAHIMU3_FIRST, + /* 407 (0x197) */ B_GIRAHIMU3_SECOND, + /* 408 (0x198) */ B_GIRAHIMU3_THIRD, + /* 409 (0x199) */ OBJ_GH_SW_L, + /* 410 (0x19A) */ OBJ_GH_KNIFE, + /* 411 (0x19B) */ OBJ_BIRD_SP_UP, + /* 412 (0x19C) */ GH_SWORD_BEAM, + /* 413 (0x19D) */ B_ASURA, + /* 414 (0x19E) */ ASURA_ARM, + /* 415 (0x19F) */ ASURA_FOOT, + /* 416 (0x1A0) */ ASURA_BULLET, + /* 417 (0x1A1) */ ASURA_SWORD, + /* 418 (0x1A2) */ ASURA_PILLAR, + /* 419 (0x1A3) */ INVISIBLE, + /* 420 (0x1A4) */ E_MR_SHIELD, + /* 421 (0x1A5) */ E_KG, + /* 422 (0x1A6) */ NPC_HONEYCOMB, + /* 423 (0x1A7) */ NPC_BEE, + /* 424 (0x1A8) */ HEART_FLOWER, + /* 425 (0x1A9) */ BOMBF, + /* 426 (0x1AA) */ BOMB, + /* 427 (0x1AB) */ OBJ_CARRY_STONE, + /* 428 (0x1AC) */ OBJ_ROLL_ROCK, + /* 429 (0x1AD) */ COL_STP, + /* 430 (0x1AE) */ KANBAN, + /* 431 (0x1AF) */ OBJ_BAMBOO, + /* 432 (0x1B0) */ OBJ_SWHIT, + /* 433 (0x1B1) */ OBJ_SW_SWORD_BEAM, + /* 434 (0x1B2) */ OBJ_SW_HARP, + /* 435 (0x1B3) */ OBJ_SIREN_BARRIER, + /* 436 (0x1B4) */ OBJ_TOGE_TRAP, + /* 437 (0x1B5) */ PUMPKIN, + /* 438 (0x1B6) */ OBJ_PUMPKIN_LEAF, + /* 439 (0x1B7) */ OBJ_WATER_NUT_LEAF, + /* 440 (0x1B8) */ OBJ_WATER_NUT, + /* 441 (0x1B9) */ OBJ_TABLEWARE, + /* 442 (0x1BA) */ OBJ_SW_WHIPLEVER, + /* 443 (0x1BB) */ OBJ_MUSHROOM, + /* 444 (0x1BC) */ WOODAREA_TAG, + /* 445 (0x1BD) */ OBJ_FRUIT, + /* 446 (0x1BE) */ OBJ_SKULL, + /* 447 (0x1BF) */ SOUND_TAG, + /* 448 (0x1C0) */ OBJ_ROCK_DRAGON, + /* 449 (0x1C1) */ TAG_INSECT, + /* 450 (0x1C2) */ INSECT_LADYBUG, + /* 451 (0x1C3) */ INSECT_DRAGONFLY, + /* 452 (0x1C4) */ INSECT_BEETLE, + /* 453 (0x1C5) */ INSECT_GRASSHOPPER, + /* 454 (0x1C6) */ INSECT_CICADA, + /* 455 (0x1C7) */ INSECT_ANT, + /* 456 (0x1C8) */ INSECT_BUTTERFLY, + /* 457 (0x1C9) */ INSECT_SCARAB, + /* 458 (0x1CA) */ INSECT_FIREFLY, + /* 459 (0x1CB) */ OBJ_SAIL, + /* 460 (0x1CC) */ OBJ_LOTUS_FLOWER, + /* 461 (0x1CD) */ OBJ_LOTUS_SEED, + /* 462 (0x1CE) */ OBJ_SHUTTER_LOCK, + /* 463 (0x1CF) */ OBJ_LAMP, + /* 464 (0x1D0) */ TAG_ROCK_BOAT, + /* 465 (0x1D1) */ OBJ_TOWER_GEAR_D101, + /* 466 (0x1D2) */ OBJ_SHUTTER_WATER_D101, + /* 467 (0x1D3) */ OBJ_ANCIENT_JEWELS, + /* 468 (0x1D4) */ OBJ_MG_PUMPKIN, + /* 469 (0x1D5) */ OBJ_FLAG, + /* 470 (0x1D6) */ OBJ_CHANDELIER, + /* 471 (0x1D7) */ TAG_PUMPKIN_CLAY, + /* 472 (0x1D8) */ TAG_REACTION, + /* 473 (0x1D9) */ OBJ_SPORE, + /* 474 (0x1DA) */ OBJ_FRUIT_B, + /* 475 (0x1DB) */ OBJ_DIVINER_CRYSTAL, + /* 476 (0x1DC) */ TAG_NOEFFECT_AREA, + /* 477 (0x1DD) */ TAG_D3_SCENE_CHANGE, + /* 478 (0x1DE) */ OBJ_DECOA, + /* 479 (0x1DF) */ OBJ_DECOB, + /* 480 (0x1E0) */ OBJ_SANDBAG, + /* 481 (0x1E1) */ OBJ_PAINT, + /* 482 (0x1E2) */ OBJ_CONTROL_PANEL, + /* 483 (0x1E3) */ OBJ_UG_SWITCH, + /* 484 (0x1E4) */ OBJ_CLEARNESS_WALL, + /* 485 (0x1E5) */ OBJ_RUINED_SAVE, + /* 486 (0x1E6) */ OBJ_TRIFORCE, + /* 487 (0x1E7) */ OBJ_KANBAN_STONE, + /* 488 (0x1E8) */ TBOX, + /* 489 (0x1E9) */ OBJ_BUBBLE, + /* 490 (0x1EA) */ OBJ_VSD, + /* 491 (0x1EB) */ OBJ_SOIL, + /* 492 (0x1EC) */ OBJ_IVY_ROPE, + /* 493 (0x1ED) */ OBJ_GRASS_COIL, + /* 494 (0x1EE) */ OBJ_ROPE_IGAIGA, + /* 495 (0x1EF) */ OBJ_FIRE, + /* 496 (0x1F0) */ OBJ_TUBO, + /* 497 (0x1F1) */ OBJ_TUBO_BIG, + /* 498 (0x1F2) */ OBJ_CHAIR, + /* 499 (0x1F3) */ TIME_AREA, + /* 500 (0x1F4) */ OBJ_BLAST_ROCK, + /* 501 (0x1F5) */ OBJ_SW_DIR, + /* 502 (0x1F6) */ OBJ_SW_DIR_DOOR, + /* 503 (0x1F7) */ OBJ_SW_BANK, + /* 504 (0x1F8) */ OBJ_SW_BANK_SMALL, + /* 505 (0x1F9) */ T_FAIRY, + /* 506 (0x1FA) */ OBJ_FAIRY, + /* 507 (0x1FB) */ BIRD_MOB, + /* 508 (0x1FC) */ OBJ_BALLISTA_HANDLE, + /* 509 (0x1FD) */ OBJ_TIME_BOAT_BULLET, + /* 510 (0x1FE) */ OBJ_TIME_DOOR, + /* 511 (0x1FF) */ OBJ_TIME_DOOR_BEFORE, + /* 512 (0x200) */ TAG_TIME_DOOR_BEAM, + /* 513 (0x201) */ OBJ_COL, + /* 514 (0x202) */ OBJ_DAYNIGHT, + /* 515 (0x203) */ OBJ_BUILDING, + /* 516 (0x204) */ OBJ_OCT_GRASS, + /* 517 (0x205) */ OBJ_OCT_GRASS_LEAF, + /* 518 (0x206) */ OBJ_TUMBLE_WEED, + /* 519 (0x207) */ TUMBLE_WEED_TAG, + /* 520 (0x208) */ OBJ_FLOWER_ANCIENT, + /* 521 (0x209) */ OBJ_BARREL, + /* 522 (0x20A) */ OBJ_WARP, + /* 523 (0x20B) */ OBJ_WATER_MARK, + /* 524 (0x20C) */ OBJ_WATER_JAR, + /* 525 (0x20D) */ OBJ_STOPPING_ROPE, + /* 526 (0x20E) */ OBJ_TRAP_BIRD_WOOD, + /* 527 (0x20F) */ OBJ_TACKLE, + /* 528 (0x210) */ TACKLE_TAG, + /* 529 (0x211) */ OBJ_VORTEX, + /* 530 (0x212) */ OBJ_TOWER_BOMB, + /* 531 (0x213) */ OBJ_SEAT_SWORD, + /* 532 (0x214) */ OBJ_POLE_STONY, + /* 533 (0x215) */ OBJ_SWORD_CANDLE, + /* 534 (0x216) */ OBJ_SAVE, + /* 535 (0x217) */ OBJ_POOL_COCK, + /* 536 (0x218) */ OBJ_FIREWALL, + /* 537 (0x219) */ HARP_TAG, + /* 538 (0x21A) */ OBJ_SWORD_STAB, + /* 539 (0x21B) */ OBJ_GODDESS_CUBE, + /* 540 (0x21C) */ OBJ_TIME_BLOCK, + /* 541 (0x21D) */ OBJ_MOVE_ELEC, + /* 542 (0x21E) */ OBJ_LAVA_D201, + /* 543 (0x21F) */ OBJ_HARP_HINT, + /* 544 (0x220) */ OBJ_F302_LIGHT, + /* 545 (0x221) */ OBJ_TOD3_STONE, + /* 546 (0x222) */ OBJ_B300_SAND, + /* 547 (0x223) */ T_DOWSING, + /* 548 (0x224) */ T_MAP_MARK, + /* 549 (0x225) */ BEETLE_TAG, + /* 550 (0x226) */ EFFECT_GEN_TAG, + /* 551 (0x227) */ TAG_TIME_AREA_CHECK, + /* 552 (0x228) */ TAG_RESTART_TIME_STONE, + /* 553 (0x229) */ SHOP_SAMPLE, + /* 554 (0x22A) */ OBJ_TERRY_GIMMICK, + /* 555 (0x22B) */ OBJ_TERRY_SWITCH, + /* 556 (0x22C) */ OBJ_TERRY_HOLE, + /* 557 (0x22D) */ OBJ_TERRY_BIKE, + /* 558 (0x22E) */ OBJ_JUNK_REPAIR, + /* 559 (0x22F) */ CO_TEST, + /* 560 (0x230) */ OBJ_ARROW_SWITCH, + /* 561 (0x231) */ OBJ_VENT_FAN, + /* 562 (0x232) */ OBJ_ELECTRIC_LIGHT, + /* 563 (0x233) */ OBJ_WATER_SWITCH, + /* 564 (0x234) */ OBJ_ROTATION_LIGHT, + /* 565 (0x235) */ OBJ_HOLE_MINIGAME, + /* 566 (0x236) */ OBJ_CLOUD_DIVE, + /* 567 (0x237) */ OBJ_MUSASABI, + /* 568 (0x238) */ OBJ_FORTUNE_RING, + /* 569 (0x239) */ OBJ_BLOW_COAL, + /* 570 (0x23A) */ OBJ_SPIKE, + /* 571 (0x23B) */ OBJ_WATER_SPOUT, + /* 572 (0x23C) */ OBJ_SMOKE, + /* 573 (0x23D) */ OBJ_LIGHTHOUSE_LIGHT, + /* 574 (0x23E) */ OBJ_WATER_IGAIGA, + /* 575 (0x23F) */ OBJ_BLADE, + /* 576 (0x240) */ OBJ_FIRE_OBSTACLE, + /* 577 (0x241) */ OBJ_FIRE_PILLAR, + /* 578 (0x242) */ OBJ_GUARD_LOG, + /* 579 (0x243) */ OBJ_SLICE_LOG, + /* 580 (0x244) */ OBJ_SLICE_LOG_PARTS, + /* 581 (0x245) */ OBJ_STAGE_DEBRIS, + /* 582 (0x246) */ OBJ_GROUND_COVER, + /* 583 (0x247) */ OBJ_CUMUL_CLOUD, + /* 584 (0x248) */ OBJ_UNDER_CLOUD, + /* 585 (0x249) */ OBJ_WATERFALL_F102, + /* 586 (0x24A) */ OBJ_GOD_MARK, + /* 587 (0x24B) */ OBJ_IMPA_DOOR, + /* 588 (0x24C) */ OBJ_WATERFALL_D100, + /* 589 (0x24D) */ OBJ_GIRAHIM_FOOT, + /* 590 (0x24E) */ OBJ_ISLAND_LOD, + /* 591 (0x24F) */ OBJ_UTA_DEMO_PEDEST, + /* 592 (0x250) */ OBJ_LAVA_F200, + /* 593 (0x251) */ OBJ_ROPE_BASE, + /* 594 (0x252) */ OBJ_SUN_LIGHT, + /* 595 (0x253) */ OBJ_SIREN_2DMAP, + /* 596 (0x254) */ OBJ_DISPLAY_ONLY_NBS, + /* 597 (0x255) */ OBJ_AMBER, + /* 598 (0x256) */ OBJ_BIRD_STATUE, + /* 599 (0x257) */ OBJ_F400_GATE_LEAF, + /* 600 (0x258) */ OBJ_F400_GATE_SEAL, + /* 601 (0x259) */ OBJ_MAPPARTS, + /* 602 (0x25A) */ OBJ_RO_AT_TARGET, + /* 603 (0x25B) */ RO_AT_TAR_MANAGER_TAG, + /* 604 (0x25C) */ TAG_MUSASABI, + /* 605 (0x25D) */ TAG_MAP_INST, + /* 606 (0x25E) */ TAG_AUTO_MESSAGE, + /* 607 (0x25F) */ TAG_SHIP_SLOPE, + /* 608 (0x260) */ TAG_SHIP_FLOOD, + /* 609 (0x261) */ TAG_BARREL, + /* 610 (0x262) */ TAG_BARREL_POS, + /* 611 (0x263) */ TAG_HEAT_RESIST, + /* 612 (0x264) */ TAG_HOLY_WATER, + /* 613 (0x265) */ TAG_BELT_OBSTACLE, + /* 614 (0x266) */ TAG_DRUM, + /* 615 (0x267) */ TAG_ROLL_ATTACK_LOG, + /* 616 (0x268) */ TAG_SHIP_WINDOW, + /* 617 (0x269) */ ARROW, + /* 618 (0x26A) */ MASS_OBJ_TAG, + /* 619 (0x26B) */ SOUND_AREA_MGR, + /* 620 (0x26C) */ TAG_SOUND_AREA, + /* 621 (0x26D) */ ATT_TAG, + /* 622 (0x26E) */ TLP_TAG, + /* 623 (0x26F) */ SKYENEMY_T, + /* 624 (0x270) */ TOUCH_TAG, + /* 625 (0x271) */ CAMERA_TAG, + /* 626 (0x272) */ CAMERA2_TAG, + /* 627 (0x273) */ ACTION_TAG, + /* 628 (0x274) */ SC_CHANGE_TAG, + /* 629 (0x275) */ GATE2GND_TAG, + /* 630 (0x276) */ ALLDIE_TAG, + /* 631 (0x277) */ SW_TAG, + /* 632 (0x278) */ PL_RESTART, + /* 633 (0x279) */ SW_AREA_TAG, + /* 634 (0x27A) */ SIREN_TAG, + /* 635 (0x27B) */ TAG_TKEVNT, + /* 636 (0x27C) */ MOLE_PROHIBIT_TAG, + /* 637 (0x27D) */ TAG_DEFEAT_BOSS, + /* 638 (0x27E) */ TAG_TIMER, + /* 639 (0x27F) */ TAG_FENCE_SYNCHRONIZER, + /* 640 (0x280) */ TAG_GENKI_DOWSING_TARGET, + /* 641 (0x281) */ ITEM, + /* 642 (0x282) */ OBJ_ITEM_HEART_CONTAINER, + /* 643 (0x283) */ OBJ_CLEF, + /* 644 (0x284) */ OBJ_FRUIT_GUTS_LEAF, + /* 645 (0x285) */ OBJ_SWRD_PRJ, + /* 646 (0x286) */ OBJ_VACU_DUST_PARTS, + /* 647 (0x287) */ OBJ_VACU_DUST, + /* 648 (0x288) */ OBJ_RAIL_POST, + /* 649 (0x289) */ OBJ_RAIL_END, + /* 650 (0x28A) */ OBJ_TENI_RAIL, + /* 651 (0x28B) */ OBJ_TENI_RAIL_POST, + /* 652 (0x28C) */ OBJ_FORCE_SIGN, + /* 653 (0x28D) */ TAG_FORCE_GET_FLAG, + /* 654 (0x28E) */ TAG_CLEF_MANAGER, + /* 655 (0x28F) */ TAG_CLEF_GAME, + /* 656 (0x290) */ TAG_MINIGAME_INSECT_CAPTURE, + /* 657 (0x291) */ CAMERA, + /* 658 (0x292) */ WEATHER_TAG, + /* 659 (0x293) */ SPORE_TAG, + /* 660 (0x294) */ MIST_TAG, + /* 661 (0x295) */ SPARKS_TAG, + /* 662 (0x296) */ SPARKS2_TAG, + /* 663 (0x297) */ KYTAG_TAG, + /* 664 (0x298) */ LBTHUNDER_TAG, + /* 665 (0x299) */ PLTCHG_TAG, + /* 666 (0x29A) */ PLIGHT_TAG, + /* 667 (0x29B) */ VRBOX_TAG, + /* 668 (0x29C) */ NPC_INV, + /* 669 (0x29D) */ NPC_TKE, + /* 670 (0x29E) */ NPC_STR, + /* 671 (0x29F) */ MESSAGE_ACTOR, + /* 672 (0x2A0) */ LIGHT_OBJECT, + /* 673 (0x2A1) */ MESSAGE, + /* 674 (0x2A2) */ LYT_CONTROL_GAME, + /* 675 (0x2A3) */ LYT_DEMO_DOWSING, + /* 676 (0x2A4) */ LYT_CONTROL_TITLE, + /* 677 (0x2A5) */ LYT_DROP_LINE, + /* 678 (0x2A6) */ LYT_FORCE_LINE, + /* 679 (0x2A7) */ LYT_ENEMY_ICON, + /* 680 (0x2A8) */ LYT_MINI_GAME, + /* 681 (0x2A9) */ LYT_SUIRYU_SCORE, + /* 682 (0x2AA) */ LYT_SUIRYU_SCORE_COMP, + /* 683 (0x2AB) */ LYT_BOSS_CAPTION, + /* 684 (0x2AC) */ LYT_PAUSE, + /* 685 (0x2AD) */ LYT_GAMEOVER_MGR, + /* 686 (0x2AE) */ LYT_SAVE_MGR, + /* 687 (0x2AF) */ TITLE_MANAGER, + /* 688 (0x2B0) */ LYT_TITLE_BG, + /* 689 (0x2B1) */ LYT_SHOP, + /* 690 (0x2B2) */ LYT_DEPOSIT, + /* 691 (0x2B3) */ LYT_DEMO_TITLE, + /* 692 (0x2B4) */ LYT_END_ROLL, + /* 693 (0x2B5) */ LYT_SEEKER_STONE, + /* 694 (0x2B6) */ LYT_FILESELECT, + /* 695 (0x2B7) */ SKB, + /* 696 (0x2B8) */ EVENT_TAG, + /* 697 (0x2B9) */ EVENTF_TAG, + /* 698 (0x2BA) */ C_GAME, + /* 699 (0x2BB) */ C_BASE, + /* 700 (0x2BC) */ BOOT, + /* 701 (0x2BD) */ ROOM, + /* 702 (0x2BE) */ LAST, + /* 703 */ NUMBER_OF_ACTORS, + INVALID, +}; +}; diff --git a/include/f/f_tree_mg.h b/include/f/f_tree_mg.h index 87ef7814..724e4d01 100644 --- a/include/f/f_tree_mg.h +++ b/include/f/f_tree_mg.h @@ -1,10 +1,12 @@ #pragma once -// This file was ported from https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_tree_mg.hpp +// This file was ported from +// https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_tree_mg.hpp -#include "types.h" #include "c/c_tree.h" #include "f/f_profile.h" +#include + class fTrNdBa_c; @@ -27,4 +29,4 @@ public: * @return The found node, or @p nullptr if none was found. */ const fTrNdBa_c *searchNodeByGroupType(u8 groupType, const fTrNdBa_c *parent) const; -}; \ No newline at end of file +}; diff --git a/include/f/f_tree_mg_ptmf.h b/include/f/f_tree_mg_ptmf.h index ed0e0d91..ecfc682a 100644 --- a/include/f/f_tree_mg_ptmf.h +++ b/include/f/f_tree_mg_ptmf.h @@ -1,10 +1,12 @@ #pragma once -// This file was ported from https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_tree_mg_ptmf.hpp +// This file was ported from +// https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_tree_mg_ptmf.hpp -#include "types.h" #include "c/c_tree.h" #include "f/f_tree_mg.h" +#include + class fBase_c; @@ -22,4 +24,4 @@ public: private: int (fBase_c::*mpProcFunc)(); ///< The process function for the tree. -}; \ No newline at end of file +}; diff --git a/include/f/f_tree_nd.h b/include/f/f_tree_nd.h index 8aad0725..ca4eb791 100644 --- a/include/f/f_tree_nd.h +++ b/include/f/f_tree_nd.h @@ -1,10 +1,12 @@ #pragma once -// This file was ported from https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_tree_nd.hpp +// This file was ported from +// https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_tree_nd.hpp -#include "types.h" #include "c/c_tree.h" #include "f/f_profile.h" +#include + class fBase_c; @@ -13,28 +15,28 @@ public: fTrNdBa_c(fBase_c *owner) : p_owner(owner) {} fTrNdBa_c *getTreeNext() const { - return (fTrNdBa_c *) cTreeNd_c::getTreeNext(); + return (fTrNdBa_c *)cTreeNd_c::getTreeNext(); } fTrNdBa_c *getTreeNextNotChild() const { - return (fTrNdBa_c *) cTreeNd_c::getTreeNextNotChild(); + return (fTrNdBa_c *)cTreeNd_c::getTreeNextNotChild(); } fTrNdBa_c *getParent() const { - return (fTrNdBa_c *) cTreeNd_c::getParent(); + return (fTrNdBa_c *)cTreeNd_c::getParent(); } fTrNdBa_c *getChild() const { - return (fTrNdBa_c *) cTreeNd_c::getChild(); + return (fTrNdBa_c *)cTreeNd_c::getChild(); } fTrNdBa_c *getBrPrev() const { - return (fTrNdBa_c *) cTreeNd_c::getBrPrev(); + return (fTrNdBa_c *)cTreeNd_c::getBrPrev(); } fTrNdBa_c *getBrNext() const { - return (fTrNdBa_c *) cTreeNd_c::getBrNext(); + return (fTrNdBa_c *)cTreeNd_c::getBrNext(); } fBase_c *p_owner; -}; \ No newline at end of file +}; diff --git a/include/libc.h b/include/libc.h index 8de50d97..593affe0 100644 --- a/include/libc.h +++ b/include/libc.h @@ -1,11 +1,10 @@ #pragma once -#include "types.h" +#include extern "C" { -void* memset(void* dest, s32 value, u32 count); -void* memcpy(void* dest, const void* src, u32 count); -void* checkedMemcpy(void* dest, u16 destLen, const void* src, u16 count); - +void *memset(void *dest, s32 value, u32 count); +void *memcpy(void *dest, const void *src, u32 count); +void *checkedMemcpy(void *dest, u16 destLen, const void *src, u16 count); } diff --git a/include/m/m_angle.h b/include/m/m_angle.h index 72dfd5c4..2579ca87 100644 --- a/include/m/m_angle.h +++ b/include/m/m_angle.h @@ -1,18 +1,19 @@ #pragma once -#include "types.h" +#include struct mAng { - public: + mAng() {} + mAng(s16 s) : val(s) {} s16 val; }; class mAng3_c { - public: - s16 x,y,z; +public: + s16 x, y, z; void set(s16 fx, s16 fy, s16 fz) { x = fx; y = fy; z = fz; } -}; \ No newline at end of file +}; diff --git a/include/m/m_frustum.h b/include/m/m_frustum.h index f407bfc1..99d3aaa0 100644 --- a/include/m/m_frustum.h +++ b/include/m/m_frustum.h @@ -1,7 +1,5 @@ #pragma once -#include "types.h" +#include -class mFrustum_c { - -}; \ No newline at end of file +class mFrustum_c {}; diff --git a/include/m/m_math.h b/include/m/m_math.h new file mode 100644 index 00000000..8216b72e --- /dev/null +++ b/include/m/m_math.h @@ -0,0 +1,9 @@ +#ifndef M_MATH_H +#define M_MATH_H + +#include "m/m_vec.h" +#include "m/m_angle.h" +#include "m/m_mtx.h" +#include "m/m_quat.h" + +#endif diff --git a/include/m/m_mtx.h b/include/m/m_mtx.h index c7eee925..ca81b9f5 100644 --- a/include/m/m_mtx.h +++ b/include/m/m_mtx.h @@ -2,21 +2,16 @@ // NOTE:: Comments about functions pulled from NSMBW -#include "types.h" +#include "egg/math/eggMatrix.h" #include "m/m_angle.h" #include "nw4r/nw4r_types.h" +#include -class mMtx_c -{ -public: - f32 xx, xy, xz, xw; - f32 yx, yy, yz, yw; - f32 zx, zy, zz, zw; - mMtx_c() {}; - /* 802f1660 */ mMtx_c(f32 xx, f32 xy, f32 xz, f32 xw, \ - f32 yx, f32 yy, f32 yz, f32 yw, \ - f32 zx, f32 zy, f32 zz, f32 zw); +class mMtx_c { + mMtx_c(){}; + /* 802f1660 */ mMtx_c(f32 xx, f32 xy, f32 xz, f32 xw, f32 yx, f32 yy, f32 yz, f32 yw, f32 zx, f32 zy, f32 zz, + f32 zw); /* 802f16b0 */ void XrotS(mAng angle); ///< Generates a rotation matrix for the X axis with the given angle. /* 802f1770 */ void XrotM(mAng angle); ///< Rotates the matrix on the X axis by the given angle. @@ -25,18 +20,34 @@ public: /* 802f18d0 */ void ZrotS(mAng angle); ///< Generates a rotation matrix for the Z axis with the given angle. /* 802f1990 */ void ZrotM(mAng angle); ///< Rotates the matrix on the Z axis by the given angle. - /* 802f19e0 */ void ZXYrotS(mAng xRot, mAng yRot, mAng zRot); ///< Generates the matrix on the Y, X and Z axes by the given angles. - /* 802f1a40 */ void ZXYrotM(mAng xRot, mAng yRot, mAng zRot); ///< Rotates the matrix on the Y, X and Z axes by the given angles. - /* 802f1aa0 */ void XYZrotS(mAng xRot, mAng yRot, mAng zRot); ///< Generates the matrix on the Z, Y and X axes by the given angles. - /* 802f1b00 */ void XYZrotM(mAng xRot, mAng yRot, mAng zRot); ///< Rotates the matrix on the Z, Y and X axes by the given angles. + /* 802f19e0 */ void ZXYrotS(mAng xRot, mAng yRot, + mAng zRot); ///< Generates the matrix on the Y, X and Z axes by the given angles. + /* 802f1a40 */ void ZXYrotM(mAng xRot, mAng yRot, + mAng zRot); ///< Rotates the matrix on the Y, X and Z axes by the given angles. + /* 802f1aa0 */ void XYZrotS(mAng xRot, mAng yRot, + mAng zRot); ///< Generates the matrix on the Z, Y and X axes by the given angles. + /* 802f1b00 */ void XYZrotM(mAng xRot, mAng yRot, + mAng zRot); ///< Rotates the matrix on the Z, Y and X axes by the given angles. /* 802f1b60 */ void toRot(mAng3_c &out) const; ///< Converts the matrix to a rotation vector. void multVecZero(nw4r::math::VEC3 &out) const; ///< Converts the matrix to a vector. - void zero(); ///< Zeroes out the matrix. - + void zero(); ///< Zeroes out the matrix. + /* 802f1c40 */ void rot(int, int); // does some werrd operation to rotate the matrix /* 802f1e60 */ bool quatRelated(); +public: + union { + EGG::Matrix34f mat; + f32 m[3][4]; + struct { + f32 xx, xy, xz, xw; + f32 yx, yy, yz, yw; + f32 zx, zy, zz, zw; + }; + }; + +public: static mMtx_c Identity; }; diff --git a/include/m/m_vec.h b/include/m/m_vec.h index f091412b..96e3128a 100644 --- a/include/m/m_vec.h +++ b/include/m/m_vec.h @@ -1,83 +1,157 @@ #pragma once -#include "types.h" -#include "rvl/MTX.h" #include "egg/math/eggVector.h" +#include "rvl/MTX.h" +#include + class mVec3_c : public EGG::Vector3f { - public: - +public: /// @brief Constructs an empty vector. mVec3_c() {} /// @brief Constructs a vector from a float array. - mVec3_c(const f32 *p) { x = p[0]; y = p[1]; z = p[2]; } - mVec3_c(const mVec3_c& other) {x = other.x; y = other.y; z = other.z;} + mVec3_c(const f32 *p) { + x = p[0]; + y = p[1]; + z = p[2]; + } + mVec3_c(const mVec3_c &other) { + x = other.x; + y = other.y; + z = other.z; + } /// @brief Constructs a vector from three floating point values. - mVec3_c(f32 fx, f32 fy, f32 fz) { x = fx; y = fy; z = fz; } - - void set(f32 fx, f32 fy, f32 fz) { x = fx; y = fy; z = fz; } - mVec3_c& operator=(const mVec3_c& r) { x = r.x; y = r.y; z = r.z; return *this;} + mVec3_c(f32 fx, f32 fy, f32 fz) { + x = fx; + y = fy; + z = fz; + } + void set(f32 fx, f32 fy, f32 fz) { + x = fx; + y = fy; + z = fz; + } + mVec3_c &operator=(const mVec3_c &r) { + x = r.x; + y = r.y; + z = r.z; + return *this; + } /// @brief Constructs a new vector from an existing vector from the MTX library. - mVec3_c(const Vec &v) { x = v.x; y = v.y; z = v.z; } + mVec3_c(const Vec &v) { + x = v.x; + y = v.y; + z = v.z; + } /// @brief Constructs a new vector from an existing vector from the nw4r::math library. - mVec3_c(const nw4r::math::VEC3 &v) { x = v.x; y = v.y; z = v.z; } + mVec3_c(const nw4r::math::VEC3 &v) { + x = v.x; + y = v.y; + z = v.z; + } /// @brief Float cast operator. - operator f32*() { return &x; } + operator f32 *() { + return &x; + } /// @brief Const float cast operator. - operator const f32*() const { return &x; } + operator const f32 *() const { + return &x; + } /// @brief Vec cast operator. - operator Vec*() { return (Vec*)&x; } + operator Vec *() { + return (Vec *)&x; + } /// @brief Const Vec cast operator. - operator const Vec*() const { return (const Vec*)&x; } + operator const Vec *() const { + return (const Vec *)&x; + } /// @brief nw4r::math::VEC3 cast operator. - operator nw4r::math::VEC3*() { return (nw4r::math::VEC3*)&x; } + operator nw4r::math::VEC3 *() { + return (nw4r::math::VEC3 *)&x; + } /// @brief Const nw4r::math::VEC3 cast operator. - operator const nw4r::math::VEC3*() const { return (const nw4r::math::VEC3*)&x; } + operator const nw4r::math::VEC3 *() const { + return (const nw4r::math::VEC3 *)&x; + } /// @brief Augmented addition operator. - mVec3_c &operator+=(const mVec3_c &v) { x += v.x; y += v.y; z += v.z; return *this; } + mVec3_c &operator+=(const mVec3_c &v) { + x += v.x; + y += v.y; + z += v.z; + return *this; + } /// @brief Augmented subtraction operator. - mVec3_c &operator-=(const mVec3_c &v) { x -= v.x; y -= v.y; z -= v.z; return *this; } + mVec3_c &operator-=(const mVec3_c &v) { + x -= v.x; + y -= v.y; + z -= v.z; + return *this; + } /// @brief Augmented scalar product operator. - mVec3_c &operator*=(f32 f) { x *= f; y *= f; z *= f; return *this; } + mVec3_c &operator*=(f32 f) { + x *= f; + y *= f; + z *= f; + return *this; + } /// @brief Augmented scalar division operator. - mVec3_c &operator/=(f32 f) { return operator*=(1.0f / f); } + mVec3_c &operator/=(f32 f) { + return operator*=(1.0f / f); + } /// @brief Positive operator. - mVec3_c operator+() const { return *this; } + mVec3_c operator+() const { + return *this; + } /// @brief Negative operator. - mVec3_c operator-() const { return mVec3_c(-x, -y, -z); } + mVec3_c operator-() const { + return mVec3_c(-x, -y, -z); + } /// @brief Addition operator. - mVec3_c operator+(const mVec3_c &v) const { return mVec3_c(x + v.x, y + v.y, z + v.z); } + mVec3_c operator+(const mVec3_c &v) const { + return mVec3_c(x + v.x, y + v.y, z + v.z); + } /// @brief Subtraction operator. - mVec3_c operator-(const mVec3_c &v) const { return mVec3_c(x - v.x, y - v.y, z - v.z); } + mVec3_c operator-(const mVec3_c &v) const { + return mVec3_c(x - v.x, y - v.y, z - v.z); + } /// @brief Scalar product operator. - mVec3_c operator*(f32 f) const { return mVec3_c(f * x, f * y, f * z); } + mVec3_c operator*(f32 f) const { + return mVec3_c(f * x, f * y, f * z); + } /// @brief Scalar division operator. - mVec3_c operator/(f32 f) const { f32 r = 1.0f / f; return operator*(r); } + mVec3_c operator/(f32 f) const { + f32 r = 1.0f / f; + return operator*(r); + } /// @brief Equality operator. - bool operator==(const mVec3_c &v) const { return x == v.x && y == v.y && z == v.z; } + bool operator==(const mVec3_c &v) const { + return x == v.x && y == v.y && z == v.z; + } /// @brief Inequality operator. - bool operator!=(const mVec3_c &v) const { return x != v.x || y != v.y || z != v.z; } + bool operator!=(const mVec3_c &v) const { + return x != v.x || y != v.y || z != v.z; + } }; diff --git a/include/m/types_m.h b/include/m/types_m.h index 4dc6d4e2..d642784d 100644 --- a/include/m/types_m.h +++ b/include/m/types_m.h @@ -1,7 +1,6 @@ #pragma once -#include "types.h" - +#include class mFaderBase_c; class mFader_c; @@ -22,37 +21,36 @@ class mVec3_c; class mFrustum_c; namespace m2d { - class Layout_c; - class AnmResV2_c; - class AnmGroup_c; - class Simple_c; - class FrameCtrl_c; - class AnmGroupBase_c; - class Base_c; - class ResAccIf_c; +class Layout_c; +class AnmResV2_c; +class AnmGroup_c; +class Simple_c; +class FrameCtrl_c; +class AnmGroupBase_c; +class Base_c; +class ResAccIf_c; } // namespace m2d namespace m3d { - class mdl_c; // also contains ::callback_c ::mdlCallback_c - class smdl_c; - class bmdl_c; +class mdl_c; // also contains ::callback_c ::mdlCallback_c +class smdl_c; +class bmdl_c; - class scnLeaf_c; +class scnLeaf_c; - class banm_c; - class fanm_c; - - class anmChr_c; - class anmChrBlend_c; - class anmMatClr_c; // also contains ::child_c - class anmTexPat_c; // also contains ::child_c - class anmTexSrt_c; // also contains ::child_c +class banm_c; +class fanm_c; +class anmChr_c; +class anmChrBlend_c; +class anmMatClr_c; // also contains ::child_c +class anmTexPat_c; // also contains ::child_c +class anmTexSrt_c; // also contains ::child_c - class anmVis_c; +class anmVis_c; - class capture_c; - class calcRatio_c; +class capture_c; +class calcRatio_c; } // namespace m3d class mDvd_command_c; @@ -60,11 +58,10 @@ class mDvd_param_c; class mDvd_toMainRam_c; class mDvd_callback_c; class mDvd_mountMemArchive_c; -namespace mDvd -{ - class MyThread_c; +namespace mDvd { +class MyThread_c; - template // types are from EGG::StreamDecomp[LH/LRC/RL/LZ] - class TUncompressedInfo_c; +template // types are from EGG::StreamDecomp[LH/LRC/RL/LZ] +class TUncompressedInfo_c; } // namespace mDvd diff --git a/include/nw4r/db/db_directPrint.h b/include/nw4r/db/db_directPrint.h index 93e79cb4..cc574723 100644 --- a/include/nw4r/db/db_directPrint.h +++ b/include/nw4r/db/db_directPrint.h @@ -1,7 +1,7 @@ #pragma once -#include "types.h" -#include +#include +#include #include namespace nw4r { diff --git a/include/nw4r/g3d/g3d_resfile.h b/include/nw4r/g3d/g3d_resfile.h index 3f44eb0b..edcd9e5a 100644 --- a/include/nw4r/g3d/g3d_resfile.h +++ b/include/nw4r/g3d/g3d_resfile.h @@ -1,18 +1,15 @@ #pragma once -#include "types.h" +#include namespace nw4r { - namespace g3d { +namespace g3d { - struct ResFileData { +struct ResFileData {}; - }; +struct ResFile { + /* data */ +}; - struct ResFile - { - /* data */ - }; - - }; -}; \ No newline at end of file +}; // namespace g3d +}; // namespace nw4r diff --git a/include/nw4r/math/arithmetic.h b/include/nw4r/math/arithmetic.h new file mode 100644 index 00000000..caa97bba --- /dev/null +++ b/include/nw4r/math/arithmetic.h @@ -0,0 +1,111 @@ +#ifndef NW4R_MATH_ARITHMETIC_H +#define NW4R_MATH_ARITHMETIC_H + +#include +#include +#include + +namespace nw4r +{ + namespace math + { + namespace detail + { + f32 FExp(f32); + f32 FLog(f32); + } + + f32 FrSqrt(register f32); + + inline u32 F32AsU32(f32 x) + { + return *(u32 *)&x; + } + + inline f32 U32AsF32(u32 x) + { + return *(f32 *)&x; + } + + inline s32 FGetExpPart(f32 x) + { + u32 ul = F32AsU32(x); + return ((ul >> 23) & 0xFF) - 127; + } + + inline f32 FGetMantPart(f32 x) + { + u32 ul = F32AsU32(x); + return U32AsF32((ul & 0x807FFFFF) | 0x3F800000); + } + + inline float FFloor(float arg) + { + return floor(arg); + } + + inline float FModf(float arg, float * pIntegralPart) + { + double integralPart; + float fractionalPart = modf(arg, &integralPart); + + *pIntegralPart = integralPart; + + return fractionalPart; + } + + inline float FInv(register float arg) + { + register float tmp; + register float ret; + + asm + { + fres ret, arg + ps_add tmp, ret, ret + ps_mul ret, ret, ret + ps_nmsub ret, arg, ret, tmp + } + + return ret; + } + + inline f32 U16ToF32(u16 arg) + { + f32 ret; + + OSu16tof32(&arg, &ret); + + return ret; + } + + inline u16 F32ToU16(f32 arg) + { + u16 ret; + + OSf32tou16(&arg, &ret); + + return ret; + } + + inline f32 S16ToF32(s16 arg) + { + f32 ret; + + OSs16tof32(&arg, &ret); + + return ret; + } + + inline s16 F32ToS16(f32 arg) + { + s16 ret; + + OSf32tos16(&arg, &ret); + + return ret; + } + } +} + +#endif diff --git a/include/nw4r/nw4r_types.h b/include/nw4r/nw4r_types.h index 9dcd1846..1eb11924 100644 --- a/include/nw4r/nw4r_types.h +++ b/include/nw4r/nw4r_types.h @@ -1,197 +1,185 @@ #pragma once +namespace nw4r { +namespace ut { +template +struct TextWriterBase; +template +struct TagProcessorBase; -#include "types.h" +struct Color; +struct FileStream; -namespace nw4r -{ - namespace ut - { - template struct TextWriterBase; - template struct TagProcessorBase; - - struct Color; - struct FileStream; - - namespace detail - { - struct RuntimeTypeInfo; - } - } - - namespace ef - { - struct DrawOrder; - struct DrawInfo; - struct DrawStrategy; - struct DrawStrategyImpl; - struct DrawStrategyBuilder; - struct Effect; - struct EffectSystem; - struct EffectProject; - struct Emitter; - struct EmitterDrawSetting; - struct EmitFormBuilder; - struct ResEmitter; - struct EmitterResource; - struct EmitterForm; - struct EmitterInheritSetting; - struct Particle; - struct ParticleManager; - struct MemoryManager; - struct MemoryManagerBase; - } - - namespace math - { - class VEC2; - class VEC3; - class MTX33; - class MTX34; - class AABB; - class FRUSTUM; - } - - namespace snd - { - struct FxBase; - struct SoundPlayer; - struct SoundHandle; - struct SeqSoundHandle; - struct SoundArchive; - struct SoundArchivePlayer; - struct Sound3DActor; - struct Sound3DListener; - struct Sound3DManager; - struct SoundHandle; - struct StrmSoundHandle; - struct WaveSoundHandle; - - namespace detail - { - struct BasicSound; - struct BasicPlayer; - struct ChannelManager; - struct SeqSound; - struct SeqPlayer; - struct MmlParser; - struct MmlSeqTrack; - struct SeqTrack; - struct SeqTrackAllocator; - template struct SoundInstanceManager; - struct StrmBufferPool; - struct StrmSound; - struct NoteOnCallback; - struct PlayerHeap; - struct SoundArchiveFileReader; - struct SoundThread; - struct WaveSound; - struct StrmPlayer; - struct WsdPlayer; - } - } - - namespace g3d - { - struct AnmObjVis; - struct AnmObjVisNode; - struct AnmObjVisOR; - struct AnmObjVisRes; - struct AnmObj; - struct AnmObjChr; - struct FuncObjCalcWorld; - struct AnmScn; - struct AnmScnRes; - struct CameraAnmResult; - struct Draw1Mat1ShpSwap; - struct DrawResMdlReplacement; - struct FogAnmResult; - struct ResFile; - struct ResMdl; - struct ResPltt; - struct ResTex; - struct ResTexSrt; - struct ResMat; - struct ResTexPlttInfo; - struct ResShp; - struct ResFog; - struct ResAnmChr; - struct ResAnmVis; - struct ResAnmClr; - struct ResAnmTexPat; - struct ResAnmTexSrt; - struct ResAnmShp; - struct ResAnmScn; - struct ResAnmFog; - struct ResAnmCamera; - struct ResVtxPos; - struct ResVtxNrm; - struct ResVtxClr; - struct ResVtxTexCoord; - struct ClrAnmResult; - struct TexPatAnmResult; - struct TexSrtAnmResult; - struct ScnMdl1Mat1Shp; - struct TexSrt; - struct TexSrtTypedef; - struct LightObj; - struct LightAnmResult; - struct LightSet; - struct LightSetting; - struct LightSetData; - struct AmbLightObj; - struct AmbLightAnmResult; - struct Fog; - struct ScnRoot; - struct ScnProc; - struct ScnLeaf; - struct ScnObj; - struct ScnRfl; - struct ScnGroup; - struct ScnMdlSimple; - struct ScnMdl; - struct IScnObjGather; - struct IScnObjCallback; - - namespace G3DState - { - struct IndMtxOp; - } - } - - namespace lyt - { - struct Size; - - namespace detail - { - struct PaneBase; - struct TexCoordAry; - } - - namespace res - { - struct Group; - struct Pane; - struct Bounding; - struct AnimationBlock; - struct BinaryFileHeader; - } - - struct Group; - struct GroupContainer; - struct Pane; - struct DrawInfo; - struct AnimResource; - struct AnimTransform; - struct AnimTransformBasic; - struct AnimationLink; - struct ResourceAccessor; - struct ArcResourceAccessor; - struct FontRefLink; - struct Material; - struct Layout; - struct Bounding; - struct ResBlockSet; - struct TexMap; - } +namespace detail { +struct RuntimeTypeInfo; } +} // namespace ut + +namespace ef { +struct DrawOrder; +struct DrawInfo; +struct DrawStrategy; +struct DrawStrategyImpl; +struct DrawStrategyBuilder; +struct Effect; +struct EffectSystem; +struct EffectProject; +struct Emitter; +struct EmitterDrawSetting; +struct EmitFormBuilder; +struct ResEmitter; +struct EmitterResource; +struct EmitterForm; +struct EmitterInheritSetting; +struct Particle; +struct ParticleManager; +struct MemoryManager; +struct MemoryManagerBase; +} // namespace ef + +namespace math { +class VEC2; +class VEC3; +class MTX33; +class MTX34; +class AABB; +class FRUSTUM; +} // namespace math + +namespace snd { +struct FxBase; +struct SoundPlayer; +struct SoundHandle; +struct SeqSoundHandle; +struct SoundArchive; +struct SoundArchivePlayer; +struct Sound3DActor; +struct Sound3DListener; +struct Sound3DManager; +struct SoundHandle; +struct StrmSoundHandle; +struct WaveSoundHandle; + +namespace detail { +struct BasicSound; +struct BasicPlayer; +struct ChannelManager; +struct SeqSound; +struct SeqPlayer; +struct MmlParser; +struct MmlSeqTrack; +struct SeqTrack; +struct SeqTrackAllocator; +template +struct SoundInstanceManager; +struct StrmBufferPool; +struct StrmSound; +struct NoteOnCallback; +struct PlayerHeap; +struct SoundArchiveFileReader; +struct SoundThread; +struct WaveSound; +struct StrmPlayer; +struct WsdPlayer; +} // namespace detail +} // namespace snd + +namespace g3d { +struct AnmObjVis; +struct AnmObjVisNode; +struct AnmObjVisOR; +struct AnmObjVisRes; +struct AnmObj; +struct AnmObjChr; +struct FuncObjCalcWorld; +struct AnmScn; +struct AnmScnRes; +struct CameraAnmResult; +struct Draw1Mat1ShpSwap; +struct DrawResMdlReplacement; +struct FogAnmResult; +struct ResFile; +struct ResMdl; +struct ResPltt; +struct ResTex; +struct ResTexSrt; +struct ResMat; +struct ResTexPlttInfo; +struct ResShp; +struct ResFog; +struct ResAnmChr; +struct ResAnmVis; +struct ResAnmClr; +struct ResAnmTexPat; +struct ResAnmTexSrt; +struct ResAnmShp; +struct ResAnmScn; +struct ResAnmFog; +struct ResAnmCamera; +struct ResVtxPos; +struct ResVtxNrm; +struct ResVtxClr; +struct ResVtxTexCoord; +struct ClrAnmResult; +struct TexPatAnmResult; +struct TexSrtAnmResult; +struct ScnMdl1Mat1Shp; +struct TexSrt; +struct TexSrtTypedef; +struct LightObj; +struct LightAnmResult; +struct LightSet; +struct LightSetting; +struct LightSetData; +struct AmbLightObj; +struct AmbLightAnmResult; +struct Fog; +struct ScnRoot; +struct ScnProc; +struct ScnLeaf; +struct ScnObj; +struct ScnRfl; +struct ScnGroup; +struct ScnMdlSimple; +struct ScnMdl; +struct IScnObjGather; +struct IScnObjCallback; + +namespace G3DState { +struct IndMtxOp; +} +} // namespace g3d + +namespace lyt { +struct Size; + +namespace detail { +struct PaneBase; +struct TexCoordAry; +} // namespace detail + +namespace res { +struct Group; +struct Pane; +struct Bounding; +struct AnimationBlock; +struct BinaryFileHeader; +} // namespace res + +struct Group; +struct GroupContainer; +struct Pane; +struct DrawInfo; +struct AnimResource; +struct AnimTransform; +struct AnimTransformBasic; +struct AnimationLink; +struct ResourceAccessor; +struct ArcResourceAccessor; +struct FontRefLink; +struct Material; +struct Layout; +struct Bounding; +struct ResBlockSet; +struct TexMap; +} // namespace lyt +} // namespace nw4r diff --git a/include/nw4r/ut/Color.h b/include/nw4r/ut/Color.h index 91c2a2c6..57312e54 100644 --- a/include/nw4r/ut/Color.h +++ b/include/nw4r/ut/Color.h @@ -1,22 +1,21 @@ #pragma once -#include "types.h" #include "rvl/GX.h" +#include + + +namespace nw4r { +namespace ut { -namespace nw4r -{ -namespace ut -{ - struct Color : public _GXColor { Color() {} /* 80007bc0 */ ~Color(); Color(u32 color) { - *(u32*)this = color; + *(u32 *)this = color; } - Color& operator=(u32 color) { - *(u32*)this = color; + Color &operator=(u32 color) { + *(u32 *)this = color; return *this; } }; diff --git a/include/nw4r/ut/List.h b/include/nw4r/ut/List.h index f8dd23b2..194f67a8 100644 --- a/include/nw4r/ut/List.h +++ b/include/nw4r/ut/List.h @@ -2,7 +2,7 @@ // This file was ported from https://github.com/riidefi/mkw/blob/master/source/nw4r/ut/utList.hpp -#include "types.h" +#include // TODO: Doc file boundaries @@ -11,28 +11,28 @@ namespace ut { //! Bidirectional list node struct Node { - void* pred; - void* succ; + void *pred; + void *succ; }; // Unlike modern "std::list"-like structures, list nodes are directly inherited // by children, which saves a level of indirection. struct List { - void* head; - void* tail; - u16 count; - u16 intrusion_offset; + void *head; + void *tail; + u16 count; + u16 intrusion_offset; }; -void List_Init(List* pList, u16 intrusion_offset); -void List_Append(List* pList, void* pObj); -void List_Insert(List* pList, void* pTgt, void* pObj); -void List_Remove(List* pList, void* pObj); -void* List_GetNext(const List*, const void*); -void* List_GetPrev(const List*, const void*); -void* List_GetNth(const List* pList, unsigned short); -inline void* List_GetFirst(const List* pList) { - return List_GetNext(pList, nullptr); +void List_Init(List *pList, u16 intrusion_offset); +void List_Append(List *pList, void *pObj); +void List_Insert(List *pList, void *pTgt, void *pObj); +void List_Remove(List *pList, void *pObj); +void *List_GetNext(const List *, const void *); +void *List_GetPrev(const List *, const void *); +void *List_GetNth(const List *pList, unsigned short); +inline void *List_GetFirst(const List *pList) { + return List_GetNext(pList, nullptr); } // Seems to be not included as a symbol. Only inlined. // void List_Prepend(List* pList, void* pObj); diff --git a/include/rvl/AI/ai.h b/include/rvl/AI/ai.h index 5f331674..4ddf3854 100644 --- a/include/rvl/AI/ai.h +++ b/include/rvl/AI/ai.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_AI_H #define RVL_SDK_AI_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -16,13 +16,13 @@ typedef enum { } AIDSPSampleRate; AIDMACallback AIRegisterDMACallback(AIDMACallback callback); -void AIInitDMA(void* buffer, u32 length); +void AIInitDMA(void *buffer, u32 length); void AIStartDMA(void); u32 AIGetDMABytesLeft(void); void AISetDSPSampleRate(u32 rate); u32 AIGetDSPSampleRate(void); -void AIInit(void* stack); -void __AIDHandler(s16 intr, struct OSContext* ctx); +void AIInit(void *stack); +void __AIDHandler(s16 intr, struct OSContext *ctx); #ifdef __cplusplus } diff --git a/include/rvl/AI/ai_hardware.h b/include/rvl/AI/ai_hardware.h index f0b70415..c9630d43 100644 --- a/include/rvl/AI/ai_hardware.h +++ b/include/rvl/AI/ai_hardware.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_AI_HARDWARE_H #define RVL_SDK_AI_HARDWARE_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif diff --git a/include/rvl/ARC/arc.h b/include/rvl/ARC/arc.h index c9ff7795..6506800a 100644 --- a/include/rvl/ARC/arc.h +++ b/include/rvl/ARC/arc.h @@ -1,7 +1,7 @@ #pragma once #ifndef RVL_SDK_ARC_H #define RVL_SDK_ARC_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -51,49 +51,48 @@ typedef struct ARCHeader { } ARCHeader; typedef struct ARCHandle { - ARCHeader* header; // at 0x0 - ARCNode* nodes; // at 0x4 - u8* file; // at 0x8 + ARCHeader *header; // at 0x0 + ARCNode *nodes; // at 0x4 + u8 *file; // at 0x8 u32 count; // at 0xC - const char* strings; // at 0x10 + const char *strings; // at 0x10 u32 fstSize; // at 0x14 s32 entrynum; // at 0x18 } ARCHandle; typedef struct ARCFileInfo { - ARCHandle* handle; // at 0x0 + ARCHandle *handle; // at 0x0 u32 offset; // at 0x4 u32 size; // at 0x8 } ARCFileInfo; typedef struct ARCEntry { - ARCHandle* handle; // at 0x0 + ARCHandle *handle; // at 0x0 u32 path; // at 0x4 ARCEntryType type; // at 0x8 - const char* name; // at 0xC + const char *name; // at 0xC } ARCEntry; typedef struct ARCDirEntry { - ARCHandle* handle; // at 0x0 + ARCHandle *handle; // at 0x0 u32 path_begin; // at 0x4 u32 path_it; // at 0x8 u32 path_end; // at 0xC } ARCDirEntry; - -BOOL ARCGetCurrentDir(ARCHandle* handle, char* string, u32 maxlen); -BOOL ARCInitHandle(void* bin, ARCHandle* handle); -BOOL ARCOpen(ARCHandle* handle, const char* path, ARCFileInfo* info); -BOOL ARCFastOpen(ARCHandle* handle, s32 entrynum, ARCFileInfo* info); -s32 ARCConvertPathToEntrynum(ARCHandle* handle, const char* path); -void* ARCGetStartAddrInMem(ARCFileInfo* info); -s32 ARCGetStartOffset(ARCFileInfo* info); -u32 ARCGetLength(ARCFileInfo* info); -BOOL ARCClose(ARCFileInfo* info); -BOOL ARCChangeDir(ARCHandle* info, const char* path); -BOOL ARCOpenDir(ARCHandle* info, const char* path, ARCDirEntry* dir); -BOOL ARCReadDir(ARCDirEntry* dir, ARCEntry* entry); -BOOL ARCCloseDir(ARCDirEntry* dir); +BOOL ARCGetCurrentDir(ARCHandle *handle, char *string, u32 maxlen); +BOOL ARCInitHandle(void *bin, ARCHandle *handle); +BOOL ARCOpen(ARCHandle *handle, const char *path, ARCFileInfo *info); +BOOL ARCFastOpen(ARCHandle *handle, s32 entrynum, ARCFileInfo *info); +s32 ARCConvertPathToEntrynum(ARCHandle *handle, const char *path); +void *ARCGetStartAddrInMem(ARCFileInfo *info); +s32 ARCGetStartOffset(ARCFileInfo *info); +u32 ARCGetLength(ARCFileInfo *info); +BOOL ARCClose(ARCFileInfo *info); +BOOL ARCChangeDir(ARCHandle *info, const char *path); +BOOL ARCOpenDir(ARCHandle *info, const char *path, ARCDirEntry *dir); +BOOL ARCReadDir(ARCDirEntry *dir, ARCEntry *entry); +BOOL ARCCloseDir(ARCDirEntry *dir); #ifdef __cplusplus } diff --git a/include/rvl/BASE/PPCArch.h b/include/rvl/BASE/PPCArch.h index 5cce44a6..27cd1c6d 100644 --- a/include/rvl/BASE/PPCArch.h +++ b/include/rvl/BASE/PPCArch.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_PPC_ARCH_H #define RVL_SDK_PPC_ARCH_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -225,7 +225,7 @@ void PPCMthid4(u32 val); #define FPSCR_VE (1 << (31 - 24)) // IEEE floating-point overflow exception enable #define FPSCR_OE (1 << (31 - 25)) -// IEEE floating-point underflow exception enable +// IEEE floating-point underflow exception enable #define FPSCR_UE (1 << (31 - 26)) // IEEE floating-point zero divide exception enable #define FPSCR_ZE (1 << (31 - 27)) @@ -247,8 +247,7 @@ void PPCMthid4(u32 val); // Locked cache enable #define HID2_LCE (1 << (31 - 3)) // DMA queue length (read only) -#define HID2_DMAQL \ - ((1 << (31 - 4)) | (1 << (31 - 5)) | (1 << (31 - 6)) | (1 << (31 - 7))) +#define HID2_DMAQL ((1 << (31 - 4)) | (1 << (31 - 5)) | (1 << (31 - 6)) | (1 << (31 - 7))) // dcbz_l cache hit error #define HID2_DCHERR (1 << (31 - 8)) // DMA access to normal cache error diff --git a/include/rvl/CARD/CARD.h b/include/rvl/CARD/CARD.h index 27fe804d..f07e8b9f 100644 --- a/include/rvl/CARD/CARD.h +++ b/include/rvl/CARD/CARD.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_CARD_H #define RVL_SDK_CARD_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif diff --git a/include/rvl/CNT/cnt.h b/include/rvl/CNT/cnt.h index 2ab09fa7..23c6ca98 100644 --- a/include/rvl/CNT/cnt.h +++ b/include/rvl/CNT/cnt.h @@ -1,7 +1,7 @@ #ifndef RVL_SDK_CNT_H #define RVL_SDK_CNT_H #include "rvl/ARC.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -12,17 +12,17 @@ typedef struct CNTHandle { } CNTHandle; typedef struct CNTFileInfo { - CNTHandle* handle; // at 0x0 + CNTHandle *handle; // at 0x0 u32 offset; // at 0x4 u32 length; // at 0x8 u32 position; // at 0xC } CNTFileInfo; -s32 contentFastOpenNAND(CNTHandle* handle, s32 entrynum, CNTFileInfo* info); -s32 contentConvertPathToEntrynumNAND(CNTHandle* handle, const char* path); -u32 contentGetLengthNAND(CNTFileInfo* info); -s32 contentReadNAND(CNTFileInfo* info, void* dst, s32 len, s32 offset); -s32 contentCloseNAND(CNTFileInfo* info); +s32 contentFastOpenNAND(CNTHandle *handle, s32 entrynum, CNTFileInfo *info); +s32 contentConvertPathToEntrynumNAND(CNTHandle *handle, const char *path); +u32 contentGetLengthNAND(CNTFileInfo *info); +s32 contentReadNAND(CNTFileInfo *info, void *dst, s32 len, s32 offset); +s32 contentCloseNAND(CNTFileInfo *info); #ifdef __cplusplus } diff --git a/include/rvl/CX/cx.h b/include/rvl/CX/cx.h index 2f3fdae9..66b75bd3 100644 --- a/include/rvl/CX/cx.h +++ b/include/rvl/CX/cx.h @@ -1,6 +1,6 @@ #pragma once -#include "types.h" +#include // .text: [0x803cee90, 0x803d0b20] @@ -19,20 +19,20 @@ typedef struct CXUncompContextRL { typedef struct CXUncompContextLH { // u8 _[0x8a8]; // taken from xenoblade - u8* destp; - s32 destCount; - s32 forceDestCount; - u16 huffTable9[1 << (9 + 1)]; - u16 huffTable12[1 << (5 + 1)]; - u16* nodep; - s32 tableSize9; - s32 tableSize12; - u32 tableIdx; - u32 stream; - u32 stream_len; - u16 length; - s8 offset_bits; - u8 headerSize; + u8 *destp; + s32 destCount; + s32 forceDestCount; + u16 huffTable9[1 << (9 + 1)]; + u16 huffTable12[1 << (5 + 1)]; + u16 *nodep; + s32 tableSize9; + s32 tableSize12; + u32 tableIdx; + u32 stream; + u32 stream_len; + u16 length; + s8 offset_bits; + u8 headerSize; } CXUncompContextLH; typedef struct CXUncompContextLRC { @@ -55,7 +55,6 @@ typedef struct CXUncompContextLRC { /* 803d07d0 */ void CXUncompressLZ(); /* 803d0920 */ void CXiLHVerifyTable(); - #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/include/rvl/DB/db.h b/include/rvl/DB/db.h index 7e4ab69d..13259afd 100644 --- a/include/rvl/DB/db.h +++ b/include/rvl/DB/db.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_DB_H #define RVL_SDK_DB_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -12,7 +12,7 @@ void DBInit(void); void __DBExceptionDestinationAux(void); void __DBExceptionDestination(void); BOOL __DBIsExceptionMarked(u8 exc); -void DBPrintf(const char* msg, ...); +void DBPrintf(const char *msg, ...); #ifdef __cplusplus } diff --git a/include/rvl/DSP/dsp.h b/include/rvl/DSP/dsp.h index d0caf527..c22f37c8 100644 --- a/include/rvl/DSP/dsp.h +++ b/include/rvl/DSP/dsp.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_DSP_H #define RVL_SDK_DSP_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -9,7 +9,7 @@ extern "C" { typedef struct DSPTask; // General-purpose typedef -typedef void* DSPMail; +typedef void *DSPMail; BOOL DSPCheckMailToDSP(void); BOOL DSPCheckMailFromDSP(void); @@ -18,8 +18,8 @@ void DSPSendMailToDSP(DSPMail mail); void DSPAssertInt(void); void DSPInit(void); BOOL DSPCheckInit(void); -struct DSPTask* DSPAddTask(struct DSPTask* task); -struct DSPTask* DSPAssertTask(struct DSPTask* task); +struct DSPTask *DSPAddTask(struct DSPTask *task); +struct DSPTask *DSPAssertTask(struct DSPTask *task); #ifdef __cplusplus } diff --git a/include/rvl/DSP/dsp_debug.h b/include/rvl/DSP/dsp_debug.h index a1259d06..1390d7c0 100644 --- a/include/rvl/DSP/dsp_debug.h +++ b/include/rvl/DSP/dsp_debug.h @@ -1,11 +1,11 @@ #ifndef RVL_SDK_DSP_DEBUG_H #define RVL_SDK_DSP_DEBUG_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif -void __DSP_debug_printf(const char* fmt, ...); +void __DSP_debug_printf(const char *fmt, ...); #ifdef __cplusplus } diff --git a/include/rvl/DSP/dsp_hardware.h b/include/rvl/DSP/dsp_hardware.h index 51fdbe54..34797cca 100644 --- a/include/rvl/DSP/dsp_hardware.h +++ b/include/rvl/DSP/dsp_hardware.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_DSP_HARDWARE_H #define RVL_SDK_DSP_HARDWARE_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif diff --git a/include/rvl/DSP/dsp_task.h b/include/rvl/DSP/dsp_task.h index c56ad6d2..98444616 100644 --- a/include/rvl/DSP/dsp_task.h +++ b/include/rvl/DSP/dsp_task.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_DSP_TASK_H #define RVL_SDK_DSP_TASK_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -21,15 +21,15 @@ typedef enum { DSP_TASK_STATE_3, } DSPTaskState; -typedef void (*DSPTaskCallback)(struct DSPTask* task); +typedef void (*DSPTaskCallback)(struct DSPTask *task); typedef struct DSPTask { u32 state; // at 0x0 u32 prio; // at 0x4 u32 flags; // at 0x8 - void* iramMmemAddr; // at 0xC + void *iramMmemAddr; // at 0xC u32 iramMmemLen; // at 0x10 - void* iramDspAddr; // at 0x14 + void *iramDspAddr; // at 0x14 u32 iramDspLen; // at 0x18 u32 dramMmemLen; // at 0x1C UNKWORD WORD_0x20; @@ -39,22 +39,22 @@ typedef struct DSPTask { DSPTaskCallback resumeCallback; // at 0x2C DSPTaskCallback doneCallback; // at 0x30 DSPTaskCallback requestCallback; // at 0x34 - struct DSPTask* next; // at 0x38 - struct DSPTask* prev; // at 0x3C + struct DSPTask *next; // at 0x38 + struct DSPTask *prev; // at 0x3C } DSPTask; extern BOOL __DSP_rude_task_pending; -extern DSPTask* __DSP_rude_task; -extern DSPTask* __DSP_tmp_task; -extern DSPTask* __DSP_last_task; -extern DSPTask* __DSP_first_task; -extern DSPTask* __DSP_curr_task; +extern DSPTask *__DSP_rude_task; +extern DSPTask *__DSP_tmp_task; +extern DSPTask *__DSP_last_task; +extern DSPTask *__DSP_first_task; +extern DSPTask *__DSP_curr_task; -void __DSPHandler(s16 intr, struct OSContext* ctx); -void __DSP_exec_task(DSPTask* task1, DSPTask* task2); -void __DSP_boot_task(DSPTask* task); -void __DSP_insert_task(DSPTask* task); -void __DSP_remove_task(DSPTask* task); +void __DSPHandler(s16 intr, struct OSContext *ctx); +void __DSP_exec_task(DSPTask *task1, DSPTask *task2); +void __DSP_boot_task(DSPTask *task); +void __DSP_insert_task(DSPTask *task); +void __DSP_remove_task(DSPTask *task); #ifdef __cplusplus } diff --git a/include/rvl/DVD/dvd.h b/include/rvl/DVD/dvd.h index ac91ac08..254cdf12 100644 --- a/include/rvl/DVD/dvd.h +++ b/include/rvl/DVD/dvd.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_DVD_H #define RVL_SDK_DVD_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -21,16 +21,16 @@ typedef struct DVDDriveInfo { char padding[32 - 0x8]; } DVDDriveInfo; -typedef void (*DVDInquiryCallback)(s32, DVDDriveBlock*); +typedef void (*DVDInquiryCallback)(s32, DVDDriveBlock *); void DVDInit(void); -BOOL DVDInquiryAsync(DVDDriveBlock*, DVDDriveInfo*, DVDInquiryCallback); +BOOL DVDInquiryAsync(DVDDriveBlock *, DVDDriveInfo *, DVDInquiryCallback); u32 __DVDGetCoverStatus(void); void __DVDPrepareReset(void); -BOOL __DVDTestAlarm(struct OSAlarm*); +BOOL __DVDTestAlarm(struct OSAlarm *); #ifdef __cplusplus } diff --git a/include/rvl/DVD/dvd_broadway.h b/include/rvl/DVD/dvd_broadway.h index 2946ef4d..6329e2f0 100644 --- a/include/rvl/DVD/dvd_broadway.h +++ b/include/rvl/DVD/dvd_broadway.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_DVD_BROADWAY_H #define RVL_SDK_DVD_BROADWAY_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -30,21 +30,19 @@ typedef enum { typedef void (*DVDLowCallback)(u32 intType); BOOL DVDLowInit(void); -BOOL DVDLowReadDiskID(struct DVDDiskID* out, DVDLowCallback callback); -BOOL DVDLowOpenPartition(u32 offset, const struct ESPTicket* ticket, - u32 certsSize, const void* certs, struct ESPTmd* tmd, - DVDLowCallback callback); +BOOL DVDLowReadDiskID(struct DVDDiskID *out, DVDLowCallback callback); +BOOL DVDLowOpenPartition(u32 offset, const struct ESPTicket *ticket, u32 certsSize, const void *certs, + struct ESPTmd *tmd, DVDLowCallback callback); BOOL DVDLowClosePartition(DVDLowCallback callback); -BOOL DVDLowUnencryptedRead(void* dst, u32 size, u32 offset, - DVDLowCallback callback); +BOOL DVDLowUnencryptedRead(void *dst, u32 size, u32 offset, DVDLowCallback callback); BOOL DVDLowStopMotor(BOOL eject, BOOL kill, DVDLowCallback callback); -BOOL DVDLowInquiry(struct DVDDriveInfo* out, DVDLowCallback callback); +BOOL DVDLowInquiry(struct DVDDriveInfo *out, DVDLowCallback callback); BOOL DVDLowRequestError(DVDLowCallback callback); BOOL DVDLowSetSpinupFlag(BOOL enable); BOOL DVDLowReset(DVDLowCallback callback); BOOL DVDLowAudioBufferConfig(BOOL enable, u32 size, DVDLowCallback callback); BOOL DVDLowSetMaximumRotation(u32 speed, DVDLowCallback callback); -BOOL DVDLowRead(void* dst, u32 size, u32 offset, DVDLowCallback callback); +BOOL DVDLowRead(void *dst, u32 size, u32 offset, DVDLowCallback callback); BOOL DVDLowSeek(u32 offset, DVDLowCallback callback); u32 DVDLowGetCoverRegister(void); BOOL DVDLowPrepareCoverRegister(DVDLowCallback callback); @@ -52,7 +50,7 @@ u32 DVDLowGetImmBufferReg(void); BOOL DVDLowUnmaskStatusInterrupts(void); BOOL DVDLowMaskCoverInterrupt(void); BOOL DVDLowClearCoverInterrupt(DVDLowCallback callback); -BOOL __DVDLowTestAlarm(const struct OSAlarm* alarm); +BOOL __DVDLowTestAlarm(const struct OSAlarm *alarm); #ifdef __cplusplus } diff --git a/include/rvl/DVD/dvdfatal.h b/include/rvl/DVD/dvdfatal.h index cfc501f4..c221c498 100644 --- a/include/rvl/DVD/dvdfatal.h +++ b/include/rvl/DVD/dvdfatal.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_DVD_FATAL_H #define RVL_SDK_DVD_FATAL_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif diff --git a/include/rvl/DVD/dvdfs.h b/include/rvl/DVD/dvdfs.h index 4cf52d1a..7458692c 100644 --- a/include/rvl/DVD/dvdfs.h +++ b/include/rvl/DVD/dvdfs.h @@ -1,39 +1,37 @@ #ifndef RVL_SDK_DVD_FS_H #define RVL_SDK_DVD_FS_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif extern BOOL __DVDLongFileNameFlag; -typedef void (*DVDCommandCallback)(s32, struct DVDCommandBlock*); -typedef void (*DVDFileCallback)(s32, struct DVDFileInfo*); +typedef void (*DVDCommandCallback)(s32, struct DVDCommandBlock *); +typedef void (*DVDFileCallback)(s32, struct DVDFileInfo *); typedef struct DVDCommandBlock { - /* 0x00 */ struct DVDCommandBlock* next; - /* 0x04 */ struct DVDCommandBlock* prev; + /* 0x00 */ struct DVDCommandBlock *next; + /* 0x04 */ struct DVDCommandBlock *prev; /* 0x08 */ u32 command; /* 0x0c */ s32 state; /* 0x10 */ u32 offset; /* 0x14 */ u32 length; - /* 0x18 */ void* addr; + /* 0x18 */ void *addr; /* 0x1c */ u32 currTransferSize; /* 0x20 */ u32 transferredSize; - /* 0x24 */ DVDDiskID* id; + /* 0x24 */ DVDDiskID *id; /* 0x28 */ DVDCommandCallback callback; - /* 0x2c */ void* userData; + /* 0x2c */ void *userData; } DVDCommandBlock; -typedef struct DVDFileInfo -{ - /* 0x00 */ DVDCommandBlock cb; - /* 0x30 */ u32 startAddr; +typedef struct DVDFileInfo { + /* 0x00 */ DVDCommandBlock cb; + /* 0x30 */ u32 startAddr; /* 0x34 */ u32 length; - /* 0x38 */ DVDFileCallback* callback; + /* 0x38 */ DVDFileCallback *callback; } DVDFileInfo; - #ifdef __cplusplus } #endif diff --git a/include/rvl/DVD/dvdidutils.h b/include/rvl/DVD/dvdidutils.h index e2852eeb..2dceb761 100644 --- a/include/rvl/DVD/dvdidutils.h +++ b/include/rvl/DVD/dvdidutils.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_DVD_ID_UTILS_H #define RVL_SDK_DVD_ID_UTILS_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -17,7 +17,7 @@ typedef struct DVDDiskID { u32 gcMagic; // at 0x1C } DVDDiskID; -BOOL DVDCompareDiskID(const DVDDiskID* id1, const DVDDiskID* id2); +BOOL DVDCompareDiskID(const DVDDiskID *id1, const DVDDiskID *id2); #ifdef __cplusplus } diff --git a/include/rvl/ESP/esp.h b/include/rvl/ESP/esp.h index a36ff9c5..f28c7db7 100644 --- a/include/rvl/ESP/esp.h +++ b/include/rvl/ESP/esp.h @@ -2,7 +2,7 @@ #define RVL_SDK_ESP_H #include "rvl/ARC.h" #include "rvl/IPC.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -25,7 +25,7 @@ typedef struct ESPTmd { char padding[0x4A00 - 0x49E4]; } ESPTmd; -s32 ESP_ReadContentFile(UNKWORD, void*, u32); +s32 ESP_ReadContentFile(UNKWORD, void *, u32); s32 ESP_SeekContentFile(UNKWORD, s32, UNKWORD); #ifdef __cplusplus diff --git a/include/rvl/EXI/EXIBios.h b/include/rvl/EXI/EXIBios.h index d13fb52c..9438d77d 100644 --- a/include/rvl/EXI/EXIBios.h +++ b/include/rvl/EXI/EXIBios.h @@ -1,7 +1,7 @@ #ifndef RVL_SDK_EXI_BIOS_H #define RVL_SDK_EXI_BIOS_H #include "rvl/EXI/EXICommon.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -26,7 +26,7 @@ typedef struct EXIData { EXICallback extCallback; // at 0x8 volatile s32 state; // at 0xC s32 bytesRead; // at 0x10 - void* buffer; // at 0x14 + void *buffer; // at 0x14 u32 dev; // at 0x18 u32 id; // at 0x1C UNKWORD WORD_0x20; @@ -34,11 +34,9 @@ typedef struct EXIData { EXIItem items[3]; // at 0x28 } EXIData; -BOOL EXIImm(EXIChannel chan, void* buf, s32 len, u32 type, - EXICallback callback); -BOOL EXIImmEx(EXIChannel chan, void* buf, s32 len, u32 type); -BOOL EXIDma(EXIChannel chan, void* buf, s32 len, u32 type, - EXICallback callback); +BOOL EXIImm(EXIChannel chan, void *buf, s32 len, u32 type, EXICallback callback); +BOOL EXIImmEx(EXIChannel chan, void *buf, s32 len, u32 type); +BOOL EXIDma(EXIChannel chan, void *buf, s32 len, u32 type, EXICallback callback); BOOL EXISync(EXIChannel chan); void EXIClearInterrupts(EXIChannel chan, BOOL exi, BOOL tc, BOOL ext); EXICallback EXISetExiCallback(EXIChannel chan, EXICallback callback); @@ -51,7 +49,7 @@ BOOL EXIDeselect(EXIChannel chan); void EXIInit(void); BOOL EXILock(EXIChannel chan, u32 dev, EXICallback callback); BOOL EXIUnlock(EXIChannel chan); -s32 EXIGetID(EXIChannel chan, u32 dev, u32* out); +s32 EXIGetID(EXIChannel chan, u32 dev, u32 *out); #ifdef __cplusplus } diff --git a/include/rvl/EXI/EXICommon.h b/include/rvl/EXI/EXICommon.h index dbad73d6..698964f9 100644 --- a/include/rvl/EXI/EXICommon.h +++ b/include/rvl/EXI/EXICommon.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_EXI_COMMON_H #define RVL_SDK_EXI_COMMON_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -22,17 +22,15 @@ typedef enum { EXI_CHAN_0, EXI_CHAN_1, EXI_CHAN_2, EXI_MAX_CHAN } EXIChannel; typedef enum { EXI_READ, EXI_WRITE, EXI_TYPE_2, EXI_MAX_TYPE } EXIType; -typedef void (*EXICallback)(EXIChannel chan, struct OSContext* ctx); +typedef void (*EXICallback)(EXIChannel chan, struct OSContext *ctx); extern const u32 __EXIFreq; static u32 __EXISwap32(u32 val) { - return val >> 24 & 0x000000FF | val >> 8 & 0x0000FF00 | - val << 8 & 0x00FF0000 | val << 24 & 0xFF000000; + return val >> 24 & 0x000000FF | val >> 8 & 0x0000FF00 | val << 8 & 0x00FF0000 | val << 24 & 0xFF000000; } -BOOL EXIWriteReg(EXIChannel chan, u32 dev, UNKWORD r5, const void* buf, - s32 len); +BOOL EXIWriteReg(EXIChannel chan, u32 dev, UNKWORD r5, const void *buf, s32 len); #ifdef __cplusplus } diff --git a/include/rvl/EXI/EXIHardware.h b/include/rvl/EXI/EXIHardware.h index defbc980..75f949d3 100644 --- a/include/rvl/EXI/EXIHardware.h +++ b/include/rvl/EXI/EXIHardware.h @@ -1,7 +1,7 @@ #ifndef RVL_SDK_EXI_HARDWARE_H #define RVL_SDK_EXI_HARDWARE_H #include "rvl/EXI/EXICommon.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -12,7 +12,7 @@ extern "C" { */ typedef struct ExiChannelControl { u32 csr; // at 0x0 - void* dmaAddr; // at 0x4 + void *dmaAddr; // at 0x4 u32 dmaLen; // at 0x8 u32 cr; // at 0xC u32 imm; // at 0x10 diff --git a/include/rvl/EXI/EXIUart.h b/include/rvl/EXI/EXIUart.h index 0a4a5c2e..f1f8be6a 100644 --- a/include/rvl/EXI/EXIUart.h +++ b/include/rvl/EXI/EXIUart.h @@ -1,7 +1,7 @@ #ifndef RVL_SDK_EXI_UART_H #define RVL_SDK_EXI_UART_H #include "rvl/EXI/EXIBios.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif diff --git a/include/rvl/FS/fs.h b/include/rvl/FS/fs.h index 8ed45994..bc15158c 100644 --- a/include/rvl/FS/fs.h +++ b/include/rvl/FS/fs.h @@ -1,14 +1,14 @@ #ifndef RVL_SDK_FS_H #define RVL_SDK_FS_H #include "rvl/IPC.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif #define FS_MAX_PATH 64 -typedef void (*FSAsyncCallback)(s32 result, void* arg); +typedef void (*FSAsyncCallback)(s32 result, void *arg); typedef struct FSStats { char UNK_0x0[0x1C]; @@ -21,51 +21,36 @@ typedef struct FSFileStats { } FSFileStats ALIGN(32); s32 ISFS_OpenLib(void); -s32 ISFS_CreateDir(const char* path, u32 attr, u32 ownerPerm, u32 groupPerm, - u32 otherPerm); -s32 ISFS_CreateDirAsync(const char* path, u32 attr, u32 ownerPerm, - u32 groupPerm, u32 otherPerm, FSAsyncCallback callback, - void* callbackArg); -s32 ISFS_ReadDir(const char* path, char* filesOut, u32* fileCountOut); -s32 ISFS_ReadDirAsync(const char* path, char* filesOut, u32* fileCountOut, - FSAsyncCallback callback, void* callbackArg); -s32 ISFS_GetAttr(const char* path, u32* ownerIdOut, u16* groupIdOut, - u32* attrOut, u32* ownerPermOut, u32* groupPermOut, - u32* otherPermOut); -s32 ISFS_GetAttrAsync(const char* path, u32* ownerIdOut, u16* groupIdOut, - u32* attrOut, u32* ownerPermOut, u32* groupPermOut, - u32* otherPermOut, FSAsyncCallback callback, - void* callbackArg); -s32 ISFS_Delete(const char* path); -s32 ISFS_DeleteAsync(const char* path, FSAsyncCallback callback, - void* callbackArg); -s32 ISFS_Rename(const char* from, const char* to); -s32 ISFS_RenameAsync(const char* from, const char* to, FSAsyncCallback callback, - void* callbackArg); -s32 ISFS_GetUsage(const char* path, s32* blockCountOut, s32* fileCountOut); -s32 ISFS_CreateFile(const char* path, u32 attr, u32 ownerPerm, u32 groupPerm, - u32 otherPerm); -s32 ISFS_CreateFileAsync(const char* path, u32 attr, u32 ownerPerm, - u32 groupPerm, u32 otherPerm, FSAsyncCallback callback, - void* callbackArg); -s32 ISFS_Open(const char* path, IPCOpenMode mode); -s32 ISFS_OpenAsync(const char* path, IPCOpenMode mode, FSAsyncCallback callback, - void* callbackArg); -s32 ISFS_GetFileStats(s32 fd, FSFileStats* statsOut); -s32 ISFS_GetFileStatsAsync(s32 fd, FSFileStats* statsOut, - FSAsyncCallback callback, void* callbackArg); +s32 ISFS_CreateDir(const char *path, u32 attr, u32 ownerPerm, u32 groupPerm, u32 otherPerm); +s32 ISFS_CreateDirAsync(const char *path, u32 attr, u32 ownerPerm, u32 groupPerm, u32 otherPerm, + FSAsyncCallback callback, void *callbackArg); +s32 ISFS_ReadDir(const char *path, char *filesOut, u32 *fileCountOut); +s32 ISFS_ReadDirAsync(const char *path, char *filesOut, u32 *fileCountOut, FSAsyncCallback callback, void *callbackArg); +s32 ISFS_GetAttr(const char *path, u32 *ownerIdOut, u16 *groupIdOut, u32 *attrOut, u32 *ownerPermOut, u32 *groupPermOut, + u32 *otherPermOut); +s32 ISFS_GetAttrAsync(const char *path, u32 *ownerIdOut, u16 *groupIdOut, u32 *attrOut, u32 *ownerPermOut, + u32 *groupPermOut, u32 *otherPermOut, FSAsyncCallback callback, void *callbackArg); +s32 ISFS_Delete(const char *path); +s32 ISFS_DeleteAsync(const char *path, FSAsyncCallback callback, void *callbackArg); +s32 ISFS_Rename(const char *from, const char *to); +s32 ISFS_RenameAsync(const char *from, const char *to, FSAsyncCallback callback, void *callbackArg); +s32 ISFS_GetUsage(const char *path, s32 *blockCountOut, s32 *fileCountOut); +s32 ISFS_CreateFile(const char *path, u32 attr, u32 ownerPerm, u32 groupPerm, u32 otherPerm); +s32 ISFS_CreateFileAsync(const char *path, u32 attr, u32 ownerPerm, u32 groupPerm, u32 otherPerm, + FSAsyncCallback callback, void *callbackArg); +s32 ISFS_Open(const char *path, IPCOpenMode mode); +s32 ISFS_OpenAsync(const char *path, IPCOpenMode mode, FSAsyncCallback callback, void *callbackArg); +s32 ISFS_GetFileStats(s32 fd, FSFileStats *statsOut); +s32 ISFS_GetFileStatsAsync(s32 fd, FSFileStats *statsOut, FSAsyncCallback callback, void *callbackArg); s32 ISFS_Seek(s32 fd, s32 offset, IPCSeekMode mode); -s32 ISFS_SeekAsync(s32 fd, s32 offset, IPCSeekMode mode, - FSAsyncCallback callback, void* callbackArg); -s32 ISFS_Read(s32 fd, void* dst, s32 len); -s32 ISFS_ReadAsync(s32 fd, void* dst, s32 len, FSAsyncCallback callback, - void* callbackArg); -s32 ISFS_Write(s32 fd, const void* src, s32 len); -s32 ISFS_WriteAsync(s32 fd, const void* src, s32 len, FSAsyncCallback callback, - void* callbackArg); +s32 ISFS_SeekAsync(s32 fd, s32 offset, IPCSeekMode mode, FSAsyncCallback callback, void *callbackArg); +s32 ISFS_Read(s32 fd, void *dst, s32 len); +s32 ISFS_ReadAsync(s32 fd, void *dst, s32 len, FSAsyncCallback callback, void *callbackArg); +s32 ISFS_Write(s32 fd, const void *src, s32 len); +s32 ISFS_WriteAsync(s32 fd, const void *src, s32 len, FSAsyncCallback callback, void *callbackArg); s32 ISFS_Close(s32 fd); -s32 ISFS_CloseAsync(s32 fd, FSAsyncCallback callback, void* callbackArg); -s32 ISFS_ShutdownAsync(FSAsyncCallback callback, void* callbackArg); +s32 ISFS_CloseAsync(s32 fd, FSAsyncCallback callback, void *callbackArg); +s32 ISFS_ShutdownAsync(FSAsyncCallback callback, void *callbackArg); #ifdef __cplusplus } diff --git a/include/rvl/GX/GXAttr.h b/include/rvl/GX/GXAttr.h index 0f696ddb..e7994b6c 100644 --- a/include/rvl/GX/GXAttr.h +++ b/include/rvl/GX/GXAttr.h @@ -1,7 +1,7 @@ #ifndef RVL_SDK_GX_ATTR_H #define RVL_SDK_GX_ATTR_H #include "rvl/GX/GXTypes.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -19,40 +19,36 @@ typedef struct _GXVtxAttrFmtList { } GXVtxAttrFmtList; void GXSetVtxDesc(GXAttr name, GXAttrType type); -void GXSetVtxDescv(const GXVtxDescList* list); -void GXGetVtxDesc(GXAttr name, GXAttrType* type); -void GXGetVtxDescv(GXVtxDescList* list); +void GXSetVtxDescv(const GXVtxDescList *list); +void GXGetVtxDesc(GXAttr name, GXAttrType *type); +void GXGetVtxDescv(GXVtxDescList *list); void GXClearVtxDesc(void); -void GXSetVtxAttrFmt(GXVtxFmt fmt, GXAttr attr, GXCompCnt compCnt, - GXCompType compType, u8 shift); +void GXSetVtxAttrFmt(GXVtxFmt fmt, GXAttr attr, GXCompCnt compCnt, GXCompType compType, u8 shift); // TODO: Please find a way to get rid of this #ifdef GXATTR_MATCH_HACK -void GXSetVtxAttrFmtv(s16 fmt, const GXVtxAttrFmtList* list); +void GXSetVtxAttrFmtv(s16 fmt, const GXVtxAttrFmtList *list); #else -void GXSetVtxAttrFmtv(GXVtxFmt fmt, const GXVtxAttrFmtList* list); +void GXSetVtxAttrFmtv(GXVtxFmt fmt, const GXVtxAttrFmtList *list); #endif -void GXGetVtxAttrFmt(GXVtxFmt fmt, GXAttr attr, GXCompCnt* compCnt, - GXCompType* compType, u8* shift); -void GXGetVtxAttrFmtv(GXVtxFmt fmt, GXVtxAttrFmtList* list); +void GXGetVtxAttrFmt(GXVtxFmt fmt, GXAttr attr, GXCompCnt *compCnt, GXCompType *compType, u8 *shift); +void GXGetVtxAttrFmtv(GXVtxFmt fmt, GXVtxAttrFmtList *list); void GXSetArray(GXAttr attr, u32 base, u8 stride); void GXInvalidateVtxCache(void); -void GXSetTexCoordGen2(GXTexCoordID id, GXTexGenType type, GXTexGenSrc src, - u32 texMtxIdx, GXBool normalize, u32 dualTexMtxIdx); +void GXSetTexCoordGen2(GXTexCoordID id, GXTexGenType type, GXTexGenSrc src, u32 texMtxIdx, GXBool normalize, + u32 dualTexMtxIdx); void GXSetNumTexGens(u8 num); void __GXSetVCD(void); void __GXCalculateVLim(void); void __GXSetVAT(void); -static void GXSetTexCoordGen(GXTexCoordID id, GXTexGenType type, - GXTexGenSrc src, u32 texMtxIdx) ; -// // TODO: What matrix index is this??? -// GXSetTexCoordGen2(id, type, src, texMtxIdx, FALSE, 125); +static void GXSetTexCoordGen(GXTexCoordID id, GXTexGenType type, GXTexGenSrc src, u32 texMtxIdx); +// // TODO: What matrix index is this??? +// GXSetTexCoordGen2(id, type, src, texMtxIdx, FALSE, 125); // } - #ifdef __cplusplus } #endif diff --git a/include/rvl/GX/GXBump.h b/include/rvl/GX/GXBump.h index 5bb453c4..b5bc37b3 100644 --- a/include/rvl/GX/GXBump.h +++ b/include/rvl/GX/GXBump.h @@ -1,21 +1,17 @@ #ifndef RVL_SDK_GX_BUMP_H #define RVL_SDK_GX_BUMP_H #include "rvl/GX/GXTypes.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif -void GXSetTevIndirect(GXTevStageID tevStage, GXIndTexStageID texStage, - GXIndTexFormat texFmt, GXIndTexBiasSel biasSel, - GXIndTexMtxID mtxId, GXIndTexWrap wrapS, - GXIndTexWrap wrapT, GXBool addPrev, GXBool utcLod, - GXIndTexAlphaSel alphaSel); +void GXSetTevIndirect(GXTevStageID tevStage, GXIndTexStageID texStage, GXIndTexFormat texFmt, GXIndTexBiasSel biasSel, + GXIndTexMtxID mtxId, GXIndTexWrap wrapS, GXIndTexWrap wrapT, GXBool addPrev, GXBool utcLod, + GXIndTexAlphaSel alphaSel); void GXSetIndTexMtx(GXIndTexMtxID id, const f32 offset[2][3], s8 scaleExp); -void GXSetIndTexCoordScale(GXIndTexStageID stage, GXIndTexScale scaleS, - GXIndTexScale scaleT); -void GXSetIndTexOrder(GXIndTexStageID stage, GXTexCoordID coord, - GXTexMapID map); +void GXSetIndTexCoordScale(GXIndTexStageID stage, GXIndTexScale scaleS, GXIndTexScale scaleT); +void GXSetIndTexOrder(GXIndTexStageID stage, GXTexCoordID coord, GXTexMapID map); void GXSetNumIndStages(u8 num); void GXSetTevDirect(GXTevStageID stage); void __GXUpdateBPMask(void); diff --git a/include/rvl/GX/GXDisplayList.h b/include/rvl/GX/GXDisplayList.h index 6c669aab..67988977 100644 --- a/include/rvl/GX/GXDisplayList.h +++ b/include/rvl/GX/GXDisplayList.h @@ -1,16 +1,16 @@ #ifndef RVL_SDK_GX_DISPLAY_LIST_H #define RVL_SDK_GX_DISPLAY_LIST_H #include "rvl/GX/GXHardware.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif -void GXBeginDisplayList(void* list, u32 size); +void GXBeginDisplayList(void *list, u32 size); u32 GXEndDisplayList(void); -void GXCallDisplayList(void* list, u32 size); +void GXCallDisplayList(void *list, u32 size); -static inline void GXFastCallDisplayList(void* list, u32 size) { +static inline void GXFastCallDisplayList(void *list, u32 size) { WGPIPE.c = GX_FIFO_CMD_CALL_DL; WGPIPE.p = list; WGPIPE.i = size; diff --git a/include/rvl/GX/GXDraw.h b/include/rvl/GX/GXDraw.h index 89a1c841..0c4a62f9 100644 --- a/include/rvl/GX/GXDraw.h +++ b/include/rvl/GX/GXDraw.h @@ -1,13 +1,13 @@ #ifndef RVL_SDK_GX_DRAW_H #define RVL_SDK_GX_DRAW_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif void GXDrawCylinder(u8 sides); void GXDrawSphere(u32 stacks, u32 sectors); -/* 803bcdb0 */ void GXDrawDone(); +/* 803bcdb0 */ void GXDrawDone(); #ifdef __cplusplus } #endif diff --git a/include/rvl/GX/GXFifo.h b/include/rvl/GX/GXFifo.h index bb89fbc1..c545fd7a 100644 --- a/include/rvl/GX/GXFifo.h +++ b/include/rvl/GX/GXFifo.h @@ -1,18 +1,18 @@ #ifndef RVL_SDK_GX_FIFO_H #define RVL_SDK_GX_FIFO_H #include "rvl/GX/GXInternal.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif GX_DECL_PUBLIC_STRUCT(GXFifoObj, 128); -void GXSetCPUFifo(GXFifoObj*); -BOOL GXGetCPUFifo(GXFifoObj*); +void GXSetCPUFifo(GXFifoObj *); +BOOL GXGetCPUFifo(GXFifoObj *); -u32 GXGetFifoCount(GXFifoObj*); -u8 GXGetFifoWrap(GXFifoObj*); +u32 GXGetFifoCount(GXFifoObj *); +u8 GXGetFifoWrap(GXFifoObj *); #ifdef __cplusplus } diff --git a/include/rvl/GX/GXFrameBuf.h b/include/rvl/GX/GXFrameBuf.h index 10c952c8..376007e5 100644 --- a/include/rvl/GX/GXFrameBuf.h +++ b/include/rvl/GX/GXFrameBuf.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_GX_FRAMEBUF_H #define RVL_SDK_GX_FRAMEBUF_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif diff --git a/include/rvl/GX/GXGeometry.h b/include/rvl/GX/GXGeometry.h index 567ab9e7..289e662e 100644 --- a/include/rvl/GX/GXGeometry.h +++ b/include/rvl/GX/GXGeometry.h @@ -1,7 +1,7 @@ #ifndef RVL_SDK_GX_GEOMETRY_H #define RVL_SDK_GX_GEOMETRY_H #include "rvl/GX/GXTypes.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -11,10 +11,9 @@ static void GXEnd(void); void GXSetLineWidth(u8 width, u32 offset); void GXSetPointSize(u8 size, u32 offset); -void GXEnableTexOffsets(GXTexCoordID coordId, GXBool lineOfs, - GXBool pointOfs); +void GXEnableTexOffsets(GXTexCoordID coordId, GXBool lineOfs, GXBool pointOfs); void GXSetCullMode(GXCullMode mode); -void GXGetCullMode(GXCullMode* out); +void GXGetCullMode(GXCullMode *out); void GXSetCoPlanar(GXBool coplanar); void __GXSetDirtyState(void); diff --git a/include/rvl/GX/GXHardware.h b/include/rvl/GX/GXHardware.h index 6e771a30..be53d68b 100644 --- a/include/rvl/GX/GXHardware.h +++ b/include/rvl/GX/GXHardware.h @@ -1,7 +1,7 @@ #ifndef RVL_SDK_GX_HARDWARE_H #define RVL_SDK_GX_HARDWARE_H #include "rvl/GX/GXTypes.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -40,7 +40,7 @@ extern volatile union { // 4-byte int i; unsigned int ui; - void* p; + void *p; float f; } WGPIPE : 0xCC008000; @@ -67,27 +67,23 @@ typedef enum { #define __GX_FIFO_SET_LOAD_INDX_NELEM(reg, x) ((reg) = GX_BITSET(reg, 16, 4, x)) #define __GX_FIFO_SET_LOAD_INDX_INDEX(reg, x) ((reg) = GX_BITSET(reg, 0, 16, x)) -#define __GX_FIFO_LOAD_INDX(reg, dst, nelem, index) \ - { \ - u32 cmd = 0; \ - __GX_FIFO_SET_LOAD_INDX_DST(cmd, dst); \ - __GX_FIFO_SET_LOAD_INDX_NELEM(cmd, nelem); \ - __GX_FIFO_SET_LOAD_INDX_INDEX(cmd, index); \ - WGPIPE.c = reg; \ - WGPIPE.i = cmd; \ +#define __GX_FIFO_LOAD_INDX(reg, dst, nelem, index) \ + { \ + u32 cmd = 0; \ + __GX_FIFO_SET_LOAD_INDX_DST(cmd, dst); \ + __GX_FIFO_SET_LOAD_INDX_NELEM(cmd, nelem); \ + __GX_FIFO_SET_LOAD_INDX_INDEX(cmd, index); \ + WGPIPE.c = reg; \ + WGPIPE.i = cmd; \ } -#define GX_FIFO_LOAD_INDX_A(dst, nelem, index) \ - __GX_FIFO_LOAD_INDX(GX_FIFO_CMD_LOAD_INDX_A, dst, nelem, index) +#define GX_FIFO_LOAD_INDX_A(dst, nelem, index) __GX_FIFO_LOAD_INDX(GX_FIFO_CMD_LOAD_INDX_A, dst, nelem, index) -#define GX_FIFO_LOAD_INDX_B(dst, nelem, index) \ - __GX_FIFO_LOAD_INDX(GX_FIFO_CMD_LOAD_INDX_B, dst, nelem, index) +#define GX_FIFO_LOAD_INDX_B(dst, nelem, index) __GX_FIFO_LOAD_INDX(GX_FIFO_CMD_LOAD_INDX_B, dst, nelem, index) -#define GX_FIFO_LOAD_INDX_C(dst, nelem, index) \ - __GX_FIFO_LOAD_INDX(GX_FIFO_CMD_LOAD_INDX_C, dst, nelem, index) +#define GX_FIFO_LOAD_INDX_C(dst, nelem, index) __GX_FIFO_LOAD_INDX(GX_FIFO_CMD_LOAD_INDX_C, dst, nelem, index) -#define GX_FIFO_LOAD_INDX_D(dst, nelem, index) \ - __GX_FIFO_LOAD_INDX(GX_FIFO_CMD_LOAD_INDX_D, dst, nelem, index) +#define GX_FIFO_LOAD_INDX_D(dst, nelem, index) __GX_FIFO_LOAD_INDX(GX_FIFO_CMD_LOAD_INDX_D, dst, nelem, index) /************************************************************ * @@ -100,8 +96,8 @@ typedef enum { /** * Load immediate value into BP register */ -#define GX_BP_LOAD_REG(data) \ - WGPIPE.c = GX_FIFO_CMD_LOAD_BP_REG; \ +#define GX_BP_LOAD_REG(data) \ + WGPIPE.c = GX_FIFO_CMD_LOAD_BP_REG; \ WGPIPE.i = (data); /** @@ -120,9 +116,9 @@ typedef enum { /** * Load immediate value into CP register */ -#define GX_CP_LOAD_REG(addr, data) \ - WGPIPE.c = GX_FIFO_CMD_LOAD_CP_REG; \ - WGPIPE.c = (addr); \ +#define GX_CP_LOAD_REG(addr, data) \ + WGPIPE.c = GX_FIFO_CMD_LOAD_CP_REG; \ + WGPIPE.c = (addr); \ WGPIPE.i = (data); /************************************************************ @@ -146,26 +142,26 @@ typedef enum { /** * Header for an XF register load */ -#define GX_XF_LOAD_REG_HDR(addr) \ - WGPIPE.c = GX_FIFO_CMD_LOAD_XF_REG; \ +#define GX_XF_LOAD_REG_HDR(addr) \ + WGPIPE.c = GX_FIFO_CMD_LOAD_XF_REG; \ WGPIPE.i = (addr); /** * Load immediate value into XF register */ -#define GX_XF_LOAD_REG(addr, data) \ - GX_XF_LOAD_REG_HDR(addr); \ +#define GX_XF_LOAD_REG(addr, data) \ + GX_XF_LOAD_REG_HDR(addr); \ WGPIPE.i = (data); /** * Load immediate values into multiple XF registers */ -#define GX_XF_LOAD_REGS(size, addr) \ - { \ - u32 cmd = 0; \ - cmd |= (addr); \ - cmd |= (size) << 16; \ - GX_XF_LOAD_REG_HDR(cmd); \ +#define GX_XF_LOAD_REGS(size, addr) \ + { \ + u32 cmd = 0; \ + cmd |= (addr); \ + cmd |= (size) << 16; \ + GX_XF_LOAD_REG_HDR(cmd); \ } /** @@ -184,10 +180,10 @@ typedef enum { typedef enum { GX_XF_TG_REGULAR, //! Regular transformation (transform incoming data) GX_XF_TG_BUMP, //! Texgen bump mapping - GX_XF_TG_CLR0, //! Color texgen: (s,t)=(r,g:b) (g and b are concatenated), - //! color0 - GX_XF_TG_CLR1 //! Color texgen: (s,t)=(r,g:b) (g and b are concatenated), - //! color 1 + GX_XF_TG_CLR0, //! Color texgen: (s,t)=(r,g:b) (g and b are concatenated), + //! color0 + GX_XF_TG_CLR1 //! Color texgen: (s,t)=(r,g:b) (g and b are concatenated), + //! color 1 } GXXfTexGen; #ifdef __cplusplus diff --git a/include/rvl/GX/GXHardwareBP.h b/include/rvl/GX/GXHardwareBP.h index 7de55079..c25d1c3c 100644 --- a/include/rvl/GX/GXHardwareBP.h +++ b/include/rvl/GX/GXHardwareBP.h @@ -1,7 +1,7 @@ #ifndef RVL_SDK_GX_HARDWARE_BP_H #define RVL_SDK_GX_HARDWARE_BP_H #include "rvl/GX/GXTypes.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -970,7 +970,6 @@ typedef enum { #define GX_BP_GET_FOGCOLOR_RGB(reg) GX_BITGET(reg, 8, 24) #define GX_BP_SET_FOGCOLOR_RGB(reg, x) ((reg) = GX_BITSET(reg, 8, 24, x)) - #ifdef __cplusplus } #endif diff --git a/include/rvl/GX/GXHardwareCP.h b/include/rvl/GX/GXHardwareCP.h index 28d196a1..6dcef101 100644 --- a/include/rvl/GX/GXHardwareCP.h +++ b/include/rvl/GX/GXHardwareCP.h @@ -1,7 +1,7 @@ #ifndef RVL_SDK_GX_HARDWARE_CP_H #define RVL_SDK_GX_HARDWARE_CP_H #include "rvl/GX/GXTypes.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -349,7 +349,8 @@ typedef enum { #define GX_CP_VAT_GROUP0_BYTEDEQUANT_MASK (((1 << 1) - 1) << 31 - 1) #define GX_CP_GET_VAT_GROUP0_BYTEDEQUANT(reg) GX_BITGET(reg, 1, 1) #define GX_CP_SET_VAT_GROUP0_BYTEDEQUANT(reg, x) ((reg) = GX_BITSET(reg, 1, 1, x)) -// NORMALINDEX3 [0:0] (1) - Input will be treated as three staggered indices (one per triple biased by component size) into normal table +// NORMALINDEX3 [0:0] (1) - Input will be treated as three staggered indices (one per triple biased by component size) +// into normal table #define GX_CP_VAT_GROUP0_NORMALINDEX3_ST 0 #define GX_CP_VAT_GROUP0_NORMALINDEX3_END 0 #define GX_CP_VAT_GROUP0_NORMALINDEX3_SZ 1 @@ -534,7 +535,6 @@ typedef enum { #define GX_CP_GET_ARRAYSTRIDE_STRIDE(reg) GX_BITGET(reg, 24, 8) #define GX_CP_SET_ARRAYSTRIDE_STRIDE(reg, x) ((reg) = GX_BITSET(reg, 24, 8, x)) - #ifdef __cplusplus } #endif diff --git a/include/rvl/GX/GXHardwareXF.h b/include/rvl/GX/GXHardwareXF.h index 8ec281af..a923fadb 100644 --- a/include/rvl/GX/GXHardwareXF.h +++ b/include/rvl/GX/GXHardwareXF.h @@ -1,7 +1,7 @@ #ifndef RVL_SDK_GX_HARDWARE_XF_H #define RVL_SDK_GX_HARDWARE_XF_H #include "rvl/GX/GXTypes.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -327,7 +327,6 @@ typedef enum { #define GX_XF_GET_DUALTEX_NORMALIZE(reg) GX_BITGET(reg, 23, 1) #define GX_XF_SET_DUALTEX_NORMALIZE(reg, x) ((reg) = GX_BITSET(reg, 23, 1, x)) - #ifdef __cplusplus } #endif diff --git a/include/rvl/GX/GXInit.h b/include/rvl/GX/GXInit.h index d5d7af6e..32369c91 100644 --- a/include/rvl/GX/GXInit.h +++ b/include/rvl/GX/GXInit.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_GX_INIT_H #define RVL_SDK_GX_INIT_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -75,7 +75,7 @@ typedef struct _GXData { u32 gxDirtyFlags; // at 0x5FC } GXData; -extern GXData* const __GXData; +extern GXData *const __GXData; // I hate typing this name out #define gxdt __GXData diff --git a/include/rvl/GX/GXInternal.h b/include/rvl/GX/GXInternal.h index 05958f55..40b05fb2 100644 --- a/include/rvl/GX/GXInternal.h +++ b/include/rvl/GX/GXInternal.h @@ -1,7 +1,7 @@ #ifndef RVL_SDK_GX_INTERNAL_H #define RVL_SDK_GX_INTERNAL_H #include "rvl/GX/GXTypes.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -21,19 +21,19 @@ extern "C" { * (Implementation size is included to require that such a structure already * exists.) */ -#define GX_DECL_PUBLIC_STRUCT(name, size) \ - typedef struct _##name { \ - u8 dummy[(size) - sizeof(name##Impl) + sizeof(name##Impl)]; \ +#define GX_DECL_PUBLIC_STRUCT(name, size) \ + typedef struct _##name { \ + u8 dummy[(size) - sizeof(name##Impl) + sizeof(name##Impl)]; \ } name; typedef struct _GXFifoObjImpl { - void* base; // at 0x0 - void* end; // at 0x4 + void *base; // at 0x0 + void *end; // at 0x4 u32 size; // at 0x8 - void* hiWatermark; // at 0xC - void* loWatermark; // at 0x10 - void* readPtr; // at 0x14 - void* writePtr; // at 0x18 + void *hiWatermark; // at 0xC + void *loWatermark; // at 0x10 + void *readPtr; // at 0x14 + void *writePtr; // at 0x18 u32 count; // at 0x1C u8 wrap; // at 0x20 } GXFifoObjImpl; diff --git a/include/rvl/GX/GXLight.h b/include/rvl/GX/GXLight.h index 888bfcf6..2deb53e7 100644 --- a/include/rvl/GX/GXLight.h +++ b/include/rvl/GX/GXLight.h @@ -2,34 +2,31 @@ #define RVL_SDK_GX_LIGHT_H #include "rvl/GX/GXInternal.h" #include "rvl/GX/GXTypes.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif GX_DECL_PUBLIC_STRUCT(GXLightObj, 64); -void GXInitLightAttn(GXLightObj* light, f32 aa, f32 ab, f32 ac, f32 ka, f32 kb, - f32 kc); -void GXInitLightAttnA(GXLightObj* light, f32 a, f32 b, f32 c); -void GXInitLightAttnK(GXLightObj* light, f32 a, f32 b, f32 c); -void GXInitLightSpot(GXLightObj* light, f32 angle, GXSpotFn fn); -void GXInitLightDistAttn(GXLightObj* light, f32 distance, f32 brightness, - GXDistAttnFn fn); -void GXInitLightPos(GXLightObj* light, f32 x, f32 y, f32 z); -void GXGetLightPos(const GXLightObj* light, f32* x, f32* y, f32* z); -void GXInitLightDir(GXLightObj* light, f32 x, f32 y, f32 z); -void GXGetLightDir(const GXLightObj* light, f32* x, f32* y, f32* z); -void GXInitSpecularDir(GXLightObj* light, f32 x, f32 y, f32 z); -void GXInitLightColor(GXLightObj* light, GXColor color); -void GXLoadLightObjImm(const GXLightObj* light, GXLightID id); +void GXInitLightAttn(GXLightObj *light, f32 aa, f32 ab, f32 ac, f32 ka, f32 kb, f32 kc); +void GXInitLightAttnA(GXLightObj *light, f32 a, f32 b, f32 c); +void GXInitLightAttnK(GXLightObj *light, f32 a, f32 b, f32 c); +void GXInitLightSpot(GXLightObj *light, f32 angle, GXSpotFn fn); +void GXInitLightDistAttn(GXLightObj *light, f32 distance, f32 brightness, GXDistAttnFn fn); +void GXInitLightPos(GXLightObj *light, f32 x, f32 y, f32 z); +void GXGetLightPos(const GXLightObj *light, f32 *x, f32 *y, f32 *z); +void GXInitLightDir(GXLightObj *light, f32 x, f32 y, f32 z); +void GXGetLightDir(const GXLightObj *light, f32 *x, f32 *y, f32 *z); +void GXInitSpecularDir(GXLightObj *light, f32 x, f32 y, f32 z); +void GXInitLightColor(GXLightObj *light, GXColor color); +void GXLoadLightObjImm(const GXLightObj *light, GXLightID id); void GXLoadLightObjIndx(u16 index, GXLightID id); void GXSetChanAmbColor(GXChannelID chan, GXColor color); void GXSetChanMatColor(GXChannelID chan, GXColor color); void GXSetNumChans(u8 num); -void GXSetChanCtrl(GXChannelID chan, GXBool enable, GXColorSrc ambSrc, - GXColorSrc matSrc, GXLightID lightMask, GXDiffuseFn diffFn, - GXAttnFn attnFn); +void GXSetChanCtrl(GXChannelID chan, GXBool enable, GXColorSrc ambSrc, GXColorSrc matSrc, GXLightID lightMask, + GXDiffuseFn diffFn, GXAttnFn attnFn); #ifdef __cplusplus } diff --git a/include/rvl/GX/GXMisc.h b/include/rvl/GX/GXMisc.h index bddd3906..5ab126e9 100644 --- a/include/rvl/GX/GXMisc.h +++ b/include/rvl/GX/GXMisc.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_GX_MISC_H #define RVL_SDK_GX_MISC_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif diff --git a/include/rvl/GX/GXPixel.h b/include/rvl/GX/GXPixel.h index 48867356..64637b06 100644 --- a/include/rvl/GX/GXPixel.h +++ b/include/rvl/GX/GXPixel.h @@ -2,7 +2,7 @@ #define RVL_SDK_GX_PIXEL_H #include "rvl/GX/GXTypes.h" #include "rvl/MTX.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -11,12 +11,10 @@ typedef struct _GXFogAdjTable { u16 r[10]; // at 0x0 } GXFogAdjTable; -void GXSetFog(GXFogType type, GXColor color, f32 start, f32 end, f32 near, - f32 far); -void GXInitFogAdjTable(GXFogAdjTable* table, u16 width, const Mtx44 proj); -void GXSetFogRangeAdj(GXBool enable, u16 center, const GXFogAdjTable* table); -void GXSetBlendMode(GXBlendMode mode, GXBlendFactor src, GXBlendFactor dst, - GXLogicOp op); +void GXSetFog(GXFogType type, GXColor color, f32 start, f32 end, f32 near, f32 far); +void GXInitFogAdjTable(GXFogAdjTable *table, u16 width, const Mtx44 proj); +void GXSetFogRangeAdj(GXBool enable, u16 center, const GXFogAdjTable *table); +void GXSetBlendMode(GXBlendMode mode, GXBlendFactor src, GXBlendFactor dst, GXLogicOp op); void GXSetColorUpdate(GXBool enable); void GXSetAlphaUpdate(GXBool enable); void GXSetZMode(GXBool enableTest, GXCompare func, GXBool enableUpdate); diff --git a/include/rvl/GX/GXTev.h b/include/rvl/GX/GXTev.h index 6112db6e..c53c04b6 100644 --- a/include/rvl/GX/GXTev.h +++ b/include/rvl/GX/GXTev.h @@ -1,20 +1,16 @@ #ifndef RVL_SDK_GX_TEV_H #define RVL_SDK_GX_TEV_H #include "rvl/GX/GXTypes.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif void GXSetTevOp(GXTevStageID, UNKWORD); -void GXSetTevColorIn(GXTevStageID, GXTevColorArg, GXTevColorArg, GXTevColorArg, - GXTevColorArg); -void GXSetTevAlphaIn(GXTevStageID, GXTevAlphaArg, GXTevAlphaArg, GXTevAlphaArg, - GXTevAlphaArg); -void GXSetTevColorOp(GXTevStageID, GXTevOp, GXTevBias, GXTevScale, u8, - GXTevRegID); -void GXSetTevAlphaOp(GXTevStageID, GXTevOp, GXTevBias, GXTevScale, u8, - GXTevRegID); +void GXSetTevColorIn(GXTevStageID, GXTevColorArg, GXTevColorArg, GXTevColorArg, GXTevColorArg); +void GXSetTevAlphaIn(GXTevStageID, GXTevAlphaArg, GXTevAlphaArg, GXTevAlphaArg, GXTevAlphaArg); +void GXSetTevColorOp(GXTevStageID, GXTevOp, GXTevBias, GXTevScale, u8, GXTevRegID); +void GXSetTevAlphaOp(GXTevStageID, GXTevOp, GXTevBias, GXTevScale, u8, GXTevRegID); void GXSetTevColor(GXTevRegID, GXColor); @@ -22,8 +18,7 @@ void GXSetTevKColor(GXTevKColorID, GXColor); void GXSetTevKColorSel(GXTevStageID, GXTevKColorSel); void GXSetTevKAlphaSel(GXTevStageID, GXTevKAlphaSel); void GXSetTevSwapMode(GXTevStageID, GXTevSwapSel, GXTevSwapSel); -void GXSetTevSwapModeTable(GXTevSwapSel, GXTevColorChan, GXTevColorChan, - GXTevColorChan, GXTevColorChan); +void GXSetTevSwapModeTable(GXTevSwapSel, GXTevColorChan, GXTevColorChan, GXTevColorChan, GXTevColorChan); void GXSetAlphaCompare(GXCompare, u8, GXAlphaOp, GXCompare, u8); void GXSetZTexture(UNKWORD, UNKWORD, UNKWORD); diff --git a/include/rvl/GX/GXTexture.h b/include/rvl/GX/GXTexture.h index a096c618..06e33a3b 100644 --- a/include/rvl/GX/GXTexture.h +++ b/include/rvl/GX/GXTexture.h @@ -1,7 +1,7 @@ #ifndef RVL_SDK_GX_TEXTURE_H #define RVL_SDK_GX_TEXTURE_H #include "rvl/GX/GXTypes.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -10,12 +10,10 @@ GX_DECL_PUBLIC_STRUCT(GXTexObj, 32); void __GXSetSUTexRegs(void); -void GXInitTexObj(GXTexObj*, void*, u16, u16, GXTexFmt, GXTexWrapMode, - GXTexWrapMode, u8); -void GXInitTexObjLOD(GXTexObj*, GXTexFilter, GXTexFilter, f32, f32, f32, u8, u8, - GXAnisotropy); +void GXInitTexObj(GXTexObj *, void *, u16, u16, GXTexFmt, GXTexWrapMode, GXTexWrapMode, u8); +void GXInitTexObjLOD(GXTexObj *, GXTexFilter, GXTexFilter, f32, f32, f32, u8, u8, GXAnisotropy); -void GXLoadTexObj(GXTexObj*, GXTexMapID); +void GXLoadTexObj(GXTexObj *, GXTexMapID); #ifdef __cplusplus } diff --git a/include/rvl/GX/GXTransform.h b/include/rvl/GX/GXTransform.h index 7922d2eb..2842d634 100644 --- a/include/rvl/GX/GXTransform.h +++ b/include/rvl/GX/GXTransform.h @@ -2,7 +2,7 @@ #define RVL_SDK_GX_TRANSFORM_H #include "rvl/GX/GXTypes.h" #include "rvl/MTX.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -16,13 +16,12 @@ void GXLoadNrmMtxImm(const Mtx mtx, u32 id); void GXLoadNrmMtxIndx3x3(u16 index, u32 id); void GXSetCurrentMtx(u32 id); void GXLoadTexMtxImm(const Mtx mtx, u32 id, GXMtxType type); -void GXSetViewportJitter(f32 ox, f32 oy, f32 sx, f32 sy, f32 near, f32 far, - u32 nextField); +void GXSetViewportJitter(f32 ox, f32 oy, f32 sx, f32 sy, f32 near, f32 far, u32 nextField); void GXSetViewport(f32 ox, f32 oy, f32 sx, f32 sy, f32 near, f32 far); void GXGetViewportv(f32 view[6]); void GXSetZScaleOffset(f32 scale, f32 offset); void GXSetScissor(u32 x, u32 y, u32 w, u32 h); -void GXGetScissor(u32* x, u32* y, u32* w, u32* h); +void GXGetScissor(u32 *x, u32 *y, u32 *w, u32 *h); void GXSetScissorBoxOffset(u32 ox, u32 oy); void GXSetClipMode(GXClipMode mode); diff --git a/include/rvl/GX/GXTypes.h b/include/rvl/GX/GXTypes.h index 353e3296..c2c1c424 100644 --- a/include/rvl/GX/GXTypes.h +++ b/include/rvl/GX/GXTypes.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_GX_TYPES_H #define RVL_SDK_GX_TYPES_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -10,32 +10,28 @@ extern "C" { * Value is shifted to the specified bit position. * (Bit indices are LSB) */ -#define GX_BITSET(field, pos, size, value) \ - __rlwimi((field), (value), 31 - (pos) - (size) + 1, (pos), (pos) + (size)-1) +#define GX_BITSET(field, pos, size, value) __rlwimi((field), (value), 31 - (pos) - (size) + 1, (pos), (pos) + (size)-1) /** * Compose value from bitfield. * Value is shifted after masking. * (Bit indices are LSB) */ -#define GX_BITGET(field, pos, size) \ - ((field) >> (31 - (pos) - (size) + 1) & ((1 << (size)) - 1)) +#define GX_BITGET(field, pos, size) ((field) >> (31 - (pos) - (size) + 1) & ((1 << (size)) - 1)) /** * Pack value into bitfield. * Value is not shifted, only masked. * (Bit indices are LSB) */ -#define GX_BITSET_TRUNC(field, pos, size, value) \ - __rlwimi((field), (value), 0, (pos), (pos) + (size)-1) +#define GX_BITSET_TRUNC(field, pos, size, value) __rlwimi((field), (value), 0, (pos), (pos) + (size)-1) /** * Compose value from bitfield. * Value is not shifted, only masked. * (Bit indices are LSB) */ -#define GX_BITGET_TRUNC(field, pos, size) \ - ((field) & (((1 << (size)) - 1) << (32 - (pos) - (size)))) +#define GX_BITGET_TRUNC(field, pos, size) ((field) & (((1 << (size)) - 1) << (32 - (pos) - (size)))) /** * Common types used throughout many GX files. @@ -212,12 +208,7 @@ typedef enum _GXCompType { GX_RGBA8 } GXCompType; -typedef enum _GXCullMode { - GX_CULL_NONE, - GX_CULL_FRONT, - GX_CULL_BACK, - GX_CULL_ALL -} GXCullMode; +typedef enum _GXCullMode { GX_CULL_NONE, GX_CULL_FRONT, GX_CULL_BACK, GX_CULL_ALL } GXCullMode; typedef enum _GXDiffuseFn { GX_DF_NONE, GX_DF_SIGN, GX_DF_CLAMP } GXDiffuseFn; @@ -250,22 +241,15 @@ typedef enum _GXDirtyFlag { GX_DIRTY_PROJECTION = (1 << 27), GX_DIRTY_VIEWPORT = (1 << 28), - GX_AMB_MAT_MASK = GX_DIRTY_AMB_COLOR0 | GX_DIRTY_AMB_COLOR1 | - GX_DIRTY_MAT_COLOR0 | GX_DIRTY_MAT_COLOR1, + GX_AMB_MAT_MASK = GX_DIRTY_AMB_COLOR0 | GX_DIRTY_AMB_COLOR1 | GX_DIRTY_MAT_COLOR0 | GX_DIRTY_MAT_COLOR1, - GX_LIGHT_CHAN_MASK = GX_DIRTY_CHAN_COLOR0 | GX_DIRTY_CHAN_COLOR1 | - GX_DIRTY_CHAN_ALPHA0 | GX_DIRTY_CHAN_ALPHA1 | - GX_DIRTY_NUM_COLORS, + GX_LIGHT_CHAN_MASK = GX_DIRTY_CHAN_COLOR0 | GX_DIRTY_CHAN_COLOR1 | GX_DIRTY_CHAN_ALPHA0 | GX_DIRTY_CHAN_ALPHA1 | + GX_DIRTY_NUM_COLORS, GX_TEX_GEN_MASK = 0x2FF0000, } GXDirtyFlag; -typedef enum _GXDistAttnFn { - GX_DA_OFF, - GX_DA_GENTLE, - GX_DA_MEDIUM, - GX_DA_STEEP -} GXDistAttnFn; +typedef enum _GXDistAttnFn { GX_DA_OFF, GX_DA_GENTLE, GX_DA_MEDIUM, GX_DA_STEEP } GXDistAttnFn; typedef enum _GXFogType { GX_FOG_NONE, @@ -286,7 +270,7 @@ typedef enum _GXFogType { // Access components of the fog type #define GX_FOG_GET_PROJ(x) ((x) >> 3 & 1) -#define GX_FOG_GET_FSEL(x) ((x)&7) +#define GX_FOG_GET_FSEL(x) ((x) & 7) typedef enum _GXIndTexAlphaSel { GX_ITBA_OFF, @@ -450,15 +434,7 @@ typedef enum _GXPrimitive { typedef enum _GXProjMtxType { GX_PERSPECTIVE, GX_ORTHOGRAPHIC } GXProjMtxType; -typedef enum _GXSpotFn { - GX_SP_OFF, - GX_SP_FLAT, - GX_SP_COS, - GX_SP_COS2, - GX_SP_SHARP, - GX_SP_RING1, - GX_SP_RING2 -} GXSpotFn; +typedef enum _GXSpotFn { GX_SP_OFF, GX_SP_FLAT, GX_SP_COS, GX_SP_COS2, GX_SP_SHARP, GX_SP_RING1, GX_SP_RING2 } GXSpotFn; typedef enum _GXTevAlphaArg { GX_CA_APREV, @@ -504,12 +480,7 @@ typedef enum _GXTevColorArg { GX_CC_QUARTER = GX_CC_KONST } GXTevColorArg; -typedef enum _GXTevColorChan { - GX_CH_RED, - GX_CH_GREEN, - GX_CH_BLUE, - GX_CH_ALPHA -} GXTevColorChan; +typedef enum _GXTevColorChan { GX_CH_RED, GX_CH_GREEN, GX_CH_BLUE, GX_CH_ALPHA } GXTevColorChan; typedef enum _GXTevOp { GX_TEV_ADD, diff --git a/include/rvl/GX/GXVert.h b/include/rvl/GX/GXVert.h index 58ecdca5..7cb87a19 100644 --- a/include/rvl/GX/GXVert.h +++ b/include/rvl/GX/GXVert.h @@ -1,16 +1,22 @@ #ifndef RVL_SDK_GX_VERT_H #define RVL_SDK_GX_VERT_H #include "rvl/GX/GXHardware.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif -static inline void GXCmd1u8(u8 uc) { WGPIPE.c = uc; } +static inline void GXCmd1u8(u8 uc) { + WGPIPE.c = uc; +} -static inline void GXCmd1u16(u16 us) { WGPIPE.us = us; } +static inline void GXCmd1u16(u16 us) { + WGPIPE.us = us; +} -static inline void GXCmd1u32(u32 ul) { WGPIPE.i = ul; } +static inline void GXCmd1u32(u32 ul) { + WGPIPE.i = ul; +} static inline void GXPosition3f32(f32 x, f32 y, f32 z) { WGPIPE.f = x; @@ -67,9 +73,13 @@ static inline void GXPosition2s16(s16 x, s16 y) { WGPIPE.s = y; } -static inline void GXPosition1x16(u16 us) { WGPIPE.us = us; } +static inline void GXPosition1x16(u16 us) { + WGPIPE.us = us; +} -static inline void GXPosition1x8(u8 uc) { WGPIPE.c = uc; } +static inline void GXPosition1x8(u8 uc) { + WGPIPE.c = uc; +} static inline void GXNormal3f32(f32 x, f32 y, f32 z) { WGPIPE.f = x; @@ -89,9 +99,13 @@ static inline void GXNormal3s8(s8 x, s8 y, s8 z) { WGPIPE.c = z; } -static inline void GXNormal1x16(u16 us) { WGPIPE.us = us; } +static inline void GXNormal1x16(u16 us) { + WGPIPE.us = us; +} -static inline void GXNormal1x8(u8 uc) { WGPIPE.c = uc; } +static inline void GXNormal1x8(u8 uc) { + WGPIPE.c = uc; +} static inline void GXColor4u8(u8 r, u8 g, u8 b, u8 a) { WGPIPE.c = r; @@ -100,7 +114,9 @@ static inline void GXColor4u8(u8 r, u8 g, u8 b, u8 a) { WGPIPE.c = a; } -static inline void GXColor1u32(u32 color) { WGPIPE.i = color; } +static inline void GXColor1u32(u32 color) { + WGPIPE.i = color; +} static inline void GXColor3u8(u8 r, u8 g, u8 b) { WGPIPE.c = r; @@ -108,11 +124,17 @@ static inline void GXColor3u8(u8 r, u8 g, u8 b) { WGPIPE.c = b; } -static inline void GXColor1u16(u16 us) { WGPIPE.us = us; } +static inline void GXColor1u16(u16 us) { + WGPIPE.us = us; +} -static inline void GXColor1x16(u16 us) { WGPIPE.us = us; } +static inline void GXColor1x16(u16 us) { + WGPIPE.us = us; +} -static inline void GXColor1x8(u8 uc) { WGPIPE.c = uc; } +static inline void GXColor1x8(u8 uc) { + WGPIPE.c = uc; +} static inline void GXTexCoord2f32(f32 x, f32 y) { WGPIPE.f = x; @@ -139,19 +161,33 @@ static inline void GXTexCoord2u8(u8 x, u8 y) { WGPIPE.c = y; } -static inline void GXTexCoord1f32(f32 f) { WGPIPE.f = f; } +static inline void GXTexCoord1f32(f32 f) { + WGPIPE.f = f; +} -static inline void GXTexCoord1s16(s16 s) { WGPIPE.s = s; } +static inline void GXTexCoord1s16(s16 s) { + WGPIPE.s = s; +} -static inline void GXTexCoord1u16(u16 us) { WGPIPE.us = us; } +static inline void GXTexCoord1u16(u16 us) { + WGPIPE.us = us; +} -static inline void GXTexCoord1s8(s8 c) { WGPIPE.c = c; } +static inline void GXTexCoord1s8(s8 c) { + WGPIPE.c = c; +} -static inline void GXTexCoord1u8(u8 uc) { WGPIPE.c = uc; } +static inline void GXTexCoord1u8(u8 uc) { + WGPIPE.c = uc; +} -static inline void GXTexCoord1x16(u16 us) { WGPIPE.us = us; } +static inline void GXTexCoord1x16(u16 us) { + WGPIPE.us = us; +} -static inline void GXTexCoord1x8(u8 uc) { WGPIPE.c = uc; } +static inline void GXTexCoord1x8(u8 uc) { + WGPIPE.c = uc; +} #ifdef __cplusplus } diff --git a/include/rvl/IPC/ipcMain.h b/include/rvl/IPC/ipcMain.h index 7cc48771..4ab9787b 100644 --- a/include/rvl/IPC/ipcMain.h +++ b/include/rvl/IPC/ipcMain.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_IPC_MAIN_H #define RVL_SDK_IPC_MAIN_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -8,19 +8,19 @@ extern "C" { u32 IPC_HW_REGS[] : 0xCD000000; static inline u32 ACRReadReg(u32 reg) { - return *(u32*)((char*)IPC_HW_REGS + (reg & ~0x3)); + return *(u32 *)((char *)IPC_HW_REGS + (reg & ~0x3)); } static inline void ACRWriteReg(u32 reg, u32 val) { - *(u32*)((char*)IPC_HW_REGS + (reg & ~0x3)) = val; + *(u32 *)((char *)IPC_HW_REGS + (reg & ~0x3)) = val; } void IPCInit(void); u32 IPCReadReg(s32 index); void IPCWriteReg(s32 index, u32 value); -void* IPCGetBufferHi(void); -void* IPCGetBufferLo(void); -void IPCSetBufferLo(void* lo); +void *IPCGetBufferHi(void); +void *IPCGetBufferLo(void); +void IPCSetBufferLo(void *lo); #ifdef __cplusplus } diff --git a/include/rvl/IPC/ipcProfile.h b/include/rvl/IPC/ipcProfile.h index dc2ec0b7..3dea2177 100644 --- a/include/rvl/IPC/ipcProfile.h +++ b/include/rvl/IPC/ipcProfile.h @@ -1,15 +1,15 @@ #ifndef RVL_SDK_IPC_PROFILE_H #define RVL_SDK_IPC_PROFILE_H #include "rvl/IPC/ipcclt.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif void IPCiProfInit(void); -void IPCiProfQueueReq(IPCRequestEx* req, s32 fd); +void IPCiProfQueueReq(IPCRequestEx *req, s32 fd); void IPCiProfAck(void); -void IPCiProfReply(IPCRequestEx* req, s32 fd); +void IPCiProfReply(IPCRequestEx *req, s32 fd); #ifdef __cplusplus } diff --git a/include/rvl/IPC/ipcclt.h b/include/rvl/IPC/ipcclt.h index 97ad9765..064759c2 100644 --- a/include/rvl/IPC/ipcclt.h +++ b/include/rvl/IPC/ipcclt.h @@ -1,7 +1,7 @@ #ifndef RVL_SDK_IPC_CLT_H #define RVL_SDK_IPC_CLT_H #include "rvl/OS.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -64,20 +64,20 @@ typedef enum { IPC_SEEK_END, } IPCSeekMode; -typedef s32 (*IPCAsyncCallback)(s32 result, void* arg); +typedef s32 (*IPCAsyncCallback)(s32 result, void *arg); typedef struct IPCIOVector { - void* base; // at 0x0 + void *base; // at 0x0 u32 length; // at 0x4 } IPCIOVector; typedef struct IPCOpenArgs { - const char* path; // at 0x0 + const char *path; // at 0x0 IPCOpenMode mode; // at 0x4 } IPCOpenArgs; typedef struct IPCReadWriteArgs { - void* data; // at 0x0 + void *data; // at 0x0 u32 length; // at 0x4 } IPCReadWriteArgs; @@ -88,9 +88,9 @@ typedef struct IPCSeekArgs { typedef struct IPCIoctlArgs { s32 type; // at 0x0 - void* in; // at 0x4 + void *in; // at 0x4 s32 inSize; // at 0x8 - void* out; // at 0xC + void *out; // at 0xC s32 outSize; // at 0x10 } IPCIoctlArgs; @@ -98,7 +98,7 @@ typedef struct IPCIoctlvArgs { s32 type; // at 0x0 u32 inCount; // at 0x4 u32 outCount; // at 0x8 - IPCIOVector* vectors; // at 0xC + IPCIOVector *vectors; // at 0xC } IPCIoctlvArgs; typedef struct IPCRequest { @@ -117,37 +117,30 @@ typedef struct IPCRequest { typedef struct IPCRequestEx { IPCRequest base; // at 0x0 IPCAsyncCallback callback; // at 0x20 - void* callbackArg; // at 0x24 + void *callbackArg; // at 0x24 BOOL reboot; // at 0x28 OSThreadQueue queue; // at 0x2C char padding[64 - 0x34]; } IPCRequestEx; s32 IPCCltInit(void); -s32 IOS_OpenAsync(const char* path, IPCOpenMode mode, IPCAsyncCallback callback, - void* callbackArg); -s32 IOS_Open(const char* path, IPCOpenMode mode); -s32 IOS_CloseAsync(s32 fd, IPCAsyncCallback callback, void* callbackArg); +s32 IOS_OpenAsync(const char *path, IPCOpenMode mode, IPCAsyncCallback callback, void *callbackArg); +s32 IOS_Open(const char *path, IPCOpenMode mode); +s32 IOS_CloseAsync(s32 fd, IPCAsyncCallback callback, void *callbackArg); s32 IOS_Close(s32 fd); -s32 IOS_ReadAsync(s32 fd, void* buf, s32 len, IPCAsyncCallback callback, - void* callbackArg); -s32 IOS_Read(s32 fd, void* buf, s32 len); -s32 IOS_WriteAsync(s32 fd, const void* buf, s32 len, IPCAsyncCallback callback, - void* callbackArg); -s32 IOS_Write(s32 fd, const void* buf, s32 len); -s32 IOS_SeekAsync(s32 fd, s32 offset, IPCSeekMode mode, - IPCAsyncCallback callback, void* callbackArg); +s32 IOS_ReadAsync(s32 fd, void *buf, s32 len, IPCAsyncCallback callback, void *callbackArg); +s32 IOS_Read(s32 fd, void *buf, s32 len); +s32 IOS_WriteAsync(s32 fd, const void *buf, s32 len, IPCAsyncCallback callback, void *callbackArg); +s32 IOS_Write(s32 fd, const void *buf, s32 len); +s32 IOS_SeekAsync(s32 fd, s32 offset, IPCSeekMode mode, IPCAsyncCallback callback, void *callbackArg); s32 IOS_Seek(s32 fd, s32 offset, IPCSeekMode mode); -s32 IOS_IoctlAsync(s32 fd, s32 type, void* in, s32 inSize, void* out, - s32 outSize, IPCAsyncCallback callback, void* callbackArg); -s32 IOS_Ioctl(s32 fd, s32 type, void* in, s32 inSize, void* out, s32 outSize); -s32 IOS_IoctlvAsync(s32 fd, s32 type, s32 inCount, s32 outCount, - IPCIOVector* vectors, IPCAsyncCallback callback, - void* callbackArg); -s32 IOS_Ioctlv(s32 fd, s32 type, s32 inCount, s32 outCount, - IPCIOVector* vectors); -s32 IOS_IoctlvReboot(s32 fd, s32 type, s32 inCount, s32 outCount, - IPCIOVector* vectors); +s32 IOS_IoctlAsync(s32 fd, s32 type, void *in, s32 inSize, void *out, s32 outSize, IPCAsyncCallback callback, + void *callbackArg); +s32 IOS_Ioctl(s32 fd, s32 type, void *in, s32 inSize, void *out, s32 outSize); +s32 IOS_IoctlvAsync(s32 fd, s32 type, s32 inCount, s32 outCount, IPCIOVector *vectors, IPCAsyncCallback callback, + void *callbackArg); +s32 IOS_Ioctlv(s32 fd, s32 type, s32 inCount, s32 outCount, IPCIOVector *vectors); +s32 IOS_IoctlvReboot(s32 fd, s32 type, s32 inCount, s32 outCount, IPCIOVector *vectors); #ifdef __cplusplus } diff --git a/include/rvl/IPC/memory.h b/include/rvl/IPC/memory.h index 5a44ff19..b38f63bb 100644 --- a/include/rvl/IPC/memory.h +++ b/include/rvl/IPC/memory.h @@ -1,14 +1,14 @@ #ifndef RVL_SDK_IPC_MEMORY_H #define RVL_SDK_IPC_MEMORY_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif -s32 iosCreateHeap(void*, u32); +s32 iosCreateHeap(void *, u32); -void* iosAllocAligned(s32, u32, s32); -s32 iosFree(s32, void*); +void *iosAllocAligned(s32, u32, s32); +s32 iosFree(s32, void *); #ifdef __cplusplus } diff --git a/include/rvl/MEM/mem_allocator.h b/include/rvl/MEM/mem_allocator.h index 8972c983..3146fe87 100644 --- a/include/rvl/MEM/mem_allocator.h +++ b/include/rvl/MEM/mem_allocator.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_MEM_ALLOCATOR_H #define RVL_SDK_MEM_ALLOCATOR_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -9,10 +9,8 @@ extern "C" { typedef struct MEMAllocator; typedef struct MEMiHeapHead; -typedef void* (*MEMAllocatorAllocFunc)(struct MEMAllocator* allocator, - u32 size); -typedef void (*MEMAllocatorFreeFunc)(struct MEMAllocator* allocator, - void* block); +typedef void *(*MEMAllocatorAllocFunc)(struct MEMAllocator *allocator, u32 size); +typedef void (*MEMAllocatorFreeFunc)(struct MEMAllocator *allocator, void *block); typedef struct MEMAllocatorFuncs { MEMAllocatorAllocFunc allocFunc; // at 0x0 @@ -20,19 +18,17 @@ typedef struct MEMAllocatorFuncs { } MEMAllocatorFuncs; typedef struct MEMAllocator { - const MEMAllocatorFuncs* funcs; // at 0x0 - struct MEMiHeapHead* heap; // at 0x4 + const MEMAllocatorFuncs *funcs; // at 0x0 + struct MEMiHeapHead *heap; // at 0x4 u32 heapParam1; // at 0x8 u32 heapParam2; // at 0xC } MEMAllocator; -void* MEMAllocFromAllocator(MEMAllocator* allocator, u32 size); -void MEMFreeToAllocator(MEMAllocator* allocator, void* block); +void *MEMAllocFromAllocator(MEMAllocator *allocator, u32 size); +void MEMFreeToAllocator(MEMAllocator *allocator, void *block); -void MEMInitAllocatorForExpHeap(MEMAllocator* allocator, - struct MEMiHeapHead* heap, s32 align); -void MEMInitAllocatorForFrmHeap(MEMAllocator* allocator, - struct MEMiHeapHead* heap, s32 align); +void MEMInitAllocatorForExpHeap(MEMAllocator *allocator, struct MEMiHeapHead *heap, s32 align); +void MEMInitAllocatorForFrmHeap(MEMAllocator *allocator, struct MEMiHeapHead *heap, s32 align); #ifdef __cplusplus } diff --git a/include/rvl/MEM/mem_expHeap.h b/include/rvl/MEM/mem_expHeap.h index 5dc06462..2a8cbe88 100644 --- a/include/rvl/MEM/mem_expHeap.h +++ b/include/rvl/MEM/mem_expHeap.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_MEM_EXP_HEAP_H #define RVL_SDK_MEM_EXP_HEAP_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -25,13 +25,13 @@ typedef struct MEMiExpHeapMBlock { }; }; // at 0x2 u32 size; // at 0x4 - struct MEMiExpHeapMBlock* prev; // at 0x8 - struct MEMiExpHeapMBlock* next; // at 0xC + struct MEMiExpHeapMBlock *prev; // at 0x8 + struct MEMiExpHeapMBlock *next; // at 0xC } MEMiExpHeapMBlock; typedef struct MEMiExpHeapMBlockList { - MEMiExpHeapMBlock* head; // at 0x0 - MEMiExpHeapMBlock* tail; // at 0x4 + MEMiExpHeapMBlock *head; // at 0x0 + MEMiExpHeapMBlock *tail; // at 0x4 } MEMiExpHeapMBlockList; // Placed in heap after base heap head @@ -48,24 +48,23 @@ typedef struct MEMiExpHeapHead { }; // at 0x12 } MEMiExpHeapHead; -struct MEMiHeapHead* MEMCreateExpHeapEx(void* start, u32 size, u16 opt); -struct MEMiHeapHead* MEMDestroyExpHeap(struct MEMiHeapHead* heap); -void* MEMAllocFromExpHeapEx(struct MEMiHeapHead* heap, u32 size, s32 align); -u32 MEMResizeForMBlockExpHeap(struct MEMiHeapHead* heap, void* memBlock, - u32 size); -void MEMFreeToExpHeap(struct MEMiHeapHead* heap, void* memBlock); -u32 MEMGetAllocatableSizeForExpHeapEx(struct MEMiHeapHead* heap, s32 align); -u32 MEMAdjustExpHeap(struct MEMiHeapHead* heap); +struct MEMiHeapHead *MEMCreateExpHeapEx(void *start, u32 size, u16 opt); +struct MEMiHeapHead *MEMDestroyExpHeap(struct MEMiHeapHead *heap); +void *MEMAllocFromExpHeapEx(struct MEMiHeapHead *heap, u32 size, s32 align); +u32 MEMResizeForMBlockExpHeap(struct MEMiHeapHead *heap, void *memBlock, u32 size); +void MEMFreeToExpHeap(struct MEMiHeapHead *heap, void *memBlock); +u32 MEMGetAllocatableSizeForExpHeapEx(struct MEMiHeapHead *heap, s32 align); +u32 MEMAdjustExpHeap(struct MEMiHeapHead *heap); -static inline struct MEMiHeapHead* MEMCreateExpHeap(void* start, u32 size) { +static inline struct MEMiHeapHead *MEMCreateExpHeap(void *start, u32 size) { return MEMCreateExpHeapEx(start, size, 0); } -static inline void* MEMAllocFromExpHeap(struct MEMiHeapHead* heap, u32 size) { +static inline void *MEMAllocFromExpHeap(struct MEMiHeapHead *heap, u32 size) { return MEMAllocFromExpHeapEx(heap, size, 4); } -static inline u32 MEMGetAllocatableSizeForExpHeap(struct MEMiHeapHead* heap) { +static inline u32 MEMGetAllocatableSizeForExpHeap(struct MEMiHeapHead *heap) { return MEMGetAllocatableSizeForExpHeapEx(heap, 4); } diff --git a/include/rvl/MEM/mem_frameHeap.h b/include/rvl/MEM/mem_frameHeap.h index 91f725a8..a648fae5 100644 --- a/include/rvl/MEM/mem_frameHeap.h +++ b/include/rvl/MEM/mem_frameHeap.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_MEM_FRAME_HEAP_H #define RVL_SDK_MEM_FRAME_HEAP_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -9,45 +9,41 @@ extern "C" { typedef struct MEMiHeapHead; // Specify how to free memory -typedef enum { - MEM_FRM_HEAP_FREE_TO_HEAD = (1 << 0), - MEM_FRM_HEAP_FREE_TO_TAIL = (1 << 1) -} MEMiFrmFreeFlag; +typedef enum { MEM_FRM_HEAP_FREE_TO_HEAD = (1 << 0), MEM_FRM_HEAP_FREE_TO_TAIL = (1 << 1) } MEMiFrmFreeFlag; typedef struct MEMiFrmHeapState { u32 id; // at 0x0 - u8* head; // at 0x4 - u8* tail; // at 0x8 - struct MEMiFrmHeapState* next; // at 0xC + u8 *head; // at 0x4 + u8 *tail; // at 0x8 + struct MEMiFrmHeapState *next; // at 0xC } MEMiFrmHeapState; // Placed in heap after base heap head typedef struct MEMiFrmHeapHead { - u8* head; // at 0x0 - u8* tail; // at 0x4 - MEMiFrmHeapState* states; // at 0x8 + u8 *head; // at 0x0 + u8 *tail; // at 0x4 + MEMiFrmHeapState *states; // at 0x8 } MEMiFrmHeapHead; -struct MEMiHeapHead* MEMCreateFrmHeapEx(void* start, u32 size, u16 opt); -struct MEMiHeapHead* MEMDestroyFrmHeap(struct MEMiHeapHead* heap); -void* MEMAllocFromFrmHeapEx(struct MEMiHeapHead* heap, u32 size, s32 align); -void MEMFreeToFrmHeap(struct MEMiHeapHead* heap, u32 flags); -u32 MEMGetAllocatableSizeForFrmHeapEx(struct MEMiHeapHead* heap, s32 align); -BOOL MEMRecordStateForFrmHeap(struct MEMiHeapHead* heap, u32 id); -BOOL MEMFreeByStateToFrmHeap(struct MEMiHeapHead* heap, u32 id); -u32 MEMAdjustFrmHeap(struct MEMiHeapHead* heap); -u32 MEMResizeForMBlockFrmHeap(struct MEMiHeapHead* heap, void* memBlock, - u32 size); +struct MEMiHeapHead *MEMCreateFrmHeapEx(void *start, u32 size, u16 opt); +struct MEMiHeapHead *MEMDestroyFrmHeap(struct MEMiHeapHead *heap); +void *MEMAllocFromFrmHeapEx(struct MEMiHeapHead *heap, u32 size, s32 align); +void MEMFreeToFrmHeap(struct MEMiHeapHead *heap, u32 flags); +u32 MEMGetAllocatableSizeForFrmHeapEx(struct MEMiHeapHead *heap, s32 align); +BOOL MEMRecordStateForFrmHeap(struct MEMiHeapHead *heap, u32 id); +BOOL MEMFreeByStateToFrmHeap(struct MEMiHeapHead *heap, u32 id); +u32 MEMAdjustFrmHeap(struct MEMiHeapHead *heap); +u32 MEMResizeForMBlockFrmHeap(struct MEMiHeapHead *heap, void *memBlock, u32 size); -static inline struct MEMiHeapHead* MEMCreateFrmHeap(void* start, u32 size) { +static inline struct MEMiHeapHead *MEMCreateFrmHeap(void *start, u32 size) { return MEMCreateFrmHeapEx(start, size, 0); } -static inline void* MEMAllocFromFrmHeap(struct MEMiHeapHead* heap, u32 size) { +static inline void *MEMAllocFromFrmHeap(struct MEMiHeapHead *heap, u32 size) { return MEMAllocFromFrmHeapEx(heap, size, 4); } -static inline u32 MEMGetAllocatableSizeForFrmHeap(struct MEMiHeapHead* heap) { +static inline u32 MEMGetAllocatableSizeForFrmHeap(struct MEMiHeapHead *heap) { return MEMGetAllocatableSizeForFrmHeapEx(heap, 4); } diff --git a/include/rvl/MEM/mem_heapCommon.h b/include/rvl/MEM/mem_heapCommon.h index ed6e8566..22b0b457 100644 --- a/include/rvl/MEM/mem_heapCommon.h +++ b/include/rvl/MEM/mem_heapCommon.h @@ -2,7 +2,7 @@ #define RVL_SDK_MEM_HEAP_COMMON_H #include "rvl/MEM/mem_list.h" #include "rvl/OS.h" -#include "rvl/types.h" +#include // #include "string.h" #ifdef __cplusplus extern "C" { @@ -18,8 +18,8 @@ typedef struct MEMiHeapHead { u32 magic; // at 0x0 MEMLink link; // at 0x4 MEMList list; // at 0xC - u8* start; // at 0x18 - u8* end; // at 0x1C + u8 *start; // at 0x18 + u8 *end; // at 0x1C OSMutex mutex; // at 0x20 union { @@ -31,53 +31,55 @@ typedef struct MEMiHeapHead { }; // at 0x38 } MEMiHeapHead; -void MEMiInitHeapHead(MEMiHeapHead* heap, u32 magic, void* start, void* end, - u16 opt); -void MEMiFinalizeHeap(MEMiHeapHead* heap); -MEMiHeapHead* MEMFindContainHeap(const void* memBlock); +void MEMiInitHeapHead(MEMiHeapHead *heap, u32 magic, void *start, void *end, u16 opt); +void MEMiFinalizeHeap(MEMiHeapHead *heap); +MEMiHeapHead *MEMFindContainHeap(const void *memBlock); -static inline int GetUIntPtr(const void* p) { return (int)p; } - -static inline void* AddU32ToPtr(const void* p, u32 ofs) { - return (void*)(GetUIntPtr(p) + ofs); +static inline int GetUIntPtr(const void *p) { + return (int)p; } -static inline void* SubU32ToPtr(const void* p, u32 ofs) { - return (void*)(GetUIntPtr(p) - ofs); +static inline void *AddU32ToPtr(const void *p, u32 ofs) { + return (void *)(GetUIntPtr(p) + ofs); } -static inline const void* AddU32ToCPtr(const void* p, u32 ofs) { - return (const void*)(GetUIntPtr(p) + ofs); +static inline void *SubU32ToPtr(const void *p, u32 ofs) { + return (void *)(GetUIntPtr(p) - ofs); } -static inline const void* SubU32ToCPtr(const void* p, u32 ofs) { - return (const void*)(GetUIntPtr(p) - ofs); +static inline const void *AddU32ToCPtr(const void *p, u32 ofs) { + return (const void *)(GetUIntPtr(p) + ofs); } -static inline s32 GetOffsetFromPtr(const void* start, const void* end) { +static inline const void *SubU32ToCPtr(const void *p, u32 ofs) { + return (const void *)(GetUIntPtr(p) - ofs); +} + +static inline s32 GetOffsetFromPtr(const void *start, const void *end) { return GetUIntPtr(end) - GetUIntPtr(start); } -static inline u16 GetOptForHeap(const MEMiHeapHead* heap) { return heap->opt; } +static inline u16 GetOptForHeap(const MEMiHeapHead *heap) { + return heap->opt; +} -static inline void SetOptForHeap(MEMiHeapHead* heap, u16 opt) { +static inline void SetOptForHeap(MEMiHeapHead *heap, u16 opt) { heap->opt = (u8)opt; } -static inline void LockHeap(MEMiHeapHead* heap) { +static inline void LockHeap(MEMiHeapHead *heap) { if (GetOptForHeap(heap) & MEM_HEAP_OPT_CAN_LOCK) { OSLockMutex(&heap->mutex); } } -static inline void UnlockHeap(MEMiHeapHead* heap) { +static inline void UnlockHeap(MEMiHeapHead *heap) { if (GetOptForHeap(heap) & MEM_HEAP_OPT_CAN_LOCK) { OSUnlockMutex(&heap->mutex); } } -static void FillAllocMemory(MEMiHeapHead* heap, void* memBlock, - u32 size); +static void FillAllocMemory(MEMiHeapHead *heap, void *memBlock, u32 size); #ifdef __cplusplus } diff --git a/include/rvl/MEM/mem_list.h b/include/rvl/MEM/mem_list.h index ad7fbbd0..c54b906b 100644 --- a/include/rvl/MEM/mem_list.h +++ b/include/rvl/MEM/mem_list.h @@ -1,26 +1,26 @@ #ifndef RVL_SDK_MEM_LIST_H #define RVL_SDK_MEM_LIST_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif typedef struct MEMList { - void* head; // at 0x0 - void* tail; // at 0x4 + void *head; // at 0x0 + void *tail; // at 0x4 u16 length; // at 0x8 u16 offset; // at 0xA } MEMList; typedef struct MEMLink { - void* prev; // at 0x0 - void* next; // at 0x4 + void *prev; // at 0x0 + void *next; // at 0x4 } MEMLink; -void MEMInitList(MEMList* list, u16 offset); -void MEMAppendListObject(MEMList* list, void* object); -void MEMRemoveListObject(MEMList* list, void* object); -void* MEMGetNextListObject(MEMList* list, void* object); +void MEMInitList(MEMList *list, u16 offset); +void MEMAppendListObject(MEMList *list, void *object); +void MEMRemoveListObject(MEMList *list, void *object); +void *MEMGetNextListObject(MEMList *list, void *object); #ifdef __cplusplus } diff --git a/include/rvl/MTX/mtx.h b/include/rvl/MTX/mtx.h index 0d7f7eca..642f9997 100644 --- a/include/rvl/MTX/mtx.h +++ b/include/rvl/MTX/mtx.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_MTX_MTX_H #define RVL_SDK_MTX_MTX_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -25,14 +25,14 @@ void PSMTXInverse(const Mtx, Mtx); void PSMTXInvXpose(const Mtx, Mtx); void PSMTXRotRad(Mtx, f32, char); void PSMTXRotTrig(Mtx, f32, f32, char); -void PSMTXRotAxisRad(Mtx, const Vec*, f32); +void PSMTXRotAxisRad(Mtx, const Vec *, f32); void PSMTXTrans(Mtx, f32, f32, f32); void PSMTXTransApply(const Mtx, Mtx, f32, f32, f32); void PSMTXScale(Mtx, f32, f32, f32); void PSMTXScaleApply(const Mtx, Mtx, f32, f32, f32); -void PSMTXQuat(Mtx, const Quaternion*); +void PSMTXQuat(Mtx, const Quaternion *); -void C_MTXLookAt(Mtx, const Vec*, const Vec*, const Vec*); +void C_MTXLookAt(Mtx, const Vec *, const Vec *, const Vec *); void C_MTXLightFrustum(Mtx, f32, f32, f32, f32, f32, f32, f32, f32, f32); void C_MTXLightPerspective(Mtx, f32, f32, f32, f32, f32, f32); void C_MTXLightOrtho(Mtx, f32, f32, f32, f32, f32, f32, f32, f32); diff --git a/include/rvl/MTX/mtx44.h b/include/rvl/MTX/mtx44.h index e5dfd040..8834028b 100644 --- a/include/rvl/MTX/mtx44.h +++ b/include/rvl/MTX/mtx44.h @@ -1,7 +1,7 @@ #ifndef RVL_SDK_MTX_MTX44_H #define RVL_SDK_MTX_MTX44_H #include "rvl/MTX/mtx.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif diff --git a/include/rvl/MTX/mtxvec.h b/include/rvl/MTX/mtxvec.h index b1650c51..ff00123f 100644 --- a/include/rvl/MTX/mtxvec.h +++ b/include/rvl/MTX/mtxvec.h @@ -1,12 +1,12 @@ #ifndef RVL_SDK_MTX_MTXVEC_H #define RVL_SDK_MTX_MTXVEC_H #include "rvl/MTX/mtx.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif -void PSMTXMultVec(const Mtx, const Vec*, Vec*); +void PSMTXMultVec(const Mtx, const Vec *, Vec *); #ifdef __cplusplus } diff --git a/include/rvl/MTX/quat.h b/include/rvl/MTX/quat.h index 662a9acc..7a92b9cf 100644 --- a/include/rvl/MTX/quat.h +++ b/include/rvl/MTX/quat.h @@ -1,15 +1,15 @@ #ifndef RVL_SDK_MTX_QUAT_H #define RVL_SDK_MTX_QUAT_H #include "rvl/MTX/mtx.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif -void PSQUATMultiply(const Quaternion*, const Quaternion*, Quaternion*); -void PSQUATNormalize(const Quaternion*, Quaternion*); -void C_QUATMtx(Quaternion*, const Mtx); -void C_QUATSlerp(const Quaternion*, const Quaternion*, Quaternion*, f32); +void PSQUATMultiply(const Quaternion *, const Quaternion *, Quaternion *); +void PSQUATNormalize(const Quaternion *, Quaternion *); +void C_QUATMtx(Quaternion *, const Mtx); +void C_QUATSlerp(const Quaternion *, const Quaternion *, Quaternion *, f32); #ifdef __cplusplus } diff --git a/include/rvl/MTX/vec.h b/include/rvl/MTX/vec.h index 3f362386..cfc4410c 100644 --- a/include/rvl/MTX/vec.h +++ b/include/rvl/MTX/vec.h @@ -1,20 +1,20 @@ #ifndef RVL_SDK_MTX_VEC_H #define RVL_SDK_MTX_VEC_H #include "rvl/MTX/mtx.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif -void PSVECAdd(const Vec*, const Vec*, Vec*); -void PSVECScale(const Vec*, Vec*, f32); -void PSVECNormalize(const Vec*, Vec*); -f32 PSVECMag(const Vec*); -f32 PSVECDotProduct(const Vec*, const Vec*); -void PSVECCrossProduct(const Vec*, const Vec*, Vec*); -f32 PSVECSquareDistance(const Vec*, const Vec*); +void PSVECAdd(const Vec *, const Vec *, Vec *); +void PSVECScale(const Vec *, Vec *, f32); +void PSVECNormalize(const Vec *, Vec *); +f32 PSVECMag(const Vec *); +f32 PSVECDotProduct(const Vec *, const Vec *); +void PSVECCrossProduct(const Vec *, const Vec *, Vec *); +f32 PSVECSquareDistance(const Vec *, const Vec *); -void C_VECHalfAngle(const Vec*, const Vec*, Vec*); +void C_VECHalfAngle(const Vec *, const Vec *, Vec *); #ifdef __cplusplus } diff --git a/include/rvl/NAND/NANDCheck.h b/include/rvl/NAND/NANDCheck.h index 50969817..52d87ce0 100644 --- a/include/rvl/NAND/NANDCheck.h +++ b/include/rvl/NAND/NANDCheck.h @@ -1,7 +1,7 @@ #ifndef RVL_SDK_NAND_CHECK_H #define RVL_SDK_NAND_CHECK_H #include "rvl/NAND/nand.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -13,7 +13,7 @@ typedef enum { NAND_CHECK_TOO_MANY_USER_FILES = (1 << 3), } NANDCheckFlags; -NANDResult NANDCheck(u32 neededBlocks, u32 neededFiles, u32* answer); +NANDResult NANDCheck(u32 neededBlocks, u32 neededFiles, u32 *answer); #ifdef __cplusplus } diff --git a/include/rvl/NAND/NANDCore.h b/include/rvl/NAND/NANDCore.h index 59cafe7e..dc2616a1 100644 --- a/include/rvl/NAND/NANDCore.h +++ b/include/rvl/NAND/NANDCore.h @@ -1,33 +1,30 @@ #ifndef RVL_SDK_NAND_CORE_H #define RVL_SDK_NAND_CORE_H #include "rvl/NAND/nand.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif -void nandRemoveTailToken(char* newp, const char* oldp); -void nandGetHeadToken(char* head, char* rest, const char* path); -void nandGetRelativeName(char* name, const char* path); -void nandConvertPath(char* abs, const char* dir, const char* rel); -BOOL nandIsPrivatePath(const char* path); -BOOL nandIsUnderPrivatePath(const char* path); +void nandRemoveTailToken(char *newp, const char *oldp); +void nandGetHeadToken(char *head, char *rest, const char *path); +void nandGetRelativeName(char *name, const char *path); +void nandConvertPath(char *abs, const char *dir, const char *rel); +BOOL nandIsPrivatePath(const char *path); +BOOL nandIsUnderPrivatePath(const char *path); BOOL nandIsInitialized(void); void nandReportErrorCode(s32 result) DONT_INLINE; NANDResult nandConvertErrorCode(s32 result); -void nandGenerateAbsPath(char* abs, const char* rel); -void nandGetParentDirectory(char* dir, const char* path); +void nandGenerateAbsPath(char *abs, const char *rel); +void nandGetParentDirectory(char *dir, const char *path); NANDResult NANDInit(void); -NANDResult NANDGetCurrentDir(char* out); -NANDResult NANDGetHomeDir(char* out); -void nandCallback(s32 result, void* arg); -NANDResult NANDGetType(const char* path, u8* type); -NANDResult NANDPrivateGetTypeAsync(const char* path, u8* type, - NANDAsyncCallback callback, - NANDCommandBlock* block); -const char* nandGetHomeDir(void); -void NANDInitBanner(NANDBanner* banner, u32 flags, const wchar_t* title, - const wchar_t* subtitle); +NANDResult NANDGetCurrentDir(char *out); +NANDResult NANDGetHomeDir(char *out); +void nandCallback(s32 result, void *arg); +NANDResult NANDGetType(const char *path, u8 *type); +NANDResult NANDPrivateGetTypeAsync(const char *path, u8 *type, NANDAsyncCallback callback, NANDCommandBlock *block); +const char *nandGetHomeDir(void); +void NANDInitBanner(NANDBanner *banner, u32 flags, const wchar_t *title, const wchar_t *subtitle); #ifdef __cplusplus } diff --git a/include/rvl/NAND/NANDOpenClose.h b/include/rvl/NAND/NANDOpenClose.h index baf5dc5a..de9106d8 100644 --- a/include/rvl/NAND/NANDOpenClose.h +++ b/include/rvl/NAND/NANDOpenClose.h @@ -1,29 +1,24 @@ #ifndef RVL_SDK_NAND_OPEN_CLOSE_H #define RVL_SDK_NAND_OPEN_CLOSE_H #include "rvl/NAND/nand.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif -NANDResult NANDOpen(const char* path, NANDFileInfo* info, u8 mode); -NANDResult NANDPrivateOpen(const char* path, NANDFileInfo* info, u8 mode); -NANDResult NANDOpenAsync(const char* path, NANDFileInfo* info, u8 mode, - NANDAsyncCallback callback, NANDCommandBlock* block); -NANDResult NANDPrivateOpenAsync(const char* path, NANDFileInfo* info, u8 mode, - NANDAsyncCallback callback, - NANDCommandBlock* block); +NANDResult NANDOpen(const char *path, NANDFileInfo *info, u8 mode); +NANDResult NANDPrivateOpen(const char *path, NANDFileInfo *info, u8 mode); +NANDResult NANDOpenAsync(const char *path, NANDFileInfo *info, u8 mode, NANDAsyncCallback callback, + NANDCommandBlock *block); +NANDResult NANDPrivateOpenAsync(const char *path, NANDFileInfo *info, u8 mode, NANDAsyncCallback callback, + NANDCommandBlock *block); -NANDResult NANDClose(NANDFileInfo* info); -NANDResult NANDCloseAsync(NANDFileInfo* info, NANDAsyncCallback callback, - NANDCommandBlock* block); +NANDResult NANDClose(NANDFileInfo *info); +NANDResult NANDCloseAsync(NANDFileInfo *info, NANDAsyncCallback callback, NANDCommandBlock *block); -NANDResult NANDPrivateSafeOpenAsync(const char* path, NANDFileInfo* info, - u8 access, void* buffer, u32 bufferSize, - NANDAsyncCallback callback, - NANDCommandBlock* block); -NANDResult NANDSafeCloseAsync(NANDFileInfo* info, NANDAsyncCallback callback, - NANDCommandBlock* block); +NANDResult NANDPrivateSafeOpenAsync(const char *path, NANDFileInfo *info, u8 access, void *buffer, u32 bufferSize, + NANDAsyncCallback callback, NANDCommandBlock *block); +NANDResult NANDSafeCloseAsync(NANDFileInfo *info, NANDAsyncCallback callback, NANDCommandBlock *block); #ifdef __cplusplus } diff --git a/include/rvl/NAND/nand.h b/include/rvl/NAND/nand.h index c59d30c0..bae91f37 100644 --- a/include/rvl/NAND/nand.h +++ b/include/rvl/NAND/nand.h @@ -1,7 +1,7 @@ #ifndef RVL_SDK_NAND_H #define RVL_SDK_NAND_H #include "rvl/FS.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -42,12 +42,7 @@ typedef enum { NAND_SEEK_END, } NANDSeekMode; -typedef enum { - NAND_ACCESS_NONE, - NAND_ACCESS_READ, - NAND_ACCESS_WRITE, - NAND_ACCESS_RW -} NANDAccessType; +typedef enum { NAND_ACCESS_NONE, NAND_ACCESS_READ, NAND_ACCESS_WRITE, NAND_ACCESS_RW } NANDAccessType; typedef enum { NAND_FILE_TYPE_NONE, @@ -71,7 +66,7 @@ typedef enum { NAND_PERM_RWALL = NAND_PERM_RALL | NAND_PERM_WALL } NANDPermission; -typedef void (*NANDAsyncCallback)(s32 result, struct NANDCommandBlock* block); +typedef void (*NANDAsyncCallback)(s32 result, struct NANDCommandBlock *block); typedef struct NANDStatus { u32 ownerId; // at 0x0 @@ -91,12 +86,12 @@ typedef struct NANDFileInfo { } NANDFileInfo; typedef struct NANDCommandBlock { - void* userData; // at 0x0 + void *userData; // at 0x0 NANDAsyncCallback callback; // at 0x4 - NANDFileInfo* info; // at 0x8 - void* bytes; // at 0xC - void* inodes; // at 0x10 - NANDStatus* status; // at 0x14 + NANDFileInfo *info; // at 0x8 + void *bytes; // at 0xC + void *inodes; // at 0x10 + NANDStatus *status; // at 0x14 u32 ownerId; // at 0x18 u16 groupId; // at 0x1C u8 nextStage; // at 0x1E @@ -106,23 +101,23 @@ typedef struct NANDCommandBlock { u32 otherPerm; // at 0x2C u32 dirFileCount; // at 0x30 char path[FS_MAX_PATH]; // at 0x34 - u32* length; // at 0x74 - u32* position; // at 0x78 + u32 *length; // at 0x74 + u32 *position; // at 0x78 s32 state; // at 0x7C - void* buffer; // at 0x80 + void *buffer; // at 0x80 u32 bufferSize; // at 0x84 - u8* type; // at 0x88 + u8 *type; // at 0x88 u32 uniqueNo; // at 0x8C u32 reqBlocks; // at 0x90 u32 reqInodes; // at 0x94 - u32* answer; // at 0x98 + u32 *answer; // at 0x98 u32 homeBlocks; // at 0x9C u32 homeInodes; // at 0xA0 u32 userBlocks; // at 0xA4 u32 userInodes; // at 0xA8 u32 workBlocks; // at 0xAC u32 workInodes; // at 0xB0 - const char** dir; // at 0xB4 + const char **dir; // at 0xB4 } NANDCommandBlock; typedef struct NANDBanner { @@ -136,48 +131,41 @@ typedef struct NANDBanner { u8 iconTexture[0x1200][NAND_BANNER_ICON_MAX_FRAME]; // at 0x60A0 } NANDBanner; -NANDResult NANDCreate(const char* path, u8 perm, u8 attr); -NANDResult NANDPrivateCreate(const char* path, u8 perm, u8 attr); -NANDResult NANDPrivateCreateAsync(const char* path, u8 perm, u8 attr, - NANDAsyncCallback callback, - NANDCommandBlock* block); +NANDResult NANDCreate(const char *path, u8 perm, u8 attr); +NANDResult NANDPrivateCreate(const char *path, u8 perm, u8 attr); +NANDResult NANDPrivateCreateAsync(const char *path, u8 perm, u8 attr, NANDAsyncCallback callback, + NANDCommandBlock *block); -NANDResult NANDDelete(const char* path); -NANDResult NANDPrivateDelete(const char* path); -NANDResult NANDPrivateDeleteAsync(const char* path, NANDAsyncCallback callback, - NANDCommandBlock* block); +NANDResult NANDDelete(const char *path); +NANDResult NANDPrivateDelete(const char *path); +NANDResult NANDPrivateDeleteAsync(const char *path, NANDAsyncCallback callback, NANDCommandBlock *block); -NANDResult NANDRead(NANDFileInfo* info, void* buf, u32 len); -NANDResult NANDReadAsync(NANDFileInfo* info, void* buf, u32 len, - NANDAsyncCallback callback, NANDCommandBlock* block); +NANDResult NANDRead(NANDFileInfo *info, void *buf, u32 len); +NANDResult NANDReadAsync(NANDFileInfo *info, void *buf, u32 len, NANDAsyncCallback callback, NANDCommandBlock *block); -NANDResult NANDWrite(NANDFileInfo* info, const void* buf, u32 len); -NANDResult NANDWriteAsync(NANDFileInfo* info, const void* buf, u32 len, - NANDAsyncCallback callback, NANDCommandBlock* block); +NANDResult NANDWrite(NANDFileInfo *info, const void *buf, u32 len); +NANDResult NANDWriteAsync(NANDFileInfo *info, const void *buf, u32 len, NANDAsyncCallback callback, + NANDCommandBlock *block); -NANDResult NANDSeek(NANDFileInfo* info, s32 offset, NANDSeekMode whence); -NANDResult NANDSeekAsync(NANDFileInfo* info, s32 offset, NANDSeekMode whence, - NANDAsyncCallback callback, NANDCommandBlock* block); +NANDResult NANDSeek(NANDFileInfo *info, s32 offset, NANDSeekMode whence); +NANDResult NANDSeekAsync(NANDFileInfo *info, s32 offset, NANDSeekMode whence, NANDAsyncCallback callback, + NANDCommandBlock *block); -NANDResult NANDPrivateCreateDir(const char* path, u8 perm, u8 attr); -NANDResult NANDPrivateCreateDirAsync(const char* path, u8 perm, u8 attr, - NANDAsyncCallback callback, - NANDCommandBlock* block); +NANDResult NANDPrivateCreateDir(const char *path, u8 perm, u8 attr); +NANDResult NANDPrivateCreateDirAsync(const char *path, u8 perm, u8 attr, NANDAsyncCallback callback, + NANDCommandBlock *block); -NANDResult NANDMove(const char* from, const char* to); +NANDResult NANDMove(const char *from, const char *to); -NANDResult NANDGetLength(NANDFileInfo* info, u32* length); -NANDResult NANDGetLengthAsync(NANDFileInfo* info, u32* lengthOut, - NANDAsyncCallback callback, - NANDCommandBlock* block); +NANDResult NANDGetLength(NANDFileInfo *info, u32 *length); +NANDResult NANDGetLengthAsync(NANDFileInfo *info, u32 *lengthOut, NANDAsyncCallback callback, NANDCommandBlock *block); -NANDResult NANDGetStatus(const char* path, NANDStatus* status); -NANDResult NANDPrivateGetStatusAsync(const char* path, NANDStatus* status, - NANDAsyncCallback callback, - NANDCommandBlock* block); +NANDResult NANDGetStatus(const char *path, NANDStatus *status); +NANDResult NANDPrivateGetStatusAsync(const char *path, NANDStatus *status, NANDAsyncCallback callback, + NANDCommandBlock *block); -void NANDSetUserData(NANDCommandBlock* block, void* data); -void* NANDGetUserData(NANDCommandBlock* block); +void NANDSetUserData(NANDCommandBlock *block, void *data); +void *NANDGetUserData(NANDCommandBlock *block); #ifdef __cplusplus } diff --git a/include/rvl/NWC24/NWC24Schedule.h b/include/rvl/NWC24/NWC24Schedule.h index 18b70ffb..922af2ca 100644 --- a/include/rvl/NWC24/NWC24Schedule.h +++ b/include/rvl/NWC24/NWC24Schedule.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_NWC24_SCHEDULE_H #define RVL_SDK_NWC24_SCHEDULE_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif diff --git a/include/rvl/NWC24/NWC24System.h b/include/rvl/NWC24/NWC24System.h index 0e4b9a5f..75cc1c60 100644 --- a/include/rvl/NWC24/NWC24System.h +++ b/include/rvl/NWC24/NWC24System.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_NWC24_SYSTEM_H #define RVL_SDK_NWC24_SYSTEM_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif diff --git a/include/rvl/NWC24/NWC24Time.h b/include/rvl/NWC24/NWC24Time.h index 0b30b9b2..e7b55119 100644 --- a/include/rvl/NWC24/NWC24Time.h +++ b/include/rvl/NWC24/NWC24Time.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_NWC24_TIME_H #define RVL_SDK_NWC24_TIME_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif diff --git a/include/rvl/NdevExi2AD/DebuggerDriver.h b/include/rvl/NdevExi2AD/DebuggerDriver.h index 38892315..be907319 100644 --- a/include/rvl/NdevExi2AD/DebuggerDriver.h +++ b/include/rvl/NdevExi2AD/DebuggerDriver.h @@ -2,24 +2,24 @@ #define RVL_SDK_NDEV_EXI2_AD_DEBUGGER_DRIVER_H #include "rvl/NdevExi2AD/exi2.h" #include "rvl/OS.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif -void DBInitComm(u8** flagOut, OSInterruptHandler handler); +void DBInitComm(u8 **flagOut, OSInterruptHandler handler); void DBInitInterrupts(void); u32 DBQueryData(void); -BOOL DBRead(void* dst, u32 size); -BOOL DBWrite(const void* src, u32 size); +BOOL DBRead(void *dst, u32 size); +BOOL DBWrite(const void *src, u32 size); void DBOpen(void); void DBClose(void); -static inline BOOL __DBReadMailbox(u32* mailOut) { +static inline BOOL __DBReadMailbox(u32 *mailOut) { return __DBEXIReadReg(0x34000200, mailOut, sizeof(*mailOut)); } -static inline BOOL __DBRead(u32 ofs, void* dest, u32 size) { +static inline BOOL __DBRead(u32 ofs, void *dest, u32 size) { return __DBEXIReadRam(((ofs + 0xD10000) * 0x40) & 0x3FFFFF00, dest, size); } @@ -27,9 +27,8 @@ static inline BOOL __DBWriteMailbox(u32 mail) { return __DBEXIWriteReg(0xB4000100, &mail, sizeof(mail)); } -static inline BOOL __DBWrite(u32 ofs, const void* src, u32 size) { - return __DBEXIWriteRam( - (((ofs + 0xD10000) * 0x40) & 0x3FFFFF00) | 0x80000000, src, size); +static inline BOOL __DBWrite(u32 ofs, const void *src, u32 size) { + return __DBEXIWriteRam((((ofs + 0xD10000) * 0x40) & 0x3FFFFF00) | 0x80000000, src, size); } #ifdef __cplusplus diff --git a/include/rvl/NdevExi2AD/ODEMU.h b/include/rvl/NdevExi2AD/ODEMU.h index 1f77ab31..8de6ddb7 100644 --- a/include/rvl/NdevExi2AD/ODEMU.h +++ b/include/rvl/NdevExi2AD/ODEMU.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_NDEV_EXI2_AD_ODEMU_H #define RVL_SDK_NDEV_EXI2_AD_ODEMU_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -9,7 +9,9 @@ static inline u32 ODEMUGenMailData(u32 ofs, u32 size) { return (ofs & 0xff) << 0x10 | 0x1f000000 | size & 0x1fff; } -static inline u32 ODEMUGetPage(u32 mail) { return (mail & 0xFF0000) >> 16; } +static inline u32 ODEMUGetPage(u32 mail) { + return (mail & 0xFF0000) >> 16; +} static inline u32 ODEMUGetPc2NngcOffset(u32 mail) { if (!(ODEMUGetPage(mail) & 0x1)) { @@ -23,7 +25,9 @@ static inline BOOL ODEMUIsValidMail(u32 mail) { return (mail & 0x1F000000) == 0x1F000000; } -static inline u32 ODEMUGetSize(u32 mail) { return mail & 0x1FFF; } +static inline u32 ODEMUGetSize(u32 mail) { + return mail & 0x1FFF; +} #ifdef __cplusplus } diff --git a/include/rvl/NdevExi2AD/exi2.h b/include/rvl/NdevExi2AD/exi2.h index 64eed826..d240bce3 100644 --- a/include/rvl/NdevExi2AD/exi2.h +++ b/include/rvl/NdevExi2AD/exi2.h @@ -1,16 +1,16 @@ #ifndef RVL_SDK_NDEV_EXI2_AD_EXI2_H #define RVL_SDK_NDEV_EXI2_AD_EXI2_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif -BOOL __EXI2Imm(void* mem, s32 size, u32 type); +BOOL __EXI2Imm(void *mem, s32 size, u32 type); void __DBEXIInit(void); -BOOL __DBEXIReadReg(u32 cmd, void* mem, s32 size); -BOOL __DBEXIWriteReg(u32 cmd, const void* mem, s32 size); -BOOL __DBEXIReadRam(u32 cmd, void* mem, s32 size); -BOOL __DBEXIWriteRam(u32 cmd, const void* mem, s32 size); +BOOL __DBEXIReadReg(u32 cmd, void *mem, s32 size); +BOOL __DBEXIWriteReg(u32 cmd, const void *mem, s32 size); +BOOL __DBEXIReadRam(u32 cmd, void *mem, s32 size); +BOOL __DBEXIWriteRam(u32 cmd, const void *mem, s32 size); #ifdef __cplusplus } diff --git a/include/rvl/OS/OS.h b/include/rvl/OS/OS.h index 29666cd2..290ab6a4 100644 --- a/include/rvl/OS/OS.h +++ b/include/rvl/OS/OS.h @@ -2,7 +2,7 @@ #define RVL_SDK_OS_H #include "rvl/OS/OSContext.h" #include "rvl/OS/OSExec.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -61,7 +61,7 @@ typedef struct OSIOSRev { u16 buildYear; // at 0x6 } OSIOSRev; -typedef void (*OSExceptionHandler)(u8 type, OSContext* ctx); +typedef void (*OSExceptionHandler)(u8 type, OSContext *ctx); extern BOOL __OSInIPL; extern BOOL __OSInNandBoot; @@ -71,16 +71,16 @@ extern OSExecParams __OSRebootParams; void __OSFPRInit(void); u32 __OSGetHollywoodRev(void); -void __OSGetIOSRev(OSIOSRev* rev); +void __OSGetIOSRev(OSIOSRev *rev); u32 OSGetConsoleType(void); void OSInit(void); OSExceptionHandler __OSSetExceptionHandler(u8 type, OSExceptionHandler handler); OSExceptionHandler __OSGetExceptionHandler(u8 type); -void OSDefaultExceptionHandler(u8 type, OSContext* ctx); +void OSDefaultExceptionHandler(u8 type, OSContext *ctx); void __OSPSInit(void); u32 __OSGetDIConfig(void); -void OSRegisterVersion(const char* ver); -const char* OSGetAppGamename(void); +void OSRegisterVersion(const char *ver); +const char *OSGetAppGamename(void); u8 OSGetAppType(void); #ifdef __cplusplus diff --git a/include/rvl/OS/OSAddress.h b/include/rvl/OS/OSAddress.h index 742bbf8a..9563cd1d 100644 --- a/include/rvl/OS/OSAddress.h +++ b/include/rvl/OS/OSAddress.h @@ -1,20 +1,20 @@ #ifndef RVL_SDK_OS_ADDRESS_H #define RVL_SDK_OS_ADDRESS_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif -static inline void* OSPhysicalToCached(u32 ofs) { - return (void*)(ofs + 0x80000000); +static inline void *OSPhysicalToCached(u32 ofs) { + return (void *)(ofs + 0x80000000); } -static inline void* OSPhysicalToUncached(u32 ofs) { - return (void*)(ofs + 0xC0000000); +static inline void *OSPhysicalToUncached(u32 ofs) { + return (void *)(ofs + 0xC0000000); } -static inline void* OSCachedToPhysical(const void* ofs) { - return (char*)ofs - 0x80000000; +static inline void *OSCachedToPhysical(const void *ofs) { + return (char *)ofs - 0x80000000; } #ifdef __cplusplus diff --git a/include/rvl/OS/OSAlarm.h b/include/rvl/OS/OSAlarm.h index 13c675f9..10f7f99b 100644 --- a/include/rvl/OS/OSAlarm.h +++ b/include/rvl/OS/OSAlarm.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_OS_ALARM_H #define RVL_SDK_OS_ALARM_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -9,33 +9,32 @@ extern "C" { typedef struct OSAlarm; typedef struct OSContext; -typedef void (*OSAlarmHandler)(struct OSAlarm* alarm, struct OSContext* ctx); +typedef void (*OSAlarmHandler)(struct OSAlarm *alarm, struct OSContext *ctx); typedef struct OSAlarm { OSAlarmHandler handler; // at 0x0 u32 tag; // at 0x4 s64 end; - struct OSAlarm* prev; // at 0x10 - struct OSAlarm* next; // at 0x14 + struct OSAlarm *prev; // at 0x10 + struct OSAlarm *next; // at 0x14 s64 period; // at 0x18 s64 start; // at 0x20 - void* userData; // at 0x28 + void *userData; // at 0x28 } OSAlarm; typedef struct OSAlarmQueue { - OSAlarm* head; // at 0x0 - OSAlarm* tail; // at 0x4 + OSAlarm *head; // at 0x0 + OSAlarm *tail; // at 0x4 } OSAlarmQueue; void __OSInitAlarm(void); -void OSCreateAlarm(OSAlarm* alarm); -void OSSetAlarm(OSAlarm* alarm, s64 tick, OSAlarmHandler handler); -void OSSetPeriodicAlarm(OSAlarm* alarm, s64 tick, s64 period, - OSAlarmHandler handler); -void OSCancelAlarm(OSAlarm* alarm); -void OSSetAlarmTag(OSAlarm* alarm, u32 tag); -void OSSetAlarmUserData(OSAlarm* alarm, void* userData); -void* OSGetAlarmUserData(const OSAlarm* alarm); +void OSCreateAlarm(OSAlarm *alarm); +void OSSetAlarm(OSAlarm *alarm, s64 tick, OSAlarmHandler handler); +void OSSetPeriodicAlarm(OSAlarm *alarm, s64 tick, s64 period, OSAlarmHandler handler); +void OSCancelAlarm(OSAlarm *alarm); +void OSSetAlarmTag(OSAlarm *alarm, u32 tag); +void OSSetAlarmUserData(OSAlarm *alarm, void *userData); +void *OSGetAlarmUserData(const OSAlarm *alarm); #ifdef __cplusplus } diff --git a/include/rvl/OS/OSAlloc.h b/include/rvl/OS/OSAlloc.h index c5c5cbf2..a7baddc5 100644 --- a/include/rvl/OS/OSAlloc.h +++ b/include/rvl/OS/OSAlloc.h @@ -1,17 +1,17 @@ #ifndef RVL_SDK_OS_ALLOC_H #define RVL_SDK_OS_ALLOC_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif extern volatile s32 __OSCurrHeap; -void* OSAllocFromHeap(s32 handle, s32 size); -void OSFreeToHeap(s32 handle, void* p); +void *OSAllocFromHeap(s32 handle, s32 size); +void OSFreeToHeap(s32 handle, void *p); s32 OSSetCurrentHeap(s32 handle); -void* OSInitAlloc(void* start, void* end, s32 numHeaps); -s32 OSCreateHeap(void* start, void* end); +void *OSInitAlloc(void *start, void *end, s32 numHeaps); +s32 OSCreateHeap(void *start, void *end); #ifdef __cplusplus } diff --git a/include/rvl/OS/OSArena.h b/include/rvl/OS/OSArena.h index ebf2b6bc..3900c202 100644 --- a/include/rvl/OS/OSArena.h +++ b/include/rvl/OS/OSArena.h @@ -1,27 +1,27 @@ #ifndef RVL_SDK_OS_ARENA_H #define RVL_SDK_OS_ARENA_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif -void* OSGetMEM1ArenaHi(void); -void* OSGetMEM2ArenaHi(void); -void* OSGetArenaHi(void); +void *OSGetMEM1ArenaHi(void); +void *OSGetMEM2ArenaHi(void); +void *OSGetArenaHi(void); -void* OSGetMEM1ArenaLo(void); -void* OSGetMEM2ArenaLo(void); -void* OSGetArenaLo(void); +void *OSGetMEM1ArenaLo(void); +void *OSGetMEM2ArenaLo(void); +void *OSGetArenaLo(void); -void OSSetMEM1ArenaHi(void* hi); -void OSSetMEM2ArenaHi(void* hi); -void OSSetArenaHi(void* hi); +void OSSetMEM1ArenaHi(void *hi); +void OSSetMEM2ArenaHi(void *hi); +void OSSetArenaHi(void *hi); -void OSSetMEM1ArenaLo(void* lo); -void OSSetMEM2ArenaLo(void* lo); -void OSSetArenaLo(void* lo); +void OSSetMEM1ArenaLo(void *lo); +void OSSetMEM2ArenaLo(void *lo); +void OSSetArenaLo(void *lo); -void* OSAllocFromMEM1ArenaLo(size_t size, u32 align); +void *OSAllocFromMEM1ArenaLo(size_t size, u32 align); #ifdef __cplusplus } diff --git a/include/rvl/OS/OSAudioSystem.h b/include/rvl/OS/OSAudioSystem.h index a5c811bb..dbf7a60d 100644 --- a/include/rvl/OS/OSAudioSystem.h +++ b/include/rvl/OS/OSAudioSystem.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_OS_AUDIOSYSTEM_H #define RVL_SDK_OS_AUDIOSYSTEM_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif diff --git a/include/rvl/OS/OSCache.h b/include/rvl/OS/OSCache.h index a35ca89c..d8c995d6 100644 --- a/include/rvl/OS/OSCache.h +++ b/include/rvl/OS/OSCache.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_OS_CACHE_H #define RVL_SDK_OS_CACHE_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -9,22 +9,22 @@ extern "C" { typedef struct OSContext; void DCEnable(void); -void DCInvalidateRange(const void* buf, u32 len); -void DCFlushRange(const void* buf, u32 len); -void DCStoreRange(const void* buf, u32 len); -void DCFlushRangeNoSync(const void* buf, u32 len); -void DCStoreRangeNoSync(const void* buf, u32 len); -void DCZeroRange(const void* buf, u32 len); +void DCInvalidateRange(const void *buf, u32 len); +void DCFlushRange(const void *buf, u32 len); +void DCStoreRange(const void *buf, u32 len); +void DCFlushRangeNoSync(const void *buf, u32 len); +void DCStoreRangeNoSync(const void *buf, u32 len); +void DCZeroRange(const void *buf, u32 len); -void ICInvalidateRange(const void* buf, u32 len); +void ICInvalidateRange(const void *buf, u32 len); void ICFlashInvalidate(void); void ICEnable(void); void LCEnable(void); void LCDisable(void); -void LCLoadBlocks(void* dst, const void* src, u32 len); -void LCStoreBlocks(void* dst, const void* src, u32 len); -u32 LCStoreData(void* dst, const void* src, u32 len); +void LCLoadBlocks(void *dst, const void *src, u32 len); +void LCStoreBlocks(void *dst, const void *src, u32 len); +u32 LCStoreData(void *dst, const void *src, u32 len); u32 LCQueueLength(void); void LCQueueWait(u32 n); @@ -32,7 +32,7 @@ void L2Enable(void); void L2Disable(void); void L2GlobalInvalidate(void); -void DMAErrorHandler(u8 error, OSContext* ctx, u32 dsisr, u32 dar, ...); +void DMAErrorHandler(u8 error, OSContext *ctx, u32 dsisr, u32 dar, ...); void __OSCacheInit(void); diff --git a/include/rvl/OS/OSContext.h b/include/rvl/OS/OSContext.h index 8893a169..136d2e00 100644 --- a/include/rvl/OS/OSContext.h +++ b/include/rvl/OS/OSContext.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_OS_CONTEXT_H #define RVL_SDK_OS_CONTEXT_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -27,17 +27,17 @@ typedef struct OSContext { f64 psfs[32]; // at 0x1C8 } OSContext; -void OSSaveFPUContext(OSContext* ctx); -void OSSetCurrentContext(OSContext* ctx); -OSContext* OSGetCurrentContext(void); -BOOL OSSaveContext(OSContext* ctx); -void OSLoadContext(OSContext* ctx); -void* OSGetStackPointer(void); -void OSSwitchFiber(void* func, void* stack); -void OSSwitchFiberEx(u32 r3, u32 r4, u32 r5, u32 r6, void* func, void* stack); -void OSClearContext(OSContext* ctx); -void OSInitContext(OSContext* ctx, void* _srr0, void* stack); -void OSDumpContext(const OSContext* ctx); +void OSSaveFPUContext(OSContext *ctx); +void OSSetCurrentContext(OSContext *ctx); +OSContext *OSGetCurrentContext(void); +BOOL OSSaveContext(OSContext *ctx); +void OSLoadContext(OSContext *ctx); +void *OSGetStackPointer(void); +void OSSwitchFiber(void *func, void *stack); +void OSSwitchFiberEx(u32 r3, u32 r4, u32 r5, u32 r6, void *func, void *stack); +void OSClearContext(OSContext *ctx); +void OSInitContext(OSContext *ctx, void *_srr0, void *stack); +void OSDumpContext(const OSContext *ctx); void __OSContextInit(void); #ifdef __cplusplus diff --git a/include/rvl/OS/OSError.h b/include/rvl/OS/OSError.h index 36f696a1..64ce47e1 100644 --- a/include/rvl/OS/OSError.h +++ b/include/rvl/OS/OSError.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_OS_ERROR_H #define RVL_SDK_OS_ERROR_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -9,8 +9,8 @@ extern "C" { typedef struct OSContext; #define OSError(...) OSPanic(__FILE__, __LINE__, __VA_ARGS__) -#define OSAssert(exp, ...) \ - if (!(exp)) \ +#define OSAssert(exp, ...) \ + if (!(exp)) \ OSPanic(__FILE__, __LINE__, __VA_ARGS__) typedef enum { @@ -35,17 +35,16 @@ typedef enum { OS_ERR_MAX } OSErrorType; -typedef void (*OSErrorHandler)(u8 error, OSContext* ctx, u32 dsisr, u32 dar, - ...); +typedef void (*OSErrorHandler)(u8 error, OSContext *ctx, u32 dsisr, u32 dar, ...); extern OSErrorHandler __OSErrorTable[OS_ERR_MAX]; extern u32 __OSFpscrEnableBits; -DECL_WEAK void OSReport(const char* msg, ...); -DECL_WEAK void OSPanic(const char* file, int line, const char* msg, ...); +DECL_WEAK void OSReport(const char *msg, ...); +DECL_WEAK void OSPanic(const char *file, int line, const char *msg, ...); OSErrorHandler OSSetErrorHandler(u16 error, OSErrorHandler handler); -void __OSUnhandledException(u8 error, OSContext* ctx, u32 dsisr, u32 dar); +void __OSUnhandledException(u8 error, OSContext *ctx, u32 dsisr, u32 dar); #ifdef __cplusplus } diff --git a/include/rvl/OS/OSExec.h b/include/rvl/OS/OSExec.h index 3fb1c972..fc2c1213 100644 --- a/include/rvl/OS/OSExec.h +++ b/include/rvl/OS/OSExec.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_OS_EXEC_H #define RVL_SDK_OS_EXEC_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -9,14 +9,14 @@ typedef struct OSExecParams { UNKWORD WORD_0x0; UNKWORD WORD_0x4; char UNK_0x8[0x4]; - void* regionStart; // at 0xC - void* regionEnd; // at 0x10 + void *regionStart; // at 0xC + void *regionEnd; // at 0x10 char UNK_0x14[0x1C - 0x14]; } OSExecParams; extern BOOL __OSInReboot; -void __OSGetExecParams(OSExecParams* out); +void __OSGetExecParams(OSExecParams *out); void __OSLaunchMenu(void); #ifdef __cplusplus diff --git a/include/rvl/OS/OSFastCast.h b/include/rvl/OS/OSFastCast.h index d75f1e7d..5791018a 100644 --- a/include/rvl/OS/OSFastCast.h +++ b/include/rvl/OS/OSFastCast.h @@ -1,95 +1,103 @@ -// #ifndef RVL_SDK_OS_FAST_CAST_H -// #define RVL_SDK_OS_FAST_CAST_H -// #include "rvl/types.h" -// #ifdef __cplusplus -// extern "C" { -// #endif +#ifndef RVL_SDK_OS_FAST_CAST_H +#define RVL_SDK_OS_FAST_CAST_H +#include +#ifdef __cplusplus +extern "C" { +#endif -// static void OSInitFastCast(void) { -// // clang-format off -// asm { -// li r3, 4 -// oris r3, r3, 4 -// mtspr 0x392, r3 +static inline void OSInitFastCast(void) { + // clang-format off + asm { + li r3, 4 + oris r3, r3, 4 + mtspr 0x392, r3 -// li r3, 5 -// oris r3, r3, 5 -// mtspr 0x393, r3 + li r3, 5 + oris r3, r3, 5 + mtspr 0x393, r3 -// li r3, 6 -// oris r3, r3, 6 -// mtspr 0x394, r3 + li r3, 6 + oris r3, r3, 6 + mtspr 0x394, r3 -// li r3, 7 -// oris r3, r3, 7 -// mtspr 0x395, r3 -// } -// // clang-format on -// } + li r3, 7 + oris r3, r3, 7 + mtspr 0x395, r3 + } + // clang-format on +} -// static f32 __OSu16tof32(register const u16* arg) { -// register f32 ret; +static inline f32 __OSu16tof32(register const u16 *arg) { + register f32 ret; -// // clang-format off -// asm { -// psq_l ret, 0(arg), 1, 3 -// } -// // clang-format on + // clang-format off + asm { + psq_l ret, 0(arg), 1, 3 + } + // clang-format on -// return ret; -// } + return ret; +} -// static void OSu16tof32(const u16* in, f32* out) { *out = __OSu16tof32(in); } +static inline void OSu16tof32(const u16 *in, f32 *out) { + *out = __OSu16tof32(in); +} -// static u16 __OSf32tou16(register f32 arg) { -// f32 a; -// register f32* ptr = &a; -// u16 r; +static inline u16 __OSf32tou16(register f32 arg) { + f32 a; + register f32 *ptr = &a; + u16 r; -// // clang-format off -// asm { -// psq_st arg, 0(ptr), 1, 3 -// } -// // clang-format on + // clang-format off + asm { + psq_st arg, 0(ptr), 1, 3 + } + // clang-format on -// r = *(u16*)ptr; -// return r; -// } + r = *(u16 *)ptr; + return r; +} -// static void OSf32tou16(const f32* in, u16* out) { *out = __OSf32tou16(*in); } +static inline void OSf32tou16(const f32 *in, u16 *out) { + *out = __OSf32tou16(*in); +} -// static f32 __OSs16tof32(register const s16* arg) { -// register f32 ret; +static inline f32 __OSs16tof32(register const s16 *arg) { + register f32 ret; -// // clang-format off -// asm { -// psq_l ret, 0(arg), 1, 5 -// } -// // clang-format on + // clang-format off + asm { + psq_l ret, 0(arg), 1, 5 + } + // clang-format on -// return ret; -// } + return ret; +} -// static void OSs16tof32(const s16* in, f32* out) { *out = __OSs16tof32(in); } +static inline void OSs16tof32(const s16 *in, f32 *out) { + *out = __OSs16tof32(in); +} -// static s16 __OSf32tos16(register f32 arg) { -// f32 a; -// register f32* ptr = &a; -// s16 r; +static inline s16 __OSf32tos16(register f32 arg) { + f32 a; + register f32 *ptr = &a; + s16 r; -// // clang-format off -// asm { -// psq_st arg, 0(ptr), 1, 5 -// } -// // clang-format on + // clang-format off + asm { + psq_st arg, 0(ptr), 1, 5 + } + // clang-format on -// r = *(s16*)ptr; -// return r; -// } + r = *(s16 *)ptr; + return r; +} -// static void OSf32tos16(const f32* in, s16* out) { *out = __OSf32tos16(*in); } +static inline void OSf32tos16(const f32 *in, s16 *out) { + *out = __OSf32tos16(*in); +} -// #ifdef __cplusplus -// } -// #endif -// #endif +#ifdef __cplusplus +} +#endif +#endif diff --git a/include/rvl/OS/OSFatal.h b/include/rvl/OS/OSFatal.h index 7ed7ebf8..2c145072 100644 --- a/include/rvl/OS/OSFatal.h +++ b/include/rvl/OS/OSFatal.h @@ -1,12 +1,12 @@ #ifndef RVL_SDK_OS_FATAL_H #define RVL_SDK_OS_FATAL_H #include "rvl/GX/GXTypes.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif -void OSFatal(GXColor textColor, GXColor bgColor, const char* msg); +void OSFatal(GXColor textColor, GXColor bgColor, const char *msg); #ifdef __cplusplus } diff --git a/include/rvl/OS/OSFont.h b/include/rvl/OS/OSFont.h index 4b791d79..73ca9a03 100644 --- a/include/rvl/OS/OSFont.h +++ b/include/rvl/OS/OSFont.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_OS_FONT_H #define RVL_SDK_OS_FONT_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -48,13 +48,11 @@ typedef struct OSFontHeader { u16 OSGetFontEncode(void); u16 OSSetFontEncode(u16 encode); -u32 OSLoadFont(OSFontHeader* font, void* dst); -const char* OSGetFontTexel(const char* str, void* dst, s32 xOfs, s32 arg3, - u32* widthOut); -BOOL OSInitFont(OSFontHeader* font); -const char* OSGetFontTexture(const char* str, void** texOut, u32* xOut, - u32* yOut, u32* widthOut); -const char* OSGetFontWidth(const char* str, u32* widthOut); +u32 OSLoadFont(OSFontHeader *font, void *dst); +const char *OSGetFontTexel(const char *str, void *dst, s32 xOfs, s32 arg3, u32 *widthOut); +BOOL OSInitFont(OSFontHeader *font); +const char *OSGetFontTexture(const char *str, void **texOut, u32 *xOut, u32 *yOut, u32 *widthOut); +const char *OSGetFontWidth(const char *str, u32 *widthOut); #ifdef __cplusplus } diff --git a/include/rvl/OS/OSHardware.h b/include/rvl/OS/OSHardware.h index 119a7190..9db8881e 100644 --- a/include/rvl/OS/OSHardware.h +++ b/include/rvl/OS/OSHardware.h @@ -2,7 +2,7 @@ #define RVL_SDK_OS_HARDWARE_H #include "rvl/OS/OSAddress.h" #include "rvl/OS/OSThread.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -18,28 +18,28 @@ typedef struct OSExecParams; */ // Derive offsets for use with OSAddress functions -#define __DEF_ADDR_OFFSETS(name, addr) \ - static const u32 OS_PHYS_##name = (addr)-0x80000000; \ - static const u32 OS_CACHED_##name = (addr); \ +#define __DEF_ADDR_OFFSETS(name, addr) \ + static const u32 OS_PHYS_##name = (addr)-0x80000000; \ + static const u32 OS_CACHED_##name = (addr); \ static const u32 OS_UNCACHED_##name = (addr) + (0xC0000000 - 0x80000000); // Define a global variable in *CACHED* MEM1. // Can be accessed directly or with OSAddress functions. -#define OS_DEF_GLOBAL_VAR(type, name, addr) \ - /* Memory-mapped value for direct access */ \ - type OS_##name : (addr); \ +#define OS_DEF_GLOBAL_VAR(type, name, addr) \ + /* Memory-mapped value for direct access */ \ + type OS_##name : (addr); \ __DEF_ADDR_OFFSETS(name, addr) // Define a global array in *CACHED* MEM1. // Can be accessed directly or with OSAddress functions. -#define OS_DEF_GLOBAL_ARR(type, name, arr, addr) \ - /* Memory-mapped value for direct access */ \ - type OS_##name arr : (addr); \ +#define OS_DEF_GLOBAL_ARR(type, name, arr, addr) \ + /* Memory-mapped value for direct access */ \ + type OS_##name arr : (addr); \ __DEF_ADDR_OFFSETS(name, addr) // Define an global variable in the hardware-register range. -#define OS_DEF_HW_REG(type, name, addr) \ - /* Memory-mapped value for direct access */ \ +#define OS_DEF_HW_REG(type, name, addr) \ + /* Memory-mapped value for direct access */ \ type OS_##name : (addr); typedef struct OSBootInfo { @@ -56,17 +56,17 @@ typedef struct OSBootInfo { u32 aplVersion; // at 0x24 u32 physMemSize; // at 0x28 u32 consoleType; // at 0x2C - void* arenaLo; // at 0x30 - void* arenaHi; // at 0x34 - void* fstStart; // at 0x38 + void *arenaLo; // at 0x30 + void *arenaHi; // at 0x34 + void *fstStart; // at 0x38 u32 fstSize; // at 0x3C } OSBootInfo; typedef struct OSDebugInterface { BOOL usingDebugger; // at 0x0 u32 exceptionMask; // at 0x4 - void* exceptionHook; // at 0x8 - void* exceptionHookLR; // at 0xC + void *exceptionHook; // at 0x8 + void *exceptionHookLR; // at 0xC } OSDebugInterface; typedef struct OSBI2 { diff --git a/include/rvl/OS/OSInterrupt.h b/include/rvl/OS/OSInterrupt.h index dcd852f2..875200d6 100644 --- a/include/rvl/OS/OSInterrupt.h +++ b/include/rvl/OS/OSInterrupt.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_OS_INTERRUPT_H #define RVL_SDK_OS_INTERRUPT_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -48,7 +48,7 @@ typedef enum { OS_INTR_MAX } OSInterruptType; -typedef void (*OSInterruptHandler)(s16 intr, struct OSContext* ctx); +typedef void (*OSInterruptHandler)(s16 intr, struct OSContext *ctx); extern u32 __OSLastInterruptSrr0; extern s16 __OSLastInterrupt; @@ -58,15 +58,14 @@ BOOL OSDisableInterrupts(void); BOOL OSEnableInterrupts(void); BOOL OSRestoreInterrupts(BOOL status); -OSInterruptHandler __OSSetInterruptHandler(OSInterruptType type, - OSInterruptHandler handler); +OSInterruptHandler __OSSetInterruptHandler(OSInterruptType type, OSInterruptHandler handler); OSInterruptHandler __OSGetInterruptHandler(OSInterruptType type); void __OSInterruptInit(void); u32 __OSMaskInterrupts(u32 userMask); u32 __OSUnmaskInterrupts(u32 userMask); -void __OSDispatchInterrupt(u8 intr, struct OSContext* ctx); +void __OSDispatchInterrupt(u8 intr, struct OSContext *ctx); void __RAS_OSDisableInterrupts_begin(void); void __RAS_OSDisableInterrupts_end(void); diff --git a/include/rvl/OS/OSIpc.h b/include/rvl/OS/OSIpc.h index 24c03871..f681ac39 100644 --- a/include/rvl/OS/OSIpc.h +++ b/include/rvl/OS/OSIpc.h @@ -1,12 +1,12 @@ #ifndef RVL_SDK_OS_IPC_H #define RVL_SDK_OS_IPC_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif -void* __OSGetIPCBufferHi(void); -void* __OSGetIPCBufferLo(void); +void *__OSGetIPCBufferHi(void); +void *__OSGetIPCBufferLo(void); void __OSInitIPCBuffer(void); #ifdef __cplusplus diff --git a/include/rvl/OS/OSLink.h b/include/rvl/OS/OSLink.h index 749574d2..0736a590 100644 --- a/include/rvl/OS/OSLink.h +++ b/include/rvl/OS/OSLink.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_OS_LINK_H #define RVL_SDK_OS_LINK_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif diff --git a/include/rvl/OS/OSMemory.h b/include/rvl/OS/OSMemory.h index 5f8de442..ae25cae4 100644 --- a/include/rvl/OS/OSMemory.h +++ b/include/rvl/OS/OSMemory.h @@ -1,15 +1,15 @@ #ifndef RVL_SDK_OS_MEMORY_H #define RVL_SDK_OS_MEMORY_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif -#define OS_MEM_MB_TO_B(mb) ((mb)*1024 * 1024) +#define OS_MEM_MB_TO_B(mb) ((mb) * 1024 * 1024) #define OS_MEM_B_TO_MB(mb) ((mb) / 1024 / 1024) -#define OS_MEM_IS_MEM1(addr) (((u32)(addr)&0x30000000) == 0) -#define OS_MEM_IS_MEM2(addr) (((u32)(addr)&0x30000000) == 0x10000000) +#define OS_MEM_IS_MEM1(addr) (((u32)(addr) & 0x30000000) == 0) +#define OS_MEM_IS_MEM2(addr) (((u32)(addr) & 0x30000000) == 0x10000000) u32 OSGetPhysicalMem1Size(void); u32 OSGetPhysicalMem2Size(void); diff --git a/include/rvl/OS/OSMessage.h b/include/rvl/OS/OSMessage.h index ab1e9352..38f7358b 100644 --- a/include/rvl/OS/OSMessage.h +++ b/include/rvl/OS/OSMessage.h @@ -1,29 +1,29 @@ #ifndef RVL_SDK_OS_MESSAGE_H #define RVL_SDK_OS_MESSAGE_H #include "rvl/OS/OSThread.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif // General-purpose typedef -typedef void* OSMessage; +typedef void *OSMessage; typedef enum { OS_MSG_PERSISTENT = (1 << 0) } OSMessageFlags; typedef struct OSMessageQueue { OSThreadQueue sendQueue; // at 0x0 OSThreadQueue recvQueue; // at 0x8 - OSMessage* buffer; // at 0x10 + OSMessage *buffer; // at 0x10 s32 capacity; // at 0x14 s32 front; // at 0x18 s32 size; // at 0x1C } OSMessageQueue; -void OSInitMessageQueue(OSMessageQueue* queue, OSMessage* buffer, s32 capacity); -BOOL OSSendMessage(OSMessageQueue* queue, OSMessage mesg, u32 flags); -BOOL OSReceiveMessage(OSMessageQueue* queue, OSMessage* mesg, u32 flags); -BOOL OSJamMessage(OSMessageQueue* queue, OSMessage mesg, u32 flags); +void OSInitMessageQueue(OSMessageQueue *queue, OSMessage *buffer, s32 capacity); +BOOL OSSendMessage(OSMessageQueue *queue, OSMessage mesg, u32 flags); +BOOL OSReceiveMessage(OSMessageQueue *queue, OSMessage *mesg, u32 flags); +BOOL OSJamMessage(OSMessageQueue *queue, OSMessage mesg, u32 flags); #ifdef __cplusplus } diff --git a/include/rvl/OS/OSMutex.h b/include/rvl/OS/OSMutex.h index 7dde7c49..f83dee73 100644 --- a/include/rvl/OS/OSMutex.h +++ b/include/rvl/OS/OSMutex.h @@ -1,24 +1,24 @@ #ifndef RVL_SDK_OS_MUTEX_H #define RVL_SDK_OS_MUTEX_H #include "rvl/OS/OSThread.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif typedef struct OSMutex { OSThreadQueue queue; // at 0x0 - OSThread* thread; // at 0x8 + OSThread *thread; // at 0x8 s32 lock; // at 0xC - struct OSMutex* next; // at 0x10 - struct OSMutex* prev; // at 0x14 + struct OSMutex *next; // at 0x10 + struct OSMutex *prev; // at 0x14 } OSMutex; -void OSInitMutex(OSMutex* mutex); -void OSLockMutex(OSMutex* mutex); -void OSUnlockMutex(OSMutex* mutex); -void __OSUnlockAllMutex(OSThread* thread); -BOOL OSTryLockMutex(OSMutex* mutex); +void OSInitMutex(OSMutex *mutex); +void OSLockMutex(OSMutex *mutex); +void OSUnlockMutex(OSMutex *mutex); +void __OSUnlockAllMutex(OSThread *thread); +BOOL OSTryLockMutex(OSMutex *mutex); #ifdef __cplusplus } diff --git a/include/rvl/OS/OSNet.h b/include/rvl/OS/OSNet.h index 0f248549..2025165f 100644 --- a/include/rvl/OS/OSNet.h +++ b/include/rvl/OS/OSNet.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_OS_NET_H #define RVL_SDK_OS_NET_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif diff --git a/include/rvl/OS/OSPlayRecord.h b/include/rvl/OS/OSPlayRecord.h index c1a26623..d5a65e07 100644 --- a/include/rvl/OS/OSPlayRecord.h +++ b/include/rvl/OS/OSPlayRecord.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_OS_PLAY_RECORD_H #define RVL_SDK_OS_PLAY_RECORD_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif diff --git a/include/rvl/OS/OSReset.h b/include/rvl/OS/OSReset.h index 32c9da4b..d6e065c1 100644 --- a/include/rvl/OS/OSReset.h +++ b/include/rvl/OS/OSReset.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_OS_RESET_H #define RVL_SDK_OS_RESET_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -19,19 +19,19 @@ typedef enum { typedef struct OSShutdownFunctionInfo { OSShutdownFunction func; // at 0x0 u32 prio; // at 0x4 - struct OSShutdownFunctionInfo* next; // at 0x8 - struct OSShutdownFunctionInfo* prev; // at 0xC + struct OSShutdownFunctionInfo *next; // at 0x8 + struct OSShutdownFunctionInfo *prev; // at 0xC } OSShutdownFunctionInfo; typedef struct OSShutdownFunctionQueue { - OSShutdownFunctionInfo* head; // at 0x0 - OSShutdownFunctionInfo* tail; // at 0x4 + OSShutdownFunctionInfo *head; // at 0x0 + OSShutdownFunctionInfo *tail; // at 0x4 } OSShutdownFunctionQueue; -void OSRegisterShutdownFunction(OSShutdownFunctionInfo* info); +void OSRegisterShutdownFunction(OSShutdownFunctionInfo *info); BOOL __OSCallShutdownFunctions(u32 pass, u32 event); void __OSShutdownDevices(u32 event); -void __OSGetDiscState(u8* out); +void __OSGetDiscState(u8 *out); void OSShutdownSystem(void); void OSReturnToMenu(void); u32 OSGetResetCode(void); diff --git a/include/rvl/OS/OSRtc.h b/include/rvl/OS/OSRtc.h index 57b3678b..0d345ca3 100644 --- a/include/rvl/OS/OSRtc.h +++ b/include/rvl/OS/OSRtc.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_OS_RTC_H #define RVL_SDK_OS_RTC_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -31,15 +31,15 @@ typedef struct OSSramEx { } OSSramEx; void __OSInitSram(void); -OSSramEx* __OSLockSramEx(void); +OSSramEx *__OSLockSramEx(void); BOOL __OSUnlockSramEx(BOOL save); BOOL __OSSyncSram(void); -BOOL __OSReadROM(void* dst, s32 size, const void* src); +BOOL __OSReadROM(void *dst, s32 size, const void *src); u16 OSGetWirelessID(s32 pad); void OSSetWirelessID(s32 pad, u16 id); u16 OSGetGbsMode(void); void OSSetGbsMode(u16 gbs); -BOOL __OSGetRTCFlags(u32* out); +BOOL __OSGetRTCFlags(u32 *out); BOOL __OSClearRTCFlags(void); #ifdef __cplusplus diff --git a/include/rvl/OS/OSStateFlags.h b/include/rvl/OS/OSStateFlags.h index 5d1b28fc..c6a457ce 100644 --- a/include/rvl/OS/OSStateFlags.h +++ b/include/rvl/OS/OSStateFlags.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_OS_STATE_FLAGS_H #define RVL_SDK_OS_STATE_FLAGS_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -19,8 +19,8 @@ typedef struct OSStateFlags { u32 WORD_0x1C; } OSStateFlags; -BOOL __OSWriteStateFlags(const OSStateFlags* state); -BOOL __OSReadStateFlags(OSStateFlags* state); +BOOL __OSWriteStateFlags(const OSStateFlags *state); +BOOL __OSReadStateFlags(OSStateFlags *state); #ifdef __cplusplus } diff --git a/include/rvl/OS/OSStateTM.h b/include/rvl/OS/OSStateTM.h index 4f6255b2..c22aec74 100644 --- a/include/rvl/OS/OSStateTM.h +++ b/include/rvl/OS/OSStateTM.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_OS_STATETM_H #define RVL_SDK_OS_STATETM_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif diff --git a/include/rvl/OS/OSSync.h b/include/rvl/OS/OSSync.h index 457ceaca..5edc5746 100644 --- a/include/rvl/OS/OSSync.h +++ b/include/rvl/OS/OSSync.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_OS_SYNC_H #define RVL_SDK_OS_SYNC_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif diff --git a/include/rvl/OS/OSThread.h b/include/rvl/OS/OSThread.h index ceeb941b..b81078b3 100644 --- a/include/rvl/OS/OSThread.h +++ b/include/rvl/OS/OSThread.h @@ -1,7 +1,7 @@ #ifndef RVL_SDK_OS_THREAD_H #define RVL_SDK_OS_THREAD_H #include "rvl/OS/OSContext.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -22,13 +22,13 @@ typedef enum { typedef enum { OS_THREAD_DETACHED = (1 << 0) } OSThreadFlag; typedef struct OSThreadQueue { - struct OSThread* head; // at 0x0 - struct OSThread* tail; // at 0x4 + struct OSThread *head; // at 0x0 + struct OSThread *tail; // at 0x4 } OSThreadQueue; typedef struct OSMutexQueue { - struct OSMutex* head; // at 0x0 - struct OSMutex* tail; // at 0x4 + struct OSMutex *head; // at 0x0 + struct OSMutex *tail; // at 0x4 } OSMutexQueue; typedef struct OSThread { @@ -39,49 +39,47 @@ typedef struct OSThread { s32 priority; // at 0x2D0 s32 base; // at 0x2D4 u32 val; // at 0x2D8 - OSThreadQueue* queue; // at 0x2DC - struct OSThread* next; // at 0x2E0 - struct OSThread* prev; // at 0x2E4 + OSThreadQueue *queue; // at 0x2DC + struct OSThread *next; // at 0x2E0 + struct OSThread *prev; // at 0x2E4 OSThreadQueue joinQueue; // at 0x2E8 - struct OSMutex* mutex; // at 0x2F0 + struct OSMutex *mutex; // at 0x2F0 OSMutexQueue mutexQueue; // at 0x2F4 - struct OSThread* nextActive; // at 0x2FC - struct OSThread* prevActive; // at 0x300 - u32* stackBegin; // at 0x304 - u32* stackEnd; // at 0x308 + struct OSThread *nextActive; // at 0x2FC + struct OSThread *prevActive; // at 0x300 + u32 *stackBegin; // at 0x304 + u32 *stackEnd; // at 0x308 s32 error; // at 0x30C - void* specific[2]; // at 0x310 + void *specific[2]; // at 0x310 } OSThread; -typedef void (*OSSwitchThreadCallback)(OSThread* currThread, - OSThread* newThread); -typedef void* (*OSThreadFunc)(void* arg); +typedef void (*OSSwitchThreadCallback)(OSThread *currThread, OSThread *newThread); +typedef void *(*OSThreadFunc)(void *arg); -OSSwitchThreadCallback -OSSetSwitchThreadCallback(OSSwitchThreadCallback callback); +OSSwitchThreadCallback OSSetSwitchThreadCallback(OSSwitchThreadCallback callback); void __OSThreadInit(void); -void OSSetCurrentThread(OSThread* thread); -void OSInitMutexQueue(OSMutexQueue* queue); -void OSInitThreadQueue(OSThreadQueue* queue); -OSThread* OSGetCurrentThread(void); -BOOL OSIsThreadTerminated(OSThread* thread); +void OSSetCurrentThread(OSThread *thread); +void OSInitMutexQueue(OSMutexQueue *queue); +void OSInitThreadQueue(OSThreadQueue *queue); +OSThread *OSGetCurrentThread(void); +BOOL OSIsThreadTerminated(OSThread *thread); s32 OSDisableScheduler(void); s32 OSEnableScheduler(void); -s32 __OSGetEffectivePriority(OSThread* thread); -void __OSPromoteThread(OSThread* thread, s32 prio); +s32 __OSGetEffectivePriority(OSThread *thread); +void __OSPromoteThread(OSThread *thread, s32 prio); void __OSReschedule(void); void OSYieldThread(void); -BOOL OSCreateThread(OSThread* thread, OSThreadFunc func, void* funcArg, - void* stackBegin, u32 stackSize, s32 prio, u16 flags); -void OSExitThread(OSThread* thread); -void OSCancelThread(OSThread* thread); -BOOL OSJoinThread(OSThread* thread, void* val); -void OSDetachThread(OSThread* thread); -s32 OSResumeThread(OSThread* thread); -s32 OSSuspendThread(OSThread* thread); -void OSSleepThread(OSThreadQueue* queue); -void OSWakeupThread(OSThreadQueue* queue); -BOOL OSSetThreadPriority(OSThread* thread, s32 prio); +BOOL OSCreateThread(OSThread *thread, OSThreadFunc func, void *funcArg, void *stackBegin, u32 stackSize, s32 prio, + u16 flags); +void OSExitThread(OSThread *thread); +void OSCancelThread(OSThread *thread); +BOOL OSJoinThread(OSThread *thread, void *val); +void OSDetachThread(OSThread *thread); +s32 OSResumeThread(OSThread *thread); +s32 OSSuspendThread(OSThread *thread); +void OSSleepThread(OSThreadQueue *queue); +void OSWakeupThread(OSThreadQueue *queue); +BOOL OSSetThreadPriority(OSThread *thread, s32 prio); void OSClearStack(u8 val); void OSSleepTicks(s64 ticks); diff --git a/include/rvl/OS/OSTime.h b/include/rvl/OS/OSTime.h index 3bd44f85..9628edc4 100644 --- a/include/rvl/OS/OSTime.h +++ b/include/rvl/OS/OSTime.h @@ -1,7 +1,7 @@ #ifndef RVL_SDK_OS_TIME_H #define RVL_SDK_OS_TIME_H #include "rvl/OS/OSHardware.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -12,8 +12,8 @@ extern "C" { // OS time -> Real time #define OS_TICKS_TO_SEC(x) ((x) / (OS_TIME_SPEED)) #define OS_TICKS_TO_MSEC(x) ((x) / (OS_TIME_SPEED / 1000)) -#define OS_TICKS_TO_USEC(x) (((x)*8) / (OS_TIME_SPEED / 125000)) -#define OS_TICKS_TO_NSEC(x) (((x)*8000) / (OS_TIME_SPEED / 125000)) +#define OS_TICKS_TO_USEC(x) (((x) * 8) / (OS_TIME_SPEED / 125000)) +#define OS_TICKS_TO_NSEC(x) (((x) * 8000) / (OS_TIME_SPEED / 125000)) // Real time -> OS time #define OS_SEC_TO_TICKS(x) ((x) * (OS_TIME_SPEED)) @@ -40,8 +40,8 @@ s32 OSGetTick(void); s64 __OSGetSystemTime(void); s64 __OSTimeToSystemTime(s64 time); -void OSTicksToCalendarTime(s64 time, OSCalendarTime* cal); -s64 OSCalendarTimeToTicks(const OSCalendarTime* cal); +void OSTicksToCalendarTime(s64 time, OSCalendarTime *cal); +s64 OSCalendarTimeToTicks(const OSCalendarTime *cal); #ifdef __cplusplus } diff --git a/include/rvl/OS/OSUtf.h b/include/rvl/OS/OSUtf.h index 670e56ec..5e52925e 100644 --- a/include/rvl/OS/OSUtf.h +++ b/include/rvl/OS/OSUtf.h @@ -1,12 +1,12 @@ #ifndef RVL_SDK_OS_UTF_H #define RVL_SDK_OS_UTF_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif -const u8* OSUTF8to32(const u8* utf8, u32* utf32); -const wchar_t* OSUTF16to32(const wchar_t* utf16, u32* utf32); +const u8 *OSUTF8to32(const u8 *utf8, u32 *utf32); +const wchar_t *OSUTF16to32(const wchar_t *utf16, u32 *utf32); u8 OSUTF32toANSI(u32 utf32); wchar_t OSUTF32toSJIS(u32 utf32); diff --git a/include/rvl/OS/__ppc_eabi_init.h b/include/rvl/OS/__ppc_eabi_init.h index b09255e8..b0a40e72 100644 --- a/include/rvl/OS/__ppc_eabi_init.h +++ b/include/rvl/OS/__ppc_eabi_init.h @@ -1,13 +1,13 @@ #ifndef RVL_SDK_OS_PPC_EABI_INIT_H #define RVL_SDK_OS_PPC_EABI_INIT_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif #pragma section ".init" DECL_SECTION(".init") void __init_hardware(void); -DECL_SECTION(".init") void __flush_cache(void*, size_t); +DECL_SECTION(".init") void __flush_cache(void *, size_t); void __init_user(void); void __init_cpp(void); @@ -20,14 +20,14 @@ void _ExitProcess(void); */ // Declare linker symbols for a section in the ROM -#define DECL_ROM_SECTION(x) \ - extern u8 _f##x[]; \ - extern u8 _f##x##_rom[]; \ +#define DECL_ROM_SECTION(x) \ + extern u8 _f##x[]; \ + extern u8 _f##x##_rom[]; \ extern u8 _e##x[]; // Declare linker symbols for a BSS section -#define DECL_BSS_SECTION(x) \ - extern u8 _f##x[]; \ +#define DECL_BSS_SECTION(x) \ + extern u8 _f##x[]; \ extern u8 _e##x[]; // Debugger stack @@ -65,20 +65,20 @@ DECL_BSS_SECTION(_sbss); DECL_BSS_SECTION(_sbss2); typedef struct RomSection { - void* romOfs; // at 0x4 - void* virtualOfs; // at 0x0 + void *romOfs; // at 0x4 + void *virtualOfs; // at 0x0 size_t size; // at 0x8 } RomSection; typedef struct BssSection { - void* virtualOfs; // at 0x0 + void *virtualOfs; // at 0x0 size_t size; // at 0x8 } BssSection; typedef struct ExtabIndexInfo { - void* etiStart; // at 0x0 - void* etiEnd; // at 0x4 - void* codeStart; // at 0x8 + void *etiStart; // at 0x0 + void *etiEnd; // at 0x4 + void *codeStart; // at 0x8 u32 codeSize; // at 0x10 } ExtabIndexInfo; diff --git a/include/rvl/PAD/Pad.h b/include/rvl/PAD/Pad.h index 6811a931..d2f90312 100644 --- a/include/rvl/PAD/Pad.h +++ b/include/rvl/PAD/Pad.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_PAD_H #define RVL_SDK_PAD_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif diff --git a/include/rvl/SC/scapi.h b/include/rvl/SC/scapi.h index 3f60136c..52708b4c 100644 --- a/include/rvl/SC/scapi.h +++ b/include/rvl/SC/scapi.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_SC_SCAPI_H #define RVL_SDK_SC_SCAPI_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -50,14 +50,14 @@ typedef struct SCBtDeviceInfoArray { u8 SCGetAspectRatio(void); s8 SCGetDisplayOffsetH(void); u8 SCGetEuRgb60Mode(void); -void SCGetIdleMode(SCIdleMode* mode); +void SCGetIdleMode(SCIdleMode *mode); u8 SCGetLanguage(void); u8 SCGetProgressiveMode(void); u8 SCGetScreenSaverMode(void); u8 SCGetSoundMode(void); u32 SCGetCounterBias(void); -void SCGetBtDeviceInfoArray(SCBtDeviceInfoArray* info); -void SCSetBtDeviceInfoArray(const SCBtDeviceInfoArray* info); +void SCGetBtDeviceInfoArray(SCBtDeviceInfoArray *info); +void SCSetBtDeviceInfoArray(const SCBtDeviceInfoArray *info); u32 SCGetBtDpdSensibility(void); u8 SCGetWpadMotorMode(void); void SCSetWpadMotorMode(u8 mode); diff --git a/include/rvl/SC/scapi_prdinfo.h b/include/rvl/SC/scapi_prdinfo.h index f193da71..21f66aaf 100644 --- a/include/rvl/SC/scapi_prdinfo.h +++ b/include/rvl/SC/scapi_prdinfo.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_SC_SCAPI_PRDINFO_H #define RVL_SDK_SC_SCAPI_PRDINFO_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -26,8 +26,8 @@ typedef struct SCRegion { char name[4]; // at 0x1 } SCRegion; -BOOL __SCF1(const char* type, char* buf, u32 sz); -BOOL SCGetProductAreaString(char* buf, u32 sz); +BOOL __SCF1(const char *type, char *buf, u32 sz); +BOOL SCGetProductAreaString(char *buf, u32 sz); s8 SCGetProductArea(void); #ifdef __cplusplus diff --git a/include/rvl/SC/scsystem.h b/include/rvl/SC/scsystem.h index 13c95dde..d01ace55 100644 --- a/include/rvl/SC/scsystem.h +++ b/include/rvl/SC/scsystem.h @@ -3,7 +3,7 @@ #include "rvl/FS.h" #include "rvl/NAND.h" #include "rvl/OS.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -84,8 +84,8 @@ typedef struct SCItem { u8 arrayType; // at 0x9 u32 nameLen; // at 0xC u32 dataLen; // at 0x10 - const char* name; // at 0x14 - u8* data; // at 0x18 + const char *name; // at 0x14 + u8 *data; // at 0x18 u32 itemLen; // at 0x1C } SCItem; @@ -100,8 +100,8 @@ typedef struct SCControl { u8 BYTE_0x157; SCAsyncCallback asyncCallback; // at 0x158 NANDResult asyncResult; // at 0x15C - const char* filePaths[SC_CONF_FILE_MAX]; // at 0x160 - u8* fileBuffers[SC_CONF_FILE_MAX]; // at 0x168 + const char *filePaths[SC_CONF_FILE_MAX]; // at 0x160 + u8 *fileBuffers[SC_CONF_FILE_MAX]; // at 0x168 u32 bufferSizes[SC_CONF_FILE_MAX]; // at 0x170 u32 fileSizes[SC_CONF_FILE_MAX]; // at 0x178 SCFlushCallback flushCallback; // at 0x180 @@ -112,12 +112,12 @@ typedef struct SCControl { void SCInit(void); u32 SCCheckStatus(void); -BOOL SCFindByteArrayItem(void* dst, u32 len, SCItemID id); -BOOL SCReplaceByteArrayItem(const void* src, u32 len, SCItemID id); +BOOL SCFindByteArrayItem(void *dst, u32 len, SCItemID id); +BOOL SCReplaceByteArrayItem(const void *src, u32 len, SCItemID id); -BOOL SCFindU8Item(u8* dst, SCItemID id); -BOOL SCFindS8Item(s8* dst, SCItemID id); -BOOL SCFindU32Item(u32* dst, SCItemID id); +BOOL SCFindU8Item(u8 *dst, SCItemID id); +BOOL SCFindS8Item(s8 *dst, SCItemID id); +BOOL SCFindU32Item(u32 *dst, SCItemID id); BOOL SCReplaceU8Item(u8 data, SCItemID id); @@ -127,7 +127,7 @@ BOOL __SCIsDirty(void); void __SCSetDirtyFlag(void); void __SCClearDirtyFlag(void); -u8* __SCGetConfBuf(void); +u8 *__SCGetConfBuf(void); u32 __SCGetConfBufSize(void); #ifdef __cplusplus diff --git a/include/rvl/SI/SIBios.h b/include/rvl/SI/SIBios.h index 863994bc..eae3e606 100644 --- a/include/rvl/SI/SIBios.h +++ b/include/rvl/SI/SIBios.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_SI_SIBIOS_H #define RVL_SDK_SI_SIBIOS_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif diff --git a/include/rvl/TPL/TPL.h b/include/rvl/TPL/TPL.h index 9615a3d0..acf56ab1 100644 --- a/include/rvl/TPL/TPL.h +++ b/include/rvl/TPL/TPL.h @@ -1,7 +1,7 @@ #ifndef RVL_SDK_TPL_H #define RVL_SDK_TPL_H #include "rvl/GX.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -17,7 +17,7 @@ typedef struct TPLHeader { u16 height; // at 0x0 u16 width; // at 0x2 u32 format; // at 0x4 - char* data; // at 0x8 + char *data; // at 0x8 GXTexWrapMode wrapS; // at 0xC GXTexWrapMode wrapT; // at 0x10 GXTexFilter minFilt; // at 0x14 @@ -34,22 +34,22 @@ typedef struct TPLClutHeader { u8 unpacked; // at 0x1 u8 padding; // at 0x2 GXTlutFmt format; // at 0x4 - char* data; // at 0x8 + char *data; // at 0x8 } TPLClutHeader; typedef struct TPLDescriptor { - TPLHeader* texHeader; // at 0x0 - TPLClutHeader* clutHeader; // at 0x4 + TPLHeader *texHeader; // at 0x0 + TPLClutHeader *clutHeader; // at 0x4 } TPLDescriptor; typedef struct TPLPalette { u32 version; // at 0x0 u32 numImages; // at 0x4 - TPLDescriptor* descriptors; // at 0x8 + TPLDescriptor *descriptors; // at 0x8 } TPLPalette; -void TPLBind(TPLPalette* pal); -TPLDescriptor* TPLGet(TPLPalette* pal, u32 id); +void TPLBind(TPLPalette *pal); +TPLDescriptor *TPLGet(TPLPalette *pal, u32 id); #ifdef __cplusplus } diff --git a/include/rvl/USB/usb.h b/include/rvl/USB/usb.h index 7292aef5..018dfaff 100644 --- a/include/rvl/USB/usb.h +++ b/include/rvl/USB/usb.h @@ -1,29 +1,24 @@ #ifndef RVL_SDK_USB_H #define RVL_SDK_USB_H #include "rvl/IPC.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif -typedef void (*USBCallback)(IPCResult result, void* arg); +typedef void (*USBCallback)(IPCResult result, void *arg); IPCResult IUSB_OpenLib(void); IPCResult IUSB_CloseLib(void); -IPCResult IUSB_OpenDeviceIds(const char* interface, u16 vid, u16 pid, - IPCResult* resultOut); -IPCResult IUSB_CloseDeviceAsync(s32 fd, USBCallback callback, - void* callbackArg); -IPCResult IUSB_ReadIntrMsgAsync(s32 fd, u32 endpoint, u32 length, void* buffer, - USBCallback callback, void* callbackArg); -IPCResult IUSB_ReadBlkMsgAsync(s32 fd, u32 endpoint, u32 length, void* buffer, - USBCallback callback, void* callbackArg); -IPCResult IUSB_WriteBlkMsgAsync(s32 fd, u32 endpoint, u32 length, - const void* buffer, USBCallback callback, - void* callbackArg); -IPCResult IUSB_WriteCtrlMsgAsync(s32 fd, u8 requestType, u8 request, u16 value, - u16 index, u16 length, void* buffer, - USBCallback callback, void* callbackArg); +IPCResult IUSB_OpenDeviceIds(const char *interface, u16 vid, u16 pid, IPCResult *resultOut); +IPCResult IUSB_CloseDeviceAsync(s32 fd, USBCallback callback, void *callbackArg); +IPCResult IUSB_ReadIntrMsgAsync(s32 fd, u32 endpoint, u32 length, void *buffer, USBCallback callback, + void *callbackArg); +IPCResult IUSB_ReadBlkMsgAsync(s32 fd, u32 endpoint, u32 length, void *buffer, USBCallback callback, void *callbackArg); +IPCResult IUSB_WriteBlkMsgAsync(s32 fd, u32 endpoint, u32 length, const void *buffer, USBCallback callback, + void *callbackArg); +IPCResult IUSB_WriteCtrlMsgAsync(s32 fd, u8 requestType, u8 request, u16 value, u16 index, u16 length, void *buffer, + USBCallback callback, void *callbackArg); #ifdef __cplusplus } diff --git a/include/rvl/VF/pf.h b/include/rvl/VF/pf.h index fefee35d..8041c2e2 100644 --- a/include/rvl/VF/pf.h +++ b/include/rvl/VF/pf.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_VF_PF_H #define RVL_SDK_VF_PF_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif diff --git a/include/rvl/VF/pf_clib.h b/include/rvl/VF/pf_clib.h index bd49c29a..d6c6bd5b 100644 --- a/include/rvl/VF/pf_clib.h +++ b/include/rvl/VF/pf_clib.h @@ -1,17 +1,17 @@ #ifndef RVL_SDK_VF_PF_CLIB_H #define RVL_SDK_VF_PF_CLIB_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif int VFipf_toupper(int c); -void* VFipf_memcpy(void* dst, const void* src, size_t n); -void* VFipf_memset(void* dst, int ch, size_t n); -size_t VFipf_strlen(const char* str); -char* VFipf_strcpy(char* dst, const char* src); -int VFipf_strcmp(const char* s1, const char* s2); -int VFipf_strncmp(const char* s1, const char* s2, size_t n); +void *VFipf_memcpy(void *dst, const void *src, size_t n); +void *VFipf_memset(void *dst, int ch, size_t n); +size_t VFipf_strlen(const char *str); +char *VFipf_strcpy(char *dst, const char *src); +int VFipf_strcmp(const char *s1, const char *s2); +int VFipf_strncmp(const char *s1, const char *s2, size_t n); #ifdef __cplusplus } diff --git a/include/rvl/VF/pf_code.h b/include/rvl/VF/pf_code.h index f11606e6..4e6720ce 100644 --- a/include/rvl/VF/pf_code.h +++ b/include/rvl/VF/pf_code.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_VF_PF_CODE_H #define RVL_SDK_VF_PF_CODE_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -14,10 +14,10 @@ typedef enum { PFCODE_FN_VALID_SHORT = (1 << 1), } PFCODE_FnValidity; -typedef s32 (*PF_OEM_2_UNICODE)(char* src, u16* dst); -typedef s32 (*PF_UNICODE_2_OEM)(u16* src, char* dst); -typedef s32 (*PF_OEM_CHAR_WIDTH)(char* ch); -typedef s32 (*PF_UNICODE_CHAR_WIDH)(wchar_t* ch); +typedef s32 (*PF_OEM_2_UNICODE)(char *src, u16 *dst); +typedef s32 (*PF_UNICODE_2_OEM)(u16 *src, char *dst); +typedef s32 (*PF_OEM_CHAR_WIDTH)(char *ch); +typedef s32 (*PF_UNICODE_CHAR_WIDH)(wchar_t *ch); typedef u32 (*PF_IS_OEM_MB_CHAR)(char ch, u32 target); typedef u32 (*PF_IS_UNICODE_MB_CHAR)(wchar_t ch, u32 target); @@ -33,7 +33,7 @@ typedef struct { extern const u8 VFipf_valid_fn_char[VF_FN_MAX_CHAR - VF_FN_MIN_CHAR]; int VFiPFCODE_Combine_Width(s16 oem_width, s16 uni_width); -void VFiPFCODE_Divide_Width(u32 width, s16* oem_width, s16* uni_width); +void VFiPFCODE_Divide_Width(u32 width, s16 *oem_width, s16 *uni_width); #ifdef __cplusplus } diff --git a/include/rvl/VF/pf_service.h b/include/rvl/VF/pf_service.h index 6dcd6ac9..f158f391 100644 --- a/include/rvl/VF/pf_service.h +++ b/include/rvl/VF/pf_service.h @@ -1,12 +1,12 @@ #ifndef RVL_SDK_VF_PF_SERVICE_H #define RVL_SDK_VF_PF_SERVICE_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif -u16 VFiPF_GET_LE_U16(const u8* buf); -void VFiPF_LE16_TO_U16_STR(u8* str, u32 n); +u16 VFiPF_GET_LE_U16(const u8 *buf); +void VFiPF_LE16_TO_U16_STR(u8 *str, u32 n); #ifdef __cplusplus } diff --git a/include/rvl/VF/pf_str.h b/include/rvl/VF/pf_str.h index c92b2194..bde314e1 100644 --- a/include/rvl/VF/pf_str.h +++ b/include/rvl/VF/pf_str.h @@ -1,7 +1,7 @@ #ifndef RVL_SDK_VF_PF_STRING_H #define RVL_SDK_VF_PF_STRING_H #include "rvl/VF/pf.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -14,24 +14,23 @@ typedef enum { } PFSTR_CodeMode; typedef struct PF_STR { - const char* head; // at 0x0 - const char* tail; // at 0x4 - const char* local; // at 0x8 + const char *head; // at 0x0 + const char *tail; // at 0x4 + const char *local; // at 0x8 u32 mode; // at 0xC } PF_STR; -void VFiPFSTR_SetCodeMode(PF_STR* str, u32 mode); -u32 VFiPFSTR_GetCodeMode(PF_STR* str); -void VFiPFSTR_SetLocalStr(PF_STR* str, char* local); -char* VFiPFSTR_GetStrPos(PF_STR* str, u32 target); -void VFiPFSTR_MoveStrPos(PF_STR* str, s16 n); -s32 VFiPFSTR_InitStr(PF_STR* str, const char* s, u32 mode); -u16 VFiPFSTR_StrLen(PF_STR* str); -u16 VFiPFSTR_StrNumChar(PF_STR* str, u32 target); -s32 VFiPFSTR_StrCmp(const PF_STR* str, const char* cmp); -int VFiPFSTR_StrNCmp(PF_STR* str, const char* cmp, u32 target, s16 offset, - u16 n); -void VFiPFSTR_ToUpperNStr(PF_STR* str, u16 n, char* out); +void VFiPFSTR_SetCodeMode(PF_STR *str, u32 mode); +u32 VFiPFSTR_GetCodeMode(PF_STR *str); +void VFiPFSTR_SetLocalStr(PF_STR *str, char *local); +char *VFiPFSTR_GetStrPos(PF_STR *str, u32 target); +void VFiPFSTR_MoveStrPos(PF_STR *str, s16 n); +s32 VFiPFSTR_InitStr(PF_STR *str, const char *s, u32 mode); +u16 VFiPFSTR_StrLen(PF_STR *str); +u16 VFiPFSTR_StrNumChar(PF_STR *str, u32 target); +s32 VFiPFSTR_StrCmp(const PF_STR *str, const char *cmp); +int VFiPFSTR_StrNCmp(PF_STR *str, const char *cmp, u32 target, s16 offset, u16 n); +void VFiPFSTR_ToUpperNStr(PF_STR *str, u16 n, char *out); #ifdef __cplusplus } diff --git a/include/rvl/VF/pf_volume.h b/include/rvl/VF/pf_volume.h index 93c9e944..f737f38d 100644 --- a/include/rvl/VF/pf_volume.h +++ b/include/rvl/VF/pf_volume.h @@ -1,7 +1,7 @@ #ifndef RVL_SDK_VF_PF_VOLUME_H #define RVL_SDK_VF_PF_VOLUME_H #include "rvl/VF/pf_code.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -14,7 +14,7 @@ typedef struct PF_VOLUME { typedef struct PF_CUR_VOLUME { u32 stat; // at 0x0 s32 context_id; // at 0x4 - PF_VOLUME* p_vol; // at 0x8 + PF_VOLUME *p_vol; // at 0x8 } PF_CUR_VOLUME; typedef struct PF_CONTEXT { @@ -27,7 +27,7 @@ typedef struct PF_VOLUME_SET { s32 num_attached_drives; // at 0xC s32 num_mounted_volumes; // at 0x10 u32 config; // at 0x14 - void* param; // at 0x18 + void *param; // at 0x18 s32 last_error; // at 0x1C s32 last_driver_error; // at 0x20 PF_CHARCODE codeset; // at 0x24 diff --git a/include/rvl/VF/pf_w_clib.h b/include/rvl/VF/pf_w_clib.h index 3e1d0ea4..4c86447d 100644 --- a/include/rvl/VF/pf_w_clib.h +++ b/include/rvl/VF/pf_w_clib.h @@ -1,13 +1,13 @@ #ifndef RVL_SDK_VF_PF_W_CLIB_H #define RVL_SDK_VF_PF_W_CLIB_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif -size_t VFipf_w_strlen(const wchar_t* str); -wchar_t* VFipf_w_strcpy(wchar_t* dst, const wchar_t* src); -int VFipf_w_strncmp(const wchar_t* s1, const wchar_t* s2, size_t n); +size_t VFipf_w_strlen(const wchar_t *str); +wchar_t *VFipf_w_strcpy(wchar_t *dst, const wchar_t *src); +int VFipf_w_strncmp(const wchar_t *s1, const wchar_t *s2, size_t n); #ifdef __cplusplus } diff --git a/include/rvl/VI/vi.h b/include/rvl/VI/vi.h index 00054dce..7a892813 100644 --- a/include/rvl/VI/vi.h +++ b/include/rvl/VI/vi.h @@ -1,7 +1,7 @@ #ifndef RVL_SDK_VI_H #define RVL_SDK_VI_H #include "rvl/GX.h" -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif diff --git a/include/rvl/VI/vi3in1.h b/include/rvl/VI/vi3in1.h index 348c60ce..db46897e 100644 --- a/include/rvl/VI/vi3in1.h +++ b/include/rvl/VI/vi3in1.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_VI_VI3IN1_H #define RVL_SDK_VI_VI3IN1_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif diff --git a/include/rvl/VI/vihardware.h b/include/rvl/VI/vihardware.h index bb132102..6c0c6331 100644 --- a/include/rvl/VI/vihardware.h +++ b/include/rvl/VI/vihardware.h @@ -1,6 +1,6 @@ #ifndef RVL_SDK_VI_HARDWARE_H #define RVL_SDK_VI_HARDWARE_H -#include "rvl/types.h" +#include #ifdef __cplusplus extern "C" { #endif diff --git a/include/rvl/types.h b/include/rvl/types.h deleted file mode 100644 index 4e5a45ce..00000000 --- a/include/rvl/types.h +++ /dev/null @@ -1,38 +0,0 @@ -#pragma once - -#include "rvl/macros.h" -typedef int BOOL; -enum { FALSE, TRUE }; -typedef int UNKWORD; -typedef void UNKTYPE; - -#ifndef TYPES_H -#define TYPES_H - -// #ifdef __cplusplus -// #include "cstdarg> -// #include "cstddef> -// #else -// #include "stdarg.h" -// #include "stddef.h" -// #endif - - -typedef unsigned long long u64; -typedef signed long long s64; - -typedef unsigned long u32; -typedef signed long s32; - -typedef unsigned short u16; -typedef signed short s16; - -typedef unsigned char u8; -typedef signed char s8; - -typedef float f32; -typedef double f64; - - - -#endif diff --git a/include/sound_mgrs/sound_audio_manager.h b/include/sound_mgrs/sound_audio_manager.h index 571c6fa5..aed22129 100644 --- a/include/sound_mgrs/sound_audio_manager.h +++ b/include/sound_mgrs/sound_audio_manager.h @@ -1,11 +1,9 @@ #pragma once -#include "types.h" #include "egg/audio/eggAudioMgr.h" - +#include // Size: 0x6d0 class SndAudioMgr : public EGG::SimpleAudioMgr { public: - -}; \ No newline at end of file +}; diff --git a/include/toBeSorted/arc_manager.h b/include/toBeSorted/arc_manager.h index bd1e39b1..6302979f 100644 --- a/include/toBeSorted/arc_manager.h +++ b/include/toBeSorted/arc_manager.h @@ -1,34 +1,34 @@ #pragma once -#include "types.h" +#include // Ghidra: ArcManagerEntry // size: 0x40 struct ArcManagerEntry { /* 0x00 */ char arc_name[0x20]; - /* 0x20 */ u16 ref_count; - /* 0x24 */ int dvd_req_ptr; - /* 0x28 */ int archive_ptr; - /* 0x2C */ int heap_ptr_0; + /* 0x20 */ u16 ref_count; + /* 0x24 */ int dvd_req_ptr; + /* 0x28 */ int archive_ptr; + /* 0x2C */ int heap_ptr_0; /* 0x30 */ char field_0x30[0x3C - 0x30]; - /* 0x3C */ int heap_ptr_1; + /* 0x3C */ int heap_ptr_1; }; // Ghidra: ArcManagerEntryTable // size: 0xC -class ArcMangerEntryTable{ - public: - /* 0x0 */ ArcManagerEntry* entries; - /* 0x4 */ u16 count; - /* 0x8 */ u32 field_0x8; - public: - ArcMangerEntryTable(); +class ArcMangerEntryTable { +public: + /* 0x0 */ ArcManagerEntry *entries; + /* 0x4 */ u16 count; + /* 0x8 */ u32 field_0x8; + +public: + ArcMangerEntryTable(); }; class OarcManager { public: - void* getDataFromOarc(char* oarcName, char* fileName); - + void *getDataFromOarc(char *oarcName, char *fileName); }; OarcManager g_OarcManager; diff --git a/include/toBeSorted/bitwise_flag_helper.h b/include/toBeSorted/bitwise_flag_helper.h index 3ddfa2df..74329985 100644 --- a/include/toBeSorted/bitwise_flag_helper.h +++ b/include/toBeSorted/bitwise_flag_helper.h @@ -1,13 +1,13 @@ #pragma once -#include "types.h" +#include class BitwiseFlagHelper { - public: +public: bool checkFlag(u16 slot, u16 shift, const u16 *pData, u16 flagCount); bool checkFlag2(u16 slot, u16 shift, const u16 *pData, s32 flagCount) { return checkFlag(slot, shift, pData, flagCount); } void setFlag(u16 slot, u16 shift, u16 *pData, u16 flagCount); void unsetFlag(u16 slot, u16 shift, u16 *pData, u16 flagCount); -}; \ No newline at end of file +}; diff --git a/include/toBeSorted/file_manager.h b/include/toBeSorted/file_manager.h index 8e542398..9b588943 100644 --- a/include/toBeSorted/file_manager.h +++ b/include/toBeSorted/file_manager.h @@ -1,86 +1,89 @@ -#include "types.h" #include "egg/core/eggHeap.h" -#include "m/m_vec.h" #include "m/m_angle.h" +#include "m/m_vec.h" #include "toBeSorted/save_file.h" +#include + enum ITEM_ID {}; enum SAVE_ITEM_ID {}; class FileManager { public: - /* 0x0000 */ void* mpSavedSaveFiles; - /* 0x0004 */ void* mpSkipData; // skip data Arrary (3 entries ) - /* 0x0008 */ SaveFile mFileA; - /* 0x53C8 */ SaveFile mFileB; - /* 0xA788 */ u16 mSkipFlags[16]; - /* 0xA7A8 */ u32 mSkipFlagsCRC; - /* 0xA7AC */ wchar_t mHeroNames[3][9]; // each name is 9 wchars - /* 0xA7E2 */ wchar_t mHeroName[9]; // The current Hero Name - /* 0xA7F4 */ char mCurrentArea[32]; - /* 0xA814 */ u32 m_0xA814; - /* 0xA818 */ s64 mPlayTime[3]; - /* 0xA830 */ s16 mCurrentHealth[3]; - /* 0xA836 */ s16 mCurrentHealthCapacity[3]; - /* 0xA83C */ u8 mSelectedFile; - /* 0xA83D */ u8 mIsFileEmpty[3]; - /* 0xA840 */ u8 mIsFileUnk1[3]; - /* 0xA843 */ u8 mIsFileInvalid[3]; - /* 0xA846 */ u8 mIsFileDataDirty[3]; - /* 0xA849 */ u8 mIsFileSkipDataDirty[3]; - /* 0xA84C */ u8 m_0xA84C; - /* 0xA84D */ u8 m_0xA84D; - /* 0xA84E */ u8 mAntiCommitFlag; - /* 0xA84F */ u8 m_0xA84F; + /* 0x0000 */ void *mpSavedSaveFiles; + /* 0x0004 */ void *mpSkipData; // skip data Arrary (3 entries ) + /* 0x0008 */ SaveFile mFileA; + /* 0x53C8 */ SaveFile mFileB; + /* 0xA788 */ u16 mSkipFlags[16]; + /* 0xA7A8 */ u32 mSkipFlagsCRC; + /* 0xA7AC */ wchar_t mHeroNames[3][9]; // each name is 9 wchars + /* 0xA7E2 */ wchar_t mHeroName[9]; // The current Hero Name + /* 0xA7F4 */ char mCurrentArea[32]; + /* 0xA814 */ u32 m_0xA814; + /* 0xA818 */ s64 mPlayTime[3]; + /* 0xA830 */ s16 mCurrentHealth[3]; + /* 0xA836 */ s16 mCurrentHealthCapacity[3]; + /* 0xA83C */ u8 mSelectedFile; + /* 0xA83D */ u8 mIsFileEmpty[3]; + /* 0xA840 */ u8 mIsFileUnk1[3]; + /* 0xA843 */ u8 mIsFileInvalid[3]; + /* 0xA846 */ u8 mIsFileDataDirty[3]; + /* 0xA849 */ u8 mIsFileSkipDataDirty[3]; + /* 0xA84C */ u8 m_0xA84C; + /* 0xA84D */ u8 m_0xA84D; + /* 0xA84E */ u8 mAntiCommitFlag; + /* 0xA84F */ u8 m_0xA84F; + public: // the following arent part of FileManager i dont think // /* 80009D30 */ void fn_80009D30(); // some ctor // /* 80009D40 */ void fn_80009D40(); // some dtor // /* 80009D80 */ void fn_80009D80(); // return // /* 80009D90 */ void fn_80009D90(); // return - // /* 80009DA0 */ void fn_80009DA0(); // memset(param_1, 0, 0x20) a 0x24 structure is implied here (0x20 data) a crc is at 0x24 + // /* 80009DA0 */ void fn_80009DA0(); // memset(param_1, 0, 0x20) a 0x24 structure is implied here (0x20 data) a crc + // is at 0x24 /* 80009DB0 */ FileManager(); // - /* 80009EE0 */ // mVec3(); + /* 80009EE0 */ // mVec3(); - /* 80009EF0 */ static FileManager create(EGG::Heap*); - /* 80009F30 */ bool loadSaveData(void* out, char* name, bool isSkipData); - /* 80009F70 */ void saveSaveData(void* unk, bool isSkipData); + /* 80009EF0 */ static FileManager create(EGG::Heap *); + /* 80009F30 */ bool loadSaveData(void *out, char *name, bool isSkipData); + /* 80009F70 */ void saveSaveData(void *unk, bool isSkipData); /* 8000A000 */ void refreshSaveFileData(); - /* 8000A260 */ wchar_t* getFileHeroname(int fileNum); + /* 8000A260 */ wchar_t *getFileHeroname(int fileNum); /* 8000A280 */ s64 getFileSaveTime(int fileNum); /* 8000A2A0 */ s16 getFileCurrentHealth(int fileNum); /* 8000A2C0 */ s16 getFileHealthCapacity(int fileNum); /* 8000A2E0 */ void fn_8000A2E0(); // idk something blank save files - /* 8000A330 */ u16* getStoryFlagsMut(); - /* 8000A360 */ u16* getStoryFlagsConst(); - /* 8000A3B0 */ u16* getItemFlagsMut(); - /* 8000A3E0 */ u16* getItemFlagsConst(); - /* 8000A430 */ u16* getDungeonFlagsMut(); - /* 8000A460 */ u16* getDungeonFlagsConst(); - /* 8000A4B0 */ u16* getSceneFlagsMut(); - /* 8000A4E0 */ u16* getSceneFlagsConst(); - /* 8000A530 */ u16* getTBoxFlagsMut(); - /* 8000A560 */ u16* getTBoxFlagsConst(); - /* 8000A5B0 */ u16* getTempFlagsMut(); - /* 8000A5E0 */ u16* getTempFlagsConst(); - /* 8000A630 */ u16* getZoneFlagsMut(); - /* 8000A660 */ u16* getZoneFlagsConst(); - /* 8000A6B0 */ u16* getEnemyDefeatFlagsMut(); - /* 8000A6E0 */ u16* getEnemyDefeatFlagsConst(); + /* 8000A330 */ u16 *getStoryFlagsMut(); + /* 8000A360 */ u16 *getStoryFlagsConst(); + /* 8000A3B0 */ u16 *getItemFlagsMut(); + /* 8000A3E0 */ u16 *getItemFlagsConst(); + /* 8000A430 */ u16 *getDungeonFlagsMut(); + /* 8000A460 */ u16 *getDungeonFlagsConst(); + /* 8000A4B0 */ u16 *getSceneFlagsMut(); + /* 8000A4E0 */ u16 *getSceneFlagsConst(); + /* 8000A530 */ u16 *getTBoxFlagsMut(); + /* 8000A560 */ u16 *getTBoxFlagsConst(); + /* 8000A5B0 */ u16 *getTempFlagsMut(); + /* 8000A5E0 */ u16 *getTempFlagsConst(); + /* 8000A630 */ u16 *getZoneFlagsMut(); + /* 8000A660 */ u16 *getZoneFlagsConst(); + /* 8000A6B0 */ u16 *getEnemyDefeatFlagsMut(); + /* 8000A6E0 */ u16 *getEnemyDefeatFlagsConst(); - /* 8000A730 */ void setStoryFlags(u16* flags, u32 offset, u16 count); - /* 8000A790 */ void setItemFlags(u16* flags, u32 offset, u16 count); - /* 8000A7F0 */ void setDungeonFlags(u16* flags, u32 offset, u16 count); - /* 8000A850 */ void setSceneFlags(u16* flags, u32 offset, u16 count); - /* 8000A8B0 */ void setTBoxFlags(u16* flags, u32 offset, u16 count); - /* 8000A910 */ void setTempFlags(u16* flags, u32 offset, u16 count); - /* 8000A970 */ void setZoneFlags(u16* flags, u32 offset, u16 count); - /* 8000A9D0 */ void setEnemyDefeatFlags(u16* flags, u32 offset, u16 count); + /* 8000A730 */ void setStoryFlags(u16 *flags, u32 offset, u16 count); + /* 8000A790 */ void setItemFlags(u16 *flags, u32 offset, u16 count); + /* 8000A7F0 */ void setDungeonFlags(u16 *flags, u32 offset, u16 count); + /* 8000A850 */ void setSceneFlags(u16 *flags, u32 offset, u16 count); + /* 8000A8B0 */ void setTBoxFlags(u16 *flags, u32 offset, u16 count); + /* 8000A910 */ void setTempFlags(u16 *flags, u32 offset, u16 count); + /* 8000A970 */ void setZoneFlags(u16 *flags, u32 offset, u16 count); + /* 8000A9D0 */ void setEnemyDefeatFlags(u16 *flags, u32 offset, u16 count); - /* 8000AA30 */ u16* getSkipFlags(); - /* 8000AA40 */ void setSkipFlagsChecked(u16* flags, u32 offset, u16 count); + /* 8000AA30 */ u16 *getSkipFlags(); + /* 8000AA40 */ void setSkipFlagsChecked(u16 *flags, u32 offset, u16 count); /* 8000AAA0 */ void initFile(int fileNum); @@ -89,22 +92,22 @@ public: /* 8000AC50 */ void setCurrentHealth(s16 health); /* 8000AC80 */ s16 getCurrentHealth(); - /* 8000ACD0 */ u16 getLoadRoomT1(); - /* 8000AD20 */ u16 getLoadRoomT2(); + /* 8000ACD0 */ u16 getLoadRoomT1(); + /* 8000AD20 */ u16 getLoadRoomT2(); /* 8000AD70 */ void setLoadRoomT3(s16 room); - /* 8000ADA0 */ u16 getLoadRoomT3(); + /* 8000ADA0 */ u16 getLoadRoomT3(); - /* 8000ADF0 */ mVec3_c* getPosT1(); - /* 8000AE40 */ void setPosT2(mVec3_c* pos); - /* 8000AE90 */ mVec3_c* getPosT2(); - /* 8000AEE0 */ void setPosT3(mVec3_c* pos); - /* 8000AF30 */ mVec3_c* getPosT3(); + /* 8000ADF0 */ mVec3_c *getPosT1(); + /* 8000AE40 */ void setPosT2(mVec3_c *pos); + /* 8000AE90 */ mVec3_c *getPosT2(); + /* 8000AEE0 */ void setPosT3(mVec3_c *pos); + /* 8000AF30 */ mVec3_c *getPosT3(); - /* 8000AF80 */ s16 getAngleT1(); + /* 8000AF80 */ s16 getAngleT1(); /* 8000AFD0 */ void setAngleT2(s16 angle); - /* 8000B000 */ s16 getAngleT2(); + /* 8000B000 */ s16 getAngleT2(); /* 8000B050 */ void setAngleT3(s16 angle); - /* 8000B080 */ s16 getAngleT3(); + /* 8000B080 */ s16 getAngleT3(); /* 8000B0D0 */ void setPouchData(s32 slot, u32 slotData); /* 8000B130 */ u32 getPouchData(s32 slot); @@ -119,7 +122,7 @@ public: /* 8000B480 */ ITEM_ID getItemCheckItem(u32 idx); /* 8000B4B0 */ void setItemCheckUpperData(u32 idx, u32 itemData); /* 8000B540 */ u32 getItemCheckUpperData(); - + /* 8000B570 */ void setEquippedItem(u8 bWheelItem); /* 8000B5A0 */ u8 getEquippedItem(); /* 8000B5F0 */ void setSelectedPouchSlot(u8 slot); @@ -143,8 +146,8 @@ public: /* 8000B9F0 */ void setDowsingSlotIdx(u8 idx); /* 8000BA20 */ u8 getDowsingSlotIdx(); - /* 8000BA70 */ void setBeaconPos(u32 beaconArea, u32 beaconNum, mVec3_c* pos); - /* 8000BB80 */ mVec3_c* getBeaconPos(u32 beaconArea, u32 beaconNum); + /* 8000BA70 */ void setBeaconPos(u32 beaconArea, u32 beaconNum, mVec3_c *pos); + /* 8000BB80 */ mVec3_c *getBeaconPos(u32 beaconArea, u32 beaconNum); /* 8000BC70 */ void setEnemyKillCount(u32 enemy, u16 killCount); /* 8000BCE0 */ u16 getEnemyKillCount(u32 enemy); /* 8000BD60 */ void setHitCountFromEnemy(u32 enemy, u16 hitCount); @@ -153,9 +156,9 @@ public: /* 8000BE50 */ void setLoadRoomT1_FileB(s16 roomId); /* 8000BE80 */ s16 getLoadRoomT1_FileB(); /* 8000BE90 */ void setEntranceT1_FileB(u8 entrance); - /* 8000BEC0 */ u8 getEntranceT1_FileB(); - /* 8000BED0 */ void setAreaT1_FileB(const char* name); - /* 8000BF80 */ char* getAreaT1_FileB(); + /* 8000BEC0 */ u8 getEntranceT1_FileB(); + /* 8000BED0 */ void setAreaT1_FileB(const char *name); + /* 8000BF80 */ char *getAreaT1_FileB(); /* 8000C080 */ void setNightT1_FileB(bool night); /* 8000C0B0 */ bool getNightT1_FileB(); /* 8000C0C0 */ void setEntranceT1LoadFlag_FileB(u8 flag); @@ -163,13 +166,13 @@ public: /* 8000C120 */ void getForcedLayerT1_FileB(); /* 8000C130 */ void setCurrentHealth_FileB(s16 health); - /* 8000C160 */ void setHeroname(const wchar_t* name); - /* 8000C230 */ wchar_t* getHeroname(); + /* 8000C160 */ void setHeroname(const wchar_t *name); + /* 8000C230 */ wchar_t *getHeroname(); - /* 8000C360 */ char* getAreaT1(); - /* 8000C470 */ char* getAreaT2(); - /* 8000C580 */ void setAreaT3(const char* name); - /* 8000C630 */ char* getAreaT3(); + /* 8000C360 */ char *getAreaT1(); + /* 8000C470 */ char *getAreaT2(); + /* 8000C580 */ void setAreaT3(const char *name); + /* 8000C630 */ char *getAreaT3(); /* 8000C740 */ u8 getForcedLayerT1(); /* 8000C790 */ u8 getForcedLayerT2(); @@ -199,7 +202,7 @@ public: /* 8000CC50 */ void setFileTimes(); /* 8000CCB0 */ void setPlayTime(s64 time); - /* 8000CCF0 */ s64 getSavedTime(); + /* 8000CCF0 */ s64 getSavedTime(); /* 8000CD40 */ void setSavedTime(s64 time); /* 8000CD80 */ void setBeedleShopPathSegment(u32 path); @@ -239,11 +242,11 @@ public: /* 80010350 */ void copyFileSkipData(int fileNum); /* 80010440 */ void clearTempFileData(); /* 800104A0 */ void saveAfterCredits(); - /* 80011210 */ SaveFile* getCurrentFile(); - /* 80011250 */ u16* getSkipFlags2(); - /* 80011260 */ SaveFile* getFileA(); - /* 80011270 */ SaveFile* getFileB(); - /* 80011280 */ void calcFileCRC(const SaveFile* file, u32 length); + /* 80011210 */ SaveFile *getCurrentFile(); + /* 80011250 */ u16 *getSkipFlags2(); + /* 80011260 */ SaveFile *getFileA(); + /* 80011270 */ SaveFile *getFileB(); + /* 80011280 */ void calcFileCRC(const SaveFile *file, u32 length); /* 80011290 */ void updateEmptyFiles(); /* 800112D0 */ void updateEmptyFileFlags(); /* 80011370 */ bool isFileEmpty(int fileNum); @@ -253,13 +256,12 @@ public: /* 80011440 */ bool checkFileCRC(int fileNum); /* 80011490 */ bool isFileInactive(); /* 80011500 */ void setPlayerInfoFileA(); - /* 800115E0 */ void setT3Info(mVec3_c* pos, mAng3_c* rot); - /* 800116C0 */ static void getRegionVersion(char* out); + /* 800115E0 */ void setT3Info(mVec3_c *pos, mAng3_c *rot); + /* 800116C0 */ static void getRegionVersion(char *out); // /* 800116F0 */ void sinit(); - static FileManager* getInstance() { + static FileManager *getInstance() { return sInstance; } static FileManager *sInstance; }; - diff --git a/include/toBeSorted/flag_space.h b/include/toBeSorted/flag_space.h index a5f45ecc..d5467839 100644 --- a/include/toBeSorted/flag_space.h +++ b/include/toBeSorted/flag_space.h @@ -1,25 +1,25 @@ #pragma once -#include "types.h" +#include struct BaseFlagSpace { u16 *mpFlags; u16 mCount; - BaseFlagSpace(u16 *pFlags, u16 count): mpFlags(pFlags), mCount(count) {} + BaseFlagSpace(u16 *pFlags, u16 count) : mpFlags(pFlags), mCount(count) {} }; -class FlagSpace: public BaseFlagSpace { - public: +class FlagSpace : public BaseFlagSpace { +public: void init(u16 *pFlags, u16 count) { mpFlags = pFlags; mCount = count; } - FlagSpace(u16 *pFlags, u16 count): BaseFlagSpace(pFlags, count) {} - u16* getFlagPtrChecked(); - u16* getFlagPtrUnchecked(); + FlagSpace(u16 *pFlags, u16 count) : BaseFlagSpace(pFlags, count) {} + u16 *getFlagPtrChecked(); + u16 *getFlagPtrUnchecked(); void unsetAll(); void setAllToZero(u16 offset, u16 flagCount); void copyFromSaveFile2(u16 *pSaved, u16 offset, u16 flagCount); void copyFromSaveFile(u16 *pSaved, u16 offset, u16 flagCount); virtual void filemanagerCheck(); -}; \ No newline at end of file +}; diff --git a/include/toBeSorted/room_manager.h b/include/toBeSorted/room_manager.h index 3b3ba024..c99b0380 100644 --- a/include/toBeSorted/room_manager.h +++ b/include/toBeSorted/room_manager.h @@ -1,7 +1,8 @@ #pragma once -#include "types.h" #include "d/d_base.h" +#include + #define MAX_ROOM_NUMBER 64 @@ -9,7 +10,7 @@ class dRoom; class RoomTable { RoomTable(); virtual ~RoomTable(); - dRoom* rooms[MAX_ROOM_NUMBER-1]; + dRoom *rooms[MAX_ROOM_NUMBER - 1]; }; // OBJ NAME: STAGE @@ -20,12 +21,14 @@ class RoomManager : public dBase_c { public: /* 0068 */ char field_0x68[0x7C - 0x68]; /* 007C */ RoomTable rooms; - /* 017c */ char fader[0x1a0 - 0x17c]; // size unk + /* 017c */ char fader[0x1a0 - 0x17c]; // size unk /* 01a0 */ char mapRelated[0x39c - 0x1a0]; // size unk - /* 039c */ u32 loaded_entities[2047]; - /* 2398 */ u8 curr_room_id; + /* 039c */ u32 loaded_entities[2047]; + /* 2398 */ u8 curr_room_id; + public: - /* 80575760 */ static RoomManager* m_Instance; + /* 80575760 */ static RoomManager *m_Instance; + public: - /* 801b42b0 */ static dBase_c* getRoom(int roomid); -}; \ No newline at end of file + /* 801b42b0 */ static dBase_c *getRoom(int roomid); +}; diff --git a/include/toBeSorted/save_file.h b/include/toBeSorted/save_file.h index c9da8bcb..7bd9fb2a 100644 --- a/include/toBeSorted/save_file.h +++ b/include/toBeSorted/save_file.h @@ -1,111 +1,109 @@ #pragma once -#include "types.h" #include "UnknownTypeBelongings.h" - +#include // Ghidra: SaveFile // Size: 0x53c0 // non-offical name class SaveFile { public: - /* 0x 0000 */ char field_0x0000[0x8-0x0]; - /* 0x 0008 */ s64 savedTime; + /* 0x 0000 */ char field_0x0000[0x8 - 0x0]; + /* 0x 0008 */ s64 savedTime; /* 0x 0010 */ Vec3f pos_t1; /* 0x 001c */ Vec3f pos_t2; /* 0x 0028 */ Vec3f pos_t3; /* 0x 0034 */ Vec3f beacon_pos[32][5]; - /* 0x 07b4 */ s32 beedleShopPathSegment; - /* 0x 07b8 */ f32 beedlShopPathSegFrac; - /* 0x 07bc */ char field_0x07BC[0x7c0 - 0x7bc]; - /* 0x 07c0 */ s32 pouch_items[8]; - /* 0x 07e0 */ s32 item_check_items[60]; - /* 0x 08d0 */ int file_area_index; - /* 0x 08d4 */ s16 player_name[8]; - /* 0x 08e4 */ u16 story_flags[128]; - /* 0x 09e4 */ u16 item_flags[64]; - /* 0x 0a64 */ u16 dungeon_flags[8][22]; - /* 0x 0bc4 */ char field_0x0BC4[0x1a64 - 0x0bc4]; - /* 0x 1a64 */ u16 scene_flags[208]; - /* 0x 1c04 */ char field_0x1c04[0x2a64 - 0x1c04]; - /* 0x 2a64 */ u16 tbox_flags[32]; // size is guessed - /* 0x 2aa4 */ char field_0x2AA4[0x2f64 - 0x2aa4]; - /* 0x 2f64 */ u16 enemyKillCounts[100]; - /* 0x 302c */ u16 hitByEnemyCounts[100]; - /* 0x 30f4 */ u16 temp_flags[4]; - /* 0x 30fc */ u16 zone_flags[252]; - /* 0x 32f4 */ u16 unk_flags[4096]; // size guessed? (saw memset) - /* 0x 52f4 */ s16 air_potion_timer; - /* 0x 52f6 */ s16 air_potion_plus_timer; - /* 0x 52f8 */ s16 stamina_potion_timer; - /* 0x 52fa */ s16 stamina_potion_plus_timer; - /* 0x 52fc */ s16 gaurdian_potion_timer; - /* 0x 52fe */ s16 gaurdian_potion_plus_timer; - /* 0x 5300 */ s16 field_0x5300; - /* 0x 5302 */ s16 health_capacity; - /* 0x 5304 */ u16 unused_heart_related; - /* 0x 5306 */ u16 current_health; - /* 0x 5308 */ u16 room_id_t1; - /* 0x 530a */ u16 room_id_t2; - /* 0x 530c */ u16 room_id_t3; - /* 0x 530e */ s16 angle_t1; - /* 0x 5310 */ s16 angle_t2; - /* 0x 5312 */ s16 angle_t3; - /* 0x 5314 */ s16 beedle_shop_rotation; - /* 0x 5316 */ u16 field_0x5316; - /* 0x 5318 */ s16 scene_flag_index; - /* 0x 531a */ u16 field_0x531A; - /* 0x 531c */ char area_t1[32]; - /* 0x 533c */ s8 area_t2[32]; - /* 0x 535c */ s8 area_t3[32]; - /* 0x 537c */ u8 placed_beacon_flags[32]; - /* 0x 539c */ u8 skykeep_puzzle[9]; - /* 0x 53a5 */ u8 forced_layer_t1; - /* 0x 53a6 */ u8 forced_layer_t2; - /* 0x 53a7 */ u8 forced_layer_t3; - /* 0x 53a8 */ u8 entrance_t1; - /* 0x 53a9 */ u8 entrance_t1_load_flag; - /* 0x 53aa */ u8 entrance_t2; - /* 0x 53ab */ u8 entrance_t3; - /* 0x 53ac */ u8 field_0x53ac; - /* 0x 53ad */ bool new_file; //set on new file, unset by saving - /* 0x 53ae */ u8 equipped_b_item; - /* 0x 53af */ u8 field_0x53af; - /* 0x 53b0 */ u8 lastUsedPouchItemSlot; - /* 0x 53b1 */ u8 shield_pouch_slot; - /* 0x 53b2 */ u8 selectedDowsingSlot; - /* 0x 53b3 */ u8 night_t1; - /* 0x 53b4 */ u8 night_t3; - /* 0x 53b5 */ char field_0x53b5[0x53bc - 0x53b5]; - /* 0x 53bc */ u32 checksum; + /* 0x 07b4 */ s32 beedleShopPathSegment; + /* 0x 07b8 */ f32 beedlShopPathSegFrac; + /* 0x 07bc */ char field_0x07BC[0x7c0 - 0x7bc]; + /* 0x 07c0 */ s32 pouch_items[8]; + /* 0x 07e0 */ s32 item_check_items[60]; + /* 0x 08d0 */ int file_area_index; + /* 0x 08d4 */ s16 player_name[8]; + /* 0x 08e4 */ u16 story_flags[128]; + /* 0x 09e4 */ u16 item_flags[64]; + /* 0x 0a64 */ u16 dungeon_flags[8][22]; + /* 0x 0bc4 */ char field_0x0BC4[0x1a64 - 0x0bc4]; + /* 0x 1a64 */ u16 scene_flags[208]; + /* 0x 1c04 */ char field_0x1c04[0x2a64 - 0x1c04]; + /* 0x 2a64 */ u16 tbox_flags[32]; // size is guessed + /* 0x 2aa4 */ char field_0x2AA4[0x2f64 - 0x2aa4]; + /* 0x 2f64 */ u16 enemyKillCounts[100]; + /* 0x 302c */ u16 hitByEnemyCounts[100]; + /* 0x 30f4 */ u16 temp_flags[4]; + /* 0x 30fc */ u16 zone_flags[252]; + /* 0x 32f4 */ u16 unk_flags[4096]; // size guessed? (saw memset) + /* 0x 52f4 */ s16 air_potion_timer; + /* 0x 52f6 */ s16 air_potion_plus_timer; + /* 0x 52f8 */ s16 stamina_potion_timer; + /* 0x 52fa */ s16 stamina_potion_plus_timer; + /* 0x 52fc */ s16 gaurdian_potion_timer; + /* 0x 52fe */ s16 gaurdian_potion_plus_timer; + /* 0x 5300 */ s16 field_0x5300; + /* 0x 5302 */ s16 health_capacity; + /* 0x 5304 */ u16 unused_heart_related; + /* 0x 5306 */ u16 current_health; + /* 0x 5308 */ u16 room_id_t1; + /* 0x 530a */ u16 room_id_t2; + /* 0x 530c */ u16 room_id_t3; + /* 0x 530e */ s16 angle_t1; + /* 0x 5310 */ s16 angle_t2; + /* 0x 5312 */ s16 angle_t3; + /* 0x 5314 */ s16 beedle_shop_rotation; + /* 0x 5316 */ u16 field_0x5316; + /* 0x 5318 */ s16 scene_flag_index; + /* 0x 531a */ u16 field_0x531A; + /* 0x 531c */ char area_t1[32]; + /* 0x 533c */ s8 area_t2[32]; + /* 0x 535c */ s8 area_t3[32]; + /* 0x 537c */ u8 placed_beacon_flags[32]; + /* 0x 539c */ u8 skykeep_puzzle[9]; + /* 0x 53a5 */ u8 forced_layer_t1; + /* 0x 53a6 */ u8 forced_layer_t2; + /* 0x 53a7 */ u8 forced_layer_t3; + /* 0x 53a8 */ u8 entrance_t1; + /* 0x 53a9 */ u8 entrance_t1_load_flag; + /* 0x 53aa */ u8 entrance_t2; + /* 0x 53ab */ u8 entrance_t3; + /* 0x 53ac */ u8 field_0x53ac; + /* 0x 53ad */ bool new_file; // set on new file, unset by saving + /* 0x 53ae */ u8 equipped_b_item; + /* 0x 53af */ u8 field_0x53af; + /* 0x 53b0 */ u8 lastUsedPouchItemSlot; + /* 0x 53b1 */ u8 shield_pouch_slot; + /* 0x 53b2 */ u8 selectedDowsingSlot; + /* 0x 53b3 */ u8 night_t1; + /* 0x 53b4 */ u8 night_t3; + /* 0x 53b5 */ char field_0x53b5[0x53bc - 0x53b5]; + /* 0x 53bc */ u32 checksum; -// ---------------------------------------------------------- -// NOTE: There are functions that are exactly the same code -// these end in a number, and likely one is const. -// it could also potentially be a static function -// ---------------------------------------------------------- + // ---------------------------------------------------------- + // NOTE: There are functions that are exactly the same code + // these end in a number, and likely one is const. + // it could also potentially be a static function + // ---------------------------------------------------------- public: - /* 800099b0 */ u16* getStoryFlags0(); - /* 800099c0 */ u16* getStoryFlags1(); - /* 800099d0 */ u16* getItemFlags0(); - /* 800099e0 */ u16* getItemFlags1(); - /* 800099F0 */ u16* getDungeonFlags0(); - /* 80009A00 */ u16* getDungeonFlags1(); - /* 80009A10 */ u16* getSceneFlags0(); - /* 80009A20 */ u16* getSceneFlags1(); - /* 80009A30 */ u16* getTboxFlags0(); - /* 80009A40 */ u16* getTboxFlags1(); - /* 80009A50 */ u16* getTempFlags0(); - /* 80009A60 */ u16* getTempFlags1(); - /* 80009A70 */ u16* getZoneFlags0(); - /* 80009A80 */ u16* getZoneFlags1(); - /* 80009A90 */ u16* getUnkFlags0(); - /* 80009AA0 */ u16* getUnkFlags1(); - /* 80009AB0 */ s16* getPlayerName(); // UTF16-BE - /* 80009AC0 */ void setAreaT1(char* name); - /* 80009BE0 */ char* getAreaT1(); - /* 80009BF0 */ void setAreaT2(char* name); - /* 80009D10 */ s8* getAreaT2(); - /* 80009D20 */ s8* getAreaT3(); - -}; \ No newline at end of file + /* 800099b0 */ u16 *getStoryFlags0(); + /* 800099c0 */ u16 *getStoryFlags1(); + /* 800099d0 */ u16 *getItemFlags0(); + /* 800099e0 */ u16 *getItemFlags1(); + /* 800099F0 */ u16 *getDungeonFlags0(); + /* 80009A00 */ u16 *getDungeonFlags1(); + /* 80009A10 */ u16 *getSceneFlags0(); + /* 80009A20 */ u16 *getSceneFlags1(); + /* 80009A30 */ u16 *getTboxFlags0(); + /* 80009A40 */ u16 *getTboxFlags1(); + /* 80009A50 */ u16 *getTempFlags0(); + /* 80009A60 */ u16 *getTempFlags1(); + /* 80009A70 */ u16 *getZoneFlags0(); + /* 80009A80 */ u16 *getZoneFlags1(); + /* 80009A90 */ u16 *getUnkFlags0(); + /* 80009AA0 */ u16 *getUnkFlags1(); + /* 80009AB0 */ s16 *getPlayerName(); // UTF16-BE + /* 80009AC0 */ void setAreaT1(char *name); + /* 80009BE0 */ char *getAreaT1(); + /* 80009BF0 */ void setAreaT2(char *name); + /* 80009D10 */ s8 *getAreaT2(); + /* 80009D20 */ s8 *getAreaT3(); +}; diff --git a/include/toBeSorted/unk_flag_stuff.h b/include/toBeSorted/unk_flag_stuff.h index 38d73fbd..87a5783f 100644 --- a/include/toBeSorted/unk_flag_stuff.h +++ b/include/toBeSorted/unk_flag_stuff.h @@ -1,6 +1,6 @@ #pragma once -#include "types.h" +#include struct UnkFlagDefinition { u8 mIndex; @@ -9,14 +9,15 @@ struct UnkFlagDefinition { class UnkFlagStuff { u16 mDefinitionsCount; - UnkFlagDefinition* mpDefinitions; + UnkFlagDefinition *mpDefinitions; + public: u16 calculateMask(s32 shift); void doNothing(u32 unused); - UnkFlagStuff(u16 count, UnkFlagDefinition* definitions); - void prepareIndexShiftMask(u16 counterIdx, u32 flagCount, u16* pIndex, u8* pShift, u16* pMask); + UnkFlagStuff(u16 count, UnkFlagDefinition *definitions); + void prepareIndexShiftMask(u16 counterIdx, u32 flagCount, u16 *pIndex, u8 *pShift, u16 *pMask); u16 maskForIdx(u16 index); - u32 getCounterOrFlag(u16 counterIdx, u16* pData, u32 flagCount); - void setCounterOrFlag(u16 counterIdx, u16* pData, u32 flagCount, u32 value); + u32 getCounterOrFlag(u16 counterIdx, u16 *pData, u32 flagCount); + void setCounterOrFlag(u16 counterIdx, u16 *pData, u32 flagCount, u32 value); u32 checkFlagValid(u16 counterIdx, u32 flagCount); }; diff --git a/include/types.h b/include/types.h deleted file mode 100644 index d3f48c9a..00000000 --- a/include/types.h +++ /dev/null @@ -1,64 +0,0 @@ -#pragma once - -#include "rvl/macros.h" - -#ifndef TYPES_H -#define TYPES_H -typedef signed char s8; -typedef signed short s16; -typedef signed int s32; -typedef signed long long s64; - -typedef unsigned char u8; -typedef unsigned short u16; -typedef unsigned int u32; -typedef unsigned long long u64; -typedef float f32; -typedef double f64; - -#endif - -#ifdef __CWCC__ - typedef unsigned long size_t; -#endif - -typedef u8 undefined1; -typedef u16 undefined2; -typedef u32 undefined4; - -typedef volatile u8 vu8; -typedef volatile u16 vu16; -typedef volatile u32 vu32; -typedef volatile u64 vu64; -typedef volatile s8 vs8; -typedef volatile s16 vs16; -typedef volatile s32 vs32; -typedef volatile s64 vs64; - -typedef volatile f32 vf32; -typedef volatile f64 vf64; - -// Necesary for CW -#if __cplusplus < 201103L && !defined(_WIN32) -#define override -#define noexcept -#define nullptr NULL -#endif - -#ifndef NULL -#define NULL 0 -#endif -#define nullptr NULL - -// taken from mkw -#ifdef __cplusplus -#define restrict - -class NonCopyable { -public: - inline NonCopyable() {} - -private: - inline NonCopyable(const NonCopyable&) {} -}; -#endif diff --git a/src/m/m_mtx.cpp b/src/m/m_mtx.cpp new file mode 100644 index 00000000..a4fb69ae --- /dev/null +++ b/src/m/m_mtx.cpp @@ -0,0 +1,12 @@ +#include +#include +#include + +void mMtx_c::toRot(mAng3_c &out) const { + f32 t1 = 0.0f; + f32 t0 = m[0][2] + m[2][2]; + if (t0 > 0.0f) { + t1 = t0 * nw4r::math::FrSqrt(t0); + } + s16 anglex = cM::atan2s(-m[1][2], t1); +} diff --git a/src/toBeSorted/bitwise_flag_helper.cpp b/src/toBeSorted/bitwise_flag_helper.cpp index d4e42131..50c3b15b 100644 --- a/src/toBeSorted/bitwise_flag_helper.cpp +++ b/src/toBeSorted/bitwise_flag_helper.cpp @@ -1,5 +1,6 @@ -#include "types.h" #include "toBeSorted/bitwise_flag_helper.h" +#include + bool BitwiseFlagHelper::checkFlag(u16 slot, u16 shift, const u16 *pData, u16 flagCount) { return (pData[slot] >> shift) & 1; @@ -9,4 +10,4 @@ void BitwiseFlagHelper::setFlag(u16 slot, u16 shift, u16 *pData, u16 flagCount) } void BitwiseFlagHelper::unsetFlag(u16 slot, u16 shift, u16 *pData, u16 flagCount) { pData[slot] &= ~(1 << shift); -} \ No newline at end of file +} diff --git a/src/toBeSorted/flag_space.cpp b/src/toBeSorted/flag_space.cpp index b509a374..c6959e59 100644 --- a/src/toBeSorted/flag_space.cpp +++ b/src/toBeSorted/flag_space.cpp @@ -1,13 +1,14 @@ -#include "libc.h" -#include "types.h" -#include "toBeSorted/file_manager.h" #include "toBeSorted/flag_space.h" +#include "libc.h" +#include "toBeSorted/file_manager.h" +#include -u16* FlagSpace::getFlagPtrChecked() { + +u16 *FlagSpace::getFlagPtrChecked() { filemanagerCheck(); return mpFlags; } -u16* FlagSpace::getFlagPtrUnchecked() { +u16 *FlagSpace::getFlagPtrUnchecked() { return mpFlags; } void FlagSpace::unsetAll() { @@ -24,11 +25,10 @@ void FlagSpace::copyFromSaveFile2(u16 *pSaved, u16 offset, u16 flagCount) { void FlagSpace::copyFromSaveFile(u16 *pSaved, u16 offset, u16 flagCount) { checkedMemcpy(mpFlags + offset, mCount * 2, pSaved, flagCount * 2); - } void FlagSpace::filemanagerCheck() { if (FileManager::sInstance->mIsFileUnk1[0]) { return; } while (true) {} -} \ No newline at end of file +} diff --git a/src/toBeSorted/sceneflag_manager.cpp b/src/toBeSorted/sceneflag_manager.cpp index 6b7b4169..3443133c 100644 --- a/src/toBeSorted/sceneflag_manager.cpp +++ b/src/toBeSorted/sceneflag_manager.cpp @@ -1,13 +1,12 @@ -#include "types.h" #include "libc.h" +#include -#include "rvl/macros.h" -#include "toBeSorted/flag_space.h" -#include "toBeSorted/file_manager.h" #include "toBeSorted/bitwise_flag_helper.h" +#include "toBeSorted/file_manager.h" +#include "toBeSorted/flag_space.h" class SceneflagManager { - public: +public: FlagSpace mSceneflags; FlagSpace mTempflags; FlagSpace mZoneflags; @@ -18,8 +17,8 @@ class SceneflagManager { static u16 sTempFlags[4]; static u16 sSceneFlags[8]; static u16 sZoneFlags[0xFC]; -// public: - static SceneflagManager* sInstance; + // public: + static SceneflagManager *sInstance; void doNothing(); void setShouldCommit(u16 flag); SceneflagManager(); @@ -70,14 +69,12 @@ void SceneflagManager::doNothing() {} void SceneflagManager::setShouldCommit(u16 flag) { mShouldCommit = 1; } -SceneflagManager::SceneflagManager(): - mSceneflags(sSceneFlags, ARRAY_LENGTH(sSceneFlags)), - mTempflags(sTempFlags, ARRAY_LENGTH(sTempFlags)), - mZoneflags(sZoneFlags, ARRAY_LENGTH(sZoneFlags)) - { - mSceneIdx = 0xFFFF; - mShouldCommit = 0; - } +SceneflagManager::SceneflagManager() + : mSceneflags(sSceneFlags, ARRAY_LENGTH(sSceneFlags)), mTempflags(sTempFlags, ARRAY_LENGTH(sTempFlags)), + mZoneflags(sZoneFlags, ARRAY_LENGTH(sZoneFlags)) { + mSceneIdx = 0xFFFF; + mShouldCommit = 0; +} // SceneflagManager::SceneflagManager() // { // mSceneflags.init(sSceneFlags, ARRAY_LENGTH(sSceneFlags)); @@ -166,7 +163,7 @@ bool SceneflagManager::checkZoneFlag(u16 roomId, u16 flag) { return false; } else { u16 zoneflag = flag - 0xC0; - u16* pData = FileManager::sInstance->getZoneFlagsConst(); + u16 *pData = FileManager::sInstance->getZoneFlagsConst(); u16 slot = getZoneflagSlot(roomId, zoneflag); return mFlagHelper.checkFlag(slot, zoneflag % 16, pData, 0xFC); } @@ -175,22 +172,22 @@ bool SceneflagManager::checkUncommittedZoneflag(u16 roomId, u16 flag) { if (flag == 0xFF) { return false; } else { - u16* pData; + u16 *pData; u16 zoneflag = flag - 0xC0; pData = mZoneflags.getFlagPtrUnchecked(); u16 slot = getZoneflagSlot(roomId, zoneflag); return mFlagHelper.checkFlag(slot, zoneflag % 16, pData, mZoneflags.mCount); } } -inline bool checkSceneflag(SceneflagManager* mgr, u16 flag) { - u16* pData; - pData = mgr->mSceneflags.getFlagPtrUnchecked(); - // u16 slot = getSceneflagSlot2(flag); - return mgr->mFlagHelper.checkFlag(mgr->getSceneflagSlot(flag), flag % 16, pData, mgr->mSceneflags.mCount); +inline bool checkSceneflag(SceneflagManager *mgr, u16 flag) { + u16 *pData; + pData = mgr->mSceneflags.getFlagPtrUnchecked(); + // u16 slot = getSceneflagSlot2(flag); + return mgr->mFlagHelper.checkFlag(mgr->getSceneflagSlot(flag), flag % 16, pData, mgr->mSceneflags.mCount); } bool SceneflagManager::checkUncommittedTempOrSceneflag(u16 flag) { if (flag >= 0x80) { - u16* pData; + u16 *pData; u16 tempflag = flag - 0x80; pData = mTempflags.getFlagPtrUnchecked(); u16 slot = getTempflagSlot(tempflag); @@ -211,13 +208,13 @@ bool SceneflagManager::checkFlag(u16 roomId, u16 flag) { } } bool SceneflagManager::checkSceneflagGlobal(u16 sceneIdx, u16 flag) { - u16* pData = FileManager::sInstance->getSceneFlagsConst(); + u16 *pData = FileManager::sInstance->getSceneFlagsConst(); return mFlagHelper.checkFlag(getSceneflagSlotGlobal(sceneIdx, flag), flag % 16, pData, 0x800); } bool SceneflagManager::checkTempOrSceneflag(u16 flag) { if (flag >= 0x80) { u16 tempflag = flag - 0x80; - const u16* pData = FileManager::sInstance->getTempFlagsConst(); + const u16 *pData = FileManager::sInstance->getTempFlagsConst(); u16 slot = getTempflagSlot(tempflag); return mFlagHelper.checkFlag(slot, tempflag % 16, pData, 4); } else { @@ -233,7 +230,7 @@ bool SceneflagManager::checkUncommittedFlag(u16 roomId, u16 flag) { } void SceneflagManager::setZoneflag(u16 roomId, u16 flag) { if (checkUncommittedZoneflag2(roomId, flag) != 1 && flag != 0xFF) { - u16* pData; + u16 *pData; u16 zoneflag = flag - 0xC0; pData = mZoneflags.getFlagPtrChecked(); u16 slot = getZoneflagSlot(roomId, zoneflag); @@ -250,19 +247,19 @@ void SceneflagManager::setFlag(u16 roomId, u16 flag) { } void SceneflagManager::setSceneflagGlobal(u16 sceneIdx, u16 flag) { u16 slot = getSceneflagSlotGlobal(sceneIdx, flag); - u16* pData = FileManager::sInstance->getSceneFlagsConst(); + u16 *pData = FileManager::sInstance->getSceneFlagsConst(); u16 pCurData = pData[slot]; mFlagHelper.setFlag(0, flag % 16, &pCurData, 2); FileManager::sInstance->setSceneFlags(&pCurData, slot, 1); if (sceneIdx == mSceneIdx) { - u16* pData2 = mSceneflags.getFlagPtrChecked(); + u16 *pData2 = mSceneflags.getFlagPtrChecked(); mFlagHelper.setFlag(getSceneflagSlot(flag), flag % 16, pData2, mSceneflags.mCount); } setShouldCommit(flag); } void SceneflagManager::setTempOrSceneflag(u16 flag) { if (checkUncommittedTempOrSceneflag2(flag) != 1) { - u16* pData; + u16 *pData; if (flag >= 0x80) { u16 tempflag = flag - 0x80; pData = mTempflags.getFlagPtrChecked(); @@ -276,7 +273,7 @@ void SceneflagManager::setTempOrSceneflag(u16 flag) { } void SceneflagManager::unsetZoneflag(u16 roomId, u16 flag) { if (checkUncommittedZoneflag2(roomId, flag) != 0 && flag != 0xFF) { - u16* pData; + u16 *pData; u16 zoneflag = flag - 0xC0; pData = mZoneflags.getFlagPtrChecked(); u16 slot = getZoneflagSlot(roomId, zoneflag); @@ -293,19 +290,19 @@ void SceneflagManager::unsetFlag(u16 roomId, u16 flag) { } void SceneflagManager::unsetSceneflagGlobal(u16 sceneIdx, u16 flag) { u16 slot = getSceneflagSlotGlobal(sceneIdx, flag); - u16* pData = FileManager::sInstance->getSceneFlagsConst(); + u16 *pData = FileManager::sInstance->getSceneFlagsConst(); u16 pCurData = pData[slot]; mFlagHelper.unsetFlag(0, flag % 16, &pCurData, 2); FileManager::sInstance->setSceneFlags(&pCurData, slot, 1); if (sceneIdx == mSceneIdx) { - u16* pData2 = mSceneflags.getFlagPtrChecked(); + u16 *pData2 = mSceneflags.getFlagPtrChecked(); mFlagHelper.unsetFlag(getSceneflagSlot(flag), flag % 16, pData2, mSceneflags.mCount); } setShouldCommit(flag); } void SceneflagManager::unsetTempOrSceneflag(u16 flag) { if (checkUncommittedTempOrSceneflag2(flag) != 0) { - u16* pData; + u16 *pData; if (flag >= 0x80) { u16 tempflag = flag - 0x80; pData = mTempflags.getFlagPtrChecked(); @@ -326,6 +323,6 @@ s32 SceneflagManager::doCommit() { FileManager::getInstance()->setZoneFlags(mZoneflags.getFlagPtrUnchecked(), 0, mZoneflags.mCount); mShouldCommit = false; return 1; - } + } return 0; }