summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2006-03-15 02:00:34 +0000
committerDave Chapman <dave@dchapman.com>2006-03-15 02:00:34 +0000
commitbfd2b868174a2eba4deb51d9967d151b40173e72 (patch)
tree61178a10042dd8b5335e3d40e482c60ebd03cba6 /apps/plugins
parent67760ded3352839925c6ff39f922d3a801b6144a (diff)
downloadrockbox-bfd2b868174a2eba4deb51d9967d151b40173e72.zip
rockbox-bfd2b868174a2eba4deb51d9967d151b40173e72.tar.gz
rockbox-bfd2b868174a2eba4deb51d9967d151b40173e72.tar.bz2
rockbox-bfd2b868174a2eba4deb51d9967d151b40173e72.tar.xz
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
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/pacbox/pacbox.c6
-rw-r--r--apps/plugins/pacbox/pacbox.h11
2 files changed, 11 insertions, 6 deletions
diff --git a/apps/plugins/pacbox/pacbox.c b/apps/plugins/pacbox/pacbox.c
index 76becd9..6c10a20 100644
--- a/apps/plugins/pacbox/pacbox.c
+++ b/apps/plugins/pacbox/pacbox.c
@@ -37,9 +37,6 @@ extern char iedata[];
extern char iend[];
#endif
-/* How many video frames (out of a possible 60) we display each second */
-#define FPS 20
-
struct plugin_api* rb;
unsigned framesPerSecond = VideoFrequency;
@@ -98,7 +95,6 @@ bool loadROMS( void )
}
/* A buffer to render Pacman's 244x288 screen into */
-unsigned char background[ScreenWidth*ScreenHeight] __attribute__ ((aligned (4)));
unsigned char video_buffer[ScreenWidth*ScreenHeight] __attribute__ ((aligned (4)));
long start_time;
@@ -316,13 +312,11 @@ int gameProc( void )
rb->lcd_update();
-#ifdef SIMULATOR
/* Keep the framerate at Pacman's 60fps */
end_time = start_time + (video_frames*HZ)/FPS;
while (TIME_BEFORE(*rb->current_tick,end_time)) {
rb->sleep(1);
}
-#endif
}
return 0;
diff --git a/apps/plugins/pacbox/pacbox.h b/apps/plugins/pacbox/pacbox.h
index 84bd8a7..3e80754 100644
--- a/apps/plugins/pacbox/pacbox.h
+++ b/apps/plugins/pacbox/pacbox.h
@@ -88,4 +88,15 @@
#define YOFS ((LCD_HEIGHT-224/2)/2)
#endif
+/* How many video frames (out of a possible 60) we display each second.
+ NOTE: pacbox.c assumes this is an integer divisor of 60
+ */
+#ifdef APPLE_IPOD_NANO
+/* The Nano can manage full-speed at 30fps (1 in 2 frames) */
+#define FPS 30
+#else
+/* We aim for 20fps on the other targets (1 in 3 frames) */
+#define FPS 20
+#endif
+
#endif