-
Notifications
You must be signed in to change notification settings - Fork 0
/
debug.html
115 lines (104 loc) · 6.56 KB
/
debug.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
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="static/style.css"/>
</head>
<body>
<div id="top">
<span><a style="text-decoration:none;color:inherit;" href="/index.html">CHIP8 EMULATOR</a><span>by Wojciech Linowski</span></span>
<a href="/docs.html" >DOCS</a>
<a href="/editor.html" >EDITOR</a>
<a href="/debug.html" >DEBUG</a>
<a href="/test.html" >TESTS</a>
</div>
<div id="content">
<div id="files">
<div id="files-frame-1">
<div id="files-frame-2">
<div id="files-frame-3">
<p>Upload chip8 program:</p>
<button id="upload-button" onclick="document.getElementById('fileInput').click()">UPLOAD</button>
<input id="fileInput" type="file" accept=".ch8" hidden="true"/>
<p>Or choose from below:</p>
<div class="custom-select">
<select id="program-select" onchange="selectProgram(this);">
<option value="">Select a game:</option>
<option value="programs/brix.ch8">brix</option>
<option value="programs/pong.ch8">pong</option>
<option value="programs/puzzle.ch8">puzzle</option>
<option value="programs/space_flight.ch8">space flight</option>
<option value="programs/space_invaders.ch8">space invaders</option>
<option value="programs/tetris.ch8">tetris</option>
<option value="programs/tic-tac-toe.ch8">tic-tac-toe</option>
</select>
</div>
</div>
</div>
</div>
</div>
<div id="screen">
<div id="screen-frame-1">
<div id="screen-frame-2">
<div id="screen-frame-3">
<div id="screen-frame-4">
<canvas id="emulator-display"></canvas>
<div id="screen-tooltip">
</div>
</div>
</div>
</div>
</div>
</div>
<div id="keyboard">
<div id="keyboard-frame-1">
<div id="keyboard-frame-2">
<div id="keyboard-frame-3">
<table id="keyboard-table">
<tr>
<td><button onmouseup="chip8.pressedKeys[49] = false" onmousedown="chip8.pressedKeys[49] = true">1</button></td>
<td><button onmouseup="chip8.pressedKeys[50] = false" onmousedown="chip8.pressedKeys[50] = true">2</button></td>
<td><button onmouseup="chip8.pressedKeys[51] = false" onmousedown="chip8.pressedKeys[51] = true">3</button></td>
<td><button onmouseup="chip8.pressedKeys[52] = false" onmousedown="chip8.pressedKeys[52] = true">C</button></td>
</tr>
<tr>
<td><button onmouseup="chip8.pressedKeys[81] = false" onmousedown="chip8.pressedKeys[81] = true">4</button></td>
<td><button onmouseup="chip8.pressedKeys[87] = false" onmousedown="chip8.pressedKeys[87] = true">5</button></td>
<td><button onmouseup="chip8.pressedKeys[69] = false" onmousedown="chip8.pressedKeys[69] = true">6</button></td>
<td><button onmouseup="chip8.pressedKeys[82] = false" onmousedown="chip8.pressedKeys[82] = true">D</button></td>
</tr>
<tr>
<td><button onmouseup="chip8.pressedKeys[65] = false" onmousedown="chip8.pressedKeys[65] = true">7</button></td>
<td><button onmouseup="chip8.pressedKeys[83] = false" onmousedown="chip8.pressedKeys[83] = true">8</button></td>
<td><button onmouseup="chip8.pressedKeys[68] = false" onmousedown="chip8.pressedKeys[68] = true">9</button></td>
<td><button onmouseup="chip8.pressedKeys[70] = false" onmousedown="chip8.pressedKeys[70] = true">E</button></td>
</tr>
<tr>
<td><button onmouseup="chip8.pressedKeys[90] = false" onmousedown="chip8.pressedKeys[90] = true">A</button></td>
<td><button onmouseup="chip8.pressedKeys[88] = false" onmousedown="chip8.pressedKeys[88] = true">0</button></td>
<td><button onmouseup="chip8.pressedKeys[67] = false" onmousedown="chip8.pressedKeys[67] = true">B</button></td>
<td><button onmouseup="chip8.pressedKeys[86] = false" onmousedown="chip8.pressedKeys[86] = true">F</button></td>
</tr>
</table>
</div>
</div>
</div>
<div id="keyboard-tooltip">
Original CHIP-8 keyboard layout is <br>mapped to PC keyboard as follows:
<br><br>
|1|2|3|C| => |1|2|3|4|<br>
|4|5|6|D| => |Q|W|E|R|<br>
|7|8|9|E| => |A|S|D|F|<br>
|A|0|B|F| => |Z|X|C|V|<br><br>
</div>
</div>
</div>
<div id="debug_console">
<label for="clock_speed">Clock Speed:</label><input onchange="window.changeClockSpeed(this.value)" id="clock_speed" name="clock_speed" type="number" min="0" max="1000" value="60"/>
<br>
<label for="manual_pass">Manual Pass:</label><input onchange="window.CheckManualPass(this.checked)" id="manual_pass" name="manual_pass" type="checkbox" checked="true">
<br>
<label for="pass">Pass:</label><button onclick="window.nextInstruction()" id="pass" name="pass">NEXT INSTRUCTION</button>
</div>
<script type="module" src="main.js"></script>
</body>
</html>