-
Notifications
You must be signed in to change notification settings - Fork 112
/
example_v86.html
76 lines (64 loc) · 3.34 KB
/
example_v86.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
<!--
The Emularity: An Example Computer Loader
For use with The Emularity, downloadable at http://www.emularity.com/
SIMPLE STEPS for trying an emulated computer (FreeDOS).
* Check out this repository in your browser-accessible directory;
this file as well as es6-promise.js, browserfs.min.js and loader.js
are required. The logo and images directories are optional, but the
splash screen looks quite a lot better when they're available.
* Clone: https://github.com/asiekierka/v86/tree/emularity
and run "make all".
* Copy bios/seabios.bin, bios/vgabios.bin, build/libv86.js,
build/v86.wasm to "emulators/v86".
* Optionally, acquire an 8x14 EGA font in WOFF format from:
https://int10h.org/oldschool-pc-fonts/fontlist/ and copy it to
"emulators/v86/ega437.woff".
* Download FreeDOS from: https://k.copy.sh/freedos722.img
* Place disk image in an "examples" subdirectory.
* Visit your example_v86.html file with a modern
Javascript-capable browser.
-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>example computer program</title>
<style type="text/css">
@font-face {
font-family: 'Ega437';
src: url('emulators/v86/ega437.woff') format('woff');
}
.emularity-v86-screen-text {
font-family: 'Ega437', monospace !important;
}
</style>
</head>
<body>
<canvas id="canvas" style="width: 50%; height: 50%; display: block; margin: 0 auto;" />
<script type="text/javascript" src="es6-promise.js"></script>
<script type="text/javascript" src="browserfs.min.js"></script>
<script type="text/javascript" src="loader.js"></script>
<script type="text/javascript">
var emulator = new Emulator(document.querySelector("#canvas"),
null,
new V86Loader(V86Loader.nativeResolution(800, 600),
V86Loader.scale(1),
V86Loader.emulatorJS("emulators/v86/libv86.js"),
V86Loader.emulatorWASM("emulators/v86/v86.wasm"),
V86Loader.memorySize(16),
V86Loader.mountFile("seabios.bin",
V86Loader.fetchFile("BIOS",
"emulators/v86/seabios.bin")),
V86Loader.mountFile("vgabios.bin",
V86Loader.fetchFile("VGA BIOS",
"emulators/v86/vgabios.bin")),
V86Loader.mountFile("freedos.img",
V86Loader.fetchFile("FreeDOS",
"examples/freedos722.img")),
V86Loader.bios("seabios.bin"),
V86Loader.vgaBios("vgabios.bin"),
V86Loader.fda("freedos.img"),
));
emulator.start({ waitAfterDownloading: true });
</script>
</body>
</html>