diff --git a/include/game/hsfdraw.h b/include/game/hsfdraw.h index a99d0bb1..0b9e0e8f 100755 --- a/include/game/hsfdraw.h +++ b/include/game/hsfdraw.h @@ -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); diff --git a/include/game/memory.h b/include/game/memory.h index a32b1a84..efc86334 100644 --- a/include/game/memory.h +++ b/include/game/memory.h @@ -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); diff --git a/src/REL/bootDll/main.c b/src/REL/bootDll/main.c index 6dd2f03a..0617bb56 100644 --- a/src/REL/bootDll/main.c +++ b/src/REL/bootDll/main.c @@ -566,8 +566,6 @@ void ObjectSetup(void) AnimData *sprite_data; s16 i; titleMdlId[0] = model = Hu3DModelCreateFile(TITLE_CHAR_HSF); -#ifdef __MWERKS__ - // TODO PC Hu3DModelAttrSet(model, HU3D_ATTR_DISPOFF); Hu3DModelAttrSet(model, HU3D_MOTATTR_LOOP); titleMdlId[1] = model = Hu3DModelCreateFile(TITLE_CUBE_HSF); @@ -578,7 +576,6 @@ void ObjectSetup(void) Hu3DModelAttrSet(model, HU3D_MOTATTR_LOOP); Hu3DModelCameraInfoSet(model, 1); Hu3DModelLightInfoSet(model, 1); -#endif #if VERSION_NTSC bootGrpId = HuSprGrpCreate(4); #else @@ -640,11 +637,8 @@ void ObjectSetup(void) s16 choice; float temp; repeat: -#ifdef __MWERKS__ - // TODO PC Hu3DModelAttrReset(titleMdlId[0], HU3D_ATTR_DISPOFF); Hu3DModelAttrReset(titleMdlId[1], HU3D_ATTR_DISPOFF); -#endif HuSprAttrReset(bootGrpId, 0, HUSPR_ATTR_DISPOFF); HuSprAttrReset(bootGrpId, 1, HUSPR_ATTR_DISPOFF); #ifdef __MWERKS__ @@ -796,12 +790,9 @@ void ObjectSetup(void) while (WipeStatGet()) { HuPrcVSleep(); } -#ifdef __MWERKS__ - // TODO PC Hu3DModelAttrSet(titleMdlId[0], HU3D_ATTR_DISPOFF); Hu3DModelAttrSet(titleMdlId[1], HU3D_ATTR_DISPOFF); Hu3DModelAttrSet(titleMdlId[2], HU3D_ATTR_DISPOFF); -#endif #if VERSION_NTSC HuSprAttrSet(bootGrpId, 0, HUSPR_ATTR_DISPOFF); HuSprAttrSet(bootGrpId, 1, HUSPR_ATTR_DISPOFF); diff --git a/src/game/hsfdraw.c b/src/game/hsfdraw.c index fbac2536..0d45b89c 100755 --- a/src/game/hsfdraw.c +++ b/src/game/hsfdraw.c @@ -89,7 +89,7 @@ static u16 faceCnt; static u16 *faceNumBuf; static s32 DLTotalNum; static u32 totalSize; -static u32 mallocNo; +static uintptr_t mallocNo; static s32 curModelID; static s16 polySize; static s32 PGFinishF; @@ -2367,7 +2367,7 @@ static void ObjDraw(HsfDrawObject *arg0) { } } -void MakeDisplayList(s16 arg0, u32 arg1) { +void MakeDisplayList(s16 arg0, uintptr_t arg1) { HsfData *temp_r31; ModelData *var_r30; diff --git a/src/game/hsfload.c b/src/game/hsfload.c index fe4d12a3..f9809ea0 100644 --- a/src/game/hsfload.c +++ b/src/game/hsfload.c @@ -138,7 +138,9 @@ static void FileLoad(void *data) byteswap_hsfheader(&head); NSymIndex = HuMemDirectMallocNum(HEAP_DATA, sizeof(void*) * head.symbol.count, MEMORY_DEFAULT_NUM); for (i = 0; i < head.symbol.count; i++) { - byteswap_u32(&((void **)((uintptr_t)fileptr + head.symbol.ofs))[i]); + u32 *file_symbol_real = (u32 *)((uintptr_t)fileptr + head.symbol.ofs); + byteswap_u32(&file_symbol_real[i]); + NSymIndex[i] = (void *)file_symbol_real[i]; } StringTable = (char *)((uintptr_t)fileptr+head.string.ofs); ClusterTop = HuMemDirectMallocNum(HEAP_DATA, sizeof(HsfCluster) * head.cluster.count, MEMORY_DEFAULT_NUM); diff --git a/src/game/hsfman.c b/src/game/hsfman.c index a82748e3..4ed699b0 100644 --- a/src/game/hsfman.c +++ b/src/game/hsfman.c @@ -43,7 +43,7 @@ s32 shadowModelDrawF; s16 Hu3DProjectionNum; s16 Hu3DCameraNo; s16 Hu3DCameraBit; -u32 Hu3DMallocNo; +uintptr_t Hu3DMallocNo; s16 Hu3DPauseF; u16 Hu3DCameraExistF; static u16 NoSyncF; @@ -350,7 +350,7 @@ s16 Hu3DModelCreate(void *arg0) { return -1; } var_r31->hsfData = LoadHSF(arg0); - var_r31->unk_48 = Hu3DMallocNo = (u32)var_r31->hsfData; + var_r31->unk_48 = Hu3DMallocNo = (uintptr_t)var_r31->hsfData; var_r31->attr = HU3D_ATTR_NONE; var_r31->motion_attr = HU3D_ATTR_NONE; var_r31->unk_02 = 0; diff --git a/src/game/malloc.c b/src/game/malloc.c index 9ed38e20..f5d747bf 100644 --- a/src/game/malloc.c +++ b/src/game/malloc.c @@ -59,7 +59,7 @@ void *HuMemDirectMalloc(HeapID heap, s32 size) return HuMemMemoryAlloc(HeapTbl[heap], size, retaddr); } -void *HuMemDirectMallocNum(HeapID heap, s32 size, u32 num) +void *HuMemDirectMallocNum(HeapID heap, s32 size, uintptr_t num) { #ifdef TARGET_PC u32 retaddr = 0; @@ -86,7 +86,7 @@ void HuMemDirectFree(void *ptr) HuMemMemoryFree(ptr, retaddr); } -void HuMemDirectFreeNum(HeapID heap, u32 num) +void HuMemDirectFreeNum(HeapID heap, uintptr_t num) { #ifdef TARGET_PC u32 retaddr = 0; diff --git a/src/game/memory.c b/src/game/memory.c index 03f793b4..766af202 100644 --- a/src/game/memory.c +++ b/src/game/memory.c @@ -12,11 +12,11 @@ struct memory_block { u8 flag; struct memory_block *prev; struct memory_block *next; - u32 num; + uintptr_t num; uintptr_t retaddr; }; -static void *HuMemMemoryAlloc2(void *heap_ptr, s32 size, u32 num, uintptr_t retaddr); +static void *HuMemMemoryAlloc2(void *heap_ptr, s32 size, uintptr_t num, uintptr_t retaddr); void *HuMemHeapInit(void *ptr, s32 size) { @@ -31,7 +31,7 @@ void *HuMemHeapInit(void *ptr, s32 size) return block; } -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) { return HuMemMemoryAlloc2(heap_ptr, size, num, retaddr); } @@ -41,7 +41,7 @@ void *HuMemMemoryAlloc(void *heap_ptr, s32 size, uintptr_t retaddr) return HuMemMemoryAlloc2(heap_ptr, size, -256, retaddr); } -static void *HuMemMemoryAlloc2(void *heap_ptr, s32 size, u32 num, uintptr_t retaddr) +static void *HuMemMemoryAlloc2(void *heap_ptr, s32 size, uintptr_t num, uintptr_t retaddr) { s32 alloc_size = MEM_ALLOC_SIZE(size); struct memory_block *block = heap_ptr; @@ -76,7 +76,7 @@ static void *HuMemMemoryAlloc2(void *heap_ptr, s32 size, u32 num, uintptr_t reta return NULL; } -void HuMemMemoryFreeNum(void *heap_ptr, u32 num, uintptr_t retaddr) +void HuMemMemoryFreeNum(void *heap_ptr, uintptr_t num, uintptr_t retaddr) { struct memory_block *block = heap_ptr; do { diff --git a/src/port/stubs.c b/src/port/stubs.c index 70a901f2..cdb2d5c1 100644 --- a/src/port/stubs.c +++ b/src/port/stubs.c @@ -603,7 +603,7 @@ GXDrawSyncCallback GXSetDrawSyncCallback(GXDrawSyncCallback cb) void PPCSync(void) { - puts("PPCSync is a stub"); + //puts("PPCSync is a stub"); } void GXUnknownu16(const u16 x)