The game is fucking running

This commit is contained in:
KiritoDv
2024-04-06 04:33:03 -06:00
parent 110e54c562
commit 9e6800d369
18 changed files with 769 additions and 474 deletions
+2 -17
View File
@@ -2,8 +2,9 @@
#define LIBC_MATH_H
#include <libultra/types.h>
#include <math.h>
#define M_PI 3.14159265358979323846f
#define M_PI 3.14159265358979323846264338327950288
#define M_DTOR (M_PI / 180.0f)
#define M_RTOD (180.0f / M_PI)
#define M_SQRT2 1.41421356237309504880f
@@ -12,22 +13,6 @@
#define SHT_MAX 32767.0f
#define SHT_MINV (1.0f / SHT_MAX)
typedef union {
struct {
u32 hi;
u32 lo;
} word;
f64 d;
} du;
typedef union {
u32 i;
f32 f;
} fu;
extern f32 __libm_qnan_f;
#define __floorf floorf
#define __floor floor
#define __lfloorf lfloorf
+4 -4
View File
@@ -21,7 +21,7 @@
#define RAND_INT_SEEDED(max) ((s32)(Rand_ZeroOneSeeded()*(max)))
#define RAND_FLOAT_CENTERED_SEEDED(width) ((Rand_ZeroOneSeeded()-0.5f)*(width))
#define SEGMENTED_TO_VIRTUAL(segment) ((void*)OS_PHYSICAL_TO_K0(gSegments[((uintptr_t)(segment)<<4)>>0x1C]+(((uintptr_t)(segment))&0xFFFFFF)))
#define SEGMENTED_TO_VIRTUAL(segment) (segment)
#define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0]))
#define ARRAY_COUNTU(arr) (u32)(sizeof(arr) / sizeof(arr[0]))
@@ -39,15 +39,15 @@
#define RAD_TO_DEG(radians) (((radians) * 180.0f) / M_PI)
#define DEG_TO_RAD(degrees) (((degrees) / 180.0f) * M_PI)
// TODO: Fix these
#define SIN_DEG(angle) /*sinf*/(M_DTOR * angle)
#define COS_DEG(angle) /*cosf*/(M_DTOR * angle)
extern f32 SIN_DEG(f32 angle);
extern f32 COS_DEG(f32 angle);
#define USEC_TO_CYCLES(n) (((u64)(n)*(OS_CLOCK_RATE/15625LL))/(1000000LL/15625LL))
#define MSEC_TO_CYCLES(n) (USEC_TO_CYCLES((n) * 1000LL))
#define CYCLES_TO_USEC(c) (((u64)(c)*(1000000LL/15625LL))/(OS_CLOCK_RATE/15625LL))
#define CYCLES_TO_MSEC(c) ((s32)CYCLES_TO_USEC(c)/1000)
#define CYCLES_TO_MSEC_PC(c) (CYCLES_TO_USEC(c)/1000)
/*
* Macros for libultra
+2 -2
View File
@@ -49,9 +49,9 @@ extern Mtx gIdentityMtx; // 800C4620
extern Matrix gIdentityMatrix; //800C4660
extern Matrix* gGfxMatrix;
extern Matrix sGfxMatrixStack[0x20];
extern Matrix sGfxMatrixStack[];
extern Matrix* gCalcMatrix;
extern Matrix sCalcMatrixStack[0x20];
extern Matrix sCalcMatrixStack[];
f32 Math_ModF(f32 value, f32 mod);
void Rand_Init(void);
+1 -1
View File
@@ -28,7 +28,7 @@ typedef struct {
/* 0x00 */ u8 active;
/* 0x08 */ OSTimer timer;
/* 0x28 */ TimerAction action;
/* 0x2C */ s32* address;
/* 0x2C */ uintptr_t address;
/* 0x30 */ s32 value;
} TimerTask; // size = 0x38, 0x8 aligned