1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-01-11 08:30:55 +00:00

Blank lines are back.

This commit is contained in:
Thomas Harte 2016-03-10 22:19:54 -05:00
parent b836d74e18
commit a89225987f
2 changed files with 121 additions and 99 deletions

View File

@ -407,32 +407,52 @@ inline void Machine::update_audio()
inline void Machine::start_pixel_line()
{
_current_pixel_line = (_current_pixel_line+1)&255;
if(!(_current_pixel_line&7))
{
_startLineAddress += ((_screen_mode < 4) ? 80 : 40) * 8 - 8;
}
if(!_current_pixel_line)
{
_startLineAddress = _startScreenAddress;
_current_character_row = 0;
_isBlankLine = false;
}
else
{
bool mode_has_blank_lines = (_screen_mode == 6) || (_screen_mode == 3);
_isBlankLine = (mode_has_blank_lines && ((_current_character_row > 7 && _current_character_row < 10) || (_current_pixel_line > 249)));
if(!_isBlankLine)
{
_startLineAddress++;
if(_current_character_row > 7)
{
_startLineAddress += ((_screen_mode < 4) ? 80 : 40) * 8 - 8;
_current_character_row = 0;
}
}
}
_currentScreenAddress = _startLineAddress;
_current_pixel_column = 0;
if(!_isBlankLine)
{
_crt->allocate_write_area(640);
_currentLine = _crt->get_write_target_for_buffer(0);
}
}
inline void Machine::end_pixel_line()
{
_crt->output_data(640, 1);
if(!_isBlankLine) _crt->output_data(640, 1);
_current_character_row++;
}
inline void Machine::output_pixels(unsigned int number_of_cycles)
{
if(_isBlankLine)
{
_crt->output_blank(number_of_cycles * crt_cycles_multiplier);
}
else
{
while(number_of_cycles--)
{
if(!(_current_pixel_column&1) || _screen_mode < 4)
@ -547,6 +567,7 @@ inline void Machine::output_pixels(unsigned int number_of_cycles)
_current_pixel_column++;
_currentLine += 8;
}
}
}
inline void Machine::update_display()

View File

@ -185,8 +185,9 @@ class Machine: public CPU6502::Processor<Machine>, Tape::Delegate {
// Display generation.
uint16_t _startLineAddress, _currentScreenAddress;
int _current_pixel_line, _current_pixel_column;
int _current_pixel_line, _current_pixel_column, _current_character_row;
uint8_t _last_pixel_byte;
bool _isBlankLine;
// CRT output
uint8_t *_currentLine;