X-Git-Url: https://git.rohieb.name/hackover2013-badge-firmware.git/blobdiff_plain/a2f51628f0de8e88650de20dbc24d90cfa0be60f..3deacf340c59a89b862f228d251307e71a9c9189:/badge/ui/vanity.c diff --git a/badge/ui/vanity.c b/badge/ui/vanity.c index b2bebbd..9ca7001 100644 --- a/badge/ui/vanity.c +++ b/badge/ui/vanity.c @@ -4,7 +4,7 @@ #include "event.h" #include -#define VANITY_IMAGE_FILE "/vanity.dat" +#define VANITY_IMAGE_FILE "/titleimg.dat" void badge_vanity_read_from_fd(FIL *fd, badge_framebuffer *dest) { UINT bytes; @@ -15,6 +15,8 @@ void badge_vanity_show(void) { FIL fd; badge_framebuffer fb; + unsigned min_ticks = 50; + if(FR_OK == f_open(&fd, VANITY_IMAGE_FILE, FA_OPEN_EXISTING | FA_READ)) { badge_vanity_read_from_fd(&fd, &fb); f_close(&fd); @@ -22,10 +24,17 @@ void badge_vanity_show(void) { badge_framebuffer_flush(&fb); badge_event_t ev; + do { ev = badge_event_wait(); - } while(badge_event_type(ev) != BADGE_EVENT_USER_INPUT); - for(;;); + if(badge_event_type(ev) == BADGE_EVENT_GAME_TICK) { + --min_ticks; + } + } while(min_ticks != 0); + + do { + ev = badge_event_wait(); + } while(badge_event_type(ev) != BADGE_EVENT_USER_INPUT); } }