This commit is contained in:
Luigi Thirty
2017-08-10 18:59:55 -04:00
parent 6a149b3365
commit cfb764b85a
5 changed files with 30 additions and 15 deletions
@@ -12,6 +12,7 @@ extension AppleIIBase {
class LoresMode: NSObject {
static func putLoresPixel(buffer: UnsafeMutablePointer<BitmapPixelsLE555.PixelData>?, pixel: UInt8, address: UInt16) {
let pageOffset = address - 0x400
let pixelPosition = VideoHelpers.getPixelOffset(memoryOffset: Int(pageOffset))
if(pixelPosition.x == -1 && pixelPosition.y == -1) {
@@ -25,7 +25,11 @@ extension AppleIIBase {
}
//Calculate the offset to reach the desired position.
let baseOffset = EmulatedSystemInstance!.emulatorViewDelegate.scanlineOffsets[Int(pixelPosition.y)] + Int(pixelPosition.x)
var baseOffset = EmulatedSystemInstance!.emulatorViewDelegate.scanlineOffsets[Int(pixelPosition.y) % 192] + Int(pixelPosition.x)
if(EmulatedSystemInstance!.videoSoftswitches.PAGE_2) {
baseOffset += 0x400
}
for charY in 0..<AppleII.A2CharacterGenerator.CHAR_HEIGHT {
let offset = baseOffset + (AppleII.ScreenDelegate.PIXEL_WIDTH * charY)
@@ -10,6 +10,9 @@ import Cocoa
extension AppleIIBase {
static let PAGE1_BASE: Address = 0x400
static let PAGE2_BASE: Address = 0x800
typealias Softswitch = Bool
struct VideoSoftswitches {