1#ifndef NW4R_G3D_PLATFORM_CPU_H
2#define NW4R_G3D_PLATFORM_CPU_H
3#include <nw4r/types_nw4r.h>
5#include <revolution/OS.h>
22inline f32 U8_0ToF32(
const u8* pPtr) {
24 OSu8tof32(
const_cast<u8*
>(pPtr), &x);
33inline f32 U16_0ToF32(
const u16* pPtr) {
35 OSu16tof32(
const_cast<u16*
>(pPtr), &x);
44inline f32 S7_8ToF32(
register const s16* pPtr) {
49 psq_l f, 0(pPtr), 1, 7
56inline f32 S10_5ToF32(
register const s16* pPtr) {
61 psq_l f, 0(pPtr), 1, 6
73inline u8 F32ToU8_0(f32 f) {
79inline s16 F32ToS10_5(
register f32 f) {
81 register s16* pPtr = &x;
85 psq_st f, 0(pPtr), 1, 6
97inline void SetGQR6_S10_5() {
98 OSSetGQR6(OS_GQR_TYPE_S16, 5);
100inline void SetGQR7_S7_8() {
101 OSSetGQR7(OS_GQR_TYPE_S16, 8);
127inline void StoreRange(
void* pBase, ulong size) {
128 DCStoreRange(pBase, size);
131inline void StoreRangeNoSync(
void* pBase, ulong size) {
132 DCStoreRangeNoSync(pBase, size);
135inline void FlushRangeNoSync(
void* pBase, ulong size) {
136 DCFlushRangeNoSync(pBase, size);
139inline void InvalidateRange(
void* pBase, ulong size) {
140 DCInvalidateRange(pBase, size);
152void Copy32ByteBlocks(
void* pDst,
const void* pSrc, ulong size);
153void ZeroMemory32ByteBlocks(
void* pDst, ulong size);
162inline void InitFastCast() {
163 fastcast::detail::Init();
3D graphics drawing library.