link m_pause.c

This commit is contained in:
Prakxo
2023-06-16 15:16:31 +02:00
parent 5e5c7ebfe1
commit f650ba65c0
4 changed files with 49 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
#include "m_pause.h"
#include "m_controller.h"
void Pause_ct(pause_t* pause){
pause->timer = 0;
pause->enabled = 0;
}
int Pause_proc(pause_t* pause, pad_t* pad){
if(CHECK_BTN_ALL(pad->now.button, BUTTON_R) && CHECK_BTN_ALL(pad->on.button, BUTTON_DDOWN)){
pause->enabled = !pause->enabled;
}
if((!pause->enabled) || (CHECK_BTN_ALL(pad->now.button, BUTTON_Z) &&
(CHECK_BTN_ALL(pad->on.button, BUTTON_R) || (CHECK_BTN_ALL(pad->now.button, BUTTON_R)
&& (++pause->timer > 8))))){
pause->timer = 0;
return 1;
}
return 0;
}