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.