diff options
| author | Dragorn421 <Dragorn421@users.noreply.github.com> | 2024-11-01 23:47:12 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-01 18:47:12 -0400 |
| commit | 5b27899b9fea7cc704cee9c0e740c00fbf24ddab (patch) | |
| tree | 6cd37e84d25722317636355ce15249dbc4f6e227 /src/code/padutils.c | |
| parent | 012c192f0052addcbe5368d872f908ec240ee478 (diff) | |
libu64 (#2267)
* libu64
* logutils.o -> debug.o in spec
* stackcheck.c is part of libu64
* review
* add paragraph about Overlay_Load calling an external function
* audio code*
Diffstat (limited to 'src/code/padutils.c')
| -rw-r--r-- | src/code/padutils.c | 106 |
1 files changed, 0 insertions, 106 deletions
diff --git a/src/code/padutils.c b/src/code/padutils.c deleted file mode 100644 index 7a0407ef9..000000000 --- a/src/code/padutils.c +++ /dev/null @@ -1,106 +0,0 @@ -#include "global.h" - -void PadUtils_Init(Input* input) { - bzero(input, sizeof(Input)); -} - -void func_800FCB70(void) { -} - -void PadUtils_ResetPressRel(Input* input) { - input->press.button = 0; -#if PLATFORM_N64 - input->press.stick_x = 0; - input->press.stick_y = 0; -#endif - input->rel.button = 0; -} - -u32 PadUtils_CheckCurExact(Input* input, u16 value) { - return value == input->cur.button; -} - -u32 PadUtils_CheckCur(Input* input, u16 key) { - return key == (input->cur.button & key); -} - -u32 PadUtils_CheckPressed(Input* input, u16 key) { - return key == (input->press.button & key); -} - -u32 PadUtils_CheckReleased(Input* input, u16 key) { - return key == (input->rel.button & key); -} - -u16 PadUtils_GetCurButton(Input* input) { - return input->cur.button; -} - -u16 PadUtils_GetPressButton(Input* input) { - return input->press.button; -} - -s8 PadUtils_GetCurX(Input* input) { - return input->cur.stick_x; -} - -s8 PadUtils_GetCurY(Input* input) { - return input->cur.stick_y; -} - -void PadUtils_SetRelXY(Input* input, s32 x, s32 y) { - input->rel.stick_x = x; - input->rel.stick_y = y; -} - -s8 PadUtils_GetRelXImpl(Input* input) { - return input->rel.stick_x; -} - -s8 PadUtils_GetRelYImpl(Input* input) { - return input->rel.stick_y; -} - -s8 PadUtils_GetRelX(Input* input) { - return PadUtils_GetRelXImpl(input); -} - -s8 PadUtils_GetRelY(Input* input) { - return PadUtils_GetRelYImpl(input); -} - -#if PLATFORM_N64 -s8 PadUtils_GetPressX(Input* input) { - return input->press.stick_x; -} - -s8 PadUtils_GetPressY(Input* input) { - return input->press.stick_y; -} -#endif - -void PadUtils_UpdateRelXY(Input* input) { - s32 curX = PadUtils_GetCurX(input); - s32 curY = PadUtils_GetCurY(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; - } - - PadUtils_SetRelXY(input, relX, relY); -} |
