diff options
author | Max Horn | 2008-12-03 10:59:06 +0000 |
---|---|---|
committer | Max Horn | 2008-12-03 10:59:06 +0000 |
commit | 59dc18d9ef1a90110cff330f81693c0f2e4fc0e7 (patch) | |
tree | 35c5086ee85a4605d8af2a0fb475c71a36e2af0b | |
parent | e7050a0c65c9e474a7e072f0883ce9858eb4bacd (diff) | |
download | scummvm-rg350-59dc18d9ef1a90110cff330f81693c0f2e4fc0e7.tar.gz scummvm-rg350-59dc18d9ef1a90110cff330f81693c0f2e4fc0e7.tar.bz2 scummvm-rg350-59dc18d9ef1a90110cff330f81693c0f2e4fc0e7.zip |
cleanup
svn-id: r35214
-rw-r--r-- | sound/fmopl.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/sound/fmopl.cpp b/sound/fmopl.cpp index 97a21d6a7c..e086038f4f 100644 --- a/sound/fmopl.cpp +++ b/sound/fmopl.cpp @@ -234,10 +234,10 @@ void OPLBuildTables(int ENV_BITS_PARAM, int EG_ENT_PARAM) { EG_AED = EG_DST; //EG_STEP = (96.0/EG_ENT); - for (i = 0; i < (int)(sizeof(KSL_TABLE_SEED) / sizeof(double)); i++) + for (i = 0; i < ARRAYSIZE(KSL_TABLE_SEED); i++) KSL_TABLE[i] = SC_KSL(KSL_TABLE_SEED[i]); - for (i = 0; i < (int)(sizeof(SL_TABLE_SEED) / sizeof(uint)); i++) + for (i = 0; i < ARRAYSIZE(SL_TABLE_SEED); i++) SL_TABLE[i] = SC_SL(SL_TABLE_SEED[i]); } @@ -246,15 +246,6 @@ void OPLBuildTables(int ENV_BITS_PARAM, int EG_ENT_PARAM) { /* --------------------- subroutines --------------------- */ -inline int Limit(int val, int max, int min) { - if ( val > max ) - val = max; - else if ( val < min ) - val = min; - - return val; -} - /* status set and IRQ handling */ inline void OPL_STATUS_SET(FM_OPL *OPL, int flag) { /* set status flag */ @@ -1027,7 +1018,7 @@ void YM3812UpdateOne(FM_OPL *OPL, int16 *buffer, int length) { if(rythm) OPL_CALC_RH(OPL, S_CH); /* limit check */ - data = Limit(outd[0], OPL_MAXOUT, OPL_MINOUT); + data = CLIP(outd[0], OPL_MINOUT, OPL_MAXOUT); /* store to sound buffer */ buf[i] = data >> OPL_OUTSB; } |