Add musyx and fix OSFastCast
This commit is contained in:
parent
2509e01125
commit
84801ecdc7
3 changed files with 37 additions and 2 deletions
|
|
@ -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); }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue