mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-29 12:50:28 +00:00
Hacks in double text.
Actually, only one error: it should start half a column earlier. All 'double' output should. TODO.
This commit is contained in:
parent
98347cb1c3
commit
8f4597f742
@ -225,10 +225,20 @@ void VideoBase::output_row(int row, int start, int end) {
|
||||
if(new_video_ & 0x80) {
|
||||
next_pixel_ = output_super_high_res(next_pixel_, window_start, window_end, row);
|
||||
} else {
|
||||
switch(graphics_mode(row)) {
|
||||
case Apple::II::GraphicsMode::Text:
|
||||
next_pixel_ = output_text(next_pixel_, window_start, window_end, row);
|
||||
break;
|
||||
case Apple::II::GraphicsMode::DoubleText:
|
||||
next_pixel_ = output_double_text(next_pixel_, window_start, window_end, row);
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(false);
|
||||
}
|
||||
|
||||
// TODO: support modes other than 40-column text.
|
||||
if(graphics_mode(row) != Apple::II::GraphicsMode::Text) printf("Outputting incorrect graphics mode!\n");
|
||||
// if(graphics_mode(row) != Apple::II::GraphicsMode::Text) printf("Outputting incorrect graphics mode!\n");
|
||||
}
|
||||
}
|
||||
|
||||
@ -335,10 +345,7 @@ bool VideoBase::get_composite_is_colour() {
|
||||
|
||||
// MARK: - Outputters.
|
||||
|
||||
uint16_t *VideoBase::output_text(uint16_t *target, int start, int end, int row) const {
|
||||
const uint16_t row_address = get_row_address(row);
|
||||
for(int c = start; c < end; c++) {
|
||||
const uint8_t source = ram_[row_address + c];
|
||||
forceinline uint16_t *VideoBase::output_char(uint16_t *target, uint8_t source, int row) const {
|
||||
const int character = source & character_zones_[source >> 6].address_mask;
|
||||
const uint8_t xor_mask = character_zones_[source >> 6].xor_mask;
|
||||
const std::size_t character_address = size_t(character << 3) + (row & 7);
|
||||
@ -352,7 +359,23 @@ uint16_t *VideoBase::output_text(uint16_t *target, int start, int end, int row)
|
||||
target[4] = colours[(character_pattern & 0x04) >> 2];
|
||||
target[5] = colours[(character_pattern & 0x02) >> 1];
|
||||
target[6] = colours[(character_pattern & 0x01) >> 0];
|
||||
target += 7;
|
||||
return target + 7;
|
||||
}
|
||||
|
||||
uint16_t *VideoBase::output_text(uint16_t *target, int start, int end, int row) const {
|
||||
const uint16_t row_address = get_row_address(row);
|
||||
for(int c = start; c < end; c++) {
|
||||
target = output_char(target, ram_[row_address + c], row);
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
uint16_t *VideoBase::output_double_text(uint16_t *target, int start, int end, int row) const {
|
||||
const uint16_t row_address = get_row_address(row);
|
||||
for(int c = start; c < end; c++) {
|
||||
target = output_char(target, ram_[0x10000 + row_address + c], row);
|
||||
target = output_char(target, ram_[row_address + c], row);
|
||||
}
|
||||
|
||||
return target;
|
||||
|
@ -82,7 +82,10 @@ class VideoBase: public Apple::II::VideoSwitches<Cycles> {
|
||||
void output_row(int row, int start, int end);
|
||||
|
||||
uint16_t *output_super_high_res(uint16_t *target, int start, int end, int row) const;
|
||||
|
||||
uint16_t *output_text(uint16_t *target, int start, int end, int row) const;
|
||||
uint16_t *output_double_text(uint16_t *target, int start, int end, int row) const;
|
||||
forceinline uint16_t *output_char(uint16_t *target, uint8_t source, int row) const;
|
||||
|
||||
// Super high-res per-line state.
|
||||
uint8_t line_control_;
|
||||
|
Loading…
Reference in New Issue
Block a user