diff options
| author | Tom Ross <midgey@rockbox.org> | 2007-07-30 05:19:05 +0000 |
|---|---|---|
| committer | Tom Ross <midgey@rockbox.org> | 2007-07-30 05:19:05 +0000 |
| commit | e1147b87abef7687055c9127437e6ce1353c6113 (patch) | |
| tree | ab9da3b3ca7efd58cbfcecf18c7735e95df8be92 /apps/plugins/rockboy/menu.c | |
| parent | 206a5d3585fcda50692fae2d60b2fba639c373b1 (diff) | |
| download | rockbox-e1147b87abef7687055c9127437e6ce1353c6113.zip rockbox-e1147b87abef7687055c9127437e6ce1353c6113.tar.gz rockbox-e1147b87abef7687055c9127437e6ce1353c6113.tar.bz2 rockbox-e1147b87abef7687055c9127437e6ce1353c6113.tar.xz | |
RTC (real time clock) support for Rockboy. The time in games like Pokemon Gold/Silver should now stay synced on RTC-capable targets. Other targets will lose track of time when the player is turned off. User's can edit the .rtc file in an attempt to resync the RTC. The clock should stay synced when entering and leaving the menu. I've tested this over the past two weeks and it seems to work well.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14071 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/rockboy/menu.c')
| -rw-r--r-- | apps/plugins/rockboy/menu.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/plugins/rockboy/menu.c b/apps/plugins/rockboy/menu.c index 803310f..0c9e46b 100644 --- a/apps/plugins/rockboy/menu.c +++ b/apps/plugins/rockboy/menu.c @@ -8,6 +8,7 @@ #include "rockmacros.h" #include "mem.h" #include "lib/oldmenuapi.h" +#include "rtc-gb.h" #if (CONFIG_KEYPAD == IPOD_4G_PAD) #define MENU_BUTTON_UP BUTTON_SCROLL_BACK @@ -84,6 +85,11 @@ int do_user_menu(void) { bool done=false; int m, ret=0; int result; + int time = 0; + +#if CONFIG_RTC + time = rb->mktime(rb->get_time()); +#endif /* Clean out the button Queue */ while (rb->button_get(false) != BUTTON_NONE) @@ -129,6 +135,12 @@ int do_user_menu(void) { rb->lcd_setfont(0); /* Reset the font */ rb->lcd_clear_display(); /* Clear display for screen size changes */ + + /* Keep the RTC in sync */ +#if CONFIG_RTC + time = (rb->mktime(rb->get_time()) - time) * 60; +#endif + while (time-- > 0) rtc_tick(); return ret; } |