summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMegaMech <MegaMech@users.noreply.github.com>2024-04-09 21:29:57 -0600
committerGitHub <noreply@github.com>2024-04-09 21:29:57 -0600
commit3da5a4f343fa708abcc461d83337ef6df9863447 (patch)
tree2ff74ffb532a89e5af9666250c2c60e7f339f9c0 /include
parent2b66867af1975759dc7acfb3bbc2c9063ffa4353 (diff)
Add ymls for Torch code generator (#497)
* Add torch * update jenkinsfile
Diffstat (limited to 'include')
-rw-r--r--include/bomb_kart.h2
-rw-r--r--include/common_structs.h3
-rw-r--r--include/defines.h19
-rw-r--r--include/macros.h17
-rw-r--r--include/types.h6
5 files changed, 44 insertions, 3 deletions
diff --git a/include/bomb_kart.h b/include/bomb_kart.h
index 9987099af..e95da284b 100644
--- a/include/bomb_kart.h
+++ b/include/bomb_kart.h
@@ -58,6 +58,6 @@ extern BombKart gBombKarts[NUM_BOMB_KARTS_MAX];
extern Collision D_80164038[NUM_BOMB_KARTS_MAX];
// data/data_0DD0A0_1.s
-extern BombKartSpawn D_800DCC08[NUM_COURSES][NUM_BOMB_KARTS_MAX];
+extern BombKartSpawn gBombKartSpawns[NUM_COURSES][NUM_BOMB_KARTS_MAX];
#endif
diff --git a/include/common_structs.h b/include/common_structs.h
index 0c07181c4..ef90adcce 100644
--- a/include/common_structs.h
+++ b/include/common_structs.h
@@ -4,6 +4,9 @@
#include "ultra64.h"
typedef f32 Vec3f[3];
+typedef f32 Vec4f[4];
+
+typedef s32 Vec3iu[3];
typedef s16 Vec3s[3];
typedef u16 Vec3su[3];
diff --git a/include/defines.h b/include/defines.h
index 833c5f53c..91d2bbd27 100644
--- a/include/defines.h
+++ b/include/defines.h
@@ -290,7 +290,7 @@
/**
* @brief Item IDs
*/
-typedef enum {
+typedef enum ITEMS {
/* 0x00 */ ITEM_NONE = 0,
/* 0x01 */ ITEM_BANANA,
/* 0x02 */ ITEM_BANANA_BUNCH,
@@ -307,7 +307,22 @@ typedef enum {
/* 0x0D */ ITEM_DOUBLE_MUSHROOM,
/* 0x0E */ ITEM_TRIPLE_MUSHROOM,
/* 0x0F */ ITEM_SUPER_MUSHROOM
-} ITEMS;
+};
+
+typedef enum KART_AI_BEHAVIOURS {
+ BEHAVIOUR_NONE = 0,
+ BEHAVIOUR_1,
+ BEHAVIOUR_HOP,
+ BEHAVIOUR_3,
+ BEHAVIOUR_4,
+ BEHAVIOUR_5,
+ BEHAVIOUR_NORMAL_SPEED,
+ BEHAVIOUR_FAST_SPEED,
+ BEHAVIOUR_SLOW_SPEED,
+ BEHAVIOUR_9,
+ BEHAVIOUR_10,
+ BEHAVIOUR_MAX_SPEED
+};
/**
* @brief Balloon status
diff --git a/include/macros.h b/include/macros.h
index 6504de275..853b79f7e 100644
--- a/include/macros.h
+++ b/include/macros.h
@@ -52,6 +52,23 @@
#define ALIGNED16
#endif
+// Fixed point macros
+#define FTOFIX(f) ((s32)((f) * 65536.0))
+#define ITOFIX(i) ((s32)((i) << 16))
+#define FIXTOF(x) ((double)((x) / 65536.0))
+#define FIXTOI(x) ((s32)((x) >> 16))
+
+// Split fixed-point values into its integer or fractional parts.
+#define toFixedInt(f) (FTOFIX(f) >> 16)
+#define toFrac(f) (FTOFIX(f) & 0xFFFF)
+
+// Setup a fixed-point matrix using floats or doubles. Recommend using doubles for more precision.
+#define toFixedPointMatrix(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16) \
+ {{((toFixedInt(x1)) << 16) | toFixedInt(x2), ((toFixedInt(x3)) << 16) | toFixedInt(x4), (toFixedInt(x5) << 16) | toFixedInt(x6), (toFixedInt(x7) << 16) | toFixedInt(x8)}, \
+ {((toFixedInt(x9)) << 16) | toFixedInt(x10), ((toFixedInt(x11)) << 16) | toFixedInt(x12), (toFixedInt(x13) << 16) | toFixedInt(x14), (toFixedInt(x15) << 16) | toFixedInt(x16)}, \
+ {((toFrac(x1)) << 16) | toFrac(x2), ((toFrac(x3)) << 16) | toFrac(x4), (toFrac(x5) << 16) | toFrac(x6), (toFrac(x7) << 16) | toFrac(x8)}, \
+ {((toFrac(x9)) << 16) | toFrac(x10), ((toFrac(x11)) << 16) | toFrac(x12), (toFrac(x13) << 16) | toFrac(x14), (toFrac(x15) << 16) | toFrac(x16)}}
+
// convert a virtual address to physical.
#define VIRTUAL_TO_PHYSICAL(addr) ((uintptr_t)(addr) & 0x1FFFFFFF)
diff --git a/include/types.h b/include/types.h
index 9ebb96e84..2af75261f 100644
--- a/include/types.h
+++ b/include/types.h
@@ -5,6 +5,12 @@
#include <common_structs.h>
#include "camera.h"
+typedef struct {
+ /* 0x0 */ s16 waypointStart;
+ /* 0x2 */ s16 waypointEnd;
+ /* 0x4 */ s32 type;
+} KartAIBehaviour; // size = 0x8
+
enum SpTaskState {
SPTASK_STATE_NOT_STARTED,
SPTASK_STATE_RUNNING,