From 189975198138adb4551fbc10e9105eb943d641f4 Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Tue, 1 Dec 2009 20:41:40 +0000 Subject: [PATCH] Playing around with LIKE Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3510 --- src/hardware/dbopl.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hardware/dbopl.cpp b/src/hardware/dbopl.cpp index 0ff691f8..b5ff85e4 100644 --- a/src/hardware/dbopl.cpp +++ b/src/hardware/dbopl.cpp @@ -401,9 +401,9 @@ Bits Operator::TemplateVolume( ) { break; case DECAY: vol += RateForward( decayAdd ); - if ( vol >= sustainLevel ) { + if ( GCC_UNLIKELY(vol >= sustainLevel) ) { //Check if we didn't overshoot max attenuation, then just go off - if ( vol >= ENV_MAX ) { + if ( GCC_UNLIKELY(vol >= ENV_MAX) ) { volume = ENV_MAX; SetState( OFF ); return ENV_MAX; @@ -420,7 +420,7 @@ Bits Operator::TemplateVolume( ) { //In sustain phase, but not sustaining, do regular release case RELEASE: vol += RateForward( releaseAdd );; - if ( vol >= ENV_MAX ) { + if ( GCC_UNLIKELY(vol >= ENV_MAX) ) { volume = ENV_MAX; SetState( OFF ); return ENV_MAX; @@ -1260,7 +1260,7 @@ void Chip::Setup( Bit32u rate ) { count += guessAdd; Bit32s change = count >> RATE_SH; count &= RATE_MASK; - if ( change ) { + if ( GCC_UNLIKELY(change) ) { // less than 1 % volume += ( ~volume * change ) >> 3; } samples++; @@ -1496,7 +1496,7 @@ void Handler::WriteReg( Bit32u addr, Bit8u val ) { void Handler::Generate( MixerChannel* chan, Bitu samples ) { Bit32s buffer[ 512 * 2 ]; - if ( samples > 512 ) + if ( GCC_UNLIKELY(samples > 512) ) samples = 512; if ( !chip.opl3Active ) { chip.GenerateBlock2( samples, buffer );