summaryrefslogtreecommitdiff
path: root/src/boot/O2/padutils.c
diff options
context:
space:
mode:
authorAnghelo Carvajal <angheloalf95@gmail.com>2023-08-09 21:21:12 -0400
committerGitHub <noreply@github.com>2023-08-09 21:21:12 -0400
commitfd54debbf2d18c7c9bfdd10bd42aab5abe9266a2 (patch)
tree4dc24ddd4fdc4210022b7d9a8c631d45020e3d11 /src/boot/O2/padutils.c
parent56b4e612cc8fc1af7c051592e850ca1aac02e39e (diff)
`libu64.a` identification (#43)
* identify debug * identify gfxprint.c and gfxprint_data.c * pad.c * fix * stackcheck * loadfragment and logseverity * mtxconv * comment * Revert "loadfragment and logseverity" This reverts commit 34d8214aa3869a518db8c9b59dc06361e8507418. * review * fix * another fix * fix
Diffstat (limited to 'src/boot/O2/padutils.c')
-rw-r--r--src/boot/O2/padutils.c92
1 files changed, 0 insertions, 92 deletions
diff --git a/src/boot/O2/padutils.c b/src/boot/O2/padutils.c
deleted file mode 100644
index 73745ac..0000000
--- a/src/boot/O2/padutils.c
+++ /dev/null
@@ -1,92 +0,0 @@
-#include "padutils.h"
-
-void pad_init(Input* input) {
- bzero(input, sizeof(Input));
-}
-
-void pad_cleanup(void) {
-}
-
-void pad_flush(Input* input) {
- input->press.button = 0;
- input->rel.button = 0;
-}
-
-s32 pad_push_only(Input* input, u16 value) {
- return value == input->cur.button;
-}
-
-s32 pad_push_also(Input* input, u16 key) {
- return key == (input->cur.button & key);
-}
-
-s32 pad_on_trigger(Input* input, u16 key) {
- return key == (input->press.button & key);
-}
-
-s32 pad_off_trigger(Input* input, u16 key) {
- return key == (input->rel.button & key);
-}
-
-u16 pad_button(Input* input) {
- return input->cur.button;
-}
-
-u16 pad_trigger(Input* input) {
- return input->press.button;
-}
-
-s8 pad_physical_stick_x(Input* input) {
- return input->cur.stick_x;
-}
-
-s8 pad_physical_stick_y(Input* input) {
- return input->cur.stick_y;
-}
-
-void pad_set_logical_stick(Input* input, s32 x, s32 y) {
- input->rel.stick_x = x;
- input->rel.stick_y = y;
-}
-
-s8 pad_logical_stick_x(Input* input) {
- return input->rel.stick_x;
-}
-
-s8 pad_logical_stick_y(Input* input) {
- return input->rel.stick_y;
-}
-
-s8 pad_stick_x(Input* input) {
- return pad_logical_stick_x(input);
-}
-
-s8 pad_stick_y(Input* input) {
- return pad_logical_stick_y(input);
-}
-
-void pad_correct_stick(Input* input) {
- s32 curX = pad_physical_stick_x(input);
- s32 curY = pad_physical_stick_y(input);
- s32 relX;
- s32 relY;
-
- if (curX > 7) {
- relX = (curX < 0x43) ? curX - 7 : 0x43 - 7;
- } else if (curX < -7) {
- relX = (curX > -0x43) ? curX + 7 : -0x43 + 7;
- } else {
- relX = 0;
- }
-
- if (curY > 7) {
- relY = (curY < 0x43) ? curY - 7 : 0x43 - 7;
-
- } else if (curY < -7) {
- relY = (curY > -0x43) ? curY + 7 : -0x43 + 7;
- } else {
- relY = 0;
- }
-
- pad_set_logical_stick(input, relX, relY);
-}