1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-11 04:28:58 +00:00

Attemted further to diminish jumpiness.

This commit is contained in:
Thomas Harte 2016-03-22 22:07:30 -04:00
parent 8cd5d40e00
commit 3ca58b2a57
3 changed files with 9 additions and 13 deletions

View File

@ -82,15 +82,12 @@ unsigned int Machine::perform_bus_operation(CPU6502::BusOperation operation, uin
} }
else else
{ {
// If we're still before the display will start to be painted, or the address is if(
// less than both the current line address and 0x3000, (the minimum screen mode (
// base address) then there's no way this write can affect the current frame. Sp ((_frameCycles >= first_graphics_line * cycles_per_line) && (_frameCycles < (first_graphics_line + 256) * cycles_per_line)) ||
// no need to flush the display. Otherwise, output up until now so that any ((_frameCycles >= (first_graphics_line + field_divider_line) * cycles_per_line) && (_frameCycles < (first_graphics_line + 256 + field_divider_line) * cycles_per_line))
// write doesn't have retroactive effect on the video output. )
// if(!( )
// (_fieldCycles < first_graphics_line * cycles_per_line) ||
// (address < _startLineAddress && address < 0x3000)
// ))
update_display(); update_display();
_ram[address] = *value; _ram[address] = *value;
@ -101,7 +98,6 @@ unsigned int Machine::perform_bus_operation(CPU6502::BusOperation operation, uin
cycles += 1 + (_frameCycles&1); cycles += 1 + (_frameCycles&1);
if(_screen_mode < 4) if(_screen_mode < 4)
{ {
update_display();
const int current_line = graphics_line(_frameCycles + (_frameCycles&1)); const int current_line = graphics_line(_frameCycles + (_frameCycles&1));
const int current_column = graphics_column(_frameCycles + (_frameCycles&1)); const int current_column = graphics_column(_frameCycles + (_frameCycles&1));
if(current_line < 256 && current_column < 80 && !_isBlankLine) if(current_line < 256 && current_column < 80 && !_isBlankLine)

View File

@ -48,7 +48,7 @@ const GLsizeiptr InputVertexBufferDataSize = 262080; // a multiple of 6 * Output
// Runs are divided discretely by vertical syncs in order to put a usable bounds on the uniform used to track // Runs are divided discretely by vertical syncs in order to put a usable bounds on the uniform used to track
// run age; that therefore creates a discrete number of fields that are stored. This number should be the // run age; that therefore creates a discrete number of fields that are stored. This number should be the
// number of historic fields that are required fully to // number of historic fields that are required fully to
const int NumberOfFields = 3; const int NumberOfFields = 4;
} }
} }

View File

@ -358,7 +358,7 @@ char *OpenGLOutputBuilder::get_output_vertex_shader()
"srcCoordinatesVarying = vec2(srcCoordinates.x / textureSize.x, (srcCoordinates.y + 0.5) / textureSize.y);" "srcCoordinatesVarying = vec2(srcCoordinates.x / textureSize.x, (srcCoordinates.y + 0.5) / textureSize.y);"
"float age = (timestampBase - timestamp) / ticksPerFrame;" "float age = (timestampBase - timestamp) / ticksPerFrame;"
"vec3 alphas = vec3(10.0 * exp((-age - 0.66) * 2.0), 10.0 * exp(-(age - 0.33) * 2.0), 10.0 * exp(-age * 2.0));" "vec3 alphas = vec3(10.0 * exp((-age - 1.33) * 2.0), 10.0 * exp(-(age - 0.66) * 2.0), 10.0 * exp(-age * 2.0));"
// "alpha = min(10.0 * exp(-age * 2.0), 1.0);" // "alpha = min(10.0 * exp(-age * 2.0), 1.0);"
"alpha = dot(alphas, filterCoefficients);" "alpha = dot(alphas, filterCoefficients);"
@ -512,7 +512,7 @@ void OpenGLOutputBuilder::prepare_rgb_output_shader()
glUniform1f(ticksPerFrameUniform, (GLfloat)(_cycles_per_line * _height_of_display)); glUniform1f(ticksPerFrameUniform, (GLfloat)(_cycles_per_line * _height_of_display));
glUniform2f(positionConversionUniform, _horizontal_scan_period, _vertical_scan_period / (unsigned int)_vertical_period_divider); glUniform2f(positionConversionUniform, _horizontal_scan_period, _vertical_scan_period / (unsigned int)_vertical_period_divider);
SignalProcessing::FIRFilter filter(3, 3 * 50, 0, 25, SignalProcessing::FIRFilter::DefaultAttenuation); SignalProcessing::FIRFilter filter(3, 6 * 50, 0, 25, SignalProcessing::FIRFilter::DefaultAttenuation);
float coefficients[3]; float coefficients[3];
filter.get_coefficients(coefficients); filter.get_coefficients(coefficients);
glUniform3fv(filterCoefficients, 1, coefficients); glUniform3fv(filterCoefficients, 1, coefficients);