From e70099fdc619423843474b3a77fad9c45f2fac9e Mon Sep 17 00:00:00 2001 From: Ivan Izaguirre Date: Sat, 12 Oct 2019 23:55:53 +0200 Subject: [PATCH] Apple IIe char gen ROM management --- screenText.go | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/screenText.go b/screenText.go index 14a7f17..fdc0b9c 100644 --- a/screenText.go +++ b/screenText.go @@ -57,12 +57,28 @@ func snapshotTextMode(a *Apple2, page int, mixMode bool, light color.Color) *ima rowInChar := y % charHeight colInChar := x % charWidth char := getTextChar(a, col, line, page) - topBits := char >> 6 - isInverse := topBits == 0 - isFlash := topBits == 1 + var pixel bool + if a.isApple2e { + isAltText := a.io.isSoftSwitchActive(ioFlagAltChar) + vid6 := (char & 0x40) != 0 + vid7 := (char & 0x80) != 0 - pixel := a.cg.getPixel(char, rowInChar, colInChar) - pixel = pixel != (isInverse || (isFlash && isFlashedFrame)) + char := char & 0x3f + if vid6 && (vid7 || isAltText) { + char += 0x40 + } + if vid7 || (vid6 && isFlashedFrame && !isAltText) { + char += 0x80 + } + pixel = !a.cg.getPixel(char, rowInChar, colInChar) + } else { + pixel = a.cg.getPixel(char, rowInChar, colInChar) + topBits := char >> 6 + isInverse := topBits == 0 + isFlash := topBits == 1 + + pixel = pixel != (isInverse || (isFlash && isFlashedFrame)) + } var colour color.Color if pixel { colour = light