diff --git a/apps/plugins/doom/Makefile b/apps/plugins/doom/Makefile index ea5644122c..0eef697292 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 3de236aede..450c213252 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 c65cdc9cac..81466ac860 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