Start of profiling support for doom.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9667 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Karl Kurbjun 2006-04-14 21:07:56 +00:00
parent 530cad32e8
commit 993545b4fb
3 changed files with 25 additions and 10 deletions

View file

@ -3,7 +3,10 @@
# $Id$ # $Id$
# #
# $Log$ # $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 # Use rockbox endian defines
# #
# Revision 1.1 2006-03-28 15:44:01 dave # 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) -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR)
CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \ CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \
-DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN \ -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN \
-Wno-strict-prototypes -O2 -Wno-strict-prototypes -O2 $(PROFILE_OPTS)
ifdef APPEXTRA ifdef APPEXTRA
INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))

View file

@ -16,7 +16,10 @@
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// $Log$ // $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 // 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 // Revision 1.6 2006-04-03 17:32:46 dave
@ -60,17 +63,17 @@
// //
// I_GetTime // I_GetTime
// returns time in 1/35th second tics // returns time in 1/70th second tics
// //
/* NOTE: /* 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 is unavailable for the grayscale targets (it's used by the grayscale
lib) and is not implemented in the simulator - so we have to lib) and is not implemented in the simulator - so we have to
approximate it using current_tick. 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; volatile unsigned int doomtimer=0;
void doomtime(void) void doomtime(void)
@ -81,8 +84,8 @@ void doomtime(void)
int I_GetTime (void) int I_GetTime (void)
{ {
#if defined(HAVE_LCD_COLOR) && !defined(SIMULATOR) #if defined(HAVE_LCD_COLOR) && !defined(SIMULATOR) && !defined(RB_PROFILE)
return doomtimer; return doomtimer;
#else #else
#if HZ==100 #if HZ==100
return ((7*(*rb->current_tick))/20); 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). // The game is much slower now (in terms of game speed).
void I_Init (void) 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); rb->timer_register(1, NULL, TIMER_FREQ/TICRATE, 1, doomtime);
#endif #endif
I_InitSound(); I_InitSound();
@ -117,7 +120,7 @@ void I_Quit (void)
I_ShutdownSound(); I_ShutdownSound();
I_ShutdownMusic(); I_ShutdownMusic();
I_ShutdownGraphics(); I_ShutdownGraphics();
#if defined(HAVE_LCD_COLOR) && !defined(SIMULATOR) #if defined(HAVE_LCD_COLOR) && !defined(SIMULATOR) && !defined(RB_PROFILE)
rb->timer_unregister(); rb->timer_unregister();
#endif #endif
doomexit=1; doomexit=1;

View file

@ -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); 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 general_translucency = default_translucency; // phares
#ifdef RB_PROFILE
rb->profile_thread();
#endif
D_DoomMain (); D_DoomMain ();
#ifdef RB_PROFILE
rb->profstop();
#endif
M_SaveDefaults (); M_SaveDefaults ();
I_Quit(); // Make SURE everything was closed out right I_Quit(); // Make SURE everything was closed out right