From c50e619bef9ecd2266ee904b87c6401cb0572660 Mon Sep 17 00:00:00 2001 From: WlodekM Date: Thu, 3 Apr 2025 10:29:58 +0300 Subject: fix stuff --- instructions/BRK.ts | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-) (limited to 'instructions/BRK.ts') diff --git a/instructions/BRK.ts b/instructions/BRK.ts index 419eeef..6a2f4e1 100644 --- a/instructions/BRK.ts +++ b/instructions/BRK.ts @@ -1,25 +1,18 @@ import type The65c02 from "../65c02.ts"; -export default function (this: The65c02, mode: string) { - switch (mode) { - case 'implied': - this.io.interruptRequest.HI() - //TODO: push shit onto stack - this.push(this.programCounter.num() & 0x00FF) - this.push(this.programCounter.num() & 0xFF00) - this.push(this.status.num()) - this.io.data.set(this.programCounter.num() & 0x00FF) - this.io.address.set(0xFFFF) - this.write() - this.io.data.set(this.programCounter.num() & 0xFF00) - this.io.address.set(0xFFFE) - this.write() - this.BRK = true - this.programCounter.increment(); - this.programCounter.increment(); - break; - - default: - throw 'wha'; - } +export default function (this: The65c02) { + this.io.interruptRequest.HI() + //TODO: push shit onto stack + this.push(this.programCounter.num() & 0x00FF) + this.push(this.programCounter.num() & 0xFF00) + this.push(this.status.num()) + this.io.data.set(this.programCounter.num() & 0x00FF) + this.io.address.set(0xFFFF) + this.write() + this.io.data.set(this.programCounter.num() & 0xFF00) + this.io.address.set(0xFFFE) + this.write() + this.BRK = true + this.programCounter.increment(); + this.programCounter.increment(); } \ No newline at end of file -- cgit 1.4.1-2-gfad0