diff options
author | Robin Watts | 2008-02-26 00:29:40 +0000 |
---|---|---|
committer | Robin Watts | 2008-02-26 00:29:40 +0000 |
commit | 2579136dd218178ff959159dbe6f3c458fc86a28 (patch) | |
tree | de77f1bdf4c9854236f605f420a029f33beee0f3 | |
parent | 07a7800ebd59c780e544928be72164aa04ffd826 (diff) | |
download | scummvm-rg350-2579136dd218178ff959159dbe6f3c458fc86a28.tar.gz scummvm-rg350-2579136dd218178ff959159dbe6f3c458fc86a28.tar.bz2 scummvm-rg350-2579136dd218178ff959159dbe6f3c458fc86a28.zip |
Another tiny speed tweak for fmopl.cpp; replace a division with a shift.
svn-id: r30968
-rw-r--r-- | sound/fmopl.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sound/fmopl.cpp b/sound/fmopl.cpp index 4e4048353a..4055ef6ba6 100644 --- a/sound/fmopl.cpp +++ b/sound/fmopl.cpp @@ -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 @@ inline void set_sl_rr(FM_OPL *OPL, int slot, int v) { /* 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; |