forked from vAmigaWeb/vAmigaWeb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
393 lines (388 loc) · 19.9 KB
/
index.php
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
<?php
// What's this?
//
// - replaces shell.html
// - includes register-sw.js, shell-init.js and keeps this file somewhat small
// - after build, run "php -S 0.0.0.0:3000" or something
define("COPPENHEIMER_VERSION", "0.2");
define("COPPENHEIMER_TIMESTAMP", "2024-06-26");
?><!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Coppenheimer <?php echo COPPENHEIMER_VERSION; ?></title>
<style>
:root{--text:#000;--distext:#00000044;--dark:#53493a;--light:#fff;--bg:#c8b9a1;--bghi:#d3c8b4;--blue:#706fbf;--bluetrans:#706fbf88;}
body{margin:0;padding:4px;font-family:sans-serif;color:var(--text);background-color:var(--bg);font-size:12px;}
button,label,select,dialog{font-size:12px;color:var(--text);}
small{font-size:11px;}
h2{font-size:16px;margin:0 0 8px;}
h3{font-size:14px;margin:0 0 8px;}
button{border-image:url("img/button1-b.png") 2;background-color:var(--bg);border-width:2px;text-align:left;}
button:disabled,button:disabled:hover,button:disabled:active:hover{background-color:var(--bg);color:var(--distext);border-image:url("img/button3-b.png") 2;}
select{border-image:url("img/button1-b.png") 2;background-color:var(--bg);border-width:2px;}
select:hover,button:hover{background-color:var(--bghi);}
#select-bpls{overflow:auto;}
button:active{border-image:url("img/button2-b.png") 2;background-color:var(--blue);}
canvas{border-image:url("img/button2-b.png") 2;border-style:outset;border-width:2px;}
a{color:var(--dark);}
a:hover{color:var(--light);}
#main{display:flex;gap:4px;padding:4px;}
#mem-div{}
[type="text"]{border-image:url("img/string-gadget-b.png") 4;border-width:4px;background-color:var(--bg);}
[type="text"]:focus{border-width:4px;background-color:var(--bghi);}
[type="checkbox"]{display:none;}
[type="checkbox"]+label{background:url('img/check2-b.png') no-repeat;display:inline-block;padding:5px 4px 1px 30px;;user-select:none;height:16px;}
[type="checkbox"]:checked+label{background-image:url('img/check1-b.png');}
[type="checkbox"]:checked:disabled+label{background-image:url('img/check3-b.png');}
input.mono{font-size:12px;}
#virtual_keyboard,#replace-me{display:none;}
dialog{font-size:14px;background-color:var(--bg);border-image:url("img/button1-b.png") 2;border-width:2px;}
dialog[open]::backdrop{background-color:var(--bluetrans);}
dialog h2{margin-top:0;}
.dialog-bottom{margin-top:8px;display:flex;gap:4px;justify-content:end;}
.dialog-top{margin-bottom:8px;display:flex;gap:4px;justify-content:space-between;}
*:focus{outline:none;}
.w-xl{width:256px;}
.w-lg{width:192px;}
.w-mid{width:128px;}
.w-mid2{width:260px;}
.w-sm{width:64px;}
.vpad{padding-top:3px;padding-bottom:3px;}
.drop-area{width:188px;height:128px;border-image:url("img/button2-b.png") 2;border-width:2px;border-style:solid;display:flex;align-items:center;justify-content:space-around;}
.lowered-border{border-image:url("img/button2-b.png") 2;border-width:2px;border-style:solid;}
.hw-led{background-color:#444;height:16px;padding-top:2px;width:54px;text-align: center;color: #991;font-family:monospace;}
.hw-led.red{background-color:#f23;}
.hw-led.yellow{background-color:#fe1;}
.floppy-area{width:252px;height:18px;overflow:hidden}
.center{text-align:center;}
.blue-center{text-align:center;background-color:var(--blue);color:var(--light);}
.floppy-area+.d-flex{justify-content:space-between;margin-top:2px;}
.mono{font-family:monospace;}
.d-none{display:none !important;}
.d-flex{display:flex;gap:4px;}
.d-vflex{display:flex;gap:4px;flex-direction:column;}
.d-btw{justify-content:space-between;}
.d-col{flex:1;}
.d-end{align-items:end;}
.d-cnt{align-items:center;}
.mb-0{margin-bottom:0;}
.mt-1{margin-top:4px;}
#maincontrols>div{display:flex;gap:4px;width:479px;}
#snapshot-list{overflow:auto;max-height:67vh;}
#retroshell-input{font-family:monospace;}
#retroshell-output{width:1024px;height:67vh;}
#button-pause img{vertical-align:bottom;}
#button-pause span{float:right;}
.hide-paused,.paused .show-paused{display:inline;}
.show-paused,.paused .hide-paused{display:none;}
summary{cursor:pointer;padding:2px;border-bottom:2px solid var(--dark);margin-bottom:2px;}
.monitor{height:64px;width:116px;}
details .d-flex{gap:0;}
</style>
<script>
var COPPENHEIMER_VERSION = "<?php echo COPPENHEIMER_VERSION; ?>";
<?php include("shell-template-snippets/register-sw.js"); ?>
</script>
<script src="js/jquery-3.6.0.min.js"></script>
<script src="js/bootstrap.bundle.min.js"></script>
<script src="js/ringbuffer.js"></script>
<script src="js/vAmiga_canvas-modified.js"></script>
<script src="js/vAmiga_canvas_gl_fast.js"></script>
<script src="js/vAmiga_ui-modified.js?<?php echo COPPENHEIMER_VERSION; ?>"></script>
<script src="js/vAmiga_storage.js?<?php echo COPPENHEIMER_VERSION; ?>">"></script>
<script src="js/vAmiga_keyboard.js?<?php echo COPPENHEIMER_VERSION; ?>">"></script>
<script src="js/jszip.min.js"></script>
</head>
<body>
<dialog id="dialog-missing-rom">
<h2>Welcome!</h2>
<div class="d-vflex">
<p>Please select a Kickstart ROM or load a snapshot to get started.<br>Kickstart 1.3 recommended!</p>
<button class="button-select-rom w-mid vpad">Kickstart ROM…</button>
<button class="button-snapshot-from-url w-mid vpad" data-fetch-aros="true" data-url="snapshots/transhuman_snapshot_M3fd8W40.vAmiga">Demo: Transhuman</button>
<button class="button-snapshot-from-url w-mid vpad" data-fetch-aros="true" data-url="snapshots/9fingers_snapshot_M1a396W44.vAmiga">Demo: 9 Fingers</button>
<button class="button-snapshot-from-url w-mid vpad" data-fetch-aros="true" data-url="snapshots/Rink_a_Dink_snapshot_M6002cW42.vAmiga">Demo: Rink-A-Dink</button>
</div>
<div class="dialog-bottom">
<button class="js-close-containing-dialog">Close</button>
</div>
</dialog>
<dialog id="dialog-examples">
<h2>Example snapshots</h2>
<div class="d-vflex">
<button class="button-snapshot-from-url w-mid vpad" data-fetch-aros="true" data-url="snapshots/transhuman_snapshot_M3fd8W40.vAmiga">Demo: Transhuman</button>
<button class="button-snapshot-from-url w-mid vpad" data-fetch-aros="true" data-url="snapshots/9fingers_snapshot_M1a396W44.vAmiga">Demo: 9 Fingers</button>
<button class="button-snapshot-from-url w-mid vpad" data-fetch-aros="true" data-url="snapshots/Rink_a_Dink_snapshot_M6002cW42.vAmiga">Demo: Rink-A-Dink</button>
</div>
<div class="dialog-bottom">
<button class="js-close-containing-dialog">Close</button>
</div>
</dialog>
<dialog id="dialog-rom">
<h2>Select Kickstart ROM</h2>
<div class="d-flex">
<div class="d-col">
<p>Kickstart</p>
<p>
<select id="select-stored-rom" class="w-lg"></select>
<br>
<button id="button-delete-rom" disabled="disabled">Delete slot</button>
<form id="file-form-kickstart" class="d-none"><input id="file-kickstart" type="file" accept=".rom"></form>
</p>
<div id="drop-kickstart" class="drop-area"><span>Drop file or click</span></div>
</div>
<div class="d-col">
<p>Kickstart ext. (optional)</p>
<p>
<select id="select-stored-rom-ext" class="w-lg"></select>
<br>
<button id="button-delete-rom-ext" disabled="disabled">Delete slot</button>
<form id="file-form-kickstart-ext" class="d-none"><input id="file-kickstart-ext" type="file" accept=".rom"></form>
</p>
<div id="drop-kickstart-ext" class="drop-area"><span>Drop file or click</span></div>
</div>
</div>
<p>
<button id="button_fetch_open_roms">Install AROS m68k ROMS</button> <a href="https://en.wikipedia.org/wiki/AROS_Research_Operating_System" target="_blank">Learn more…</a><br>
</p>
<div class="dialog-bottom">
<button class="js-close-containing-dialog">Close</button>
</div>
</dialog>
<dialog id="dialog-snapshots">
<h2>Select snapshot</h2>
<div id="snapshot-list">
</div>
<div class="dialog-bottom">
<button id="button-load-snapshot-file">Load from file…</button>
<form id="file-form-snapshot" class="d-none"><input id="file-snapshot" type="file" accept=".vAmiga"></form>
<button class="js-close-containing-dialog">Close</button>
</div>
</dialog>
<dialog id="dialog-debugger">
<h2>Debugger (vAmiga Retro Shell)</h2>
<p>Note: This is very rudimentary, but you can talk to the shell a little…</p>
<div class="d-vflex">
<textarea id="retroshell-output"></textarea>
<input type="text" id="retroshell-input">
</div>
<div class="dialog-bottom">
<button class="js-close-containing-dialog">Close</button>
</div>
</dialog>
<dialog id="dialog-about">
<h2>Coppenheimer</h2>
<p>An alternative UI for vAmigaWeb. Version <?php echo COPPENHEIMER_VERSION; ?> (<?php echo COPPENHEIMER_TIMESTAMP; ?>)</p>
<div class="lowered-border" style="padding:0 16px">
<!--<p>An alternative UI for vAmigaWeb and some vAmiga patches – because I was jealous of <a href="https://sourceforge.net/projects/c64-debugger/" target="_blank">C64 65XE NES Debugger</a> and the likes.</p>-->
<p>Release notes on <a href="https://github.com/losso3000/coppenheimer" target="_blank">GitHub</a>, some background on <a href="https://heckmeck.de/amigastyle/coppenheimer/" target="_blank">heckmeck.de</a>.</p>
<p><strong>Note:</strong> I did not write the emulator, or any of the cool stuff! <code>:)</code> Credits:</p>
<ul>
<li><a href="https://dirkwhoffmann.github.io/vAmiga/" target="_blank">vAmiga</a> by Dirk Hoffmann</li>
<li><a href="https://vamigaweb.github.io/doc/about.html" target="_blank">vAmigaWeb</a> by mithrendal</li>
<li>Using <a href="https://aros.sourceforge.io/introduction/ports.php#aros-amiga-m68k" target="_blank">AROS m68 replacement ROMS</a> by the AROS team</li>
</ul>
<p>To get started, you may try this:</p>
<ul>
<li>Load one of the example snapshots</li>
<li>Drag the large memory area around</li>
<li>Adjust display width using the mouse wheel</li>
<li>Use “Guess” to identify current bitmap areas</li>
<li>Click into the memory overview to jump around</li>
<li>Use up/down arrows and shift in address/width fields</li>
</ul>
<p>Also check out the other browser-based Amiga emulators:<br>
<a href="https://vamiganet.github.io/" target="_blank">vAmiga.net</a>,
<a href="https://vamigaweb.github.io/" target="_blank">vAmigaWeb</a>,
<a href="https://www.neoartcr.com/vamiga/index.htm" target="_blank">neoartcr’s vAmiga port</a>,
<a href="https://scriptedamigaemulator.net/" target="_blank">Scripted Amiga Emulator</a>
</p>
<p>Happy peeking!<br>Losso/AttentionWhore</p>
</div>
<div class="dialog-bottom">
<button class="js-close-containing-dialog">Close</button>
</div>
</dialog>
<dialog id="dialog-guesses" style="margin:0;">
<h2>Possible bitplane areas</h2>
<select id="select-bpls" size="20" class="w-xl lowered-border mono">
</select>
<div class="dialog-bottom">
<button id="button-guess-again">Guess again</button>
<button class="js-close-containing-dialog">Close</button>
</div>
</dialog>
<div id="replace-me">
<input type="text" id="search">
<textarea id="output"></textarea>
<div id="spinner">spinner</div>
<progress value="0" max="100" id="progress" hidden=1></progress>
<div id="status">status</div>
<div class="collapse" style="user-select: none;" id="virtual_keyboard">
<div class="justify-content-center" id="vbk_scroll_area"
style="display: flex;flex-wrap: nowrap;overflow-x: auto;overflow-y: hidden">
<div style="display:flex;padding-top:2px;position: relative;min-width: 0;max-width: 100%">
<div id="divKeyboardRows"></div>
</div>
</div>
</div>
<p>Debug</p>
<!--<button id="button-settings">Settings</button>-->
<form id="theFileInput" style="display: inline-block;">
<div id="drop_zone" class="px-1 u-full-width mr-1" data-toggle="tooltip" data-placement="bottom" title="drop .adf, .dms, .exe, .hdf .vAmiga or .zip files into here, or just click into the drop zone">
CLICK TO INSERT DISK
</div>
<!-- iOS won't work with accept=".g64,.d64,.crt,.prg,.bin" on d64 files -->
<input id="filedialog" name="theFileDialog" type="file" style="display:none"">
</form>
<div id="div_drive_select" ontouchstart="event.stopPropagation()"></div>
</div>
<div class="d-flex">
<div class="d-vflex">
<canvas width="739" height="572" id="canvas" tabindex="-1"></canvas>
<div class="d-flex d-btw" style="max-width:743px">
<div id="maincontrols" class="d-vflex">
<div>
<button id="button-reset" class="w-mid">Reset</button>
<button id="button-pause" class="w-mid"><img width="9" height="14" class="show-paused" src="img/play.png"><img width="9" height="14" class="hide-paused" src="img/pause.png"><span class="show-paused">Paused</span><span class="hide-paused">Running</span></button>
<button id="button-step" class="w-mid" disabled>Step</button>
<input id="checkbox-warp" type="checkbox"><label for="checkbox-warp">Warp</label>
</div>
<div>
<button id="button-snapshot" class="w-mid">Take snapshot</button>
<button id="button-snapshots" class="w-mid">Snapshots…</button>
<button id="button-debugger" class="w-mid">Debugger</button>
<input id="checkbox-dma" type="checkbox"><label for="checkbox-dma">DMA</label>
</div>
<div>
<button class="button-select-rom w-mid">Kickstart ROM…</button>
<select id="port1" class="w-mid" data-toggle="tooltip" data-placement="left" title="game port 1">
<option value="none">Game port 1</option>
<option value="keys">cursor key (move) space (fire)</option>
<option value="mouse">mouse </option>
</select>
<select id="port2" class="w-mid" data-toggle="tooltip" data-placement="left" title="game port 2">
<option value="none">Game port 2</option>
<option value="keys">cursor key (move) space (fire)</option>
<option value="mouse">mouse</option>
</select>
<div id="power-led" class="d-col hw-led lowered-border"></div>
</div>
<div>
<div class="w-sm"><input id="checkbox-df0" type="checkbox" checked="checked" disabled="disabled"><label for="checkbox-df0">DF0:</label><form id="file-form-df0" class="d-none"><input id="file-df0" type="file" accept=".adf,.dms,.exe"></form></div>
<div id="drop-df0" class="drop-area floppy-area"><span id="desc-df0">Drop file or click</span></div>
<button id="eject-df0" class="w-sm">Eject</button>
<div id="led-df0" class="d-col hw-led disk lowered-border"></div>
</div>
<div>
<div class="w-sm"><input id="checkbox-df1" type="checkbox"><label for="checkbox-df1">DF1:</label><form id="file-form-df1" class="d-none"><input id="file-df1" type="file" accept=".adf,.dms,.exe"></form></div>
<div id="drop-df1" class="drop-area floppy-area"><span id="desc-df1">Drop file or click</span></div>
<button id="eject-df1" class="w-sm">Eject</button>
<div id="led-df1" class="d-col hw-led disk lowered-border"></div>
</div>
<div class="d-btw">
<input id="spritesdisable" class="layer" type="checkbox"><label for="spritesdisable">Disable Sprites</label>
<input id="playfield1" class="layer" type="checkbox"><label for="playfield1">Disable playfield 1</label>
<input id="playfield2" class="layer" type="checkbox"><label for="playfield2">Disable playfield 2</label>
<input id="checkbox-mute" class="layer" type="checkbox"><label for="checkbox-mute">Mute</label>
</div>
<div class="d-col">
</div>
<div>
<div class="w-mid2 lowered-border" style="height:82px;background-image:url('img/coppenheimer.png');background-repeat:no-repeat;background-position:center center;"></div>
<div class="d-col d-vflex d-btw" style="height:86px">
<div class="d-vflex">
<div><strong>Coppenheimer <?php echo COPPENHEIMER_VERSION; ?></strong></div>
<div>Realtime Amiga monitor</div>
<div>Powered by vAmiga and vAmigaWeb</div>
</div>
<div class="d-flex">
<button id="button-about" class="d-col">About</button>
<button id="button-examples" class="d-col">Examples</button>
</div>
</div>
</div>
</div>
<div>
<canvas id="mempreview" width="256" height="256"></canvas>
<div>
<input id="checkbox-livepreview" type="checkbox" checked="checked"><label for="checkbox-livepreview">Live overview (chip+fast)</label>
</div>
</div>
</div>
<div>
<details id="dma-usage">
<summary>DMA usage</summary>
<div class="d-flex">
<div class="d-col"><canvas class="monitor" id="monitor-blitter"></canvas><div>Blitter</div></div>
<div class="d-col"><canvas class="monitor" id="monitor-copper"></canvas><div>Copper</div></div>
<div class="d-col"><canvas class="monitor" id="monitor-disk"></canvas><div>Disk</div></div>
<div class="d-col"><canvas class="monitor" id="monitor-audio"></canvas><div>Audio</div></div>
<div class="d-col"><canvas class="monitor" id="monitor-sprite"></canvas><div>Sprite</div></div>
<div class="d-col"><canvas class="monitor" id="monitor-bitplane"></canvas><div>Bitplane</div></div>
</div>
</details>
<details id="mem-usage">
<summary>CPU reads and writes</summary>
<div class="d-flex">
<div class="d-col"><canvas class="monitor" id="monitor-chip-r"></canvas><div>Chipmem reads</div></div>
<div class="d-col"><canvas class="monitor" id="monitor-chip-w"></canvas><div>Chipmem writes</div></div>
<div class="d-col"><canvas class="monitor" id="monitor-fast-r"></canvas><div>Fastmem reads</div></div>
<div class="d-col"><canvas class="monitor" id="monitor-fast-w"></canvas><div>Fastmem writes</div></div>
<div class="d-col"><canvas class="monitor" id="monitor-rom-r"></canvas><div>ROM reads</div></div>
<div class="d-col"></div>
</div>
</details>
</div>
</div>
<div id="mem-div">
<canvas id="memcanvas" width="704" height="806" ></canvas>
<div class="d-flex d-btw">
<div class="d-vflex">
<div class="d-flex">
<input id="checkbox-livedump" type="checkbox" checked="checked"><label for="checkbox-livedump">Live monitor</label>
<input id="checkbox-livedump-adapt" type="checkbox" checked="checked"><label for="checkbox-livedump-adapt">Adapt to window</label>
</div>
<select id="select-livedump-colors" class="w-lg vpad">
<option value="df942a,371d20">Amber</option>
<option value="53493a,c8b9a1">Beige</option>
<option value="ffffff,000000">White on black</option>
<option value="000000,ffffff">Black on white</option>
<option value="ffffff,0055aa">Kick 1.x</option>
<option value="000000,aeaeae">Kick 2.x</option>
<!--<option value="00459a,1065ba">rez 1</option>wp1.gif from chiptune.com, 1.x blue-->
<!--<option value="818181,a1a1a1">rez 2</option>wp2.gif from chiptune.com, gray-->
<!--<option value="707090,9090b0">rez 3</option>wp3.gif from chiptune.com, blueish-->
<!--<option value="507090,305070">rez 4</option>wp4.gif from chiptune.com, cyan-blue-->
<!--<option value="a49484,bcac9c">rez 5</option>wp5.gif from chiptune.com, cyan-blue-->
</select>
</div>
<div class="d-vflex">
<button id="button-guess-bitplanes" class="w-mid d-col center">Guess!</button>
</div>
<div class="d-vflex d-end">
<div class="d-flex d-cnt">
<div>Address:</div>
<input id="memdump-info-start" type="text" value="000000" class="w-sm mono">
<button class="w-sm vpad" id="button-memdump-chip">Chip</button>
<button class="w-sm vpad" id="button-memdump-fast">Fast</button>
</div>
<div class="d-flex d-cnt">
<div>Width:</div>
<input id="memdump-info-width" type="text" value="0" class="w-sm mono">
<button class="w-sm vpad" id="mempreview-reset-width">Reset</button>
<button class="w-sm vpad" id="mempreview-width-40">40</button>
</div>
</div>
</div>
</div>
</div>
<div id="botr" style="width:1px;height:1px;position:fixed;right:0;bottom:0"></div>
<script>
<?php include("shell-template-snippets/shell-init.js"); ?>
</script>
<script async type="text/javascript" src="vAmiga.js"></script>
</body>
</html>