1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-05 10:28:58 +00:00

Makes collated text easier to read.

This commit is contained in:
Thomas Harte 2020-02-22 18:58:24 -05:00
parent da0a9113d4
commit e0475343f5

View File

@ -96,7 +96,14 @@ class PatrikRakTests: XCTestCase, CSTestMachineTrapHandler {
let testMachineZ80 = testMachine as! CSTestMachineZ80
switch address {
case 0x0010:
let textToAppend = UnicodeScalar(testMachineZ80.value(for: .A))!
var characterCode = testMachineZ80.value(for: .A)
// Of the control codes, retain only new line. Map the rest to space.
if characterCode < 32 && characterCode != 13 {
characterCode = 32
}
let textToAppend = UnicodeScalar(characterCode)!
output += String(textToAppend)
print(textToAppend, terminator:"")