-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
207 lines (174 loc) · 5.95 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
<!doctype html>
<head>
<title>Boyo — a Game Boy emulator written in JavaScript</title>
<meta charset="utf-8">
<script src="src/utils.js"></script>
<script src="src/constants.js"></script>
<script src="src/memory.js"></script>
<script src="src/cartridge.js"></script>
<script src="src/instructions.js"></script>
<script src="src/cpu.js"></script>
<script src="src/video.js"></script>
<script src="src/audio.js"></script>
<script src="src/joypad.js"></script>
<script src="src/gb.js"></script>
<script src="src/debugger.js"></script>
<script src="libs/underscore.min.js"></script>
<script src="libs/stats.min.js"></script>
<link rel="stylesheet" type="text/css" href="screen.css"/>
</head>
<body>
<header>
<h1>Boyo</h1>
<h2> — a Game Boy emulator written in JavaScript <a href="https://github.com/merwaaan/boyo.js">(→ source)</a></h2>
</header>
<div id="game">
<canvas width="160" height="144"></canvas>
<p id="controls">
<button id="emulator-toggle" disabled>Resume</button>
<button id="gb-reset">Reset</button>
</p>
<table>
<tr>
<td>
<select id="hosted_rom">
<option disabled selected hidden="hidden">Try one of the available ROMs</option>
<optgroup label="Homebrew games">
<option>Espionage - Fredrik Brundin</option>
<option>Adjustris - Dave Vanee</option>
</optgroup>
<optgroup label="Demos">
<option>gejmbåj - Snorpung</option>
<option>oh! - Snorpung</option>
<option>20y - Snorpung</option>
<option>demon blood - Youth Uprising</option>
</optgroup>
<optgroup label="Chiptune">
<option>Music Tech - PIXELH8</option>
<option>Little Sound Dj (demo) - Johan Kotlinski</option>
</optgroup>
<optgroup label="Blargg's tests">
<option>cpu_instrs</option>
<option>dmg_sound</option>
<option>dmg_sound-2</option>
<option>instr_timing</option>
<option>mem_timing</option>
<option>mem_timing-2</option>
<option>oam_bug</option>
<option>oam_bug-2</option>
</optgroup>
</select>
</td>
<td>
<p>OR</p>
</td>
<td>
<p>Open your own ROM</p>
<input type="file" id="local_rom"/>
</td>
</tr>
</table>
</div>
<aside>
<span id="expand_button">MENU</span>
<section id="settings">
<h3>Settings</h3>
<section id="palettes">
<h4>Palettes</h4>
</section>
<section id="sound">
<h4>Sound</h4>
<input type="checkbox" name="pulse1" checked/><label>pulse1</label>
<input type="checkbox" name="pulse2" checked/><label>pulse2</label>
<input type="checkbox" name="wave" checked/><label>wave</label>
<input type="checkbox" name="noise" checked/><label>noise</label>
</section>
</section>
<section id="debugger">
<h3>Debugger</h3>
<section id="buttons">
<button>Pause</button>
<button>Step</button>
<button>Run</button>
</section>
<section id="registers">
<h4>Registers</h4>
<table>
<tr><td>AF</td><td></td></tr>
<tr><td>BC</td><td></td></tr>
<tr><td>DE</td><td></td></tr>
<tr><td>HL</td><td></td></tr>
<tr><td>SP</td><td></td></tr>
<tr><td>PC</td><td></td></tr>
</table>
<div id="flags">
<input type="checkbox" name="zero"/><label>Z</label>
<input type="checkbox" name="addsub"/><label>N</label>
<input type="checkbox" name="halfcarry"/><label>H</label>
<input type="checkbox" name="carry"/><label>C</label>
</div>
</section>
<section id="memory">
<h4>Memory</h4>
<input type="text" name="address" value="0"/>
<button name="go_to_address">Go to address</button>
<table>
</table>
</section>
<section id="breakpoints">
<h4>Breakpoints</h4>
<input type="text" name="breakpoint"/>
<button name="add_breakpoint">Add breakpoint</button>
<ul>
</ul>
</section>
<section id="video">
<h4>Graphics</h4>
<canvas width="128" height="192" id="tile_data"></canvas>
<canvas width="256" height="256" id="background_map_0"></canvas>
<canvas width="256" height="256" id="background_map_1"></canvas>
<table id="oam"></table>
</section>
</section>
<section id="about">
<h3>About</h3>
<p>By <a href="https://github.com/merwaaan">merwaaan</a> and <a href="https://github.com/fmdkdd">fmdkdd</a></p>
<p>Source on <a href="https://github.com/merwaaan/boyo.js">GitHub</a></p>
</section>
<section id="changelog">
<h3>Changelog</h3>
<section>
<h4>0.2</h4>
<ul>
<li>Sound</li>
<li>Battery-backed RAM saved with localStorage</li>
<li>TODO: more mBCs</li>
<li>TODO: UI</li>
</ul>
</section>
<section>
<h4>0.1</h4>
<ul>
<li>CPU: instruction set, interrupts, timers</li>
<li>LCD: background, window and sprite display</li>
<li>MBC: none, MBC1</li>
<li>Debugger: registers, memory, tile data, bakground maps, OAM</li>
<li>Joypad input through keyboard</li>
</ul>
</section>
</section>
</aside>
<script>
var sections = document.querySelectorAll('aside > section h3, aside > section > section h4');
for (var i = 0; i < sections.length; ++i) {
sections[i].addEventListener('click', function() {
this.parentNode.className = this.parentNode.className == 'expanded' ? '' : 'expanded';
});
}
// Initialize Boyo!
window.addEventListener('load', function() {
X.GB.init();
});
</script>
</body>
</html>