-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloader.js
28 lines (23 loc) · 823 Bytes
/
loader.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// load all files to run v86 in browser, uncompiled
(function()
{
var PATH = "src/",
CORE_FILES="const.js io.js cpu.js main.js disk.js pci.js floppy.js memory.js dma.js pit.js vga.js ps2.js pic.js rtc.js uart.js"
BROWSER_FILES="browser/main.js browser/screen.js browser/keyboard.js browser/mouse.js"
window.onload = function()
{
load_scripts(CORE_FILES);
load_scripts(BROWSER_FILES);
function load_scripts(resp)
{
var files = resp.split(" "),
script;
for(var i = 0; i < files.length; i++)
{
script = document.createElement("script");
script.src = PATH + files[i] + "?" + Math.random();
document.body.appendChild(script);
}
}
};
})();