From 03c6bc4dd7b8fa76e17dd567ae950b4adf554f4f Mon Sep 17 00:00:00 2001 From: Fabian Date: Wed, 9 Feb 2022 16:22:13 +0100 Subject: [PATCH] inline debug loader --- debug.html | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++- loader.js | 64 ------------------------------------------------------ 2 files changed, 61 insertions(+), 65 deletions(-) delete mode 100644 loader.js diff --git a/debug.html b/debug.html index 88ed728b..f65362cd 100644 --- a/debug.html +++ b/debug.html @@ -4,7 +4,67 @@ Virtual x86 (debug) - +
diff --git a/loader.js b/loader.js deleted file mode 100644 index 97fd5845..00000000 --- a/loader.js +++ /dev/null @@ -1,64 +0,0 @@ -// load all files to run v86 in browser, uncompiled - -(function() -{ - "use strict"; - - var CORE_FILES = - "const.js config.js log.js lib.js cpu.js debug.js " + - "io.js main.js ide.js pci.js floppy.js " + - "memory.js dma.js pit.js vga.js ps2.js pic.js rtc.js uart.js acpi.js apic.js ioapic.js hpet.js sb16.js " + - "ne2k.js state.js virtio.js bus.js elf.js kernel.js"; - - var BROWSER_FILES = "main.js screen.js keyboard.js mouse.js speaker.js serial.js lib.js network.js starter.js worker_bus.js print_stats.js filestorage.js"; - var LIB_FILES = ""; - - // jor1k stuff - LIB_FILES += " jor1k.js 9p.js filesystem.js marshall.js utf8.js"; - - var BUILD_FILES = "capstone-x86.min.js libwabt.js"; - - var to_load = []; - - load_scripts(CORE_FILES, "src/"); - load_scripts(BROWSER_FILES, "src/browser/"); - load_scripts(LIB_FILES, "lib/"); - load_scripts(BUILD_FILES, "build/"); - - function load_scripts(resp, path) - { - var files = resp.split(" "); - - for(var i = 0; i < files.length; i++) - { - if(!files[i]) - { - continue; - } - - to_load.push(path + files[i]); - } - } - - load_next(); - - function load_next() - { - let s = to_load.shift(); - - if(!s) - { - return; - } - - var script = document.createElement("script"); - script.src = s; - script.onload = load_next; - script.onerror = function() { - dbg_log("Warning: trying to ignore script " + s + ", which failed to load"); - - load_next(); - }; - document.head.appendChild(script); - } -})();