Port most of hsfload to PC (#581)

* Port some of hsfload.c

* More byteswaps in hsfload.c

* Finish hsfload besides cenv

* hsfload fixes
This commit is contained in:
Dávid Balatoni 2025-04-11 13:54:23 +02:00 committed by GitHub
parent 909c743527
commit bc19d2263b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 1662 additions and 402 deletions

View file

@ -57,7 +57,7 @@ void Hu3DDrawPreInit(void);
void Hu3DDraw(ModelData *arg0, Mtx arg1, Vec *arg2);
s32 ObjCullCheck(HsfData *arg0, HsfObject *arg1, Mtx arg2);
void Hu3DDrawPost(void);
void MakeDisplayList(s16 arg0, u32 arg1);
void MakeDisplayList(s16 arg0, uintptr_t arg1);
HsfConstData *ObjConstantMake(HsfObject *arg0, u32 arg1);
void mtxTransCat(Mtx arg0, float arg1, float arg2, float arg3);
void mtxRotCat(Mtx arg0, float arg1, float arg2, float arg3);

View file

@ -227,9 +227,8 @@ typedef struct hsf_cluster {
s32 target;
};
HsfPart *part;
float unk10;
float unk14[1]; // unknown array size
u8 unk18[124];
float index;
float weight[32]; // unknown array size
u8 adjusted;
u8 unk95;
u16 type;
@ -261,7 +260,7 @@ typedef struct hsf_object_data {
} mesh;
struct hsf_object *replica;
};
HsfBuffer *face;
HsfBuffer *vertex;
HsfBuffer *normal;
@ -351,6 +350,9 @@ typedef struct hsf_track {
float value;
void *data;
};
#ifdef TARGET_PC
void *dataTop;
#endif
} HsfTrack;
typedef struct hsf_motion {
@ -397,6 +399,9 @@ typedef struct hsf_data {
HsfObject *object;
HsfMapAttr *mapAttr;
HsfMatrix *matrix;
#ifdef TARGET_PC
void **symbol;
#endif
s16 sceneCnt;
s16 attributeCnt;
s16 materialCnt;

View file

@ -8,5 +8,8 @@ void ClusterAdjustObject(HsfData *model, HsfData *src_model);
char *SetName(u32 *str_ofs);
char *MakeObjectName(char *name);
s32 CmpObjectName(char *name1, char *name2);
#ifdef TARGET_PC
void KillHSF(HsfData *data);
#endif
#endif

View file

@ -10,9 +10,9 @@
typedef struct motion_data {
s16 unk_00;
s16 unk_02;
HsfData *unk_04;
s16 attr;
s16 modelId;
HsfData *hsfData;
} MotionData;
typedef struct {

View file

@ -19,9 +19,9 @@ void *HuMemInit(void *ptr, s32 size);
void HuMemDCFlushAll();
void HuMemDCFlush(HeapID heap);
void *HuMemDirectMalloc(HeapID heap, s32 size);
void *HuMemDirectMallocNum(HeapID heap, s32 size, u32 num);
void *HuMemDirectMallocNum(HeapID heap, s32 size, uintptr_t num);
void HuMemDirectFree(void *ptr);
void HuMemDirectFreeNum(HeapID heap, u32 num);
void HuMemDirectFreeNum(HeapID heap, uintptr_t num);
s32 HuMemUsedMallocSizeGet(HeapID heap);
s32 HuMemUsedMallocBlockGet(HeapID heap);
u32 HuMemHeapSizeGet(HeapID heap);
@ -29,9 +29,9 @@ void *HuMemHeapPtrGet(HeapID heap);
void *HuMemHeapInit(void *ptr, s32 size);
void *HuMemMemoryAlloc(void *heap_ptr, s32 size, uintptr_t retaddr);
void *HuMemMemoryAllocNum(void *heap_ptr, s32 size, u32 num, uintptr_t retaddr);
void *HuMemMemoryAllocNum(void *heap_ptr, s32 size, uintptr_t num, uintptr_t retaddr);
void HuMemMemoryFree(void *ptr, uintptr_t retaddr);
void HuMemMemoryFreeNum(void *heap_ptr, u32 num, uintptr_t retaddr);
void HuMemMemoryFreeNum(void *heap_ptr, uintptr_t num, uintptr_t retaddr);
s32 HuMemUsedMemorySizeGet(void *heap_ptr);
s32 HuMemUsedMemoryBlockGet(void *heap_ptr);
s32 HuMemMemorySizeGet(void *ptr);