-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
126 lines (119 loc) · 7.64 KB
/
index.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<html>
<head>
<title>
CHIP8 Emulator
</title>
<meta charset="UTF-8" />
<link rel="stylesheet" href="index.css" />
</head>
<body>
<p id="dbg" style="text-align: center;"> Anything</p>
<div class="Display" id="Display">
<div class="Chip8Display" id="Chip8Display">
<canvas id="displayCanvas" width="896" height="448"></canvas>
</div>
<div class="Options">
<div class="InstructionsPerSecond">
<label id="IPSLabel">IPS</label>
<input id="ipsSlider" onchange="UpdateIPS()" title="Instructions Per Second" type="range" value="10" min="1"
max="120" />
</div>
<!-- <div>
<select>
<option>
Normal
</option>
<option>
Debugger
</option>
<option>
Editor
</option>
</select>
</div> -->
<div>
<button onclick="Toggle()" id="PlayButton">Play</button>
</div>
<div class="LoadRom">
<input type="file" hidden="hidden" id="romFileLoader" onchange="LoadRom()" />
<select onchange="SelectRom()" id="selectRom">
<option selected style="text-align: center;" value="-1">
<b>
----Select a ROM----
</b>
</option>
<option value="0">
Load ROM from file
</option>
</select>
</div>
</div>
<div class="Input">
<table>
<tbody>
<tr>
<td><button onmouseup="KeyReleased(0xa)"
onclick="KeyPressed(0xa)">A</button
onmouseup="KeyReleased(0xa)"></td>
<td><button onmouseup="KeyReleased(0xb)"
onclick="KeyPressed(0xb)">B</button
onmouseup="KeyReleased(0xa)"></td>
<td><button onmouseup="KeyReleased(0xc)"
onclick="KeyPressed(0xc)">C</button
onmouseup="KeyReleased(0xa)"></td>
<td><button onmouseup="KeyReleased(0xd)"
onclick="KeyPressed(0xd)">D</button
onmouseup="KeyReleased(0xa)"></td>
</tr>
<tr>
<td><button onmouseup="KeyReleased(0x1)"
onclick="KeyPressed(0x1)">1</button
onmouseup="KeyReleased(0xa)"></td>
<td><button onmouseup="KeyReleased(0x2)"
onclick="KeyPressed(0x2)">2</button
onmouseup="KeyReleased(0xa)"></td>
<td><button onmouseup="KeyReleased(0x3)"
onclick="KeyPressed(0x3)">3</button
onmouseup="KeyReleased(0xa)"></td>
<td><button onmouseup="KeyReleased(0xe)"
onclick="KeyPressed(0xe)">E</button
onmouseup="KeyReleased(0xa)"></td>
</tr>
<tr>
<td><button onmouseup="KeyReleased(0x4)"
onclick="KeyPressed(0x4)">4</button
onmouseup="KeyReleased(0xa)"></td>
<td><button onmouseup="KeyReleased(0x5)"
onclick="KeyPressed(0x5)">5</button
onmouseup="KeyReleased(0xa)"></td>
<td><button onmouseup="KeyReleased(0x6)"
onclick="KeyPressed(0x6)">6</button
onmouseup="KeyReleased(0xa)"></td>
<td><button onmouseup="KeyReleased(0xf)"
onclick="KeyPressed(0xf)">F</button
onmouseup="KeyReleased(0xa)"></td>
</tr>
<tr>
<td><button onmouseup="KeyReleased(0x7)"
onclick="KeyPressed(0x7)">7</button
onmouseup="KeyReleased(0xa)"></td>
<td><button onmouseup="KeyReleased(0x8)"
onclick="KeyPressed(0x8)">8</button
onmouseup="KeyReleased(0xa)"></td>
<td><button onmouseup="KeyReleased(0x9)"
onclick="KeyPressed(0x9)">9</button
onmouseup="KeyReleased(0xa)"></td>
<td><button onmouseup="KeyReleased(0x0)"
onclick="KeyPressed(0x0)">0</button
onmouseup="KeyReleased(0xa)"></td>
</tr>
</tbody>
</table>
</div>
</div>
<script src="chip8.js"></script>
<script src="display.js"></script>
<script src="mainLoop.js"></script>
<script src="index.js"></script>
</body>
</html>