mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-18 16:30:29 +00:00
Takes a stab at double low-res graphics.
This commit is contained in:
parent
a36f37d240
commit
c91eaaf8da
@ -159,7 +159,7 @@ class VideoBase {
|
|||||||
// State affecting logical state.
|
// State affecting logical state.
|
||||||
int row_ = 0, column_ = 0, flash_ = 0;
|
int row_ = 0, column_ = 0, flash_ = 0;
|
||||||
|
|
||||||
// An
|
// Enumerates all Apple II and IIe display modes.
|
||||||
enum class GraphicsMode {
|
enum class GraphicsMode {
|
||||||
LowRes,
|
LowRes,
|
||||||
DoubleLowRes,
|
DoubleLowRes,
|
||||||
@ -324,7 +324,38 @@ template <class BusHandler> class Video: public VideoBase {
|
|||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case GraphicsMode::DoubleLowRes:
|
case GraphicsMode::DoubleLowRes: {
|
||||||
|
const int row_shift = (row_&4);
|
||||||
|
for(int c = column_; c < pixel_end; ++c) {
|
||||||
|
const uint16_t nibble = (bus_handler_.perform_aux_read(static_cast<uint16_t>(text_address + c)) >> row_shift) & 0xf0f;
|
||||||
|
|
||||||
|
if(c&1) {
|
||||||
|
pixel_pointer_[0] = pixel_pointer_[4] = (nibble >> 8) & 4;
|
||||||
|
pixel_pointer_[1] = pixel_pointer_[5] = (nibble >> 8) & 8;
|
||||||
|
pixel_pointer_[2] = pixel_pointer_[6] = (nibble >> 8) & 1;
|
||||||
|
pixel_pointer_[3] = (nibble >> 8) & 2;
|
||||||
|
|
||||||
|
pixel_pointer_[8] = pixel_pointer_[12] = nibble & 4;
|
||||||
|
pixel_pointer_[9] = pixel_pointer_[13] = nibble & 8;
|
||||||
|
pixel_pointer_[10] = nibble & 1;
|
||||||
|
pixel_pointer_[7] = pixel_pointer_[11] = nibble & 2;
|
||||||
|
graphics_carry_ = nibble & 8;
|
||||||
|
} else {
|
||||||
|
pixel_pointer_[0] = pixel_pointer_[4] = (nibble >> 8) & 1;
|
||||||
|
pixel_pointer_[1] = pixel_pointer_[5] = (nibble >> 8) & 2;
|
||||||
|
pixel_pointer_[2] = pixel_pointer_[6] = (nibble >> 8) & 4;
|
||||||
|
pixel_pointer_[3] = (nibble >> 8) & 8;
|
||||||
|
|
||||||
|
pixel_pointer_[8] = pixel_pointer_[12] = nibble & 1;
|
||||||
|
pixel_pointer_[9] = pixel_pointer_[13] = nibble & 2;
|
||||||
|
pixel_pointer_[10] = nibble & 4;
|
||||||
|
pixel_pointer_[7] = pixel_pointer_[11] = nibble & 8;
|
||||||
|
graphics_carry_ = nibble & 2;
|
||||||
|
}
|
||||||
|
pixel_pointer_ += 14;
|
||||||
|
}
|
||||||
|
} break;
|
||||||
|
|
||||||
case GraphicsMode::LowRes: {
|
case GraphicsMode::LowRes: {
|
||||||
const int row_shift = (row_&4);
|
const int row_shift = (row_&4);
|
||||||
// TODO: decompose into two loops, possibly.
|
// TODO: decompose into two loops, possibly.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user