mirror of
https://github.com/TomHarte/CLK.git
synced 2024-12-26 09:29:45 +00:00
Ensured no attempt to write to pixel storage if none was available.
This commit is contained in:
parent
4258401384
commit
734b575d30
@ -104,6 +104,8 @@ void VideoOutput::run_for_cycles(int number_of_cycles)
|
||||
if(_blink_text) inverse_mask ^= (_frame_counter&32) ? 0x77 : 0x00;
|
||||
|
||||
if((control_byte & 0x7f) >= 32)
|
||||
{
|
||||
if(_pixel_target)
|
||||
{
|
||||
uint8_t colours[2] = {
|
||||
(uint8_t)(_paper ^ inverse_mask),
|
||||
@ -114,6 +116,7 @@ void VideoOutput::run_for_cycles(int number_of_cycles)
|
||||
_pixel_target[1] = (colours[(pixels >> 2)&1] & 0x0f) | (colours[(pixels >> 3)&1] & 0xf0);
|
||||
_pixel_target[2] = (colours[(pixels >> 0)&1] & 0x0f) | (colours[(pixels >> 1)&1] & 0xf0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch(control_byte & 0x7f)
|
||||
@ -152,9 +155,9 @@ void VideoOutput::run_for_cycles(int number_of_cycles)
|
||||
|
||||
default: break;
|
||||
}
|
||||
_pixel_target[0] = _pixel_target[1] = _pixel_target[2] = (uint8_t)(_paper ^ inverse_mask);
|
||||
if(_pixel_target) _pixel_target[0] = _pixel_target[1] = _pixel_target[2] = (uint8_t)(_paper ^ inverse_mask);
|
||||
}
|
||||
_pixel_target += 3;
|
||||
if(_pixel_target) _pixel_target += 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user