-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
761 lines (699 loc) · 36.4 KB
/
index.php
File metadata and controls
761 lines (699 loc) · 36.4 KB
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
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
<?php
// check if ?share parameter is set
if (isset($_GET['share'])) {
$share = $_GET['share'];
echo "<script>console.log('Share parameter is set to: $share');</script>";
// get the share from the API using php curl
$url = "https://api.retrogamecoders.com/api/shares/$share";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
// parse the response as JSON
$data = json_decode($response, true);
$project = $data['share']['project'];
$title = $project['title'];
$description = $project['description'];
$featured_image_url = $project['featured_image_url'] ?? '';
$public = $project['public'];
$owner = $data['share']['owner'];
$attribution = $data['share']['attribution'];
//print_r($project);
//print_r($owner);
//print_r($attribution);
} else {
echo "<script>console.log('Share parameter is not set');</script>";
$title = "Online C, BASIC, TRSE,and Assembler IDE for Vintage Computers and Consoles";
$description = "Edit, compile, and run retro code for BBC Micro, C64, Atari, ZX Spectrum, and more in the browser.";
$featured_image_url = "https://retrogamecoders.com/wp-content/uploads/2025/08/Online-Retro-IDE.png";
}
$default_og_image = "https://retrogamecoders.com/wp-content/uploads/2025/08/Online-Retro-IDE.png";
if (!is_string($featured_image_url) || trim($featured_image_url) === '') {
$featured_image_url = $default_og_image;
} elseif (!preg_match('#^https?://#i', $featured_image_url)) {
$featured_image_url = 'https://api.retrogamecoders.com' . (str_starts_with($featured_image_url, '/') ? '' : '/') . $featured_image_url;
}
$scheme = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https' : 'http';
$host = $_SERVER['HTTP_HOST'] ?? '';
$requestUri = $_SERVER['REQUEST_URI'] ?? '/';
$og_url = ($host !== '') ? ($scheme . '://' . $host . $requestUri) : 'https://ide.retrogamecoders.com/';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title><?php echo $title; ?> - Retro Game Coders IDE</title>
<link rel="manifest" href="manifest.json">
<link rel="icon" type="image/x-icon" href="https://retrogamecoders.com/favicon.ico">
<!-- Open Graph / Twitter cards -->
<meta property="og:title" content="<?php echo $title; ?> - Retro Game Coders IDE">
<meta property="og:description" content="<?php echo $description; ?>">
<meta property="og:type" content="website">
<meta property="og:url" content="<?php echo htmlspecialchars($og_url, ENT_QUOTES, 'UTF-8'); ?>">
<meta property="og:image" content="<?php echo htmlspecialchars($featured_image_url, ENT_QUOTES, 'UTF-8'); ?>">
<meta property="og:image:secure_url" content="<?php echo htmlspecialchars($featured_image_url, ENT_QUOTES, 'UTF-8'); ?>">
<meta property="og:image:alt" content="<?php echo htmlspecialchars($title, ENT_QUOTES, 'UTF-8'); ?>">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="<?php echo $title; ?> - Retro Game Coders IDE">
<meta name="twitter:description" content="<?php echo $description; ?>">
<meta name="twitter:image" content="<?php echo htmlspecialchars($featured_image_url, ENT_QUOTES, 'UTF-8'); ?>">
<meta name="googlebot" content="noindex" />
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="application-name" content="RGC IDE">
<meta name="apple-mobile-web-app-title" content="RGC IDE">
<meta name="theme-color" content="#ffffff">
<meta name="msapplication-navbutton-color" content="#ffffff">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="msapplication-starturl" content="/index.php">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=yes">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<link rel="apple-touch-icon" href="/images/icon.png">
<style type="text/css" media="screen">
body {
overflow: hidden;
font-size: 11px;
}
</style>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-HVMZQH7SBE"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-HVMZQH7SBE', {
anonymize_ip: true
});
</script>
</head>
<body>
<div id="controls_top" class="disable-select">
<div id="controls_dynamic" style="visibility:hidden">
<!-- main menu -->
<span class="dropdown">
<a class="btn dropdown-toggle toolbarMenuButton" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="Menu">
<span class="glyphicon glyphicon-menu-hamburger" aria-hidden="true"></span>
<span class="caret"></span>
</a>
<ul class="dropdown-menu dropdown-menu-left" aria-labelledby="dropdownMenuButton" style="left:auto">
<li><a class="dropdown-item" href="#" id="item_new_file">New Program...</a></li>
<li><a class="dropdown-item" href="#" id="item_upload_file">Import file...</a></li>
<!--
<li><a class="dropdown-item" href="#" id="item_open_directory">Open Local Directory...</a></li>
-->
<hr>
<li class="dropdown dropdown-submenu">
<a tabindex="-1" href="#">File</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#" id="item_reset_file">Revert to Original...</a></li>
<li><a class="dropdown-item" href="#" id="item_rename_file">Rename File...</a></li>
<li><a class="dropdown-item" href="#" id="item_delete_file">Delete File...</a></li>
<hr>
<li><a class="dropdown-item" href="#" id="item_addfile_include">Add Include File...</a></li>
<li><a class="dropdown-item" href="#" id="item_addfile_link">Add Linked File...</a></li>
<!--<hr>
<li><a class="dropdown-item" href="#" id="item_switch_https" style="display:none">Switch to HTTPS...</a></li>
<li><a class="dropdown-item" href="#" id="item_request_persist">Request Local Storage Permissions</a></li>
--> </ul>
</li>
<li class="dropdown dropdown-submenu">
<a tabindex="-1" href="#">Sync</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#" id="item_api_projects">Select Existing Project...</a></li>
<li><a class="dropdown-item" href="#" id="item_api_create_project">Publish New Project</a></li>
<hr>
<li><a class="dropdown-item" href="#" id="item_api_push">Push to Server</a></li>
<li><a class="dropdown-item" href="#" id="item_api_pull">Pull from Server</a></li>
</ul>
</li>
<li class="dropdown dropdown-submenu">
<a tabindex="-1" href="#">Download</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#" id="item_download_file">Download Source File</a></li>
<li><a class="dropdown-item" href="#" id="item_download_rom">Download Program</a></li>
<li><a class="dropdown-item" href="#" id="item_download_disk" style="display: none;">Download Disk</a></li>
<li><a class="dropdown-item" href="#" id="item_export_cassette">Download Tape Audio...</a></li>
<li><a class="dropdown-item" href="#" id="item_download_rgcbasic_webzip" style="display: none;">Download RGC BASIC Web ZIP</a></li>
<li><a class="dropdown-item" href="#" id="item_download_zip">Download Project as ZIP</a></li>
<li><a class="dropdown-item" href="#" id="item_download_allzip">Download All Changes as ZIP</a></li>
<li><a class="dropdown-item" href="#" id="item_download_sym">Download Debug Symbols</a></li>
<li><a class="dropdown-item" href="#" id="item_screenshot_png">Screenshot - save PNG...</a></li>
<li><a class="dropdown-item" href="#" id="item_screenshot_clipboard">Screenshot - copy to clipboard</a></li>
</ul>
</li>
<li class="dropdown dropdown-submenu">
<a tabindex="-1" href="#">Share</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#" id="item_share_file">Share Playable Link...</a></li>
<li><a class="dropdown-item" href="#" id="item_share_project">Share Project...</a></li>
<!-- <li><a class="dropdown-item" href="#" id="item_record_video">Record Video...</a></li> -->
</ul>
</li>
<hr>
<li class="dropdown dropdown-submenu">
<a tabindex="-1" href="#">Help</a>
<ul class="dropdown-menu" id="help_menu">
<li><a class="dropdown-item" target="_8bws_help" href="https://docs.retrogamecoders.com/">IDE Help</a></li>
</ul>
</li>
<li class="dropdown dropdown-submenu">
<a tabindex="-1" href="#">About</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" target="_8bws_about" onClick="$('#aboutBox').show();" >About this IDE</a></li>
<li><a class="dropdown-item" target="_8bws_help" href="https://8bitworkshop.com/">8bitworkshop Creator Credit</a></li>
</ul>
</li>
</ul>
</span>
<!-- PLATFORMS menu -->
<span class="dropdown">
<a class="btn dropdown-toggle toolbarMenuButton" id="platformsMenuButton" style="min-width:90px" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="platform_name">PLATFORMS</span> <span class="caret"></span>
</a>
<ul class="dropdown-menu dropdown-menu-right" aria-labelledby="platformsMenuButton">
<li class="dropdown dropdown-submenu">
<a tabindex="-1" href="#">Game Consoles</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="?platform=vcs">Atari 2600</a></li>
<li><a class="dropdown-item" href="?platform=atari5200">Atari 5200</a></li>
<li><a class="dropdown-item" href="?platform=atari7800">Atari 7800</a></li>
<li><a class="dropdown-item" href="?platform=nes">NES</a></li>
<li><a class="dropdown-item" href="?platform=sms-sms-libcv">Sega Master System</a></li>
<li><a class="dropdown-item" href="?platform=vectrex">Vectrex</a></li>
</ul>
</li>
<li class="dropdown dropdown-submenu">
<a tabindex="-1" href="#">Computers</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="?platform=cpc.6128">Amstrad CPC6128</a></li>
<li><a class="dropdown-item" href="?platform=apple2">Apple ][+</a></li>
<li><a class="dropdown-item" href="?platform=apple2e">Apple //e</a></li>
<li><a class="dropdown-item" href="?platform=atari8-800">Atari 800</a></li>
<li><a class="dropdown-item" href="?platform=basic">BASIC</a></li>
<li><a class="dropdown-item" href="?platform=bbc">BBC Micro / Master</a></li>
<li><a class="dropdown-item" href="?platform=c64">Commodore 64</a></li>
<li><a class="dropdown-item" href="?platform=pet">Commodore PET</a></li>
<li><a class="dropdown-item" href="?platform=vic20">Commodore Vic 20</a></li>
<li><a class="dropdown-item" href="?platform=dragon32">Dragon 32</a></li>
<li><a class="dropdown-item" href="?platform=msx">MSX (BIOS)</a></li>
<li><a class="dropdown-item" href="?platform=msx-libcv">MSX (libCV)</a></li>
<li><a class="dropdown-item" href="?platform=rgc-basic">Retro Game Coders BASIC (RGC BASIC)</a></li>
<li><a class="dropdown-item" href="?platform=trs80">Tandy TRS-80 Color Computer 2</a></li>
<li><a class="dropdown-item" href="?platform=x86">x86 (FreeDOS)</a></li>
<li><a class="dropdown-item" href="?platform=x86dosbox">x86 (DOSBox)</a></li>
<li><a class="dropdown-item" href="?platform=zxspectrum">ZX Spectrum</a></li>
<li><a class="dropdown-item" href="?platform=zx81">ZX81</a></li>
</ul>
</li>
</ul>
</span>
<!-- project selector -->
<span id="repo_name" class="hidden-sm" style="color:#eee; font-size: small"></span>
<select id="preset_select" name="" title="Project Select" style="max-width:20em;visibility:hidden;height:2.3em">
</select>
<img id="compile_spinner" src="images/spinner.gif" style="visibility:hidden;margin-left:8px;margin-right:8px;height:2em">
<span id="toolbar"></span>
<span class="btn_group view_group hidden-sm hidden-xs" id="speed_bar" style="display:none">
<button id="dbg_slowest" class="btn" title="Slowest"><span class="glyphicon glyphicon-fast-backward" aria-hidden="true"></span></button>
<button id="dbg_slower" class="btn" title="Slower"><span class="glyphicon glyphicon-backward" aria-hidden="true"></span></button>
<span class="label"><span id="fps_label">60.00</span> fps</span>
<button id="dbg_faster" class="btn" title="Faster"><span class="glyphicon glyphicon-forward" aria-hidden="true"></span></button>
<button id="dbg_fastest" class="btn" title="Faster"><span class="glyphicon glyphicon-fast-forward" aria-hidden="true"></span></button>
</span>
<span id="verilog_bar" style="display:none">
<span class="label"><span id="settle_label"></span> evals/clk</span>
</span>
<!-- API Auth UI - Avatar when logged in, buttons when not -->
<span id="apiAuthContainer" class="pull-right" style="margin-left:auto; display:flex; align-items:center; gap:8px;">
<!-- Avatar (shown when logged in) -->
<div id="apiUserAvatar" class="api-user-avatar">
<img id="apiAvatarImg" src="" alt="User" class="api-avatar-img">
<div id="apiUserMenu" class="dropdown-menu dropdown-menu-right api-user-menu">
<div class="api-user-header">
<div id="apiUserName" class="api-user-name"></div>
<div id="apiUserEmail" class="api-user-email"></div>
</div>
<div class="dropdown-divider"></div>
<a class="dropdown-item api-menu-logout" href="#" id="item_api_logout">
<span class="api-menu-icon">←</span> Logout
</a>
</div>
</div>
<!-- Buttons (shown when not logged in) -->
<div id="apiAuthButtons" style="display:none;">
<button id="apiLoginButton" class="btn btn-sm" style="margin-right:4px;">Sign in</button>
<button id="apiRegisterButton" class="btn btn-sm btn-primary">Sign up</button>
</div>
</span>
</div><!-- controls_dynamic -->
</div><!-- controls_top -->
<div id="notebook">
<div id="sidebar">
<ul id="windowMenuList">
</ul>
<!-- reassuring message (hidden via cookie after dismiss) -->
<div id="reassuringMessage" class="alert alert-info alert-dismissible" style="display:none; position:relative; padding-right:28px;">
<button type="button" id="reassuringMessageClose" class="close" aria-label="Dismiss" style="position:absolute; top:8px; right:8px;">
<span aria-hidden="true">×</span>
</button>
<h4 style="text-align: left; font-size: 14px;">💾 These are your files!</h4>
<p>
Example and shared projects import a <i>copy</i> of the files into your local web browser storage,
so feel free to edit the code, the originals remain safe!
</p>
<p>
For longer term storage, create an account and login to save your projects.
</p>
<p>
To get example code back to match the original, use File > 'Revert to Original'.
</p>
<p>
<strong>Note:</strong> This is a beta version of the IDE.
Please report any issues you find.
</p>
<p align="right">-- Chris</p>
</div>
<script>
(function () {
var COOKIE = 'rgc_ide_hide_reassuring';
function getCookie(name) {
var parts = ('; ' + document.cookie).split('; ' + name + '=');
if (parts.length < 2) return '';
return decodeURIComponent(parts.pop().split(';').shift().replace(/\+/g, ' '));
}
function setCookie(name, value, days) {
var d = new Date();
d.setTime(d.getTime() + days * 24 * 60 * 60 * 1000);
document.cookie = name + '=' + encodeURIComponent(value) + ';path=/;expires=' + d.toUTCString() + ';SameSite=Lax';
}
var el = document.getElementById('reassuringMessage');
var btn = document.getElementById('reassuringMessageClose');
if (!el) return;
if (getCookie(COOKIE) !== '1') {
el.style.display = '';
}
if (btn) {
btn.addEventListener('click', function (e) {
e.preventDefault();
setCookie(COOKIE, '1', 365);
el.style.display = 'none';
});
}
})();
</script>
<span class="community-link" style="color: #3498db; text-align: center; display: block; margin-bottom: 10px;"><a href="https://retrogamecoders.com/community/#utm_source=ide&utm_medium=sidebar&utm_campaign=ide&utm_content=sidebar" target="_blank">Join the community!</a></span>
<a style="color: #3498db;"href="https://retrogamecoders.com/community/#utm_source=ide&utm_medium=sidebar&utm_campaign=ide&utm_content=sidebar" target="_blank">
<img src="https://retrogamecoders.com/wp-content/uploads/fluent-community/fluentcom-08d0dca1dfa3d74b90e35887df5ede95-fluentcom-Retro-Game-Coders-Community.jpg" style="width: 100%; object-fit: cover;">
</a>
</div>
<div id="workspace">
</div>
<div class="emulator disable-select" id="emulator">
<!-- replay slider -->
<div id="replaydiv" class="replaydiv" style="display:none;color:#ccc;text-align:left">
<div style="display:grid; grid-template-columns: 3em 3em auto 1em 3em; grid-gap: 1em">
<!-- first row -->
<button id="replay_back" class="btn" title="Back one frame"><span class="glyphicon glyphicon-backward" aria-hidden="true"></span></button>
<div>
Frame<br>
<span id="replay_frame" style="width:3em">-</span>
</div>
<input type="range" min="0" max="0" value="0" class="slider" id="replayslider">
<div> </div>
<button id="replay_fwd" class="btn" title="Ahead one frame"><span class="glyphicon glyphicon-forward" aria-hidden="true"></span></button>
<!-- second row -->
<button id="clock_back" class="btn" title="Back one step"><span class="glyphicon glyphicon-backward" aria-hidden="true"></span></button>
<div>
Step<br>
<span id="replay_clock" style="width:3em">-</span>
</div>
<input type="range" min="0" max="0" value="0" class="slider" id="clockslider">
<div> </div>
<button id="clock_fwd" class="btn" title="Forward one step"><span class="glyphicon glyphicon-forward" aria-hidden="true"></span></button>
</div>
</div>
<!-- emulator video -->
<div id="emuscreen">
</div>
<!-- for Javatari only -->
<div id="javatari-div" style="float:center;margin:10px;display:none">
<div id="javatari-screen" style="margin: 0 auto; box-shadow: 2px 2px 10px rgb(60, 60, 60);"></div>
<div id="javatari-console-panel" style="margin: 0 auto; box-shadow: 2px 2px 10px rgb(60, 60, 60);"></div>
</div>
<!-- for VIC-20 chips emulator only -->
<div id="vic20-chips-div" style="float:center;margin:10px;display:none">
<div id="vic20-chips-screen" style="margin: 0 auto; box-shadow: 2px 2px 10px rgb(60, 60, 60);"></div>
</div>
<!-- for C64 chips emulator only -->
<div id="c64-chips-div" style="float:center;margin:10px;display:none">
<div id="c64-chips-screen" style="margin: 0 auto; box-shadow: 2px 2px 10px rgb(60, 60, 60);"></div>
</div>
<!-- control instructions -->
<div class="emucontrols-vcs emucontrols-c64 text-center small control-insns" style="display:none">
<span class="control-def"><span class="control-key">←↑↓→</span> Joystick</span>
<span class="control-def"><span class="control-key small">Space</span> Button</span>
</div>
<div class="emucontrols-nes emucontrols-atari7800 emucontrols-pce text-center small control-insns" style="display:none">
<span class="control-def"><span class="control-key">←↑↓→</span> Joypad</span>
<span class="control-def"><span class="control-key small">Space</span> Button A</span>
<span class="control-def"><span class="control-key small">Shift</span> Button B</span>
<span class="control-def"><span class="control-key small">\</span> Select</span>
<span class="control-def"><span class="control-key small">Enter</span> Start</span>
</div>
<div class="emucontrols-msx emucontrols-coleco text-center small control-insns" style="display:none">
<span class="control-def"><span class="control-key">←↑↓→</span> Joypad</span>
<span class="control-def"><span class="control-key small">Space</span> Button A</span>
<span class="control-def"><span class="control-key small">Shift</span> Button B</span>
</div>
<div class="emucontrols-sms text-center small control-insns" style="display:none">
<span class="control-def"><span class="control-key">←↑↓→</span> Joypad</span>
<span class="control-def"><span class="control-key small">Space</span> Button A</span>
<span class="control-def"><span class="control-key small">Shift</span> Button B</span>
<span class="control-def"><span class="control-key small">Enter</span> Start</span>
</div>
<div class="emucontrols-vicdual emucontrols-galaxian emucontrols-vector text-center small control-insns" style="display:none">
<span class="control-def"><span class="control-key">←↑↓→</span> Joystick</span>
<span class="control-def"><span class="control-key small">Space</span> Button 1</span>
<span class="control-def"><span class="control-key small">Shift</span> Button 2</span>
<span class="control-def"><span class="control-key">\</span> Coin</span>
<span class="control-def"><span class="control-key small">Enter</span> Start</span>
</div>
<div class="emucontrols-mw8080bw text-center small control-insns" style="display:none">
<span class="control-def"><span class="control-key">← →</span> Joystick</span>
<span class="control-def"><span class="control-key small">Space</span> Fire</span>
</div>
<div class="emucontrols-williams text-center small control-insns" style="display:none">
<span class="control-def"><span class="control-key">A W S D</span> Move</span>
<span class="control-def"><span class="control-key">←↑↓→</span> Fire</span>
<span class="control-def"><span class="control-key">\</span> Coin</span>
<span class="control-def"><span class="control-key small">Enter</span> Start</span>
<span class="control-def"><span class="control-key small">6 7 8 9</span> Extra</span>
</div>
<div class="emucontrols-astrocade text-center small control-insns" style="display:none">
<span class="control-def"><span class="control-key">←↑↓→</span> Joystick</span>
<span class="control-def"><span class="control-key small">Space</span> Trigger</span>
<span class="control-def"><span class="control-key small">Mouse X</span> Knob</span>
<span class="control-def"><span class="control-key small" style="display:inline-block;font-family:monospace">
U I O P<br>
J K L /<br>
7 8 9 X<br>
4 5 6 -<br>
1 2 3 ,<br>
\ 0 . =</span> Keypad</span>
</div>
<div class="emucontrols-vectrex text-center small control-insns" style="display:none">
<span class="control-def"><span class="control-key">←↑↓→</span> Joystick</span>
<span class="control-def"><span class="control-key">Z X C V</span> Buttons</span>
</div>
<div class="emucontrols-atari8 text-center small control-insns" style="display:none">
<span class="control-def"><span class="control-key">←↑↓→</span> Joystick</span>
<span class="control-def"><span class="control-key">Shift</span> Button</span>
<span class="control-def"><span class="control-key">F1</span> Start</span>
<span class="control-def"><span class="control-key">F2</span> Select</span>
<span class="control-def"><span class="control-key">F3</span> Option</span>
</div>
<!-- -->
<div id="emuoverlay" class="emuoverlay" style="display:none">
</div>
</div>
<div id="mem_info" class="mem_info" style="display:none">
<div><button type="button" class="close" onclick="$('.mem_info').hide()" aria-hidden="true">×</button></div>
<div id="mem_info_msg" class="mem_info_msg"></div>
</div>
<div id="error_alert" class="alert alert-danger alert-dismissable" style="position:absolute;right:0;top:0;display:none">
<button type="button" class="close" onclick="$('.alert').hide()" aria-hidden="true">×</button>
<div id="error_alert_msg"></div>
</div>
<div id="aboutBox" class="alert alert-dismissable" style="z-index: 1000; box-shadow: 10px 10px 8px 10px black; ;background-color: white;position:absolute;right:0;top:0;display:none">
<button type="button" class="close" onclick="$('.alert').hide()" aria-hidden="true">×</button>
<div id="error_alert_msg">
<h3>About this IDE</h3>
<p>
Hope you enjoy my version of the <a href="https://8bitworkshop.com/" target="_blank">8bitworkshop IDE</a>!
</p>
<p>
The main changes I have made are to attempt to add more target platforms, and to add more features.
Most notable currently are the addition of the Commodore Vic20, the BBC Micro, and C64 BASIC.
<p>
Some elements are removed such as the Github integration, and the open source C64 ROMs were replaced with the original ones.
</p>
<hr>
<p>
<a href="https://retrogamecoders.com" target="_blank">Retro Game Coders</a> is a community of developers who create games for vintage computers and consoles.
</p>
</div>
</div>
</div>
<div id="pleaseWaitModal" class="modal fade">
<div class="modal-dialog modal-md" role="document">
<div class="modal-content">
<div class="modal-body">
Please wait...
<div class="progress">
<div class="progress-bar progress-bar-striped active" role="progressbar" id="pleaseWaitProgressBar">
</div>
</div>
</div>
</div>
</div>
</div>
<div id="videoPreviewModal" class="modal fade">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title">Video Preview - Right-click to save</h3>
</div>
<div class="modal-body">
<img id="videoPreviewImage">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div id="embedLinkModal" class="modal fade">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title">Share Playable Link</h3>
</div>
<div class="modal-body">
<p>Here's a direct link to a playable version of your game:</p>
<textarea rows="4" cols="80" id="embedLinkTextarea" class="cliptext"></textarea>
<button type="button" class="btn btn-primary" data-clipboard-target="#embedLinkTextarea">Copy Direct Link</button>
<p>You can also embed it into an IFRAME:</p>
<textarea rows="4" cols="80" id="embedIframeTextarea" class="cliptext"></textarea>
<button type="button" class="btn btn-primary" data-clipboard-target="#embedIframeTextarea">Copy IFRAME Tag</button>
<p id="embedAdviceWarnIE">Note: These links may be too long for IE/Edge browsers.</p>
<p id="embedAdviceWarnAll">Note: These links may be too long for some browsers.</p>
</div>
<div class="modal-footer">
Choose one (or none) then
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div id="debugExprModal" class="modal fade">
<div class="modal-dialog modal-md" role="document">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title">Break Expression</h3>
</div>
<div class="modal-body">
<p>Enter a break expression:</p>
<p><input id="debugExprInput" size="60"></input></p>
<p>Examples:</p>
<pre id="debugExprExamples"></pre>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" id="debugExprSubmit">Debug</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
</div>
</div>
</div>
</div>
<script src="jquery/jquery.min.js"></script>
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
<script src="bootstrap/js/bootstrap.min.js"></script>
<script src="bootstrap/js/bootbox.all.min.js"></script>
<link rel="stylesheet" href="lib/bootstrap-tourist.css">
<script src="src/codemirror/codemirror.js?v=20251212"></script>
<script src="codemirror/mode/clike/clike.js"></script>
<script src="codemirror/mode/z80/z80.js"></script>
<script src="codemirror/mode/verilog/verilog.js"></script>
<script src="codemirror/mode/markdown/markdown.js"></script>
<script src="codemirror/mode/javascript/javascript.js"></script>
<script src="codemirror/mode/pascal/pascal.js"></script>
<script src="codemirror/mode/gas/gas.js"></script>
<script src="src/codemirror/6502.js?v=20251212"></script>
<script src="src/codemirror/bataribasic.js?v=20251212"></script>
<script src="src/codemirror/c64basic.js?v=20251212"></script>
<script src="src/codemirror/inform6.js?v=20251212"></script>
<script src="src/codemirror/fastbasic.js?v=20251212"></script>
<script src="src/codemirror/basic.js?v=20251212"></script>
<script src="src/codemirror/wiz.js?v=20251212"></script>
<script src="src/codemirror/vasm.js?v=20251212"></script>
<script src="src/codemirror/ecs.js?v=20251212"></script>
<link rel="stylesheet" href="css/codemirror.css">
<script src="codemirror/addon/edit/matchbrackets.js"></script>
<script src="codemirror/addon/search/search.js"></script>
<script src="codemirror/addon/search/searchcursor.js"></script>
<script src="codemirror/addon/search/jump-to-line.js"></script>
<script src="codemirror/addon/dialog/dialog.js"></script>
<script src="codemirror/addon/selection/active-line.js"></script>
<link rel="stylesheet" href="codemirror/addon/dialog/dialog.css">
<!-- ui.css last so toolbar + IDE chrome win over Bootstrap, bootstrap-tourist, CodeMirror -->
<link rel="stylesheet" href="css/ui.css?v=20260403d">
<script src="tss/js/tss/PsgDeviceChannel.js"></script>
<script src="tss/js/tss/MasterChannel.js"></script>
<script src="tss/js/tss/AudioLooper.js"></script>
<script src="tss/js/Log.js"></script>
<!-- Bottom right footer link -->
<div style="position:fixed; bottom:10px; right:10px; z-index:100;">
<a href="https://retrogamecoders.com" target="_blank" class="logo-gradient" style="text-decoration:none; font-size:0.9em;">Retro Game Coders.com</a>
</div>
<!-- API Modals -->
<!-- Register Modal -->
<div id="registerApiModal" class="modal fade">
<div class="modal-dialog modal-md" role="document">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title">Create Account</h3>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
<div class="modal-body">
<form>
<div class="form-group">
<label>Name</label>
<input type="text" class="form-control" id="registerApiName" placeholder="Your name" required>
</div>
<div class="form-group">
<label>Email</label>
<input type="email" class="form-control" id="registerApiEmail" placeholder="your@email.com" required>
</div>
<div class="form-group">
<label>Password</label>
<input type="password" class="form-control" id="registerApiPassword" placeholder="At least 8 characters" required>
</div>
<div class="form-group">
<label>Confirm Password</label>
<input type="password" class="form-control" id="registerApiConfirmPassword" placeholder="Confirm password" required>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" id="registerApiButton">Create Account</button>
</div>
</div>
</div>
</div>
<!-- Login Modal -->
<div id="loginApiModal" class="modal fade">
<div class="modal-dialog modal-md" role="document">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title">Sign In</h3>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
<div class="modal-body">
<form>
<div class="form-group">
<label>Email</label>
<input type="email" class="form-control" id="loginApiEmail" placeholder="your@email.com" required>
</div>
<div class="form-group">
<label>Password</label>
<input type="password" class="form-control" id="loginApiPassword" placeholder="Password" required>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" id="loginApiButton">Sign In</button>
</div>
</div>
</div>
</div>
<!-- Create Project Modal -->
<div id="createApiProjectModal" class="modal fade">
<div class="modal-dialog modal-md" role="document">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title">Publish Project</h3>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
<div class="modal-body">
<form>
<div class="form-group">
<label>Project Title</label>
<input type="text" class="form-control" id="createApiProjectTitle" placeholder="My Project" required>
</div>
<div class="form-group">
<label>Description (optional)</label>
<textarea class="form-control" id="createApiProjectDescription" rows="3" placeholder="Project description"></textarea>
</div>
<div class="form-group">
<label>
<input type="checkbox" id="createApiProjectPublic"> Make project public
</label>
</div>
<div class="form-group">
<label>
<input type="checkbox" id="createApiProjectFeatureScreenshot"> Attach emulator screenshot as featured image
</label>
<p class="help-block small text-muted" style="margin-top:6px;">Same capture as Share → Screenshot (PNG). Run your program first so the screen shows what you want.</p>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" id="createApiProjectButton">Publish Project</button>
</div>
</div>
</div>
</div>
<!-- Push Modal -->
<div id="pushApiModal" class="modal fade">
<div class="modal-dialog modal-md" role="document">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title">Push to Server</h3>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
<div class="modal-body">
<form>
<div class="form-group">
<label>Commit Message</label>
<input type="text" class="form-control" id="pushApiCommitMsg" placeholder="Update project files" required>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" id="pushApiButton">Push</button>
</div>
</div>
</div>
</div>
<!-- main IDE module -->
<script>
// Add cache-busting timestamp to main UI script
const uiScript = document.createElement('script');
uiScript.src = `gen/ui.js?t=${Date.now()}`;
uiScript.type = 'module';
document.head.appendChild(uiScript);
</script>
<script>
// submenus open on click + hover
$( ".dropdown-submenu" ).click(function(event) {
event.stopPropagation();
$(this).parent().siblings().removeClass('open');
$(this).parent().toggleClass('open');
});
</script>
</body>
</html>