-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.html
99 lines (90 loc) · 4.05 KB
/
run.html
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://bootswatch.com/4/darkly/bootstrap.min.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?amily=Roboto+Mono&display=swap" rel="stylesheet">
<script src="js/js-dos.js"></script>
<title>DOSArchive</title>
</head>
<style>
#title {
color: white;
flex: 1;
text-align: center;
font-family: 'Roboto Mono', monospace;
flex-wrap: wrap;
}
#jsdos {
width: 960px;
height: 600px;
}
</style>
<body style="background-color: black;">
<h1 id="title">DOSArchive Interactive</h1>
<canvas id="jsdos"></canvas>
<div class="container-fluid text-center pt-3">
<button class="btn btn-lg btn-primary mx-2" onclick="ci.fullscreen()">Fullscreen</button>
<button class="btn btn-lg btn-warning mx-2" onclick="resetCache()">Reset Cache</button>
<button class="btn btn-lg btn-success mx-2" onclick="window.location.reload()">Run Again</button>
<button class="btn btn-lg btn-light mx-2" onclick="window.history.back()">Go Back</button>
</div>
<script>
function getQueryVariable(variable) {
var query = window.location.search.substring(1);
var vars = query.split('&');
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split('=');
if (decodeURIComponent(pair[0]) == variable) {
return decodeURIComponent(pair[1]);
}
}
}
function resetCache() {
window.indexedDB.databases().then(dbs => {
dbs.forEach(db => { window.indexedDB.deleteDatabase(db.name) });
});
alert('Please refresh to finish clearing the cache.');
}
Dos(document.getElementById("jsdos"), {
wdosboxUrl: "js/wdosbox.js",
cycles: 1000,
autolock: false,
}).ready(function (fs, main) {
fs.extractAll([
{ url: "dist/RUN.zip", mountPoint: "/" },
{ url: "dist/SCREEN.zip", mountPoint: "/ARCHIVE/SCREEN" },
{ url: "dist/SUN.zip", mountPoint: "/ARCHIVE/SUN" },
{ url: "dist/ARABART.zip", mountPoint: "/ARCHIVE/ARABART" },
{ url: "dist/ARABIC.zip", mountPoint: "/ARCHIVE/ARABIC" },
{ url: "dist/EDIT.zip", mountPoint: "/ARCHIVE/EDIT" },
{ url: "dist/FORM_X.zip", mountPoint: "/ARCHIVE/FORM_X" },
{ url: "dist/KVC.zip", mountPoint: "/ARCHIVE/KVC" },
{ url: "dist/NAMES.zip", mountPoint: "/ARCHIVE/NAMES" },
{ url: "dist/PESM.zip", mountPoint: "/ARCHIVE/PESM" },
{ url: "dist/PORTSAID.zip", mountPoint: "/ARCHIVE/PORTSAID" },
{ url: "dist/DIGI_T.zip", mountPoint: "/ARCHIVE/DIGI_T" },
{ url: "dist/TAHER.zip", mountPoint: "/ARCHIVE/TAHER" },
{ url: "dist/WINKEY.zip", mountPoint: "/ARCHIVE/WINKEY" }
]).then(function () {
//Let's build the arguments
let cmd = [];
//First we need to run ARABART, regardless if we need it.
cmd.push('-c', 'cls');
cmd.push('-c', 'cd c:\\ARCHIVE\\ARABART');
cmd.push('-c', 'ARABART.EXE > /DEV/NULL');
cmd.push('-c', 'cls');
//Now we move into the directory needed to run the program
cmd.push('-c', 'cd c:\\ARCHIVE\\' + getQueryVariable('program').split('-')[0]);
//Now, if there is a specific argument (dash), run it, otherwise just run RUN.BAT
cmd.push('-c', (getQueryVariable('program').split('-').length > 1) ? getQueryVariable('program').split('-')[1] : 'RUN.BAT')
main(cmd).then(function (ci) {
window.ci = ci;
});
});
});
</script>
</body>
</html>