starting to organize and progress on dAcBase_c

This commit is contained in:
Elijah Thomas
2023-08-12 10:47:25 -04:00
parent de8b60021c
commit 683dc91a53
27 changed files with 536 additions and 183 deletions
+1
View File
@@ -13,6 +13,7 @@ d/a/d_a_base.cpp:
.data start:0x80501544 end:0x805015B8
.sdata start:0x80571920 end:0x80571930
.sbss start:0x80575080 end:0x80575098
.sdata2 start:0x80576C88 end:0x80576C8C
d/a/obj/d_a_obj_base.cpp:
.text start:0x8002DE40 end:0x8002F300
+13 -13
View File
@@ -1030,14 +1030,14 @@ createHeap__9dAcBase_cFv = .text:0x8002C3A0; // type:function size:0x8
__ct__9dAcBase_cFv = .text:0x8002C3B0; // type:function size:0x178
__dt__7dBase_cFv = .text:0x8002C530; // type:function size:0x58
__dt__9dAcBase_cFv = .text:0x8002C590; // type:function size:0xB4
setTempCreateParams__9dAcBase_cFP5Vec3fP5Vec3sP5Vec3fiUiP9dAcBase_cUcsUcP10ObjInfoPtr = .text:0x8002C650; // type:function size:0x34
setTempCreateParams__9dAcBase_cFP7mVec3_cP7mAng3_cP7mVec3_ciUiP9dAcBase_cUcsUcP7ObjInfo = .text:0x8002C650; // type:function size:0x34
FUN_8002c690__9dAcBase_cFv = .text:0x8002C690; // type:function size:0x78
initAllocatorWork1Heap__9dAcBase_cFiPci = .text:0x8002C710; // type:function size:0xC
initAllocator__9dAcBase_cFiPcPQ23EGG4Heapi = .text:0x8002C720; // type:function size:0x8C
addActorToRoom__9dAcBase_cFi = .text:0x8002C7B0; // type:function size:0x88
setBit_field_0xE8__9dAcBase_cFi = .text:0x8002C840; // type:function size:0x18
actorCreate__9dAcBase_cFv = .text:0x8002C860; // type:function size:0x8
actorReCreate__9dAcBase_cFv = .text:0x8002C870; // type:function size:0x8
actorPostCreate__9dAcBase_cFv = .text:0x8002C870; // type:function size:0x8
create__9dAcBase_cFv = .text:0x8002C880; // type:function size:0x70
postCreate__9dAcBase_cFQ27fBase_c12MAIN_STATE_e = .text:0x8002C8F0; // type:function size:0x44
preDelete__9dAcBase_cFv = .text:0x8002C940; // type:function size:0x1D0
@@ -1086,7 +1086,7 @@ FUN_8002d830__9dAcBase_cFv = .text:0x8002D830; // type:function size:0x28
FUN_8002d860__9dAcBase_cFv = .text:0x8002D860; // type:function size:0x20
FUN_8002d880__9dAcBase_cFv = .text:0x8002D880; // type:function size:0x8
FUN_8002d890__9dAcBase_cFv = .text:0x8002D890; // type:function size:0x88
setActorRef__9dAcBase_cFR7dBase_c = .text:0x8002D920; // type:function size:0x8
setActorRef__9dAcBase_cFP7dBase_c = .text:0x8002D920; // type:function size:0x8
setUnkFlag__9dAcBase_cFv = .text:0x8002D930; // type:function size:0x10
FUN_8002d940__9dAcBase_cFv = .text:0x8002D940; // type:function size:0x14
FUN_8002d960__9dAcBase_cFv = .text:0x8002D960; // type:function size:0x14
@@ -3043,8 +3043,8 @@ fn_8006A550 = .text:0x8006A550; // type:function size:0x98
fn_8006A5F0 = .text:0x8006A5F0; // type:function size:0x34
fn_8006A630 = .text:0x8006A630; // type:function size:0x34
fn_8006A670 = .text:0x8006A670; // type:function size:0xB8
fn_8006A730 = .text:0x8006A730; // type:function size:0x18
fn_8006A750 = .text:0x8006A750; // type:function size:0x134
getObjectName_8006a730 = .text:0x8006A730; // type:function size:0x18
getObjByActorIdAndSubtype_unkNamespace = .text:0x8006A750; // type:function size:0x134
fn_8006A890 = .text:0x8006A890; // type:function size:0x38
fn_8006A8D0 = .text:0x8006A8D0; // type:function size:0x1DC
fn_8006AAB0 = .text:0x8006AAB0; // type:function size:0x85C
@@ -10982,7 +10982,7 @@ fn_801B4050 = .text:0x801B4050; // type:function size:0x8C
fn_801B40E0 = .text:0x801B40E0; // type:function size:0x12C
fn_801B4210 = .text:0x801B4210; // type:function size:0x28
fn_801B4240 = .text:0x801B4240; // type:function size:0x68
fn_801B42B0 = .text:0x801B42B0; // type:function size:0x20
getRoom__11RoomManagerFi = .text:0x801B42B0; // type:function size:0x20
fn_801B42D0 = .text:0x801B42D0; // type:function size:0x50
fn_801B4320 = .text:0x801B4320; // type:function size:0x54
fn_801B4380 = .text:0x801B4380; // type:function size:0xA0
@@ -17333,7 +17333,7 @@ getConnectParent__7fBase_cCFv = .text:0x802E1F90; // type:function size:0x1C
getConnectChild__7fBase_cCFv = .text:0x802E1FB0; // type:function size:0x1C
getConnectBrNext__7fBase_cCFv = .text:0x802E1FD0; // type:function size:0x1C
fn_802E1FF0 = .text:0x802E1FF0; // type:function size:0x98
fn_802E2090 = .text:0x802E2090; // type:function size:0x50
setConnectChild__7fBase_cFP7fBase_c = .text:0x802E2090; // type:function size:0x50
entryFrmHeap__7fBase_cFUlPQ23EGG4Heap = .text:0x802E20E0; // type:function size:0x1FC
entryFrmHeapNonAdjust__7fBase_cFUlPQ23EGG4Heap = .text:0x802E22E0; // type:function size:0xC0
createHeap__7fBase_cFv = .text:0x802E23A0; // type:function size:0x8
@@ -20947,7 +20947,7 @@ fn_80382410 = .text:0x80382410; // type:function size:0xC0
fn_803824D0 = .text:0x803824D0; // type:function size:0x24
fn_80382500 = .text:0x80382500; // type:function size:0x90
fn_80382590 = .text:0x80382590; // type:function size:0xB0
fn_80382640 = .text:0x80382640; // type:function size:0xFD8
soundForActorInitRelated_80382640 = .text:0x80382640; // type:function size:0xFD8
fn_80383620 = .text:0x80383620; // type:function size:0x94
fn_803836C0 = .text:0x803836C0; // type:function size:0x98
fn_80383760 = .text:0x80383760; // type:function size:0x58
@@ -21127,7 +21127,7 @@ fn_80386CF0 = .text:0x80386CF0; // type:function size:0xEC
fn_80386DE0 = .text:0x80386DE0; // type:function size:0x110
fn_80386EF0 = .text:0x80386EF0; // type:function size:0x80
fn_80386F70 = .text:0x80386F70; // type:function size:0x1A4C
fn_803889C0 = .text:0x803889C0; // type:function size:0x4
soundForActorInitRelated_803889c0 = .text:0x803889C0; // type:function size:0x4
fn_803889D0 = .text:0x803889D0; // type:function size:0x108
fn_80388AE0 = .text:0x80388AE0; // type:function size:0xC4
fn_80388BB0 = .text:0x80388BB0; // type:function size:0x118
@@ -39840,7 +39840,7 @@ lbl_805753C4 = .sbss:0x805753C4; // type:object size:0x1 data:byte
lbl_805753C8 = .sbss:0x805753C8; // type:object size:0x8 data:4byte
lbl_805753D0 = .sbss:0x805753D0; // type:object size:0x8 data:4byte
lbl_805753D8 = .sbss:0x805753D8; // type:object size:0x8 data:4byte
sInstance__16SceneflagManager = .sbss:0x805753E0; // type:object size:0x8 data:4byte
sInstance__16SceneflagManager = .sbss:0x805753E0; // type:object size:0x4 data:4byte
sTempFlags__16SceneflagManager = .sbss:0x805753E8; // type:object size:0x8
lbl_805753F0 = .sbss:0x805753F0; // type:object size:0x4 data:4byte
lbl_805753F4 = .sbss:0x805753F4; // type:object size:0x4
@@ -39998,7 +39998,7 @@ lbl_80575749 = .sbss:0x80575749; // type:object size:0x7 data:byte
lbl_80575750 = .sbss:0x80575750; // type:object size:0x8 data:byte
lbl_80575758 = .sbss:0x80575758; // type:object size:0x4 data:4byte
lbl_8057575C = .sbss:0x8057575C; // type:object size:0x4 data:4byte
lbl_80575760 = .sbss:0x80575760; // type:object size:0x4 data:4byte
m_Instance__11RoomManager = .sbss:0x80575760; // type:object size:0x4 data:4byte
lbl_80575764 = .sbss:0x80575764; // type:object size:0x1 data:byte
lbl_80575768 = .sbss:0x80575768; // type:object size:0x8 data:byte
lbl_80575770 = .sbss:0x80575770; // type:object size:0x4 data:float
@@ -40230,7 +40230,7 @@ lbl_80575BA8 = .sbss:0x80575BA8; // type:object size:0x8 data:4byte
sLoadAsyncCallback__7fBase_c = .sbss:0x80575BB0; // type:object size:0x4 data:4byte
sUnloadCallback__7fBase_c = .sbss:0x80575BB4; // type:object size:0x4 data:4byte
lbl_80575BB8 = .sbss:0x80575BB8; // type:object size:0x8 data:4byte
DAT_ACTOR_ALLOCATION_FUNCTIONS = .sbss:0x80575BC0; // type:object size:0x8 data:4byte
sProfileList__8fProfile = .sbss:0x80575BC0; // type:object size:0x8 data:4byte
lbl_80575BC8 = .sbss:0x80575BC8; // type:object size:0x4 data:4byte
lbl_80575BCC = .sbss:0x80575BCC; // type:object size:0x1 data:byte
lbl_80575BD0 = .sbss:0x80575BD0; // type:object size:0x4 data:4byte
@@ -41148,7 +41148,7 @@ lbl_80576C74 = .sdata2:0x80576C74; // type:object size:0x4 data:float
lbl_80576C78 = .sdata2:0x80576C78; // type:object size:0x4 data:float
lbl_80576C7C = .sdata2:0x80576C7C; // type:object size:0x4 data:float
lbl_80576C80 = .sdata2:0x80576C80; // type:object size:0x8 data:double
lbl_80576C88 = .sdata2:0x80576C88; // type:object size:0x4 data:float
lbl_80576C88 = .sdata2:0x80576C88; // type:object size:0x4 scope:local data:float
lbl_80576C8C = .sdata2:0x80576C8C; // type:object size:0x4 data:float
lbl_80576C90 = .sdata2:0x80576C90; // type:object size:0x4 data:float
lbl_80576C94 = .sdata2:0x80576C94; // type:object size:0x4 data:float
+1 -1
View File
@@ -9,9 +9,9 @@ LIBS = [
["Runtime/__init_cpp_exceptions.cpp", False],
["toBeSorted/unk_flag_stuff.cpp", True],
["toBeSorted/bitwise_flag_helper.cpp", True],
["d/d_base.cpp", True],
["toBeSorted/sceneflag_manager.cpp", True],
["toBeSorted/flag_space.cpp", False],
["d/d_base.cpp", True],
["d/a/d_a_base.cpp", False],
["d/a/obj/d_a_obj_base.cpp", False],
["toBeSorted/save_file.cpp", False],
+1 -1
View File
@@ -19,7 +19,7 @@ struct Vec3s
s16 x, y, z;
};
struct ObjInfoPtr {
struct ObjInfo {
/* 0x00 */ char* name;
/* 0x04 */ u16 obj_id;
/* 0x06 */ u16 obj_id2;
+64 -15
View File
@@ -4,20 +4,50 @@
#include <d/d_heap.h>
#include <m/m_allocator.h>
#include <UnknownTypeBelongings.h>
#include <m/types_m.h>
// #include <m/types_m.h>
#include <m/m_angle.h>
#include <m/m_vec.h>
#include <toBeSorted/room_manager.h>
class dAcBase_c;
struct SoundInfo {
dAcBase_c* actor;
void* obj_sound;
mVec3_c* obj_pos;
SoundInfo* next;
SoundInfo* prev;
};
// Ghidra: ActorBase
// size: 0xFC
// non-official name
class dAcBase_c : public dBase_c {
public:
/* 0x68 */ mHeapAllocator_c mHeapAllocator; // mHeapAlloctor
/* 0x84 */ ObjInfoPtr* objInfo; //
/* 0x88 */ int field_0x88;
/* 0x8C */ int field_0x8C;
/* 0x90 */ int field_0x90;
/* 0x94 */ void* soundRelated;
/* 0x68 */ mHeapAllocator_c heap_allocator;
/* 0x84 */ ObjInfo* obj_info;
/* 0x88 */ void* sound_info_tail;
/* 0x8c */ SoundInfo* sound_info_next;
/* 0x90 */ int count;
/* 0x94 */ void* obj_sound;
/* 0x9C */ mVec3_c* obj_pos;
/* 0x9c */ mVec3_c pos_copy;
/* 0xa8 */ u32 params2;
/* 0xAC */ mAng3_c rot_copy;
/* 0xB2 */ u16 obj_id; // enemydefeat flag / id on obj-map
/* 0xB4 */ u8 room_id_copy;
/* 0xB5 */ u8 viewclip_index;
/* 0xB6 */ u8 subtype;
/* 0xB8 */ mAng3_c rotation;
/* 0xC0 */ mVec3_c position;
/* 0xCC */ mVec3_c scale;
/* 0xD8 */ u32 actor_properties;
/* 0xDC */ fLiNdBa_c actor_node;
/* 0xE8 */ u32 field_0xe8;
/* 0xEC */ u8 roomid;
/* 0xED */ u8 actor_subtype;
/* 0xF0 */ u32 field_0xF0;
/* 0xF4 */ char someStr[4];
/* 0xF8 */ char field_0xf8[0xfc - 0xf8];
protected:
/* 80501544 */ // vtable
/* 0x08 | 8002c880 */ virtual int create();
@@ -29,7 +59,7 @@ protected:
/* 0x44 | 8002c3a0 */ virtual bool createHeap();
/* 0x48 | 8002c590 */ virtual ~dAcBase_c();
/* 0x4C | 8002c860 */ virtual int actorCreate(); // name is assumed
/* 0x50 | 8002c870 */ virtual int actorReCreate(); // name is assumed
/* 0x50 | 8002c870 */ virtual int actorPostCreate(); // name is assumed
/* 0x54 | 8002cca0 */ virtual int actorExecute(); // name is assumed
/* 0x58 | 8002ccb0 */ virtual int actorExecuteInEvent(); // name is assumed
/* 0x5C | 8002ce90 */ virtual void unkVirtFunc_0x5C();
@@ -42,13 +72,32 @@ protected:
public:
/* 8002c3b0 */ dAcBase_c();
void setPostion(mVec3_c* r) {
position.set(r->x, r->y, r->z);
}
void setScale(f32 x, f32 y, f32 z) {
scale.set(x, y, z);
}
void setScale(mVec3_c* r) {
scale.set(r->x, r->y, r->z);
}
void setRotation(mAng3_c* r) {
rotation = *r;
}
void copyPosition() {
pos_copy = position;
}
void copyRotation() {
rot_copy = rotation;
}
public:
// funcs found in TU
/* 8002c650 */ static void setTempCreateParams( \
Vec3f* pos, Vec3s* rot, Vec3f* scale, \
mVec3_c* pos, mAng3_c* rot, mVec3_c* scale, \
s32 roomId, u32 params2, dAcBase_c* parent, \
u8 subtype, s16 unkFlag, u8 viewClipIdx,\
ObjInfoPtr* objInfo );
ObjInfo* objInfo );
/* 8002c690 */ void* FUN_8002c690();
/* 8002c710 */ int initAllocatorWork1Heap(int size, char* name, int align);
@@ -98,7 +147,7 @@ public:
/* 8002d880 */ void FUN_8002d880();
// End Sound Effect Related
/* 8002d890 */ void FUN_8002d890();
/* 8002d920 */ void setActorRef(dBase_c&);
/* 8002d920 */ void setActorRef(dBase_c*);
// next three funcs are related
/* 8002d930 */ void setUnkFlag();
/* 8002d940 */ void FUN_8002d940();
@@ -124,10 +173,10 @@ public:
/* 80571924 */ static u32 s_Create_Params2;
/* 80571928 */ static u16 s_Create_UnkFlags;
/* 8057192A */ static u8 s_Create_ViewClipIdx;
/* 80575080 */ static Vec3f* s_Create_Position;
/* 80575084 */ static Vec3s* s_Create_Rotation;
/* 80575088 */ static Vec3f* s_Create_Scale;
/* 80575080 */ static mVec3_c* s_Create_Position;
/* 80575084 */ static mAng3_c* s_Create_Rotation;
/* 80575088 */ static mVec3_c* s_Create_Scale;
/* 8057508C */ static dAcBase_c* s_Create_Parent;
/* 80575090 */ static ObjInfoPtr* s_Create_ObjInfo;
/* 80575090 */ static ObjInfo* s_Create_ObjInfo;
/* 80575094 */ static u8 s_Create_Subtype;
};
+1 -1
View File
@@ -1,7 +1,7 @@
#pragma once
#include <f/f_base.h>
#include <c/c_owner_set.h>
// #include <c/c_owner_set.h>
// Ghidra: dBase_c
// size: 0x68
View File
+1
View File
@@ -82,6 +82,7 @@ public:
/* 802e1f90 */ fBase_c *getConnectParent() const;
/* 802e1fb0 */ fBase_c *getConnectChild() const;
/* 802e1fd0 */ fBase_c *getConnectBrNext() const;
/* 802e2090 */ bool setConnectChild(fBase_c* child);
/* 802e2420 */ void runCreate();
/* 802e24a0 */ fBase_c *getChildProcessCreateState() const;
/* 802e2510 */ bool checkChildProcessCreateState() const;
+1 -1
View File
@@ -7,10 +7,10 @@
class fBase_c;
// Ghidra: Used to be ActorReference
class fLiNdBa_c : public cListNd_c {
public:
fLiNdBa_c() : p_owner(nullptr) {}
fLiNdBa_c(fBase_c *owner) : p_owner(owner) {}
inline fLiNdBa_c *getPrev() const {
+25
View File
@@ -0,0 +1,25 @@
#pragma once
#include <lib/egg/egg_types.h>
#include <lib/egg/core/eggHeap.h>
namespace EGG {
class IAudioMgr {
public:
struct Arg {
/* 0x00 */ EGG::Heap* heap;
/* 0x04 */ char* soundFileName;
/* 0x08 */ int sndThreadPriority;
/* 0x0c */ int sndThreadStackSize;
/* 0x10 */ int dvdThreadPriority;
/* 0x14 */ int dvdThreadStackSize;
/* 0x18 */ u32 blocks;
/* 0x1c */ u8 field_0x1C;
};
};
class SimpleAudioMgr : public IAudioMgr, public SoundHeapMgr, public ArcPlayer {
};
}
+74 -74
View File
@@ -8,86 +8,86 @@
namespace EGG
{
// gfx
struct CapTexture;
struct CpuTexture;
struct DrawGX;
struct DrawPathBase;
struct DrawPathBloom;
struct DrawPathDOF;
struct DrawPathHDR;
struct DrawPathLightMap;
struct DrawPathShadowVolume;
struct Fog;
struct FogManager;
struct G3DUtility;
struct GfxEngine;
struct GXUtility;
struct IDrawGX;
struct IScnProc;
struct IScnProcModel;
struct LightObj;
struct LightManager;
struct LightTexture;
struct LightTextureManager;
struct ModelBoundingInfo;
struct ModelEx;
struct ModelSnapshot;
struct PostEffectBase;
struct PostEffectBlur;
struct PostEffectBlurGather;
struct PostEffectHDR;
struct PostEffectSimple;
struct ResTIMG;
struct ScnRenderer;
struct ScnRootEx;
struct Screen;
struct ScreenEffectBase;
struct ShadowTextureManager;
struct ShadowTexture;
struct StateGX;
struct StateGX;
struct TextureBuffer;
class CapTexture;
class CpuTexture;
class DrawGX;
class DrawPathBase;
class DrawPathBloom;
class DrawPathDOF;
class DrawPathHDR;
class DrawPathLightMap;
class DrawPathShadowVolume;
class Fog;
class FogManager;
class G3DUtility;
class GfxEngine;
class GXUtility;
class IDrawGX;
class IScnProc;
class IScnProcModel;
class LightObj;
class LightManager;
class LightTexture;
class LightTextureManager;
class ModelBoundingInfo;
class ModelEx;
class ModelSnapshot;
class PostEffectBase;
class PostEffectBlur;
class PostEffectBlurGather;
class PostEffectHDR;
class PostEffectSimple;
class ResTIMG;
class ScnRenderer;
class ScnRootEx;
class Screen;
class ScreenEffectBase;
class ShadowTextureManager;
class ShadowTexture;
class StateGX;
class StateGX;
class TextureBuffer;
// math
template <typename T> struct Math;
struct Matrix33f;
struct Matrix34f;
struct Matrix44f;
struct Quatf;
struct Vector2f;
struct Vector3f;
template <typename T> class Math;
class Matrix33f;
class Matrix34f;
class Matrix44f;
class Quatf;
class Vector2f;
class Vector3f;
// core
struct Allocator;
struct Archive;
struct AsyncDisplay;
template <typename T> struct IBinary;
template <typename T> struct TBitFlag;
struct CntFile;
struct ColorFader;
struct Decomp;
struct Display;
struct Disposer;
struct DvdFile;
struct DvdRipper;
struct ExpHeap;
struct Fader;
struct FrmHeap;
struct Heap;
struct Scene;
struct SceneManager;
struct Thread;
struct Video;
struct Xfb;
struct XfbManager;
class Allocator;
class Archive;
class AsyncDisplay;
template <typename T> class IBinary;
template <typename T> class TBitFlag;
class CntFile;
class ColorFader;
class Decomp;
class Display;
class Disposer;
class DvdFile;
class DvdRipper;
class ExpHeap;
class Fader;
class FrmHeap;
class Heap;
class Scene;
class SceneManager;
class Thread;
class Video;
class Xfb;
class XfbManager;
// audio
struct ArcPlayer;
struct IAudioMgr;
struct SimpleAudioMgr;
struct SoundHeapMgr;
class ArcPlayer;
class IAudioMgr;
class SimpleAudioMgr;
class SoundHeapMgr;
// util
struct Exception;
struct MsgRes;
class Exception;
class MsgRes;
} // namespace EGG
+15
View File
@@ -0,0 +1,15 @@
#pragma once
#include <lib/nw4r/nw4r_types.h>
namespace nw4r
{
namespace math
{
class VEC3 {
public:
f32 x,y,z;
};
} // namespace math
} // namespace nw4r
+6 -6
View File
@@ -43,12 +43,12 @@ namespace nw4r
namespace math
{
struct VEC2;
struct VEC3;
struct MTX33;
struct MTX34;
struct AABB;
struct FRUSTUM;
class VEC2;
class VEC3;
class MTX33;
class MTX34;
class AABB;
class FRUSTUM;
}
namespace snd
+23
View File
@@ -0,0 +1,23 @@
#pragma once
#include <lib/nw4r/nw4r_types.h>
namespace nw4r
{
namespace snd
{
class SoundSystem {
public:
struct SoundSystemParam {
int soundThreadPriority;
int soundThreadStackSize;
int dvdThreadPriority;
int dvdThreadStackSize;
};
};
} // namespace snd
} // namespace nw4r
+7
View File
@@ -3,9 +3,16 @@
#include <types.h>
struct mAng {
public:
s16 val;
};
class mAng3_c {
public:
s16 x,y,z;
void set(s16 fx, s16 fy, s16 fz) {
x = fx;
y = fy;
z = fz;
}
};
+85
View File
@@ -0,0 +1,85 @@
#pragma once
#include <types.h>
#include <lib/rvl/MTX.h>
#include <lib/nw4r/math/vec.h>
class mVec3_c {
public:
f32 x;
f32 y;
f32 z;
/// @brief Constructs an empty vector.
mVec3_c() {}
/// @brief Constructs a vector from a float array.
mVec3_c(const f32 *p) { x = p[0]; y = p[1]; z = p[2]; }
/// @brief Constructs a vector from three floating point values.
mVec3_c(f32 fx, f32 fy, f32 fz) { x = fx; y = fy; z = fz; }
void set(f32 fx, f32 fy, f32 fz) { x = fx; y = fy; z = fz; }
mVec3_c& operator=(mVec3_c& r) { x = r.x; y = r.y; z = r.z; return *this;}
/// @brief Constructs a new vector from an existing vector from the MTX library.
mVec3_c(const Vec &v) { x = v.x; y = v.y; z = v.z; }
/// @brief Constructs a new vector from an existing vector from the nw4r::math library.
mVec3_c(const nw4r::math::VEC3 &v) { x = v.x; y = v.y; z = v.z; }
/// @brief Float cast operator.
operator f32*() { return &x; }
/// @brief Const float cast operator.
operator const f32*() const { return &x; }
/// @brief Vec cast operator.
operator Vec*() { return (Vec*)&x; }
/// @brief Const Vec cast operator.
operator const Vec*() const { return (const Vec*)&x; }
/// @brief nw4r::math::VEC3 cast operator.
operator nw4r::math::VEC3*() { return (nw4r::math::VEC3*)&x; }
/// @brief Const nw4r::math::VEC3 cast operator.
operator const nw4r::math::VEC3*() const { return (const nw4r::math::VEC3*)&x; }
/// @brief Augmented addition operator.
mVec3_c &operator+=(const mVec3_c &v) { x += v.x; y += v.y; z += v.z; return *this; }
/// @brief Augmented subtraction operator.
mVec3_c &operator-=(const mVec3_c &v) { x -= v.x; y -= v.y; z -= v.z; return *this; }
/// @brief Augmented scalar product operator.
mVec3_c &operator*=(f32 f) { x *= f; y *= f; z *= f; return *this; }
/// @brief Augmented scalar division operator.
mVec3_c &operator/=(f32 f) { return operator*=(1.0f / f); }
/// @brief Positive operator.
mVec3_c operator+() const { return *this; }
/// @brief Negative operator.
mVec3_c operator-() const { return mVec3_c(-x, -y, -z); }
/// @brief Addition operator.
mVec3_c operator+(const mVec3_c &v) const { return mVec3_c(x + v.x, y + v.y, z + v.z); }
/// @brief Subtraction operator.
mVec3_c operator-(const mVec3_c &v) const { return mVec3_c(x - v.x, y - v.y, z - v.z); }
/// @brief Scalar product operator.
mVec3_c operator*(f32 f) const { return mVec3_c(f * x, f * y, f * z); }
/// @brief Scalar division operator.
mVec3_c operator/(f32 f) const { f32 r = 1.0f / f; return operator*(r); }
/// @brief Equality operator.
bool operator==(const mVec3_c &v) const { return x == v.x && y == v.y && z == v.z; }
/// @brief Inequality operator.
bool operator!=(const mVec3_c &v) const { return x != v.x || y != v.y || z != v.z; }
};
+11
View File
@@ -0,0 +1,11 @@
#pragma once
#include <types.h>
#include <lib/egg/audio/eggAudioMgr.h>
// Size: 0x6d0
class SndAudioMgr : public EGG::SimpleAudioMgr {
public:
};
+31
View File
@@ -0,0 +1,31 @@
#pragma once
#include <types.h>
#include <d/d_base.h>
#define MAX_ROOM_NUMBER 64
class dRoom;
class RoomTable {
RoomTable();
virtual ~RoomTable();
dRoom* rooms[MAX_ROOM_NUMBER-1];
};
// OBJ NAME: STAGE
// Ghidra: RoomManager
// size: 0x239c
// vtable: 8052dff4
class RoomManager : public dBase_c {
public:
/* 0068 */ char field_0x68[0x7C - 0x68];
/* 007C */ RoomTable rooms;
/* 017c */ char fader[0x1a0 - 0x17c]; // size unk
/* 01a0 */ char mapRelated[0x39c - 0x1a0]; // size unk
/* 039c */ u32 loaded_entities[2047];
/* 2398 */ u8 curr_room_id;
public:
/* 80575760 */ static RoomManager* m_Instance;
public:
/* 801b42b0 */ static dBase_c* getRoom(int roomid);
};
+22 -44
View File
@@ -85,49 +85,27 @@ public:
// it could also potentially be a static function
// ----------------------------------------------------------
public:
// 0x800099b0
u16* getStoryFlags0();
// 0x800099c0
u16* getStoryFlags1();
// 0x800099d0
u16* getItemFlags0();
// 0x800099e0
u16* getItemFlags1();
// 0x800099F0
u16* getDungeonFlags0();
// 0x80009A00
u16* getDungeonFlags1();
// 0x80009A10
u16* getSceneFlags0();
// 0x80009A20
u16* getSceneFlags1();
// 0x80009A30
u16* getTboxFlags0();
// 0x80009A40
u16* getTboxFlags1();
// 0x80009A50
u16* getTempFlags0();
// 0x80009A60
u16* getTempFlags1();
// 0x80009A70
u16* getZoneFlags0();
// 0x80009A80
u16* getZoneFlags1();
// 0x80009A90
u16* getUnkFlags0();
// 0x80009AA0
u16* getUnkFlags1();
// 0x80009AB0
s16* getPlayerName(); // UTF16-BE
// 0x80009AC0
void setAreaT1(char* name);
// 0x80009BE0
s8* getAreaT1();
// 0x80009BF0
void setAreaT2(char* name);
// lbl_80009D10
s8* getAreaT2();
// lbl_80009D20
s8* getAreaT3();
/* 800099b0 */ u16* getStoryFlags0();
/* 800099c0 */ u16* getStoryFlags1();
/* 800099d0 */ u16* getItemFlags0();
/* 800099e0 */ u16* getItemFlags1();
/* 800099F0 */ u16* getDungeonFlags0();
/* 80009A00 */ u16* getDungeonFlags1();
/* 80009A10 */ u16* getSceneFlags0();
/* 80009A20 */ u16* getSceneFlags1();
/* 80009A30 */ u16* getTboxFlags0();
/* 80009A40 */ u16* getTboxFlags1();
/* 80009A50 */ u16* getTempFlags0();
/* 80009A60 */ u16* getTempFlags1();
/* 80009A70 */ u16* getZoneFlags0();
/* 80009A80 */ u16* getZoneFlags1();
/* 80009A90 */ u16* getUnkFlags0();
/* 80009AA0 */ u16* getUnkFlags1();
/* 80009AB0 */ s16* getPlayerName(); // UTF16-BE
/* 80009AC0 */ void setAreaT1(char* name);
/* 80009BE0 */ s8* getAreaT1();
/* 80009BF0 */ void setAreaT2(char* name);
/* 80009D10 */ s8* getAreaT2();
/* 80009D20 */ s8* getAreaT3();
};
+14 -1
View File
@@ -1,5 +1,8 @@
#pragma once
#define TYPES_H
#include <lib/rvl/macros.h>
typedef signed char s8;
typedef signed short s16;
typedef signed int s32;
@@ -32,7 +35,17 @@ typedef double f64;
typedef volatile f32 vf32;
typedef volatile f64 vf64;
#define nullptr 0
// Necesary for CW
#if __cplusplus < 201103L && !defined(_WIN32)
#define override
#define noexcept
#define nullptr NULL
#endif
#ifndef NULL
#define NULL 0
#endif
#define nullptr NULL
// taken from mkw
#ifdef __cplusplus
+129 -18
View File
@@ -1,5 +1,6 @@
#include <d/a/d_a_base.h>
// RoomManager* RoomManager::m_Instance;
// .sdata
u32 dAcBase_c::s_Create_RoomId = -1;
@@ -8,28 +9,86 @@ u16 dAcBase_c::s_Create_UnkFlags = -1;
u8 dAcBase_c::s_Create_ViewClipIdx = -1;
// .sbss
Vec3f* dAcBase_c::s_Create_Position;
Vec3s* dAcBase_c::s_Create_Rotation;
Vec3f* dAcBase_c::s_Create_Scale;
mVec3_c* dAcBase_c::s_Create_Position;
mAng3_c* dAcBase_c::s_Create_Rotation;
mVec3_c* dAcBase_c::s_Create_Scale;
dAcBase_c* dAcBase_c::s_Create_Parent;
ObjInfoPtr* dAcBase_c::s_Create_ObjInfo;
ObjInfo* dAcBase_c::s_Create_ObjInfo;
u8 dAcBase_c::s_Create_Subtype;
extern "C" ObjInfo* getObjByActorIdAndSubtype_unkNamespace(ProfileName, u8);
extern "C" char* getObjectName_8006a730(ObjInfo*);
extern "C" void* soundForActorInitRelated_803889c0(s8, fBase_c*, char*, u8);
bool dAcBase_c::createHeap() {
return true;
}
dAcBase_c::dAcBase_c() {}
// Doesnt Match Yet
dAcBase_c::dAcBase_c() :
heap_allocator() ,
obj_info(s_Create_ObjInfo)
// sound_list(&heap_allocator.mHeap, &heap_allocator.mHeap)
// obj_sound(0),
// obj_pos(&position),
// params2(s_Create_Params2),
// obj_id(s_Create_UnkFlags),
// viewclip_index(s_Create_ViewClipIdx),
// actor_node(0),
// roomid(s_Create_RoomId)
{
// obj_info = s_Create_ObjInfo;
sound_info_tail = nullptr;
sound_info_next = nullptr;
obj_sound = nullptr;
obj_pos = &position;
params2 = (s_Create_Params2);
obj_id = (s_Create_UnkFlags);
viewclip_index = (s_Create_ViewClipIdx);
actor_node = (0);
roomid =(s_Create_RoomId);
actor_subtype = s_Create_Subtype;
field_0xF0 = 0;
someStr[0] = 0;
if (s_Create_Position != nullptr) {
// void set(f32 fx, f32 fy, f32 fz) { x = fx; y = fy; z = fz; }
position.set(
s_Create_Position->x,
s_Create_Position->y,
s_Create_Position->z
);
// position = *s_Create_Position;
}
if (s_Create_Rotation != 0) {
rotation = *(s_Create_Rotation);
}
if (s_Create_Scale != 0) {
setScale(s_Create_Scale->x, s_Create_Scale->y, s_Create_Scale->z);
} else {
setScale(1.0, 1.0, 1.0);
}
if (s_Create_Parent != 0){
setActorRef(s_Create_Parent);
}
fProfile::fActorProfile_c* profile = (fProfile::fActorProfile_c*)((*fProfile::sProfileList)[profile_name]);
actor_properties = profile->mActorProperties;
if (obj_info == nullptr) {
obj_info = getObjByActorIdAndSubtype_unkNamespace(profile_name, actor_subtype);
}
someStr[0] = '\0';
}
/* 8002c530 */ dBase_c::~dBase_c() {}
dAcBase_c::~dAcBase_c() {}
void dAcBase_c::setTempCreateParams( \
Vec3f* pos, Vec3s* rot, Vec3f* scale, \
mVec3_c* pos, mAng3_c* rot, mVec3_c* scale, \
s32 roomId, u32 params2, dAcBase_c* parent, \
u8 subtype, s16 unkFlag, u8 viewClipIdx,\
ObjInfoPtr* objInfo )
ObjInfo* objInfo )
{
s_Create_Position = pos;
s_Create_Rotation = rot;
@@ -42,28 +101,80 @@ void dAcBase_c::setTempCreateParams( \
s_Create_ViewClipIdx = viewClipIdx;
s_Create_ObjInfo = objInfo;
}
void* dAcBase_c::FUN_8002c690() {}
// has regswap
void* dAcBase_c::FUN_8002c690() {
if (obj_info == nullptr) {
return nullptr;
}
s8 unk_val = obj_info->unk_0xA;
if ( unk_val == -1) {
return nullptr;
}
char* objName = getObjectName_8006a730(obj_info);
return soundForActorInitRelated_803889c0(unk_val, this, objName, subtype);
}
int dAcBase_c::initAllocatorWork1Heap(int size, char* name, int align) {
initAllocator(size, name, dHeap::work1Heap, align);
}
extern "C" int fn_802EE510(mAllocator_c*, int size, EGG::Heap* heap, char* name, int align, int unk);
int dAcBase_c::initAllocator(int size, char* name, EGG::Heap* heap, int align) {
if (fn_802EE510(&mHeapAllocator, size, heap, name, 0x20, 0) == 0){
if (fn_802EE510(&heap_allocator, size, heap, name, 0x20, 0) == 0){
return 0;
}
soundRelated = FUN_8002c690();
obj_sound = FUN_8002c690();
int success = createHeap();
mHeapAllocator.adjustFrmHeapRestoreCurrent();
heap_allocator.adjustFrmHeapRestoreCurrent();
return success;
}
bool dAcBase_c::addActorToRoom(s32 roomId) {}
void dAcBase_c::setBit_field_0xE8(s32) {}
int dAcBase_c::actorCreate() {}
int dAcBase_c::actorReCreate() {}
int dAcBase_c::create() {}
void dAcBase_c::postCreate(fBase_c::MAIN_STATE_e state) {}
bool dAcBase_c::addActorToRoom(s32 roomId) {
dBase_c* room = RoomManager::getRoom(roomId);
if (room == nullptr) {
return false;
}
if (setConnectChild(room)){
if (roomId == -1) {
this->roomid = RoomManager::m_Instance->curr_room_id;
} else {
this->roomid = roomId;
}
return true;
}
return false;
}
void dAcBase_c::setBit_field_0xE8(s32 shift) {
field_0xe8 |= (1 << shift);
}
int dAcBase_c::actorCreate() {
return SUCCEEDED;
}
int dAcBase_c::actorPostCreate() {
return SUCCEEDED;
}
int dAcBase_c::create() {
if (actor_properties & 0x8000000) {
return actorPostCreate();
}
int success = actorCreate();
if (success == SUCCEEDED){
success = NOT_READY;
actor_properties |= 0x8000000;
}
return success;
}
void dAcBase_c::postCreate(fBase_c::MAIN_STATE_e state) {
if (state == SUCCESS) {
pos_copy = position;
copyRotation();
room_id_copy = roomid;
}
dBase_c::postCreate(state);
}
int dAcBase_c::preDelete() {}
int dAcBase_c::preExecute() {}
int dAcBase_c::execute() {}
@@ -126,7 +237,7 @@ void dAcBase_c::FUN_8002d880() {}
// first param is not dAcBase_c
void dAcBase_c::FUN_8002d890() {}
// current name is Global__setActorRef
void dAcBase_c::setActorRef(dBase_c&) {}
void dAcBase_c::setActorRef(dBase_c*) {}
// May not be only purpose
void dAcBase_c::setUnkFlag() {}
void dAcBase_c::FUN_8002d940() {}
+1 -3
View File
@@ -1,14 +1,12 @@
#include <d/d_base.h>
extern "C" fProfile::fBaseProfile_c** DAT_ACTOR_ALLOCATION_FUNCTIONS;
// .sbss
/* 805750c0 */ u32 dBase_c::s_ExecuteControlFlags;
/* 805750c0 */ u32 dBase_c::s_DrawControlFlags;
/* 805750c0 */ u32 dBase_c::s_NextExecuteControlFlags;
dBase_c::dBase_c() : fBase_c() {
baseProperties = DAT_ACTOR_ALLOCATION_FUNCTIONS[profile_name]->mBaseProperties;
baseProperties = (*fProfile::sProfileList)[profile_name]->mBaseProperties;
}
void dBase_c::postDraw(fBase_c::MAIN_STATE_e status) {
+4 -2
View File
@@ -28,7 +28,9 @@ fBase_c::~fBase_c() {}
int fBase_c::commonPack(int (fBase_c::*doFunc)(), int (fBase_c::*preFunc)(), void (fBase_c::*postFunc)(MAIN_STATE_e)) {}
/* 802e15c0 */
int fBase_c::create() {}
int fBase_c::create() {
return SUCCEEDED;
}
/* 802e15d0 */
int fBase_c::preCreate() {}
@@ -106,7 +108,7 @@ fBase_c* fBase_c::getConnectBrNext() const {}
// FUN_802e1ff0
/* 802e2090 */
// addActorToRoom
bool fBase_c::setConnectChild(fBase_c* child) {}
/* 802e20e0 */
bool fBase_c::entryFrmHeap(unsigned long size, EGG::Heap *parentHeap) {}
+3
View File
@@ -0,0 +1,3 @@
#include <toBeSorted/room_manager.h>
RoomManager* RoomManager::m_Instance;
+3 -3
View File
@@ -1,9 +1,9 @@
#include <types.h>
#include <libc.h>
#include "lib/rvl/macros.h"
#include "toBeSorted/flag_space.h"
#include "toBeSorted/file_manager.h"
#include <lib/rvl/macros.h>
#include <toBeSorted/flag_space.h>
#include <toBeSorted/file_manager.h>
#include <toBeSorted/bitwise_flag_helper.h>
class SceneflagManager {