Merge pull request #2 from elijah-thomas774/main

Updates from Yesterday
This commit is contained in:
Elijah Thomas
2023-08-10 10:11:30 -04:00
committed by GitHub
26 changed files with 573 additions and 14 deletions
+4
View File
@@ -14,6 +14,10 @@ d/a/d_a_base.cpp:
.sdata start:0x80571920 end:0x80571930
.sbss start:0x80575080 end:0x80575098
d/a/obj/d_a_obj_base.cpp:
.text start:0x8002DE40 end:0x8002F300
.data start:0x805015B8 end:0x80501638
d/d_base.cpp:
.text start:0x80050800 end:0x80050A14
.data start:0x80503380 end:0x805033CC
+1
View File
@@ -11,6 +11,7 @@ LIBS = [
["toBeSorted/bitwise_flag_helper.cpp", True],
["d/d_base.cpp", False],
["d/a/d_a_base.cpp", False],
["d/a/obj/d_a_obj_base.cpp", False],
["toBeSorted/save_file.cpp", False],
["toBeSorted/file_manager.cpp", False],
["toBeSorted/save_manager.cpp", False],
+11
View File
@@ -26,4 +26,15 @@ struct ObjInfoPtr {
/* 0x08 */ u16 fiTextEntryId;
/* 0x0A */ u8 unk_0xA;
/* 0x0B */ u8 subtype;
};
class fBase_c;
struct ActorReference {
ActorReference* prev;
ActorReference* next;
fBase_c* link;
};
class UnkCollider {
};
+2 -2
View File
@@ -2,14 +2,14 @@
#include <d/d_base.h>
#include <d/d_heap.h>
#include <m/mAllocator.h>
#include <m/m_allocator.h>
#include <UnknownTypeBelongings.h>
// Ghidra: ActorBase
// size: 0xFC
// non-official name
class dAcBase_c : public dBase_c {
public:
/* 0x68 */ mHeapAllocator mHeapAllocator; // mHeapAlloctor
/* 0x68 */ mHeapAllocator_c mHeapAllocator; // mHeapAlloctor
/* 0x84 */ ObjInfoPtr* objInfo; //
/* 0x88 */ int field_0x88;
/* 0x8C */ int field_0x8C;
+1 -1
View File
@@ -5,6 +5,6 @@
// Ghidra: ActorEnemyBase
// size:
// non-official name
class dAcEnBase_c : public dAcOBase_c {
class dAcEnBase_c : public dAcObjBase_c {
};
+1 -1
View File
@@ -7,6 +7,6 @@
// Ghidra: ActorNpcBase
// size: 0x6e4
// official name
class dAcNpc_c : public dAcOBase_c {
class dAcNpc_c : public dAcObjBase_c {
};
+78 -1
View File
@@ -1,10 +1,87 @@
#pragma once
#include <d/a/d_a_base.h>
#include <m/types_m.h>
// Ghidra: ActorObjectBase
// size: 0x330
// vtable: 0x805015b8
// non-official name
class dAcOBase_c : public dAcBase_c {
class dAcObjBase_c : public dAcBase_c {
public:
// Data Members
public:
// could be their own thing?
/* 8002de40 */ static void* getOarcFile(char* oarcName, char* fileName);
/* 8002de60 */ static void* getOarcSubEntry(char* oarcName, char* fileName);
/* 8002de80 */ static void* getOarcResFile(char* oarcName);
/* 8002de90 */ static void* getOarcModelFile(char* oarcName);
/* 8002dea0 */ static void* getOarcZev(char* oarcName);
/* 8002deb0 */ static void* getOarcDZB(char* dzbName);
/* 8002ded0 */ static void* getOarcPLC(char* plcName);
public:
/* 8002def0 */ dAcObjBase_c();
/* 8002e050 */ virtual ~dAcObjBase_c();
/* 8002e0e0 */ virtual int preCreate();
/* 8002e150 */ virtual int preExecute();
/* 8002e2a0 */ virtual void postExecute();
/* 8002e330 */ virtual int preDraw();
/* 8002e5b0 */ virtual void* getObjectListEntry();
/* 8002e5c0 */ virtual bool restorePosRotFromCopy();
/* 8002ea10 */ virtual bool canBeLinkedToWoodTag();
/* 8002ea20 */ virtual bool drop();
public:
/* 8002e630 */ static dAcObjBase_c create( \
fProfile::PROFILE_NAME_e actorId, u32 roomId, u32 params1, \
Vec3f* pos, Vec3s* rot, Vec3f* scale, u32 params2 );
/* 8002e6d0 */ static dAcObjBase_c create( \
char* name, u32 roomId, u32 params1, \
Vec3f* pos, Vec3s* rot, Vec3f* scale, \
u32 params2, u16 id, u8 viewclipId);
/* 8002e770 */ static dAcObjBase_c* findObject(fProfile::PROFILE_NAME_e actorId,\
ActorReference* refList, dAcObjBase_c* parent);
/* 8002e7f0 */ static dAcObjBase_c* getNextObject(ActorReference* ref, dAcObjBase_c* parent);
/* 8002e850 */ bool isPlayer();
/* 8002e870 */ void calcVelocity(Vec3f& pos, f32 speed);
/* 8002e8e0 */ void calcVelocity();
/* 8002e9a0 */ void updateMatrix();
/* 8002ea00 */ void setDefaultCullDistance();
/* 8002ea30 */ void fn_8002EA30(f32,f32,f32,f32,f32, void*);
/* 8002ea60 */ void fn_8002EA60(void*);
/* 8002eb30 */ void fn_8002EB30(void*);
/* 8002eb90 */ void putInODesert(f32 depth, Vec3f* position);
// Disabling makes Items and Link Disappear
/* 8002ec70 */ void drawModelType1();
// Disabling make Lava and other objects Disappear
/* 8002ecd0 */ void drawModel2();
/* 8002ed20 */ void fn_8002ed20();
/* 8002edb0 */ void fn_8002edb0();
/* 8002ee40 */ void drawShadow();
/* 8002ef40 */ void createChildAttached( \
fProfile::PROFILE_NAME_e actorId, u32 params1, \
Vec3f* pos, Vec3s* rot, Vec3f* scale, u32 params2, \
u32 roomId );
/* 8002ef40 */ void createChildNonAttached( \
fProfile::PROFILE_NAME_e actorId, u32 params1, \
Vec3f* pos, Vec3s* rot, Vec3f* scale, u32 params2, \
u32 roomId );
/* 8002efa0 */ void fn_8002efa0();
/* 8002eff0 */ bool fn_8002eff0(f32*, s16*, UnkCollider*, f32*, f32*);
/* 8002f190 */ void createChildAttached2( \
fProfile::PROFILE_NAME_e actorId, u32 params1, \
Vec3f* pos, Vec3s* rot, Vec3f* scale, u32 params2, \
u32 roomId );
// These may not belong here
/* 8002f1c0 */ static dAcBase_c createActorUnkGroup3( \
fProfile::PROFILE_NAME_e actorId, u32 roomId, \
u32 params1, Vec3f* pos, Vec3s* rot, Vec3f* scale, \
u32 params2);
/* 8002f260 */ static dAcBase_c createActorUnkGroup3( \
char* name, u32 roomId, u32 params1, \
Vec3f* pos, Vec3s* rot, Vec3f* scale, \
u32 params2, u16 id, u8 viewclipId);
};
+1 -1
View File
@@ -5,6 +5,6 @@
// Ghidra: AcItem
// Size: 0xd68
// official name
class dAcItem_c : public dAcOBase_c {
class dAcItem_c : public dAcObjBase_c {
};
+93
View File
@@ -0,0 +1,93 @@
#pragma once
#include <types.h>
// Types pulled from ogws
// May need to remove/add later
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;
// math
template <typename T> struct Math;
struct Matrix33f;
struct Matrix34f;
struct Matrix44f;
struct Quatf;
struct Vector2f;
struct 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;
// audio
struct ArcPlayer;
struct IAudioMgr;
struct SimpleAudioMgr;
struct SoundHeapMgr;
// util
struct Exception;
struct MsgRes;
} // namespace EGG
+18
View File
@@ -0,0 +1,18 @@
#pragma once
#include <types.h>
namespace nw4r {
namespace g3d {
struct ResFileData {
};
struct ResFile
{
/* data */
};
};
};
+197
View File
@@ -0,0 +1,197 @@
#pragma once
#include <types.h>
namespace nw4r
{
namespace ut
{
template <typename T> struct TextWriterBase;
template <typename T> struct TagProcessorBase;
struct Color;
struct FileStream;
namespace detail
{
struct RuntimeTypeInfo;
}
}
namespace ef
{
struct DrawOrder;
struct DrawInfo;
struct DrawStrategy;
struct DrawStrategyImpl;
struct DrawStrategyBuilder;
struct Effect;
struct EffectSystem;
struct EffectProject;
struct Emitter;
struct EmitterDrawSetting;
struct EmitFormBuilder;
struct ResEmitter;
struct EmitterResource;
struct EmitterForm;
struct EmitterInheritSetting;
struct Particle;
struct ParticleManager;
struct MemoryManager;
struct MemoryManagerBase;
}
namespace math
{
struct VEC2;
struct VEC3;
struct MTX33;
struct MTX34;
struct AABB;
struct FRUSTUM;
}
namespace snd
{
struct FxBase;
struct SoundPlayer;
struct SoundHandle;
struct SeqSoundHandle;
struct SoundArchive;
struct SoundArchivePlayer;
struct Sound3DActor;
struct Sound3DListener;
struct Sound3DManager;
struct SoundHandle;
struct StrmSoundHandle;
struct WaveSoundHandle;
namespace detail
{
struct BasicSound;
struct BasicPlayer;
struct ChannelManager;
struct SeqSound;
struct SeqPlayer;
struct MmlParser;
struct MmlSeqTrack;
struct SeqTrack;
struct SeqTrackAllocator;
template <typename T> struct SoundInstanceManager;
struct StrmBufferPool;
struct StrmSound;
struct NoteOnCallback;
struct PlayerHeap;
struct SoundArchiveFileReader;
struct SoundThread;
struct WaveSound;
struct StrmPlayer;
struct WsdPlayer;
}
}
namespace g3d
{
struct AnmObjVis;
struct AnmObjVisNode;
struct AnmObjVisOR;
struct AnmObjVisRes;
struct AnmObj;
struct AnmObjChr;
struct FuncObjCalcWorld;
struct AnmScn;
struct AnmScnRes;
struct CameraAnmResult;
struct Draw1Mat1ShpSwap;
struct DrawResMdlReplacement;
struct FogAnmResult;
struct ResFile;
struct ResMdl;
struct ResPltt;
struct ResTex;
struct ResTexSrt;
struct ResMat;
struct ResTexPlttInfo;
struct ResShp;
struct ResFog;
struct ResAnmChr;
struct ResAnmVis;
struct ResAnmClr;
struct ResAnmTexPat;
struct ResAnmTexSrt;
struct ResAnmShp;
struct ResAnmScn;
struct ResAnmFog;
struct ResAnmCamera;
struct ResVtxPos;
struct ResVtxNrm;
struct ResVtxClr;
struct ResVtxTexCoord;
struct ClrAnmResult;
struct TexPatAnmResult;
struct TexSrtAnmResult;
struct ScnMdl1Mat1Shp;
struct TexSrt;
struct TexSrtTypedef;
struct LightObj;
struct LightAnmResult;
struct LightSet;
struct LightSetting;
struct LightSetData;
struct AmbLightObj;
struct AmbLightAnmResult;
struct Fog;
struct ScnRoot;
struct ScnProc;
struct ScnLeaf;
struct ScnObj;
struct ScnRfl;
struct ScnGroup;
struct ScnMdlSimple;
struct ScnMdl;
struct IScnObjGather;
struct IScnObjCallback;
namespace G3DState
{
struct IndMtxOp;
}
}
namespace lyt
{
struct Size;
namespace detail
{
struct PaneBase;
struct TexCoordAry;
}
namespace res
{
struct Group;
struct Pane;
struct Bounding;
struct AnimationBlock;
struct BinaryFileHeader;
}
struct Group;
struct GroupContainer;
struct Pane;
struct DrawInfo;
struct AnimResource;
struct AnimTransform;
struct AnimTransformBasic;
struct AnimationLink;
struct ResourceAccessor;
struct ArcResourceAccessor;
struct FontRefLink;
struct Material;
struct Layout;
struct Bounding;
struct ResBlockSet;
struct TexMap;
}
}
@@ -2,21 +2,21 @@
#include <lib/egg/core/eggAllocator.h>
class mAllocator : public EGG::Allocator {
class mAllocator_c : public EGG::Allocator {
public:
mAllocator();
mAllocator_c();
// vtable at 0x10
/* 0x08 */ virtual ~mAllocator();
/* 0x08 */ virtual ~mAllocator_c();
/* 0x0C */ virtual void* alloc(u32 size);
/* 0x10 */ virtual void free(void* block);
bool attach(EGG::Heap* heap, s32 align);
};
class mHeapAllocator : public mAllocator {
class mHeapAllocator_c : public mAllocator_c {
public:
mHeapAllocator();
mHeapAllocator_c();
// vtable at 0x10
/* 0x08 */ virtual ~mHeapAllocator();
/* 0x08 */ virtual ~mHeapAllocator_c();
/* 0x0C */ // virtual void* alloc(u32 size); // see mAlloctor::alloc
/* 0x10 */ // virtual void free(void* block); // see mAlloctor::free
int replaceWithNewFrmHeap(s32 size, EGG::Heap* newHeap, char* heapName, s32 align, u32 unk);
@@ -26,5 +26,5 @@ public:
s32 adjustExpHeap();
s32 createNewTempFrmHeap(s32 size, EGG::Heap* newHeap, char* heapName, s32 align, u32 unk);
void adjustFrmHeapRestoreCurrent();
static void* allocOnHeap(s32 size, mHeapAllocator* allocator);
static void* allocOnHeap(s32 size, mHeapAllocator_c* allocator);
};
+11
View File
@@ -0,0 +1,11 @@
#pragma once
#include <types.h>
struct mAng {
s16 val;
};
class mAng3_c {
};
View File
View File
+42
View File
@@ -0,0 +1,42 @@
#pragma once
// NOTE:: Comments about functions pulled from NSMBW
#include <types.h>
#include <m/m_angle.h>
#include <lib/nw4r/nw4r_types.h>
class mMtx_c
{
public:
f32 xx, xy, xz, xw;
f32 yx, yy, yz, yw;
f32 zx, zy, zz, zw;
mMtx_c() {};
/* 802f1660 */ mMtx_c(f32 xx, f32 xy, f32 xz, f32 xw, \
f32 yx, f32 yy, f32 yz, f32 yw, \
f32 zx, f32 zy, f32 zz, f32 zw);
/* 802f16b0 */ void XrotS(mAng angle); ///< Generates a rotation matrix for the X axis with the given angle.
/* 802f1770 */ void XrotM(mAng angle); ///< Rotates the matrix on the X axis by the given angle.
/* 802f17c0 */ void YrotS(mAng angle); ///< Generates a rotation matrix for the Y axis with the given angle.
/* 802f1880 */ void YrotM(mAng angle); ///< Rotates the matrix on the Y axis by the given angle.
/* 802f18d0 */ void ZrotS(mAng angle); ///< Generates a rotation matrix for the Z axis with the given angle.
/* 802f1990 */ void ZrotM(mAng angle); ///< Rotates the matrix on the Z axis by the given angle.
/* 802f19e0 */ void ZXYrotS(mAng xRot, mAng yRot, mAng zRot); ///< Generates the matrix on the Y, X and Z axes by the given angles.
/* 802f1a40 */ void ZXYrotM(mAng xRot, mAng yRot, mAng zRot); ///< Rotates the matrix on the Y, X and Z axes by the given angles.
/* 802f1aa0 */ void XYZrotS(mAng xRot, mAng yRot, mAng zRot); ///< Generates the matrix on the Z, Y and X axes by the given angles.
/* 802f1b00 */ void XYZrotM(mAng xRot, mAng yRot, mAng zRot); ///< Rotates the matrix on the Z, Y and X axes by the given angles.
/* 802f1b60 */ void toRot(mAng3_c &out) const; ///< Converts the matrix to a rotation vector.
void multVecZero(nw4r::math::VEC3 &out) const; ///< Converts the matrix to a vector.
void zero(); ///< Zeroes out the matrix.
/* 802f1c40 */ void rot(int, int); // does some werrd operation to rotate the matrix
/* 802f1e60 */ bool quatRelated();
static mMtx_c Identity;
};
View File
View File
View File
+70
View File
@@ -0,0 +1,70 @@
#pragma once
#include <types.h>
class mFaderBase_c;
class mFader_c;
class mColorFader_c;
class mWipeFader_c;
// Heap Stuff
struct mHeap; // Maybe just a namespace?
class mAllocator_c;
class mHeapAllocator_c;
// Math Stuff
class mMtx_c;
class mQuat_c;
struct mAng;
class mAng3_c;
class mVec3_c;
class mFrustum_c;
namespace m2d {
class Layout_c;
class AnmResV2_c;
class AnmGroup_c;
class Simple_c;
class FrameCtrl_c;
class AnmGroupBase_c;
class Base_c;
class ResAccIf_c;
} // namespace m2d
namespace m3d {
class mdl_c; // also contains ::callback_c ::mdlCallback_c
class smdl_c;
class bmdl_c;
class scnLeaf_c;
class banm_c;
class fanm_c;
class anmChr_c;
class anmChrBlend_c;
class anmMatClr_c; // also contains ::child_c
class anmTexPat_c; // also contains ::child_c
class anmTexSrt_c; // also contains ::child_c
class anmVis_c;
class capture_c;
class calcRatio_c;
} // namespace m3d
class mDvd_command_c;
class mDvd_param_c;
class mDvd_toMainRam_c;
class mDvd_callback_c;
class mDvd_mountMemArchive_c;
namespace mDvd
{
class MyThread_c;
template <typename T> // types are from EGG::StreamDecomp[LH/LRC/RL/LZ]
class TUncompressedInfo_c;
} // namespace mDvd
+34
View File
@@ -0,0 +1,34 @@
#pragma once
#include <types.h>
// Ghidra: ArcManagerEntry
// size: 0x40
struct ArcManagerEntry {
/* 0x00 */ char arc_name[0x20];
/* 0x20 */ u16 ref_count;
/* 0x24 */ int dvd_req_ptr;
/* 0x28 */ int archive_ptr;
/* 0x2C */ int heap_ptr_0;
/* 0x30 */ char field_0x30[0x3C - 0x30];
/* 0x3C */ int heap_ptr_1;
};
// Ghidra: ArcManagerEntryTable
// size: 0xC
class ArcMangerEntryTable{
public:
/* 0x0 */ ArcManagerEntry* entries;
/* 0x4 */ u16 count;
/* 0x8 */ u32 field_0x8;
public:
ArcMangerEntryTable();
};
class OarcManager {
public:
void* getDataFromOarc(char* oarcName, char* fileName);
};
OarcManager g_OarcManager;
+1 -1
View File
@@ -56,7 +56,7 @@ int dAcBase_c::initAllocatorWork1Heap(int size, char* name, int align) {
initAllocator(size, name, dHeap::work1Heap, align);
}
extern "C" int fn_802EE510(mAllocator*, int size, EGG::Heap* heap, char* name, int align, int unk);
extern "C" int fn_802EE510(mAllocator_c*, int size, EGG::Heap* heap, char* name, int align, int unk);
/* 8002c720 */
int dAcBase_c::initAllocator(int size, char* name, EGG::Heap* heap, int align) {
+1
View File
@@ -0,0 +1 @@
#include <d/a/obj/d_a_obj_base.h>
View File