1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-18 13:29:41 +00:00

Reintroduced a console examination of the output runs being received after fixing a failure to complete or restart frames over in the CRT; weirdly it seems that sync is being obeyed but raster position is off. So work to do.

This commit is contained in:
Thomas Harte 2015-07-22 20:45:10 -04:00
parent 065050115f
commit 5203f31bf4
2 changed files with 30 additions and 26 deletions

View File

@ -12,33 +12,35 @@
class Atari2600CRTDelegate: public Outputs::CRT::CRTDelegate {
void crt_did_end_frame(Outputs::CRT *crt, Outputs::CRTFrame *frame)
{
// printf("===\n\n");
// for(int run = 0; run < runs_to_draw; run++)
// {
// char character = ' ';
// switch(runs[run].type)
// {
// case Outputs::CRTRun::Type::Sync: character = '<'; break;
// case Outputs::CRTRun::Type::Level: character = '_'; break;
// case Outputs::CRTRun::Type::Data: character = '-'; break;
// case Outputs::CRTRun::Type::Blank: character = ' '; break;
// }
//
// if(runs[run].start_point.dst_x > runs[run].end_point.dst_x)
// {
// printf("\n");
// }
//
// float length = fabsf(runs[run].end_point.dst_x - runs[run].start_point.dst_x);
// int iLength = (int)(length * 64.0);
// for(int c = 0; c < iLength; c++)
// {
// putc(character, stdout);
// }
//
// if (runs[run].type == Outputs::CRTRun::Type::Sync) printf("\n");
// }
printf("\n\n===\n\n");
int c = 0;
for(int run = 0; run < frame->number_of_runs; run++)
{
char character = ' ';
switch(frame->runs[run].type)
{
case Outputs::CRTRun::Type::Sync: character = '<'; break;
case Outputs::CRTRun::Type::Level: character = '_'; break;
case Outputs::CRTRun::Type::Data: character = '-'; break;
case Outputs::CRTRun::Type::Blank: character = ' '; break;
}
if(frame->runs[run].start_point.dst_x < 1.0 / 224.0)
{
printf("\n[%0.2f]: ", frame->runs[run].start_point.dst_y);
c++;
}
printf("(%0.2f): ", frame->runs[run].start_point.dst_x);
float length = fabsf(frame->runs[run].end_point.dst_x - frame->runs[run].start_point.dst_x);
int iLength = (int)(length * 64.0);
for(int c = 0; c < iLength; c++)
{
putc(character, stdout);
}
}
printf("\n\n[%d]\n\n", c);
crt->return_frame();
}

View File

@ -235,6 +235,7 @@ void CRT::advance_cycles(int number_of_cycles, bool hsync_requested, const bool
case SyncEvent::EndVSync:
if(_delegate && _current_frame)
{
_current_frame->complete();
_frames_with_delegate++;
_delegate->crt_did_end_frame(this, _current_frame);
}
@ -243,6 +244,7 @@ void CRT::advance_cycles(int number_of_cycles, bool hsync_requested, const bool
{
_frame_read_pointer = (_frame_read_pointer + 1)%kCRTNumberOfFrames;
_current_frame = _frames[_frame_read_pointer];
_current_frame->reset();
}
else
_current_frame = nullptr;