Document time trial input replay system (#730)

* Document time trial input replay system

Documents how the input replay system works in time trials. This is used for
* Course ghosts (on the raceways)
* Player ghosts
* Replays

* Rename ghosts/replays and minor cleanup

Refer to staff and player ghosts in time trials as replays.
Refer to the basic replay as a "post time trial replay"
Change variable / function names to reflect terminology change

* Define replay magic values

* Rename staff_ghosts files to replays

Renames staff_ghosts files to replays, since they also deal with player ghosts and post time trial replays.

Also, changes staff_ghosts_loop -> replays_loop

* REPLAY_NOT_FRAME_COUNTER -> REPLAY_CLEAR_FRAME_COUNTER

* Add replays header and format

* Update replays.c

* Name load replay functions

---------

Co-authored-by: MegaMech <MegaMech@users.noreply.github.com>
This commit is contained in:
Jed Grabman
2025-06-28 18:36:36 -04:00
committed by GitHub
parent 91ee36c539
commit 6b08e60fe6
20 changed files with 678 additions and 620 deletions
+19
View File
@@ -45,6 +45,25 @@
#define HOLD_ALL_DPAD_AND_C_BUTTONS \
(U_JPAD | L_JPAD | R_JPAD | D_JPAD | U_CBUTTONS | L_CBUTTONS | R_CBUTTONS | D_CBUTTONS)
#define ALL_BUTTONS \
(A_BUTTON | B_BUTTON | L_TRIG | R_TRIG | Z_TRIG | START_BUTTON | U_JPAD | L_JPAD | R_JPAD | D_JPAD | U_CBUTTONS | \
L_CBUTTONS | R_CBUTTONS | D_CBUTTONS)
/**
* Replay controller buttons
* Used for time trial replays (including staff and player ghosts)
* Each entry is converted to a u32 value
* This allows access to the button struct member
*/
#define REPLAY_A_BUTTON (1 << 31) // 0x80000000
#define REPLAY_B_BUTTON (1 << 30) // 0x40000000
#define REPLAY_Z_TRIG (1 << 29) // 0x20000000
#define REPLAY_R_TRIG (1 << 28) // 0x10000000
#define REPLAY_FRAME_COUNTER 0xFF0000
#define REPLAY_CLEAR_FRAME_COUNTER (0xFFFFFFFF & ~REPLAY_FRAME_COUNTER)
#define REPLAY_STICK_Y 0xFF00
#define REPLAY_STICK_X 0xFF
#define REPLAY_FRAME_INCREMENT 0x10000
/**
* @brief Jump to demo mode from the debug menu using L and A