summaryrefslogtreecommitdiff
path: root/apps/plugins/doom
diff options
context:
space:
mode:
authorKarl Kurbjun <kkurbjun@gmail.com>2006-04-14 21:07:56 +0000
committerKarl Kurbjun <kkurbjun@gmail.com>2006-04-14 21:07:56 +0000
commit993545b4fb375bd0dc5be407fa8e23bfc4fd9e20 (patch)
tree8971172a4ede454a40cd5e01f44d135d9ed63ddc /apps/plugins/doom
parent530cad32e88e35b515f5340946315cfef442afec (diff)
downloadrockbox-993545b4fb375bd0dc5be407fa8e23bfc4fd9e20.zip
rockbox-993545b4fb375bd0dc5be407fa8e23bfc4fd9e20.tar.gz
rockbox-993545b4fb375bd0dc5be407fa8e23bfc4fd9e20.tar.bz2
rockbox-993545b4fb375bd0dc5be407fa8e23bfc4fd9e20.tar.xz
Start of profiling support for doom.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9667 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/doom')
-rw-r--r--apps/plugins/doom/Makefile7
-rw-r--r--apps/plugins/doom/i_system.c19
-rw-r--r--apps/plugins/doom/rockdoom.c9
3 files changed, 25 insertions, 10 deletions
diff --git a/apps/plugins/doom/Makefile b/apps/plugins/doom/Makefile
index ea56441..0eef697 100644
--- a/apps/plugins/doom/Makefile
+++ b/apps/plugins/doom/Makefile
@@ -3,7 +3,10 @@
# $Id$
#
# $Log$
-# Revision 1.2 2006/03/29 21:16:45 kkurbjun
+# Revision 1.3 2006/04/14 21:07:56 kkurbjun
+# Start of profiling support for doom.
+#
+# Revision 1.2 2006-03-29 21:16:45 kkurbjun
# Use rockbox endian defines
#
# Revision 1.1 2006-03-28 15:44:01 dave
@@ -15,7 +18,7 @@ INCLUDES = -I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
-I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR)
CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \
-DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN \
- -Wno-strict-prototypes -O2
+ -Wno-strict-prototypes -O2 $(PROFILE_OPTS)
ifdef APPEXTRA
INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
diff --git a/apps/plugins/doom/i_system.c b/apps/plugins/doom/i_system.c
index 3de236a..450c213 100644
--- a/apps/plugins/doom/i_system.c
+++ b/apps/plugins/doom/i_system.c
@@ -16,7 +16,10 @@
// GNU General Public License for more details.
//
// $Log$
-// Revision 1.7 2006/04/04 11:16:44 dave
+// Revision 1.8 2006/04/14 21:07:55 kkurbjun
+// Start of profiling support for doom.
+//
+// Revision 1.7 2006-04-04 11:16:44 dave
// Correct the #ifdef logic for timer_unregister() and add a comment describing why we need to surround the use of the user timer with #ifdefs
//
// Revision 1.6 2006-04-03 17:32:46 dave
@@ -60,17 +63,17 @@
//
// I_GetTime
-// returns time in 1/35th second tics
+// returns time in 1/70th second tics
//
/* NOTE:
- The user timer is used to generate a 35Hz tick for Doom. But it
+ The user timer is used to generate a 70Hz tick for Doom. But it
is unavailable for the grayscale targets (it's used by the grayscale
lib) and is not implemented in the simulator - so we have to
approximate it using current_tick.
*/
-#if defined(HAVE_LCD_COLOR) && !defined(SIMULATOR)
+#if defined(HAVE_LCD_COLOR) && !defined(SIMULATOR) && !defined(RB_PROFILE)
volatile unsigned int doomtimer=0;
void doomtime(void)
@@ -81,8 +84,8 @@ void doomtime(void)
int I_GetTime (void)
{
-#if defined(HAVE_LCD_COLOR) && !defined(SIMULATOR)
- return doomtimer;
+#if defined(HAVE_LCD_COLOR) && !defined(SIMULATOR) && !defined(RB_PROFILE)
+ return doomtimer;
#else
#if HZ==100
return ((7*(*rb->current_tick))/20);
@@ -102,7 +105,7 @@ int I_GetTime (void)
// The game is much slower now (in terms of game speed).
void I_Init (void)
{
-#if defined(HAVE_LCD_COLOR) && !defined(SIMULATOR)
+#if defined(HAVE_LCD_COLOR) && !defined(SIMULATOR) && !defined(RB_PROFILE)
rb->timer_register(1, NULL, TIMER_FREQ/TICRATE, 1, doomtime);
#endif
I_InitSound();
@@ -117,7 +120,7 @@ void I_Quit (void)
I_ShutdownSound();
I_ShutdownMusic();
I_ShutdownGraphics();
-#if defined(HAVE_LCD_COLOR) && !defined(SIMULATOR)
+#if defined(HAVE_LCD_COLOR) && !defined(SIMULATOR) && !defined(RB_PROFILE)
rb->timer_unregister();
#endif
doomexit=1;
diff --git a/apps/plugins/doom/rockdoom.c b/apps/plugins/doom/rockdoom.c
index c65cdc9..81466ac 100644
--- a/apps/plugins/doom/rockdoom.c
+++ b/apps/plugins/doom/rockdoom.c
@@ -838,8 +838,17 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
systemvol= rb->global_settings->volume-rb->global_settings->volume%((rb->sound_max(SOUND_VOLUME)-rb->sound_min(SOUND_VOLUME))/15);
general_translucency = default_translucency; // phares
+
+#ifdef RB_PROFILE
+ rb->profile_thread();
+#endif
+
D_DoomMain ();
+#ifdef RB_PROFILE
+ rb->profstop();
+#endif
+
M_SaveDefaults ();
I_Quit(); // Make SURE everything was closed out right