Skip to content

Commit

Permalink
inline debug loader
Browse files Browse the repository at this point in the history
  • Loading branch information
copy committed Feb 17, 2022
1 parent e7f574f commit 03c6bc4
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 65 deletions.
62 changes: 61 additions & 1 deletion debug.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,67 @@
<title>Virtual x86 (debug)</title>
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">

<script src="loader.js"></script>
<script>
"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() {
console.warn("trying to ignore script " + s + ", which failed to load");

load_next();
};
document.head.appendChild(script);
}
</script>
<link rel="stylesheet" href="v86.css">

<div>
Expand Down
64 changes: 0 additions & 64 deletions loader.js

This file was deleted.

0 comments on commit 03c6bc4

Please sign in to comment.