summaryrefslogtreecommitdiffstats
path: root/apps/plugins
diff options
context:
space:
mode:
authorFranklin Wei <franklin@rockbox.org>2019-08-09 21:17:46 -0400
committerFranklin Wei <franklin@rockbox.org>2019-08-09 21:27:55 -0400
commit4397194110e67084ce7de179f0d0f094dee4dada (patch)
treec8c0df947d10047b769005c4ac4c606f1bf354f8 /apps/plugins
parentf5bb7fddecc0066a6cfb580538f297cec1def5d8 (diff)
downloadrockbox-4397194110e67084ce7de179f0d0f094dee4dada.tar.gz
rockbox-4397194110e67084ce7de179f0d0f094dee4dada.tar.bz2
rockbox-4397194110e67084ce7de179f0d0f094dee4dada.zip
quake: enable PQ_OPT5 (a fixed-point DrawSpans8)
This boosts performance to 13.0FPS on ipod6g for `timedemo demo1'. That's a +34% increase from baseline. Change-Id: I50bae7783ff2fce46e8257c251c6b639c069e7cb
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/sdl/progs/quake/d_local.h34
-rw-r--r--apps/plugins/sdl/progs/quake/d_vars.c20
-rw-r--r--apps/plugins/sdl/progs/quake/quakedef.h2
3 files changed, 53 insertions, 3 deletions
diff --git a/apps/plugins/sdl/progs/quake/d_local.h b/apps/plugins/sdl/progs/quake/d_local.h
index af924899e5..781aea06d4 100644
--- a/apps/plugins/sdl/progs/quake/d_local.h
+++ b/apps/plugins/sdl/progs/quake/d_local.h
@@ -66,11 +66,41 @@ extern float d_sdivzstepu, d_tdivzstepu, d_zistepu;
extern float d_sdivzstepv, d_tdivzstepv, d_zistepv;
extern float d_sdivzorigin, d_tdivzorigin, d_ziorigin;
-fixed16_t sadjust, tadjust;
-fixed16_t bbextents, bbextentt;
+extern int d_zistepu_fxp, d_zistepv_fxp, d_ziorigin_fxp;
+
+#ifdef USE_PQ_OPT3
+extern int d_sdivzstepu_fxp, d_tdivzstepu_fxp, d_zistepu_fxp;
+extern int d_sdivzstepv_fxp, d_tdivzstepv_fxp, d_zistepv_fxp;
+extern int d_sdivzorigin_fxp, d_tdivzorigin_fxp, d_ziorigin_fxp;
+#endif
+
+
+#ifdef USE_PQ_OPT
+//JB:Optimization
+//FW: disable
+//extern int sdivzstepu, tdivzstepu, zistepu;
+//extern int sdivzstepv, tdivzstepv, zistepv;
+//extern int sdivzorigin, tdivzorigin, ziorigin;
+#endif
+
+extern fixedpoint_t d_sdivzstepuFPM, d_tdivzstepuFPM, d_zistepuFPM;
+extern fixedpoint_t d_sdivzstepvFPM, d_tdivzstepvFPM, d_zistepvFPM;
+extern fixedpoint_t d_sdivzoriginFPM, d_tdivzoriginFPM, d_zioriginFPM;
+
+//Dan: ID Software was already using a minute amount of fixed point. I duplicated
+//these just for consistancy in the conversion, and so the types would match.
+fixed16_t sadjust, tadjust;
+fixed16_t bbextents, bbextentt;
+fixedpoint_t sadjustFPM, tadjustFPM;
+fixedpoint_t bbextentsFPM, bbextenttFPM;
void D_DrawSpans8 (espan_t *pspans);
+#ifdef USE_PQ_OPT
+//JB:Optimization
+void D_DrawSpans8WithZ (espan_t *pspans);
+#endif
+void D_DrawSpans8FPM (espan_t *pspans);
void D_DrawSpans16 (espan_t *pspans);
void D_DrawZSpans (espan_t *pspans);
void Turbulent8 (espan_t *pspan);
diff --git a/apps/plugins/sdl/progs/quake/d_vars.c b/apps/plugins/sdl/progs/quake/d_vars.c
index 88cc841ab8..f9db12dd06 100644
--- a/apps/plugins/sdl/progs/quake/d_vars.c
+++ b/apps/plugins/sdl/progs/quake/d_vars.c
@@ -36,6 +36,26 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
float d_sdivzstepu, d_tdivzstepu, d_zistepu;
float d_sdivzstepv, d_tdivzstepv, d_zistepv;
float d_sdivzorigin, d_tdivzorigin, d_ziorigin;
+#ifdef USE_PQ_OPT3
+int d_sdivzstepu_fxp, d_tdivzstepu_fxp, d_zistepu_fxp;
+int d_sdivzstepv_fxp, d_tdivzstepv_fxp, d_zistepv_fxp;
+int d_sdivzorigin_fxp, d_tdivzorigin_fxp, d_ziorigin_fxp;
+#endif
+
+int d_ziorigin_fxp, d_zistepv_fxp, d_zistepu_fxp;
+
+#ifdef USE_PQ_OPT
+//JB: Optimization
+int sdivzstepu, tdivzstepu, zistepu;
+int sdivzstepv, tdivzstepv, zistepv;
+int sdivzorigin, tdivzorigin, ziorigin;
+#endif
+
+#ifdef USEFPM
+fixedpoint_t d_sdivzstepuFPM, d_tdivzstepuFPM, d_zistepuFPM;
+fixedpoint_t d_sdivzstepvFPM, d_tdivzstepvFPM, d_zistepvFPM;
+fixedpoint_t d_sdivzoriginFPM, d_tdivzoriginFPM, d_zioriginFPM;
+#endif
fixed16_t sadjust, tadjust, bbextents, bbextentt;
diff --git a/apps/plugins/sdl/progs/quake/quakedef.h b/apps/plugins/sdl/progs/quake/quakedef.h
index fe9245e851..b629eeb3b2 100644
--- a/apps/plugins/sdl/progs/quake/quakedef.h
+++ b/apps/plugins/sdl/progs/quake/quakedef.h
@@ -34,7 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define USE_PQ_OPT2
//#define USE_PQ_OPT3 // don't use
#define USE_PQ_OPT4
-//#define USE_PQ_OPT5
+#define USE_PQ_OPT5
#endif
#define QUAKE_GAME // as opposed to utilities