From e2568226af4af2d3b27e9e1a775e7244c5ef7191 Mon Sep 17 00:00:00 2001 From: WlodekM Date: Thu, 3 Apr 2025 21:51:53 +0300 Subject: more progress on trying to get wozmon running --- 65c02.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to '65c02.ts') diff --git a/65c02.ts b/65c02.ts index f1368a9..fb8f050 100644 --- a/65c02.ts +++ b/65c02.ts @@ -157,6 +157,22 @@ export default class The65c02 { this.programCounter.set(resetVector); return; } + if (this.io.interruptRequest.high && !this.IRQBDisable) { + console.log('interrupt!') + this.IRQBDisable = true; + this.push(this.programCounter.num() & 0x00FF) + this.push(this.programCounter.num() & 0xFF00) + this.push(this.status.num()) + let interruptVector = 0; + this.io.address.set(0xFFFE); + this.read() + interruptVector |= this.io.data.num(); + this.io.address.set(0xFFFF); + this.read() + interruptVector |= this.io.data.num() << 8; + this.programCounter.set(interruptVector); + return; + } this.io.address.set(this.programCounter.num()); this.read(); const instruction = this.io.data -- cgit 1.4.1-2-gfad0