From 4008067c7c1b85a7ac0f89e1fa98b699240efb68 Mon Sep 17 00:00:00 2001 From: Grimicron Date: Sun, 5 Mar 2023 00:59:07 +0000 Subject: [PATCH] Fixed mmap is null error in cpu.js. --- src/cpu.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cpu.js b/src/cpu.js index 4a0a40c3..d2057567 100644 --- a/src/cpu.js +++ b/src/cpu.js @@ -143,6 +143,7 @@ CPU.prototype = { this.irqRequested = false; } + if (null == this.nes.mmap) return 32; var opinf = this.opdata[this.nes.mmap.load(this.REG_PC + 1)]; var cycleCount = opinf >> 24; var cycleAdd = 0; @@ -1318,6 +1319,7 @@ CPU.prototype = { }, doNonMaskableInterrupt: function (status) { + if (null == this.nes.mmap) return; if ((this.nes.mmap.load(0x2000) & 128) !== 0) { // Check whether VBlank Interrupts are enabled