From c981206adf4e8724df7e97c2c8639e4a3e6aff9e Mon Sep 17 00:00:00 2001 From: Astoria Date: Mon, 8 Apr 2024 00:34:00 -0500 Subject: [PATCH] Slight optimizations, more centered center --- .../net/brokenmoon/BasicMonitorDriver.java | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/main/java/net/brokenmoon/BasicMonitorDriver.java b/src/main/java/net/brokenmoon/BasicMonitorDriver.java index 391363b..c1eb6d1 100644 --- a/src/main/java/net/brokenmoon/BasicMonitorDriver.java +++ b/src/main/java/net/brokenmoon/BasicMonitorDriver.java @@ -13,6 +13,7 @@ import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import java.net.URISyntaxException; +import java.util.Arrays; import java.util.Objects; import static com.simon816.j65el02.device.RPMonitor.HEIGHT; @@ -21,15 +22,12 @@ import static com.simon816.j65el02.device.RPMonitor.WIDTH; public class BasicMonitorDriver implements MonitorDriver, KeyListener { BufferedImage display; - final int width = 8; - final int height = 8; - int rows = 16; - int cols = 16; JLabel[] lines = new JLabel[HEIGHT]; Machine emu; + byte[][] windowDataOld = new byte[HEIGHT][WIDTH]; - int xoffset = 32; - int yoffset = 27; + int xoffset = 30; + int yoffset = 26; public BasicMonitorDriver(Machine emu) { this.emu = emu; try{ @@ -102,11 +100,14 @@ public class BasicMonitorDriver implements MonitorDriver, KeyListener { public void update(byte[][] windowData) { for(int y = windowData.length - 1; y >= 0; y--){ String text = ""; - for(int x = 0; x