From dbadb76789b30e5f55daeb152eddc41659f6a31b Mon Sep 17 00:00:00 2001 From: Matt Godbolt Date: Sat, 14 Sep 2024 13:39:04 -0500 Subject: [PATCH] More cleanups --- tests/test-suite.js | 23 ++++++----------- tests/test-web.js | 60 --------------------------------------------- 2 files changed, 8 insertions(+), 75 deletions(-) delete mode 100644 tests/test-web.js diff --git a/tests/test-suite.js b/tests/test-suite.js index 4e6a7395..19ee8372 100644 --- a/tests/test-suite.js +++ b/tests/test-suite.js @@ -7,6 +7,8 @@ const processor = fake6502(); const IRQ_ROUTINE_START = 0xff48; const RTS_OPCODE = 0x60; const NOP_OPCODE = 0xea; + +// prettier-ignore const IRQ_ROUTINE = [ 0x48, // PHA 0x8a, // TXA @@ -14,19 +16,11 @@ const IRQ_ROUTINE = [ 0x98, // TYA 0x48, // PHA 0xba, // TSX - 0xbd, - 0x04, - 0x01, // LDA $0104,X - 0x29, - 0x10, // AND #$10 - 0xf0, - 0x03, // BEQ $03 - 0x6c, - 0x16, - 0x03, // JMP ($0316) - 0x6c, - 0x14, - 0x03, // JMP ($0314) + 0xbd, 0x04, 0x01, // LDA $0104,X + 0x29, 0x10, // AND #$10 + 0xf0, 0x03, // BEQ $03 + 0x6c, 0x16, 0x03, // JMP ($0316) + 0x6c, 0x14, 0x03 // JMP ($0314) ]; async function setup(filename) { @@ -93,8 +87,7 @@ processor.debugInstruction.add((addr) => { handlePrint(); break; case 0xe16f: - handleLoad(); - return true; + return handleLoad(); case 0x8000: case 0xa474: handleError(); diff --git a/tests/test-web.js b/tests/test-web.js deleted file mode 100644 index 68b85a38..00000000 --- a/tests/test-web.js +++ /dev/null @@ -1,60 +0,0 @@ -require(["jquery", "tests/test"], function ($, test) { - "use strict"; - let currentTest = null; - - function log() { - console.log.apply(console, arguments); - let msg = Array.prototype.join.call(arguments, " "); - if (currentTest) { - currentTest.find(".template").clone().removeClass("template").text(msg).appendTo(currentTest); - } - } - - function beginTest(name) { - currentTest = $("#test-info > .template").clone().removeClass("template").appendTo($("#test-info")); - currentTest.find(".test-name").text(name); - } - - function endTest(name, failures) { - if (!failures) { - currentTest.addClass("success"); - } else { - currentTest.addClass("fail"); - } - } - - $(function () { - let canvas = $("#screen"); - let fb32; - let paint = function () {}; - if (canvas.length) { - canvas = $("#screen")[0]; - let ctx = canvas.getContext("2d"); - ctx.fillStyle = "black"; - ctx.fillRect(0, 0, 1280, 768); - if (!ctx.getImageData) { - window.alert("Unsupported browser"); - return; - } - let backBuffer = document.createElement("canvas"); - backBuffer.width = 1280; - backBuffer.height = 768; - let backCtx = backBuffer.getContext("2d"); - let imageData = backCtx.createImageData(backBuffer.width, backBuffer.height); - let fb8 = imageData.data; - let canvasWidth = canvas.width; - let canvasHeight = canvas.height; - paint = function (minx, miny, maxx, maxy) { - let width = maxx - minx; - let height = maxy - miny; - backCtx.putImageData(imageData, 0, 0, minx, miny, width, height); - ctx.drawImage(backBuffer, minx, miny, width, height, 0, 0, canvasWidth, canvasHeight); - }; - - fb32 = new Uint32Array(fb8.buffer); - } else { - fb32 = new Uint32Array(1280 * 1024); - } - test.run(log, beginTest, endTest, fb32, paint); - }); -});