diff --git a/src/dmg/gbSound.cpp b/src/dmg/gbSound.cpp index 75079e11..878e0fa8 100644 --- a/src/dmg/gbSound.cpp +++ b/src/dmg/gbSound.cpp @@ -120,6 +120,11 @@ static void apply_effects() } } +void gbSoundConfigEffects( gb_effects_config_t const& c ) +{ + gb_effects_config = c; +} + void gbSoundTick() { if ( systemSoundOn && gb_apu && stereo_buffer ) @@ -140,8 +145,12 @@ void gbSoundTick() static void reset_apu() { - // Use DMG or CGB sound differences based on type of game - gb_apu->reset( gbHardware & 1 ? gb_apu->mode_dmg : gb_apu->mode_cgb ); + Gb_Apu::mode_t mode = Gb_Apu::mode_dmg; + if ( gbHardware & 1 ) + mode = Gb_Apu::mode_cgb; + if ( gbHardware & 4 ) + mode = Gb_Apu::mode_agb; + gb_apu->reset( mode ); if ( stereo_buffer ) stereo_buffer->clear(); diff --git a/src/dmg/gbSound.h b/src/dmg/gbSound.h index 2dc8e79a..62402aa4 100644 --- a/src/dmg/gbSound.h +++ b/src/dmg/gbSound.h @@ -69,6 +69,6 @@ struct gb_effects_config_t bool surround; // true = put some channels in back }; -// Can be changed at any time, probably from another thread too. -// Sound will notice changes during next 1/100 second. -extern gb_effects_config_t gb_effects_config; +// Changes effects configuration +void gbSoundConfigEffects( gb_effects_config_t const& ); +extern gb_effects_config_t gb_effects_config; // current configuration