From 5b3c415c6f3c5f92698a31ee0a2c4aeaa8ba327e Mon Sep 17 00:00:00 2001 From: Steven Hugg Date: Fri, 24 Aug 2018 22:55:16 -0400 Subject: [PATCH] debugging refactoring; fixed up embed.html; started DASM macro parse; Z80 stack view; replay wraps buffer > 120 secs; verilog edits --- doc/notes.txt | 4 +-- embed.html | 25 +++++++++------- index.html | 2 ++ presets/verilog/ram.v | 6 ++-- src/baseplatform.ts | 42 +++++++++++++++++++++++++-- src/emu.ts | 30 ++----------------- src/platform/apple2.ts | 15 ++++------ src/platform/galaxian.ts | 12 +------- src/platform/mw8080bw.ts | 17 +---------- src/platform/nes.ts | 7 +++-- src/platform/vector.ts | 10 +++++-- src/platform/verilog.ts | 3 +- src/recorder.ts | 14 +++++---- src/ui.ts | 7 +++-- src/worker/workermain.js | 30 +++++++++++++++---- test/cli/testplatforms.js | 53 ++++++++++++++++++++++------------ test/roms/apple2/mandel.c.rom | Bin 0 -> 19695 bytes 17 files changed, 158 insertions(+), 119 deletions(-) create mode 100644 test/roms/apple2/mandel.c.rom diff --git a/doc/notes.txt b/doc/notes.txt index 50ac5f23..f9bfeddb 100644 --- a/doc/notes.txt +++ b/doc/notes.txt @@ -34,7 +34,6 @@ TODO: - facade/kbd shortcuts for emulators, focus - update Javatari version? (and others?) - unify versioning -- more UI tests - disassembler for uploaded ROMs - show tool-specific (readonly) include files - verilog debugging/reloading makes it slow @@ -45,14 +44,13 @@ TODO: - Verilog compile spins forever? - go to error in include files - BOM in upload/download? -- stack view for Z80 platforms using memory map - online tools for music etc -- tools (memory, disasm) use debugging state - text log debugging script - NES crt should mark raster pos when debugging - intro/help text for each platform - vscode/atom extension? - navigator.getGamepads +- VCS library FYI: Image links for the books on http://8bitworkshop.com/ are broken On the website the additional grey spacing next to the program line numbers is not dynamically resized when the web browser window size is changed. Intentional? diff --git a/embed.html b/embed.html index f9e6f9db..55777ca3 100644 --- a/embed.html +++ b/embed.html @@ -79,7 +79,7 @@ window.Javatari.AUTO_START = false; var PLATFORMS = exports.PLATFORMS; var platform, platform_id; -var qs = (function (a) { +var _qs = (function (a) { if (!a || a.length == 0) return {}; var b = {}; @@ -135,7 +135,7 @@ function addPageFocusHandlers() { }); } -function startPlatform() { +function startPlatform(qs) { if (!PLATFORMS[platform_id]) throw Error("Invalid platform '" + platform_id + "'."); platform = new PLATFORMS[platform_id]($("#emulator")[0]); platform.start(); @@ -148,6 +148,17 @@ function startPlatform() { return true; } +function loadPlatform(qs) { + if (qs.data) qs = qs.data; + platform_id = qs['p']; + if (!platform_id) throw('No platform variable!'); + var scriptfn = 'gen/platform/' + platform_id.split(/[.-]/)[0] + '.js'; + loadScript(scriptfn, () => { + console.log("loaded platform", platform_id); + startPlatform(qs); + }); +} + function loadScript(scriptfn, onload) { var script = document.createElement('script'); script.onload = onload; @@ -158,14 +169,8 @@ function loadScript(scriptfn, onload) { // start function startEmbed() { installErrorHandler(); - // add default platform? - platform_id = qs['p']; - if (!platform_id) throw('No platform variable!'); - var scriptfn = 'gen/platform/' + platform_id.split(/[.-]/)[0] + '.js'; - loadScript(scriptfn, () => { - console.log("loaded platform", platform_id); - startPlatform(); - }); + window.addEventListener("message", loadPlatform, false); + if (_qs['p']) loadPlatform(_qs); } startEmbed(); diff --git a/index.html b/index.html index 4cd53c39..77f19f7f 100644 --- a/index.html +++ b/index.html @@ -234,6 +234,8 @@ if (window.location.host.endsWith('8bitworkshop.com')) {

You can also embed it into an IFRAME:

+

Note: These links may be too long for IE/Edge browsers.

+

Note: These links may be too long for some browsers.