Video Text/LoRes mem fix for Int/Aux mempry select

This commit is contained in:
Tamas Rudnai 2024-01-14 07:45:11 -08:00
parent 39f6bdc1bd
commit 112f43fafe
3 changed files with 24 additions and 6 deletions

View File

@ -39,6 +39,8 @@ class LoRes: NSView {
static let blockWidth = PixelWidth / blockCols
static let blockHeight = PixelHeight / blockRows
let LoResIntBuffer1 = UnsafeRawBufferPointer(start: RAM + Page1Addr, count: PageSize * 2)
let LoResIntBuffer2 = UnsafeRawBufferPointer(start: RAM + Page2Addr, count: PageSize * 2)
let LoResBuffer1 = UnsafeRawBufferPointer(start: MEM + Page1Addr, count: PageSize * 2)
let LoResBuffer2 = UnsafeRawBufferPointer(start: MEM + Page2Addr, count: PageSize * 2)
var LoResBufferPointer = UnsafeRawBufferPointer(start: MEM + Page1Addr, count: PageSize * 2)
@ -350,10 +352,20 @@ class LoRes: NSView {
height = LoRes.PixelMixedHeight / 2
}
if MEMcfg.txt_page_2 == 1 {
LoResBufferPointer = LoResBuffer2
if (MEMcfg.RD_AUX_MEM == 0) {
LoResBufferPointer = LoResBuffer2
}
else {
LoResBufferPointer = LoResIntBuffer2
}
}
else {
LoResBufferPointer = LoResBuffer1
if (MEMcfg.RD_AUX_MEM == 0) {
LoResBufferPointer = LoResBuffer1
}
else {
LoResBufferPointer = LoResIntBuffer1
}
}
}

View File

@ -463,7 +463,8 @@ class ViewController: NSViewController {
let ramBufferPointer = UnsafeRawBufferPointer(start: MEM, count: 64 * 1024)
static let textPage1Pointer = UnsafeRawBufferPointer(start: MEM + textPage1Addr, count: textBufferSize)
static let textPage2Pointer = UnsafeRawBufferPointer(start: MEM + textPage2Addr, count: textBufferSize)
static let textIntBufferPointer = UnsafeRawBufferPointer(start: RAM + textPage1Addr, count: textBufferSize)
static let textIntPage1BufferPointer = UnsafeRawBufferPointer(start: RAM + textPage1Addr, count: textBufferSize)
static let textIntPage2BufferPointer = UnsafeRawBufferPointer(start: RAM + textPage2Addr, count: textBufferSize)
static let textAuxBufferPointer = UnsafeRawBufferPointer(start: AUX + textPage1Addr, count: textBufferSize)
static let textPageShadowBuffer = UnsafeMutableRawBufferPointer.allocate(byteCount: textBufferSize, alignment: 1)
@ -991,11 +992,16 @@ class ViewController: NSViewController {
textBufferPointer = ViewController.textPage1Pointer
}
else {
textBufferPointer = ViewController.textIntBufferPointer
textBufferPointer = ViewController.textIntPage1BufferPointer
}
}
else {
textBufferPointer = ViewController.textPage2Pointer
if (MEMcfg.RD_AUX_MEM == 0) {
textBufferPointer = ViewController.textPage2Pointer
}
else {
textBufferPointer = ViewController.textIntPage2BufferPointer
}
}
if textBufferPointer.elementsEqual(ViewController.textPageShadowBuffer) {
@ -1024,7 +1030,7 @@ class ViewController: NSViewController {
else {
let auxPage = ( MEMcfg.is_80STORE == 1 ) && ( MEMcfg.txt_page_2 == 1 )
let textIntBuffer = auxPage ? ViewController.textIntBufferPointer : ViewController.textPage1Pointer
let textIntBuffer = auxPage ? ViewController.textIntPage1BufferPointer : ViewController.textPage1Pointer
let textAuxBuffer = auxPage ? ViewController.textPage1Pointer : ViewController.textAuxBufferPointer
// render the rest of the text screen