From b3d19ba78cd6eced3f3582a045f4ba1f0aba33bb Mon Sep 17 00:00:00 2001 From: Chris Moeller Date: Thu, 28 Nov 2013 01:47:48 -0800 Subject: [PATCH] GSF: Boosted GB noise channel volume and programmed a basic equalizer preset for the GB channels --- .../HighlyAdvanced/HighlyAdvanced/vbam/apu/Gb_Apu.cpp | 10 ++++++---- .../HighlyAdvanced/HighlyAdvanced/vbam/apu/Gb_Apu.h | 2 +- .../HighlyAdvanced/HighlyAdvanced/vbam/gba/Sound.cpp | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Frameworks/HighlyAdvanced/HighlyAdvanced/vbam/apu/Gb_Apu.cpp b/Frameworks/HighlyAdvanced/HighlyAdvanced/vbam/apu/Gb_Apu.cpp index 0fadfba14..1629fbd11 100644 --- a/Frameworks/HighlyAdvanced/HighlyAdvanced/vbam/apu/Gb_Apu.cpp +++ b/Frameworks/HighlyAdvanced/HighlyAdvanced/vbam/apu/Gb_Apu.cpp @@ -27,7 +27,8 @@ int const power_mask = 0x80; void Gb_Apu::treble_eq( blip_eq_t const& eq ) { good_synth.treble_eq( eq ); - med_synth .treble_eq( eq ); + med_synth[0].treble_eq( eq ); + med_synth[1].treble_eq( eq ); } inline int Gb_Apu::calc_output( int osc ) const @@ -64,7 +65,8 @@ void Gb_Apu::synth_volume( int iv ) { double v = volume_ * 0.60 / osc_count / 15 /*steps*/ / 8 /*master vol range*/ * iv; good_synth.volume( v ); - med_synth .volume( v ); + med_synth[0].volume( v ); + med_synth[1].volume( v * 1.4 ); } void Gb_Apu::apply_volume() @@ -185,7 +187,7 @@ Gb_Apu::Gb_Apu() o.outputs [2] = 0; o.outputs [3] = 0; o.good_synth = &good_synth; - o.med_synth = &med_synth; + o.med_synth = (i == 3) ? &med_synth[1] : &med_synth[0]; } reduce_clicks_ = false; @@ -267,7 +269,7 @@ void Gb_Apu::silence_osc( Gb_Osc& o ) if ( o.output ) { o.output->set_modified(); - med_synth.offset( last_time, delta, o.output ); + med_synth[0].offset( last_time, delta, o.output ); } } } diff --git a/Frameworks/HighlyAdvanced/HighlyAdvanced/vbam/apu/Gb_Apu.h b/Frameworks/HighlyAdvanced/HighlyAdvanced/vbam/apu/Gb_Apu.h index c807a023b..d651ce0e9 100644 --- a/Frameworks/HighlyAdvanced/HighlyAdvanced/vbam/apu/Gb_Apu.h +++ b/Frameworks/HighlyAdvanced/HighlyAdvanced/vbam/apu/Gb_Apu.h @@ -115,7 +115,7 @@ private: // large objects after everything else Gb_Osc::Good_Synth good_synth; - Gb_Osc::Med_Synth med_synth; + Gb_Osc::Med_Synth med_synth[2]; void reset_lengths(); void reset_regs(); diff --git a/Frameworks/HighlyAdvanced/HighlyAdvanced/vbam/gba/Sound.cpp b/Frameworks/HighlyAdvanced/HighlyAdvanced/vbam/gba/Sound.cpp index 815878a63..19c3c962f 100644 --- a/Frameworks/HighlyAdvanced/HighlyAdvanced/vbam/gba/Sound.cpp +++ b/Frameworks/HighlyAdvanced/HighlyAdvanced/vbam/gba/Sound.cpp @@ -418,6 +418,7 @@ static void remake_stereo_buffer(GBASystem *gba) { gba->gb_apu = new GBA::Gb_Apu; // TODO: handle out of memory reset_apu(gba); + gba->gb_apu->treble_eq( GBA::blip_eq_t( 0, 0, gba->soundSampleRate, gba->soundSampleRate / 2 ) ); } apply_muting(gba);