diff options
author | Dave Chapman <dave@dchapman.com> | 2006-03-15 02:00:34 +0000 |
---|---|---|
committer | Dave Chapman <dave@dchapman.com> | 2006-03-15 02:00:34 +0000 |
commit | bfd2b868174a2eba4deb51d9967d151b40173e72 (patch) | |
tree | 61178a10042dd8b5335e3d40e482c60ebd03cba6 | |
parent | 67760ded3352839925c6ff39f922d3a801b6144a (diff) | |
download | rockbox-bfd2b868174a2eba4deb51d9967d151b40173e72.tar.gz rockbox-bfd2b868174a2eba4deb51d9967d151b40173e72.zip |
Enable frame-rate control for all targets. Change the iPod Nano to display 30fps (the other targets are all aiming for 20fps, but are not yet achieving it)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9042 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/plugins/pacbox/pacbox.c | 6 | ||||
-rw-r--r-- | apps/plugins/pacbox/pacbox.h | 11 |
2 files changed, 11 insertions, 6 deletions
diff --git a/apps/plugins/pacbox/pacbox.c b/apps/plugins/pacbox/pacbox.c index 76becd9b56..6c10a20915 100644 --- a/apps/plugins/pacbox/pacbox.c +++ b/apps/plugins/pacbox/pacbox.c | |||
@@ -37,9 +37,6 @@ extern char iedata[]; | |||
37 | extern char iend[]; | 37 | extern char iend[]; |
38 | #endif | 38 | #endif |
39 | 39 | ||
40 | /* How many video frames (out of a possible 60) we display each second */ | ||
41 | #define FPS 20 | ||
42 | |||
43 | struct plugin_api* rb; | 40 | struct plugin_api* rb; |
44 | 41 | ||
45 | unsigned framesPerSecond = VideoFrequency; | 42 | unsigned framesPerSecond = VideoFrequency; |
@@ -98,7 +95,6 @@ bool loadROMS( void ) | |||
98 | } | 95 | } |
99 | 96 | ||
100 | /* A buffer to render Pacman's 244x288 screen into */ | 97 | /* A buffer to render Pacman's 244x288 screen into */ |
101 | unsigned char background[ScreenWidth*ScreenHeight] __attribute__ ((aligned (4))); | ||
102 | unsigned char video_buffer[ScreenWidth*ScreenHeight] __attribute__ ((aligned (4))); | 98 | unsigned char video_buffer[ScreenWidth*ScreenHeight] __attribute__ ((aligned (4))); |
103 | 99 | ||
104 | long start_time; | 100 | long start_time; |
@@ -316,13 +312,11 @@ int gameProc( void ) | |||
316 | 312 | ||
317 | rb->lcd_update(); | 313 | rb->lcd_update(); |
318 | 314 | ||
319 | #ifdef SIMULATOR | ||
320 | /* Keep the framerate at Pacman's 60fps */ | 315 | /* Keep the framerate at Pacman's 60fps */ |
321 | end_time = start_time + (video_frames*HZ)/FPS; | 316 | end_time = start_time + (video_frames*HZ)/FPS; |
322 | while (TIME_BEFORE(*rb->current_tick,end_time)) { | 317 | while (TIME_BEFORE(*rb->current_tick,end_time)) { |
323 | rb->sleep(1); | 318 | rb->sleep(1); |
324 | } | 319 | } |
325 | #endif | ||
326 | } | 320 | } |
327 | 321 | ||
328 | return 0; | 322 | return 0; |
diff --git a/apps/plugins/pacbox/pacbox.h b/apps/plugins/pacbox/pacbox.h index 84bd8a7be8..3e80754f76 100644 --- a/apps/plugins/pacbox/pacbox.h +++ b/apps/plugins/pacbox/pacbox.h | |||
@@ -88,4 +88,15 @@ | |||
88 | #define YOFS ((LCD_HEIGHT-224/2)/2) | 88 | #define YOFS ((LCD_HEIGHT-224/2)/2) |
89 | #endif | 89 | #endif |
90 | 90 | ||
91 | /* How many video frames (out of a possible 60) we display each second. | ||
92 | NOTE: pacbox.c assumes this is an integer divisor of 60 | ||
93 | */ | ||
94 | #ifdef APPLE_IPOD_NANO | ||
95 | /* The Nano can manage full-speed at 30fps (1 in 2 frames) */ | ||
96 | #define FPS 30 | ||
97 | #else | ||
98 | /* We aim for 20fps on the other targets (1 in 3 frames) */ | ||
99 | #define FPS 20 | ||
100 | #endif | ||
101 | |||
91 | #endif | 102 | #endif |