1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-30 04:50:08 +00:00

Source runs are now captured, and that buffer appropriately reset.

This commit is contained in:
Thomas Harte 2016-04-13 22:20:13 -04:00
parent 2ea02ed127
commit 026ce0255f
3 changed files with 10 additions and 4 deletions

View File

@ -65,7 +65,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::Monitor);
_crt->set_output_device(Outputs::CRT::Television);
_crt->set_visible_area(_crt->get_rect_for_area(first_graphics_line - 3, 256, first_graphics_cycle * crt_cycles_multiplier, 80 * crt_cycles_multiplier, 4.0f / 3.0f));
// The maximum output frequency is 62500Hz and all other permitted output frequencies are integral divisions of that;

View File

@ -248,9 +248,13 @@ void OpenGLOutputBuilder::draw_frame(unsigned int output_width, unsigned int out
// drawing commands having been issued, reclaim the array buffer pointer
glBindBuffer(GL_ARRAY_BUFFER, output_array_buffer);
_output_buffer_data = (uint8_t *)glMapBufferRange(GL_ARRAY_BUFFER, 0, OutputVertexBufferDataSize, GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT);
glBindBuffer(GL_ARRAY_BUFFER, source_array_buffer);
_source_buffer_data = (uint8_t *)glMapBufferRange(GL_ARRAY_BUFFER, 0, SourceVertexBufferDataSize, GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT);
_source_buffer_data_pointer = 0;
_input_texture_data = (uint8_t *)glMapBufferRange(GL_PIXEL_UNPACK_BUFFER, 0, _input_texture_array_size, GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT);
_output_mutex->unlock();
}

View File

@ -106,18 +106,20 @@ class OpenGLOutputBuilder {
inline uint8_t *get_next_source_run()
{
return nullptr;
_output_mutex->lock();
return &_source_buffer_data[_source_buffer_data_pointer];
}
inline void complete_source_run()
{
_source_buffer_data_pointer += 2 * SourceVertexSize;
_output_mutex->unlock();
}
inline uint8_t *get_next_output_run()
{
_output_mutex->lock();
uint8_t *pointer = &_output_buffer_data[_output_buffer_data_pointer];
return pointer;
return &_output_buffer_data[_output_buffer_data_pointer];
}
inline void complete_output_run(size_t vertices_written)