From 875a69fad6b6537e34df45f47a75bacd7454306a Mon Sep 17 00:00:00 2001 From: MatCat Date: Wed, 7 Apr 2021 01:58:33 -0700 Subject: [PATCH] Fixed some code in ram drawer --- js/cpu.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/cpu.js b/js/cpu.js index c9c32b4..34fa733 100644 --- a/js/cpu.js +++ b/js/cpu.js @@ -185,9 +185,9 @@ function printTextOut(ram,startaddr,endaddr) { function printRAM(ram) { let addrSpan = parseInt(ramlines.value); - let startADDR = (cpu.ADDRBUS & 0xfff0) - ((Math.ceil(addrSpan/2)*16)); + let startADDR = (cpu.ADDRBUS & 0xfffff0) - ((Math.floor(addrSpan/2)*16)); if (startADDR < 0) startADDR = 0; - if (startADDR > 0xFEFF) startADDR = (0xFF00 + (addrSpan*16)); + //if (startADDR > 0xFFFEFF) startADDR = (0xFF00 + (addrSpan*16)); let sp_ram = document.getElementById("RAM"); let ramtext = "ADDR    :   0    1    2    3    4    5    6    7    8    9    A    B    C    D    E    F
"; for (let a = startADDR; a < (startADDR+(addrSpan*16)); a+=16) {