From f1b6c51ce7d2f803d9890b35301f5e5c7291fd32 Mon Sep 17 00:00:00 2001 From: Ian Flanigan Date: Mon, 16 Nov 2020 02:54:27 +0100 Subject: [PATCH] Fix a "wrong this" bug in cpu6502 (#44) --- js/cpu6502.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/cpu6502.ts b/js/cpu6502.ts index b4a7f1b..f39388c 100644 --- a/js/cpu6502.ts +++ b/js/cpu6502.ts @@ -997,11 +997,12 @@ export default class CPU6502 { mode: 'implied', }; } else { + let cpu = this; unk = { name: '???', op: function() { debug('Unknown OpCode: ' + toHex(b) + - ' at ' + toHex(this.pc - 1, 4)); + ' at ' + toHex(cpu.pc - 1, 4)); }, modeFn: this.implied, mode: 'implied'