From 9e062adfa4b1ee7c8b873b864d34ba7885fe6b11 Mon Sep 17 00:00:00 2001 From: dbalatoni13 <40299962+dbalatoni13@users.noreply.github.com> Date: Fri, 11 Apr 2025 18:27:23 +0200 Subject: [PATCH] Some x64 improvements --- README.md | 2 +- include/game/hsfman.h | 2 +- include/game/jmp.h | 20 ++-- include/game/process.h | 2 +- include/port/byteswap.h | 2 +- src/game/hsfdraw.c | 13 ++- src/game/objmain.c | 2 + src/port/byteswap.cpp | 206 +++++++++++++++++++++------------------- src/port/stubs.c | 2 +- 9 files changed, 135 insertions(+), 116 deletions(-) diff --git a/README.md b/README.md index 884478a1..06a57925 100644 --- a/README.md +++ b/README.md @@ -98,4 +98,4 @@ After you got the GameCube build up and running for `GMPE01_00`: ``` Linux and MacOS, and x64 support is coming later. -- Open the solution in Visual Studio and build. [Fix for UtilsVulkan.h](https://github.com/encounter/dawn-cmake/blob/f10e70a26db00bb89f88be4204cf49ffc869e194/src/dawn/native/vulkan/UtilsVulkan.h#L128-L132) +- Open the solution in Visual Studio and build. diff --git a/include/game/hsfman.h b/include/game/hsfman.h index 2be96d31..0ef4d011 100644 --- a/include/game/hsfman.h +++ b/include/game/hsfman.h @@ -104,7 +104,7 @@ struct model_data { u16 unk_26; u16 unk_28[8]; s16 unk_38[8]; - u32 unk_48; + uintptr_t unk_48; u32 unk_4C; u32 attr; u32 motion_attr; diff --git a/include/game/jmp.h b/include/game/jmp.h index 8dfe2179..432d640c 100755 --- a/include/game/jmp.h +++ b/include/game/jmp.h @@ -134,20 +134,20 @@ typedef struct _JUMP_BUFFER { #endif #if defined(_M_IX86) || defined(__i386__) -#define SETJMP_SET_IP(jump, func) ((_JUMP_BUFFER *)((jump)))->Eip = (size_t)func -#define SETJMP_SET_SP(jump, sp) ((_JUMP_BUFFER *)((jump)))->Esp = (size_t)sp +#define SETJMP_SET_IP(jump, func) ((_JUMP_BUFFER *)((jump)))->Eip = (uintptr_t)func +#define SETJMP_SET_SP(jump, sp) ((_JUMP_BUFFER *)((jump)))->Esp = (uintptr_t)sp #elif defined(_M_X64) || defined(__x86_64__) -#define SETJMP_SET_IP(jump, func) ((_JUMP_BUFFER *)((jump)))->Rip = (size_t)func -#define SETJMP_SET_SP(jump, sp) ((_JUMP_BUFFER *)((jump)))->Rsp = (size_t)sp +#define SETJMP_SET_IP(jump, func) ((_JUMP_BUFFER *)((jump)))->Rip = (uintptr_t)func +#define SETJMP_SET_SP(jump, sp) ((_JUMP_BUFFER *)((jump)))->Rsp = (uintptr_t)sp #elif defined(_M_ARM) || defined(__arm__) -#define SETJMP_SET_IP(jump, func) ((_JUMP_BUFFER *)((jump)))->Pc = (size_t)func -#define SETJMP_SET_SP(jump, sp) ((_JUMP_BUFFER *)((jump)))->Sp = (size_t)sp +#define SETJMP_SET_IP(jump, func) ((_JUMP_BUFFER *)((jump)))->Pc = (uintptr_t)func +#define SETJMP_SET_SP(jump, sp) ((_JUMP_BUFFER *)((jump)))->Sp = (uintptr_t)sp #elif defined(_M_ARM64) || defined(__aarch64__) -#define SETJMP_SET_IP(jump, func) ((_JUMP_BUFFER *)((jump)))->Lr = (size_t)func -#define SETJMP_SET_SP(jump, sp) ((_JUMP_BUFFER *)((jump)))->Sp = (size_t)sp +#define SETJMP_SET_IP(jump, func) ((_JUMP_BUFFER *)((jump)))->Lr = (uintptr_t)func +#define SETJMP_SET_SP(jump, sp) ((_JUMP_BUFFER *)((jump)))->Sp = (uintptr_t)sp #elif defined(__riscv) -#define SETJMP_SET_IP(jump, func) ((_JUMP_BUFFER *)((jump)))->ra = (size_t)func -#define SETJMP_SET_SP(jump, sp) ((_JUMP_BUFFER *)((jump)))->sp = (size_t)sp +#define SETJMP_SET_IP(jump, func) ((_JUMP_BUFFER *)((jump)))->ra = (uintptr_t)func +#define SETJMP_SET_SP(jump, sp) ((_JUMP_BUFFER *)((jump)))->sp = (uintptr_t)sp #endif #else diff --git a/include/game/process.h b/include/game/process.h index c8b43d89..02bb1196 100644 --- a/include/game/process.h +++ b/include/game/process.h @@ -26,7 +26,7 @@ typedef struct process { u16 stat; u16 prio; s32 sleep_time; - u32 base_sp; + uintptr_t base_sp; jmp_buf jump; void (*dtor)(void); void *user_data; diff --git a/include/port/byteswap.h b/include/port/byteswap.h index 1d7549d9..c1d309a7 100644 --- a/include/port/byteswap.h +++ b/include/port/byteswap.h @@ -145,7 +145,7 @@ typedef struct HsfObjectData32b { float baseMorph; float morphWeight[33]; } mesh; - struct hsf_object *replica; + u32 replica; }; u32 face; diff --git a/src/game/hsfdraw.c b/src/game/hsfdraw.c index 0d45b89c..8b91fc05 100755 --- a/src/game/hsfdraw.c +++ b/src/game/hsfdraw.c @@ -1842,7 +1842,9 @@ static s32 LoadTexture(ModelData *arg0, HsfBitmap *arg1, HsfAttribute *arg2, s16 GXLoadTexObj(&sp1C, arg3); #ifdef TARGET_PC GXDestroyTexObj(&sp1C); - GXDestroyTlutObj(&sp10); + if (arg1->dataFmt == 9 || arg1->dataFmt == 10 || arg1->dataFmt == 11) { + GXDestroyTlutObj(&sp10); + } #endif } @@ -2579,6 +2581,9 @@ static void MDFaceDraw(HsfObject *arg0, HsfFace *arg1) { GXTexCoord1x16(arg1->indices[1][3]); } } +#ifdef TARGET_PC + GXEnd(); +#endif faceCnt = faceNumBuf[drawCnt] / 3; break; case 3: @@ -2649,6 +2654,9 @@ static void MDFaceDraw(HsfObject *arg0, HsfFace *arg1) { GXTexCoord1x16(arg1->indices[1][3]); } } +#ifdef TARGET_PC + GXEnd(); +#endif faceCnt = faceNumBuf[drawCnt] / 4; break; case 4: @@ -2720,6 +2728,9 @@ static void MDFaceDraw(HsfObject *arg0, HsfFace *arg1) { GXTexCoord1x16(var_r24[3]); } } +#ifdef TARGET_PC + GXEnd(); +#endif faceCnt = arg1->strip.count + 1; break; } diff --git a/src/game/objmain.c b/src/game/objmain.c index 1c3aeda5..479466a5 100644 --- a/src/game/objmain.c +++ b/src/game/objmain.c @@ -5,9 +5,11 @@ #include "game/hsfdraw.h" #include "game/hsfman.h" #include "game/object.h" +#include #include "game/pad.h" #include "game/printfunc.h" + #define OM_OVL_HIS_MAX 16 #define OM_MAX_GROUPS 10 diff --git a/src/port/byteswap.cpp b/src/port/byteswap.cpp index 1a19aa87..c6d6ab84 100644 --- a/src/port/byteswap.cpp +++ b/src/port/byteswap.cpp @@ -109,47 +109,47 @@ template T *offset_ptr(B &base, T *ptr, void *extra) return reinterpret_cast(reinterpret_cast(&base) + reinterpret_cast(ptr) + reinterpret_cast(extra)); } -template static inline void bswap(B &base, T &data); -template void bswap(B &base, P *&ptr) -{ - ptr = bswap32(ptr); -} -template void bswap(B &base, T *&ptr, s32 count) -{ - ptr = bswap32(ptr); - if (ptr == nullptr) { - return; - } - T *objBase = offset_ptr(base, ptr); - for (s32 i = 0; i < count; ++i) { - if (sVisitedPtrs.contains(objBase)) { - continue; - } - sVisitedPtrs.insert(objBase); - bswap(base, *objBase); - ++objBase; - } -} -template void bswap_list(B &base, T **&ptr) -{ - ptr = bswap32(ptr); - if (ptr == nullptr) { - return; - } - T **objBase = offset_ptr(base, ptr); - while (*objBase != nullptr) { - bswap(base, *objBase, 1); - ++objBase; - } -} -template void bswap_list(B &base, T *(&ptr)[]) -{ - T **objBase = ptr; - while (*objBase != nullptr) { - bswap(base, *objBase, 1); - ++objBase; - } -} +// template static inline void bswap(B &base, T &data); +// template void bswap(B &base, P *&ptr) +// { +// ptr = bswap32(ptr); +// } +// template void bswap(B &base, T *&ptr, s32 count) +// { +// ptr = bswap32(ptr); +// if (ptr == nullptr) { +// return; +// } +// T *objBase = offset_ptr(base, ptr); +// for (s32 i = 0; i < count; ++i) { +// if (sVisitedPtrs.contains(objBase)) { +// continue; +// } +// sVisitedPtrs.insert(objBase); +// bswap(base, *objBase); +// ++objBase; +// } +// } +// template void bswap_list(B &base, T **&ptr) +// { +// ptr = bswap32(ptr); +// if (ptr == nullptr) { +// return; +// } +// T **objBase = offset_ptr(base, ptr); +// while (*objBase != nullptr) { +// bswap(base, *objBase, 1); +// ++objBase; +// } +// } +// template void bswap_list(B &base, T *(&ptr)[]) +// { +// T **objBase = ptr; +// while (*objBase != nullptr) { +// bswap(base, *objBase, 1); +// ++objBase; +// } +// } template void bswap_flat(B &base, T *start, s32 count) { T *objBase = start; @@ -228,9 +228,9 @@ template void bswap(B &base, AnimData32b &obj, AnimData &dest) dest.patNum = obj.patNum; dest.bmpNum = obj.bmpNum; dest.useNum = obj.useNum; - dest.bank = reinterpret_cast(obj.bank); - dest.pat = reinterpret_cast(obj.pat); - dest.bmp = reinterpret_cast(obj.bmp); + dest.bank = reinterpret_cast(static_cast(obj.bank)); + dest.pat = reinterpret_cast(static_cast(obj.pat)); + dest.bmp = reinterpret_cast(static_cast(obj.bmp)); } template void bswap(B &base, AnimBankData32b &obj, AnimBankData &dest) @@ -241,7 +241,7 @@ template void bswap(B &base, AnimBankData32b &obj, AnimBankData &de dest.timeNum = obj.timeNum; dest.unk = obj.unk; - dest.frame = reinterpret_cast(obj.frame); + dest.frame = reinterpret_cast(static_cast(obj.frame)); } template void bswap(B &base, AnimPatData32b &obj, AnimPatData &dest) @@ -258,7 +258,7 @@ template void bswap(B &base, AnimPatData32b &obj, AnimPatData &dest dest.centerY = obj.centerY; dest.sizeX = obj.sizeX; dest.sizeY = obj.sizeY; - dest.layer = reinterpret_cast(obj.layer); + dest.layer = reinterpret_cast(static_cast(obj.layer)); } template void bswap(B &base, AnimBmpData32b &obj, AnimBmpData &dest) @@ -278,8 +278,8 @@ template void bswap(B &base, AnimBmpData32b &obj, AnimBmpData &dest dest.sizeX = obj.sizeX; dest.sizeY = obj.sizeY; dest.dataSize = obj.dataSize; - dest.palData = reinterpret_cast(obj.palData); - dest.data = reinterpret_cast(obj.data); + dest.palData = reinterpret_cast(static_cast(obj.palData)); + dest.data = reinterpret_cast(static_cast(obj.data)); } template void bswap(B &base, AnimFrameData &obj) @@ -349,10 +349,10 @@ template void bswap(B &base, HsfCluster32b &obj, HsfCluster &dest) bswap(base, obj.vertexCnt); bswap(base, obj.vertex); - dest.name[0] = reinterpret_cast(obj.name[0]); - dest.name[1] = reinterpret_cast(obj.name[1]); + dest.name[0] = reinterpret_cast(static_cast(obj.name[0])); + dest.name[1] = reinterpret_cast(static_cast(obj.name[1])); - dest.targetName = reinterpret_cast(obj.targetName); + dest.targetName = reinterpret_cast(static_cast(obj.targetName)); dest.index = obj.index; std::copy(std::begin(obj.weight), std::end(obj.weight), dest.weight); @@ -360,7 +360,7 @@ template void bswap(B &base, HsfCluster32b &obj, HsfCluster &dest) dest.unk95 = obj.unk95; dest.type = obj.type; dest.vertexCnt = obj.vertexCnt; - dest.vertex = reinterpret_cast(obj.vertex); + dest.vertex = reinterpret_cast(static_cast(obj.vertex)); } template void bswap(B &base, HsfAttribute32b &obj, HsfAttribute &dest) @@ -380,8 +380,8 @@ template void bswap(B &base, HsfAttribute32b &obj, HsfAttribute &de bswap(base, obj.flag); bswap(base, obj.bitmap); - dest.name = reinterpret_cast(obj.name); - dest.unk04 = reinterpret_cast(obj.unk04); + dest.name = reinterpret_cast(static_cast(obj.name)); + dest.unk04 = reinterpret_cast(static_cast(obj.unk04)); std::copy(std::begin(obj.unk8), std::end(obj.unk8), dest.unk8); dest.unk0C = obj.unk0C; std::copy(std::begin(obj.unk10), std::end(obj.unk10), dest.unk10); @@ -399,7 +399,7 @@ template void bswap(B &base, HsfAttribute32b &obj, HsfAttribute &de std::copy(std::begin(obj.unk6C), std::end(obj.unk6C), dest.unk6C); dest.unk78 = obj.unk78; dest.flag = obj.flag; - dest.bitmap = reinterpret_cast(obj.bitmap); + dest.bitmap = reinterpret_cast(static_cast(obj.bitmap)); } template void bswap(B &base, HsfMaterial32b &obj, HsfMaterial &dest) @@ -416,7 +416,7 @@ template void bswap(B &base, HsfMaterial32b &obj, HsfMaterial &dest bswap(base, obj.numAttrs); bswap(base, obj.attrs); - dest.name = reinterpret_cast(obj.name); + dest.name = reinterpret_cast(static_cast(obj.name)); std::copy(std::begin(obj.unk4), std::end(obj.unk4), dest.unk4); dest.pass = obj.pass; dest.vtxMode = obj.vtxMode; @@ -431,7 +431,7 @@ template void bswap(B &base, HsfMaterial32b &obj, HsfMaterial &dest dest.unk2C = obj.unk2C; dest.flags = obj.flags; dest.numAttrs = obj.numAttrs; - dest.attrs = reinterpret_cast(obj.attrs); + dest.attrs = reinterpret_cast(static_cast(obj.attrs)); } template void bswap(B &base, HsfScene &obj) @@ -449,9 +449,9 @@ template void bswap(B &base, HsfBuffer32b &obj, HsfBuffer &dest) bswap(base, obj.count); bswap(base, obj.data); - dest.name = reinterpret_cast(obj.name); + dest.name = reinterpret_cast(static_cast(obj.name)); dest.count = obj.count; - dest.data = reinterpret_cast(obj.data); + dest.data = reinterpret_cast(static_cast(obj.data)); } template void bswap(B &base, HsfMatrix &obj) @@ -459,7 +459,7 @@ template void bswap(B &base, HsfMatrix &obj) bswap(base, obj.base_idx); bswap(base, obj.count); - obj.data = (Mtx *)((uintptr_t)&obj + sizeof(0xC)); // hardcoded for 64 bit support + obj.data = reinterpret_cast(reinterpret_cast(&obj) + 0xC); // hardcoded for 64 bit support for (s32 i = 0; i < obj.count; i++) { for (s32 j = 0; j < 3; j++) { bswap_flat(base, obj.data[i][j], 4); @@ -474,10 +474,10 @@ template void bswap(B &base, HsfPalette32b &obj, HsfPalette &dest) bswap(base, obj.palSize); bswap(base, obj.data); - dest.name = reinterpret_cast(obj.name); + dest.name = reinterpret_cast(static_cast(obj.name)); dest.unk = obj.unk; dest.palSize = obj.palSize; - dest.data = reinterpret_cast(obj.data); + dest.data = reinterpret_cast(static_cast(obj.data)); } template void bswap(B &base, HsfPart32b &obj, HsfPart &dest) @@ -486,9 +486,9 @@ template void bswap(B &base, HsfPart32b &obj, HsfPart &dest) bswap(base, obj.count); bswap(base, obj.vertex); - dest.name = reinterpret_cast(obj.name); + dest.name = reinterpret_cast(static_cast(obj.name)); dest.count = obj.count; - dest.vertex = reinterpret_cast(obj.vertex); + dest.vertex = reinterpret_cast(static_cast(obj.vertex)); } template void bswap(B &base, HsfBitmap32b &obj, HsfBitmap &dest) @@ -502,7 +502,7 @@ template void bswap(B &base, HsfBitmap32b &obj, HsfBitmap &dest) bswap(base, obj.unk); bswap(base, obj.data); - dest.name = reinterpret_cast(obj.name); + dest.name = reinterpret_cast(static_cast(obj.name)); dest.maxLod = obj.maxLod; dest.dataFmt = obj.dataFmt; dest.pixSize = obj.pixSize; @@ -510,9 +510,9 @@ template void bswap(B &base, HsfBitmap32b &obj, HsfBitmap &dest) dest.sizeY = obj.sizeY; dest.palSize = obj.palSize; dest.tint = obj.tint; - dest.palData = reinterpret_cast(obj.palData); + dest.palData = reinterpret_cast(static_cast(obj.palData)); dest.unk = obj.unk; - dest.data = reinterpret_cast(obj.data); + dest.data = reinterpret_cast(static_cast(obj.data)); } template void bswap(B &base, HsfMapAttr32b &obj, HsfMapAttr &dest) @@ -527,7 +527,7 @@ template void bswap(B &base, HsfMapAttr32b &obj, HsfMapAttr &dest) dest.minX = obj.minX; dest.minZ = obj.minZ; dest.maxX = obj.maxZ; - dest.data = reinterpret_cast(obj.data); + dest.data = reinterpret_cast(static_cast(obj.data)); dest.dataLen = obj.dataLen; } @@ -543,7 +543,7 @@ template void bswap(B &base, HsfSkeleton32b &obj, HsfSkeleton &dest bswap(base, obj.name); bswap(base, obj.transform); - dest.name = reinterpret_cast(obj.name); + dest.name = reinterpret_cast(static_cast(obj.name)); dest.transform = obj.transform; } @@ -552,8 +552,8 @@ template void bswap(B &base, HsfShape32b &obj, HsfShape &dest) bswap(base, obj.name); bswap(base, obj.vertex); - dest.name = reinterpret_cast(obj.name); - dest.vertex = reinterpret_cast(obj.vertex); + dest.name = reinterpret_cast(static_cast(obj.name)); + dest.vertex = reinterpret_cast(static_cast(obj.vertex)); } template void bswap(B &base, HsfCenvSingle &obj) @@ -577,10 +577,10 @@ template void bswap(B &base, HsfCenv32b &obj, HsfCenv &dest) bswap(base, obj.vtxCount); bswap(base, obj.copyCount); - dest.name = reinterpret_cast(obj.name); - dest.singleData = reinterpret_cast(obj.singleData); - dest.dualData = reinterpret_cast(obj.dualData); - dest.multiData = reinterpret_cast(obj.multiData); + dest.name = reinterpret_cast(static_cast(obj.name)); + dest.singleData = reinterpret_cast(static_cast(obj.singleData)); + dest.dualData = reinterpret_cast(static_cast(obj.dualData)); + dest.multiData = reinterpret_cast(static_cast(obj.multiData)); dest.singleCount = obj.singleCount; dest.dualCount = obj.dualCount; dest.multiCount = obj.multiCount; @@ -610,29 +610,29 @@ template void bswap(B &base, HsfObjectData32b &obj, HsfObjectData & bswap(base, obj.cenv); bswap_flat(base, obj.file, sizeof(obj.file) / sizeof(u32)); - dest.parent = reinterpret_cast(obj.parent); + dest.parent = reinterpret_cast(static_cast(obj.parent)); dest.childrenCount = obj.childrenCount; - dest.children = reinterpret_cast(obj.children); + dest.children = reinterpret_cast(static_cast(obj.children)); dest.base = obj.base; dest.curr = obj.curr; - dest.face = reinterpret_cast(obj.face); - dest.vertex = reinterpret_cast(obj.vertex); - dest.normal = reinterpret_cast(obj.normal); - dest.color = reinterpret_cast(obj.color); - dest.st = reinterpret_cast(obj.st); - dest.material = reinterpret_cast(obj.material); - dest.attribute = reinterpret_cast(obj.attribute); + dest.face = reinterpret_cast(static_cast(obj.face)); + dest.vertex = reinterpret_cast(static_cast(obj.vertex)); + dest.normal = reinterpret_cast(static_cast(obj.normal)); + dest.color = reinterpret_cast(static_cast(obj.color)); + dest.st = reinterpret_cast(static_cast(obj.st)); + dest.material = reinterpret_cast(static_cast(obj.material)); + dest.attribute = reinterpret_cast(static_cast(obj.attribute)); std::copy(std::begin(obj.unk120), std::end(obj.unk120), dest.unk120); dest.shapeType = obj.shapeType; dest.unk123 = obj.unk123; dest.vertexShapeCnt = obj.vertexShapeCnt; - dest.vertexShape = reinterpret_cast(obj.vertexShape); + dest.vertexShape = reinterpret_cast(static_cast(obj.vertexShape)); dest.clusterCnt = obj.clusterCnt; - dest.cluster = reinterpret_cast(obj.cluster); + dest.cluster = reinterpret_cast(static_cast(obj.cluster)); dest.cenvCnt = obj.cenvCnt; - dest.cenv = reinterpret_cast(obj.cenv); - dest.file[0] = reinterpret_cast(obj.file[0]); - dest.file[1] = reinterpret_cast(obj.file[1]); + dest.cenv = reinterpret_cast(static_cast(obj.cenv)); + dest.file[0] = reinterpret_cast(static_cast(obj.file[0])); + dest.file[1] = reinterpret_cast(static_cast(obj.file[1])); switch (type) { case HSF_OBJ_MESH: @@ -649,7 +649,7 @@ template void bswap(B &base, HsfObjectData32b &obj, HsfObjectData & case HSF_OBJ_REPLICA: bswap(base, obj.replica); - dest.replica = obj.replica; + dest.replica = reinterpret_cast(static_cast(obj.replica)); break; default: break; @@ -663,9 +663,9 @@ template void bswap(B &base, HsfObject32b &obj, HsfObject &dest) bswap(base, obj.constData); bswap(base, obj.flags); - dest.name = reinterpret_cast(obj.name); + dest.name = reinterpret_cast(static_cast(obj.name)); dest.type = obj.type; - dest.constData = reinterpret_cast(obj.constData); + dest.constData = reinterpret_cast(static_cast(obj.constData)); dest.flags = obj.flags; bswap(base, obj.data, dest.data, obj.type); @@ -677,7 +677,7 @@ template void bswap(B &base, HsfBitmapKey32b &obj, HsfBitmapKey &de bswap(base, obj.data); dest.time = obj.time; - dest.data = reinterpret_cast(obj.data); + dest.data = reinterpret_cast(static_cast(obj.data)); } template void bswap(B &base, HsfTrack32b &obj, HsfTrack &dest) @@ -686,17 +686,23 @@ template void bswap(B &base, HsfTrack32b &obj, HsfTrack &dest) bswap(base, obj.start); bswap(base, obj.curveType); bswap(base, obj.numKeyframes); - bswap(base, obj.data); // this byteswaps "value" too dest.type = obj.type; dest.start = obj.start; dest.curveType = obj.curveType; dest.numKeyframes = obj.numKeyframes; - dest.data = reinterpret_cast(obj.data); // this correctly sets "value" too - if (obj.type = HSF_TRACK_CLUSTER_WEIGHT) { + if (obj.curveType == HSF_CURVE_CONST) { + bswap(base, obj.value); + dest.value = obj.value; + } + else { + bswap(base, obj.data); + dest.data = reinterpret_cast(static_cast(obj.data)); + } + + if (obj.type == HSF_TRACK_CLUSTER_WEIGHT) { bswap(base, obj.unk04); - dest.unk04 = obj.unk04; } else { @@ -715,9 +721,9 @@ template void bswap(B &base, HsfMotion32b &obj, HsfMotion &dest) bswap(base, obj.track); bswap(base, obj.len); - dest.name = reinterpret_cast(obj.name); + dest.name = reinterpret_cast(static_cast(obj.name)); dest.numTracks = obj.numTracks; - dest.track = reinterpret_cast(obj.track); + dest.track = reinterpret_cast(static_cast(obj.track)); dest.len = obj.len; } @@ -737,7 +743,7 @@ template void bswap(B &base, HsfFace32b &obj, HsfFace &dest) bswap_flat(base, obj.strip.indices[0], 3 * 4); dest.strip.count = obj.strip.count; - dest.strip.data = reinterpret_cast(obj.strip.data); + dest.strip.data = reinterpret_cast(static_cast(obj.strip.data)); std::copy(&obj.strip.indices[0][0], &obj.strip.indices[0][0] + 3 * 4, &dest.strip.indices[0][0]); } else { diff --git a/src/port/stubs.c b/src/port/stubs.c index 1fe4509f..37cdca92 100644 --- a/src/port/stubs.c +++ b/src/port/stubs.c @@ -629,7 +629,7 @@ void GXSetTexCoordScaleManually(GXTexCoordID coord, u8 enable, u16 ss, u16 ts) void GXResetWriteGatherPipe(void) { - puts("GXResetWriteGatherPipe is a stub"); + // puts("GXResetWriteGatherPipe is a stub"); } void ARQInit(void) {