1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-25 18:30:07 +00:00

Attempt to enable high-speed fill.

This commit is contained in:
Thomas Harte 2023-02-01 22:57:33 -05:00
parent 8f5c7fcabc
commit 5d4c49c913
2 changed files with 5 additions and 6 deletions

View File

@ -42,7 +42,7 @@ enum class ScreenMode {
constexpr int pixels_per_byte(ScreenMode mode) {
switch(mode) {
default:
case ScreenMode::Blank: return 0;
case ScreenMode::Blank: return 1;
case ScreenMode::Text: return 6;
case ScreenMode::MultiColour: return 2;
case ScreenMode::ColouredText: return 8;

View File

@ -22,7 +22,7 @@ struct Vector {
template <int offset, bool high> void set(uint8_t value) {
constexpr uint8_t mask = high ? (offset ? 0x3 : 0x1) : 0xff;
constexpr int shift = high ? 8 : 0;
v[offset] = (v[offset] & ~(mask << shift)) | (value << shift);
v[offset] = (v[offset] & ~(mask << shift)) | ((value & mask) << shift);
}
template <int offset> void add(int amount) {
@ -258,17 +258,16 @@ struct HighSpeedFill: public Command {
}
bool done() final {
return true;
return !context.size.v[1] || !width_;
}
void advance(int pixels_per_byte) final {
cycles = 48;
// TODO: step at byte speed, not pixel speed.
advance_axis<0>(pixels_per_byte);
--context.size.v[0];
context.size.v[0] -= pixels_per_byte;
if(!context.size.v[0]) {
if(!(context.size.v[0] & ~(pixels_per_byte - 1))) {
cycles += 56;
context.size.v[0] = width_;
context.destination.v[0] = start_x_;