Display Text Page 2

This commit is contained in:
tudnai 2020-05-24 21:04:34 -07:00
parent ef4e124043
commit c5f16cd15a
2 changed files with 13 additions and 4 deletions

View File

@ -170,7 +170,8 @@ class ViewController: NSViewController {
}
static let textBaseAddr = 0x400
static let textPage1Addr = 0x400
static let textPage2Addr = 0x800
static let textBufferSize = 0x400
// static only needed to be able to initialize things
@ -191,8 +192,10 @@ class ViewController: NSViewController {
// static var flashingSpace : Character = " "
let ramBufferPointer = UnsafeRawBufferPointer(start: MEM, count: 64 * 1024)
let textBufferPointer = UnsafeRawBufferPointer(start: MEM + textBaseAddr, count: textBufferSize * 2)
let textAuxBufferPointer = UnsafeRawBufferPointer(start: AUX + textBaseAddr, count: textBufferSize)
static let textPage1Pointer = UnsafeRawBufferPointer(start: MEM + textPage1Addr, count: textBufferSize * 2)
static let textPage2Pointer = UnsafeRawBufferPointer(start: MEM + textPage2Addr, count: textBufferSize * 2)
var textBufferPointer = textPage1Pointer
let textAuxBufferPointer = UnsafeRawBufferPointer(start: AUX + textPage1Addr, count: textBufferSize)
static let textArraySize = textLines * (textCols + lineEndChars) + textCols * 2
@ -518,6 +521,12 @@ class ViewController: NSViewController {
// 40 col
if videoMode.col80 == 0 {
if MEMcfg.txt_page_2 == 0 {
self.textBufferPointer = ViewController.textPage1Pointer
}
else {
self.textBufferPointer = ViewController.textPage2Pointer
}
// render the rest of the text screen
for y in fromLines ..< toLines {
for x in 0 ..< self.textCols {

View File

@ -786,7 +786,7 @@ INLINE void ioWrite( uint16_t addr, uint8_t val ) {
case io_VID_TXTPAGE2:
// printf("io_VID_TXTPAGE2\n");
MEMcfg.txt_page_2 = 1;
MEMcfg.txt_page_2 = ! MEMcfg.is_80STORE;
textPageSelect();
break;