summaryrefslogtreecommitdiffstats
path: root/src/gba-buttons.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gba-buttons.c')
-rw-r--r--src/gba-buttons.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/gba-buttons.c b/src/gba-buttons.c
index 0f6218a..ee6458d 100644
--- a/src/gba-buttons.c
+++ b/src/gba-buttons.c
@@ -227,3 +227,27 @@ u32 gba_btn_b_data[112][8] = {
227 {0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, 227 {0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
228 {0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, 228 {0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
229}; 229};
230
231typedef enum {GBA_BTN_STATE_IDLE, GBA_BTN_STATE_PRESSED} GbaBtnState;
232typedef struct SpriteAnimation {
233 size_t *tile_offsets;
234 size_t n_frames;
235} SpriteAnimation;
236
237static size_t gba_btn_state_idle[] = {0};
238static size_t gba_btn_state_pressed[] = {0, 16, 16, 32, 32, 48, 48, 64, 64, 80, 96};
239
240SpriteAnimation anim_idle = {
241 .tile_offsets = &gba_btn_state_idle,
242 .n_frames = sizeof(gba_btn_state_idle) / sizeof(size_t),
243};
244
245SpriteAnimation anim_pressed = {
246 .tile_offsets = &gba_btn_state_pressed,
247 .n_frames = sizeof(gba_btn_state_pressed) / sizeof(size_t),
248};
249
250SpriteAnimation *animation_states[] = {
251 &anim_idle,
252 &anim_pressed,
253};