remove address comments

This commit is contained in:
elijah-thomas774
2025-09-16 22:26:16 -04:00
parent 0a2b38da2b
commit e3b5103cbe
60 changed files with 805 additions and 1097 deletions
+28 -27
View File
@@ -4,6 +4,7 @@
#include "common.h"
#include "m/m_dvd.h"
#include "nw4r/db/db_mapFile.h"
#include "rvl/OS.h" // IWYU pragma: export
class DbMapFile {
@@ -28,20 +29,20 @@ struct DynamicModuleControlBase {
/* 0x08 */ DynamicModuleControlBase *mNext;
/* 0x0C */ /*vtable*/
/* 802df100 */ virtual ~DynamicModuleControlBase();
/* 802df340 */ virtual const char *getModuleName() const;
/* 802df350 */ virtual int getModuleSize() const;
/* 802df360 */ virtual const char *getModuleTypeString() const;
/* 802df370 */ virtual void dump();
/* 802df380 */ virtual bool do_load();
/* 802df390 */ virtual BOOL do_load_async();
/* 802df3a0 */ virtual bool do_unload();
/* 802df3b0 */ virtual BOOL do_link();
/* 802df3c0 */ virtual bool do_unlink();
/* 802df1a0 */ DynamicModuleControlBase();
/* 802df1f0 */ BOOL link();
/* 802df290 */ BOOL unlink();
/* 802df310 */ BOOL load_async();
virtual ~DynamicModuleControlBase();
virtual const char *getModuleName() const;
virtual int getModuleSize() const;
virtual const char *getModuleTypeString() const;
virtual void dump();
virtual bool do_load();
virtual BOOL do_load_async();
virtual bool do_unload();
virtual BOOL do_link();
virtual bool do_unlink();
DynamicModuleControlBase();
BOOL link();
BOOL unlink();
BOOL load_async();
static inline DynamicModuleControlBase *getFirstClass() {
return mFirst;
@@ -58,19 +59,19 @@ struct DynamicModuleControlBase {
};
struct DynamicModuleControl : DynamicModuleControlBase {
/* 802df4c0 */ virtual const char *getModuleName() const;
/* 802df450 */ virtual ~DynamicModuleControl();
/* 802dfb10 */ virtual int getModuleSize() const;
/* 802dfb70 */ virtual const char *getModuleTypeString() const;
/* 802df800 */ virtual void dump();
/* 802df5d0 */ virtual bool do_load();
/* 802df710 */ virtual BOOL do_load_async();
/* 802df7a0 */ virtual bool do_unload();
/* 802df810 */ virtual BOOL do_link();
/* 802dfa60 */ virtual bool do_unlink();
/* 802df3d0 */ DynamicModuleControl(char const *, EGG::ExpHeap *);
/* 802df4d0 */ static void initialize(EGG::ExpHeap *heap);
/* 802df530 */ static void *callback(void *);
virtual const char *getModuleName() const;
virtual ~DynamicModuleControl();
virtual int getModuleSize() const;
virtual const char *getModuleTypeString() const;
virtual void dump();
virtual bool do_load();
virtual BOOL do_load_async();
virtual bool do_unload();
virtual BOOL do_link();
virtual bool do_unlink();
DynamicModuleControl(char const *, EGG::ExpHeap *);
static void initialize(EGG::ExpHeap *heap);
static void *callback(void *);
void checkHeapStatus();
/* 0x10 */ UNKWORD unk_16;
+1 -2
View File
@@ -28,8 +28,7 @@ protected:
class cListMg_c {
public:
/* 802e2be0 */ cListMg_c() : mpFirst(nullptr), mpLast(nullptr) {}
// /* 802e2880 */ ~cListMg_c();
cListMg_c() : mpFirst(nullptr), mpLast(nullptr) {}
void insertAfter(cListNd_c *node, cListNd_c *prevNode);
+3 -4
View File
@@ -16,10 +16,8 @@ enum dArcResult_e {
class ArcCallbackHandlerBase {
public:
ArcCallbackHandlerBase() : mPrefix(' ') {}
/* vtable at 8050df50 */
/** 800651c0 */
virtual void CreateArcEntry(void *data, const char *path);
/** 800653d0 */
virtual void DestroyArcEntry(const char *path);
u32 mPrefix;
@@ -46,7 +44,8 @@ public:
static BOOL checkArcExistsOnDisk(const char *fileName, const char *dirName);
static BOOL checkArcExistsOnDiskInner(SizedString<128> &path, const char *fileName, const char *dirName);
dArcResult_e mount(const char *name, void *data, ArcCallbackHandler *callbackArg, u8 mountDirection, EGG::Heap *heap);
dArcResult_e
mount(const char *name, void *data, ArcCallbackHandler *callbackArg, u8 mountDirection, EGG::Heap *heap);
dArcResult_e onMount(void *callbackArg);
dArcResult_e ensureLoadedMaybe(void *callbackArg);
+5 -6
View File
@@ -17,7 +17,7 @@
class dRoomTable_c {
public:
/* 801b4670 */ dRoomTable_c();
dRoomTable_c();
virtual ~dRoomTable_c() {}
void setRoom(int roomid, dRoom_c *room) {
@@ -33,7 +33,7 @@ private:
};
class MapRelated {
friend class dStage_c;
friend class dStage_c;
struct Child {
Child() : a(mVec3_c::Zero), b(mVec3_c::Zero), c(false) {}
~Child() {}
@@ -74,8 +74,8 @@ public:
/* 0x1F0 */ u8 field_0x1F0;
public:
/* 801b4780 */ void init(MapRelated *);
/* 801b4900 */ void fn_801b4900();
void init(MapRelated *);
void fn_801b4900();
void fn_801B4B80(u32 mapParams, const mVec3_c &center, const mVec3_c &size);
void fn_801B4C70(const mVec3_c &);
void fn_801B50C0(s32);
@@ -114,7 +114,6 @@ public:
bool hasVisitedRoom(int roomid) const;
void setRoomVisited(int roomid);
static void bindStageResToFile(nw4r::g3d::ResFile *file);
static void bindSkyCmnToResFile(nw4r::g3d::ResFile *file);
static bool getMA0AnmTexSrt(nw4r::g3d::ResAnmTexSrt *, const char *matName);
@@ -160,7 +159,7 @@ private:
/* 0x039C */ u32 loaded_entities[2047];
/* 0x2398 */ s8 curr_room_id;
/* 80575760 */ static dStage_c *sInstance;
static dStage_c *sInstance;
};
#endif
+3 -1
View File
@@ -4,15 +4,17 @@
// This file was adapted from https://github.com/riidefi/mkw/blob/master/source/egg/core/eggDisposer.hpp
#include "common.h"
#include "nw4r/ut.h"
namespace EGG {
class Heap;
class Disposer : private NonCopyable {
public:
/* vt 0x08 */ virtual ~Disposer();
/* 80496830 */ Disposer();
Disposer();
public:
enum eLifetime {
+4 -6
View File
@@ -4,7 +4,6 @@
#include "common.h"
#include "rvl/CX/cx.h"
// NOTE: I put StreamDecomp stuff here. im unsure of the correct place
namespace EGG {
@@ -80,11 +79,10 @@ public:
// NON-OFFICIAL
struct UncompContextSZS {
/* 80494e00 */ static u32 getUncompressedSize(const void *pSrc);
/* 80494e30 */ void initUncompContext(void *pDest);
/* 80494e60 */ static s32
readHeader(u8 *pHeaderLen, s32 *pUncompSize, const u8 *src, u32 maxCompLen, s32 maxUncompSize);
/* 80494f60 */ s32 readUncomp(const void *pSrca, u32 len);
static u32 getUncompressedSize(const void *pSrc);
void initUncompContext(void *pDest);
static s32 readHeader(u8 *pHeaderLen, s32 *pUncompSize, const u8 *src, u32 maxCompLen, s32 maxUncompSize);
s32 readUncomp(const void *pSrca, u32 len);
/* 0x00 */ u8 *mpDest;
/* 0x04 */ s32 mUncompSize;
+5 -5
View File
@@ -2,8 +2,8 @@
#define EGG_UNK_H
#include "common.h"
#include "rvl/OS.h" // IWYU pragma: export
#include "rvl/OS.h" // IWYU pragma: export
// This is seen in Animal Crossing: City Folk also. Idk where it belongs
@@ -15,10 +15,10 @@ 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 *);
void fn_80496de0(OSThread *);
void fn_80496e30(OSThread *);
void fn_80496f10();
void fn_804970e0(OSThread *, u8 *);
};
} // namespace EGG
+16 -16
View File
@@ -31,22 +31,22 @@ struct Quatf {
return Quatf(lhs.w * rhs.w - lhs.v.dot(rhs.v), tmp1);
}
/* 8049b390 */ void set(f32 fw, f32 fx, f32 fy, f32 fz);
/* */ void set(f32 f, const Vector3f &vec);
/* */ void setRPY(const EGG::Vector3f &rpy);
/* */ Vector3f calcRPY();
/* */ void setRPY(f32 roll, f32 pitch, f32 yaw);
/* 8049b3b0 */ void setAxisRotation(const Vector3f &, f32);
/* 8049b450 */ f32 norm();
/* 8049b480 */ void normalise();
/* 8049b500 */ Quatf conjugate() const;
/* */ Quatf inverse();
/* 8049b550 */ Vector3f rotateVector(const Vector3f &);
/* */ Vector3f rotateVectorInv(const Vector3f &);
/* 8049b800 */ void slerpTo(const Quatf &, f32, Quatf &out) const;
/* 8049b800 */ void limitSlerpTo(const Quatf &, f32, f32, Quatf &out) const;
/* */ void makeVectorRotationLimit(Vector3f &, Vector3f &, f32);
/* 8049bbb0 */ void makeVectorRotation(const Vector3f &, const Vector3f &);
void set(f32 fw, f32 fx, f32 fy, f32 fz);
void set(f32 f, const Vector3f &vec); // not in SS
void setRPY(const EGG::Vector3f &rpy); // not in SS
Vector3f calcRPY(); // not in SS
void setRPY(f32 roll, f32 pitch, f32 yaw); // not in SS
void setAxisRotation(const Vector3f &, f32);
f32 norm();
void normalise();
Quatf conjugate() const;
Quatf inverse(); // not in SS
Vector3f rotateVector(const Vector3f &);
Vector3f rotateVectorInv(const Vector3f &); // not in SS
void slerpTo(const Quatf &, f32, Quatf &out) const;
void limitSlerpTo(const Quatf &, f32, f32, Quatf &out) const;
void makeVectorRotationLimit(Vector3f &, Vector3f &, f32); // not in SS
void makeVectorRotation(const Vector3f &, const Vector3f &);
void multScalar(f32 s) {
w *= s;
+2 -3
View File
@@ -10,7 +10,6 @@
#include "f/f_list_nd.h"
#include "f/f_profile.h"
class fBase_c;
/// @brief A list of fLiNdBa_c nodes.
@@ -25,8 +24,8 @@ public:
*/
int countNodeByProfName(ProfileName profName) const;
/* 802e2760 */ const fLiNdBa_c *searchNodeByID(fBaseID_e id) const;
/* 802e2790 */ const fLiNdBa_c *searchNodeByProfName(ProfileName name, fLiNdBa_c *start) const;
const fLiNdBa_c *searchNodeByID(fBaseID_e id) const;
const fLiNdBa_c *searchNodeByProfName(ProfileName name, fLiNdBa_c *start) const;
inline fLiNdBa_c *getFirst() const {
return (fLiNdBa_c *)cListMg_c::getFirst();
+2 -3
View File
@@ -8,7 +8,6 @@
#include "f/f_list_mg.h"
#include "f/f_list_nd_prio.h"
class fBase_c;
/// @brief A list of fLiNdPrio_c nodes with a reference to a process function.
@@ -16,8 +15,8 @@ class fBase_c;
class fLiMgPTMF_c : public fLiMgBa_c {
public:
fLiMgPTMF_c(int (fBase_c::*procFunc)()) : mpProcFunc(procFunc) {}
/* 802e2680 */ void addNode(fLiNdPrio_c *node);
/* 802e26e0 */ bool walkPack();
void addNode(fLiNdPrio_c *node);
bool walkPack();
fLiNdPrio_c *getFirst() const {
return (fLiNdPrio_c *)fLiMgBa_c::getFirst();
+2 -2
View File
@@ -22,8 +22,8 @@ public:
return (fLiNdBa_c *)cListNd_c::getNext();
}
/* 802e27d0 */ void link(fBase_c *);
/* 802e2830 */ void unlink();
void link(fBase_c *);
void unlink();
fBase_c *p_owner;
};
+21 -14
View File
@@ -19,7 +19,14 @@ class fBase_c;
class fManager_c {
public:
enum LOOP_PROC_e { NOTHING, CONNECT, CREATE, EXECUTE, DELETE, DRAW };
enum LOOP_PROC_e {
NOTHING,
CONNECT,
CREATE,
EXECUTE,
DELETE,
DRAW
};
enum PROC_FLAGS {
PROC_FLAG_CONNECT = GET_PROC_FLAG(CONNECT),
@@ -30,11 +37,11 @@ public:
};
fManager_c(fBase_c *owner) : connect_node(owner), execute_node(owner), draw_node(owner), search_node(owner) {}
~fManager_c() {}
/* 802e28c0 */ int getSearchTableNum();
/* 802e28d0 */ static fBase_c *searchBaseByID(fBaseID_e id);
/* 802e2920 */ static fBase_c *searchBaseByProfName(ProfileName profID, const fBase_c *parent);
/* 802e2980 */ static fBase_c *searchBaseByGroupType(u8 groupType, const fBase_c *parent);
/* 802e29e0 */ static void mainLoop();
int getSearchTableNum();
static fBase_c *searchBaseByID(fBaseID_e id);
static fBase_c *searchBaseByProfName(ProfileName profID, const fBase_c *parent);
static fBase_c *searchBaseByGroupType(u8 groupType, const fBase_c *parent);
static void mainLoop();
private:
fTrNdBa_c connect_node; ///< The node in ::m_connectManage.
@@ -42,16 +49,16 @@ private:
fLiNdPrio_c draw_node; ///< The node in ::m_drawManage.
fLiNdBa_c search_node; ///< The node in ::m_searchManage.
/* 805b84d8 */ static fTrMgPTMF_c m_connectManage; ///< A tree that connects all loaded bases.
/* 805b84e8 */ static fLiMgPTMF_c m_createManage; ///< A list of all the bases scheduled for creation.
/* 805b84fc */ static fLiMgPTMF_c m_executeManage; ///< A list of all the bases scheduled for execution.
/* 805b8510 */ static fLiMgPTMF_c m_drawManage; ///< A list of all the bases scheduled for drawing.
/* 805b8524 */ static fLiMgPTMF_c m_deleteManage; ///< A list of all the bases scheduled for deletion.
static fTrMgPTMF_c m_connectManage; ///< A tree that connects all loaded bases.
static fLiMgPTMF_c m_createManage; ///< A list of all the bases scheduled for creation.
static fLiMgPTMF_c m_executeManage; ///< A list of all the bases scheduled for execution.
static fLiMgPTMF_c m_drawManage; ///< A list of all the bases scheduled for drawing.
static fLiMgPTMF_c m_deleteManage; ///< A list of all the bases scheduled for deletion.
/* 805b8548 */ static fLiMgBa_c m_searchManage[8];
static fLiMgBa_c m_searchManage[8];
/* 80575bb8 */ static u32 m_StopProcInf; ///< Which processes should be executed this frame.
/* 80573fc0 */ static LOOP_PROC_e m_nowLoopProc; ///< The process ::mainLoop is currently in.
static u32 m_StopProcInf; ///< Which processes should be executed this frame.
static LOOP_PROC_e m_nowLoopProc; ///< The process ::mainLoop is currently in.
friend class fBase_c;
};
+28 -29
View File
@@ -1,6 +1,7 @@
#ifndef M_HEAP_H
#define M_HEAP_H
#include "common.h"
#include "egg/core/eggExpHeap.h"
#include "egg/core/eggFrmHeap.h"
@@ -24,35 +25,33 @@ public:
OPT_4 = 0x4,
};
/* 802f0f00 */ static u16 GetOptFlag(AllocOptBit_t);
/* 802f0f40 */ static EGG::Heap *setCurrentHeap(EGG::Heap *);
/* 802f0f50 */ static EGG::Heap *createExpHeap(size_t size, EGG::Heap *parentHeap, const char *name, u32 align,
AllocOptBit_t attrs);
/* 802f1060 */ static size_t adjustExpHeap(EGG::ExpHeap *heap);
/* 802f10d0 */ static size_t expHeapCost(size_t start, u32 size);
/* 802f10f0 */ static EGG::FrmHeap *createFrmHeap(size_t size, EGG::Heap *parentHeap, const char *name,
size_t align, AllocOptBit_t attrs);
/* 802f1200 */ static void destroyFrmHeap(EGG::FrmHeap *heap);
/* 802f1220 */ static size_t adjustFrmHeap(EGG::FrmHeap *heap);
/* 802f1290 */ static size_t frmHeapCost(size_t start, u32 size);
mHeap() {
heap = nullptr;
}
/* 802f12b0 */ mHeap(EGG::Heap *heap);
/* 802f12f0 */ ~mHeap();
/* 802f1350 */ static EGG::ExpHeap *createHeap(size_t size, EGG::Heap *, const char *name);
/* 802f13d0 */ static void saveCurrentHeap();
/* 802f13e0 */ static void restoreCurrentHeap();
/* 802f1410 */ static EGG::FrmHeap *createFrmHeapToCurrent(size_t size, EGG::Heap *parentHeap, const char *name,
u32 align, AllocOptBit_t attrs);
/* 802f1450 */ static int getGameHeapNum();
/* 802f1460 */ static EGG::Heap *createGameHeap(int heapNum, size_t size, EGG::Heap *parentHeap);
/* 802f1510 */ static void createGameHeap1(size_t size, EGG::Heap *parentHeap);
/* 802f1560 */ static void createArchiveHeap(size_t size, EGG::Heap *parentHeap);
/* 802f1590 */ static void createCommandHeap(size_t size, EGG::Heap *parentHeap);
/* 802f15c0 */ static void createDylinkHeap(size_t size, EGG::Heap *parentHeap);
/* 802f15f0 */ static EGG::AssertHeap *createAssertHeap(EGG::Heap *parentHeap);
/* 802f1640 */ static EGG::FrmHeap *makeHeapOnCurrentGameHeap(size_t size, const char *name, u32 align, AllocOptBit_t flags);
static u16 GetOptFlag(AllocOptBit_t);
static EGG::Heap *setCurrentHeap(EGG::Heap *);
static EGG::Heap *
createExpHeap(size_t size, EGG::Heap *parentHeap, const char *name, u32 align, AllocOptBit_t attrs);
static size_t adjustExpHeap(EGG::ExpHeap *heap);
static size_t expHeapCost(size_t start, u32 size);
static EGG::FrmHeap *
createFrmHeap(size_t size, EGG::Heap *parentHeap, const char *name, size_t align, AllocOptBit_t attrs);
static void destroyFrmHeap(EGG::FrmHeap *heap);
static size_t adjustFrmHeap(EGG::FrmHeap *heap);
static size_t frmHeapCost(size_t start, u32 size);
mHeap() : heap(nullptr) {}
mHeap(EGG::Heap *heap);
~mHeap();
static EGG::ExpHeap *createHeap(size_t size, EGG::Heap *, const char *name);
static void saveCurrentHeap();
static void restoreCurrentHeap();
static EGG::FrmHeap *
createFrmHeapToCurrent(size_t size, EGG::Heap *parentHeap, const char *name, u32 align, AllocOptBit_t attrs);
static int getGameHeapNum();
static EGG::Heap *createGameHeap(int heapNum, size_t size, EGG::Heap *parentHeap);
static void createGameHeap1(size_t size, EGG::Heap *parentHeap);
static void createArchiveHeap(size_t size, EGG::Heap *parentHeap);
static void createCommandHeap(size_t size, EGG::Heap *parentHeap);
static void createDylinkHeap(size_t size, EGG::Heap *parentHeap);
static EGG::AssertHeap *createAssertHeap(EGG::Heap *parentHeap);
static EGG::FrmHeap *makeHeapOnCurrentGameHeap(size_t size, const char *name, u32 align, AllocOptBit_t flags);
static int getDefaultGameHeapId();
+19 -18
View File
@@ -3,6 +3,7 @@
#include "__va_arg.h"
#include "common.h"
#include "rvl/GX.h" // IWYU pragma: export
namespace nw4r {
@@ -30,32 +31,32 @@ struct YUVColorInfo {
/* 0x12 */ u16 reserved;
};
/* 804342a0 */ void DirectPrint_Init();
/* 80434360 */ bool DirectPrint_IsActive();
/* 80434390 */ void DirectPrint_EraseXfb(int posh, int posv, int sizeh, int sizev);
/* */ void DirectPrint_ChangeXfb(void *framBuf);
/* 80434520 */ void DirectPrint_ChangeXfb(void *framBuf, u16 width, u16 height);
/* 80434560 */ void DirectPrint_StoreCache();
/* 80434580 */ void DirectPrint_Printf(int posh, int posv, const char *format, ...);
/* 80434650 */ void DirectPrint_printfsub(
void DirectPrint_Init();
bool DirectPrint_IsActive();
void DirectPrint_EraseXfb(int posh, int posv, int sizeh, int sizev);
void DirectPrint_ChangeXfb(void *framBuf);
void DirectPrint_ChangeXfb(void *framBuf, u16 width, u16 height);
void DirectPrint_StoreCache();
void DirectPrint_Printf(int posh, int posv, const char *format, ...);
void DirectPrint_printfsub(
int posh, int posv, const char *format,
__va_list_struct *args
); // ????? Not from a symbol, needs the arg?
/* */ void DirectPrint_Printf(int posh, int posv, bool turnOver, const char *format, ...);
/* */ void DirectPrint_DrawString(int posh, int posv, const char *format, ...);
/* 804346c0 */ void DirectPrint_DrawString(int posh, int posv, bool turnOver, const char *format, ...);
/* */ void DirectPrint_SetColor(GXColor color);
/* inlined */ void DirectPrint_SetColor(u8 r, u8 g, u8 b);
/* */ GXColor DirectPrint_GetColor();
void DirectPrint_Printf(int posh, int posv, bool turnOver, const char *format, ...);
void DirectPrint_DrawString(int posh, int posv, const char *format, ...);
void DirectPrint_DrawString(int posh, int posv, bool turnOver, const char *format, ...);
void DirectPrint_SetColor(GXColor color);
void DirectPrint_SetColor(u8 r, u8 g, u8 b);
GXColor DirectPrint_GetColor();
namespace detail {
/* inlined */ void DirectPrint_DrawStringToXfb(
void DirectPrint_DrawStringToXfb(
int posh, int posv, const char *format, __va_list_struct *args, bool turnover, bool backErase
);
/* local */ void WaitVIRetrace_();
void WaitVIRetrace_();
/* local */ void *CreateFB_(const _GXRenderModeObj *rmode);
/* 80434cb0 */ void *DirectPrint_SetupFB(const _GXRenderModeObj *rmode);
void *CreateFB_(const _GXRenderModeObj *rmode);
void *DirectPrint_SetupFB(const _GXRenderModeObj *rmode);
} // namespace detail
+14 -14
View File
@@ -48,20 +48,20 @@ typedef struct CXUncompContextLRC {
u8 _[0x902C];
} CXUncompContextLRC;
/* 803cee90 */ void CXInitUncompContextRL(CXUncompContextRL *);
/* 803ceec0 */ void CXInitUncompContextLZ(CXUncompContextLZ *);
/* 803cef00 */ s32 CXReadUncompRL(CXUncompContextRL *, const void *, u32);
/* 803cf1b0 */ s32 CXReadUncompLZ(CXUncompContextLZ *, const void *, u32);
/* 803cf570 */ void CXInitUncompContextLH(CXUncompContextLH *);
/* 803cf5b0 */ s32 CXReadUncompLH(CXUncompContextLH *, const void *, u32);
/* 803cfda0 */ void RCAddCount_();
/* 803cff90 */ void RCSearch_();
/* 803d0030 */ void RCGetData_();
/* 803d0140 */ void CXInitUncompContextLRC(CXUncompContextLRC *);
/* 803d0390 */ s32 CXReadUncompLRC(CXUncompContextLRC *, const void *, u32);
/* 803d0790 */ u32 CXGetUncompressedSize(const void *);
/* 803d07d0 */ void CXUncompressLZ();
/* 803d0920 */ void CXiLHVerifyTable();
void CXInitUncompContextRL(CXUncompContextRL *);
void CXInitUncompContextLZ(CXUncompContextLZ *);
s32 CXReadUncompRL(CXUncompContextRL *, const void *, u32);
s32 CXReadUncompLZ(CXUncompContextLZ *, const void *, u32);
void CXInitUncompContextLH(CXUncompContextLH *);
s32 CXReadUncompLH(CXUncompContextLH *, const void *, u32);
void RCAddCount_();
void RCSearch_();
void RCGetData_();
void CXInitUncompContextLRC(CXUncompContextLRC *);
s32 CXReadUncompLRC(CXUncompContextLRC *, const void *, u32);
u32 CXGetUncompressedSize(const void *);
void CXUncompressLZ();
void CXiLHVerifyTable();
#ifdef __cplusplus
}
+1 -1
View File
@@ -7,7 +7,7 @@ extern "C" {
void GXDrawCylinder(u8 sides);
void GXDrawSphere(u32 stacks, u32 sectors);
/* 803bcdb0 */ void GXDrawDone();
void GXDrawDone();
#ifdef __cplusplus
}
#endif
+46 -46
View File
@@ -1,8 +1,8 @@
#ifndef RVL_SDK_VI_H
#define RVL_SDK_VI_H
#include "common.h"
#include "rvl/GX.h" // IWYU pragma: export
#include "rvl/GX.h" // IWYU pragma: export
#ifdef __cplusplus
extern "C" {
@@ -42,51 +42,51 @@ typedef enum VIXfbMode {
typedef void (*VIRetraceCallback)(u32 retraceCount);
typedef void (*VIPositionCallback)(s16 displayX, s16 displayY);
/* */ void getEncoderType();
/* 803b34a0 */ void OnShutdown(); // ret unk, params unk
/* */ void cntlzd(); // ret unk, params unk
/* */ void VISetRegs(); // ret unk, params unk
/* 803b3640 */ void __VIRetraceHandler(); // ret unk,params unk
/* 803b3e50 */ VIRetraceCallback VISetPreRetraceCallback(VIRetraceCallback callback); // good
/* 803b3ea0 */ VIRetraceCallback VISetPostRetraceCallback(VIRetraceCallback callback); // good
/* */ void __VISetExtraTiming(); // ret unk, params unk
/* 803b3ef0 */ void getTiming(); // ret unk, params unk
/* 803b4010 */ void __VIInit(u32); // ret unk, params unk
/* */ void AdjustPosition(); // ret unk, params unk
/* */ void ImportAdjustingValues(); // ret unk, params unk
/* 803b4210 */ void VIInit(void); // good
/* 803b4760 */ void VIWaitForRetrace(void); // good
/* */ void setInterruptRegs(); // ret unk, params unk
/* */ void setPicConfig(); // ret unk, params unk
/* */ void setBBIntervalRegs(); // ret unk, params unk
/* */ void setScalingRegs(); // ret unk, params unk
/* */ void calcFbbs(); // ret unk, params unk
/* 803b47c0? */ void setFbbRegs(); // params unk
/* 803b4a70? */ void setHorizontalRegs(); // params unk
/* 803b4b50? */ void setVerticalRegs(); // params unk
/* 803b4cf0 */ void VIConfigure(const GXRenderModeObj *rmo); // good
/* 803b53c0 */ void VIConfigurePan(u16 x, u16 y, u16 w, u16 h); // good
/* 803b5720 */ void VIFlush(); // good
/* 803b5840 */ void VISetNextFrameBuffer(void *fb); // good
/* */ void VIGetNextFrameBuffer(); // ret unk, params unk
/* 803b58b0 */ void *VIGetCurrentFrameBuffer(); // good
/* */ void VISetNextRightFrameBuffer(); // ret unk, params unk
/* 803b58c0 */ void VISetBlack(BOOL black); // good
/* */ void VISet3D(); // ret unk, params unk
/* 803b5940 */ s32 VIGetRetraceCount(void); // good
/* 803b5950 */ u32 VIGetNextField(); // ret unk
/* 803b59f0 */ u32 VIGetCurrentLine(); // ret unk
/* 803b5a80 */ VITvFormat VIGetTvFormat(void); // good
/* */ VIScanMode VIGetScanMode(void); // good
/* 803b5ae0 */ int VIGetDTVStatus(); // ret unk
/* */ void VIGetVSyncTimingTest(); // ret, params unk
/* */ void VISetVSyncTimingTest(); // ret, params unk
/* */ void VIGetDimmingCount(); // ret, params unk
/* */ void VIGetDVDStopMotorCount(); // ret, params unk
/* 803b5d60 */ int VIEnableDimming(int); // ret unk, params unk
/* 803b5dc0 */ int VISetTimeToDimming(int); // ret unk, params unk
/* 803b5ec0 */ int VIResetDimmingCount(); // ret unk
/* */ void VIEnableDVDStopMotor(); // ret, params unk
void getEncoderType();
void OnShutdown(); // ret unk, params unk
void cntlzd(); // ret unk, params unk
void VISetRegs(); // ret unk, params unk
void __VIRetraceHandler(); // ret unk,params unk
VIRetraceCallback VISetPreRetraceCallback(VIRetraceCallback callback); // good
VIRetraceCallback VISetPostRetraceCallback(VIRetraceCallback callback); // good
void __VISetExtraTiming(); // ret unk, params unk
void getTiming(); // ret unk, params unk
void __VIInit(u32); // ret unk, params unk
void AdjustPosition(); // ret unk, params unk
void ImportAdjustingValues(); // ret unk, params unk
void VIInit(void); // good
void VIWaitForRetrace(void); // good
void setInterruptRegs(); // ret unk, params unk
void setPicConfig(); // ret unk, params unk
void setBBIntervalRegs(); // ret unk, params unk
void setScalingRegs(); // ret unk, params unk
void calcFbbs(); // ret unk, params unk
void setFbbRegs(); // params unk
void setHorizontalRegs(); // params unk
void setVerticalRegs(); // params unk
void VIConfigure(const GXRenderModeObj *rmo); // good
void VIConfigurePan(u16 x, u16 y, u16 w, u16 h); // good
void VIFlush(); // good
void VISetNextFrameBuffer(void *fb); // good
void VIGetNextFrameBuffer(); // ret unk, params unk
void *VIGetCurrentFrameBuffer(); // good
void VISetNextRightFrameBuffer(); // ret unk, params unk
void VISetBlack(BOOL black); // good
void VISet3D(); // ret unk, params unk
s32 VIGetRetraceCount(void); // good
u32 VIGetNextField(); // ret unk
u32 VIGetCurrentLine(); // ret unk
VITvFormat VIGetTvFormat(void); // good
VIScanMode VIGetScanMode(void); // good
int VIGetDTVStatus(); // ret unk
void VIGetVSyncTimingTest(); // ret, params unk
void VISetVSyncTimingTest(); // ret, params unk
void VIGetDimmingCount(); // ret, params unk
void VIGetDVDStopMotorCount(); // ret, params unk
int VIEnableDimming(int); // ret unk, params unk
int VISetTimeToDimming(int); // ret unk, params unk
int VIResetDimmingCount(); // ret unk
void VIEnableDVDStopMotor(); // ret, params unk
#ifdef __cplusplus
}
+4 -4
View File
@@ -1,11 +1,11 @@
#ifndef AREA_UTILS_H
#define AREA_UTILS_H
#include "m/m_vec.h"
#include "d/d_bzs_types.h"
#include "m/m_vec.h"
/* 800a9b00 */ bool checkPosInArea(AREA **area, const mVec3_c &pos);
/* 800a9bd0 */ AREA *getAreaForIndexInRoom(s32 areaIndex, s32 roomId);
/* 800a9c50 */ bool checkPosInArea(s32 areaIndex, s32 roomId, const mVec3_c &pos, AREA *const *area);
bool checkPosInArea(AREA **area, const mVec3_c &pos);
AREA *getAreaForIndexInRoom(s32 areaIndex, s32 roomId);
bool checkPosInArea(s32 areaIndex, s32 roomId, const mVec3_c &pos, AREA *const *area);
#endif
+5 -7
View File
@@ -25,7 +25,8 @@ private:
s32 mRoomIndex;
bool mPathSubtype;
/** Must only be called for spline paths. Extracts the relevant path points and control points for the given segment. */
/** Must only be called for spline paths. Extracts the relevant path points and control points for the given
* segment. */
bool extractControlPoints(
s32 pointIndex, mVec3_c &currPos, mVec3_c &currControl2, mVec3_c &nextControl1, mVec3_c &nextPos
) const;
@@ -42,9 +43,8 @@ private:
const BPNT *getPathBpoint(s32 pointIndex) const;
public:
/* 800A6690 */
dPath_c();
/* 800A66D0 */
virtual ~dPath_c();
bool isWrapping() const {
@@ -59,12 +59,10 @@ public:
return mpPathPtr->pointCount;
}
/* 800A6D90 */
bool initWithPathId(s32 pathId, s32 roomId, bool pathSubtype);
bool initWithPathIndex(s32 pathIndex, s32 roomId, bool pathSubtype);
void clear();
/** Get a given point that the curve passes through. */
const Vec *getPoint(s32 pointIndex) const;
@@ -97,7 +95,6 @@ public:
bool getSpeed(s32 segmentIndex, f32 time, f32 *result) const;
/** Calculates the velocity (vector) of an actor moving along the segment at the given time. */
bool getVelocity(s32 segmentIndex, f32 time, mVec3_c &result) const;
};
/** A stateful "path driver" that moves along a given path with a given speed. */
@@ -109,7 +106,8 @@ public:
f32 getRemainingDistanceOnSegment() const;
s32 getClosestXZPoint(const mVec3_c &) const;
void setSegment(s32 segmentIndex, f32 segmentTime);
bool init(s32 pathIndex, s32 roomId, u32 flags, s32 segmentIndex, bool pathSubtype, f32 segmentTime, f32 speed, f32 unk);
bool
init(s32 pathIndex, s32 roomId, u32 flags, s32 segmentIndex, bool pathSubtype, f32 segmentTime, f32 speed, f32 unk);
s32 execute();
s32 getSegmentIndex() const {
+188 -189
View File
@@ -56,232 +56,230 @@ public:
public:
// the following arent part of FileManager i dont think
// /* 80009D30 */ void fn_80009D30(); // some ctor
// /* 80009D40 */ void fn_80009D40(); // some dtor
// /* 80009D80 */ void fn_80009D80(); // return
// /* 80009D90 */ void fn_80009D90(); // return
// /* 80009DA0 */ void fn_80009DA0(); // memset(param_1, 0, 0x20) a 0x24 structure is implied here (0x20 data) a crc
// void fn_80009D30(); // some ctor
// void fn_80009D40(); // some dtor
// void fn_80009D80(); // return
// void fn_80009D90(); // return
// void fn_80009DA0(); // memset(param_1, 0, 0x20) a 0x24 structure is implied here (0x20 data) a crc
// is at 0x24
/* 80009DB0 */ FileManager(); //
/* 80009EE0 */ // mVec3();
FileManager();
/* 80009EF0 */ static FileManager *create(EGG::Heap *);
/* 80009F30 */ bool loadSaveData(NandRequestWriteHolder *out, const char *name, bool isSkipData);
/* 80009F70 */ void saveSaveData(NandRequestLoadSaveFileHolder *request, bool isSkipData);
/* 8000A000 */ void refreshSaveFileData();
/* 8000A260 */ wchar_t *getFileHeroname(int fileNum);
/* 8000A280 */ s64 getFileSaveTime(int fileNum);
/* 8000A2A0 */ s16 getFileCurrentHealth(int fileNum);
/* 8000A2C0 */ s16 getFileHealthCapacity(int fileNum);
/* 8000A2E0 */ void fn_8000A2E0(); // idk something blank save files
static FileManager *create(EGG::Heap *);
bool loadSaveData(NandRequestWriteHolder *out, const char *name, bool isSkipData);
void saveSaveData(NandRequestLoadSaveFileHolder *request, bool isSkipData);
void refreshSaveFileData();
wchar_t *getFileHeroname(int fileNum);
s64 getFileSaveTime(int fileNum);
s16 getFileCurrentHealth(int fileNum);
s16 getFileHealthCapacity(int fileNum);
void fn_8000A2E0(); // idk something blank save files
/* 8000A330 */ u16 *getStoryFlagsMut();
/* 8000A360 */ const u16 *getStoryFlagsConst() const;
/* 8000A3B0 */ u16 *getItemFlagsMut();
/* 8000A3E0 */ const u16 *getItemFlagsConst();
/* 8000A430 */ u16 *getDungeonFlagsMut();
/* 8000A460 */ u16 *getDungeonFlagsConst();
/* 8000A4B0 */ u16 *getSceneFlagsMut();
/* 8000A4E0 */ u16 *getSceneFlagsConst();
/* 8000A530 */ u16 *getTBoxFlagsMut();
/* 8000A560 */ u16 *getTBoxFlagsConst();
/* 8000A5B0 */ u16 *getTempFlagsMut();
/* 8000A5E0 */ u16 *getTempFlagsConst();
/* 8000A630 */ u16 *getZoneFlagsMut();
/* 8000A660 */ u16 *getZoneFlagsConst();
/* 8000A6B0 */ u16 *getEnemyDefeatFlagsMut();
/* 8000A6E0 */ u16 *getEnemyDefeatFlagsConst();
u16 *getStoryFlagsMut();
const u16 *getStoryFlagsConst() const;
u16 *getItemFlagsMut();
const u16 *getItemFlagsConst();
u16 *getDungeonFlagsMut();
u16 *getDungeonFlagsConst();
u16 *getSceneFlagsMut();
u16 *getSceneFlagsConst();
u16 *getTBoxFlagsMut();
u16 *getTBoxFlagsConst();
u16 *getTempFlagsMut();
u16 *getTempFlagsConst();
u16 *getZoneFlagsMut();
u16 *getZoneFlagsConst();
u16 *getEnemyDefeatFlagsMut();
u16 *getEnemyDefeatFlagsConst();
/* 8000A730 */ void setStoryFlags(u16 *flags, u32 offset, u16 count);
/* 8000A790 */ void setItemFlags(u16 *flags, u32 offset, u16 count);
/* 8000A7F0 */ void setDungeonFlags(u16 *flags, u32 offset, u16 count);
/* 8000A850 */ void setSceneFlags(u16 *flags, u32 offset, u16 count);
/* 8000A8B0 */ void setTBoxFlags(u16 *flags, u32 offset, u16 count);
/* 8000A910 */ void setTempFlags(u16 *flags, u32 offset, u16 count);
/* 8000A970 */ void setZoneFlags(u16 *flags, u32 offset, u16 count);
/* 8000A9D0 */ void setEnemyDefeatFlags(u16 *flags, u32 offset, u16 count);
void setStoryFlags(u16 *flags, u32 offset, u16 count);
void setItemFlags(u16 *flags, u32 offset, u16 count);
void setDungeonFlags(u16 *flags, u32 offset, u16 count);
void setSceneFlags(u16 *flags, u32 offset, u16 count);
void setTBoxFlags(u16 *flags, u32 offset, u16 count);
void setTempFlags(u16 *flags, u32 offset, u16 count);
void setZoneFlags(u16 *flags, u32 offset, u16 count);
void setEnemyDefeatFlags(u16 *flags, u32 offset, u16 count);
/* 8000AA30 */ u16 *getSkipFlags();
/* 8000AA40 */ void setSkipFlagsChecked(u16 *flags, u32 offset, u16 count);
u16 *getSkipFlags();
void setSkipFlagsChecked(u16 *flags, u32 offset, u16 count);
/* 8000AAA0 */ void initFile(int fileNum);
void initFile(int fileNum);
/* 8000ABD0 */ void setCurrentHealthCapacity(s16 health);
/* 8000AC00 */ u16 getCurrentHealthCapacity();
/* 8000AC50 */ void setCurrentHealth(s16 health);
/* 8000AC80 */ u16 getCurrentHealth();
void setCurrentHealthCapacity(s16 health);
u16 getCurrentHealthCapacity();
void setCurrentHealth(s16 health);
u16 getCurrentHealth();
/* 8000ACD0 */ u16 getLoadRoomT1();
/* 8000AD20 */ u16 getLoadRoomT2();
/* 8000AD70 */ void setLoadRoomT3(s16 room);
/* 8000ADA0 */ u16 getLoadRoomT3();
u16 getLoadRoomT1();
u16 getLoadRoomT2();
void setLoadRoomT3(s16 room);
u16 getLoadRoomT3();
/* 8000ADF0 */ mVec3_c *getPosT1();
/* 8000AE40 */ void setPosT2(mVec3_c *pos);
/* 8000AE90 */ mVec3_c *getPosT2();
/* 8000AEE0 */ void setPosT3(mVec3_c *pos);
/* 8000AF30 */ mVec3_c *getPosT3();
mVec3_c *getPosT1();
void setPosT2(mVec3_c *pos);
mVec3_c *getPosT2();
void setPosT3(mVec3_c *pos);
mVec3_c *getPosT3();
/* 8000AF80 */ s16 getAngleT1();
/* 8000AFD0 */ void setAngleT2(s16 angle);
/* 8000B000 */ s16 getAngleT2();
/* 8000B050 */ void setAngleT3(s16 angle);
/* 8000B080 */ s16 getAngleT3();
s16 getAngleT1();
void setAngleT2(s16 angle);
s16 getAngleT2();
void setAngleT3(s16 angle);
s16 getAngleT3();
/* 8000B0D0 */ void setPouchData(s32 slot, u32 slotData);
/* 8000B130 */ u32 getPouchData(s32 slot);
/* 8000B1B0 */ void setPouchItem(s32 slot, ITEM_ID item);
/* 8000B220 */ ITEM_ID getPouchItem(s32 slot);
/* 8000B250 */ void setPouchUpperData(s32 slot, s32 data);
/* 8000B2C0 */ u16 getPouchUpperData(s32 slot);
void setPouchData(s32 slot, u32 slotData);
u32 getPouchData(s32 slot);
void setPouchItem(s32 slot, ITEM_ID item);
ITEM_ID getPouchItem(s32 slot);
void setPouchUpperData(s32 slot, s32 data);
u16 getPouchUpperData(s32 slot);
/* 8000B2F0 */ void setItemCheckData(u32 idx, u32 itemData);
/* 8000B360 */ u32 getItemCheckData(u32 idx);
/* 8000B3F0 */ void setItemCheckItem(u32 idx, ITEM_ID item);
/* 8000B480 */ ITEM_ID getItemCheckItem(u32 idx);
/* 8000B4B0 */ void setItemCheckUpperData(u32 idx, u32 itemData);
/* 8000B540 */ u32 getItemCheckUpperData();
void setItemCheckData(u32 idx, u32 itemData);
u32 getItemCheckData(u32 idx);
void setItemCheckItem(u32 idx, ITEM_ID item);
ITEM_ID getItemCheckItem(u32 idx);
void setItemCheckUpperData(u32 idx, u32 itemData);
u32 getItemCheckUpperData();
/* 8000B570 */ void setEquippedItem(u8 bWheelItem);
/* 8000B5A0 */ u8 getEquippedItem();
/* 8000B5F0 */ void setSelectedPouchSlot(u8 slot);
/* 8000B620 */ u8 getSelectedPouchSlot();
/* 8000B670 */ void setShieldPouchSlot(u8 slot);
/* 8000B6A0 */ u8 getShieldPouchSlot();
void setEquippedItem(u8 bWheelItem);
u8 getEquippedItem();
void setSelectedPouchSlot(u8 slot);
u8 getSelectedPouchSlot();
void setShieldPouchSlot(u8 slot);
u8 getShieldPouchSlot();
/* 8000B6F0 */ void setAirPotionTimer(u16 time);
/* 8000B720 */ u16 getAirPotionTimer() const;
/* 8000B770 */ void setAirPotionPlusTimer(u16 time);
/* 8000B7A0 */ u16 getAirPotionPlusTimer() const;
/* 8000B7F0 */ void setStaminaPotionTimer(u16 time);
/* 8000B820 */ u16 getStaminaPotionTimer() const;
/* 8000B870 */ void setStaminaPotionPlusTimer(u16 time);
/* 8000B8A0 */ u16 getStaminaPotionPlusTimer() const;
/* 8000B8F0 */ void setGuardianPotionTimer(u16 time);
/* 8000B920 */ u16 getGuardianPotionTimer() const;
/* 8000B970 */ void setGuardianPotionPlusTimer(u16 time);
/* 8000B9A0 */ u16 getGuardianPotionPlusTimer() const;
void setAirPotionTimer(u16 time);
u16 getAirPotionTimer() const;
void setAirPotionPlusTimer(u16 time);
u16 getAirPotionPlusTimer() const;
void setStaminaPotionTimer(u16 time);
u16 getStaminaPotionTimer() const;
void setStaminaPotionPlusTimer(u16 time);
u16 getStaminaPotionPlusTimer() const;
void setGuardianPotionTimer(u16 time);
u16 getGuardianPotionTimer() const;
void setGuardianPotionPlusTimer(u16 time);
u16 getGuardianPotionPlusTimer() const;
/* 8000B9F0 */ void setDowsingSlotIdx(u8 idx);
/* 8000BA20 */ u8 getDowsingSlotIdx();
void setDowsingSlotIdx(u8 idx);
u8 getDowsingSlotIdx();
/* 8000BA70 */ void setBeaconPos(u32 beaconArea, u32 beaconNum, mVec3_c *pos);
/* 8000BB80 */ mVec3_c *getBeaconPos(u32 beaconArea, u32 beaconNum);
/* 8000BC70 */ void setEnemyKillCount(u8 enemy, u16 killCount);
/* 8000BCE0 */ u16 getEnemyKillCount(u8 enemy);
/* 8000BD60 */ void setHitCountFromEnemy(u8 enemy, u16 hitCount);
/* 8000BDD0 */ u16 getHitCountFromEnemy(u8 enemy);
void setBeaconPos(u32 beaconArea, u32 beaconNum, mVec3_c *pos);
mVec3_c *getBeaconPos(u32 beaconArea, u32 beaconNum);
void setEnemyKillCount(u8 enemy, u16 killCount);
u16 getEnemyKillCount(u8 enemy);
void setHitCountFromEnemy(u8 enemy, u16 hitCount);
u16 getHitCountFromEnemy(u8 enemy);
/* 8000BE50 */ void setLoadRoomT1_FileB(s16 roomId);
/* 8000BE80 */ u16 getLoadRoomT1_FileB();
/* 8000BE90 */ void setEntranceT1_FileB(u8 entrance);
/* 8000BEC0 */ u8 getEntranceT1_FileB();
/* 8000BED0 */ void setAreaT1_FileB(const char *name);
/* 8000BF80 */ char *getAreaT1_FileB();
/* 8000C080 */ void setNightT1_FileB(bool night);
/* 8000C0B0 */ u8 getNightT1_FileB();
/* 8000C0C0 */ void setEntranceT1LoadFlag_FileB(u8 flag);
/* 8000C0F0 */ void setForcedLayerT1_FileB(u8 layer);
/* 8000C120 */ u8 getForcedLayerT1_FileB();
/* 8000C130 */ void setCurrentHealth_FileB(s16 health);
void setLoadRoomT1_FileB(s16 roomId);
u16 getLoadRoomT1_FileB();
void setEntranceT1_FileB(u8 entrance);
u8 getEntranceT1_FileB();
void setAreaT1_FileB(const char *name);
char *getAreaT1_FileB();
void setNightT1_FileB(bool night);
u8 getNightT1_FileB();
void setEntranceT1LoadFlag_FileB(u8 flag);
void setForcedLayerT1_FileB(u8 layer);
u8 getForcedLayerT1_FileB();
void setCurrentHealth_FileB(s16 health);
/* 8000C160 */ void setHeroname(const wchar_t *name);
/* 8000C230 */ wchar_t *getHeroname();
void setHeroname(const wchar_t *name);
wchar_t *getHeroname();
/* 8000C360 */ char *getAreaT1();
/* 8000C470 */ char *getAreaT2();
/* 8000C580 */ void setAreaT3(const char *name);
/* 8000C630 */ char *getAreaT3();
char *getAreaT1();
char *getAreaT2();
void setAreaT3(const char *name);
char *getAreaT3();
/* 8000C740 */ u8 getForcedLayerT1();
/* 8000C790 */ u8 getForcedLayerT2();
/* 8000C7E0 */ void setForcedLayerT3(u8 layer);
/* 8000C810 */ u8 getForcedLayerT3();
u8 getForcedLayerT1();
u8 getForcedLayerT2();
void setForcedLayerT3(u8 layer);
u8 getForcedLayerT3();
/* 8000C860 */ u8 getEntranceT1();
/* 8000C8B0 */ void setEntranceLoadFlagT1(u8 flag);
/* 8000C8E0 */ u8 getEntranceLoadFlagT1();
/* 8000C930 */ void getEntranceT2();
/* 8000C980 */ void setEntranceT3(u8 entrance);
/* 8000C9B0 */ u8 getEntranceT3();
u8 getEntranceT1();
void setEntranceLoadFlagT1(u8 flag);
u8 getEntranceLoadFlagT1();
void getEntranceT2();
void setEntranceT3(u8 entrance);
u8 getEntranceT3();
/* 8000CA00 */ bool getNightT1();
/* 8000CA50 */ void setNightT3(bool night);
/* 8000CA80 */ u8 getNightT3();
bool getNightT1();
void setNightT3(bool night);
u8 getNightT3();
/* 8000CAD0 */ bool isNew_FileA();
bool isNew_FileA();
/* 8000CB00 */ void setSceneFlagIndex(s16 idx);
/* 8000CB30 */ u32 getSceneFlagIndex();
/* 8000CB80 */ s32 getFileAreaIndex();
void setSceneFlagIndex(s16 idx);
u32 getSceneFlagIndex();
s32 getFileAreaIndex();
/* 8000CBD0 */ void fn_8000CBD0(u8);
/* 8000CC00 */ u8 fn_8000CC00();
void fn_8000CBD0(u8);
u8 fn_8000CC00();
/* 8000CC50 */ void setFileTimes();
/* 8000CCB0 */ void setPlayTime(s64 time);
void setFileTimes();
void setPlayTime(s64 time);
/* 8000CCF0 */ s64 getSavedTime();
/* 8000CD40 */ void setSavedTime(s64 time);
s64 getSavedTime();
void setSavedTime(s64 time);
/* 8000CD80 */ void setBeedleShopPathSegment(u32 path);
/* 8000CDB0 */ u32 getBeedleShopPathSegment();
/* 8000CE00 */ void setBeedleShopPathSegFrac(f32 segFrac);
/* 8000CE30 */ f32 getBeedleShopPathSegFrac();
/* 8000CE80 */ void setBeedleShopRotation(s16 rot);
/* 8000CEB0 */ s16 getBeedleShopRotation();
void setBeedleShopPathSegment(u32 path);
u32 getBeedleShopPathSegment();
void setBeedleShopPathSegFrac(f32 segFrac);
f32 getBeedleShopPathSegFrac();
void setBeedleShopRotation(s16 rot);
s16 getBeedleShopRotation();
/* 8000CF00 */ void fn_8000CF00(u32 shift);
/* 8000CF70 */ void fn_8000CF70(u32 shift);
void fn_8000CF00(u32 shift);
void fn_8000CF70(u32 shift);
/* 8000CFE0 */ void setSkykeepPuzzle(u32 spot, u8 tile);
/* 8000D040 */ u8 getSkykeepPuzzleTile(u32 spot);
void setSkykeepPuzzle(u32 spot, u8 tile);
u8 getSkykeepPuzzleTile(u32 spot);
/* 8000D0B0 */ void checkFileStatus();
/* 8000D1D0 */ bool checkSkipDataCRCs();
/* 8000D270 */ void saveOrClearSelectedFileToFileA();
/* 8000D280 */ void saveOrClearToFileA(int fileNum);
/* 8000D9C0 */ void copyFileBToCurrentFile();
/* 8000E060 */ void copyFileAToSelectedFile();
/* 8000E070 */ void copyFileAToFile(int fileNum);
/* 8000E7C0 */ void copyFile(int from, int to);
/* 8000EF80 */ void saveFileAToSelectedFile();
/* 8000EF90 */ void saveFileAToFile(int fileNum);
/* 8000F730 */ void copyCurrentToFileB();
/* 8000FDF0 */ void copySelectedFileSkipData();
/* 8000FE00 */ void copySkipData(u8 fileNum);
/* 8000FEB0 */ void setInfo_FileB();
/* 8000FF60 */ void clearFileA();
void checkFileStatus();
bool checkSkipDataCRCs();
void saveOrClearSelectedFileToFileA();
void saveOrClearToFileA(int fileNum);
void copyFileBToCurrentFile();
void copyFileAToSelectedFile();
void copyFileAToFile(int fileNum);
void copyFile(int from, int to);
void saveFileAToSelectedFile();
void saveFileAToFile(int fileNum);
void copyCurrentToFileB();
void copySelectedFileSkipData();
void copySkipData(u8 fileNum);
void setInfo_FileB();
void clearFileA();
/* 80010000 */ void initBlankSaveFiles();
/* 80010160 */ void initSkipData();
void initBlankSaveFiles();
void initSkipData();
/* 800101F0 */ void unsetFileANewFile();
/* 80010220 */ void saveT1SaveInfo(bool entranceT1LoadFlag);
/* 80010350 */ void copyFileSkipData(int fileNum);
/* 80010440 */ void clearTempFileData();
/* 800104A0 */ void saveAfterCredits();
/* 80011210 */ SaveFile *getCurrentFile();
void unsetFileANewFile();
void saveT1SaveInfo(bool entranceT1LoadFlag);
void copyFileSkipData(int fileNum);
void clearTempFileData();
void saveAfterCredits();
SaveFile *getCurrentFile();
inline const SaveFile *getCurrentFile() const {
return isFileInactive() ? &mFileB : &mFileA;
}
/* 80011250 */ u16 *getSkipFlags2();
/* 80011260 */ SaveFile *getFileA();
/* 80011270 */ SaveFile *getFileB();
/* 80011280 */ u32 calcFileCRC(const void *data, u32 length);
/* 80011290 */ void updateEmptyFiles();
/* 800112D0 */ void updateEmptyFileFlags();
/* 80011370 */ bool isFileEmpty(u8 fileNum);
/* 80011390 */ bool isFileDirty(int fileNum);
/* 800113B0 */ u32 get_0xA84C();
/* 800113C0 */ bool checkRegionCode();
/* 80011440 */ bool checkFileCRC(u8 fileNum);
/* 80011490 */ bool isFileInactive() const;
/* 80011500 */ void setPlayerInfoFileA();
/* 800115E0 */ void setT3Info(const mVec3_c &pos, const mAng3_c &rot);
/* 800116C0 */ static void getRegionVersion(char *out);
// /* 800116F0 */ void sinit();
u16 *getSkipFlags2();
SaveFile *getFileA();
SaveFile *getFileB();
u32 calcFileCRC(const void *data, u32 length);
void updateEmptyFiles();
void updateEmptyFileFlags();
bool isFileEmpty(u8 fileNum);
bool isFileDirty(int fileNum);
u32 get_0xA84C();
bool checkRegionCode();
bool checkFileCRC(u8 fileNum);
bool isFileInactive() const;
void setPlayerInfoFileA();
void setT3Info(const mVec3_c &pos, const mAng3_c &rot);
static void getRegionVersion(char *out);
static FileManager *GetInstance() {
return sInstance;
@@ -359,6 +357,7 @@ public:
}
static FileManager *sInstance;
private:
};
+91 -92
View File
@@ -4,81 +4,80 @@
#include "common.h"
#include "m/m_vec.h"
// Ghidra: SaveFile
// Size: 0x53c0
// non-offical name
struct SaveFile {
public:
/* 0x 0000 */ s64 playTime;
/* 0x 0008 */ s64 savedTime;
/* 0x 0010 */ mVec3_c pos_t1;
/* 0x 001c */ mVec3_c pos_t2;
/* 0x 0028 */ mVec3_c pos_t3;
/* 0x 0034 */ mVec3_c beacon_pos[32][5];
/* 0x 07b4 */ s32 beedleShopPathSegment;
/* 0x 07b8 */ f32 beedlShopPathSegFrac;
/* 0x 07bc */ u32 field_0x07BC;
/* 0x 07c0 */ s32 pouch_items[8];
/* 0x 07e0 */ s32 item_check_items[60];
/* 0x 08d0 */ int file_area_index;
/* 0x 08d4 */ wchar_t player_name[8];
/* 0x 08e4 */ u16 story_flags[128];
/* 0x 09e4 */ u16 item_flags[64];
/* 0x 0a64 */ u16 dungeon_flags[8][22];
/* 0x 0bc4 */ char field_0x0BC4[0x1a64 - 0x0bc4];
/* 0x 1a64 */ u16 scene_flags[208];
/* 0x 1c04 */ char field_0x1c04[0x2a64 - 0x1c04];
/* 0x 2a64 */ u16 tbox_flags[32]; // size is guessed
/* 0x 2aa4 */ char field_0x2AA4[0x2f64 - 0x2aa4];
/* 0x 2f64 */ u16 enemyKillCounts[100];
/* 0x 302c */ u16 hitByEnemyCounts[100];
/* 0x 30f4 */ u16 temp_flags[4];
/* 0x 30fc */ u16 zone_flags[252];
/* 0x 32f4 */ u16 enemy_flags[4096];
/* 0x 52f4 */ u16 air_potion_timer;
/* 0x 52f6 */ u16 air_potion_plus_timer;
/* 0x 52f8 */ u16 stamina_potion_timer;
/* 0x 52fa */ u16 stamina_potion_plus_timer;
/* 0x 52fc */ u16 gaurdian_potion_timer;
/* 0x 52fe */ u16 gaurdian_potion_plus_timer;
/* 0x 5300 */ u16 field_0x5300;
/* 0x 5302 */ u16 health_capacity;
/* 0x 5304 */ u16 unused_heart_related;
/* 0x 5306 */ u16 current_health;
/* 0x 5308 */ u16 room_id_t1;
/* 0x 530a */ u16 room_id_t2;
/* 0x 530c */ u16 room_id_t3;
/* 0x 530e */ s16 angle_t1;
/* 0x 5310 */ s16 angle_t2;
/* 0x 5312 */ s16 angle_t3;
/* 0x 5314 */ s16 beedle_shop_rotation;
/* 0x 5316 */ u16 field_0x5316;
/* 0x 5318 */ s16 scene_flag_index;
/* 0x 531a */ u16 field_0x531A;
/* 0x 531c */ char area_t1[32];
/* 0x 533c */ s8 area_t2[32];
/* 0x 535c */ s8 area_t3[32];
/* 0x 537c */ u8 placed_beacon_flags[32];
/* 0x 539c */ u8 skykeep_puzzle[9];
/* 0x 53a5 */ u8 forced_layer_t1;
/* 0x 53a6 */ u8 forced_layer_t2;
/* 0x 53a7 */ u8 forced_layer_t3;
/* 0x 53a8 */ u8 entrance_t1;
/* 0x 53a9 */ u8 entrance_t1_load_flag;
/* 0x 53aa */ u8 entrance_t2;
/* 0x 53ab */ u8 entrance_t3;
/* 0x 53ac */ u8 field_0x53ac;
/* 0x 53ad */ bool new_file; // set on new file, unset by saving
/* 0x 53ae */ u8 equipped_b_item;
/* 0x 53af */ u8 field_0x53af;
/* 0x 53b0 */ u8 lastUsedPouchItemSlot;
/* 0x 53b1 */ u8 shield_pouch_slot;
/* 0x 53b2 */ u8 selectedDowsingSlot;
/* 0x 53b3 */ u8 night_t1;
/* 0x 53b4 */ u8 night_t3;
/* 0x 53b5 */ char field_0x53b5[0x53bc - 0x53b5];
/* 0x 53bc */ u32 checksum;
/* 0x0000 */ s64 playTime;
/* 0x0008 */ s64 savedTime;
/* 0x0010 */ mVec3_c pos_t1;
/* 0x001c */ mVec3_c pos_t2;
/* 0x0028 */ mVec3_c pos_t3;
/* 0x0034 */ mVec3_c beacon_pos[32][5];
/* 0x07b4 */ s32 beedleShopPathSegment;
/* 0x07b8 */ f32 beedlShopPathSegFrac;
/* 0x07bc */ u32 field_0x07BC;
/* 0x07c0 */ s32 pouch_items[8];
/* 0x07e0 */ s32 item_check_items[60];
/* 0x08d0 */ int file_area_index;
/* 0x08d4 */ wchar_t player_name[8];
/* 0x08e4 */ u16 story_flags[128];
/* 0x09e4 */ u16 item_flags[64];
/* 0x0a64 */ u16 dungeon_flags[8][22];
/* 0x0bc4 */ char field_0x0BC4[0x1a64 - 0x0bc4];
/* 0x1a64 */ u16 scene_flags[208];
/* 0x1c04 */ char field_0x1c04[0x2a64 - 0x1c04];
/* 0x2a64 */ u16 tbox_flags[32]; // size is guessed
/* 0x2aa4 */ char field_0x2AA4[0x2f64 - 0x2aa4];
/* 0x2f64 */ u16 enemyKillCounts[100];
/* 0x302c */ u16 hitByEnemyCounts[100];
/* 0x30f4 */ u16 temp_flags[4];
/* 0x30fc */ u16 zone_flags[252];
/* 0x32f4 */ u16 enemy_flags[4096];
/* 0x52f4 */ u16 air_potion_timer;
/* 0x52f6 */ u16 air_potion_plus_timer;
/* 0x52f8 */ u16 stamina_potion_timer;
/* 0x52fa */ u16 stamina_potion_plus_timer;
/* 0x52fc */ u16 gaurdian_potion_timer;
/* 0x52fe */ u16 gaurdian_potion_plus_timer;
/* 0x5300 */ u16 field_0x5300;
/* 0x5302 */ u16 health_capacity;
/* 0x5304 */ u16 unused_heart_related;
/* 0x5306 */ u16 current_health;
/* 0x5308 */ u16 room_id_t1;
/* 0x530a */ u16 room_id_t2;
/* 0x530c */ u16 room_id_t3;
/* 0x530e */ s16 angle_t1;
/* 0x5310 */ s16 angle_t2;
/* 0x5312 */ s16 angle_t3;
/* 0x5314 */ s16 beedle_shop_rotation;
/* 0x5316 */ u16 field_0x5316;
/* 0x5318 */ s16 scene_flag_index;
/* 0x531a */ u16 field_0x531A;
/* 0x531c */ char area_t1[32];
/* 0x533c */ s8 area_t2[32];
/* 0x535c */ s8 area_t3[32];
/* 0x537c */ u8 placed_beacon_flags[32];
/* 0x539c */ u8 skykeep_puzzle[9];
/* 0x53a5 */ u8 forced_layer_t1;
/* 0x53a6 */ u8 forced_layer_t2;
/* 0x53a7 */ u8 forced_layer_t3;
/* 0x53a8 */ u8 entrance_t1;
/* 0x53a9 */ u8 entrance_t1_load_flag;
/* 0x53aa */ u8 entrance_t2;
/* 0x53ab */ u8 entrance_t3;
/* 0x53ac */ u8 field_0x53ac;
/* 0x53ad */ bool new_file; // set on new file, unset by saving
/* 0x53ae */ u8 equipped_b_item;
/* 0x53af */ u8 field_0x53af;
/* 0x53b0 */ u8 lastUsedPouchItemSlot;
/* 0x53b1 */ u8 shield_pouch_slot;
/* 0x53b2 */ u8 selectedDowsingSlot;
/* 0x53b3 */ u8 night_t1;
/* 0x53b4 */ u8 night_t3;
/* 0x53b5 */ char field_0x53b5[0x53bc - 0x53b5];
/* 0x53bc */ u32 checksum;
// ----------------------------------------------------------
// NOTE: There are functions that are exactly the same code
@@ -86,28 +85,28 @@ public:
// it could also potentially be a static function
// ----------------------------------------------------------
public:
/* 800099b0 */ u16 *getStoryFlags0();
/* 800099c0 */ const u16 *getStoryFlags1() const;
/* 800099d0 */ u16 *getItemFlags0();
/* 800099e0 */ const u16 *getItemFlags1() const;
/* 800099F0 */ u16 *getDungeonFlags0();
/* 80009A00 */ const u16 *getDungeonFlags1() const;
/* 80009A10 */ u16 *getSceneFlags0();
/* 80009A20 */ const u16 *getSceneFlags1() const;
/* 80009A30 */ u16 *getTboxFlags0();
/* 80009A40 */ const u16 *getTboxFlags1() const;
/* 80009A50 */ u16 *getTempFlags0();
/* 80009A60 */ const u16 *getTempFlags1() const;
/* 80009A70 */ u16 *getZoneFlags0();
/* 80009A80 */ const u16 *getZoneFlags1() const;
/* 80009A90 */ u16 *getEnemyFlags0();
/* 80009AA0 */ const u16 *getEnemyFlags1() const;
/* 80009AB0 */ wchar_t *getPlayerName(); // UTF16-BE
/* 80009AC0 */ void setAreaT1(char *name);
/* 80009BE0 */ char *getAreaT1();
/* 80009BF0 */ void setAreaT2(char *name);
/* 80009D10 */ s8 *getAreaT2();
/* 80009D20 */ s8 *getAreaT3();
u16 *getStoryFlags0();
const u16 *getStoryFlags1() const;
u16 *getItemFlags0();
const u16 *getItemFlags1() const;
u16 *getDungeonFlags0();
const u16 *getDungeonFlags1() const;
u16 *getSceneFlags0();
const u16 *getSceneFlags1() const;
u16 *getTboxFlags0();
const u16 *getTboxFlags1() const;
u16 *getTempFlags0();
const u16 *getTempFlags1() const;
u16 *getZoneFlags0();
const u16 *getZoneFlags1() const;
u16 *getEnemyFlags0();
const u16 *getEnemyFlags1() const;
wchar_t *getPlayerName(); // UTF16-BE
void setAreaT1(char *name);
char *getAreaT1();
void setAreaT2(char *name);
s8 *getAreaT2();
s8 *getAreaT3();
};
#endif
+1 -1
View File
@@ -14,7 +14,7 @@ public:
/* 0x04 */ dAcObjBase_c *mpActor;
/* 0x08 */ bool field_0x08;
/* 8001a230 */ void attach(m3d::scnLeaf_c &);
void attach(m3d::scnLeaf_c &);
};
#endif
+1 -59
View File
@@ -24,13 +24,11 @@
#include "toBeSorted/file_manager.h"
#include "toBeSorted/special_item_drop_mgr.h"
// .sdata
u32 dAcBase_c::s_Create_RoomId = -1;
u32 dAcBase_c::s_Create_Params2 = -1;
u16 dAcBase_c::s_Create_UnkFlags = -1;
u8 dAcBase_c::s_Create_ViewClipIdx = -1;
// .sbss
mVec3_c *dAcBase_c::s_Create_Position;
mAng3_c *dAcBase_c::s_Create_Rotation;
mVec3_c *dAcBase_c::s_Create_Scale;
@@ -44,7 +42,6 @@ bool dAcBase_c::createHeap() {
// mpSoundSource and mSoundList need to be ironed out before this can match
// NOT MATCHING
// 8002c3b0
dAcBase_c::dAcBase_c()
: mAllocator(),
mpActorInfo(s_Create_ActorInfo),
@@ -85,10 +82,6 @@ dAcBase_c::dAcBase_c()
someStr[0] = '\0';
}
// 8002c530
// dBase_c::~dBase_c() {}
// 8002c590
dAcBase_c::~dAcBase_c() {}
void dAcBase_c::setTempCreateParams(
@@ -175,7 +168,6 @@ int dAcBase_c::create() {
return success;
}
// 8002c8f0
void dAcBase_c::postCreate(fBase_c::MAIN_STATE_e state) {
if (state == SUCCESS) {
mPositionCopy = mPosition;
@@ -186,7 +178,6 @@ void dAcBase_c::postCreate(fBase_c::MAIN_STATE_e state) {
}
// NOT MATCHING
// 8002c940
int dAcBase_c::preDelete() {
int ret = SUCCEEDED;
if (fBase_c::preDelete() == NOT_READY) {
@@ -234,7 +225,6 @@ int dAcBase_c::preDelete() {
return SUCCEEDED;
}
// 8002cb10
int dAcBase_c::preExecute() {
if (dBase_c::preExecute() == NOT_READY) {
return NOT_READY;
@@ -252,7 +242,6 @@ int dAcBase_c::preExecute() {
return SUCCEEDED;
}
// 8002cc10
int dAcBase_c::execute() {
if (EventManager::isInEvent() && !EventManager::isInEvent0Or7()) {
return actorExecuteInEvent();
@@ -261,17 +250,14 @@ int dAcBase_c::execute() {
return actorExecute();
}
// 8002cca0
int dAcBase_c::actorExecute() {
return SUCCEEDED;
}
// 8002ccb0
int dAcBase_c::actorExecuteInEvent() {
return actorExecute();
}
// 8002ccc0
void dAcBase_c::postExecute(fBase_c::MAIN_STATE_e state) {
if (mpSoundSource != nullptr) {
mpSoundSource->calc(*mpPosition);
@@ -286,17 +272,14 @@ void dAcBase_c::postExecute(fBase_c::MAIN_STATE_e state) {
// TODO - ...
}
// 8002ce90
void dAcBase_c::unkVirtFunc_0x5C() {
return;
}
// 8002cea0
void dAcBase_c::unkVirtFunc_0x60() {
return;
}
// 8002ceb0
// loads f2 before f0 instead of f0 then f2
bool dAcBase_c::restorePosRotFromCopy() {
if (mRoomID != mRoomIDCopy) {
@@ -307,7 +290,6 @@ bool dAcBase_c::restorePosRotFromCopy() {
return 1;
}
// 8002cf10
u32 dAcBase_c::itemDroppingAndGivingRelated(mVec3_c *spawnPos, int subtype) {
if (dScGame_c::currentSpawnInfo.getTrial() == SpawnInfo::TRIAL) {
return 0;
@@ -325,43 +307,35 @@ u32 dAcBase_c::itemDroppingAndGivingRelated(mVec3_c *spawnPos, int subtype) {
);
}
// 8002cf90
void dAcBase_c::fillUpperParams2Byte() {
// Upper byte of param2 determines item drops when actor is deleted
mParams2 |= 0xFF000000;
}
// 8002cfa0
u32 dAcBase_c::getParams2_ignoreLower() {
return mParams2 | 0xFFFF;
}
// 8002cfb0
void dAcBase_c::setParams2Upper_ignoreLower(u32 val) {
mParams2 = val | 0xFFFF;
}
// 8002cfc0
int dAcBase_c::getParams2UpperByte() {
return mParams2 >> 0x18;
}
// 8002cfd0
void dAcBase_c::setParams2UpperByte(u32 val) {
mParams2 = (mParams2 & 0xFFFFFF) | val << 0x18;
}
// 8002cff0
u32 dAcBase_c::buildParams2(u32 lower, u32 upper) {
return ((upper & 0xFFFF) | 0xFFFF0000) & ((lower << 0x18) | 0xFFFFFF);
}
// 8002d010
u32 dAcBase_c::getParams2Lower() const {
return mParams2 & 0xFFFF;
}
// 8002d020
dAcBase_c *dAcBase_c::findActor(char *objName, dAcBase_c *parent) {
const ActorInfo *actorInfo = getActorInfoByName(objName);
if (actorInfo == nullptr) {
@@ -378,7 +352,6 @@ dAcBase_c *dAcBase_c::findActor(char *objName, dAcBase_c *parent) {
}
// searches for actor based on groupType
// 8002d0a0
FORCE_INLINE dAcBase_c *findActor(dAcBase_c *parent) {
dAcBase_c *foundActor;
if (!parent) {
@@ -393,14 +366,12 @@ FORCE_INLINE dAcBase_c *findActor(dAcBase_c *parent) {
// control flow sucks ;-;
// NOT MATCHING
// 8002d0a0
dAcBase_c *dAcBase_c::searchActor(dAcBase_c *parent) {
dAcBase_c *foundActor = ::findActor(parent);
return foundActor ? foundActor : (dAcBase_c *)fManager_c::searchBaseByGroupType(STAGE, parent);
}
// 8002d130
void dAcBase_c::forEveryActor(void *func(dAcBase_c *, dAcBase_c *), dAcBase_c *parent) {
dAcBase_c *foundActor = searchActor(nullptr);
@@ -410,12 +381,10 @@ void dAcBase_c::forEveryActor(void *func(dAcBase_c *, dAcBase_c *), dAcBase_c *p
}
}
// 8002d190
mAng dAcBase_c::getXZAngleToPlayer() {
return cLib::targetAngleY(this->mPosition, dAcPy_c::LINK->mPosition);
}
// 8002d1d0
bool dAcBase_c::getDistanceToActor(dAcBase_c *actor, f32 distThresh, f32 *outDist) {
f32 distSquared = 3.402823e+38;
bool isWithinThreshhold = false;
@@ -435,7 +404,6 @@ bool dAcBase_c::getDistanceToActor(dAcBase_c *actor, f32 distThresh, f32 *outDis
return isWithinThreshhold;
}
// 8002d290
bool dAcBase_c::getDistanceAndAngleToActor(
dAcBase_c *actor, f32 distThresh, s16 yAngle, s16 xAngle, f32 *outDist, s16 *outDiffAngleY, s16 *outDiffAngleX
) {
@@ -472,31 +440,26 @@ bool dAcBase_c::getDistanceAndAngleToActor(
return isWithinRange;
}
// 8002d3e0
bool dAcBase_c::isWithinPlayerRadius(f32 radius) const {
f32 dist_diff = getSquareDistanceTo(dAcPy_c::LINK->mPosition);
return dist_diff < radius * radius;
}
// 8002d440
bool dAcBase_c::getDistanceAndAngleToPlayer(
f32 distThresh, s16 yAngle, s16 xAngle, f32 *outDist, s16 *outDiffAngleY, s16 *outDiffAngleX
) {
return getDistanceAndAngleToActor(dAcPy_c::LINK, distThresh, yAngle, xAngle, outDist, outDiffAngleY, outDiffAngleX);
}
// 8002d470
f32 dAcBase_c::getDistToPlayer() {
return EGG::Math<f32>::sqrt(PSVECSquareDistance(mPosition, dAcPy_c::LINK->mPosition));
}
// 8002d4a0
f32 dAcBase_c::getSquareDistToPlayer() {
return PSVECSquareDistance(mPosition, dAcPy_c::LINK->mPosition);
}
// Some weirdness with the float registers being used
// 8002d4b0
void dAcBase_c::updateRoomId(f32 yOffset) {
if (getConnectParent()->mProfileName != fProfile::ROOM) {
mVec3_c actorPos(mPosition.x, mPosition.y + yOffset, mPosition.z);
@@ -509,7 +472,6 @@ void dAcBase_c::updateRoomId(f32 yOffset) {
}
}
// 8002d540
bool dAcBase_c::isRoomFlags_0x6_Set() {
dRoom_c *room = dStage_c::GetInstance()->getRoom(mRoomID);
return (room->checkFlag(0x4 | 0x2));
@@ -623,41 +585,33 @@ void dAcBase_c::setBattleBgmRelated(UNKWORD param) {
mpSoundSource->setBattleBgmRelated(param);
}
// 8002d880
dSoundSourceIf_c *dAcBase_c::getSoundSource() {
return mpSoundSource.get();
}
// 8002d890
void dAcBase_c::removeSoundInfo(SoundInfo *soundInfo) {
// Position != EndIter -> soundInfo is contained in mSoundList
if (mSoundList.GetPosition(soundInfo) != mSoundList.GetEndIter()) {
mSoundList.remove(soundInfo);
}
}
// current name is Global__setActorRef
void dAcBase_c::setActorRef(dAcBase_c *ref) {
mActorNode.link(ref);
}
// May not be only purpose
void dAcBase_c::setEnemyDefeatFlag() {
EnemyflagManager::sInstance->setFlag(mObjID);
}
// 8002d940
void dAcBase_c::changeLoadedEntitiesWithSet() {
dStage_c::GetInstance()->changeLoadedEntities(mObjID, true);
}
// 8002d960
void dAcBase_c::changeLoadedEntitiesNoSet() {
dStage_c::GetInstance()->changeLoadedEntities(mObjID, false);
}
// spawns GroupType2 (ACTOR)
// 8002d980
dAcBase_c *dAcBase_c::createActor(
ProfileName actorId, u32 actorParams1, mVec3_c *actorPosition, mAng3_c *actorRotation, mVec3_c *actorScale,
u32 actorParams2, s32 actorRoomid, dBase_c *actorRef
@@ -688,7 +642,6 @@ dAcBase_c *dAcBase_c::createActor(
}
// spawns GroupType2 (STAGE)
// 8002da80
dAcBase_c *dAcBase_c::createActorStage(
ProfileName actorId, u32 actorParams1, mVec3_c *actorPosition, mAng3_c *actorRotation, mVec3_c *actorScale,
u32 actorParams2, s32 actorRoomid, dBase_c *actorRef
@@ -718,13 +671,10 @@ dAcBase_c *dAcBase_c::createActorStage(
return (dAcBase_c *)dBase_c::createBase(actorId, room, actorParams1, STAGE);
}
// 8002db80
void dAcBase_c::registerInEvent() {}
// 8002db90
void dAcBase_c::unkVirtFunc_0x6C() {}
// 8002dba0
void dAcBase_c::doInteraction(s32 param) {
if (param == 4 || param == 5 || param == 12) {
Event event = Event("DefaultTalk", 400, 0x100001, nullptr, nullptr);
@@ -734,7 +684,6 @@ void dAcBase_c::doInteraction(s32 param) {
// Only called by dPlayer::dig
// Rounds angle to nearest 90 deg?
// 8002dc20
void dAcBase_c::roundAngleToNearest90(s16 *dst_angle, s16 *src_angle) {
s32 roundedAngle = *src_angle;
@@ -746,9 +695,8 @@ void dAcBase_c::roundAngleToNearest90(s16 *dst_angle, s16 *src_angle) {
*dst_angle = (roundedAngle / 0x4000) * 0x4000;
}
// 8002dc50
void dAcBase_c::incrementKillCounter() {
dAcObjBase_c *object = (dAcObjBase_c *)this; // Probably wrong
dAcObjBase_c *object = static_cast<dAcObjBase_c *>(this); // Probably wrong
if (mGroupType == ACTOR && object->mTargetFiRelated == 1) {
int killCounterId = object->mTargetFiTextID;
@@ -761,41 +709,35 @@ void dAcBase_c::incrementKillCounter() {
}
}
// 8002dcd0
void dAcBase_c::killNoItemDrop() {
fillUpperParams2Byte();
fBase_c::deleteRequest();
incrementKillCounter();
}
// 8002dd10
void dAcBase_c::killWithFlag() {
setEnemyDefeatFlag();
fBase_c::deleteRequest();
incrementKillCounter();
}
// 8002dd50
void dAcBase_c::killWithFlagNoItemDrop() {
fillUpperParams2Byte();
killWithFlag();
}
// 8002dd90
void dAcBase_c::deleteWithFlagNoItemDrop() {
fillUpperParams2Byte();
setEnemyDefeatFlag();
fBase_c::deleteRequest();
}
// 8002ddd0
void dAcBase_c::setPolyAttrs(cBgS_PolyInfo &pPolyInfo) {
mPolyAttr0 = dBgS::GetInstance()->GetPolyAtt0(pPolyInfo);
mPolyAttr1 = dBgS::GetInstance()->GetPolyAtt1(pPolyInfo);
}
// Idk what's up with this function. It's only used once.
// 8002de30
void dAcBase_c::setPolyAttrsDupe(cBgS_PolyInfo &pPolyInfo) {
setPolyAttrs(pPolyInfo);
}
-5
View File
@@ -7,12 +7,10 @@
// clang-format on
namespace dDvd {
/** 800520f0 */
void create(s32 priority, EGG::Heap *archiveHeap, EGG::Heap *commandHeap, EGG::Heap *threadHeap) {
mDvd::create(priority, archiveHeap, commandHeap, threadHeap);
}
/** 80052100 */
loader_c::loader_c() {
mpCommand = nullptr;
mSize = -1;
@@ -20,10 +18,8 @@ loader_c::loader_c() {
mpBuffer = nullptr;
}
/** 80052130 */
loader_c::~loader_c() {}
/** 80052170 */
void *loader_c::request(const char *path, u8 mountDirection, EGG::Heap *heap) {
if (mpBuffer != nullptr) {
return mpBuffer;
@@ -50,7 +46,6 @@ void *loader_c::request(const char *path, u8 mountDirection, EGG::Heap *heap) {
}
}
/** 800522a0 */
void loader_c::remove() {
if (mpHeap != nullptr && mpBuffer != nullptr) {
mpHeap->free(mpBuffer);
+1 -7
View File
@@ -2,23 +2,20 @@
#include "d/d_dvd_unk.h"
#include "d/d_gfx.h"
#include "d/d_reset.h"
#include "d/d_lyt_hio.h"
#include "d/d_reset.h"
#include "egg/gfx/eggDrawGX.h"
#include "egg/gfx/eggScreen.h"
#include "m/m_mtx.h"
#include "m/m_vec.h"
/** 805750d0 */
dDvdDriveError_c *dDvdDriveError_c::sInstance;
/** 80052300 */
void dDvdDriveError_c::create(EGG::Heap *heap) {
sInstance = new (heap, 0x04) dDvdDriveError_c();
sInstance->init();
}
/** 80052340 */
bool dDvdDriveError_c::isError() const {
return mIsError;
}
@@ -69,7 +66,6 @@ static const wchar_t *sErrorsFr[] = {
extern "C" u8 fn_80054F30();
/** 80052350 */
void dDvdDriveError_c::draw() {
EGG::Screen screen;
screen.SetCanvasMode(EGG::Screen::CANVASMODE_0);
@@ -136,7 +132,6 @@ void dDvdDriveError_c::draw() {
textWriter.Print(str, wcslen(str));
}
/** 800526b0 */
void dDvdDriveError_c::execute() {
mDvdDriveStatus = DVDGetDriveStatus();
if (!mIsError) {
@@ -151,7 +146,6 @@ void dDvdDriveError_c::execute() {
}
}
/** 80052750 */
void dDvdDriveError_c::init() {
mDvdDriveStatus = DVD_STATE_IDLE;
mIsError = false;
+2 -4
View File
@@ -4,10 +4,10 @@
#include "common.h"
#include "m/m_dvd.h"
#include "m/m_heap.h"
#include "rvl/DVD.h" // IWYU pragma: export
#include "rvl/NAND.h" // IWYU pragma: export
#include "string.h"
#include "rvl/DVD.h" // IWYU pragma: export
#include "rvl/NAND.h" // IWYU pragma: export
struct RelNamePtr {
u16 relId;
@@ -42,7 +42,6 @@ NandChunkStatus status_1 = Success;
NandChunkStatus status_2 = Success;
char relsDir[] = "/rels";
/** 80052E00 */
int initDylinkHeap(int maxRelId, const RelNamePtr *dynNameTable, int dynNameTableNum, EGG::Heap *parentHeap) {
cCc_frmHeap = mHeap::createFrmHeap(
maxRelId * 0x10 + dynNameTableNum * 0x48, parentHeap, "ダイナミックリンク制御用ヒープ(dDyl::cCc_frmHeap)", 0x20,
@@ -80,7 +79,6 @@ int initDylinkHeap(int maxRelId, const RelNamePtr *dynNameTable, int dynNameTabl
return 1;
}
/** 80052FA0 */
bool isLinked(u16 relId) {
return pDMC[relId] != nullptr ? pDMC[relId]->isLinked() : true;
}
+5 -28
View File
@@ -1,6 +1,7 @@
#include "d/flag/baseflag_manager.h"
ItemStoryManagerBase::ItemStoryManagerBase(): mFlagCount(0), mFlagSizeBytes(0), mpFlagSpace(nullptr), mpFlagIndex(nullptr), mDirty(false) {}
ItemStoryManagerBase::ItemStoryManagerBase()
: mFlagCount(0), mFlagSizeBytes(0), mpFlagSpace(nullptr), mpFlagIndex(nullptr), mDirty(false) {}
ItemStoryManagerBase::~ItemStoryManagerBase() {
if (mpFlagIndex != nullptr) {
delete mpFlagIndex;
@@ -12,19 +13,16 @@ void ItemStoryManagerBase::setFlagSizes(u16 flagCount, u16 flagSizeBytes) {
mFlagSizeBytes = flagSizeBytes;
}
/** 800bf320 */
void ItemStoryManagerBase::createFlagIndex(FlagDefinition *def, u16 count) {
mpFlagIndex = new FlagIndex(count, def);
}
/** 800bf380 */
void ItemStoryManagerBase::copyFromSave() {
FlagSpace *current = mpFlagSpace;
const u16 *saved = getSaveFlagSpace();
current->copyFromSaveFile(saved, 0, mFlagCount);
}
/** 800bf3e0 */
void ItemStoryManagerBase::init() {
const u16 *space = getSaveFlagSpace();
if (space == nullptr || mpFlagIndex == nullptr) {
@@ -34,24 +32,18 @@ void ItemStoryManagerBase::init() {
}
}
/** 800bf470 */
void ItemStoryManagerBase::initFlagSpace() {
void ItemStoryManagerBase::initFlagSpace() {}
}
/** 800bf480 */
u16 ItemStoryManagerBase::getFlag(u16 flag) const {
const u16 *data = getSaveFlagSpace();
return mpFlagIndex->getCounterOrFlag(flag, data, mFlagCount);
}
/** 800bf4e0 */
u16 ItemStoryManagerBase::getUncommittedValue_Priv(u16 flag) const {
u16 *data = mpFlagSpace->getFlagPtrUnchecked();
return mpFlagIndex->getCounterOrFlag(flag, data, mFlagCount);
}
/** 800bf530 */
void ItemStoryManagerBase::setOrClearFlag(u16 flag, u16 value) {
FlagSpace *storyFlagsPtr = mpFlagSpace;
u16 *pData = storyFlagsPtr->getFlagPtrChecked();
@@ -59,59 +51,44 @@ void ItemStoryManagerBase::setOrClearFlag(u16 flag, u16 value) {
onFlagChange(flag);
}
/** 800bf5b0 */
void ItemStoryManagerBase::setFlag(u16 flag) {
setOrClearFlag(flag, true);
}
/** 800bf5c0 */
void ItemStoryManagerBase::unsetFlag(u16 flag) {
setOrClearFlag(flag, false);
}
/** 800bf5d0 */
void ItemStoryManagerBase::setFlagOrCounterToValue(u16 flag, u16 value) {
setOrClearFlag(flag, value);
}
/** 800bf5e0 */
u16 ItemStoryManagerBase::getCounterOrFlag(u16 flag) const {
return ItemStoryManagerBase::getFlag(flag);
}
/** 800bf5f0 */
u16 ItemStoryManagerBase::getUncommittedValue(u16 flag) const {
return getUncommittedValue_Priv(flag);
}
/** 800bf600 */
u16 ItemStoryManagerBase::unk3(u16 flag) {
return getMaskForFlag(flag);
}
/** 800bf610 */
void ItemStoryManagerBase::onFlagChange(u16 flag) {
mDirty = true;
onDirty();
}
/** 800bf630 */
void ItemStoryManagerBase::onDirty() {
void ItemStoryManagerBase::onDirty() {}
}
/** 800bf640 */
u16 ItemStoryManagerBase::getMaskForFlag(u16 flag) {
return mpFlagIndex->maskForIdx(flag, mFlagCount);
}
/** 800bf650 */
void ItemStoryManagerBase::doCommit_Priv() {
doCommit();
mDirty = false;
}
/* 800bf690 */
void ItemStoryManagerBase::postCommit() {
}
void ItemStoryManagerBase::postCommit() {}
+3 -13
View File
@@ -1,64 +1,54 @@
#include "d/flag/dungeonflag_manager.h"
#include "d/flag/flag_index.h"
// TODO move
extern "C" FlagDefinition DungeonflagManager__FLAG_DEFINITIONS[];
/** 80575404 */
DungeonflagManager *DungeonflagManager::sInstance = nullptr;
/** 805a9c58 */
u16 DungeonflagManager::sDungeonFlags[8] = {};
/** 800bf8d0 */
void DungeonflagManager::copyFromSave_Internal(u16 flagIndex) {
mFlagSpace.copyFromSaveFile(saveFilePtr(flagIndex), 0, 0x8);
}
/** 800bf930 */
void DungeonflagManager::setCommitFlag(u16 flag) {
mShouldCommit = true;
}
/** 0x800bf940 */
DungeonflagManager::DungeonflagManager()
: mShouldCommit(false), mStageIndex(-1), mpFlagIndex(nullptr),
: mShouldCommit(false),
mStageIndex(-1),
mpFlagIndex(nullptr),
mFlagSpace(sDungeonFlags, ARRAY_LENGTH(sDungeonFlags)) {}
/** 800bf980 */
void DungeonflagManager::init() {
mpFlagIndex = new FlagIndex(0x11, DungeonflagManager__FLAG_DEFINITIONS);
mShouldCommit = false;
}
/** 800bf9e0 */
void DungeonflagManager::copyFromSave(u32 flag) {
mStageIndex = flag;
copyFromSave_Internal(flag);
}
/** 800bf9f0 */
void DungeonflagManager::setToValue(u16 flag, u32 value) {
u16 *data = mFlagSpace.getFlagPtrChecked();
mpFlagIndex->setCounterOrFlag(flag, data, 8, value);
setCommitFlag(flag);
}
/** 800bfa60 */
void DungeonflagManager::setFlag(u16 flag) {
u16 *data = mFlagSpace.getFlagPtrChecked();
mpFlagIndex->setCounterOrFlag(flag, data, 8, 1);
setCommitFlag(flag);
}
/** 800fbac0 */
u16 DungeonflagManager::getDungeonFlag(u16 flag) {
u16 *data = mFlagSpace.getFlagPtrUnchecked();
return mpFlagIndex->getCounterOrFlag(flag, data, 8);
}
/** 800fbb10 */
bool DungeonflagManager::commit() {
FileManager *instance;
u16 idx = mStageIndex;
+1 -10
View File
@@ -5,36 +5,29 @@
#include "d/flag/skipflag_manager.h"
#include "toBeSorted/file_manager.h"
// 0x80575408
SkipflagManager *SkipflagManager::sInstance = nullptr;
// 0x805A9C68
u16 SkipflagManager::sSkipFlags[16] = {};
// 800bfba0
void SkipflagManager::doCopyFromSave() {
u16 *savedSkipflags = FileManager::GetInstance()->getSkipFlags();
mFlagSpace.copyFromSaveFile(savedSkipflags, 0, 0x10);
}
// 800bfbf0
void SkipflagManager::setCommitFlag(u16 flag) {
mShouldCommit = true;
}
// 800bfc00
SkipflagManager::SkipflagManager() : mFlagSpace(sSkipFlags, ARRAY_LENGTH(sSkipFlags)), mShouldCommit(false) {}
// 800bfc30
void SkipflagManager::init() {
mShouldCommit = false;
}
// 800bfc40
void SkipflagManager::copyFromSave() {
doCopyFromSave();
}
// 800bfc50
void SkipflagManager::setFlag(u16 flag) {
mFlagHelper.setFlag(flag / 16, flag % 16, mFlagSpace.getFlagPtrChecked(), mFlagSpace.mCount);
@@ -46,13 +39,11 @@ void SkipflagManager::setFlag(u16 flag) {
setCommitFlag(flag);
}
// 800bfd20
bool SkipflagManager::checkFlag(u16 flag) {
u16 *savedSkipflags = FileManager::GetInstance()->getSkipFlags();
return mFlagHelper.checkFlag(flag / 16, flag % 16, savedSkipflags, 0x10);
}
// 800bfd90
bool SkipflagManager::commit() {
if (mShouldCommit) {
FileManager *instance = FileManager::GetInstance();
+7 -7
View File
@@ -2,16 +2,16 @@
#include "egg/core/eggHeap.h"
/* 804952d0 */ static void *AllocatorAllocForHeap_(MEMAllocator *alloc, u32 size) {
static void *AllocatorAllocForHeap_(MEMAllocator *alloc, u32 size) {
return static_cast<EGG::Heap *>(static_cast<EGG::Allocator *>(alloc)->heap)->alloc(size, alloc->heapParam1);
}
/* 804952f0 */ static void AllocatorFreeForHeap_(MEMAllocator *alloc, void *block) {
static void AllocatorFreeForHeap_(MEMAllocator *alloc, void *block) {
return static_cast<EGG::Heap *>(static_cast<EGG::Allocator *>(alloc)->heap)->free(block);
}
// TODO this is used from eggHeap for some reason. Figure out
// the correct privacy boundary later.
/* 80495310 */ void MEMInitAllocatorFor_Heap(MEMAllocator *alloc, s32 align, void *heap) {
void MEMInitAllocatorFor_Heap(MEMAllocator *alloc, s32 align, void *heap) {
static const MEMAllocatorFuncs sAllocatorFunc = {
&AllocatorAllocForHeap_,
&AllocatorFreeForHeap_,
@@ -25,17 +25,17 @@
namespace EGG {
/* 80495330 */ Allocator::Allocator(Heap *heap, s32 align) : mHeap(heap), align(align) {
Allocator::Allocator(Heap *heap, s32 align) : mHeap(heap), align(align) {
MEMInitAllocatorFor_Heap(this, align, heap);
}
/* 80495380 */ Allocator::~Allocator() {}
Allocator::~Allocator() {}
/* 804953c0 */ void *Allocator::alloc(u32 size) {
void *Allocator::alloc(u32 size) {
return Heap::alloc(size, align, mHeap);
}
/* 804953e0 */ void Allocator::free(void *block) {
void Allocator::free(void *block) {
Heap::free(block, mHeap);
}
+6 -2
View File
@@ -1,11 +1,15 @@
#include "egg/core/eggColorFader.h"
/* 80497930 */
EGG::ColorFader::ColorFader(
float startX, float startY, float lengthX, float lengthY, nw4r::ut::Color color, Fader::EStatus initialStatus
)
: mStartX(startX), mStartY(startY), mEndX(startX + lengthX), mEndY(startY + lengthY), mFrame(0x14), mFadeTimer(0),
: mStartX(startX),
mStartY(startY),
mEndX(startX + lengthX),
mEndY(startY + lengthY),
mFrame(0x14),
mFadeTimer(0),
mFlags(0) {
setColor(color);
setStatus(initialStatus);
+10 -11
View File
@@ -2,6 +2,7 @@
#include "egg/core/eggXfbManager.h"
#include "nw4r/db/db_directPrint.h"
#include "rvl/GX.h" // IWYU pragma: export
#include "rvl/OS.h" // IWYU pragma: export
@@ -14,21 +15,25 @@ namespace EGG {
u32 Display::sTickPeriod = ((OS_BUS_CLOCK_SPEED >> 2) / 125000) * 300 >> 3;
/* 80497570 */
Display::Display(u8 maxRetrace)
: mMaxRetraces(maxRetrace), mScreenStateFlag(0), mRetraceCount(0), mFrameCount(0), mClearColor(0x808080ff),
mClearZ(0xFFFFFF), mBeginTick(0), mFlag(0) {
: mMaxRetraces(maxRetrace),
mScreenStateFlag(0),
mRetraceCount(0),
mFrameCount(0),
mClearColor(0x808080ff),
mClearZ(0xFFFFFF),
mBeginTick(0),
mFlag(0) {
mFlag.setBit(mFlag_SetClear);
mFlag.setBit(mFlag_WaitForRetrace);
nw4r::db::DirectPrint_Init();
VISetPreRetraceCallback(PreRetraceCallback);
}
/* vt 0x18 | 804975f0 */
u32 Display::getTickPerFrame() {
return Video::getTickPerVRetrace();
}
/* vt 0x08 | 80497600 */
void Display::beginFrame() {
GXDrawDone();
if (mFlag.onBit(mFlag_WaitForRetrace) ||
@@ -44,22 +49,18 @@ void Display::beginFrame() {
mFrameCount++;
}
/* vt 0x0C | 804976c0 */
void Display::beginRender() {
return;
}
/* vt 0x10 | 804976d0 */
void Display::endRender() {
return;
}
/* vt 0x14 | 804976e0 */
void Display::endFrame() {
return;
}
/* vt 0x1C | 804976f0 */
void Display::preVRetrace() {
mLastTick = OSGetTick();
if (VIGetRetraceCount() - mRetraceCount < mMaxRetraces) {
@@ -73,7 +74,6 @@ void Display::preVRetrace() {
mRetraceCount = VIGetRetraceCount();
}
/* 804977d0 */
void Display::copyEFBtoXFB() {
if (mFlag.onBit(mFlag_SetClear)) {
GXSetCopyClear(mClearColor, mClearZ);
@@ -83,7 +83,6 @@ void Display::copyEFBtoXFB() {
BaseSystem::getXfbMgr()->copyEFB(mFlag.onBit(mFlag_SetClear));
}
/* 80497870 */
void Display::calcFrequency() {
s32 endTick = OSGetTick();
mDeltaTick = endTick - mBeginTick;
-4
View File
@@ -7,7 +7,6 @@ namespace EGG {
bool DvdRipper::sErrorRetry = true;
DvdRipper::UnkCallback DvdRipper::sCallback;
/* 80494680 */
u8 *DvdRipper::loadToMainRAM(
s32 entryNum, u8 *dst, Heap *heap, EAllocDirection allocDir, u32 offset, u32 *amountRead, u32 *fileSize
) {
@@ -18,7 +17,6 @@ u8 *DvdRipper::loadToMainRAM(
return loadToMainRAM(&file, dst, heap, allocDir, offset, amountRead, fileSize);
}
/* 80494730 */
u8 *DvdRipper::loadToMainRAM(
const char *path, u8 *dst, Heap *heap, EAllocDirection allocDir, u32 offset, u32 *amountRead, u32 *fileSize
) {
@@ -29,7 +27,6 @@ u8 *DvdRipper::loadToMainRAM(
return loadToMainRAM(&file, dst, heap, allocDir, offset, amountRead, fileSize);
}
/* 804947e0 */
u8 *DvdRipper::loadToMainRAM(
DvdFile *pFile, u8 *pOut, Heap *pHeap, EAllocDirection allocDir, u32 offset, u32 *pRead, u32 *pSize
) {
@@ -107,7 +104,6 @@ u8 *DvdRipper::loadToMainRAM(
return pOut;
}
/* 804949b0 */
void *DvdRipper::loadToMainRAMDecomp(
DvdFile *file, StreamDecomp *decompressor, u8 *pOut, Heap *heap, EAllocDirection allocDir, s32 offset, u32 size,
u32 chunkSize, u32 *pRead, u32 *pSize
+13 -33
View File
@@ -6,28 +6,26 @@
namespace EGG {
/* 80673ae8 */ nw4r::ut::List Heap::sHeapList;
/* 80673af8 */ OSMutex Heap::sRootMutex;
/* 80576740 */ Heap *Heap::sCurrentHeap;
/* 80576744 */ int Heap::sIsHeapListInitialized;
/* 80576748 */ Heap *Heap::sAllocatableHeap;
/* 8057674c */ ErrorCallback Heap::sErrorCallback;
/* 80576750 */ HeapAllocCallback Heap::sAllocCallback;
/* 80576754 */ HeapFreeCallback Heap::sFreeCallback;
/* 80576758 */ void *Heap::sErrorCallbackArg;
/* 8057675c */ void *Heap::sAllocCallbackArg;
/* 80576760 */ void *Heap::sFreeCallbackArg;
/* 80576764 */ HeapCreateCallback Heap::sCreateCallback;
/* 80576764 */ HeapDestroyCallback Heap::sDestroyCallback;
nw4r::ut::List Heap::sHeapList;
OSMutex Heap::sRootMutex;
Heap *Heap::sCurrentHeap;
int Heap::sIsHeapListInitialized;
Heap *Heap::sAllocatableHeap;
ErrorCallback Heap::sErrorCallback;
HeapAllocCallback Heap::sAllocCallback;
HeapFreeCallback Heap::sFreeCallback;
void *Heap::sErrorCallbackArg;
void *Heap::sAllocCallbackArg;
void *Heap::sFreeCallbackArg;
HeapCreateCallback Heap::sCreateCallback;
HeapDestroyCallback Heap::sDestroyCallback;
/* 804953f0 */
void Heap::initialize() {
nw4r::ut::List_Init(&sHeapList, 0x1c /* todo offsetof() */);
OSInitMutex(&sRootMutex);
sIsHeapListInitialized = true;
}
/* 80495430 */
Heap::Heap(MEMiHeapHead *head) : mHeapHandle(head), mParentBlock(nullptr), mName("NoName"), mFlag() {
mFlag.value = 0;
nw4r::ut::List_Init(&mChildren, 0x8 /* todo offsetof() */);
@@ -36,14 +34,12 @@ Heap::Heap(MEMiHeapHead *head) : mHeapHandle(head), mParentBlock(nullptr), mName
OSUnlockMutex(&sRootMutex);
}
/* 804954c0 */
Heap::~Heap() {
OSLockMutex(&sRootMutex);
nw4r::ut::List_Remove(&sHeapList, this);
OSUnlockMutex(&sRootMutex);
}
/* 80495560 */
void *Heap::alloc(size_t size, int align, Heap *heap) {
Heap *currentHeap = sCurrentHeap;
Thread *thread = Thread::findThread(OSGetCurrentThread());
@@ -86,7 +82,6 @@ void *Heap::alloc(size_t size, int align, Heap *heap) {
return ptr;
}
/* 80495690 */
Heap *Heap::findHeap(MEMiHeapHead *head) {
Heap *heap = nullptr;
OSLockMutex(&sRootMutex);
@@ -103,7 +98,6 @@ Heap *Heap::findHeap(MEMiHeapHead *head) {
return heap;
}
/* 80495730 */
Heap *Heap::findParentHeap() {
Heap *retHeap = nullptr;
MEMiHeapHead *heap = MEMFindParentHeap(mHeapHandle);
@@ -114,7 +108,6 @@ Heap *Heap::findParentHeap() {
return retHeap;
}
/* 80495780 */
Heap *Heap::findContainHeap(const void *memBlock) {
Heap *retHeap = nullptr;
MEMiHeapHead *heap = MEMFindContainHeap(memBlock);
@@ -125,7 +118,6 @@ Heap *Heap::findContainHeap(const void *memBlock) {
return retHeap;
}
/* 804957c0 */
void Heap::free(void *ptr, Heap *heap) {
if (heap == nullptr) {
MEMiHeapHead *iheap = MEMFindContainHeap(ptr);
@@ -141,7 +133,6 @@ void Heap::free(void *ptr, Heap *heap) {
heap->free(ptr);
}
/* 80495830 */
void Heap::dispose() {
mFlag.setBit(1);
Heap *heap;
@@ -151,10 +142,8 @@ void Heap::dispose() {
mFlag.resetBit(1);
}
/* 804958a0 */
void Heap::dump() {}
/* 804958b0 */
void Heap::dumpAll() {
Heap *heap = nullptr;
u32 mem[2] = {0, 0};
@@ -178,7 +167,6 @@ void Heap::dumpAll() {
OSUnlockMutex(&sRootMutex);
}
/* 804959a0 */
Heap *Heap::becomeCurrentHeap() {
OSLockMutex(&sRootMutex);
Heap *h = sCurrentHeap;
@@ -187,7 +175,6 @@ Heap *Heap::becomeCurrentHeap() {
return h;
}
/* 80495a00 */
Heap *Heap::_becomeCurrentHeapWithoutLock() {
Heap *h = sCurrentHeap;
sCurrentHeap = this;
@@ -196,31 +183,24 @@ Heap *Heap::_becomeCurrentHeapWithoutLock() {
}
// TODO this could be an inline virtual function
/* 80495a40 */
void Heap::initAllocator(Allocator *alloc, s32 align) {
MEMInitAllocatorFor_Heap(alloc, align, this);
}
} // namespace EGG
/* 80495a60 */
void *operator new(size_t, void *p) {
return p;
}
/* 80495a70 */
void *operator new(size_t size, EGG::Heap *heap, int align) {
return EGG::Heap::alloc(size, align, heap);
}
/* 80495a80 */
void *operator new(size_t size, EGG::Allocator *alloc) {
return MEMAllocFromAllocator(alloc->getHandle(), size);
}
/* 80495a90 */
void *operator new[](size_t size, int align) {
return EGG::Heap::alloc(size, align, nullptr);
}
/* 80495aa0 */
void *operator new[](size_t size, EGG::Heap *heap, int align) {
return EGG::Heap::alloc(size, align, heap);
}
+11 -11
View File
@@ -2,10 +2,10 @@
namespace EGG {
/* 80673b10 */ nw4r::ut::List Thread::sThreadList;
/* 80576770 */ void (*Thread::sOldSwitchThreadCallback)(OSThread *, OSThread *);
nw4r::ut::List Thread::sThreadList;
void (*Thread::sOldSwitchThreadCallback)(OSThread *, OSThread *);
/* 80496910 */ Thread::Thread(u32 stackSize, int msgCount, int priority, Heap *heap) {
Thread::Thread(u32 stackSize, int msgCount, int priority, Heap *heap) {
if (heap == nullptr) {
heap = Heap::sCurrentHeap;
}
@@ -20,7 +20,7 @@ namespace EGG {
setCommonMesgQueue(msgCount, mContainingHeap);
}
/* 804969e0 */ Thread::Thread(OSThread *osThread, int msgCount) {
Thread::Thread(OSThread *osThread, int msgCount) {
mContainingHeap = nullptr;
mOSThread = osThread;
mStackSize = (u8 *)osThread->stackBegin - (u8 *)osThread->stackEnd;
@@ -30,7 +30,7 @@ namespace EGG {
setCommonMesgQueue(msgCount, Heap::sCurrentHeap);
}
/* 80496a60 */ Thread::~Thread() {
Thread::~Thread() {
nw4r::ut::List_Remove(&sThreadList, this);
if (mContainingHeap != nullptr) {
if (!OSIsThreadTerminated(mOSThread)) {
@@ -43,7 +43,7 @@ namespace EGG {
Heap::free(mMesgBuffer, nullptr);
}
/* 80496b20 */ Thread *Thread::findThread(OSThread *thread) {
Thread *Thread::findThread(OSThread *thread) {
Thread *ptr = nullptr;
while ((ptr = (Thread *)nw4r::ut::List_GetNext(&sThreadList, ptr)) != nullptr) {
if (ptr->mOSThread == thread) {
@@ -53,13 +53,13 @@ namespace EGG {
return nullptr;
}
/* 80496b90 */ void Thread::initialize() {
void Thread::initialize() {
// TODO offsetof
nw4r::ut::List_Init(&sThreadList, 0x44);
sOldSwitchThreadCallback = OSSetSwitchThreadCallback(switchThreadCallback);
}
/* 80496bd0 */ void Thread::setThreadCurrentHeap(Heap *heap) {
void Thread::setThreadCurrentHeap(Heap *heap) {
OSDisableScheduler();
OSThread *myThread = mOSThread;
OSThread *currentThread = OSGetCurrentThread();
@@ -82,7 +82,7 @@ namespace EGG {
OSEnableScheduler();
}
/* 80496c70 */ void Thread::switchThreadCallback(OSThread *from, OSThread *to) {
void Thread::switchThreadCallback(OSThread *from, OSThread *to) {
Thread *fromThread = from != nullptr ? findThread(from) : nullptr;
Thread *toThread = to != nullptr ? findThread(to) : nullptr;
@@ -109,14 +109,14 @@ namespace EGG {
}
}
/* 80496d60 */ void Thread::setCommonMesgQueue(int mesgCount, Heap *heap) {
void Thread::setCommonMesgQueue(int mesgCount, Heap *heap) {
mMesgCount = mesgCount;
mMesgBuffer = Heap::alloc<OSMessage>(mesgCount, heap);
OSInitMessageQueue(&mMesgQueue, mMesgBuffer, mMesgCount);
nw4r::ut::List_Append(&sThreadList, this);
}
/* 80496dc0 */ void *Thread::start(void *arg) {
void *Thread::start(void *arg) {
Thread *thread = static_cast<Thread *>(arg);
return thread->run();
}
+5 -5
View File
@@ -307,12 +307,12 @@ const EGG::Video::RenderModeObjSet renderModes = {
&gRMO_Ntsc_640x456IntDf_4x3}
};
/* 80498690 */ void Video::initialize(GXRenderModeObj *obj, const RenderModeObjSet *set) {
void Video::initialize(GXRenderModeObj *obj, const RenderModeObjSet *set) {
VIInit();
configure(obj, set);
}
/* 804986f0 */ GXRenderModeObj *Video::configure(GXRenderModeObj *obj, const RenderModeObjSet *set) {
GXRenderModeObj *Video::configure(GXRenderModeObj *obj, const RenderModeObjSet *set) {
GXRenderModeObj *oldMode = pRenderMode;
if (set == nullptr) {
set = &renderModes;
@@ -349,14 +349,14 @@ f32 itof(u32 n) {
return n;
}
// TODO VITvFormat
/* 80498800 */ u32 Video::getTickPerVRetrace(u32 tvFormat) {
u32 Video::getTickPerVRetrace(u32 tvFormat) {
f32 val = tvFormat - 1 <= VI_TV_FMT_PAL ? 50.0f : 59.94f;
return (u32)((OS_BUS_CLOCK_SPEED >> 2) / val);
}
/* 80498860 */ u32 Video::getTickPerVRetrace() {
u32 Video::getTickPerVRetrace() {
return getTickPerVRetrace(VIGetTvFormat());
}
/* 80498890 */ const GXRenderModeObj *Video::getStandardRenderModeObj(const RenderModeObjSet *set) {
const GXRenderModeObj *Video::getStandardRenderModeObj(const RenderModeObjSet *set) {
bool pmode = SCGetProgressiveMode() == 1;
bool rbg60mode = SCGetEuRgb60Mode() == 1;
bool aspect = SCGetAspectRatio() == 0;
+3 -4
View File
@@ -3,10 +3,9 @@
#include "egg/core/eggSystem.h"
#include "egg/core/eggVideo.h"
namespace EGG {
/* 804989e0 */ void Xfb::init(u16 width, u16 height, Heap *heap) {
void Xfb::init(u16 width, u16 height, Heap *heap) {
mWidth = width;
mHeight = height;
u32 size = calcBufferSize(width, height);
@@ -21,12 +20,12 @@ namespace EGG {
mState = XFB_UNPROCESSED;
}
/* 80498a60 */ Xfb::Xfb(Heap *heap) {
Xfb::Xfb(Heap *heap) {
Video *video = BaseSystem::mConfigData->getVideo();
init(video->pRenderMode->fbWidth, video->pRenderMode->xfbHeight, heap);
}
/* 80498ad0 */ u32 Xfb::calcBufferSize(u16 width, u16 height) {
u32 Xfb::calcBufferSize(u16 width, u16 height) {
return ((width + 0xf) & 0xfff0) * height * 2;
}
+5 -5
View File
@@ -3,12 +3,12 @@
#include "common.h"
#include "egg/core/eggXfb.h"
#include "nw4r/db/db_directPrint.h"
#include "rvl/VI.h" // IWYU pragma: export
#include "rvl/VI.h" // IWYU pragma: export
namespace EGG {
/* 80498af0 */ bool XfbManager::isRegisterd(Xfb &xfb) const {
bool XfbManager::isRegisterd(Xfb &xfb) const {
Xfb *x = mNextXfb;
Xfb *iter = x;
@@ -23,7 +23,7 @@ namespace EGG {
return false;
}
/* 80498b30 */ bool XfbManager::attach(Xfb *xfb) {
bool XfbManager::attach(Xfb *xfb) {
int interrupts = OSDisableInterrupts();
bool u3 = 0;
@@ -47,7 +47,7 @@ namespace EGG {
OSRestoreInterrupts(interrupts);
return u3;
}
/* 80498c10 */ void XfbManager::copyEFB(bool bUpdate) {
void XfbManager::copyEFB(bool bUpdate) {
if (mNumXfbs == 1 && mToCopyXfb == nullptr) {
mToCopyXfb = mNextXfb;
}
@@ -75,7 +75,7 @@ namespace EGG {
}
}
/* 80498d00 */ void XfbManager::setNextFrameBuffer() {
void XfbManager::setNextFrameBuffer() {
if (mToShowXfb != nullptr) {
if (mNumXfbs_Copy > 2) {
mNumXfbs_Copy -= 1;
-9
View File
@@ -2,7 +2,6 @@
namespace EGG {
/* 8049b390 */
void Quatf::set(f32 fw, f32 fx, f32 fy, f32 fz) {
w = fw;
v.x = fx;
@@ -73,7 +72,6 @@ void Quatf::setRPY(f32 roll, f32 pitch, f32 yaw) {
setRPY(Vector3f(roll, pitch, yaw));
}
/* 8049b3b0 */
void Quatf::setAxisRotation(const Vector3f &axis, f32 rot) {
2.0f; // force sdata2 ordering
const f32 half_angle = rot * 0.5f;
@@ -82,12 +80,10 @@ void Quatf::setAxisRotation(const Vector3f &axis, f32 rot) {
set(cos, sin * axis.x, sin * axis.y, sin * axis.z);
}
/* 8049b450 */
f32 Quatf::norm() {
return w * w + v.dot(v);
}
/* 8049b480 */
void Quatf::normalise() {
f32 mag = Math<f32>::sqrt(norm());
if (mag > 0.0f) {
@@ -95,7 +91,6 @@ void Quatf::normalise() {
}
}
/* 8049b500 */
Quatf Quatf::conjugate() const {
Quatf q;
q.w = w;
@@ -103,7 +98,6 @@ Quatf Quatf::conjugate() const {
return q;
}
/* 8049b550 */
Vector3f Quatf::rotateVector(const Vector3f &vec) {
Quatf conj, mult;
conj = conjugate();
@@ -120,7 +114,6 @@ Vector3f Quatf::rotateVector(const Vector3f &vec) {
// return ret;
// }
/* 8049b800 */
void Quatf::slerpTo(const Quatf &q2, f32 t, Quatf &out) const {
f32 dot = v.x * q2.v.x + v.y * q2.v.y + v.z * q2.v.z + w * q2.w;
@@ -162,7 +155,6 @@ void Quatf::slerpTo(const Quatf &q2, f32 t, Quatf &out) const {
out.w = a * w + b * q2.w;
}
/* 8049b9d0 */
void Quatf::limitSlerpTo(const Quatf &q2, f32 t, f32 t2, Quatf &out) const {
t2 *= 0.5f;
@@ -210,7 +202,6 @@ void Quatf::limitSlerpTo(const Quatf &q2, f32 t, f32 t2, Quatf &out) const {
out.w = a * w + b * q2.w;
}
/* 8049bbb0 */
void Quatf::makeVectorRotation(const Vector3f &from, const Vector3f &to) {
Vector3f cross = from.cross(to);
f32 t0 = (from.dot(to) + 1) * 2.0f;
+12 -15
View File
@@ -5,10 +5,10 @@
#include "egg/core/eggXfbManager.h"
#include "nw4r/db/db_directPrint.h"
#include "nw4r/db/db_mapFile.h"
#include "rvl/OS.h" // IWYU pragma: export
#include "rvl/VI.h" // IWYU pragma: export
#include "string.h"
#include "rvl/OS.h" // IWYU pragma: export
#include "rvl/VI.h" // IWYU pragma: export
namespace EGG {
@@ -20,7 +20,7 @@ u32 sPtrOverride;
bool sInstantHalt;
bool sAssertOccurred;
/* 8049bf90 */ void wait(u32 time) {
void wait(u32 time) {
u32 tick = OSGetTick();
u32 tick2;
do {
@@ -28,18 +28,16 @@ bool sAssertOccurred;
} while ((tick2 - tick) / (OS_BUS_CLOCK_SPEED / 4 / 1000) < time);
}
// extern "C" void OSVReport(const char *str, va_list list);
/* 8049c010 */ void system_vreport(const char *str, va_list list) {
void system_vreport(const char *str, va_list list) {
OSVReport(str, list);
}
/* 8049c010 */ void system_report(const char *str, ...) {
void system_report(const char *str, ...) {
va_list l;
va_start(l, str);
system_vreport(str, l);
va_end(l);
}
/* 8049c0a0 */ s32 getPeriodPos(const char *str) {
s32 getPeriodPos(const char *str) {
char *b = strchr(str, '.');
s32 len;
if (b == nullptr) {
@@ -54,28 +52,27 @@ bool sAssertOccurred;
return len;
}
/* 80674c60 */ char buf[260];
char buf[260];
/* 8049c100 */ const char *getMapSymbol(void *arg) {
const char *getMapSymbol(void *arg) {
bool success = nw4r::db::MapFile_QuerySymbol((u32)arg, (u8 *)buf, sizeof(buf));
return success ? buf : nullptr;
}
/* 8049c150 */ bool isOutsideMEM1(u32 addr) {
bool isOutsideMEM1(u32 addr) {
if (!(0x80000000 <= addr) || !(addr <= 0x83000000 - 1)) {
return true;
}
return false;
}
/* 8049c180 */ AssertCallback setAssertCallback(AssertCallback cb) {
AssertCallback setAssertCallback(AssertCallback cb) {
AssertCallback old = sAssertCallback;
sAssertCallback = cb;
return old;
}
/* 8049c190 */ void system_halt(const char *file, u32 line, const char *msg, va_list list) {
void system_halt(const char *file, u32 line, const char *msg, va_list list) {
if (sAssertOccurred) {
#line 152
OSError("Recursive assertioned");
@@ -185,7 +182,7 @@ end:
OSError("Program Halt");
return;
}
/* 8049c530 */ void assert(const char *file, u32 line, const char *msg, ...) {
void assert(const char *file, u32 line, const char *msg, ...) {
va_list l;
va_start(l, msg);
system_halt(file, line, msg, l);
-50
View File
@@ -3,11 +3,6 @@
#include "m/m_heap.h"
#include "string.h"
/*
.text File Range:
[802e12f0 - 802e2680]
*/
// This file will be ported from
// https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/source/dol/framework/f_base.cpp
@@ -15,13 +10,10 @@ fBaseID_e fBase_c::m_rootUniqueID = FIRST_ID;
fBase_c::ConstructData fBase_c::m_tmpCtData;
// 0x80575bb0: sLoadAsyncCallback__7fBase_c
// 0x80575bb4: sUnloadCallback__7fBase_c
fLiMgBa_c fBase_c::m_forceExecuteList;
int (*fBase_c::sLoadAsyncCallback)();
void (*fBase_c::sUnloadCallback)();
/* 802e12f0 */
fBase_c::fBase_c()
: mID(m_rootUniqueID),
mParams(m_tmpCtData.params),
@@ -56,7 +48,6 @@ fBase_c::fBase_c()
}
}
/* 802e1480 */
fBase_c::~fBase_c() {
// Is this static_cast fake? Maybe. But if actor_list is of type fLiMgBa_c,
// that causes a weak destructor to spawn that actually needs to be in f_manager.
@@ -69,7 +60,6 @@ fBase_c::~fBase_c() {
}
}
/* 802e1500 */
int fBase_c::commonPack(int (fBase_c::*doFunc)(), int (fBase_c::*preFunc)(), void (fBase_c::*postFunc)(MAIN_STATE_e)) {
MAIN_STATE_e state;
@@ -94,17 +84,14 @@ int fBase_c::commonPack(int (fBase_c::*doFunc)(), int (fBase_c::*preFunc)(), voi
return result;
}
/* 802e15c0 */
int fBase_c::create() {
return SUCCEEDED;
}
/* 802e15d0 */
int fBase_c::preCreate() {
return SUCCEEDED;
}
/* 802e15e0 */
void fBase_c::postCreate(MAIN_STATE_e state) {
if (state == SUCCESS) {
fManager_c::m_createManage.remove(&mManager.execute_node);
@@ -120,18 +107,14 @@ void fBase_c::postCreate(MAIN_STATE_e state) {
}
}
/* 802e1670 */
int fBase_c::doDelete() {
return SUCCEEDED;
}
/* 802e1680 */
int fBase_c::createPack() {
// Returns PACK_RESULT_e
return commonPack(&fBase_c::create, &fBase_c::preCreate, &fBase_c::postCreate);
}
/* 802e1730 */
int fBase_c::preDelete() {
if (mpHelper != nullptr && !mpHelper->LoadOnlyOne()) {
return NOT_READY;
@@ -146,7 +129,6 @@ int fBase_c::preDelete() {
return SUCCEEDED;
}
/* 802e17a0 */
void fBase_c::postDelete(MAIN_STATE_e state) {
// If the Actor is ready for deletion, make sure that it is:
// - Removed from the connection tree
@@ -173,18 +155,15 @@ void fBase_c::postDelete(MAIN_STATE_e state) {
}
}
/* 802e15d0 */
int fBase_c::deletePack() {
// Returns PACK_RESULT_e
return commonPack(&fBase_c::doDelete, &fBase_c::preDelete, &fBase_c::postDelete);
}
/* 802e1910 */
int fBase_c::execute() {
return SUCCEEDED;
}
/* 802e1920 */
int fBase_c::preExecute() {
// Do not execute if it has been flagged for deletion or marked as non-execute
if (mDeleteRequest || checkProcControl(DISABLE_EXECUTE)) {
@@ -194,13 +173,11 @@ int fBase_c::preExecute() {
return SUCCEEDED;
}
/* 802e1950 */
void fBase_c::postExecute(MAIN_STATE_e state) {
// Implemented per Actor
return;
}
/* 802e1960 */
int fBase_c::executePack() {
// Returns PACK_RESULT_e
int result = commonPack(&fBase_c::execute, &fBase_c::preExecute, &fBase_c::postExecute);
@@ -217,12 +194,10 @@ int fBase_c::executePack() {
return result;
}
/* 802e1a90 */
int fBase_c::draw() {
return SUCCEEDED;
}
/* 802e1aa0 */
int fBase_c::preDraw() {
// Do not draw if it has been flagged for deletion or marked as non-draw
if (mDeleteRequest || checkProcControl(DISABLE_DRAW)) {
@@ -232,22 +207,18 @@ int fBase_c::preDraw() {
return SUCCEEDED;
}
/* 802e1ad0 */
void fBase_c::postDraw(MAIN_STATE_e state) {
// Per Actor imple
return;
}
/* 802e1ae0 */
int fBase_c::drawPack() {
// Returns PACK_RESULT_e
return commonPack(&fBase_c::draw, &fBase_c::preDraw, &fBase_c::postDraw);
}
/* 802e1b90 */
void fBase_c::deleteReady() {}
/* 802e1ba0 */
int fBase_c::connectProc() {
if (mDeleteRequest) {
mDeleteRequest = false;
@@ -332,7 +303,6 @@ int fBase_c::connectProc() {
return SUCCEEDED;
}
/* 802e1e00 */
void fBase_c::deleteRequest() {
if (!mDeleteRequest && mLifecycleState != TO_BE_DELETED) {
mDeleteRequest = true;
@@ -344,7 +314,6 @@ void fBase_c::deleteRequest() {
}
}
/* 802e1e80 */
void fBase_c::forceUpdate() {
// There is probably an inline active here
if (((!mDeleteRequest && mLifecycleState != TO_BE_DELETED) && mLifecycleState != ACTIVE) &&
@@ -356,7 +325,6 @@ void fBase_c::forceUpdate() {
}
}
/* 802e1f10 */
fBase_c *fBase_c::getConnectRoot() {
if (fManager_c::m_connectManage.getRoot() != nullptr) {
return fManager_c::m_connectManage.getRoot()->p_owner;
@@ -364,7 +332,6 @@ fBase_c *fBase_c::getConnectRoot() {
return nullptr;
}
/* 802e1f30 */
fBase_c *fBase_c::getConnectTreeNext(fBase_c *actor) {
fBase_c *ret = nullptr;
@@ -379,7 +346,6 @@ fBase_c *fBase_c::getConnectTreeNext(fBase_c *actor) {
return ret;
}
/* 802e1f90 */
fBase_c *fBase_c::getConnectParent() const {
fTrNdBa_c *node = mManager.connect_node.getParent();
if (node != nullptr) {
@@ -388,7 +354,6 @@ fBase_c *fBase_c::getConnectParent() const {
return nullptr;
}
/* 802e1fb0 */
fBase_c *fBase_c::getConnectChild() const {
fTrNdBa_c *node = mManager.connect_node.getChild();
if (node != nullptr) {
@@ -397,7 +362,6 @@ fBase_c *fBase_c::getConnectChild() const {
return nullptr;
}
/* 802e1fd0 */
fBase_c *fBase_c::getConnectBrNext() const {
fTrNdBa_c *node = mManager.connect_node.getBrNext();
if (node != nullptr) {
@@ -406,7 +370,6 @@ fBase_c *fBase_c::getConnectBrNext() const {
return nullptr;
}
/* 802e1ff0 */
void fBase_c::updateExecutePriority(u16 order) {
if (mLifecycleState == ACTIVE && mUpdateRequest != UPDATE_FORCE) {
if (fManager_c::m_nowLoopProc == fManager_c::EXECUTE) {
@@ -422,7 +385,6 @@ void fBase_c::updateExecutePriority(u16 order) {
}
}
/* 802e2090 */
bool fBase_c::setConnectChild(fBase_c *child) {
if (child == nullptr || child->mLifecycleState == TO_BE_DELETED) {
return false;
@@ -435,7 +397,6 @@ bool fBase_c::setConnectChild(fBase_c *child) {
return fManager_c::m_connectManage.insertTreeNode(&mManager.connect_node, &child->mManager.connect_node);
}
/* 802e20e0 */
bool fBase_c::entryFrmHeap(size_t size, EGG::Heap *parentHeap) {
if (mpHeap != nullptr) {
return true;
@@ -514,7 +475,6 @@ bool fBase_c::entryFrmHeap(size_t size, EGG::Heap *parentHeap) {
return false;
}
/* 802e22e0 */
bool fBase_c::entryFrmHeapNonAdjust(size_t size, EGG::Heap *parentHeap) {
if (mpHeap != nullptr) {
return true;
@@ -538,12 +498,10 @@ bool fBase_c::entryFrmHeapNonAdjust(size_t size, EGG::Heap *parentHeap) {
return false;
}
/* 802e23a0 */
bool fBase_c::createHeap() {
return true;
}
/* 802e23b0 */
void *fBase_c::operator new(size_t size) {
void *mem = EGG::Heap::alloc(size, -4, mHeap::g_gameHeaps[0]);
if (mem != nullptr) {
@@ -552,12 +510,10 @@ void *fBase_c::operator new(size_t size) {
return mem;
}
/* 802e2410 */
void fBase_c::operator delete(void *block) {
EGG::Heap::free(block, mHeap::g_gameHeaps[0]);
}
/* 802e2420 */
void fBase_c::runCreate() {
createPack();
if ((!mDeleteRequest && (u8)mUpdateRequest == UPDATING) && mLifecycleState == WAITING_FOR_CREATE) {
@@ -569,7 +525,6 @@ void fBase_c::runCreate() {
}
}
/* 802e24a0 */
fBase_c *fBase_c::getChildProcessCreateState() const {
const fTrNdBa_c *connect_node = &mManager.connect_node;
fTrNdBa_c *end = connect_node->getTreeNextNotChild();
@@ -584,12 +539,10 @@ fBase_c *fBase_c::getChildProcessCreateState() const {
return nullptr;
}
/* 802e2510 */
bool fBase_c::checkChildProcessCreateState() const {
return getChildProcessCreateState() != nullptr;
}
/* 802e2540 */
void fBase_c::setTmpCtData(ProfileName profile_name, fTrNdBa_c *connect_parent, u32 param, u8 group_type) {
m_tmpCtData.prof_name = profile_name;
m_tmpCtData.connect_parent = connect_parent;
@@ -597,7 +550,6 @@ void fBase_c::setTmpCtData(ProfileName profile_name, fTrNdBa_c *connect_parent,
m_tmpCtData.group_type = group_type;
}
/* 802e2560 */
fBase_c *fBase_c::fBase_make(ProfileName profile_name, fTrNdBa_c *connect_parent, u32 param, u8 group_type) {
if ((*fProfile::sProfileList)[profile_name] == nullptr) {
return nullptr;
@@ -616,7 +568,6 @@ fBase_c *fBase_c::fBase_make(ProfileName profile_name, fTrNdBa_c *connect_parent
return actor;
}
/* 802e2600 */
fBase_c *fBase_c::createChild(ProfileName profile_name, fBase_c *parent, u32 param, u8 group_type) {
if (parent == nullptr) {
return nullptr;
@@ -629,7 +580,6 @@ fBase_c *fBase_c::createChild(ProfileName profile_name, fBase_c *parent, u32 par
return fBase_make(profile_name, &parent->mManager.connect_node, param, group_type);
}
/* 802e2640 */
fBase_c *fBase_c::createRoot(ProfileName profile_name, u32 param, u8 group_type) {
return fBase_make(profile_name, nullptr, param, group_type);
}
-6
View File
@@ -2,7 +2,6 @@
#include "f/f_list_mg.h"
#include "f/f_list_mg_ptmf.h"
/* 802e2680 */
void fLiMgPTMF_c::addNode(fLiNdPrio_c *add) {
fLiNdPrio_c *node = getFirst();
@@ -26,7 +25,6 @@ void fLiMgPTMF_c::addNode(fLiNdPrio_c *add) {
insertAfter(add, node);
}
/* 802e26e0 */
bool fLiMgPTMF_c::walkPack() {
if (mpProcFunc == nullptr) {
return true;
@@ -42,7 +40,6 @@ bool fLiMgPTMF_c::walkPack() {
return true;
}
/* 802e2760 */
const fLiNdBa_c *fLiMgBa_c::searchNodeByID(fBaseID_e id) const {
fLiNdBa_c *node = getFirst();
while (node != nullptr) {
@@ -54,7 +51,6 @@ const fLiNdBa_c *fLiMgBa_c::searchNodeByID(fBaseID_e id) const {
return nullptr;
}
/* 802e2790 */
const fLiNdBa_c *fLiMgBa_c::searchNodeByProfName(ProfileName name, fLiNdBa_c *start) const {
fLiNdBa_c *node = start != nullptr ? start->getNext() : getFirst();
while (node != nullptr) {
@@ -66,7 +62,6 @@ const fLiNdBa_c *fLiMgBa_c::searchNodeByProfName(ProfileName name, fLiNdBa_c *st
return nullptr;
}
/* 802e27d0 */
void fLiNdBa_c::link(fBase_c *link) {
if (p_owner != nullptr) {
unlink();
@@ -78,7 +73,6 @@ void fLiNdBa_c::link(fBase_c *link) {
}
}
/* 802e2830 */
void fLiNdBa_c::unlink() {
if (p_owner != nullptr) {
p_owner->mActorList.remove(this);
-5
View File
@@ -13,12 +13,10 @@ fLiMgBa_c fManager_c::m_searchManage[8];
u32 fManager_c::m_StopProcInf;
fManager_c::LOOP_PROC_e fManager_c::m_nowLoopProc = CONNECT;
/* 802e28c0 */
int fManager_c::getSearchTableNum() {
return reinterpret_cast<fBase_c *>(search_node.p_owner)->mID & 7;
}
/* 802e28d0 */
fBase_c *fManager_c::searchBaseByID(fBaseID_e id) {
const fLiNdBa_c *res = m_searchManage[id & 7].searchNodeByID(id);
if (res != nullptr) {
@@ -27,7 +25,6 @@ fBase_c *fManager_c::searchBaseByID(fBaseID_e id) {
return nullptr;
}
/* 802e2920 */
fBase_c *fManager_c::searchBaseByProfName(ProfileName profID, const fBase_c *parent) {
const fTrNdBa_c *connect_node = parent != nullptr ? &parent->mManager.connect_node : nullptr;
@@ -40,7 +37,6 @@ fBase_c *fManager_c::searchBaseByProfName(ProfileName profID, const fBase_c *par
return nullptr;
}
/* 802e2980 */
fBase_c *fManager_c::searchBaseByGroupType(unsigned char groupType, const fBase_c *parent) {
const fTrNdBa_c *connect_node = parent != nullptr ? &parent->mManager.connect_node : nullptr;
@@ -53,7 +49,6 @@ fBase_c *fManager_c::searchBaseByGroupType(unsigned char groupType, const fBase_
return nullptr;
}
/* 802e29e0 */
void fManager_c::mainLoop() {
if ((m_StopProcInf & PROC_FLAG_DELETE) == 0) {
m_nowLoopProc = DELETE;
-2
View File
@@ -2,7 +2,6 @@
#include "math.h"
/** 80575c08 */
mAng3_c mAng3_c::Zero(0, 0, 0);
const f32 mAng::sHalfCircleDeg = 360.0f / 2;
@@ -14,7 +13,6 @@ const f32 mAng::sDegToAng = (1 << 16) / 360.0f;
const f32 mAng::sRadToAng = (1 << 16) / (2 * M_PI);
const f32 mAng::sRadToDeg = 180.0f / M_PI;
/** 802ee5f0 */
s32 mAng::step(s16 target, s32 steps, s16 max, s16 min) {
if (mVal != target) {
int stepSize;
+2 -59
View File
@@ -6,9 +6,9 @@
#include "egg/core/eggHeap.h"
#include "egg/core/eggStreamDecomp.h"
#include "m/m_heap.h"
#include "rvl/DVD.h" // IWYU pragma: export
#include "string.h"
#include "rvl/DVD.h" // IWYU pragma: export
static int ConvertPathToEntrynum(const char *path, u8 *outType);
@@ -47,20 +47,17 @@ EGG::Heap *l_CommandHeap;
EGG::Heap *l_ArchiveHeap;
bool l_IsAutoStreamDecomp;
/** 802eece0 */
static void unk_setDecompressorPtrs(TUncompressInfo_Base_c **ptr, TUncompressInfo_Base_c **last) {
compressors_ptr = ptr;
compressors_last = last;
}
/** 802eecf0 */
void unk_initDecompressors() {
unk_setDecompressorPtrs(decompressorPtrs, &decompressorPtrs[1]);
somePtr = decompressor_alloc_space;
someNumber = 0x24;
}
/** 802eed30 */
static TUncompressInfo_Base_c *findUncompressInfo(u8 type) {
TUncompressInfo_Base_c **ptr = compressors_ptr;
while (ptr != compressors_last) {
@@ -72,7 +69,6 @@ static TUncompressInfo_Base_c *findUncompressInfo(u8 type) {
return nullptr;
}
/** 802eed70 */
static EGG::StreamDecomp *newUncompressObj(u8 type) {
TUncompressInfo_Base_c *factory = findUncompressInfo(type);
if (factory != nullptr) {
@@ -82,7 +78,6 @@ static EGG::StreamDecomp *newUncompressObj(u8 type) {
}
}
/** 802eedb0 */
static void deleteUncompressObj(u8 type) {
TUncompressInfo_Base_c *factory = findUncompressInfo(type);
if (factory != nullptr) {
@@ -98,21 +93,17 @@ EGG::Heap *getArchiveHeap() {
return l_ArchiveHeap;
}
/** 802eee10 */
void *MyThread_c::run(mDvd_param_c *dvd) {
dvd->mainLoop();
return nullptr;
}
/** 802eee40 */
MyThread_c::MyThread_c(int priority, EGG::Heap *heap) : EGG::Thread(0x4000, 0, priority, heap) {}
/** 802eee90 */
void *MyThread_c::run() {
return run(mDvd_param_c::mInstance);
}
/** 802eeea0 */
void create(int priority, EGG::Heap *commandHeap, EGG::Heap *archiveHeap, EGG::Heap *threadHeap) {
l_CommandHeap = commandHeap;
l_ArchiveHeap = archiveHeap;
@@ -125,7 +116,6 @@ void create(int priority, EGG::Heap *commandHeap, EGG::Heap *archiveHeap, EGG::H
OSResumeThread(l_MyThread->getMyOsThread());
}
/** 802eef30 */
static void *loadToMainRAM(
int entryNum, char *dst, EGG::Heap *heap, EGG::DvdRipper::EAllocDirection allocDir, s32 offset, u32 *outAmountRead,
u32 *outFileSize, u32 decompressorType
@@ -180,12 +170,10 @@ u32 IsExistPath(const char *path) {
mDvd_param_c *mDvd_param_c::mInstance;
/** 802ef0d0 */
mDvd_command_c::~mDvd_command_c() {
waitUntilDone();
}
/** 802ef130 */
void *mDvd_command_c::operator new(size_t size) {
return EGG::Heap::alloc(size, -4, mDvd::l_CommandHeap);
}
@@ -194,12 +182,10 @@ void mDvd_command_c::operator delete(void *ptr) {
EGG::Heap::free(ptr, mDvd::l_CommandHeap);
}
/** 802ef150 */
void mDvd_command_c::done() {
doClear();
}
/** 802ef170 */
void mDvd_command_c::doClear() {}
void mDvd_command_c::waitDone() {
@@ -207,14 +193,12 @@ void mDvd_command_c::waitDone() {
OSWakeupThread(&mDvd_param_c::mInstance->mThreadQueue2);
}
/** 802ef190 */
void mDvd_command_c::waitUntilDone() {
while (mStatus == 0) {
OSSleepThread(&mDvd_param_c::mInstance->mThreadQueue2);
}
}
/** 802ef1e0 */
mDvd_param_c::mDvd_param_c() {
mFirstRequest = nullptr;
mLastRequest = nullptr;
@@ -224,22 +208,18 @@ mDvd_param_c::mDvd_param_c() {
mDvd_param_c::mInstance = this;
}
/** 802ef230 */
void mDvd_param_c::kick() {
OSWakeupThread(&mThreadQueue1);
}
/** 802ef240 */
void mDvd_param_c::waitForKick() {
OSSleepThread(&mThreadQueue1);
}
/** 802ef250 */
mDvd_command_c *mDvd_param_c::getFirstCommand() {
return mFirstRequest;
}
/** 802ef260 */
void mDvd_param_c::addCommand(mDvd_command_c *cmd) {
OSThread *dvdThread = mDvd::getOSThread();
OSThread *currThread = OSGetCurrentThread();
@@ -260,7 +240,6 @@ void mDvd_param_c::addCommand(mDvd_command_c *cmd) {
}
}
/** 802ef310 */
void mDvd_param_c::removeCommand(mDvd_command_c *toRemove) {
OSLockMutex(&mMutex);
mDvd_command_c *prev = nullptr;
@@ -294,7 +273,6 @@ u32 mDvd_param_c::executeCB(mDvd_command_c **cmd) {
return 0;
}
/** 802ef410 */
void mDvd_param_c::mainLoop() {
mDvd_command_c *cmd;
while (true) {
@@ -306,18 +284,15 @@ void mDvd_param_c::mainLoop() {
}
}
/** 802ef460 */
mDvd_command_c::mDvd_command_c() {
mNext = nullptr;
mStatus = 0;
}
/** 802ef480 */
void mDvd_command_c::do_delete() {
delete this;
}
/** 802ef4a0 */
void mDvd_command_c::destroy(mDvd_command_c **cmd) {
// TODO fake match, this looks like an inlined dtor
if (cmd != nullptr && cmd != nullptr && *cmd != nullptr) {
@@ -327,17 +302,14 @@ void mDvd_command_c::destroy(mDvd_command_c **cmd) {
}
}
/** 802ef500 */
mDvd_callback_c::~mDvd_callback_c() {}
/** 802ef560 */
mDvd_callback_c::mDvd_callback_c(dvdReadCallback cb, void *cbData) {
mCallback = cb;
mCallbackData = cbData;
mCallbackResult = 0;
}
/* 802ef5d0 */
mDvd_callback_c *mDvd_callback_c::create(dvdReadCallback cb, void *cbData) {
mDvd_callback_c *cmd = new mDvd_callback_c(cb, cbData);
if (cmd != nullptr) {
@@ -346,24 +318,20 @@ mDvd_callback_c *mDvd_callback_c::create(dvdReadCallback cb, void *cbData) {
return cmd;
}
/** 802ef650 */
mDvd_callback_c *mDvd_callback_c::createOrDie(dvdReadCallback cb, void *cbData) {
mDvd_callback_c *cmd = mDvd_callback_c::create(cb, cbData);
while (!cmd) {}
return cmd;
}
/** 802ef680 */
u32 mDvd_callback_c::execute() {
mCallbackResult = (mCallback)(mCallbackData);
waitDone();
return (bool)mCallbackResult;
}
/** 802ef6e0 */
mDvd_mountMemArchive_c::~mDvd_mountMemArchive_c() {}
/** 802ef740 */
mDvd_mountMemArchive_c::mDvd_mountMemArchive_c(int mountDirection) {
if (mountDirection == 0) {
mountDirection = mDvd::g_mountDirection;
@@ -378,7 +346,6 @@ mDvd_mountMemArchive_c::mDvd_mountMemArchive_c(int mountDirection) {
namespace mDvd {
/** 802ef7c0 */
static int ConvertPathToEntrynumASD_(const char *name, u8 *outType) {
u8 type;
char buf[256];
@@ -432,18 +399,14 @@ out:
return num;
}
/** 802ef930 */
void setAutoStreamDecomp(bool arg) {
mDvd::l_IsAutoStreamDecomp = arg;
}
/** 802ef940 */
bool isAutoStreamDecomp() {
return mDvd::l_IsAutoStreamDecomp;
}
/** 802ef950 */
static int ConvertPathToEntrynum(const char *path, u8 *outType) {
int num = DVDConvertPathToEntrynum(path);
if (num != -1) {
@@ -456,14 +419,12 @@ static int ConvertPathToEntrynum(const char *path, u8 *outType) {
return num;
}
/** 802ef9d0 */
static int ConvertPathToEntrynumWithWarning(const char *path, u8 *outType) {
return ConvertPathToEntrynum(path, outType);
}
}
} // namespace mDvd
/** 802ef9e0 */
mDvd_mountMemArchive_c *mDvd_mountMemArchive_c::create(const char *path, u8 mountDirection, EGG::Heap *heap) {
u8 type;
mDvd_mountMemArchive_c *cmd = nullptr;
@@ -481,7 +442,6 @@ mDvd_mountMemArchive_c *mDvd_mountMemArchive_c::create(const char *path, u8 moun
return cmd;
}
/** 802efa80 */
u32 mDvd_mountMemArchive_c::execute() {
EGG::DvdRipper::EAllocDirection allocDirection;
EGG::Archive *archive;
@@ -511,7 +471,6 @@ u32 mDvd_mountMemArchive_c::execute() {
return (bool)mDataPtr;
}
/** 802efb80 */
void *mDvd_mountMemArchive_c::getArcBinary() {
void *result = nullptr;
if (mDataPtr != nullptr) {
@@ -520,7 +479,6 @@ void *mDvd_mountMemArchive_c::getArcBinary() {
return result;
}
/** 802efba0 */
void mDvd_mountMemArchive_c::doClear() {
if (mDataPtr != nullptr) {
void *data = mDataPtr->mHandle.header;
@@ -532,7 +490,6 @@ void mDvd_mountMemArchive_c::doClear() {
}
}
/** 802efc10 */
mDvd_toMainRam_base_c::mDvd_toMainRam_base_c(int mountDirection) {
if (mountDirection == 0) {
mountDirection = mDvd::g_mountDirection;
@@ -544,19 +501,15 @@ mDvd_toMainRam_base_c::mDvd_toMainRam_base_c(int mountDirection) {
mHeap = nullptr;
}
/** 802efc80 */
mDvd_toMainRam_base_c::~mDvd_toMainRam_base_c() {}
/** 802efce0 */
mDvd_toMainRam_arc_c::~mDvd_toMainRam_arc_c() {}
/** 802efd40 */
mDvd_toMainRam_arc_c::mDvd_toMainRam_arc_c(EGG::Archive *arc, int entryNum, int mountDirection)
: mDvd_toMainRam_base_c(mountDirection), mArcPtr(arc) {
mEntryNum = entryNum;
}
/** 802efda0 */
mDvd_toMainRam_arc_c *
mDvd_toMainRam_arc_c::makeRequest(EGG::Archive *arc, int entryNum, int mountDirection, EGG::Heap *heap) {
mDvd_toMainRam_arc_c *cmd = new mDvd_toMainRam_arc_c(arc, entryNum, mountDirection);
@@ -567,7 +520,6 @@ mDvd_toMainRam_arc_c::makeRequest(EGG::Archive *arc, int entryNum, int mountDire
return cmd;
}
/** 802efe20 */
mDvd_toMainRam_arc_c *
mDvd_toMainRam_arc_c::create(EGG::Archive *arc, const char *path, int mountDirection, EGG::Heap *heap) {
int entryNum = arc->convertPathToEntryID(path);
@@ -578,7 +530,6 @@ mDvd_toMainRam_arc_c::create(EGG::Archive *arc, const char *path, int mountDirec
return cmd;
}
/** 802efe90 */
mDvd_toMainRam_arc_c *
mDvd_toMainRam_arc_c::createOrDie(EGG::Archive *arc, const char *path, int mountDirection, EGG::Heap *heap) {
mDvd_toMainRam_arc_c *cmd = mDvd_toMainRam_arc_c::create(arc, path, mountDirection, heap);
@@ -586,7 +537,6 @@ mDvd_toMainRam_arc_c::createOrDie(EGG::Archive *arc, const char *path, int mount
return cmd;
}
/** 802efec0 */
u32 mDvd_toMainRam_arc_c::execute() {
EGG::Heap *heap = mHeap != nullptr ? mHeap : mDvd::l_ArchiveHeap;
mDataPtr = mArcPtr->getFileFast(mEntryNum, heap, mMountDirection == 1 ? 0x20 : -0x20);
@@ -594,13 +544,11 @@ u32 mDvd_toMainRam_arc_c::execute() {
return (bool)mDataPtr;
}
/** 802eff40 */
mDvd_toMainRam_normal_c::mDvd_toMainRam_normal_c(int mountDirection) : mDvd_toMainRam_base_c(mountDirection) {
mCompressionType2 = 0;
mEntryNum = -1;
}
/** 802eff90 */
mDvd_toMainRam_normal_c *mDvd_toMainRam_normal_c::create(const char *path, int mountDirection, EGG::Heap *heap) {
u8 type;
int entryNum = mDvd::ConvertPathToEntrynumWithWarning(path, &type);
@@ -619,14 +567,12 @@ mDvd_toMainRam_normal_c *mDvd_toMainRam_normal_c::create(const char *path, int m
return cmd;
}
/** 802f0030 */
mDvd_toMainRam_normal_c *mDvd_toMainRam_normal_c::createOrDie(const char *path, int mountDirection, EGG::Heap *heap) {
mDvd_toMainRam_normal_c *cmd = mDvd_toMainRam_normal_c::create(path, mountDirection, heap);
while (!cmd) {}
return cmd;
}
/** 802f0060 */
void mDvd_toMainRam_normal_c::create2(
mDvd_toMainRam_normal_c **cmd, const char *path, int mountDirection, EGG::Heap *heap
) {
@@ -635,10 +581,8 @@ void mDvd_toMainRam_normal_c::create2(
}
}
/** 802f00b0 */
mDvd_toMainRam_normal_c::~mDvd_toMainRam_normal_c() {}
/** 802f0110 */
u32 mDvd_toMainRam_normal_c::execute() {
u32 amountRead;
u32 fileSize;
@@ -654,7 +598,6 @@ u32 mDvd_toMainRam_normal_c::execute() {
return (bool)mDataPtr;
}
/** 802f01b0 */
void mDvd_toMainRam_normal_c::doClear() {
if (mDataPtr == nullptr) {
return;
+2 -3
View File
@@ -2,11 +2,11 @@
#include "nw4r/db/db_directPrint.h"
#include "nw4r/db/db_mapFile.h"
#include "rvl/GX.h" // IWYU pragma: export
#include "rvl/VI.h" // IWYU pragma: export
#include "rvl/OS/OSError.h"
#include "string.h"
#include "rvl/GX.h" // IWYU pragma: export
#include "rvl/VI.h" // IWYU pragma: export
namespace nw4r {
namespace db {
@@ -383,7 +383,6 @@ void ShowSRR0Map_(const OSContext *ctx) {
}
}
// 804ca0e4
extern "C" int __fpclassifyf(float val);
static void ShowFloatSub_(s32 reg, f32 val);
+2 -8
View File
@@ -1,9 +1,9 @@
#include "nw4r/db/db_mapFile.h"
#include "stdio.h"
#include "rvl/DVD.h" // IWYU pragma: export
#include "rvl/OS.h" // IWYU pragma: export
#include "stdio.h"
namespace nw4r {
namespace db {
@@ -34,7 +34,6 @@ static void MapFile_Append_(MapFile *file) {
}
}
/** 80436a50 */
MapFileHandle MapFile_RegistOnDvd(void *buf, const char *path, const OSModuleInfo *info) {
MapFile *file = (MapFile *)buf;
file->mapBuf = nullptr;
@@ -46,7 +45,6 @@ MapFileHandle MapFile_RegistOnDvd(void *buf, const char *path, const OSModuleInf
return file;
}
/** 80436ae0 */
void MapFile_Unregist(MapFileHandle file) {
if (file == sMapFileList) {
sMapFileList = sMapFileList->next;
@@ -62,17 +60,14 @@ void MapFile_Unregist(MapFileHandle file) {
}
}
/** 80436b30 */
void MapFile_UnregistAll() {
sMapFileList = nullptr;
}
/** 80436b40 */
static u8 GetCharOnMem_(const u8 *arg) {
return *arg;
}
/** 80436b50 */
static u8 GetCharOnDvd_(const u8 *buf) {
s32 address = (u32)buf & 0x7fffffff;
s32 offset = address - sMapBufOffset;
@@ -264,7 +259,6 @@ bool QuerySymbolToMapFile_(u8 *buf, const OSModuleInfo *moduleInfo, u32 address,
}
// No idea, doesn't appear in the DWARF
/** 804370d0 */
bool UnkFunction_(const OSModuleInfo *moduleInfo, u32 address, u8 *strBuf, u32 strBufSize) {
if (moduleInfo == nullptr) {
if (address < (u32)_stack_end) {
-2
View File
@@ -8,7 +8,6 @@
#include "nw4r/ut/ut_RuntimeTypeInfo.h"
#include "nw4r/ut/ut_list.h"
// ReverseYAxis__22@unnamed@lyt_pane_cpp@FPQ34nw4r4math5MTX34
namespace nw4r {
@@ -47,7 +46,6 @@ Pane::Pane() : mChildList(), mAnimList(), mSize() {
// __dt__Q34nw4r2ut28LinkList<Q34nw4r3lyt4Pane,4>Fv
// 80486a70
// __ct__Q34nw4r3lyt4PaneFPCQ44nw4r3lyt3res4Pane
Pane::Pane(const res::Pane *pBlock) : mChildList(), mAnimList(), mSize() {
this->mpParent = nullptr;
-5
View File
@@ -4,23 +4,19 @@ namespace nw4r {
namespace ut {
namespace detail {
/* 8042a850 */
LinkListImpl::~LinkListImpl() {
Clear();
}
/* 8042a8e0 */
LinkListImpl::Iterator LinkListImpl::Erase(LinkListImpl::Iterator it) {
Iterator copy(it);
return Erase(it, ++copy);
}
/* 8042a930 */
void LinkListImpl::Clear() {
Erase(GetBeginIter(), GetEndIter());
}
/* 8042a980 */
LinkListImpl::Iterator LinkListImpl::Insert(Iterator it, LinkListNode *p) {
LinkListNode *next = it.mNode;
LinkListNode *prev = next->mPrev;
@@ -37,7 +33,6 @@ LinkListImpl::Iterator LinkListImpl::Insert(Iterator it, LinkListNode *p) {
return Iterator(p);
}
/* 8042a9b0 */
LinkListImpl::Iterator LinkListImpl::Erase(LinkListNode *p) {
LinkListNode *next = p->mNext;
LinkListNode *prev = p->mPrev;
-1
View File
@@ -3,7 +3,6 @@
namespace nw4r {
namespace ut {
/* 8042a9e0 */
bool IsValidBinaryFile(const BinaryFileHeader *header, u32 magic, u16 version, u16 numBlocks) {
if (header->signature != magic) {
return false;
+4 -4
View File
@@ -3,12 +3,12 @@
class ArrowCounter : public Counter {
public:
ArrowCounter();
/* 8016DFA0 */ ~ArrowCounter() {}
/* 8016E000 */ virtual u16 getMax() const override {
~ArrowCounter() {}
virtual u16 getMax() const override {
return 20;
};
};
/* 80575618 */ ArrowCounter ARROW_COUNTER;
ArrowCounter ARROW_COUNTER;
/* 8016DFE0 */ ArrowCounter::ArrowCounter() : Counter(0x1f2) {}
ArrowCounter::ArrowCounter() : Counter(0x1f2) {}
+4 -4
View File
@@ -3,12 +3,12 @@
class BombCounter : public Counter {
public:
BombCounter();
/* 8016E020 */ ~BombCounter() {}
/* 8016E080 */ virtual u16 getMax() const override {
~BombCounter() {}
virtual u16 getMax() const override {
return 10;
}
};
/* 80575620 */ BombCounter BOMB_COUNTER;
BombCounter BOMB_COUNTER;
/* 8016E060 */ BombCounter::BombCounter() : Counter(0x1f3) {}
BombCounter::BombCounter() : Counter(0x1f3) {}
+4 -4
View File
@@ -2,7 +2,7 @@
#include "d/flag/itemflag_manager.h"
/* 8016cc40 */ s32 Counter::checkedAdd(s32 num) {
s32 Counter::checkedAdd(s32 num) {
s32 uncommitted = getUncommittedValue();
s32 max = getMax();
s32 result = uncommitted + num;
@@ -21,14 +21,14 @@
return result <= max ? 0 : (result - max);
}
/* 8016cd30 */ u16 Counter::getCommittedValue() const {
u16 Counter::getCommittedValue() const {
return ItemflagManager::sInstance->getItemCounterOrFlag(counterId);
}
/* 8016cd50 */ u16 Counter::getUncommittedValue() const {
u16 Counter::getUncommittedValue() const {
return ItemflagManager::sInstance->getUncommittedItemValue(counterId);
}
/* 8016cd70 */ void Counter::setValue(u16 num) {
void Counter::setValue(u16 num) {
ItemflagManager::sInstance->setItemFlagOrCounterToValue(counterId, num);
}
@@ -3,12 +3,12 @@
class ExtraWalletCounter : public Counter {
public:
ExtraWalletCounter();
/* 8016E220 */ ~ExtraWalletCounter() {}
/* 8016E280 */ virtual u16 getMax() const override {
~ExtraWalletCounter() {}
virtual u16 getMax() const override {
return 3;
}
};
/* 80575640 */ ExtraWalletCounter EXTRA_WALLET_COUNTER;
ExtraWalletCounter EXTRA_WALLET_COUNTER;
/* 8016E260 */ ExtraWalletCounter::ExtraWalletCounter() : Counter(0x1fc) {}
ExtraWalletCounter::ExtraWalletCounter() : Counter(0x1fc) {}
@@ -3,12 +3,12 @@
class KeyPieceCounter : public Counter {
public:
KeyPieceCounter();
/* 8016E1A0 */ ~KeyPieceCounter() {}
/* 8016E200 */ virtual u16 getMax() const override {
~KeyPieceCounter() {}
virtual u16 getMax() const override {
return 5;
}
};
/* 80575638 */ KeyPieceCounter KEY_PIECE_COUNTER;
KeyPieceCounter KEY_PIECE_COUNTER;
/* 8016E1E0 */ KeyPieceCounter::KeyPieceCounter() : Counter(0x1f9) {}
KeyPieceCounter::KeyPieceCounter() : Counter(0x1f9) {}
+7 -7
View File
@@ -8,8 +8,8 @@ static u16 getExtraWalletCapacity();
class RupeeCounter : public Counter {
public:
RupeeCounter();
/* 8016DEF0 */ ~RupeeCounter() {}
/* 8016DF50 */ virtual u16 getMax() const override {
~RupeeCounter() {}
virtual u16 getMax() const override {
return (getBaseCapacity() + getExtraWalletCapacity());
}
};
@@ -19,9 +19,9 @@ struct WalletStruct {
u16 capacity;
};
/* 8016DE10 */ static u16 getBaseCapacity() {
static u16 getBaseCapacity() {
int i = 0;
/* 804E91B0 */ WalletStruct wallet_definitions[4] = {
WalletStruct wallet_definitions[4] = {
{ITEM_MEDIUM_WALLET, 500},
{ ITEM_BIG_WALLET, 1000},
{ ITEM_GIANT_WALLET, 5000},
@@ -36,10 +36,10 @@ struct WalletStruct {
return 300;
}
/* 8016DEC0 */ static u16 getExtraWalletCapacity() {
static u16 getExtraWalletCapacity() {
return 300 * getCounterByIndex(0x27); // Maybe 0x27 corresponds to item 27 -> small wallet?
}
/* 80575610 */ RupeeCounter RUPEE_COUNTER;
RupeeCounter RUPEE_COUNTER;
/* 8016DF30 */ RupeeCounter::RupeeCounter() : Counter(0x1f5) {}
RupeeCounter::RupeeCounter() : Counter(0x1f5) {}
@@ -3,12 +3,12 @@
class SlingshotSeedCounter : public Counter {
public:
SlingshotSeedCounter();
/* 8016E120 */ ~SlingshotSeedCounter() {}
/* 8016E180 */ virtual u16 getMax() const override {
~SlingshotSeedCounter() {}
virtual u16 getMax() const override {
return 20;
};
};
/* 80575630 */ SlingshotSeedCounter SLINGSHOT_SEED_COUNTER;
SlingshotSeedCounter SLINGSHOT_SEED_COUNTER;
/* 8016E160 */ SlingshotSeedCounter::SlingshotSeedCounter() : Counter(0x1ed) {}
SlingshotSeedCounter::SlingshotSeedCounter() : Counter(0x1ed) {}
+4 -4
View File
@@ -3,12 +3,12 @@
class TearCounter : public Counter {
public:
TearCounter();
/* 8016E0A0 */ ~TearCounter() {}
/* 8016E100 */ virtual u16 getMax() const override {
~TearCounter() {}
virtual u16 getMax() const override {
return 15;
};
};
/* 80575628 */ TearCounter TEAR_COUNTER;
TearCounter TEAR_COUNTER;
/* 8016E0E0 */ TearCounter::TearCounter() : Counter(0x1f4) {}
TearCounter::TearCounter() : Counter(0x1f4) {}
+190 -192
View File
@@ -16,29 +16,29 @@
class UnkClass {
public:
UnkClass();
/* vtable at 80500400 */
virtual ~UnkClass();
static UnkClass sInstance;
};
// This seems really pointless since the class only has a virtual destructor
// and no members but /shrug
/* 80574FF8 */ UnkClass UnkClass::sInstance;
UnkClass UnkClass::sInstance;
/* 80009D30 */ UnkClass::UnkClass() {}
/* 80009D40 */ UnkClass::~UnkClass() {}
UnkClass::UnkClass() {}
UnkClass::~UnkClass() {}
/* 80574FFC */ FileManager *FileManager::sInstance;
FileManager *FileManager::sInstance;
extern "C" {
/* 80009D80 */ void fn_80009D80() {} // return
/* 80009D90 */ void fn_80009D90() {} // return
/* 80009DA0 */ void fn_80009DA0(void *ptr) {
void fn_80009D80() {}
void fn_80009D90() {}
void fn_80009DA0(void *ptr) {
memset(ptr, 0, 0x20);
} // memset(param_1, 0, 0x20) a 0x24 structure is implied here (0x20 data) a crc is at 0x24
}
}
/* 80009DB0 */ FileManager::FileManager() {
FileManager::FileManager() {
// TODO the assembly code looks really wild
mHeroNames[0][0] = '\0';
u32 num_files = (u32)(mHeroName - mHeroNames[0]);
@@ -55,19 +55,18 @@ extern "C" {
fn_8000A2E0();
}
/* 80009EE0 */ // mVec3();
/* 80009EF0 */ FileManager *FileManager::create(EGG::Heap *heap) {
FileManager *FileManager::create(EGG::Heap *heap) {
return new (heap, 0x04) FileManager();
}
/* 80009F30 */ bool FileManager::loadSaveData(NandRequestWriteHolder *out, const char *name, bool isSkipData) {}
/* 80009F70 */ void FileManager::saveSaveData(NandRequestLoadSaveFileHolder *unk, bool isSkipData) {}
/* 8000A000 */ void FileManager::refreshSaveFileData() {}
/* 8000A260 */ wchar_t *FileManager::getFileHeroname(int fileNum) {}
/* 8000A280 */ s64 FileManager::getFileSaveTime(int fileNum) {}
/* 8000A2A0 */ s16 FileManager::getFileCurrentHealth(int fileNum) {}
/* 8000A2C0 */ s16 FileManager::getFileHealthCapacity(int fileNum) {}
/* 8000A2E0 */ void FileManager::fn_8000A2E0() {
bool FileManager::loadSaveData(NandRequestWriteHolder *out, const char *name, bool isSkipData) {}
void FileManager::saveSaveData(NandRequestLoadSaveFileHolder *unk, bool isSkipData) {}
void FileManager::refreshSaveFileData() {}
wchar_t *FileManager::getFileHeroname(int fileNum) {}
s64 FileManager::getFileSaveTime(int fileNum) {}
s16 FileManager::getFileCurrentHealth(int fileNum) {}
s16 FileManager::getFileHealthCapacity(int fileNum) {}
void FileManager::fn_8000A2E0() {
// maybe call this function "reset"
mIsFileUnk1[0] = true;
initBlankSaveFiles();
@@ -75,40 +74,39 @@ extern "C" {
mSelectedFile = 1;
}
/* 8000A330 */
u16 *FileManager::getStoryFlagsMut() {
return getCurrentFile()->getStoryFlags0();
}
/* 8000A360 */ const u16 *FileManager::getStoryFlagsConst() const {
const u16 *FileManager::getStoryFlagsConst() const {
return getCurrentFile()->getStoryFlags1();
}
/* 8000A3B0 */ u16 *FileManager::getItemFlagsMut() {}
/* 8000A3E0 */ const u16 *FileManager::getItemFlagsConst() {}
/* 8000A430 */ u16 *FileManager::getDungeonFlagsMut() {}
/* 8000A460 */ u16 *FileManager::getDungeonFlagsConst() {}
/* 8000A4B0 */ u16 *FileManager::getSceneFlagsMut() {}
/* 8000A4E0 */ u16 *FileManager::getSceneFlagsConst() {}
/* 8000A530 */ u16 *FileManager::getTBoxFlagsMut() {}
/* 8000A560 */ u16 *FileManager::getTBoxFlagsConst() {}
/* 8000A5B0 */ u16 *FileManager::getTempFlagsMut() {}
/* 8000A5E0 */ u16 *FileManager::getTempFlagsConst() {}
/* 8000A630 */ u16 *FileManager::getZoneFlagsMut() {}
/* 8000A660 */ u16 *FileManager::getZoneFlagsConst() {}
/* 8000A6B0 */ u16 *FileManager::getEnemyDefeatFlagsMut() {}
/* 8000A6E0 */ u16 *FileManager::getEnemyDefeatFlagsConst() {}
/* 8000A730 */ void FileManager::setStoryFlags(u16 *flags, u32 offset, u16 count) {}
/* 8000A790 */ void FileManager::setItemFlags(u16 *flags, u32 offset, u16 count) {}
/* 8000A7F0 */ void FileManager::setDungeonFlags(u16 *flags, u32 offset, u16 count) {}
/* 8000A850 */ void FileManager::setSceneFlags(u16 *flags, u32 offset, u16 count) {}
/* 8000A8B0 */ void FileManager::setTBoxFlags(u16 *flags, u32 offset, u16 count) {}
/* 8000A910 */ void FileManager::setTempFlags(u16 *flags, u32 offset, u16 count) {}
/* 8000A970 */ void FileManager::setZoneFlags(u16 *flags, u32 offset, u16 count) {}
/* 8000A9D0 */ void FileManager::setEnemyDefeatFlags(u16 *flags, u32 offset, u16 count) {}
u16 *FileManager::getItemFlagsMut() {}
const u16 *FileManager::getItemFlagsConst() {}
u16 *FileManager::getDungeonFlagsMut() {}
u16 *FileManager::getDungeonFlagsConst() {}
u16 *FileManager::getSceneFlagsMut() {}
u16 *FileManager::getSceneFlagsConst() {}
u16 *FileManager::getTBoxFlagsMut() {}
u16 *FileManager::getTBoxFlagsConst() {}
u16 *FileManager::getTempFlagsMut() {}
u16 *FileManager::getTempFlagsConst() {}
u16 *FileManager::getZoneFlagsMut() {}
u16 *FileManager::getZoneFlagsConst() {}
u16 *FileManager::getEnemyDefeatFlagsMut() {}
u16 *FileManager::getEnemyDefeatFlagsConst() {}
void FileManager::setStoryFlags(u16 *flags, u32 offset, u16 count) {}
void FileManager::setItemFlags(u16 *flags, u32 offset, u16 count) {}
void FileManager::setDungeonFlags(u16 *flags, u32 offset, u16 count) {}
void FileManager::setSceneFlags(u16 *flags, u32 offset, u16 count) {}
void FileManager::setTBoxFlags(u16 *flags, u32 offset, u16 count) {}
void FileManager::setTempFlags(u16 *flags, u32 offset, u16 count) {}
void FileManager::setZoneFlags(u16 *flags, u32 offset, u16 count) {}
void FileManager::setEnemyDefeatFlags(u16 *flags, u32 offset, u16 count) {}
/* 8000AA30 */ u16 *FileManager::getSkipFlags() {}
/* 8000AA40 */ void FileManager::setSkipFlagsChecked(u16 *flags, u32 offset, u16 count) {}
u16 *FileManager::getSkipFlags() {}
void FileManager::setSkipFlagsChecked(u16 *flags, u32 offset, u16 count) {}
/* 8000AAA0 */ void FileManager::initFile(int fileNum) {
void FileManager::initFile(int fileNum) {
mIsFileInvalid[1] = 1;
SaveFile *file = getFileA();
if (fileNum != 0) {
@@ -132,138 +130,138 @@ u16 *FileManager::getStoryFlagsMut() {
file->entrance_t1_load_flag = 1;
}
/* 8000ABD0 */ void FileManager::setCurrentHealthCapacity(s16 health) {}
/* 8000AC00 */ u16 FileManager::getCurrentHealthCapacity() {}
/* 8000AC50 */ void FileManager::setCurrentHealth(s16 health) {}
/* 8000AC80 */ u16 FileManager::getCurrentHealth() {}
void FileManager::setCurrentHealthCapacity(s16 health) {}
u16 FileManager::getCurrentHealthCapacity() {}
void FileManager::setCurrentHealth(s16 health) {}
u16 FileManager::getCurrentHealth() {}
/* 8000ACD0 */ u16 FileManager::getLoadRoomT1() {}
/* 8000AD20 */ u16 FileManager::getLoadRoomT2() {}
/* 8000AD70 */ void FileManager::setLoadRoomT3(s16 room) {}
/* 8000ADA0 */ u16 FileManager::getLoadRoomT3() {}
u16 FileManager::getLoadRoomT1() {}
u16 FileManager::getLoadRoomT2() {}
void FileManager::setLoadRoomT3(s16 room) {}
u16 FileManager::getLoadRoomT3() {}
/* 8000ADF0 */ mVec3_c *FileManager::getPosT1() {}
/* 8000AE40 */ void FileManager::setPosT2(mVec3_c *pos) {}
/* 8000AE90 */ mVec3_c *FileManager::getPosT2() {}
/* 8000AEE0 */ void FileManager::setPosT3(mVec3_c *pos) {}
/* 8000AF30 */ mVec3_c *FileManager::getPosT3() {}
mVec3_c *FileManager::getPosT1() {}
void FileManager::setPosT2(mVec3_c *pos) {}
mVec3_c *FileManager::getPosT2() {}
void FileManager::setPosT3(mVec3_c *pos) {}
mVec3_c *FileManager::getPosT3() {}
/* 8000AF80 */ s16 FileManager::getAngleT1() {}
/* 8000AFD0 */ void FileManager::setAngleT2(s16 angle) {}
/* 8000B000 */ s16 FileManager::getAngleT2() {}
/* 8000B050 */ void FileManager::setAngleT3(s16 angle) {}
/* 8000B080 */ s16 FileManager::getAngleT3() {}
s16 FileManager::getAngleT1() {}
void FileManager::setAngleT2(s16 angle) {}
s16 FileManager::getAngleT2() {}
void FileManager::setAngleT3(s16 angle) {}
s16 FileManager::getAngleT3() {}
/* 8000B0D0 */ void FileManager::setPouchData(s32 slot, u32 slotData) {}
/* 8000B130 */ u32 FileManager::getPouchData(s32 slot) {}
/* 8000B1B0 */ void FileManager::setPouchItem(s32 slot, ITEM_ID item) {}
/* 8000B220 */ ITEM_ID FileManager::getPouchItem(s32 slot) {}
/* 8000B250 */ void FileManager::setPouchUpperData(s32 slot, s32 data) {}
/* 8000B2C0 */ u16 FileManager::getPouchUpperData(s32 slot) {}
void FileManager::setPouchData(s32 slot, u32 slotData) {}
u32 FileManager::getPouchData(s32 slot) {}
void FileManager::setPouchItem(s32 slot, ITEM_ID item) {}
ITEM_ID FileManager::getPouchItem(s32 slot) {}
void FileManager::setPouchUpperData(s32 slot, s32 data) {}
u16 FileManager::getPouchUpperData(s32 slot) {}
/* 8000B2F0 */ void FileManager::setItemCheckData(u32 idx, u32 itemData) {}
/* 8000B360 */ u32 FileManager::getItemCheckData(u32 idx) {}
/* 8000B3F0 */ void FileManager::setItemCheckItem(u32 idx, ITEM_ID item) {}
/* 8000B480 */ ITEM_ID FileManager::getItemCheckItem(u32 idx) {}
/* 8000B4B0 */ void FileManager::setItemCheckUpperData(u32 idx, u32 itemData) {}
/* 8000B540 */ u32 FileManager::getItemCheckUpperData() {}
void FileManager::setItemCheckData(u32 idx, u32 itemData) {}
u32 FileManager::getItemCheckData(u32 idx) {}
void FileManager::setItemCheckItem(u32 idx, ITEM_ID item) {}
ITEM_ID FileManager::getItemCheckItem(u32 idx) {}
void FileManager::setItemCheckUpperData(u32 idx, u32 itemData) {}
u32 FileManager::getItemCheckUpperData() {}
/* 8000B570 */ void FileManager::setEquippedItem(u8 bWheelItem) {}
/* 8000B5A0 */ u8 FileManager::getEquippedItem() {}
/* 8000B5F0 */ void FileManager::setSelectedPouchSlot(u8 slot) {}
/* 8000B620 */ u8 FileManager::getSelectedPouchSlot() {}
/* 8000B670 */ void FileManager::setShieldPouchSlot(u8 slot) {}
/* 8000B6A0 */ u8 FileManager::getShieldPouchSlot() {}
void FileManager::setEquippedItem(u8 bWheelItem) {}
u8 FileManager::getEquippedItem() {}
void FileManager::setSelectedPouchSlot(u8 slot) {}
u8 FileManager::getSelectedPouchSlot() {}
void FileManager::setShieldPouchSlot(u8 slot) {}
u8 FileManager::getShieldPouchSlot() {}
/* 8000B6F0 */ void FileManager::setAirPotionTimer(u16 time) {}
/* 8000B720 */ u16 FileManager::getAirPotionTimer() const {}
/* 8000B770 */ void FileManager::setAirPotionPlusTimer(u16 time) {}
/* 8000B7A0 */ u16 FileManager::getAirPotionPlusTimer() const {}
/* 8000B7F0 */ void FileManager::setStaminaPotionTimer(u16 time) {}
/* 8000B820 */ u16 FileManager::getStaminaPotionTimer() const {}
/* 8000B870 */ void FileManager::setStaminaPotionPlusTimer(u16 time) {}
/* 8000B8A0 */ u16 FileManager::getStaminaPotionPlusTimer() const {}
/* 8000B8F0 */ void FileManager::setGuardianPotionTimer(u16 time) {}
/* 8000B920 */ u16 FileManager::getGuardianPotionTimer() const {}
/* 8000B970 */ void FileManager::setGuardianPotionPlusTimer(u16 time) {}
/* 8000B9A0 */ u16 FileManager::getGuardianPotionPlusTimer() const {}
void FileManager::setAirPotionTimer(u16 time) {}
u16 FileManager::getAirPotionTimer() const {}
void FileManager::setAirPotionPlusTimer(u16 time) {}
u16 FileManager::getAirPotionPlusTimer() const {}
void FileManager::setStaminaPotionTimer(u16 time) {}
u16 FileManager::getStaminaPotionTimer() const {}
void FileManager::setStaminaPotionPlusTimer(u16 time) {}
u16 FileManager::getStaminaPotionPlusTimer() const {}
void FileManager::setGuardianPotionTimer(u16 time) {}
u16 FileManager::getGuardianPotionTimer() const {}
void FileManager::setGuardianPotionPlusTimer(u16 time) {}
u16 FileManager::getGuardianPotionPlusTimer() const {}
/* 8000B9F0 */ void FileManager::setDowsingSlotIdx(u8 idx) {}
/* 8000BA20 */ u8 FileManager::getDowsingSlotIdx() {}
void FileManager::setDowsingSlotIdx(u8 idx) {}
u8 FileManager::getDowsingSlotIdx() {}
/* 8000BA70 */ void FileManager::setBeaconPos(u32 beaconArea, u32 beaconNum, mVec3_c *pos) {}
/* 8000BB80 */ mVec3_c *FileManager::getBeaconPos(u32 beaconArea, u32 beaconNum) {}
/* 8000BC70 */ void FileManager::setEnemyKillCount(u8 enemy, u16 killCount) {}
/* 8000BCE0 */ u16 FileManager::getEnemyKillCount(u8 enemy) {}
/* 8000BD60 */ void FileManager::setHitCountFromEnemy(u8 enemy, u16 hitCount) {}
/* 8000BDD0 */ u16 FileManager::getHitCountFromEnemy(u8 enemy) {}
void FileManager::setBeaconPos(u32 beaconArea, u32 beaconNum, mVec3_c *pos) {}
mVec3_c *FileManager::getBeaconPos(u32 beaconArea, u32 beaconNum) {}
void FileManager::setEnemyKillCount(u8 enemy, u16 killCount) {}
u16 FileManager::getEnemyKillCount(u8 enemy) {}
void FileManager::setHitCountFromEnemy(u8 enemy, u16 hitCount) {}
u16 FileManager::getHitCountFromEnemy(u8 enemy) {}
/* 8000BE50 */ void FileManager::setLoadRoomT1_FileB(s16 roomId) {}
/* 8000BE80 */ u16 FileManager::getLoadRoomT1_FileB() {}
/* 8000BE90 */ void FileManager::setEntranceT1_FileB(u8 entrance) {}
/* 8000BEC0 */ u8 FileManager::getEntranceT1_FileB() {}
/* 8000BED0 */ void FileManager::setAreaT1_FileB(const char *name) {}
/* 8000BF80 */ char *FileManager::getAreaT1_FileB() {}
/* 8000C080 */ void FileManager::setNightT1_FileB(bool night) {}
/* 8000C0B0 */ u8 FileManager::getNightT1_FileB() {}
/* 8000C0C0 */ void FileManager::setEntranceT1LoadFlag_FileB(u8 flag) {}
/* 8000C0F0 */ void FileManager::setForcedLayerT1_FileB(u8 layer) {}
/* 8000C120 */ u8 FileManager::getForcedLayerT1_FileB() {}
/* 8000C130 */ void FileManager::setCurrentHealth_FileB(s16 health) {}
void FileManager::setLoadRoomT1_FileB(s16 roomId) {}
u16 FileManager::getLoadRoomT1_FileB() {}
void FileManager::setEntranceT1_FileB(u8 entrance) {}
u8 FileManager::getEntranceT1_FileB() {}
void FileManager::setAreaT1_FileB(const char *name) {}
char *FileManager::getAreaT1_FileB() {}
void FileManager::setNightT1_FileB(bool night) {}
u8 FileManager::getNightT1_FileB() {}
void FileManager::setEntranceT1LoadFlag_FileB(u8 flag) {}
void FileManager::setForcedLayerT1_FileB(u8 layer) {}
u8 FileManager::getForcedLayerT1_FileB() {}
void FileManager::setCurrentHealth_FileB(s16 health) {}
/* 8000C160 */ void FileManager::setHeroname(const wchar_t *name) {}
/* 8000C230 */ wchar_t *FileManager::getHeroname() {}
void FileManager::setHeroname(const wchar_t *name) {}
wchar_t *FileManager::getHeroname() {}
/* 8000C360 */ char *FileManager::getAreaT1() {}
/* 8000C470 */ char *FileManager::getAreaT2() {}
/* 8000C580 */ void FileManager::setAreaT3(const char *name) {}
/* 8000C630 */ char *FileManager::getAreaT3() {}
char *FileManager::getAreaT1() {}
char *FileManager::getAreaT2() {}
void FileManager::setAreaT3(const char *name) {}
char *FileManager::getAreaT3() {}
/* 8000C740 */ u8 FileManager::getForcedLayerT1() {}
/* 8000C790 */ u8 FileManager::getForcedLayerT2() {}
/* 8000C7E0 */ void FileManager::setForcedLayerT3(u8 layer) {}
/* 8000C810 */ u8 FileManager::getForcedLayerT3() {}
u8 FileManager::getForcedLayerT1() {}
u8 FileManager::getForcedLayerT2() {}
void FileManager::setForcedLayerT3(u8 layer) {}
u8 FileManager::getForcedLayerT3() {}
/* 8000C860 */ u8 FileManager::getEntranceT1() {}
/* 8000C8B0 */ void FileManager::setEntranceLoadFlagT1(u8 flag) {}
/* 8000C8E0 */ u8 FileManager::getEntranceLoadFlagT1() {}
/* 8000C930 */ void FileManager::getEntranceT2() {}
/* 8000C980 */ void FileManager::setEntranceT3(u8 entrance) {}
/* 8000C9B0 */ u8 FileManager::getEntranceT3() {}
u8 FileManager::getEntranceT1() {}
void FileManager::setEntranceLoadFlagT1(u8 flag) {}
u8 FileManager::getEntranceLoadFlagT1() {}
void FileManager::getEntranceT2() {}
void FileManager::setEntranceT3(u8 entrance) {}
u8 FileManager::getEntranceT3() {}
/* 8000CA00 */ bool FileManager::getNightT1() {}
/* 8000CA50 */ void FileManager::setNightT3(bool night) {}
/* 8000CA80 */ u8 FileManager::getNightT3() {}
bool FileManager::getNightT1() {}
void FileManager::setNightT3(bool night) {}
u8 FileManager::getNightT3() {}
/* 8000CAD0 */ bool FileManager::isNew_FileA() {}
bool FileManager::isNew_FileA() {}
/* 8000CB00 */ void FileManager::setSceneFlagIndex(s16 idx) {}
/* 8000CB30 */ u32 FileManager::getSceneFlagIndex() {}
/* 8000CB80 */ s32 FileManager::getFileAreaIndex() {}
void FileManager::setSceneFlagIndex(s16 idx) {}
u32 FileManager::getSceneFlagIndex() {}
s32 FileManager::getFileAreaIndex() {}
/* 8000CBD0 */ void FileManager::fn_8000CBD0(u8) {}
/* 8000CC00 */ u8 FileManager::fn_8000CC00() {}
void FileManager::fn_8000CBD0(u8) {}
u8 FileManager::fn_8000CC00() {}
/* 8000CC50 */ void FileManager::setFileTimes() {}
/* 8000CCB0 */ void FileManager::setPlayTime(s64 time) {}
void FileManager::setFileTimes() {}
void FileManager::setPlayTime(s64 time) {}
/* 8000CCF0 */ s64 FileManager::getSavedTime() {}
/* 8000CD40 */ void FileManager::setSavedTime(s64 time) {}
s64 FileManager::getSavedTime() {}
void FileManager::setSavedTime(s64 time) {}
/* 8000CD80 */ void FileManager::setBeedleShopPathSegment(u32 path) {}
/* 8000CDB0 */ u32 FileManager::getBeedleShopPathSegment() {}
/* 8000CE00 */ void FileManager::setBeedleShopPathSegFrac(f32 segFrac) {}
/* 8000CE30 */ f32 FileManager::getBeedleShopPathSegFrac() {}
/* 8000CE80 */ void FileManager::setBeedleShopRotation(s16 rot) {}
/* 8000CEB0 */ s16 FileManager::getBeedleShopRotation() {}
void FileManager::setBeedleShopPathSegment(u32 path) {}
u32 FileManager::getBeedleShopPathSegment() {}
void FileManager::setBeedleShopPathSegFrac(f32 segFrac) {}
f32 FileManager::getBeedleShopPathSegFrac() {}
void FileManager::setBeedleShopRotation(s16 rot) {}
s16 FileManager::getBeedleShopRotation() {}
/* 8000CF00 */ void FileManager::fn_8000CF00(u32 shift) {}
/* 8000CF70 */ void FileManager::fn_8000CF70(u32 shift) {}
void FileManager::fn_8000CF00(u32 shift) {}
void FileManager::fn_8000CF70(u32 shift) {}
/* 8000CFE0 */ void FileManager::setSkykeepPuzzle(u32 spot, u8 tile) {}
/* 8000D040 */ u8 FileManager::getSkykeepPuzzleTile(u32 spot) {}
void FileManager::setSkykeepPuzzle(u32 spot, u8 tile) {}
u8 FileManager::getSkykeepPuzzleTile(u32 spot) {}
/* 8000D0B0 */ void FileManager::checkFileStatus() {
void FileManager::checkFileStatus() {
mIsFileInvalid[2] = 0;
SkipData *data;
SavedSaveFiles *files = mpSavedSaveFiles;
@@ -292,7 +290,7 @@ u16 *FileManager::getStoryFlagsMut() {
}
}
}
/* 8000D1D0 */ bool FileManager::checkSkipDataCRCs() {
bool FileManager::checkSkipDataCRCs() {
SkipData *data;
bool dirty = false;
u8 i;
@@ -307,25 +305,25 @@ u16 *FileManager::getStoryFlagsMut() {
}
return dirty;
}
/* 8000D270 */ void FileManager::saveOrClearSelectedFileToFileA() {
void FileManager::saveOrClearSelectedFileToFileA() {
saveOrClearToFileA(mSelectedFile);
}
/* 8000D280 */ void FileManager::saveOrClearToFileA(int fileNum) {}
/* 8000D9C0 */ void FileManager::copyFileBToCurrentFile() {}
/* 8000E060 */ void FileManager::copyFileAToSelectedFile() {
void FileManager::saveOrClearToFileA(int fileNum) {}
void FileManager::copyFileBToCurrentFile() {}
void FileManager::copyFileAToSelectedFile() {
copyFileAToFile(mSelectedFile);
}
/* 8000E070 */ void FileManager::copyFileAToFile(int fileNum) {}
/* 8000E7C0 */ void FileManager::copyFile(int from, int to) {}
/* 8000EF80 */ void FileManager::saveFileAToSelectedFile() {
void FileManager::copyFileAToFile(int fileNum) {}
void FileManager::copyFile(int from, int to) {}
void FileManager::saveFileAToSelectedFile() {
saveFileAToFile(mSelectedFile);
}
/* 8000EF90 */ void FileManager::saveFileAToFile(int fileNum) {}
/* 8000F730 */ void FileManager::copyCurrentToFileB() {}
/* 8000FDF0 */ void FileManager::copySelectedFileSkipData() {
void FileManager::saveFileAToFile(int fileNum) {}
void FileManager::copyCurrentToFileB() {}
void FileManager::copySelectedFileSkipData() {
copySkipData(mSelectedFile);
}
/* 8000FE00 */ void FileManager::copySkipData(u8 fileNum) {
void FileManager::copySkipData(u8 fileNum) {
if (fileNum < 3) {
SkipData *curr = &mSkipData;
SkipData *data = mpSkipData;
@@ -333,8 +331,8 @@ u16 *FileManager::getStoryFlagsMut() {
data[fileNum] = *curr;
}
}
/* 8000FEB0 */ void FileManager::setInfo_FileB() {}
/* 8000FF60 */ void FileManager::clearFileA() {
void FileManager::setInfo_FileB() {}
void FileManager::clearFileA() {
SkipData *data;
SaveFile *file = getFileA();
memset(file, 0, sizeof(SaveFile));
@@ -345,7 +343,7 @@ u16 *FileManager::getStoryFlagsMut() {
data->crc = calcFileCRC(data->data, sizeof(mSkipData.data));
}
/* 80010000 */ void FileManager::initBlankSaveFiles() {
void FileManager::initBlankSaveFiles() {
memset(mpSavedSaveFiles, 0, sizeof(SavedSaveFiles));
mSelectedFile = 0;
memset(mIsFileEmpty, 0, 3);
@@ -397,7 +395,7 @@ u16 *FileManager::getStoryFlagsMut() {
mIsFileDataDirty[2] = 0;
initSkipData();
}
/* 80010160 */ void FileManager::initSkipData() {
void FileManager::initSkipData() {
memset(mpSkipData, 0, 0x80);
SkipData *data;
int i;
@@ -410,36 +408,36 @@ u16 *FileManager::getStoryFlagsMut() {
mIsFileSkipDataDirty[2] = 0;
}
/* 800101F0 */ void FileManager::unsetFileANewFile() {}
/* 80010220 */ void FileManager::saveT1SaveInfo(bool entranceT1LoadFlag) {}
/* 80010350 */ void FileManager::copyFileSkipData(int fileNum) {}
void FileManager::unsetFileANewFile() {}
void FileManager::saveT1SaveInfo(bool entranceT1LoadFlag) {}
void FileManager::copyFileSkipData(int fileNum) {}
extern "C" void fn_800C01F0(); // todo flag managers
/* 80010440 */ void FileManager::clearTempFileData() {
void FileManager::clearTempFileData() {
memset(&mFileA, 0, sizeof(SaveFile));
memset(&mFileB, 0, sizeof(SaveFile));
memset(&mSkipData, 0, sizeof(SkipData));
fn_800C01F0();
}
/* 800104A0 */ void FileManager::saveAfterCredits() {}
void FileManager::saveAfterCredits() {}
/* 80011210 */ SaveFile *FileManager::getCurrentFile() {
SaveFile *FileManager::getCurrentFile() {
return isFileInactive() ? &mFileB : &mFileA;
}
/* 80011250 */ u16 *FileManager::getSkipFlags2() {}
/* 80011260 */ SaveFile *FileManager::getFileA() {
u16 *FileManager::getSkipFlags2() {}
SaveFile *FileManager::getFileA() {
return &mFileA;
}
/* 80011270 */ SaveFile *FileManager::getFileB() {
SaveFile *FileManager::getFileB() {
return &mFileB;
}
/* 80011280 */ u32 FileManager::calcFileCRC(const void *data, u32 length) {
u32 FileManager::calcFileCRC(const void *data, u32 length) {
return sCrc::calcCRC32(data, length);
}
/* 80011290 */ void FileManager::updateEmptyFiles() {
void FileManager::updateEmptyFiles() {
updateEmptyFileFlags();
refreshSaveFileData();
}
/* 800112D0 */ void FileManager::updateEmptyFileFlags() {
void FileManager::updateEmptyFileFlags() {
SaveFile *saves = mpSavedSaveFiles->saveFiles;
for (int i = 0; i < 3; i++) {
if (saves[i].new_file == 1) {
@@ -449,12 +447,12 @@ extern "C" void fn_800C01F0(); // todo flag managers
}
}
}
/* 80011370 */ bool FileManager::isFileEmpty(u8 fileNum) {}
/* 80011390 */ bool FileManager::isFileDirty(int fileNum) {}
/* 800113B0 */ u32 FileManager::get_0xA84C() {}
/* 800113C0 */ bool FileManager::checkRegionCode() {}
/* 80011440 */ bool FileManager::checkFileCRC(u8 fileNum) {}
/* 80011490 */
bool FileManager::isFileEmpty(u8 fileNum) {}
bool FileManager::isFileDirty(int fileNum) {}
u32 FileManager::get_0xA84C() {}
bool FileManager::checkRegionCode() {}
bool FileManager::checkFileCRC(u8 fileNum) {}
bool FileManager::isFileInactive() const {
fBase_c *actor = fManager_c::searchBaseByGroupType(1, nullptr);
if (actor) {
@@ -465,6 +463,6 @@ bool FileManager::isFileInactive() const {
}
return false;
}
/* 80011500 */ void FileManager::setPlayerInfoFileA() {}
/* 800115E0 */ void FileManager::setT3Info(const mVec3_c &pos, const mAng3_c &rot) {}
/* 800116C0 */ void FileManager::getRegionVersion(char *out) {}
void FileManager::setPlayerInfoFileA() {}
void FileManager::setT3Info(const mVec3_c &pos, const mAng3_c &rot) {}
void FileManager::getRegionVersion(char *out) {}
-7
View File
@@ -23,7 +23,6 @@ extern "C" void spawnItem7(u32 itemid, u32 roomid, mVec3_c *pos, mAng3_c *rot, u
extern "C" void spawnItem8(u32 itemid, u32 roomid, mVec3_c *pos, mAng3_c *rot, void *, void *, u32 param2, u32 unk);
extern "C" void spawnItem9(u32 itemid, u32 roomid, mVec3_c *pos, mAng3_c *rot);
// 800c7b80
SpecialItemDropMgr::SpecialItemDropMgr() {
SpecialItemDropMgr::sInstance = this;
}
@@ -387,7 +386,6 @@ static const struct {
};
static const u16 RAND_RUPEE_ARRAY[3] = {ITEM_GREEN_RUPEE, ITEM_BLUE_RUPEE, ITEM_RED_RUPEE};
// 800c7bb0
int SpecialItemDropMgr::fn_800C7BB0(int specialItemId) {
const DropList *list = &sDropTable.mList[specialItemId];
const DropEntry *e = list->mpEntries;
@@ -444,7 +442,6 @@ bool SpecialItemDropMgr::shouldTryExtraRupees(int specialItemId) {
return sDropTable.mList[specialItemId].mFlags & FLAG_EXTRA_RUPEES;
}
// 800c7d40
int SpecialItemDropMgr::giveSpecialDropItem(
int specialItemId, int roomid, mVec3_c *pos, int subtype, mAng rot, s32 unused
) {
@@ -481,7 +478,6 @@ int SpecialItemDropMgr::giveSpecialDropItem(
static s32 SOME_ANG = -3641;
// 800c7ef0
// Very unmatching. Just here as a starting point
bool SpecialItemDropMgr::spawnSpecialDropItem(int specialItemId, int roomid, mVec3_c *pos, int subtype, mAng rot) {
s32 unk = fn_800C7BB0(specialItemId);
@@ -547,6 +543,3 @@ bool SpecialItemDropMgr::spawnSpecialDropItem(int specialItemId, int roomid, mVe
}
return true;
}
// 800c8270
// SpecialItemDropMgr::~SpecialItemDropMgr() {}