From c261f0f10375531c0ae2a3073e8d071b5ef5df76 Mon Sep 17 00:00:00 2001 From: Brendan Robert Date: Sun, 3 Jan 2016 16:44:09 -0600 Subject: [PATCH] Cleared up funky behavior on lo-res graphics, and some improvement on rendering for Crazy Cycles demo --- src/main/java/jace/apple2e/VideoNTSC.java | 10 ++++++---- src/main/java/jace/core/Video.java | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/jace/apple2e/VideoNTSC.java b/src/main/java/jace/apple2e/VideoNTSC.java index a806c9d..75622c7 100644 --- a/src/main/java/jace/apple2e/VideoNTSC.java +++ b/src/main/java/jace/apple2e/VideoNTSC.java @@ -90,22 +90,24 @@ public class VideoNTSC extends VideoDHGR { @Override protected void displayLores(WritableImage screen, int xOffset, int y, int rowAddress) { + int data = ((RAM128k) computer.getMemory()).getMainMemory().readByte(rowAddress + xOffset) & 0x0FF; int pos = xOffset >> 1; if (rowStart < 0) { rowStart = pos; } - colorActive[xOffset * 2] = colorActive[xOffset * 2 + 1] = true; - int data = ((RAM128k) computer.getMemory()).getMainMemory().readByte(rowAddress + xOffset) & 0x0FF; + colorActive[xOffset * 2] = true; + colorActive[xOffset * 2 + 1] = true; if ((xOffset & 1) == 0) { + int pat = scanline[pos] & 0x0fffc000; if ((y & 7) < 4) { data &= 15; } else { data >>= 4; } - int pat = data | data << 4 | data << 8 | (data & 3) << 12; + pat |= data | data << 4 | data << 8 | (data & 3) << 12; scanline[pos] = pat; } else { - int pat = scanline[pos]; + int pat = scanline[pos] & 0x03fff; if ((y & 7) < 4) { data &= 15; } else { diff --git a/src/main/java/jace/core/Video.java b/src/main/java/jace/core/Video.java index f291044..19c6912 100644 --- a/src/main/java/jace/core/Video.java +++ b/src/main/java/jace/core/Video.java @@ -164,7 +164,7 @@ public abstract class Video extends Device { x = -1; } } else { - if (!isVblank && x < (APPLE_CYCLES_PER_LINE-1)) { + if (!isVblank && x < APPLE_CYCLES_PER_LINE) { draw(); } if (x >= APPLE_CYCLES_PER_LINE - 1) {