mirror of
https://github.com/n64decomp/mk64
synced 2026-07-10 21:40:58 -04:00
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:
@@ -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
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user