diff options
author | WlodekM <[email protected]> | 2025-04-03 21:51:53 +0300 |
---|---|---|
committer | WlodekM <[email protected]> | 2025-04-03 21:51:53 +0300 |
commit | e2568226af4af2d3b27e9e1a775e7244c5ef7191 (patch) | |
tree | f6bd5d51753c549728a7160743e3b935a3a39602 /65c02.ts | |
parent | c62e133afb34fc38445af7bbe61e88cf45e9a7e3 (diff) |
more progress on trying to get wozmon running
Diffstat (limited to '65c02.ts')
-rw-r--r-- | 65c02.ts | 16 |
1 files changed, 16 insertions, 0 deletions
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 |