From 47fe12539faa4a61cb7a1e13e84951863e3440f3 Mon Sep 17 00:00:00 2001 From: Will Scullin Date: Sun, 9 May 2021 13:21:15 -0700 Subject: [PATCH] Clean up //e behaviors (#79) --- js/apple2.ts | 1 - js/canvas.ts | 13 ++------- js/gl.ts | 13 ++------- js/mmu.ts | 14 ++++++--- js/roms/apple2e.ts | 2 -- js/roms/apple2e_char.ts | 64 ++++++++++++++++++++--------------------- js/videomodes.ts | 1 - 7 files changed, 46 insertions(+), 62 deletions(-) diff --git a/js/apple2.ts b/js/apple2.ts index bb6f619..619c211 100644 --- a/js/apple2.ts +++ b/js/apple2.ts @@ -87,7 +87,6 @@ export class Apple2 implements Restorable, DebuggerContainer { this.hgr = new HiresPage(1); this.hgr2 = new HiresPage(2); this.vm = new VideoModes(this.gr, this.hgr, this.gr2, this.hgr2, options.canvas, options.e); - this.vm.enhanced(options.enhanced); this.io = new Apple2IO(this.cpu, this.vm); this.tick = options.tick; diff --git a/js/canvas.ts b/js/canvas.ts index 680790b..c3c27b7 100644 --- a/js/canvas.ts +++ b/js/canvas.ts @@ -22,7 +22,6 @@ import { pageNo } from './videomodes'; -let enhanced = false; let textMode = true; let mixedMode = false; let hiresMode = false; @@ -272,9 +271,7 @@ export class LoresPage2D implements LoresPage { fore = inverse ? blackCol : whiteCol; back = inverse ? whiteCol : blackCol; - if (!enhanced) { - val = (val >= 0x40 && val < 0x60) ? val - 0x40 : val; - } else if (!altCharMode) { + if (!altCharMode) { val = (val >= 0x40 && val < 0x80) ? val - 0x40 : val; } @@ -298,9 +295,7 @@ export class LoresPage2D implements LoresPage { fore = inverse ? blackCol : whiteCol; back = inverse ? whiteCol : blackCol; - if (!enhanced) { - val = (val >= 0x40 && val < 0x60) ? val - 0x40 : val; - } else if (!altCharMode) { + if (!altCharMode) { val = (val >= 0x40 && val < 0x80) ? val - 0x40 : val; } @@ -1030,10 +1025,6 @@ export class VideoModes2D implements VideoModes { } } - enhanced(on: boolean) { - enhanced = on; - } - isText() { return textMode; } diff --git a/js/gl.ts b/js/gl.ts index 1e1b217..270dc98 100644 --- a/js/gl.ts +++ b/js/gl.ts @@ -25,7 +25,6 @@ import { pageNo } from './videomodes'; -let enhanced = false; let textMode = true; let mixedMode = false; let hiresMode = false; @@ -196,9 +195,7 @@ export class LoresPageGL implements LoresPage { fore = inverse ? blackCol : whiteCol; back = inverse ? whiteCol : blackCol; - if (!enhanced) { - val = (val >= 0x40 && val < 0x60) ? val - 0x40 : val; - } else if (!altCharMode) { + if (!altCharMode) { val = (val >= 0x40 && val < 0x80) ? val - 0x40 : val; } @@ -222,9 +219,7 @@ export class LoresPageGL implements LoresPage { fore = inverse ? blackCol : whiteCol; back = inverse ? whiteCol : blackCol; - if (!enhanced) { - val = (val >= 0x40 && val < 0x60) ? val - 0x40 : val; - } else if (!altCharMode) { + if (!altCharMode) { val = (val >= 0x40 && val < 0x80) ? val - 0x40 : val; } @@ -772,10 +767,6 @@ export class VideoModesGL implements VideoModes { } } - enhanced(on: boolean) { - enhanced = on; - } - isText() { return textMode; } diff --git a/js/mmu.ts b/js/mmu.ts index 983e063..5a70005 100644 --- a/js/mmu.ts +++ b/js/mmu.ts @@ -111,7 +111,7 @@ class AuxRom implements Memory { private readonly mmu: MMU, private readonly rom: ROM) { } - read(page: byte, off: byte) { + _access(page: byte, off: byte) { if (page == 0xc3) { this.mmu._setIntc8rom(true); this.mmu._updateBanks(); @@ -120,11 +120,15 @@ class AuxRom implements Memory { this.mmu._setIntc8rom(false); this.mmu._updateBanks(); } + } + + read(page: byte, off: byte) { + this._access(page, off); return this.rom.read(page, off); } - write(_page: byte, _off: byte, _val: byte) { - // It's ROM. + write(page: byte, off: byte, _val: byte) { + this._access(page, off); } } @@ -477,7 +481,9 @@ export default class MMU implements Memory, Restorable { case LOC.INTCXROMOFF: this._intcxrom = false; - this._intc8rom = false; + if (this._slot3rom) { + this._intc8rom = false; + } this._debug('Int CX ROM Off'); break; case LOC.INTCXROMON: diff --git a/js/roms/apple2e.ts b/js/roms/apple2e.ts index b2a1480..7f3bb21 100644 --- a/js/roms/apple2e.ts +++ b/js/roms/apple2e.ts @@ -258,7 +258,6 @@ const rom = new Uint8Array([ 0x85,0x32,0x20,0x58,0xfc,0x60,0x80,0x00, 0x00,0x00,0x80,0x00,0x00,0x00,0x80,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x4c,0x4a,0xca,0xa9,0x06,0xcd,0xb3,0xfb, 0xf0,0x0c,0x20,0x78,0xcf,0xcd,0xb3,0xfb, 0xf0,0x04,0x78,0x4c,0x13,0xc8,0xa9,0xc3, @@ -515,7 +514,6 @@ const rom = new Uint8Array([ 0x29,0x60,0x28,0x42,0x4c,0x7c,0x9b,0xe9, 0xff,0x01,0x89,0xe0,0xec,0xcc,0xd2,0xd8, 0xe9,0x23,0x22,0xe6,0x00,0x00,0x00,0x00, - 0x6f,0xd8,0x65,0xd7,0xf8,0xdc,0x94,0xd9, 0xb1,0xdb,0x30,0xf3,0xd8,0xdf,0xe1,0xdb, 0x8f,0xf3,0x98,0xf3,0xe4,0xf1,0xdd,0xf1, diff --git a/js/roms/apple2e_char.ts b/js/roms/apple2e_char.ts index ff485d7..1f3cbc2 100644 --- a/js/roms/apple2e_char.ts +++ b/js/roms/apple2e_char.ts @@ -67,38 +67,38 @@ const apple2e_charset = new Uint8Array([ 0x00,0x00,0x3e,0x00,0x3e,0x00,0x00,0x00, 0x04,0x08,0x10,0x20,0x10,0x08,0x04,0x00, 0x1c,0x22,0x10,0x08,0x08,0x00,0x08,0x00, - 0xef,0xf7,0xc9,0x80,0xc0,0xc0,0x81,0xc9, - 0xef,0xf7,0xc9,0xbe,0xde,0xde,0xb5,0xc9, - 0xff,0xff,0xfd,0xf9,0xf1,0xe1,0xc9,0xbd, - 0x80,0xdd,0xeb,0xf7,0xf7,0xeb,0xd5,0x80, - 0xff,0xbf,0xdf,0xee,0xf5,0xfb,0xfb,0xff, - 0x80,0xc0,0xa0,0x93,0x8a,0x84,0x84,0x80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fe, + 0x1c,0x22,0x2a,0x3a,0x1a,0x02,0x3c,0x00, + 0x08,0x14,0x22,0x22,0x3e,0x22,0x22,0x00, + 0x1e,0x22,0x22,0x1e,0x22,0x22,0x1e,0x00, + 0x1c,0x22,0x02,0x02,0x02,0x22,0x1c,0x00, + 0x1e,0x22,0x22,0x22,0x22,0x22,0x1e,0x00, + 0x3e,0x02,0x02,0x1e,0x02,0x02,0x3e,0x00, + 0x3e,0x02,0x02,0x1e,0x02,0x02,0x02,0x00, + 0x3c,0x02,0x02,0x02,0x32,0x22,0x3c,0x00, + 0x22,0x22,0x22,0x3e,0x22,0x22,0x22,0x00, + 0x1c,0x08,0x08,0x08,0x08,0x08,0x1c,0x00, + 0x20,0x20,0x20,0x20,0x20,0x22,0x1c,0x00, + 0x22,0x12,0x0a,0x06,0x0a,0x12,0x22,0x00, + 0x02,0x02,0x02,0x02,0x02,0x02,0x3e,0x00, + 0x22,0x36,0x2a,0x2a,0x22,0x22,0x22,0x00, + 0x22,0x22,0x26,0x2a,0x32,0x22,0x22,0x00, + 0x1c,0x22,0x22,0x22,0x22,0x22,0x1c,0x00, + 0x1e,0x22,0x22,0x1e,0x02,0x02,0x02,0x00, + 0x1c,0x22,0x22,0x22,0x2a,0x12,0x2c,0x00, + 0x1e,0x22,0x22,0x1e,0x0a,0x12,0x22,0x00, + 0x1c,0x22,0x02,0x1c,0x20,0x22,0x1c,0x00, + 0x3e,0x08,0x08,0x08,0x08,0x08,0x08,0x00, + 0x22,0x22,0x22,0x22,0x22,0x22,0x1c,0x00, + 0x22,0x22,0x22,0x22,0x22,0x14,0x08,0x00, + 0x22,0x22,0x22,0x2a,0x2a,0x36,0x22,0x00, + 0x22,0x22,0x14,0x08,0x14,0x22,0x22,0x00, + 0x22,0x22,0x14,0x08,0x08,0x08,0x08,0x00, + 0x3e,0x20,0x10,0x08,0x04,0x02,0x3e,0x00, + 0x3e,0x06,0x06,0x06,0x06,0x06,0x3e,0x00, + 0x00,0x02,0x04,0x08,0x10,0x20,0x00,0x00, + 0x3e,0x30,0x30,0x30,0x30,0x30,0x3e,0x00, + 0x00,0x00,0x08,0x14,0x22,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f, 0x04,0x08,0x10,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x1c,0x20,0x3c,0x22,0x3c,0x00, 0x02,0x02,0x1e,0x22,0x22,0x22,0x1e,0x00, diff --git a/js/videomodes.ts b/js/videomodes.ts index a773f9f..b141aa8 100644 --- a/js/videomodes.ts +++ b/js/videomodes.ts @@ -57,7 +57,6 @@ export interface VideoModes extends Restorable { _80col(on: boolean): void altchar(on: boolean): void doubleHires(on: boolean): void - enhanced(on: boolean): void hires(on: boolean): void mixed(on: boolean): void text(on: boolean): void