mirror of
https://github.com/TomHarte/CLK.git
synced 2025-08-15 14:27:29 +00:00
Ensures no writes to pixel_pointer_
when allocation has failed.
This commit is contained in:
@@ -394,7 +394,6 @@ template <class BusHandler, bool is_iie> class Video: public VideoBase {
|
|||||||
static_cast<size_t>(fetch_end - column_),
|
static_cast<size_t>(fetch_end - column_),
|
||||||
&base_stream_[static_cast<size_t>(column_)],
|
&base_stream_[static_cast<size_t>(column_)],
|
||||||
&auxiliary_stream_[static_cast<size_t>(column_)]);
|
&auxiliary_stream_[static_cast<size_t>(column_)]);
|
||||||
// TODO: should character modes be mapped to character pixel outputs here?
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(row_ < 192) {
|
if(row_ < 192) {
|
||||||
@@ -413,7 +412,7 @@ template <class BusHandler, bool is_iie> class Video: public VideoBase {
|
|||||||
const int pixel_row = row_ & 7;
|
const int pixel_row = row_ & 7;
|
||||||
|
|
||||||
const bool is_double = Video::is_double_mode(line_mode);
|
const bool is_double = Video::is_double_mode(line_mode);
|
||||||
if(!is_double && was_double_) {
|
if(!is_double && was_double_ && pixel_pointer_) {
|
||||||
pixel_pointer_[pixel_start*14 + 0] =
|
pixel_pointer_[pixel_start*14 + 0] =
|
||||||
pixel_pointer_[pixel_start*14 + 1] =
|
pixel_pointer_[pixel_start*14 + 1] =
|
||||||
pixel_pointer_[pixel_start*14 + 2] =
|
pixel_pointer_[pixel_start*14 + 2] =
|
||||||
@@ -424,79 +423,83 @@ template <class BusHandler, bool is_iie> class Video: public VideoBase {
|
|||||||
}
|
}
|
||||||
was_double_ = is_double;
|
was_double_ = is_double;
|
||||||
|
|
||||||
switch(line_mode) {
|
if(pixel_pointer_) {
|
||||||
case GraphicsMode::Text:
|
switch(line_mode) {
|
||||||
output_text(
|
case GraphicsMode::Text:
|
||||||
&pixel_pointer_[pixel_start * 14 + 7],
|
output_text(
|
||||||
&base_stream_[static_cast<size_t>(pixel_start)],
|
&pixel_pointer_[pixel_start * 14 + 7],
|
||||||
static_cast<size_t>(pixel_end - pixel_start),
|
&base_stream_[static_cast<size_t>(pixel_start)],
|
||||||
static_cast<size_t>(pixel_row));
|
static_cast<size_t>(pixel_end - pixel_start),
|
||||||
break;
|
static_cast<size_t>(pixel_row));
|
||||||
|
break;
|
||||||
|
|
||||||
case GraphicsMode::DoubleText:
|
case GraphicsMode::DoubleText:
|
||||||
output_double_text(
|
output_double_text(
|
||||||
&pixel_pointer_[pixel_start * 14],
|
&pixel_pointer_[pixel_start * 14],
|
||||||
&base_stream_[static_cast<size_t>(pixel_start)],
|
&base_stream_[static_cast<size_t>(pixel_start)],
|
||||||
&auxiliary_stream_[static_cast<size_t>(pixel_start)],
|
&auxiliary_stream_[static_cast<size_t>(pixel_start)],
|
||||||
static_cast<size_t>(pixel_end - pixel_start),
|
static_cast<size_t>(pixel_end - pixel_start),
|
||||||
static_cast<size_t>(pixel_row));
|
static_cast<size_t>(pixel_row));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GraphicsMode::LowRes:
|
case GraphicsMode::LowRes:
|
||||||
output_low_resolution(
|
output_low_resolution(
|
||||||
&pixel_pointer_[pixel_start * 14 + 7],
|
&pixel_pointer_[pixel_start * 14 + 7],
|
||||||
&base_stream_[static_cast<size_t>(pixel_start)],
|
&base_stream_[static_cast<size_t>(pixel_start)],
|
||||||
static_cast<size_t>(pixel_end - pixel_start),
|
static_cast<size_t>(pixel_end - pixel_start),
|
||||||
pixel_start,
|
pixel_start,
|
||||||
pixel_row);
|
pixel_row);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GraphicsMode::FatLowRes:
|
case GraphicsMode::FatLowRes:
|
||||||
output_fat_low_resolution(
|
output_fat_low_resolution(
|
||||||
&pixel_pointer_[pixel_start * 14 + 7],
|
&pixel_pointer_[pixel_start * 14 + 7],
|
||||||
&base_stream_[static_cast<size_t>(pixel_start)],
|
&base_stream_[static_cast<size_t>(pixel_start)],
|
||||||
static_cast<size_t>(pixel_end - pixel_start),
|
static_cast<size_t>(pixel_end - pixel_start),
|
||||||
pixel_start,
|
pixel_start,
|
||||||
pixel_row);
|
pixel_row);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GraphicsMode::DoubleLowRes:
|
case GraphicsMode::DoubleLowRes:
|
||||||
output_double_low_resolution(
|
output_double_low_resolution(
|
||||||
&pixel_pointer_[pixel_start * 14],
|
&pixel_pointer_[pixel_start * 14],
|
||||||
&base_stream_[static_cast<size_t>(pixel_start)],
|
&base_stream_[static_cast<size_t>(pixel_start)],
|
||||||
&auxiliary_stream_[static_cast<size_t>(pixel_start)],
|
&auxiliary_stream_[static_cast<size_t>(pixel_start)],
|
||||||
static_cast<size_t>(pixel_end - pixel_start),
|
static_cast<size_t>(pixel_end - pixel_start),
|
||||||
pixel_start,
|
pixel_start,
|
||||||
pixel_row);
|
pixel_row);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GraphicsMode::HighRes:
|
case GraphicsMode::HighRes:
|
||||||
output_high_resolution(
|
output_high_resolution(
|
||||||
&pixel_pointer_[pixel_start * 14 + 7],
|
&pixel_pointer_[pixel_start * 14 + 7],
|
||||||
&base_stream_[static_cast<size_t>(pixel_start)],
|
&base_stream_[static_cast<size_t>(pixel_start)],
|
||||||
static_cast<size_t>(pixel_end - pixel_start));
|
static_cast<size_t>(pixel_end - pixel_start));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GraphicsMode::DoubleHighRes:
|
case GraphicsMode::DoubleHighRes:
|
||||||
output_double_high_resolution(
|
output_double_high_resolution(
|
||||||
&pixel_pointer_[pixel_start * 14],
|
&pixel_pointer_[pixel_start * 14],
|
||||||
&base_stream_[static_cast<size_t>(pixel_start)],
|
&base_stream_[static_cast<size_t>(pixel_start)],
|
||||||
&auxiliary_stream_[static_cast<size_t>(pixel_start)],
|
&auxiliary_stream_[static_cast<size_t>(pixel_start)],
|
||||||
static_cast<size_t>(pixel_end - pixel_start));
|
static_cast<size_t>(pixel_end - pixel_start));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: break;
|
default: break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pixel_end == 40) {
|
if(pixel_end == 40) {
|
||||||
if(was_double_) {
|
if(pixel_pointer_) {
|
||||||
pixel_pointer_[560] = pixel_pointer_[561] = pixel_pointer_[562] = pixel_pointer_[563] =
|
if(was_double_) {
|
||||||
pixel_pointer_[564] = pixel_pointer_[565] = pixel_pointer_[566] = pixel_pointer_[567] = 0;
|
pixel_pointer_[560] = pixel_pointer_[561] = pixel_pointer_[562] = pixel_pointer_[563] =
|
||||||
} else {
|
pixel_pointer_[564] = pixel_pointer_[565] = pixel_pointer_[566] = pixel_pointer_[567] = 0;
|
||||||
if(line_mode == GraphicsMode::HighRes && base_stream_[39]&0x80)
|
} else {
|
||||||
pixel_pointer_[567] = graphics_carry_;
|
if(line_mode == GraphicsMode::HighRes && base_stream_[39]&0x80)
|
||||||
else
|
pixel_pointer_[567] = graphics_carry_;
|
||||||
pixel_pointer_[567] = 0;
|
else
|
||||||
|
pixel_pointer_[567] = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
crt_.output_data(568, 568);
|
crt_.output_data(568, 568);
|
||||||
|
Reference in New Issue
Block a user