forked from mattgodbolt/jsbeeb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
559 lines (538 loc) · 24.6 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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="Matt Godbolt">
<meta name="description" content="A Javascript BBC Micro emulator">
<title>JSBeeb - Javascript BBC Micro emulator</title>
<link rel="stylesheet" href="lib/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="jsbeeb.css" type="text/css">
<link rel="shortcut icon" href="/favicon.ico">
<script type="text/javascript" src="lib/require.js"></script>
<script type="text/javascript">
require(['requirejs-common'], function () {
require(['main']);
});
</script>
<script>
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-55180-8', 'godbolt.org');
ga('send', 'pageview');
</script>
<script type="text/javascript">
(function () {
var po = document.createElement('script');
po.type = 'text/javascript';
po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(po, s);
})();
</script>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="http://bbc.godbolt.org/" target="_top">jsbeeb - a Javascript BBC micro
emulator</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="dropdown btn-group">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span id="bbc-model">BBC B</span><b
class="caret"></b></a>
<ul class="dropdown-menu" role="menu" id="model-menu">
<li><a href="#" data-target="B">BBC B</a></li>
<li><a href="#" data-target="B-Econnet">BBC B (with Econet)</a></li>
<li><a href="#" data-target="Master">BBC Master 128</a></li>
<li><a href="#" data-target="MasterTurbo">BBC Master Turbo</a></li>
<li><a href="#" data-target="hard-reset">Hard reset</a></li>
<li><a href="#" data-target="soft-reset">Soft reset</a></li>
</ul>
</li>
<li class="dropdown btn-group">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Keyboard<b class="caret"></b></a>
<ul class="dropdown-menu" role="menu" id="keyboard-menu">
<li><a href="#" data-target="physical">Physical: '*' is next to Enter/Return</a></li>
<li><a href="#" data-target="natural">Natural: '*' is shift-8</a></li>
<li><a href="#" data-target="gaming">Gaming: handy for games like Zalaga</a></li>
</ul>
</li>
<li class="dropdown embed-hide">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Discs<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#sth" class="sth" data-id="discs" data-toggle="modal" data-target="#sth">From STH
archive</a></li>
<li><a href="#discs" data-toggle="modal" data-target="#discs">From examples or local</a></li>
<li class="if-drive-available">
<a href="#google-drive" id="open-drive-link">From Google Drive</a>
</li>
</ul>
</li>
<li class="dropdown embed-hide">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Cassettes<b class="caret"></b></a>
<ul class="dropdown-menu" id="tape-menu">
<li><a href="#sth" class="sth" data-toggle="modal" data-id="tapes" data-target="#sth">From STH
archive</a></li>
<li><a data-id="rewind">Rewind cassette</a></li>
<li><a href="#discs" data-toggle="modal" data-target="#tapes">From local file</a>
</li>
</ul>
</li>
<li class="dropdown embed-hide">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Share<b class="caret"></b></a>
<ul class="dropdown-menu">
<li class="social">
<g:plusone annotation="inline" width="150"></g:plusone>
</li>
<li class="social"><a href="https://twitter.com/share" class="twitter-share-button"
data-via="mattgodbolt">Tweet</a>
<script>!function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (!d.getElementById(id)) {
js = d.createElement(s);
js.id = id;
js.src = "//platform.twitter.com/widgets.js";
fjs.parentNode.insertBefore(js, fjs);
}
}(document, "script", "twitter-wjs");</script>
</li>
</ul>
</li>
<li class="dropdown embed-hide">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Contact<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="https://plus.google.com/105166465490735292917" rel="author">About Matt</a></li>
<li><a href="mailto:matt@godbolt.org">Contact Matt</a></li>
</ul>
</li>
<li><a href="#help" data-toggle="modal" data-target="#help">Help</a></li>
<li><a href="#about" data-toggle="modal" data-target="#info" id="about">About</a></li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
</div>
<div>
<div id="outer">
<div id="cub-monitor">
<img id="cub-monitor-pic" width="896" height="648" src="images/cub-monitor.png">
<div class="sidebar left"><img></div>
<canvas id="screen" width="896" height="600"></canvas>
<div class="sidebar right"><img></div>
<div class="sidebar bottom"><img></div>
</div>
</div>
<div id="leds">
<table>
<thead>
<tr>
<th>cassette<br>motor</th>
<th>caps<br>lock</th>
<th>shift<br>lock</th>
<th>drive<br>0/2</th>
<th>drive<br>1/3</th>
<th>virtual<br>MHz</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<div class="red led" id="motorlight"></div>
</td>
<td>
<div class="red led" id="capslight"></div>
</td>
<td>
<div class="red led" id="shiftlight"></div>
</td>
<td>
<div class="yellow led" id="drive0"></div>
</td>
<td>
<div class="yellow led" id="drive1"></div>
</td>
<td>
<div class="virtualMHz"></div>
</td>
</tr>
</tbody>
</table>
</div>
<div id="crtc_debug" class="initially-hidden">
<div class="crtc_state">
<h6 class="dbg">6845 state</h6>
<table>
<tbody>
<tr class="template">
<th><span class="register"></span>:</th>
<td class="value"></td>
</tr>
</tbody>
</table>
</div>
<div class="crtc_regs">
<h6 class="dbg">6845 regs</h6>
<table>
<tbody>
<tr class="template">
<th><span class="register"></span>:</th>
<td class="value"></td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="debug" class="initially-hidden">
<div class="debug-container">
<form class="form-inline" role="form" id="goto-mem-addr-form">
<div class="form-group">
<label accesskey="m" class="control-label"><span class="accesskey">M</span>em
addr:</label>
<input type="text" class="form-control input-sm goto-addr" placeholder="$0000">
</div>
</form>
<div id="memory">
<div class="template"><span class="dis_addr">0000</span><span
class="mem_bytes"><span>11</span> <span>22</span> <span>33</span> <span>44</span> <span>55</span> <span>66</span> <span>77</span> <span>88</span></span><span
class="mem_asc"><span>A</span><span>A</span><span>A</span><span>A</span><span>A</span><span>A</span><span>A</span><span>A</span></span>
</div>
</div>
</div>
<div class="debug-container">
<form class="form-inline" role="form" id="goto-dis-addr-form">
<div class="form-group">
<label accesskey="a" class="control-label"><span class="accesskey">A</span>ddr:</label>
<input type="text" class="form-control input-sm goto-addr" placeholder="$0000">
</div>
</form>
<div id="disassembly">
<div class="template dis_elem"><span class="bp_gutter"></span><span class="dis_addr">0000</span><span
class="instr_bytes">11 22 33</span><span class="instr_asc">ABC</span><span
class="disassembly">LDA (&70), X</span></div>
</div>
</div>
<div id="registers">
<div>
<span class="flag" id="cpu6502_flag_c">C</span><span class="flag" id="cpu6502_flag_z">Z</span><span
class="flag" id="cpu6502_flag_i">I</span><span class="flag" id="cpu6502_flag_d">D</span><span
class="flag" id="cpu6502_flag_v">V</span><span class="flag" id="cpu6502_flag_n">N</span>
</div>
<div><span class="register">A</span>: <span id="cpu6502_a">00</span></div>
<div><span class="register">X</span>: <span id="cpu6502_x">00</span></div>
<div><span class="register">Y</span>: <span id="cpu6502_y">00</span></div>
<div><span class="register">S</span>: <span id="cpu6502_s">00</span></div>
<div><span class="register">PC</span>: <span id="cpu6502_pc">0000</span></div>
</div>
</div>
<div id="hardware_debug" class="initially-hidden">
<div class="via_regs" id="sysvia">
<h6 class="dbg">System VIA</h6>
<table>
<tbody>
<tr class="template">
<th><span class="register"></span>:</th>
<td class="value"></td>
</tr>
</tbody>
</table>
</div>
<div class="via_regs" id="uservia">
<h6 class="dbg">User VIA</h6>
<table>
<tbody>
<tr class="template">
<th><span class="register"></span>:</th>
<td class="value"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="modal fade" id="info">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">About jsbeeb</h4>
</div>
<div class="modal-body">
<div>By <a href="http://xania.org/">Matt Godbolt</a>. Based on Tom Walker's <a
href="http://b-em.bbcmicro.com/">b-em</a> emulator. Huge thanks to him for open sourcing his
code. Big thanks too to Richard Talbot-Watkins for his help and support. The disc loaded up by
default is the amazing Elite (thanks to <a href="http://www.iancgbell.clara.net/elite/bbc/">Ian
Bell</a> for making it available).
</div>
<div>Source is on <a href="https://github.com/mattgodbolt/jsbeeb">GitHub</a>. Works best in Chrome
or Firefox. Still very much work in progress: keep coming back for bugfixes and more features!
</div>
<div>Cycle-accurate emulation greatly helped by the fantastic <a href="http://www.visual6502.org/">Visual
6502</a> Project. Consider donating to them if you enjoy this stuff as much as I do!
</div>
<div>If you're looking for more information on the BBC or to find like-minded people to chat about
the hardware or software, check out the <a href="http://www.stardot.org.uk/forums/">StarDot
forums</a>.
</div>
</div>
<!-- model-body -->
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<div class="modal fade" id="help">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Help</h4>
</div>
<div class="modal-body">
<div>This is an emulator for the <a href="http://en.wikipedia.org/wiki/Bbc_micro">BBC Micro</a>
Model B, a popular home computer in the UK in the 1980s.
</div>
<div>The default disc image is Elite - a pioneering 3D space trading game. To boot discs on the BBC,
one would press <span class="key">SHIFT</span> and <span class="key">BREAK</span>. The keyboard
of the BBC is slightly different from a modern PC, notably in the placement of the symbol
characters. Also, the current keyboard layout is optimized for a US keyboard; I am working on
improving this situation.
</div>
<h5>Handy key mappings</h5>
<table class="keymap">
<tr>
<th>BBC</th>
<th>PC</th>
<th>OSX</th>
</tr>
<tr>
<td><span class="function key">F0</span></td>
<td><span class="key">F10</span></td>
<td><span class="key">F10</span></td>
</tr>
<tr>
<td><span class="key">BREAK</span></td>
<td><span class="key">F12</span></td>
<td><span class="key">Right ⌘</span> + <span class="key">F12</span></td>
</tr>
<tr>
<td><span class="key">COPY</span></td>
<td><span class="key">End</span></td>
<td><span class="key">Right ⌘</span> + <span class="key">F11</span></td>
</tr>
<tr>
<td>
<div class="dbl key">*<br>:</div>
</td>
<td>TODO</td>
<td>TODO</td>
</tr>
<tr>
<td>Debug</td>
<td><span class="key">Ctrl-Home</span></td>
<td>TODO</td>
</tr>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<div class="modal fade" id="discs">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Load disc image</h4>
</div>
<div class="modal-body">
<ul id="disc-list">
<li class="template"><a href="#"><span class="name"></span></a> - <span
class="description"></span></li>
</ul>
To load a custom disc image, get an SSD or DSD file and load it below. Search the web, or check
somewhere
like <a href="http://www.bbcmicrogames.com/GettingStarted.html">here</a> for these. Be aware the
images are usually stored in a ZIP file, and you'll need to unzip first.
<div class="disc">
<label>Load local SSD or DSD file: <input type="file" id="disc_load"
accept=".ssd,.dsd,application/binary"></label>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<div class="modal fade" id="tapes">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Load cassette image</h4>
</div>
<div class="modal-body">
To load a custom cassette image, get a UEF file and load it below.
<div class="tape">
<label>Load local UEF file: <input type="file" id="tape_load"
accept=".uef,application/binary"></label>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<div class="modal fade" id="google-drive">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Load or create disc from your <a href="https://drive.google.com/">Google
Drive</a>
account</h4>
<div class="loading">Loading...</div>
</div>
<div class="modal-body">
<div>
<ul class="list">
<li class="template"><a href="#"><span class="name"></span></a></li>
</ul>
<div>
<form class="form-horizontal well" role="form" action="#">
<input type="text" placeholder="Create disc..." autofocus class="disc-name">
<button type="submit" class="btn btn-default create-button">Create</button>
</form>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn" data-dismiss="modal">Close</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<div class="modal fade" id="loading-dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<h4 class="modal-title loading"></h4>
<div style="display:none" id="google-drive-auth">
Google Drive requires you to authorize jsbeeb to access your files by logging in.<br>
Please click Authorize to open a Google Drive pop-up to authenticate and give permission to jsbeeb.
<form class="form-horizontal well" role="form" action="#">
<button type="submit" class="btn btn-default create-button">Authorize</button>
</form>
</div>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<div class="modal fade" id="sth">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Load from <a href="http://www.stairwaytohell.com/">Stairway to Hell</a>
archive</h4>
<div class="loading">Loading catalog from STH archive...</div>
<div class="filter">
<input type="text" placeholder="Filter..." autofocus id="sth-filter">
</div>
</div>
<div class="modal-body">
<ul id="sth-list">
<li class="template"><a href="#"><span class="name"></span></a></li>
</ul>
</div>
<div class="modal-footer">
<label class="pull-left checkbox-inline"><input type="checkbox" class="autoboot"
value="">Autoboot</label>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<div class="modal fade" id="error-dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">An error occurred - sorry!</h4>
<div>While <span class="context"></span>:</div>
<div class="error"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<div class="modal fade" id="are-you-sure">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Are you sure?</h4>
<div class="context"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default ays-no" data-dismiss="modal">No</button>
<button type="button" class="btn ays-yes">Yes</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
</body>
</html>