black and white high resolution graphics work

This commit is contained in:
Luigi Thirty 2017-08-11 20:15:07 -04:00
parent 5fc2be1fdc
commit a9a12189af
2 changed files with 11 additions and 5 deletions

View File

@ -144,10 +144,13 @@ class AppleIIBase: NSObject, EmulatedSystem {
videoMode = getCurrentVideoMode(switches: videoSoftswitches)
let videoMemoryStart: Address
let hgrMemoryStart: Address
if(videoSoftswitches.PAGE_2) {
videoMemoryStart = 0x800
hgrMemoryStart = 0x4000
} else {
videoMemoryStart = 0x400
hgrMemoryStart = 0x2000
}
if(videoMode == .Text)
@ -175,9 +178,9 @@ class AppleIIBase: NSObject, EmulatedSystem {
putGlyphs(buffer: buf!, start: videoMemoryStart + 0x350, end: videoMemoryStart + 0x378)
putGlyphs(buffer: buf!, start: videoMemoryStart + 0x3D0, end: videoMemoryStart + 0x3F8)
} else if(videoMode == .Hires) {
putHiresPixels(buffer: buf!, start: hgrMemoryStart, end: hgrMemoryStart + 0x1fff)
} else if(videoMode == .MixedHires) {
putHiresPixels(buffer: buf!, start: 0x2000, end: 0x3fff)
putHiresPixels(buffer: buf!, start: hgrMemoryStart, end: hgrMemoryStart + 0x1fff)
//Draw the bottom 4 text rows.
putGlyphs(buffer: buf!, start: videoMemoryStart + 0x250, end: videoMemoryStart + 0x278)

View File

@ -22,10 +22,13 @@ extension AppleIIBase {
}
//Convert the address into an (X,Y) pixel coordinate.
var offset = address - 0x2000
var offset = address - pageBase
/*
if(offset >= 0x2000) { //Page 2 address
offset -= 0x2000
}
*/
//Find the row number.
var rowNumber = 0
@ -44,6 +47,7 @@ extension AppleIIBase {
}
else if(0x78 ... 0x7F ~= lowByte || 0xF8 ... 0xFF ~= lowByte) {
//Discard.
return
}
else {
//Top third.
@ -67,12 +71,11 @@ extension AppleIIBase {
let dot4 = (pixel & 0x10) == 0x10
let dot5 = (pixel & 0x20) == 0x20
let dot6 = (pixel & 0x40) == 0x40
//let dot7 = (pixel & 0x80) == 0x80
let pixelRowOffset = Int(rowNumber * AppleII.ScreenDelegate.PIXEL_WIDTH)
let pixelColumnOffset = Int(UInt16(columnByte) * 7)
if(pixelRowOffset + pixelColumnOffset == 17920) {
if(pixelRowOffset + pixelColumnOffset == (5 * AppleII.ScreenDelegate.PIXEL_WIDTH)) {
let x = 0
}