[Scummvm-cvs-logs] SF.net SVN: scummvm: [30968] scummvm/trunk/sound/fmopl.cpp

robinwatts at users.sourceforge.net robinwatts at users.sourceforge.net
Tue Feb 26 01:29:40 CET 2008


Revision: 30968
          http://scummvm.svn.sourceforge.net/scummvm/?rev=30968&view=rev
Author:   robinwatts
Date:     2008-02-25 16:29:40 -0800 (Mon, 25 Feb 2008)

Log Message:
-----------
Another tiny speed tweak for fmopl.cpp; replace a division with a shift.

Modified Paths:
--------------
    scummvm/trunk/sound/fmopl.cpp

Modified: scummvm/trunk/sound/fmopl.cpp
===================================================================
--- scummvm/trunk/sound/fmopl.cpp	2008-02-25 19:57:35 UTC (rev 30967)
+++ scummvm/trunk/sound/fmopl.cpp	2008-02-26 00:29:40 UTC (rev 30968)
@@ -59,10 +59,11 @@
 /* used static memory = SIN_ENT * 4 (byte) */
 #ifdef __DS__
 #include "dsmain.h"
-#define SIN_ENT 256
+#define SIN_ENT_SHIFT 8
 #else
-#define SIN_ENT 2048
+#define SIN_ENT_SHIFT 11
 #endif
+#define SIN_ENT (1<<SIN_ENT_SHIFT)
 
 /* output level entries (envelope,sinwave) */
 /* envelope counter lower bits */
@@ -464,7 +465,7 @@
 
 /* operator output calcrator */
 
-#define OP_OUT(slot,env,con)   slot->wavetable[((slot->Cnt + con) / (0x1000000 / SIN_ENT)) & (SIN_ENT-1)][env]
+#define OP_OUT(slot,env,con)   slot->wavetable[((slot->Cnt + con)>>(24-SIN_ENT_SHIFT)) & (SIN_ENT-1)][env]
 /* ---------- calcrate one of channel ---------- */
 inline void OPL_CALC_CH(OPL_CH *CH) {
 	uint env_out;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list