diff options
| author | Prakxo <87568477+Prakxo@users.noreply.github.com> | 2023-08-12 17:55:42 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-12 09:55:42 -0700 |
| commit | 8aa8fb893a2258a27e77b2872c189a93dc427a2e (patch) | |
| tree | f374420ecdc12ec202ef01f41404d34fb9e22459 /src/code | |
| parent | d9a77b4949e78c889d5cc2c7554cce4a9b12992c (diff) | |
m_pause OK (#47)
* m_pause OK
* yeah now it's OK lol
* refactor
* refactor 2
Diffstat (limited to 'src/code')
| -rw-r--r-- | src/code/m_pause.c | 22 | ||||
| -rw-r--r-- | src/code/zurumode.c | 3 |
2 files changed, 24 insertions, 1 deletions
diff --git a/src/code/m_pause.c b/src/code/m_pause.c new file mode 100644 index 0000000..0b59856 --- /dev/null +++ b/src/code/m_pause.c @@ -0,0 +1,22 @@ +#include "m_pause.h" +#include "m_controller.h" +#include "libc/stdbool.h" + +void Pause_ct(Pause* pause) { + pause->timer = 0; + pause->enabled = 0; +} + +s32 Pause_proc(Pause* pause, Input* input) { + if (CHECK_BTN_ALL(input->cur.button, R_TRIG) && CHECK_BTN_ALL(input->press.button, D_JPAD)) { + pause->enabled = !pause->enabled; + } + + if ((!pause->enabled) || (CHECK_BTN_ALL(input->cur.button, Z_TRIG) && + (CHECK_BTN_ALL(input->press.button, R_TRIG) || + (CHECK_BTN_ALL(input->cur.button, R_TRIG) && (++pause->timer >= 9))))) { + pause->timer = 0; + return true; + } + return false; +} diff --git a/src/code/zurumode.c b/src/code/zurumode.c index 8c90d93..a67ea81 100644 --- a/src/code/zurumode.c +++ b/src/code/zurumode.c @@ -1,6 +1,7 @@ #include "zurumode.h" #include "m_nmi_buf.h" #include "padmgr.h" +#include "m_controller.h" zuruKeycheck zuruKeyCheck; @@ -185,7 +186,7 @@ void zurumode_callback(void* p) { zerucheck_init(&zuruKeyCheck); APPNMI_ZURUMODE_FLP(); zurumode_update(); - if ((mgr->pads[0].button) & 0x80) { + if (mgr->pads[0].button & RESET_BUTTON) { APPNMI_ZURUMODE3_FLP(); } } |
