mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-26 08:49:37 +00:00
Adds support for fill mode.
This commit is contained in:
parent
8ace258fbc
commit
46f7ff07f7
@ -235,6 +235,11 @@ void VideoBase::output_row(int row, int start, int end) {
|
|||||||
set_interrupts(0x20);
|
set_interrupts(0x20);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set up appropriately for fill mode (or not).
|
||||||
|
for(int c = 0; c < 4; c++) {
|
||||||
|
palette_zero_[c] = (line_control_ & 0x20) ? &palette_[c * 4] : &palette_throwaway_;
|
||||||
|
}
|
||||||
|
|
||||||
// Reset NTSC decoding and total line buffering.
|
// Reset NTSC decoding and total line buffering.
|
||||||
ntsc_delay_ = 4;
|
ntsc_delay_ = 4;
|
||||||
pixels_start_column_ = start;
|
pixels_start_column_ = start;
|
||||||
@ -431,21 +436,22 @@ uint16_t *VideoBase::output_double_text(uint16_t *target, int start, int end, in
|
|||||||
uint16_t *VideoBase::output_super_high_res(uint16_t *target, int start, int end, int row) const {
|
uint16_t *VideoBase::output_super_high_res(uint16_t *target, int start, int end, int row) const {
|
||||||
const int row_address = row * 160 + 0x12000;
|
const int row_address = row * 160 + 0x12000;
|
||||||
|
|
||||||
// TODO: line_control_ & 0x20 should enable or disable colour fill mode.
|
// The palette_zero_ writes ensure that palette colour 0 is replaced by whatever was last output,
|
||||||
|
// if fill mode is enabled. Otherwise they go to throwaway storage.
|
||||||
if(line_control_ & 0x80) {
|
if(line_control_ & 0x80) {
|
||||||
for(int c = start * 4; c < end * 4; c++) {
|
for(int c = start * 4; c < end * 4; c++) {
|
||||||
const uint8_t source = ram_[row_address + c];
|
const uint8_t source = ram_[row_address + c];
|
||||||
target[0] = palette_[0x8 + ((source >> 6) & 0x3)];
|
*palette_zero_[3] = target[0] = palette_[0x8 + ((source >> 6) & 0x3)];
|
||||||
target[1] = palette_[0xc + ((source >> 4) & 0x3)];
|
*palette_zero_[0] = target[1] = palette_[0xc + ((source >> 4) & 0x3)];
|
||||||
target[2] = palette_[0x0 + ((source >> 2) & 0x3)];
|
*palette_zero_[1] = target[2] = palette_[0x0 + ((source >> 2) & 0x3)];
|
||||||
target[3] = palette_[0x4 + ((source >> 0) & 0x3)];
|
*palette_zero_[2] = target[3] = palette_[0x4 + ((source >> 0) & 0x3)];
|
||||||
target += 4;
|
target += 4;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for(int c = start * 4; c < end * 4; c++) {
|
for(int c = start * 4; c < end * 4; c++) {
|
||||||
const uint8_t source = ram_[row_address + c];
|
const uint8_t source = ram_[row_address + c];
|
||||||
target[0] = palette_[(source >> 4) & 0xf];
|
*palette_zero_[0] = target[0] = palette_[(source >> 4) & 0xf];
|
||||||
target[1] = palette_[source & 0xf];
|
*palette_zero_[0] = target[1] = palette_[source & 0xf];
|
||||||
target += 2;
|
target += 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -144,6 +144,9 @@ class VideoBase: public Apple::II::VideoSwitches<Cycles> {
|
|||||||
uint8_t line_control_;
|
uint8_t line_control_;
|
||||||
uint16_t palette_[16];
|
uint16_t palette_[16];
|
||||||
|
|
||||||
|
// Storage used for fill mode.
|
||||||
|
uint16_t *palette_zero_[4] = {nullptr, nullptr, nullptr, nullptr}, palette_throwaway_;
|
||||||
|
|
||||||
// Lookup tables and state to assist in the IIgs' mapping from NTSC to RGB.
|
// Lookup tables and state to assist in the IIgs' mapping from NTSC to RGB.
|
||||||
//
|
//
|
||||||
// My understanding of the real-life algorithm is: maintain a four-bit buffer.
|
// My understanding of the real-life algorithm is: maintain a four-bit buffer.
|
||||||
|
Loading…
Reference in New Issue
Block a user