diff options
-rw-r--r-- | apps/plugins/doom/Makefile | 7 | ||||
-rw-r--r-- | apps/plugins/doom/i_system.c | 19 | ||||
-rw-r--r-- | apps/plugins/doom/rockdoom.c | 9 |
3 files changed, 25 insertions, 10 deletions
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 @@ | |||
3 | # $Id$ | 3 | # $Id$ |
4 | # | 4 | # |
5 | # $Log$ | 5 | # $Log$ |
6 | # Revision 1.2 2006/03/29 21:16:45 kkurbjun | 6 | # Revision 1.3 2006/04/14 21:07:56 kkurbjun |
7 | # Start of profiling support for doom. | ||
8 | # | ||
9 | # Revision 1.2 2006-03-29 21:16:45 kkurbjun | ||
7 | # Use rockbox endian defines | 10 | # Use rockbox endian defines |
8 | # | 11 | # |
9 | # Revision 1.1 2006-03-28 15:44:01 dave | 12 | # 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 \ | |||
15 | -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) | 18 | -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) |
16 | CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \ | 19 | CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \ |
17 | -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN \ | 20 | -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN \ |
18 | -Wno-strict-prototypes -O2 | 21 | -Wno-strict-prototypes -O2 $(PROFILE_OPTS) |
19 | 22 | ||
20 | ifdef APPEXTRA | 23 | ifdef APPEXTRA |
21 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | 24 | 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 @@ | |||
16 | // GNU General Public License for more details. | 16 | // GNU General Public License for more details. |
17 | // | 17 | // |
18 | // $Log$ | 18 | // $Log$ |
19 | // Revision 1.7 2006/04/04 11:16:44 dave | 19 | // Revision 1.8 2006/04/14 21:07:55 kkurbjun |
20 | // Start of profiling support for doom. | ||
21 | // | ||
22 | // Revision 1.7 2006-04-04 11:16:44 dave | ||
20 | // 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 | 23 | // 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 |
21 | // | 24 | // |
22 | // Revision 1.6 2006-04-03 17:32:46 dave | 25 | // Revision 1.6 2006-04-03 17:32:46 dave |
@@ -60,17 +63,17 @@ | |||
60 | 63 | ||
61 | // | 64 | // |
62 | // I_GetTime | 65 | // I_GetTime |
63 | // returns time in 1/35th second tics | 66 | // returns time in 1/70th second tics |
64 | // | 67 | // |
65 | 68 | ||
66 | /* NOTE: | 69 | /* NOTE: |
67 | 70 | ||
68 | The user timer is used to generate a 35Hz tick for Doom. But it | 71 | The user timer is used to generate a 70Hz tick for Doom. But it |
69 | is unavailable for the grayscale targets (it's used by the grayscale | 72 | is unavailable for the grayscale targets (it's used by the grayscale |
70 | lib) and is not implemented in the simulator - so we have to | 73 | lib) and is not implemented in the simulator - so we have to |
71 | approximate it using current_tick. | 74 | approximate it using current_tick. |
72 | */ | 75 | */ |
73 | #if defined(HAVE_LCD_COLOR) && !defined(SIMULATOR) | 76 | #if defined(HAVE_LCD_COLOR) && !defined(SIMULATOR) && !defined(RB_PROFILE) |
74 | volatile unsigned int doomtimer=0; | 77 | volatile unsigned int doomtimer=0; |
75 | 78 | ||
76 | void doomtime(void) | 79 | void doomtime(void) |
@@ -81,8 +84,8 @@ void doomtime(void) | |||
81 | 84 | ||
82 | int I_GetTime (void) | 85 | int I_GetTime (void) |
83 | { | 86 | { |
84 | #if defined(HAVE_LCD_COLOR) && !defined(SIMULATOR) | 87 | #if defined(HAVE_LCD_COLOR) && !defined(SIMULATOR) && !defined(RB_PROFILE) |
85 | return doomtimer; | 88 | return doomtimer; |
86 | #else | 89 | #else |
87 | #if HZ==100 | 90 | #if HZ==100 |
88 | return ((7*(*rb->current_tick))/20); | 91 | return ((7*(*rb->current_tick))/20); |
@@ -102,7 +105,7 @@ int I_GetTime (void) | |||
102 | // The game is much slower now (in terms of game speed). | 105 | // The game is much slower now (in terms of game speed). |
103 | void I_Init (void) | 106 | void I_Init (void) |
104 | { | 107 | { |
105 | #if defined(HAVE_LCD_COLOR) && !defined(SIMULATOR) | 108 | #if defined(HAVE_LCD_COLOR) && !defined(SIMULATOR) && !defined(RB_PROFILE) |
106 | rb->timer_register(1, NULL, TIMER_FREQ/TICRATE, 1, doomtime); | 109 | rb->timer_register(1, NULL, TIMER_FREQ/TICRATE, 1, doomtime); |
107 | #endif | 110 | #endif |
108 | I_InitSound(); | 111 | I_InitSound(); |
@@ -117,7 +120,7 @@ void I_Quit (void) | |||
117 | I_ShutdownSound(); | 120 | I_ShutdownSound(); |
118 | I_ShutdownMusic(); | 121 | I_ShutdownMusic(); |
119 | I_ShutdownGraphics(); | 122 | I_ShutdownGraphics(); |
120 | #if defined(HAVE_LCD_COLOR) && !defined(SIMULATOR) | 123 | #if defined(HAVE_LCD_COLOR) && !defined(SIMULATOR) && !defined(RB_PROFILE) |
121 | rb->timer_unregister(); | 124 | rb->timer_unregister(); |
122 | #endif | 125 | #endif |
123 | doomexit=1; | 126 | 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) | |||
838 | 838 | ||
839 | systemvol= rb->global_settings->volume-rb->global_settings->volume%((rb->sound_max(SOUND_VOLUME)-rb->sound_min(SOUND_VOLUME))/15); | 839 | systemvol= rb->global_settings->volume-rb->global_settings->volume%((rb->sound_max(SOUND_VOLUME)-rb->sound_min(SOUND_VOLUME))/15); |
840 | general_translucency = default_translucency; // phares | 840 | general_translucency = default_translucency; // phares |
841 | |||
842 | #ifdef RB_PROFILE | ||
843 | rb->profile_thread(); | ||
844 | #endif | ||
845 | |||
841 | D_DoomMain (); | 846 | D_DoomMain (); |
842 | 847 | ||
848 | #ifdef RB_PROFILE | ||
849 | rb->profstop(); | ||
850 | #endif | ||
851 | |||
843 | M_SaveDefaults (); | 852 | M_SaveDefaults (); |
844 | 853 | ||
845 | I_Quit(); // Make SURE everything was closed out right | 854 | I_Quit(); // Make SURE everything was closed out right |