From d1f0c8e1db0b0c3fdc03c37c3ec8e04c7e3d21b5 Mon Sep 17 00:00:00 2001 From: tudnai Date: Mon, 27 Apr 2020 12:38:07 -0700 Subject: [PATCH] Fix text screen rendering in graphics mode --- A2Mac/ViewController.swift | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/A2Mac/ViewController.swift b/A2Mac/ViewController.swift index 7ef607e..86f8396 100644 --- a/A2Mac/ViewController.swift +++ b/A2Mac/ViewController.swift @@ -408,7 +408,19 @@ class ViewController: NSViewController { } txtArr = txtClear - + + + // render an empty space to eiminate displaying text portion of the screen covered by graphics + for y in 0 ..< fromLines { + if videoMode.col80 == 0 { + txtArr[ y * (textCols + lineEndChars) + textCols ] = "\n" + } + else { + txtArr[ y * (textCols * 2 + lineEndChars) + textCols * 2] = "\n" + } + } + + // render the rest of the text screen for y in fromLines ..< toLines { for x in 0 ..< textCols { let byte = textBufferPointer[ textLineOfs[y] + x ]