Alchemy
Loading...
Searching...
No Matches

keystate.h

Go to the documentation of this file.
1#ifndef ALCHEMY_KEYSTATE_H
2#define ALCHEMY_KEYSTATE_H
3
4/// @file
5/// The keypad state the VBlank interrupt keeps.
6///
7/// The VBlank handler reads the keypad into these cells, and
8/// Input_UpdateKeyRepeatAndDirection turns them into repeats after each frame
9/// (runtime/frame.c). The first five are volatile, a device: each tag names
10/// what differs without it.
11
12#include "types.h"
13
14/// Keys down now.
15/* FAKEMATCH(volatile): as plain u32, 18 functions differ in tbs-en, most
16 * UiWork_StepChannelScript (249), Clear_CheckButtonCodes (134). */
17extern volatile u32 gKeysHeld;
18/// Keys that went down this frame.
19/* FAKEMATCH(volatile): as plain u32, 41 functions differ in tbs-en, most
20 * PsynergyMenu_RunList (299), PsynergyMenu_SelectAction (261). */
21extern volatile u32 gKeysPressed;
22/// Pressed keys, repeating while held: after 19 frames, then every 6.
23/* FAKEMATCH(volatile): as plain u32, 54 functions differ in tbs-en, most
24 * CharacterSelector_RunRearrange (288), PsynergyMenu_SelectAction (236). */
25extern volatile u32 gKeysRepeat;
26/// gKeysRepeat with at most one D-pad direction.
27/* FAKEMATCH(volatile): as plain u32, 70 of 121 instructions differ in tbs-en
28 * (Input_UpdateKeyRepeatAndDirection). */
29extern volatile u32 gKeysRepeatDirected;
30/// The D-pad direction gKeysRepeatDirected keeps: of several held, the one
31/// added last.
32/* FAKEMATCH(volatile): as plain u32, 52 of 121 instructions differ in tbs-en
33 * (Input_UpdateKeyRepeatAndDirection). */
34extern volatile u32 gKeysDirection;
35
36// Cells whose rereads the bytes do not show
37extern u32 gKeysPressedLatch; ///< Presses since a reader last cleared it.
38extern u32 gKeysHeldLast; ///< gKeysHeld when the frame loop last read it.
39extern u32 gKeysHeldAtVBlank; ///< gKeysHeld at the previous VBlank.
40/// Frames until the held keys repeat; -1 makes them repeat at once.
41extern s32 gKeyRepeatTimer;
42
43#endif
volatile u32 gKeysDirection
The D-pad direction gKeysRepeatDirected keeps: of several held, the one added last.
volatile u32 gKeysHeld
Keys down now.
volatile u32 gKeysPressed
Keys that went down this frame.
u32 gKeysPressedLatch
Presses since a reader last cleared it.
volatile u32 gKeysRepeat
Pressed keys, repeating while held: after 19 frames, then every 6.
volatile u32 gKeysRepeatDirected
gKeysRepeat with at most one D-pad direction.
u32 gKeysHeldLast
gKeysHeld when the frame loop last read it.
u32 gKeysHeldAtVBlank
gKeysHeld at the previous VBlank.
s32 gKeyRepeatTimer
Frames until the held keys repeat; -1 makes them repeat at once.
The integer types, TRUE, UNUSED and the fixed-address macros.
signed int s32
Definition types.h:14
unsigned int u32
Definition types.h:15