Set Apple II font on launch

This commit is contained in:
Tamas Rudnai 2022-08-21 22:22:31 -07:00
parent f9abef0123
commit 7abc95f4d8
2 changed files with 110152 additions and 110249 deletions

File diff suppressed because it is too large Load Diff

View File

@ -956,7 +956,45 @@ class ViewController: NSViewController {
}
}
func SetSplashScreenFont() {
for view in splashScreen.subviews {
if view is NSTextField {
let textField = view as! NSTextField
if let fontSize = textField.font?.pointSize {
textField.font = NSFont(name: "PrintChar21", size: fontSize)
}
}
}
// Set Apple ][ font
if let fontSize = textDisplay.font?.pointSize {
textDisplay.font = NSFont(name: "PrintChar21", size: fontSize)
ViewController.charConvTblFlashOn = ViewController.charConvTblFlashOn40
ViewController.charConvTblFlashOff = ViewController.charConvTblFlashOff40
}
}
func SetCol40() {
// Set Apple ][ font
if let fontSize = textDisplay.font?.pointSize {
textDisplay.font = NSFont(name: "PrintChar21", size: fontSize)
ViewController.charConvTblFlashOn = ViewController.charConvTblFlashOn40
ViewController.charConvTblFlashOff = ViewController.charConvTblFlashOff40
}
}
func SetCol80() {
// Set Apple ][ font
if let fontSize = textDisplay.font?.pointSize {
textDisplay.font = NSFont(name: "PRNumber3", size: fontSize)
ViewController.charConvTblFlashOn = ViewController.charConvTblCol80
ViewController.charConvTblFlashOff = ViewController.charConvTblCol80
}
}
func UpdateText() {
// TODO: Render text Screen in native C
@ -965,17 +1003,11 @@ class ViewController: NSViewController {
if videoMode.col80 != currentVideoMode.col80 {
currentVideoMode.col80 = videoMode.col80
if let fontSize = textDisplay.font?.pointSize {
if videoMode.col80 == 1 {
textDisplay.font = NSFont(name: "PRNumber3", size: fontSize)
ViewController.charConvTblFlashOn = ViewController.charConvTblCol80
ViewController.charConvTblFlashOff = ViewController.charConvTblCol80
}
else {
textDisplay.font = NSFont(name: "PrintChar21", size: fontSize)
ViewController.charConvTblFlashOn = ViewController.charConvTblFlashOn40
ViewController.charConvTblFlashOff = ViewController.charConvTblFlashOff40
}
if videoMode.col80 == 1 {
SetCol80()
}
else {
SetCol40()
}
}
@ -1366,7 +1398,11 @@ class ViewController: NSViewController {
// timer = CADisplayLink(target: self, selector: #selector(gameloop))
// timer.add(to: RunLoop.main, forMode: .default)
// Set Apple ][ font
SetCol40()
SetSplashScreenFont()
openLog()
hires.clearScreen();