mirror of
https://github.com/ivanizag/izapple2.git
synced 2024-11-16 19:08:37 +00:00
29 lines
678 B
Go
29 lines
678 B
Go
|
package screen
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
)
|
||
|
|
||
|
// RenderTextModeString returns the text mode contents ignoring reverse and flash
|
||
|
func RenderTextModeString(vs VideoSource, is80Columns bool, isSecondPage bool, isAltText bool, isApple2e bool) string {
|
||
|
|
||
|
var text []uint8
|
||
|
if is80Columns {
|
||
|
text = getText80FromMemory(vs, isSecondPage)
|
||
|
} else {
|
||
|
text = getTextFromMemory(vs, isSecondPage, false)
|
||
|
}
|
||
|
columns := len(text) / textLines
|
||
|
|
||
|
content := ""
|
||
|
for l := 0; l < textLines; l++ {
|
||
|
line := ""
|
||
|
for c := 0; c < columns; c++ {
|
||
|
char := text[l*columns+c]
|
||
|
line += textMemoryByteToString(char, isAltText, isApple2e, false)
|
||
|
}
|
||
|
content += fmt.Sprintf("%v\n", line)
|
||
|
}
|
||
|
return content
|
||
|
}
|