diff --git a/Platform/Apple/tools/jace/src/main/java/jace/core/Video.java b/Platform/Apple/tools/jace/src/main/java/jace/core/Video.java index 215f2683..58afb7f2 100644 --- a/Platform/Apple/tools/jace/src/main/java/jace/core/Video.java +++ b/Platform/Apple/tools/jace/src/main/java/jace/core/Video.java @@ -183,6 +183,7 @@ public abstract class Video extends TimedDevice { } hPeriod = HBLANK; y++; + getCurrentWriter().setCurrentRow(y); if (y >= APPLE_SCREEN_LINES) { if (!isVblank) { y = APPLE_SCREEN_LINES - (TOTAL_LINES - APPLE_SCREEN_LINES); diff --git a/Platform/Apple/tools/jace/src/main/java/jace/core/VideoWriter.java b/Platform/Apple/tools/jace/src/main/java/jace/core/VideoWriter.java index 5b952823..5437c08b 100644 --- a/Platform/Apple/tools/jace/src/main/java/jace/core/VideoWriter.java +++ b/Platform/Apple/tools/jace/src/main/java/jace/core/VideoWriter.java @@ -30,6 +30,11 @@ import javafx.scene.image.WritableImage; */ public abstract class VideoWriter { + int currentRow = -1; + public void setCurrentRow(int y) { + currentRow = y; + } + public abstract void displayByte(WritableImage screen, int xOffset, int y, int yTextOffset, int yGraphicsOffset); // This is used to support composite mixed-mode writers so that we can talk to the writer being used for a scanline @@ -42,12 +47,19 @@ public abstract class VideoWriter { // Very useful for knowing if we should bother drawing changes private final boolean[] dirtyFlags = new boolean[192]; + boolean updatedDuringRaster = false; public void markDirty(int y) { actualWriter().dirtyFlags[y] = true; + if (y == currentRow) { + updatedDuringRaster = true; + } } public void clearDirty(int y) { - actualWriter().dirtyFlags[y] = false; + if (!updatedDuringRaster) { + actualWriter().dirtyFlags[y] = false; + } + updatedDuringRaster = false; } public boolean isRowDirty(int y) {