Imported funcs from sm64 to code_80004740.c and trig_tables.inc.c (#68)

* fixed float issue brought over from zeldaret

* Import trig_tables.inc.c

* Delete game_data_802BA370.s

* Import two funcs from sm64 into code_80004740.c
This commit is contained in:
CoderStig
2021-11-28 15:42:03 -07:00
committed by GitHub
parent 7387724509
commit 632512ada9
132 changed files with 2469 additions and 6154 deletions
+29
View File
@@ -0,0 +1,29 @@
#ifndef MK64_H
#define MK64_H
// Global header for Mario Kart 64
#include <types.h>
#include "config.h"
// Pointer casting is technically UB, and avoiding it gets rid of endian issues
// as well as a nice side effect.
#ifdef AVOID_UB
#define GET_HIGH_U16_OF_32(var) ((u16)((var) >> 16))
#define GET_HIGH_S16_OF_32(var) ((s16)((var) >> 16))
#define GET_LOW_U16_OF_32(var) ((u16)((var) & 0xFFFF))
#define GET_LOW_S16_OF_32(var) ((s16)((var) & 0xFFFF))
#define SET_HIGH_U16_OF_32(var, x) ((var) = ((var) & 0xFFFF) | ((x) << 16))
#define SET_HIGH_S16_OF_32(var, x) ((var) = ((var) & 0xFFFF) | ((x) << 16))
#else
#define GET_HIGH_U16_OF_32(var) (((u16 *)&(var))[0])
#define GET_HIGH_S16_OF_32(var) (((s16 *)&(var))[0])
#define GET_LOW_U16_OF_32(var) (((u16 *)&(var))[1])
#define GET_LOW_S16_OF_32(var) (((s16 *)&(var))[1])
#define SET_HIGH_U16_OF_32(var, x) ((((u16 *)&(var))[0]) = (x))
#define SET_HIGH_S16_OF_32(var, x) ((((s16 *)&(var))[0]) = (x))
#endif
#endif // MK64_H
File diff suppressed because it is too large Load Diff
+2
View File
@@ -4,6 +4,8 @@
#include <ultra64.h>
#include <common_structs.h>
typedef f32 Mat4[4][4];
enum SpTaskState {
SPTASK_STATE_NOT_STARTED,
SPTASK_STATE_RUNNING,