1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-24 12:30:17 +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
{
// If we're still before the display will start to be painted, or the address is
// 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
// no need to flush the display. Otherwise, output up until now so that any
// write doesn't have retroactive effect on the video output.
// if(!(
// (_fieldCycles < first_graphics_line * cycles_per_line) ||
// (address < _startLineAddress && address < 0x3000)
// ))
if(
(
((_frameCycles >= first_graphics_line * cycles_per_line) && (_frameCycles < (first_graphics_line + 256) * cycles_per_line)) ||
((_frameCycles >= (first_graphics_line + field_divider_line) * cycles_per_line) && (_frameCycles < (first_graphics_line + 256 + field_divider_line) * cycles_per_line))
)
)
update_display();
_ram[address] = *value;
@ -101,7 +98,6 @@ unsigned int Machine::perform_bus_operation(CPU6502::BusOperation operation, uin
cycles += 1 + (_frameCycles&1);
if(_screen_mode < 4)
{
update_display();
const int current_line = graphics_line(_frameCycles + (_frameCycles&1));
const int current_column = graphics_column(_frameCycles + (_frameCycles&1));
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
// 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
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);"
"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 = dot(alphas, filterCoefficients);"
@ -512,7 +512,7 @@ void OpenGLOutputBuilder::prepare_rgb_output_shader()
glUniform1f(ticksPerFrameUniform, (GLfloat)(_cycles_per_line * _height_of_display));
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];
filter.get_coefficients(coefficients);
glUniform3fv(filterCoefficients, 1, coefficients);