From 84801ecdc71576c0d461a5eee17c65ee37da7788 Mon Sep 17 00:00:00 2001 From: dbalatoni13 <40299962+dbalatoni13@users.noreply.github.com> Date: Wed, 2 Apr 2025 04:45:52 +0200 Subject: [PATCH] Add musyx and fix OSFastCast --- CMakeLists.txt | 3 ++- README.md | 2 +- include/dolphin/os/OSFastCast.h | 34 +++++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e6455cd8..c1d980c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL Linux) endif () add_subdirectory(extern/aurora EXCLUDE_FROM_ALL) +add_subdirectory(extern/musyx EXCLUDE_FROM_ALL) add_executable(marioparty4 src/game/main.c @@ -27,4 +28,4 @@ add_executable(marioparty4 ) target_compile_definitions(marioparty4 PRIVATE TARGET_PC VERSION=0) target_include_directories(marioparty4 PRIVATE include) -target_link_libraries(marioparty4 PRIVATE aurora::aurora aurora::main) +target_link_libraries(marioparty4 PRIVATE aurora::aurora aurora::main musyx) diff --git a/README.md b/README.md index 06a57925..884478a1 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. +- 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) diff --git a/include/dolphin/os/OSFastCast.h b/include/dolphin/os/OSFastCast.h index b52cabfe..9fb24e30 100644 --- a/include/dolphin/os/OSFastCast.h +++ b/include/dolphin/os/OSFastCast.h @@ -1,6 +1,8 @@ #ifndef _DOLPHIN_OSFASTCAST #define _DOLPHIN_OSFASTCAST +#include "dolphin/types.h" + #ifdef __cplusplus extern "C" { #endif @@ -44,6 +46,7 @@ static inline void OSInitFastCast(void) { static inline s16 __OSf32tos16(register f32 inF) { +#ifdef __MWERKS__ u32 tmp; register u32* tmpPtr = &tmp; register s16 out; @@ -55,12 +58,16 @@ static inline s16 __OSf32tos16(register f32 inF) // clang-format on return out; +#else + return (s16) inF; +#endif } static inline void OSf32tos16(f32 *f, s16 *out) { *out = __OSf32tos16(*f); } static inline u8 __OSf32tou8(register f32 inF) { +#ifdef __MWERKS__ u32 tmp; register u32 *tmpPtr = &tmp; register u8 out; @@ -72,12 +79,16 @@ static inline u8 __OSf32tou8(register f32 inF) // clang-format on return out; +#else + return (u8)inF; +#endif } static inline void OSf32tou8(f32 *f, u8 *out) { *out = __OSf32tou8(*f); } static inline s8 __OSf32tos8(register f32 inF) { +#ifdef __MWERKS__ u32 tmp; register u32 *tmpPtr = &tmp; register s8 out; @@ -90,12 +101,16 @@ static inline s8 __OSf32tos8(register f32 inF) // clang-format on return out; +#else + return (s8) inF; +#endif } static inline void OSf32tos8(f32 *f, s8 *out) { *out = __OSf32tos8(*f); } static inline u16 __OSf32tou16(register f32 inF) { +#ifdef __MWERKS__ u32 tmp; register u32 *tmpPtr = &tmp; register u16 out; @@ -107,11 +122,15 @@ static inline u16 __OSf32tou16(register f32 inF) // clang-format on return out; +#else + return (u16) inF; +#endif } static inline void OSf32tou16(f32 *f, u16 *out) { *out = __OSf32tou16(*f); } static inline float __OSs8tof32(register const s8* arg) { +#ifdef __MWERKS__ register float ret; asm { @@ -119,11 +138,15 @@ static inline float __OSs8tof32(register const s8* arg) { } return ret; +#else + return (f32)*arg; +#endif } static inline void OSs8tof32(const s8* in, float* out) { *out = __OSs8tof32(in); } static inline float __OSs16tof32(register const s16* arg) { +#ifdef __MWERKS__ register float ret; asm { @@ -131,11 +154,15 @@ static inline float __OSs16tof32(register const s16* arg) { } return ret; +#else + return (f32)*arg; +#endif } static inline void OSs16tof32(const s16* in, float* out) { *out = __OSs16tof32(in); } static inline float __OSu8tof32(register const u8* arg) { +#ifdef __MWERKS__ register float ret; asm { @@ -143,11 +170,15 @@ static inline float __OSu8tof32(register const u8* arg) { } return ret; +#else + return (f32)*arg; +#endif } static inline void OSu8tof32(const u8* in, float* out) { *out = __OSu8tof32(in); } static inline float __OSu16tof32(register const u16* arg) { +#ifdef __MWERKS__ register float ret; asm { @@ -155,6 +186,9 @@ static inline float __OSu16tof32(register const u16* arg) { } return ret; +#else + return (f32)*arg; +#endif } static inline void OSu16tof32(const u16* in, float* out) { *out = __OSu16tof32(in); }