Rename and format

This commit is contained in:
Derek Hensley
2021-11-10 08:02:36 -08:00
parent 6d6c973d27
commit aec7d245e8
5 changed files with 30 additions and 21 deletions
+25
View File
@@ -0,0 +1,25 @@
#include "global.h"
void FrameAdvance_Init(FrameAdvanceContext* frameAdvCtx) {
frameAdvCtx->timer = 0;
frameAdvCtx->enabled = false;
}
/**
* Frame advance allows you to advance through the game one frame at a time on command.
* To advance a frame, hold Z and press R on the spceified controller.
* Holding Z and R will advance a frame every half second.
*
* This function returns true when frame advance is not active (game will run normally)
*
* Note: There is no way to enable it
*/
s32 FrameAdvance_Update(FrameAdvanceContext* frameAdvCtx, Input* input) {
if (!frameAdvCtx->enabled || (CHECK_BTN_ALL(input->cur.button, BTN_Z) &&
(CHECK_BTN_ALL(input->press.button, BTN_R) ||
(CHECK_BTN_ALL(input->cur.button, BTN_R) && (++frameAdvCtx->timer >= 9))))) {
frameAdvCtx->timer = 0;
return true;
}
return false;
}
-16
View File
@@ -1,16 +0,0 @@
#include "global.h"
void func_80122660(FrameAdvanceContext* frameAdvCtx) {
frameAdvCtx->timer = 0;
frameAdvCtx->enabled = false;
}
s32 func_80122670(FrameAdvanceContext* frameAdvCtx, Input* input) {
if (!frameAdvCtx->enabled || (CHECK_BTN_ALL(input->cur.button, BTN_Z) &&
(CHECK_BTN_ALL(input->press.button, BTN_R) ||
(CHECK_BTN_ALL(input->cur.button, BTN_R) && (++frameAdvCtx->timer >= 9))))) {
frameAdvCtx->timer = 0;
return true;
}
return false;
}