diff --git a/A2Mac/Base.lproj/Main.storyboard b/A2Mac/Base.lproj/Main.storyboard
index ef8419e..6edec36 100644
--- a/A2Mac/Base.lproj/Main.storyboard
+++ b/A2Mac/Base.lproj/Main.storyboard
@@ -1388,13 +1388,13 @@
-
+
-
+
-
diff --git a/A2Mac/HiRes.swift b/A2Mac/HiRes.swift
index 5907458..4156714 100644
--- a/A2Mac/HiRes.swift
+++ b/A2Mac/HiRes.swift
@@ -167,6 +167,9 @@ class HiRes: NSView {
let color_turquis : UInt32 = 0xFF11BBBB;
let color_yellow : UInt32 = 0xFFBBBB11;
+ // default is green
+ var monoColor : UInt32 = 0xFF2BD84A;
+
func refreshChanged( blockSize : Int ) {
// refresh changed block only
@@ -193,14 +196,37 @@ class HiRes: NSView {
}
- func UpdateMono() {
- blockChanged = [Bool](repeating: false, count: HiRes.blockRows * HiRes.blockCols)
+ func RenderMono() {
+ var height = HiRes.PixelHeight
+
+ // do not even render it...
+ if videoMode.text == 1 {
+ return
+ }
+ else {
+ if videoMode.mixed == 1 {
+ height = HiRes.MixedHeight
+ }
+ if MEMcfg.txt_page_2 == 1 {
+ HiResBufferPointer = HiResBuffer2
+ }
+ else {
+ HiResBufferPointer = HiResBuffer1
+ }
+ }
var pixelAddr = 0
var y = 0
+ blockChanged = [Bool](repeating: false, count: HiRes.blockRows * HiRes.blockCols)
+
for lineAddr in HiResLineAddrTbl {
+ if ( height <= 0 ) {
+ break
+ }
+ height -= 1
+
let blockVertIdx = y / HiRes.blockHeight * HiRes.blockCols
for blockHorIdx in 0..> 5 ) & 0x04
- let block = ( blockL << 7 ) | ( blockH & 0x7F ) & 0x3FFF
- let block8 = ( blockL << 8 ) | blockH
+ let block = ( ( blockL & 0x7F ) << 7 ) | ( blockH & 0x7F )
+ let block14 = ( blockL << 8 ) | blockH
let screenIdx = y * HiRes.blockCols + blockHorIdx
// get all changed blocks
- blockChanged[ blockVertIdx + blockHorIdx ] = blockChanged[ blockVertIdx + blockHorIdx ] || shadowScreen[ screenIdx ] != block8
- shadowScreen[ screenIdx ] = block8
+ blockChanged[ blockVertIdx + blockHorIdx ] = blockChanged[ blockVertIdx + blockHorIdx ] || shadowScreen[ screenIdx ] != block14
+ shadowScreen[ screenIdx ] = block14
for px in 0 ... 2 {
// let bitMask = 3 << ( px * 2 )
@@ -408,19 +434,19 @@ class HiRes: NSView {
}
-
- func Update() {
+
+ func Render() {
if ( ViewController.current?.ColorMonitor ?? true ) {
- UpdateColor()
+ RenderColor()
}
else {
- UpdateMono()
+ RenderMono()
}
}
-
- func fullUpdate() {
+
+ func RenderFullScreen() {
needsDisplay = true
- Update()
+ Render()
}
diff --git a/A2Mac/LoRes.swift b/A2Mac/LoRes.swift
index d54a956..5762027 100644
--- a/A2Mac/LoRes.swift
+++ b/A2Mac/LoRes.swift
@@ -323,7 +323,7 @@ class LoRes: NSView {
}
- func Update() {
+ func Render() {
var height = LoRes.PixelHeight / 2
// do not even render it...
diff --git a/A2Mac/ViewController.swift b/A2Mac/ViewController.swift
index fadbd2e..ea7cba2 100644
--- a/A2Mac/ViewController.swift
+++ b/A2Mac/ViewController.swift
@@ -22,6 +22,12 @@ let GB : Double = (MB * KB)
let TB : Double = (GB * KB)
+let colorWhite = NSColor.init( red:0.9296875, green:0.9296875, blue:0.9296875, alpha: 1 )
+let colorGreen = NSColor.init( red:0.16796875, green:0.84375, blue:0.2890625, alpha: 1 )
+let colorOrange = NSColor.init( red:1, green:0.38671875, blue:0.0078125, alpha: 1 )
+
+var monoColor = colorGreen;
+
var spk_up: AVAudioPlayer?
var spk_dn: AVAudioPlayer?
@@ -543,11 +549,9 @@ class ViewController: NSViewController {
frameCnt += 1
if ( frameCnt == fpsHalf ) {
- // flashingSpace = blockChar
ViewController.charConvTbl = ViewController.charConvTblFlashOn
}
else if ( frameCnt >= fps ) {
- // flashingSpace = spaceChar
ViewController.charConvTbl = ViewController.charConvTblFlashOff
frameCnt = 0
}
@@ -578,7 +582,6 @@ class ViewController: NSViewController {
self.txtArr[ y * (self.textCols * charDisposition + self.lineEndChars) + self.textCols * charDisposition] = "\n"
}
-
// 40 col
if videoMode.col80 == 0 {
if MEMcfg.txt_page_2 == 0 {
@@ -600,7 +603,7 @@ class ViewController: NSViewController {
self.txtArr[ y * (self.textCols + self.lineEndChars) + self.textCols ] = "\n"
}
}
- // 80 col
+ // 80 col
else {
let auxPage = ( MEMcfg.is_80STORE == 1 ) && ( MEMcfg.txt_page_2 == 1 )
@@ -677,7 +680,7 @@ class ViewController: NSViewController {
self.hires.isHidden = true
}
- self.lores.Update()
+ self.lores.Render()
}
else {
// when we change video mode, buffer needs to be cleared to avoid artifacts
@@ -690,7 +693,7 @@ class ViewController: NSViewController {
self.lores.isHidden = true
}
- hires.Update()
+ hires.Render()
}
}
else if ( self.savedVideoMode.text == 0 ) {
@@ -983,12 +986,45 @@ class ViewController: NSViewController {
@IBAction func CRTMonitorOnOff(_ sender: NSButton) {
CRTMonitor = sender.state == .on
scanLines.isHidden = !CRTMonitor
- hires.fullUpdate()
+ hires.RenderFullScreen()
}
@IBAction func ColorMonitorOnOff(_ sender: NSButton) {
ColorMonitor = sender.state == .on
- hires.fullUpdate()
+ hires.RenderFullScreen()
+
+ if ( ColorMonitor ) {
+ display.textColor = colorWhite // .white
+ }
+ else {
+ display.textColor = colorGreen // .green
+ }
+ }
+
+ @IBAction func MonitorChange(_ sender: NSButton) {
+ switch sender.title {
+ case "White Mono":
+ ColorMonitor = false
+ monoColor = colorWhite
+ hires.monoColor = hires.color_white
+
+ case "Green Mono":
+ ColorMonitor = false
+ monoColor = colorGreen
+ hires.monoColor = hires.color_green
+
+ case "Amber Mono":
+ ColorMonitor = false
+ monoColor = colorOrange
+ hires.monoColor = hires.color_orange
+
+ default:
+ ColorMonitor = true
+ monoColor = colorWhite
+ }
+
+ display.textColor = monoColor
+ hires.RenderFullScreen()
}
@IBAction func Keyboard2JoystickOnOff(_ sender: NSButton) {