move around apu reset a bit, doesn't seem to have broken anything
doesn't seem to have fixed anything either.
This commit is contained in:
parent
f19a0529ca
commit
b36bd990aa
|
@ -121,6 +121,13 @@ static void reset_apu()
|
||||||
|
|
||||||
static void remake_stereo_buffer()
|
static void remake_stereo_buffer()
|
||||||
{
|
{
|
||||||
|
// APU
|
||||||
|
if ( !gb_apu )
|
||||||
|
{
|
||||||
|
gb_apu = new Gb_Apu; // TODO: handle errors
|
||||||
|
reset_apu();
|
||||||
|
}
|
||||||
|
|
||||||
// Stereo_Buffer
|
// Stereo_Buffer
|
||||||
delete stereo_buffer;
|
delete stereo_buffer;
|
||||||
stereo_buffer = 0;
|
stereo_buffer = 0;
|
||||||
|
@ -128,20 +135,15 @@ static void remake_stereo_buffer()
|
||||||
stereo_buffer = new Simple_Effects_Buffer; // TODO: handle out of memory
|
stereo_buffer = new Simple_Effects_Buffer; // TODO: handle out of memory
|
||||||
if ( stereo_buffer->set_sample_rate( soundSampleRate ) ) { } // TODO: handle out of memory
|
if ( stereo_buffer->set_sample_rate( soundSampleRate ) ) { } // TODO: handle out of memory
|
||||||
stereo_buffer->clock_rate( gb_apu->clock_rate );
|
stereo_buffer->clock_rate( gb_apu->clock_rate );
|
||||||
|
|
||||||
// APU
|
// Multi_Buffer
|
||||||
static int const chan_types [chan_count] = {
|
static int const chan_types [chan_count] = {
|
||||||
Multi_Buffer::wave_type+1, Multi_Buffer::wave_type+2,
|
Multi_Buffer::wave_type+1, Multi_Buffer::wave_type+2,
|
||||||
Multi_Buffer::wave_type+3, Multi_Buffer::mixed_type+1
|
Multi_Buffer::wave_type+3, Multi_Buffer::mixed_type+1
|
||||||
};
|
};
|
||||||
if ( stereo_buffer->set_channel_count( chan_count, chan_types ) ) { } // TODO: handle errors
|
if ( stereo_buffer->set_channel_count( chan_count, chan_types ) ) { } // TODO: handle errors
|
||||||
|
|
||||||
if ( !gb_apu )
|
// Volume Level
|
||||||
{
|
|
||||||
gb_apu = new Gb_Apu; // TODO: handle errors
|
|
||||||
reset_apu();
|
|
||||||
}
|
|
||||||
|
|
||||||
apply_effects();
|
apply_effects();
|
||||||
apply_volume();
|
apply_volume();
|
||||||
}
|
}
|
||||||
|
|
|
@ -446,6 +446,13 @@ static void remake_stereo_buffer()
|
||||||
pcm [0].pcm.init();
|
pcm [0].pcm.init();
|
||||||
pcm [1].pcm.init();
|
pcm [1].pcm.init();
|
||||||
|
|
||||||
|
// APU
|
||||||
|
if ( !gb_apu )
|
||||||
|
{
|
||||||
|
gb_apu = new Gb_Apu; // TODO: handle out of memory
|
||||||
|
reset_apu();
|
||||||
|
}
|
||||||
|
|
||||||
// Stereo_Buffer
|
// Stereo_Buffer
|
||||||
delete stereo_buffer;
|
delete stereo_buffer;
|
||||||
stereo_buffer = 0;
|
stereo_buffer = 0;
|
||||||
|
@ -459,13 +466,7 @@ static void remake_stereo_buffer()
|
||||||
pcm [1].which = 1;
|
pcm [1].which = 1;
|
||||||
apply_filtering();
|
apply_filtering();
|
||||||
|
|
||||||
// APU
|
// Volume Level
|
||||||
if ( !gb_apu )
|
|
||||||
{
|
|
||||||
gb_apu = new Gb_Apu; // TODO: handle out of memory
|
|
||||||
reset_apu();
|
|
||||||
}
|
|
||||||
|
|
||||||
apply_muting();
|
apply_muting();
|
||||||
apply_volume();
|
apply_volume();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue