Dynamic Actor IDs (#1729)

* Add dynamic actor IDs

* Convert Ivan to use new actor system

* attempt to fix linux build

* attempt to fix linux build

* merge

* Cleanup

* Fix missing math functions on Windows.

* Removes a stubbed function to fix non-windows builds.

* Update soh/soh/ActorDB.cpp

Co-authored-by: Adam Bird <Archez@users.noreply.github.com>

---------

Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: Adam Bird <Archez@users.noreply.github.com>
This commit is contained in:
Rozelette
2023-06-01 20:39:50 -05:00
committed by GitHub
parent 26d934541a
commit fdf9086b2a
19 changed files with 786 additions and 749 deletions

View File

@@ -28,7 +28,5 @@ s32 lnearbyint(f64 x);
f32 roundf(f32 x);
f64 round(f64 x);
s32 lroundf(f32 x);
s32 lround(f64 x);
#endif

View File

@@ -20,13 +20,6 @@ extern "C"
#define osSyncPrintf(fmt, ...) osSyncPrintfUnused(fmt, ##__VA_ARGS__)
#endif
f32 fabsf(f32 f);
//#pragma intrinsic(fabsf)
f32 sqrtf(f32 f);
//#pragma intrinsic(sqrtf)
f64 sqrt(f64 d);
//#pragma intrinsic(sqrt)
void gSPSegment(void* value, int segNum, uintptr_t target);
void gSPSegmentLoadRes(void* value, int segNum, uintptr_t target);
void gDPSetTextureImage(Gfx* pkt, u32 f, u32 s, u32 w, uintptr_t i);
@@ -567,9 +560,6 @@ void Flags_SetRandomizerInf(RandomizerInf flag);
u16 func_80037C30(PlayState* play, s16 arg1);
s32 func_80037D98(PlayState* play, Actor* actor, s16 arg2, s32* arg3);
s32 func_80038290(PlayState* play, Actor* actor, Vec3s* arg2, Vec3s* arg3, Vec3f arg4);
void ActorOverlayTable_LogPrint(void);
void ActorOverlayTable_Init(void);
void ActorOverlayTable_Cleanup(void);
// ? func_80038600(?);
u16 DynaSSNodeList_GetNextNodeIdx(DynaSSNodeList*);
void func_80038A28(CollisionPoly* poly, f32 tx, f32 ty, f32 tz, MtxF* dest);
@@ -2296,7 +2286,6 @@ s32 JpegDecoder_ParseNextSymbol(JpegHuffmanTable* hTable, s16* outCoeff, s8* out
u16 JpegDecoder_ReadBits(u8 len);
s32 osPfsFreeBlocks(OSPfs* pfs, s32* leftoverBytes);
void guScale(Mtx* m, f32 x, f32 y, f32 z);
f32 sinf(f32);
s16 sins(u16);
OSTask* _VirtualToPhysicalTask(OSTask* intp);
void osSpTaskLoad(OSTask* task);
@@ -2361,7 +2350,6 @@ s32 osPfsDeleteFile(OSPfs* pfs, u16 companyCode, u32 gameCode, u8* gameName, u8*
s32 __osPfsReleasePages(OSPfs* pfs, __OSInode* inode, u8 initialPage, u8 bank, __OSInodeUnit* finalPage);
void guOrthoF(f32[4][4], f32, f32, f32, f32, f32, f32, f32);
void guOrtho(Mtx*, f32, f32, f32, f32, f32, f32, f32);
f32 cosf(f32);
s16 coss(u16);
void osViSetEvent(OSMesgQueue* mq, OSMesg m, u32 retraceCount);
s32 osPfsIsPlug(OSMesgQueue* mq, u8* pattern);

View File

@@ -3,6 +3,8 @@
#ifndef GLOBAL_H
#define GLOBAL_H
#include "math.h"
#include "functions.h"
#include "variables.h"
#include "macros.h"

View File

@@ -480,5 +480,4 @@
/* 0x01D3 */ DEFINE_ACTOR(En_Zl4, ACTOR_EN_ZL4, ALLOCTYPE_NORMAL)
/* 0x01D4 */ DEFINE_ACTOR(En_Mm2, ACTOR_EN_MM2, ALLOCTYPE_NORMAL)
/* 0x01D5 */ DEFINE_ACTOR(Bg_Jya_Block, ACTOR_BG_JYA_BLOCK, ALLOCTYPE_NORMAL)
/* 0x01D6 */ DEFINE_ACTOR(Obj_Warp2block, ACTOR_OBJ_WARP2BLOCK, ALLOCTYPE_NORMAL)
/* 0x01D7 */ DEFINE_ACTOR(En_Partner, ACTOR_EN_PARTNER, ALLOCTYPE_NORMAL)
/* 0x01D6 */ DEFINE_ACTOR(Obj_Warp2block, ACTOR_OBJ_WARP2BLOCK, ALLOCTYPE_NORMAL)

View File

@@ -68,8 +68,6 @@ extern "C"
extern u64 gJpegUCode[];
extern EffectSsOverlay gEffectSsOverlayTable[EFFECT_SS_TYPE_MAX];
extern Gfx D_80116280[];
extern ActorOverlay gActorOverlayTable[ACTOR_ID_MAX]; // original name: "actor_dlftbls" 801162A0
extern s32 gMaxActorId; // original name: "MaxProfile"
extern s32 gDbgCamEnabled;
extern GameStateOverlay gGameStateOverlayTable[6];
extern u8 gWeatherMode;

View File

@@ -5,6 +5,7 @@
#include "z64animation.h"
#include "z64math.h"
#include "z64collision_check.h"
#include "z64bgcheck.h"
#include "soh/Enhancements/item-tables/ItemTableTypes.h"
#define ACTOR_NUMBER_MAX 2000
@@ -47,18 +48,6 @@ typedef enum {
/* 2 */ ALLOCTYPE_PERMANENT
} AllocType;
typedef struct {
/* 0x00 */ uintptr_t vromStart;
/* 0x04 */ uintptr_t vromEnd;
/* 0x08 */ void* vramStart;
/* 0x0C */ void* vramEnd;
/* 0x10 */ void* loadedRamAddr; // original name: "allocp"
/* 0x14 */ ActorInit* initInfo;
/* 0x18 */ char* name;
/* 0x1C */ u16 allocType;
/* 0x1E */ s8 numLoaded; // original name: "clients"
} ActorOverlay; // size = 0x20
typedef struct {
u8 table[32];
} DamageTable;
@@ -188,7 +177,6 @@ typedef struct Actor {
/* 0x130 */ ActorFunc update; // Update Routine. Called by `Actor_UpdateAll`
/* 0x134 */ ActorFunc draw; // Draw Routine. Called by `Actor_Draw`
/* 0x138 */ ActorResetFunc reset;
/* 0x138 */ ActorOverlay* overlayEntry; // Pointer to the overlay table entry for this actor
/* 0x13C */ char dbgPad[0x10]; // Padding that only exists in the debug rom
} Actor; // size = 0x14C