Add musyx and fix OSFastCast

This commit is contained in:
dbalatoni13 2025-04-02 04:45:52 +02:00
parent 2509e01125
commit 84801ecdc7
3 changed files with 37 additions and 2 deletions

View file

@ -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)

View file

@ -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)

View file

@ -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); }