summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDerek Hensley <hensley.derek58@gmail.com>2024-09-07 21:55:59 -0600
committerGitHub <noreply@github.com>2024-09-07 20:55:59 -0700
commit6eaf196927eb6c4465c3b6c8fcdcefb08a9bc377 (patch)
treed519b46246312e8947507f840f39afbf06829216 /include
parent2e2b2e2c7a59bd3544de5e73f72a03b947ec8ab3 (diff)
Misc Clean (#1680)
* vramu32 in Overlay_Relocate * Actor_SetColorFilter args * Effect Hitmark enum * Actor_WorldToActorCoords * Some fault clean up * contoller.h * macros.h no longer needs stdint.h
Diffstat (limited to 'include')
-rw-r--r--include/PR/os_cont.h18
-rw-r--r--include/controller.h25
-rw-r--r--include/functions.h2
-rw-r--r--include/macros.h5
-rw-r--r--include/z64.h1
5 files changed, 28 insertions, 23 deletions
diff --git a/include/PR/os_cont.h b/include/PR/os_cont.h
index 50febb015..2deae976e 100644
--- a/include/PR/os_cont.h
+++ b/include/PR/os_cont.h
@@ -56,24 +56,6 @@ typedef struct {
#define B_BUTTON 0x4000
#define A_BUTTON 0x8000
-/* Not original to libultra: button macros */
-/* Buttons */
-#define BTN_CRIGHT R_CBUTTONS
-#define BTN_CLEFT L_CBUTTONS
-#define BTN_CDOWN D_CBUTTONS
-#define BTN_CUP U_CBUTTONS
-#define BTN_R R_TRIG
-#define BTN_L L_TRIG
-#define BTN_RESET 0x0080 /* "neutral reset": Corresponds to holding L+R and pressing S */
-#define BTN_DRIGHT R_JPAD
-#define BTN_DLEFT L_JPAD
-#define BTN_DDOWN D_JPAD
-#define BTN_DUP U_JPAD
-#define BTN_START START_BUTTON
-#define BTN_Z Z_TRIG
-#define BTN_B B_BUTTON
-#define BTN_A A_BUTTON
-
#define CONT_ERR_NO_CONTROLLER PFS_ERR_NOPACK /* 1 */
#define CONT_ERR_CONTRFAIL CONT_OVERRUN_ERROR /* 4 */
#define CONT_ERR_INVALID PFS_ERR_INVALID /* 5 */
diff --git a/include/controller.h b/include/controller.h
new file mode 100644
index 000000000..933e3dc19
--- /dev/null
+++ b/include/controller.h
@@ -0,0 +1,25 @@
+#ifndef CONTROLLER_H
+#define CONTROLLER_H
+
+#include "PR/os_cont.h"
+
+#define BTN_A A_BUTTON
+#define BTN_B B_BUTTON
+#define BTN_Z Z_TRIG
+#define BTN_START START_BUTTON
+#define BTN_DUP U_JPAD
+#define BTN_DDOWN D_JPAD
+#define BTN_DLEFT L_JPAD
+#define BTN_DRIGHT R_JPAD
+#define BTN_RESET 0x0080 /* "neutral reset": Corresponds to holding L+R and pressing S */
+#define BTN_L L_TRIG
+#define BTN_R R_TRIG
+#define BTN_CUP U_CBUTTONS
+#define BTN_CDOWN D_CBUTTONS
+#define BTN_CLEFT L_CBUTTONS
+#define BTN_CRIGHT R_CBUTTONS
+
+#define CHECK_BTN_ALL(state, combo) (~((state) | ~(combo)) == 0)
+#define CHECK_BTN_ANY(state, combo) (((state) & (combo)) != 0)
+
+#endif
diff --git a/include/functions.h b/include/functions.h
index 1cc08c174..ea15b64b8 100644
--- a/include/functions.h
+++ b/include/functions.h
@@ -73,7 +73,7 @@ f32 Actor_WorldDistXYZToActor(Actor* actorA, Actor* actorB);
f32 Actor_WorldDistXYZToPoint(Actor* actor, Vec3f* refPoint);
f32 Actor_WorldDistXZToActor(Actor* actorA, Actor* actorB);
f32 Actor_WorldDistXZToPoint(Actor* actor, Vec3f* refPoint);
-void Actor_OffsetOfPointInActorCoords(Actor* actor, Vec3f* offset, Vec3f* point);
+void Actor_WorldToActorCoords(Actor* actor, Vec3f* offset, Vec3f* point);
f32 Actor_HeightDiff(Actor* actor1, Actor* actor2);
void Actor_SetControlStickData(PlayState* play, Input* input, f32 controlStickMagnitude, s16 controlStickAngle);
diff --git a/include/macros.h b/include/macros.h
index 534b275c7..29baeda55 100644
--- a/include/macros.h
+++ b/include/macros.h
@@ -1,7 +1,7 @@
#ifndef MACROS_H
#define MACROS_H
-#include "stdint.h"
+#include "PR/ultratypes.h"
#define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 240
@@ -41,9 +41,6 @@
// To be used with `Magic_Add`, but ensures enough magic is added to fill the magic bar to capacity
#define MAGIC_FILL_TO_CAPACITY (((void)0, gSaveContext.magicFillTarget) + (gSaveContext.save.saveInfo.playerData.isDoubleMagicAcquired + 1) * MAGIC_NORMAL_METER)
-#define CHECK_BTN_ALL(state, combo) (~((state) | ~(combo)) == 0)
-#define CHECK_BTN_ANY(state, combo) (((state) & (combo)) != 0)
-
#define CHECK_FLAG_ALL(flags, mask) (((flags) & (mask)) == (mask))
#define BIT_FLAG_TO_SHIFT(flag) \
diff --git a/include/z64.h b/include/z64.h
index f801fecdc..d22447676 100644
--- a/include/z64.h
+++ b/include/z64.h
@@ -13,6 +13,7 @@
#include "libc64/qrand.h"
#include "color.h"
+#include "controller.h"
#include "gfx.h"
#include "gfxprint.h"
#include "ichain.h"