From 3681bc65e8d9a1c7882a3c17f749d6455d6a863f Mon Sep 17 00:00:00 2001 From: Micah Cowan Date: Fri, 28 Jan 2022 23:32:10 -0800 Subject: [PATCH] apple2: don't modify uploaded ROMs with RTS byte --- src/machine/apple2.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/machine/apple2.ts b/src/machine/apple2.ts index d6a9acd9..37a635c6 100644 --- a/src/machine/apple2.ts +++ b/src/machine/apple2.ts @@ -120,6 +120,11 @@ export class AppleII extends BasicScanlineMachine implements AcceptsBIOS { super(); this.loadBIOS(new lzgmini().decode(stringToByteArray(atob(APPLEIIGO_LZG)))); this.connectCPUMemoryBus(this); + // This line is inappropriate for real ROMs, but was there for + // the APPLE][GO ROM, so keeping it only in the constructor, for + // that special case (in case it really is important for this + // address to be an RTS). + this.bios[0xD39A - (0x10000 - this.bios.length)] = 0x60; // $d39a = RTS } saveState() : AppleIIState { // TODO: automagic @@ -163,7 +168,6 @@ export class AppleII extends BasicScanlineMachine implements AcceptsBIOS { console.log("will load BIOS to end of memory anyway..."); } this.bios = Uint8Array.from(data); - this.bios[0xD39A - (0x10000 - this.bios.length)] = 0x60; // $d39a = RTS this.ram.set(this.bios, 0x10000 - this.bios.length); this.ram[0xbf00] = 0x4c; // fake DOS detect for C this.ram[0xbf6f] = 0x01; // fake DOS detect for C