mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-23 03:32:32 +00:00
Re-enabled working video output for the Electron for the day and consolidated the rough metric I'm using to pick a number of taps for the audio filter.
This commit is contained in:
parent
9ede284eb6
commit
499f7ace07
@ -66,7 +66,7 @@ void Machine::setup_output(float aspect_ratio)
|
||||
"texValue >>= 4 - (int(icoordinate.x * 8) & 4);"
|
||||
"return vec3( uvec3(texValue) & uvec3(4u, 2u, 1u));"
|
||||
"}");
|
||||
_crt->set_output_device(Outputs::CRT::Television);
|
||||
_crt->set_output_device(Outputs::CRT::Monitor);
|
||||
|
||||
// TODO: as implied below, I've introduced a clock's latency into the graphics pipeline somehow. Investigate.
|
||||
_crt->set_visible_area(_crt->get_rect_for_area(first_graphics_line - 3, 256, (first_graphics_cycle+1) * crt_cycles_multiplier, 80 * crt_cycles_multiplier, 4.0f / 3.0f));
|
||||
|
@ -60,7 +60,7 @@
|
||||
- (BOOL)setSpeakerDelegate:(Outputs::Speaker::Delegate *)delegate sampleRate:(int)sampleRate {
|
||||
@synchronized(self) {
|
||||
_electron.get_speaker()->set_output_rate(sampleRate, 256);
|
||||
_electron.get_speaker()->set_output_quality(47);
|
||||
// _electron.get_speaker()->set_output_quality(47);
|
||||
_electron.get_speaker()->set_delegate(delegate);
|
||||
return YES;
|
||||
}
|
||||
|
@ -35,11 +35,11 @@ class Speaker {
|
||||
set_needs_updated_filter_coefficients();
|
||||
}
|
||||
|
||||
void set_output_quality(int number_of_taps)
|
||||
{
|
||||
_number_of_taps = number_of_taps;
|
||||
set_needs_updated_filter_coefficients();
|
||||
}
|
||||
// void set_output_quality(int number_of_taps)
|
||||
// {
|
||||
// _number_of_taps = number_of_taps;
|
||||
// set_needs_updated_filter_coefficients();
|
||||
// }
|
||||
|
||||
void set_delegate(Delegate *delegate)
|
||||
{
|
||||
@ -130,6 +130,11 @@ template <class T> class Filter: public Speaker {
|
||||
|
||||
void update_filter_coefficients()
|
||||
{
|
||||
// make a guess at a good number of taps
|
||||
_number_of_taps = (_input_cycles_per_second + _output_cycles_per_second) / _output_cycles_per_second;
|
||||
_number_of_taps *= 2;
|
||||
_number_of_taps |= 1;
|
||||
|
||||
_coefficients_are_dirty = false;
|
||||
_buffer_in_progress_pointer = 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user