diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2023-02-01 18:45:02 -0400 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2023-02-01 18:50:25 -0400 |
commit | 9fa0a7f1da1b70bee995f53c6c96c43189018772 (patch) | |
tree | 114548896790eaff23cdca84a025281de86bbb51 /include/dolphin/os/OSFastCast.h | |
parent | 2ba3289286bbfcf9fcc13fd135d976058d8b6c2e (diff) |
global: Import Dolphin SDK
This version comes from the Metroid Prime decompilation project.
https://github.com/PrimeDecomp/prime
Diffstat (limited to 'include/dolphin/os/OSFastCast.h')
-rw-r--r-- | include/dolphin/os/OSFastCast.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/include/dolphin/os/OSFastCast.h b/include/dolphin/os/OSFastCast.h new file mode 100644 index 0000000..b6ca50d --- /dev/null +++ b/include/dolphin/os/OSFastCast.h @@ -0,0 +1,48 @@ +#ifndef _DOLPHIN_OSFASTCAST +#define _DOLPHIN_OSFASTCAST + +#ifdef __cplusplus +extern "C" { +#endif + +#define OS_GQR_F32 0x0000 +#define OS_GQR_U8 0x0004 +#define OS_GQR_U16 0x0005 +#define OS_GQR_S8 0x0006 +#define OS_GQR_S16 0x0007 + +#define OS_FASTCAST_U8 2 +#define OS_FASTCAST_U16 3 +#define OS_FASTCAST_S16 5 +// clang-format off +static inline void OSInitFastCast(void) { +#ifdef __MWERKS__ + asm + { + li r3, OS_GQR_U8 + oris r3, r3, OS_GQR_U8 + mtspr GQR2, r3 + + li r3, OS_GQR_U16 + oris r3, r3, OS_GQR_U16 + mtspr GQR3, r3 + + li r3, OS_GQR_S8 + oris r3, r3, OS_GQR_S8 + mtspr GQR4, r3 + + li r3, OS_GQR_S16 + oris r3, r3, OS_GQR_S16 + mtspr GQR5, r3 + } +#else + +#endif +} +// clang-format off + +#ifdef __cplusplus +} +#endif + +#endif // _DOLPHIN_OSFASTCAST |