mirror of
https://github.com/zeldaret/ss
synced 2026-06-11 21:18:40 -04:00
change everything to use a common types file
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
+25
-26
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
#ifndef CPLUSLIBPPC_H
|
||||
#define CPLUSLIBPPC_H
|
||||
|
||||
#include <common.h>
|
||||
|
||||
#endif /* CPLUSLIBPPC_H */
|
||||
@@ -0,0 +1,4 @@
|
||||
#ifndef GCN_MEM_ALLOC_H
|
||||
#define GCN_MEM_ALLOC_H
|
||||
|
||||
#endif /* GCN_MEM_ALLOC_H */
|
||||
@@ -0,0 +1,4 @@
|
||||
#ifndef GECKO_EXCEPTIONPPC_H
|
||||
#define GECKO_EXCEPTIONPPC_H
|
||||
|
||||
#endif /* GECKO_EXCEPTIONPPC_H */
|
||||
@@ -0,0 +1,29 @@
|
||||
#ifndef _NMWEXCEPTION
|
||||
#define _NMWEXCEPTION
|
||||
|
||||
#include "Runtime.PPCEABI.H/__ppc_eabi_linker.h"
|
||||
#include <common.h>
|
||||
|
||||
|
||||
#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
|
||||
@@ -0,0 +1,6 @@
|
||||
#ifndef __INIT_CPP_EXCEPTIONS_H
|
||||
#define __INIT_CPP_EXCEPTIONS_H
|
||||
|
||||
#include <common.h>
|
||||
|
||||
#endif /* __INIT_CPP_EXCEPTIONS_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 */
|
||||
@@ -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
|
||||
@@ -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 <common.h>
|
||||
|
||||
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
|
||||
#endif /* __VA_ARG_H */
|
||||
@@ -0,0 +1,4 @@
|
||||
#ifndef GLOBAL_DESTRUCTOR_CHAIN_H
|
||||
#define GLOBAL_DESTRUCTOR_CHAIN_H
|
||||
|
||||
#endif /* GLOBAL_DESTRUCTOR_CHAIN_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 */
|
||||
@@ -0,0 +1,6 @@
|
||||
#ifndef RUNTIME_H
|
||||
#define RUNTIME_H
|
||||
|
||||
#include <common.h>
|
||||
|
||||
#endif /* RUNTIME_H */
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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 */
|
||||
@@ -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
|
||||
@@ -1,31 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include <common.h>
|
||||
|
||||
// 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 {
|
||||
|
||||
};
|
||||
class UnkCollider {};
|
||||
|
||||
+17
-9
@@ -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 <common.h>
|
||||
|
||||
/// @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.
|
||||
};
|
||||
cListNd_c *mpLast; ///< The last node in the list.
|
||||
};
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
#ifndef C_LIB_CMATH
|
||||
#define C_LIB_CMATH
|
||||
|
||||
#include <common.h>
|
||||
|
||||
namespace cM {
|
||||
static s16 atan2s(f32, f32);
|
||||
} // namespace cM
|
||||
|
||||
#endif
|
||||
+15
-8
@@ -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 <common.h>
|
||||
/// @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.
|
||||
};
|
||||
|
||||
+17
-9
@@ -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 <common.h>
|
||||
|
||||
/// @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.
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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
|
||||
@@ -1,24 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include "types.h"
|
||||
#include "rvl/MEM.h"
|
||||
#include "egg/core/eggHeap.h"
|
||||
#include "rvl/MEM.h"
|
||||
#include <common.h>
|
||||
|
||||
|
||||
// /* 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<MEMAllocator*>(this); }
|
||||
/* 0x14 */ Heap* mHeap;
|
||||
/* 0x18 */ s32 align;
|
||||
};
|
||||
};
|
||||
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<MEMAllocator *>(this);
|
||||
}
|
||||
/* 0x14 */ Heap *mHeap;
|
||||
/* 0x18 */ s32 align;
|
||||
};
|
||||
}; // namespace EGG
|
||||
|
||||
@@ -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 <common.h>
|
||||
|
||||
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
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "types.h"
|
||||
#include "egg/core/eggHeap.h"
|
||||
#include <common.h>
|
||||
|
||||
|
||||
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
|
||||
} // namespace EGG
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "types.h"
|
||||
#include "egg/core/eggDisplay.h"
|
||||
#include <common.h>
|
||||
|
||||
|
||||
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
|
||||
#endif
|
||||
|
||||
@@ -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 <common.h>
|
||||
|
||||
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<u8> 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);
|
||||
};
|
||||
|
||||
@@ -1,27 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
#include "types.h"
|
||||
#include <common.h>
|
||||
|
||||
#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<u8> 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<u8> 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<CoreController*> mControllers;
|
||||
/* 0x0014 */ TBuffer<CoreController *> mControllers;
|
||||
/* 0x0020 */ u8 field_0x20[0x10a4 - 0x0020];
|
||||
/* 0x10A4 */ TBuffer<eCoreDevType> 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<eCoreDevType>::allocate(int, int);
|
||||
// /* 8049a9a0 */ void TBuffer<eCoreDevType>::allocate(int, Heap*, int);
|
||||
// /* 8049aa20 */ void TBuffer<eCoreDevType>::onAllocate(Heap*);
|
||||
// /* 8049aa30 */ void TBuffer<CoreController*>::allocate(int, int);
|
||||
// /* 8049aa80 */ void TBuffer<CoreController*>::allocate(int, Heap*, int);
|
||||
// /* 8049ab00 */ void TBuffer<CoreController*>::onAllocate(Heap*);
|
||||
// /* 8049ab10 */ void sinit(); // NULL CONTROLLER
|
||||
|
||||
// Other Stuff thats autogen (buffers/sinit/etc)
|
||||
// /* 8049a950 */ void TBuffer<eCoreDevType>::allocate(int, int);
|
||||
// /* 8049a9a0 */ void TBuffer<eCoreDevType>::allocate(int, Heap*, int);
|
||||
// /* 8049aa20 */ void TBuffer<eCoreDevType>::onAllocate(Heap*);
|
||||
// /* 8049aa30 */ void TBuffer<CoreController*>::allocate(int, int);
|
||||
// /* 8049aa80 */ void TBuffer<CoreController*>::allocate(int, Heap*, int);
|
||||
// /* 8049ab00 */ void TBuffer<CoreController*>::onAllocate(Heap*);
|
||||
// /* 8049ab10 */ void sinit(); // NULL CONTROLLER
|
||||
};
|
||||
|
||||
} // namespace EGG
|
||||
|
||||
@@ -1,75 +1,82 @@
|
||||
#pragma once
|
||||
|
||||
#include "types.h"
|
||||
#include "rvl/CX/cx.h"
|
||||
#include <common.h>
|
||||
|
||||
|
||||
// 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;
|
||||
};
|
||||
|
||||
@@ -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 <common.h>
|
||||
|
||||
/* 80497530 */ // void PreRetraceCallback(void);
|
||||
|
||||
namespace EGG
|
||||
{
|
||||
namespace EGG {
|
||||
|
||||
class Display {
|
||||
public:
|
||||
enum EFlagBits { mFlag_SetClear, mFlag_WaitForRetrace };
|
||||
/* 0x00*/ TBitFlag<u8> 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;
|
||||
};
|
||||
|
||||
@@ -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 <common.h>
|
||||
|
||||
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
|
||||
|
||||
};
|
||||
}; // namespace EGG
|
||||
|
||||
@@ -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 <common.h>
|
||||
|
||||
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;
|
||||
|
||||
@@ -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 <common.h>
|
||||
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,29 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include "types.h"
|
||||
#include "egg/core/eggHeap.h"
|
||||
#include <common.h>
|
||||
|
||||
|
||||
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
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "types.h"
|
||||
#include <common.h>
|
||||
|
||||
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;
|
||||
|
||||
@@ -1,24 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
#include "types.h"
|
||||
#include <common.h>
|
||||
|
||||
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
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "types.h"
|
||||
#include "egg/core/eggHeap.h"
|
||||
#include <common.h>
|
||||
|
||||
|
||||
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
|
||||
} // namespace EGG
|
||||
|
||||
@@ -1,24 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#include "types.h"
|
||||
#include "egg/core/eggHeap.h"
|
||||
#include <common.h>
|
||||
|
||||
|
||||
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];
|
||||
};
|
||||
|
||||
|
||||
+119
-108
@@ -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 <common.h>
|
||||
|
||||
|
||||
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<u16> 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__Q23EGG12TBitFlag<Us>FUc
|
||||
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<u16> 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__Q23EGG12TBitFlag<Us>FUc
|
||||
HEAP_FLAG_LOCKED = (1 << 0)
|
||||
};
|
||||
|
||||
public:
|
||||
template <typename T> static T* alloc(u32 count, Heap* heap, int align = 4) {
|
||||
return reinterpret_cast<T*>(alloc(count * sizeof(T), align, heap));
|
||||
}
|
||||
template <typename T> static T* alloc(Heap* heap, int align = 4) {
|
||||
return reinterpret_cast<T*>(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<char*>(begin) + size;
|
||||
}
|
||||
template <typename T>
|
||||
static T *alloc(u32 count, Heap *heap, int align = 4) {
|
||||
return reinterpret_cast<T *>(alloc(count * sizeof(T), align, heap));
|
||||
}
|
||||
template <typename T>
|
||||
static T *alloc(Heap *heap, int align = 4) {
|
||||
return reinterpret_cast<T *>(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<char *>(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);
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include "types.h"
|
||||
#include "egg/core/eggHeap.h"
|
||||
#include <common.h>
|
||||
|
||||
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
|
||||
} // namespace EGG
|
||||
|
||||
@@ -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 <common.h>
|
||||
|
||||
|
||||
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
|
||||
} // namespace EGG
|
||||
|
||||
+11
-11
@@ -1,7 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "types.h"
|
||||
#include "rvl/OS.h"
|
||||
#include <common.h>
|
||||
|
||||
|
||||
// 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
|
||||
|
||||
+13
-10
@@ -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 <common.h>
|
||||
|
||||
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<u8> 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));
|
||||
|
||||
+11
-10
@@ -1,29 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include "types.h"
|
||||
#include "egg/core/eggHeap.h"
|
||||
#include <common.h>
|
||||
|
||||
|
||||
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);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include "types.h"
|
||||
#include "egg/core/eggXfb.h"
|
||||
#include <common.h>
|
||||
|
||||
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();
|
||||
};
|
||||
|
||||
+84
-82
@@ -1,93 +1,95 @@
|
||||
#pragma once
|
||||
|
||||
#include "types.h"
|
||||
#include <common.h>
|
||||
|
||||
// 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 <typename T> class Math;
|
||||
class Matrix33f;
|
||||
class Matrix34f;
|
||||
class Matrix44f;
|
||||
class Quatf;
|
||||
class Vector2f;
|
||||
class Vector3f;
|
||||
// math
|
||||
template <typename T>
|
||||
class Math;
|
||||
class Matrix33f;
|
||||
class Matrix34f;
|
||||
class Matrix44f;
|
||||
class Quatf;
|
||||
class Vector2f;
|
||||
class Vector3f;
|
||||
|
||||
// core
|
||||
class Allocator;
|
||||
class Archive;
|
||||
class AsyncDisplay;
|
||||
template <typename T> class IBinary;
|
||||
template <typename T> 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 <typename T>
|
||||
class IBinary;
|
||||
template <typename T>
|
||||
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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "types.h"
|
||||
#include <common.h>
|
||||
|
||||
namespace EGG {
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "egg/math/eggQuat.h"
|
||||
#include "egg/math/eggVector.h"
|
||||
#include "types.h"
|
||||
#include <common.h>
|
||||
|
||||
namespace EGG {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "egg/math/eggVector.h"
|
||||
#include "types.h"
|
||||
#include <common.h>
|
||||
|
||||
namespace EGG {
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "MSL_C/float.h"
|
||||
#include "egg/math/eggMath.h"
|
||||
#include "nw4r/math/vec.h"
|
||||
#include "types.h"
|
||||
#include <common.h>
|
||||
|
||||
namespace EGG {
|
||||
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include "types.h"
|
||||
#include <common.h>
|
||||
|
||||
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();
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
// Pulled from ogws
|
||||
|
||||
#include "types.h"
|
||||
#include <common.h>
|
||||
|
||||
namespace EGG
|
||||
{
|
||||
|
||||
template<typename T> class TBitFlag {
|
||||
namespace EGG {
|
||||
|
||||
template <typename T>
|
||||
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;
|
||||
|
||||
@@ -1,39 +1,43 @@
|
||||
#pragma once
|
||||
|
||||
#include "types.h"
|
||||
#include "egg/core/eggHeap.h"
|
||||
#include <common.h>
|
||||
|
||||
namespace EGG
|
||||
{
|
||||
|
||||
namespace EGG {
|
||||
|
||||
template <typename T>
|
||||
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
|
||||
|
||||
+54
-38
@@ -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 <common.h>
|
||||
|
||||
|
||||
// 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;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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 <common.h>
|
||||
|
||||
/// @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.
|
||||
};
|
||||
};
|
||||
|
||||
+11
-9
@@ -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 <common.h>
|
||||
|
||||
|
||||
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();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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 <common.h>
|
||||
|
||||
#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.
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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 <common.h>
|
||||
|
||||
|
||||
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;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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 <common.h>
|
||||
|
||||
|
||||
/// @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.
|
||||
};
|
||||
};
|
||||
|
||||
+710
-710
File diff suppressed because it is too large
Load Diff
@@ -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 <common.h>
|
||||
|
||||
|
||||
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;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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 <common.h>
|
||||
|
||||
|
||||
class fBase_c;
|
||||
|
||||
@@ -22,4 +24,4 @@ public:
|
||||
|
||||
private:
|
||||
int (fBase_c::*mpProcFunc)(); ///< The process function for the tree.
|
||||
};
|
||||
};
|
||||
|
||||
+11
-9
@@ -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 <common.h>
|
||||
|
||||
|
||||
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;
|
||||
};
|
||||
};
|
||||
|
||||
+4
-5
@@ -1,11 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "types.h"
|
||||
#include <common.h>
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
+6
-5
@@ -1,18 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include "types.h"
|
||||
#include <common.h>
|
||||
|
||||
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;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include "types.h"
|
||||
#include <common.h>
|
||||
|
||||
class mFrustum_c {
|
||||
|
||||
};
|
||||
class mFrustum_c {};
|
||||
|
||||
@@ -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
|
||||
+28
-17
@@ -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 <common.h>
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
+104
-30
@@ -1,83 +1,157 @@
|
||||
#pragma once
|
||||
|
||||
#include "types.h"
|
||||
#include "rvl/MTX.h"
|
||||
#include "egg/math/eggVector.h"
|
||||
#include "rvl/MTX.h"
|
||||
#include <common.h>
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
};
|
||||
|
||||
+27
-30
@@ -1,7 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include <common.h>
|
||||
|
||||
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 <typename T> // types are from EGG::StreamDecomp[LH/LRC/RL/LZ]
|
||||
class TUncompressedInfo_c;
|
||||
template <typename T> // types are from EGG::StreamDecomp[LH/LRC/RL/LZ]
|
||||
class TUncompressedInfo_c;
|
||||
|
||||
} // namespace mDvd
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "types.h"
|
||||
#include <Runtime/__va_arg.h>
|
||||
#include <Runtime.PPCEABI.H/__va_arg.h>
|
||||
#include <common.h>
|
||||
#include <rvl/GX.h>
|
||||
|
||||
namespace nw4r {
|
||||
|
||||
@@ -1,18 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include "types.h"
|
||||
#include <common.h>
|
||||
|
||||
namespace nw4r {
|
||||
namespace g3d {
|
||||
namespace g3d {
|
||||
|
||||
struct ResFileData {
|
||||
struct ResFileData {};
|
||||
|
||||
};
|
||||
struct ResFile {
|
||||
/* data */
|
||||
};
|
||||
|
||||
struct ResFile
|
||||
{
|
||||
/* data */
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
}; // namespace g3d
|
||||
}; // namespace nw4r
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
#ifndef NW4R_MATH_ARITHMETIC_H
|
||||
#define NW4R_MATH_ARITHMETIC_H
|
||||
|
||||
#include <nw4r/nw4r_types.h>
|
||||
#include <rvl/OS.h>
|
||||
#include <MSL_C/math.h>
|
||||
|
||||
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
|
||||
+181
-193
@@ -1,197 +1,185 @@
|
||||
#pragma once
|
||||
namespace nw4r {
|
||||
namespace ut {
|
||||
template <typename T>
|
||||
struct TextWriterBase;
|
||||
template <typename T>
|
||||
struct TagProcessorBase;
|
||||
|
||||
#include "types.h"
|
||||
struct Color;
|
||||
struct FileStream;
|
||||
|
||||
namespace nw4r
|
||||
{
|
||||
namespace ut
|
||||
{
|
||||
template <typename T> struct TextWriterBase;
|
||||
template <typename T> 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 <typename T> 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 <typename T>
|
||||
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
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include "types.h"
|
||||
#include "rvl/GX.h"
|
||||
#include <common.h>
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
};
|
||||
|
||||
+16
-16
@@ -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 <common.h>
|
||||
|
||||
// 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);
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
#ifndef RVL_SDK_AI_H
|
||||
#define RVL_SDK_AI_H
|
||||
#include "rvl/types.h"
|
||||
#include <common.h>
|
||||
#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
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef RVL_SDK_AI_HARDWARE_H
|
||||
#define RVL_SDK_AI_HARDWARE_H
|
||||
#include "rvl/types.h"
|
||||
#include <common.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
+22
-23
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
#ifndef RVL_SDK_ARC_H
|
||||
#define RVL_SDK_ARC_H
|
||||
#include "rvl/types.h"
|
||||
#include <common.h>
|
||||
#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
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef RVL_SDK_PPC_ARCH_H
|
||||
#define RVL_SDK_PPC_ARCH_H
|
||||
#include "rvl/types.h"
|
||||
#include <common.h>
|
||||
#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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef RVL_SDK_CARD_H
|
||||
#define RVL_SDK_CARD_H
|
||||
#include "rvl/types.h"
|
||||
#include <common.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef RVL_SDK_CNT_H
|
||||
#define RVL_SDK_CNT_H
|
||||
#include "rvl/ARC.h"
|
||||
#include "rvl/types.h"
|
||||
#include <common.h>
|
||||
#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
|
||||
}
|
||||
|
||||
+16
-17
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "types.h"
|
||||
#include <common.h>
|
||||
|
||||
// .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
|
||||
#endif
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
#ifndef RVL_SDK_DB_H
|
||||
#define RVL_SDK_DB_H
|
||||
#include "rvl/types.h"
|
||||
#include <common.h>
|
||||
#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
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef RVL_SDK_DSP_H
|
||||
#define RVL_SDK_DSP_H
|
||||
#include "rvl/types.h"
|
||||
#include <common.h>
|
||||
#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
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#ifndef RVL_SDK_DSP_DEBUG_H
|
||||
#define RVL_SDK_DSP_DEBUG_H
|
||||
#include "rvl/types.h"
|
||||
#include <common.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void __DSP_debug_printf(const char* fmt, ...);
|
||||
void __DSP_debug_printf(const char *fmt, ...);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef RVL_SDK_DSP_HARDWARE_H
|
||||
#define RVL_SDK_DSP_HARDWARE_H
|
||||
#include "rvl/types.h"
|
||||
#include <common.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
+16
-16
@@ -1,6 +1,6 @@
|
||||
#ifndef RVL_SDK_DSP_TASK_H
|
||||
#define RVL_SDK_DSP_TASK_H
|
||||
#include "rvl/types.h"
|
||||
#include <common.h>
|
||||
#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
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef RVL_SDK_DVD_H
|
||||
#define RVL_SDK_DVD_H
|
||||
#include "rvl/types.h"
|
||||
#include <common.h>
|
||||
#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
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef RVL_SDK_DVD_BROADWAY_H
|
||||
#define RVL_SDK_DVD_BROADWAY_H
|
||||
#include "rvl/types.h"
|
||||
#include <common.h>
|
||||
#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
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef RVL_SDK_DVD_FATAL_H
|
||||
#define RVL_SDK_DVD_FATAL_H
|
||||
#include "rvl/types.h"
|
||||
#include <common.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
+12
-14
@@ -1,39 +1,37 @@
|
||||
#ifndef RVL_SDK_DVD_FS_H
|
||||
#define RVL_SDK_DVD_FS_H
|
||||
#include "rvl/types.h"
|
||||
#include <common.h>
|
||||
#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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef RVL_SDK_DVD_ID_UTILS_H
|
||||
#define RVL_SDK_DVD_ID_UTILS_H
|
||||
#include "rvl/types.h"
|
||||
#include <common.h>
|
||||
#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
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user