electron: initial experimental build (npm start), removed web/images
16
Makefile
@ -1,11 +1,26 @@
|
||||
|
||||
TSC=./node_modules/typescript/bin/tsc --build
|
||||
TMP=./tmp/dist
|
||||
|
||||
all:
|
||||
cp nanoasm/src/assembler.ts src/worker/
|
||||
$(TSC) -v
|
||||
$(TSC)
|
||||
cd jsnes && npm i
|
||||
patch -i electron.diff -o electron.html
|
||||
|
||||
dist:
|
||||
rm -fr $(TMP) && mkdir -p $(TMP)
|
||||
git archive HEAD | tar x -C $(TMP)
|
||||
cp -rp gen $(TMP)
|
||||
rm -r $(TMP)/doc $(TMP)/romsrc $(TMP)/scripts $(TMP)/test* $(TMP)/tools $(TMP)/electron.diff $(TMP)/.[a-z]* $(TMP)/ts*.json
|
||||
rm -f $(TMP)/javatari && mkdir -p $(TMP)/javatari && cp javatari.js/release/javatari/* $(TMP)/javatari/
|
||||
tar cf - `cat electron.html | egrep "^<(script|link)" | egrep -o '"([^"]+).(js|css)"' | cut -d '"' -f2` | tar x -C $(TMP)
|
||||
|
||||
%.dist:
|
||||
./node_modules/.bin/electron-packager $(TMP) --icon images/8bitworkshop-icon-1024.icns --out ./release --overwrite --platform $*
|
||||
|
||||
package: dist darwin.dist win32.dist linux.dist
|
||||
|
||||
z80: src/cpu/z80fast.js
|
||||
|
||||
@ -21,7 +36,6 @@ check:
|
||||
lint:
|
||||
gjslint -r src
|
||||
|
||||
|
||||
web:
|
||||
(ip addr || ifconfig) | grep inet
|
||||
python3 scripts/serveit.py 2>> /dev/null #http.out
|
||||
|
@ -65,13 +65,14 @@ The IDE uses custom forks for many of these, found at https://github.com/sehugg?
|
||||
* http://mcpp.sourceforge.net/
|
||||
* http://www.ifarchive.org/indexes/if-archiveXinfocomXcompilersXinform6.html
|
||||
* https://github.com/dmsc/fastbasic
|
||||
* https://github.com/apple2accumulator/merlin32
|
||||
|
||||
### Assemblers/Linkers
|
||||
|
||||
* https://dasm-assembler.github.io/
|
||||
* http://atjs.mbnet.fi/mc6809/Assembler/xasm-990104.tar.gz
|
||||
* http://48k.ca/zmac.html
|
||||
* https://github.com/apple2accumulator/merlin32
|
||||
* https://github.com/camsaul/nesasm
|
||||
|
||||
### Dev Kits / Libraries
|
||||
|
||||
|
@ -1 +0,0 @@
|
||||
theme: jekyll-theme-cayman
|
18
electron-preload.js
Normal file
@ -0,0 +1,18 @@
|
||||
// preload.js for Electron app
|
||||
const { ipcRenderer } = require('electron');
|
||||
|
||||
process.once('loaded', () => {
|
||||
ipcRenderer.on('updateFile', (event, data) => {
|
||||
console.log('updateFile', data);
|
||||
data.cmd = 'updateFile';
|
||||
postMessage(data);
|
||||
});
|
||||
window.addEventListener('message', event => {
|
||||
const message = event.data;
|
||||
console.log('MESSAGE', event, message);
|
||||
//if (message.myTypeField === 'my-custom-message') {
|
||||
//ipcRenderer.send('custom-message', message);
|
||||
//}
|
||||
});
|
||||
//ipcRenderer.send('hello', true);
|
||||
});
|
266
electron.diff
Normal file
@ -0,0 +1,266 @@
|
||||
*** index.html 2020-07-30 21:15:48.000000000 -0500
|
||||
--- electron.html 2020-07-30 21:16:00.000000000 -0500
|
||||
***************
|
||||
*** 3,18 ****
|
||||
|
||||
<head>
|
||||
<title>8bitworkshop IDE</title>
|
||||
- <link rel="manifest" href="manifest.json">
|
||||
- <meta name="googlebot" content="nosnippet" />
|
||||
- <meta name="mobile-web-app-capable" content="yes">
|
||||
- <meta name="apple-mobile-web-app-capable" content="yes">
|
||||
- <meta name="application-name" content="8bitworkshop">
|
||||
- <meta name="apple-mobile-web-app-title" content="8bitworkshop">
|
||||
- <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="/redir.html">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=yes">
|
||||
<style type="text/css" media="screen">
|
||||
body {
|
||||
--- 3,8 ----
|
||||
*************** body {
|
||||
*** 21,61 ****
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" href="css/ui.css">
|
||||
-
|
||||
- <!-- google analytics -->
|
||||
- <script>
|
||||
- window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
|
||||
- if (window.location.host.endsWith('8bitworkshop.com')) {
|
||||
- ga('create', 'UA-54497476-9', 'auto');
|
||||
- ga('set', 'anonymizeIp', true);
|
||||
- }
|
||||
- </script>
|
||||
- <script async src='https://www.google-analytics.com/analytics.js'></script>
|
||||
-
|
||||
- <!-- firebase libs -->
|
||||
- <script defer src="https://www.gstatic.com/firebasejs/5.11.1/firebase-app.js"></script>
|
||||
- <script defer src="https://www.gstatic.com/firebasejs/5.11.1/firebase-auth.js"></script>
|
||||
- <script defer src="config.js"></script>
|
||||
-
|
||||
- <!-- Sentry error reporting -->
|
||||
- <script
|
||||
- src="https://browser.sentry-cdn.com/5.10.2/bundle.min.js"
|
||||
- integrity="sha384-ssBfXiBvlVC7bdA/VX03S88B5MwXQWdnpJRbUYFPgswlOBwETwTp6F3SMUNpo9M9"
|
||||
- crossorigin="anonymous"></script>
|
||||
- <script>
|
||||
- if (window.location.host.endsWith('8bitworkshop.com')) {
|
||||
- Sentry.init({
|
||||
- dsn: 'https://bf329df3d1b34afa9f5b5e8ecd80ad11@sentry.io/1813925',
|
||||
- beforeBreadcrumb(breadcrumb, hint) {
|
||||
- if (breadcrumb.category === 'xhr' && typeof breadcrumb.data.url === 'string') {
|
||||
- if (breadcrumb.data.url.startsWith('http')) return null; // discard external scripts
|
||||
- }
|
||||
- return breadcrumb;
|
||||
- },
|
||||
- });
|
||||
- }
|
||||
- </script>
|
||||
-
|
||||
</head>
|
||||
<body>
|
||||
|
||||
--- 11,16 ----
|
||||
*************** if (window.location.host.endsWith('8bitw
|
||||
*** 83,108 ****
|
||||
<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_github_login">Sign in to Github...</a></li>
|
||||
- <li><a class="dropdown-item" href="#" id="item_github_logout">Log out</a></li>
|
||||
- <hr>
|
||||
- <li><a class="dropdown-item" href="#" id="item_github_import">Import Project from GitHub...</a></li>
|
||||
- <li><a class="dropdown-item" href="#" id="item_github_pull">Pull Latest from Repository</a></li>
|
||||
- <hr>
|
||||
- <li><a class="dropdown-item" href="#" id="item_github_publish">Publish Project on GitHub...</a></li>
|
||||
- <li><a class="dropdown-item" href="#" id="item_github_push">Push Changes to Repository...</a></li>
|
||||
- <hr>
|
||||
- <li><a class="dropdown-item" href="#" id="item_repo_delete">Delete Local Repository...</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown dropdown-submenu">
|
||||
--- 38,43 ----
|
||||
*************** if (window.location.host.endsWith('8bitw
|
||||
*** 128,163 ****
|
||||
<li><a class="dropdown-item" href="#" id="item_debug_expr">Break Expression...</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
- <li class="dropdown dropdown-submenu">
|
||||
- <a tabindex="-1" href="#">Tools</a>
|
||||
- <ul class="dropdown-menu">
|
||||
- <li><a class="dropdown-item" target="_8bws_tools" href="https://8bitworkshop.com/dithertron/">Dithertron Image Converter</a></li>
|
||||
- <li><a class="dropdown-item" target="_8bws_tools" href="https://8bitworkshop.com/bitmapfontgenerator/">Bitmap Font Generator</a></li>
|
||||
- <li><a class="dropdown-item" target="_8bws_tools" href="http://tomeko.net/online_tools/file_to_hex.php?lang=en">Binary File to Hex Converter</a></li>
|
||||
- <li class="dropdown dropdown-submenu">
|
||||
- <a tabindex="-1" href="#">Atari 2600</a>
|
||||
- <ul class="dropdown-menu">
|
||||
- <li><a class="dropdown-item" target="_8bws_tools" href="https://alienbill.com/2600/playerpalnext.html">playerpal 2600</a></li>
|
||||
- <li><a class="dropdown-item" target="_8bws_tools" href="https://alienbill.com/2600/playfieldpal.html">playfieldpal 2600</a></li>
|
||||
- </ul>
|
||||
- </li>
|
||||
- </ul>
|
||||
- </li>
|
||||
- <hr>
|
||||
- <li class="dropdown dropdown-submenu">
|
||||
- <a tabindex="-1" href="#">About</a>
|
||||
- <ul class="dropdown-menu">
|
||||
- <li><a class="dropdown-item" target="_8bws_about" href="https://8bitworkshop.com/blog">Latest News</a></li>
|
||||
- <li><a class="dropdown-item" target="_8bws_about" href="https://8bitworkshop.com/projects">Projects</a></li>
|
||||
- <li><a class="dropdown-item" target="_8bws_about" href="https://twitter.com/8bitworkshop">Twitter</a></li>
|
||||
- <li><a class="dropdown-item" target="_8bws_about" href="https://github.com/sehugg/8bitworkshop">GitHub</a></li>
|
||||
- <li><a class="dropdown-item" target="_8bws_about" href="https://github.com/sehugg/8bitworkshop/issues/new">Report an Issue</a></li>
|
||||
- <li><a class="dropdown-item" target="_8bws_about" href="https://8bitworkshop.com/blog/docs/ide.md.html">IDE Help</a></li>
|
||||
- </ul>
|
||||
- </li>
|
||||
- <!--
|
||||
- <hr><li><a class="dropdown-item" href="/redir.html">Use Latest Version</a></li>
|
||||
- -->
|
||||
</ul>
|
||||
</span>
|
||||
|
||||
--- 63,68 ----
|
||||
*************** if (window.location.host.endsWith('8bitw
|
||||
*** 252,290 ****
|
||||
<span class="label"><span id="settle_label"></span> evals/clk</span>
|
||||
</span>
|
||||
|
||||
- <!-- BOOKS menu -->
|
||||
- <span class="dropdown pull-right">
|
||||
- <a class="btn dropdown-toggle hidden-xs toolbarMenuButton" id="booksMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
- <span class="glyphicon glyphicon-book" aria-hidden="true"></span>
|
||||
- Get Books <span class="caret"></span>
|
||||
- </a>
|
||||
- <ul class="dropdown-menu dropdown-menu-right" aria-labelledby="booksMenuButton">
|
||||
- <li>
|
||||
- <a class="dropdown-item dropdown-link book-vcs" target="_book_a2600" href="https://www.amazon.com/gp/product/1541021304/ref=as_li_qf_sp_asin_il_tl?ie=UTF8&tag=pzp-20&camp=1789&creative=9325&linkCode=as2&creativeASIN=B01N4DSRIZ&linkId=04d39e274c06e6c93b93d20a9a977111">
|
||||
- <img src="images/book_a2600.png"/>
|
||||
- <span class="book-title">Making Games For The Atari 2600</span>
|
||||
- </a>
|
||||
- </li>
|
||||
- <li>
|
||||
- <a class="dropdown-item dropdown-link book-arcade" target="_book_arcade" href="https://www.amazon.com/gp/product/1545484759/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1545484759&linkCode=as2&tag=pzp-20&linkId=b27709c022d2ebe639e90316d9f4fd5b">
|
||||
- <img src="images/book_arcade.png"/>
|
||||
- <span class="book-title">Making 8-bit Arcade Games in C</span>
|
||||
- </a>
|
||||
- </li>
|
||||
- <li>
|
||||
- <a class="dropdown-item dropdown-link book-verilog" target="_book_verilog" href="https://www.amazon.com/gp/product/1728619440/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1728619440&linkCode=as2&tag=pzp-20&linkId=7237a25861cb6b49a4128ba53d84c3e2">
|
||||
- <img src="images/book_verilog.png"/>
|
||||
- <span class="book-title">Designing Video Game Hardware in Verilog</span>
|
||||
- </a>
|
||||
- </li>
|
||||
- <li>
|
||||
- <a class="dropdown-item dropdown-link book-nes" target="_book_nes" href="https://www.amazon.com/gp/product/1075952727/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1075952727&linkCode=as2&tag=pzp-20&linkId=633176e8b36fea7f927020e2c322d80a">
|
||||
- <img src="images/book_nes.png"/>
|
||||
- <span class="book-title">Making Games For The NES</span>
|
||||
- </a>
|
||||
- </li>
|
||||
- </ul>
|
||||
- </span>
|
||||
<!-- 8bitworkshop logo -->
|
||||
<span class="logo-gradient hidden-xs hidden-sm hidden-md pull-right" style="margin-left:auto" onclick="window.open('/','_8bitws');">8bitworkshop</span>
|
||||
|
||||
--- 157,162 ----
|
||||
*************** if (window.location.host.endsWith('8bitw
|
||||
*** 471,543 ****
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
- <div id="importGithubModal" class="modal fade">
|
||||
- <div class="modal-dialog modal-md" role="document">
|
||||
- <div class="modal-content">
|
||||
- <div class="modal-header">
|
||||
- <h3 class="modal-title">Import Project from GitHub</h3>
|
||||
- </div>
|
||||
- <div class="modal-body">
|
||||
- <p>Enter the GitHub repository URL:</p>
|
||||
- <p><input id="importGithubURL" size="60" placeholder="https://github.com/user/repo"></input></p>
|
||||
- <p>If the project is compatible with 8bitworkshop, it should build automatically.</p>
|
||||
- <p>Otherwise, some work may be required -- make sure you've selected the correct platform.</p>
|
||||
- <p>Source files must be in the root folder of the repository.</p>
|
||||
- <p><button type="button" class="btn btn-primary" id="importGithubButton">Import Project</button></p>
|
||||
- </div>
|
||||
- <div class="modal-footer">
|
||||
- <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
- </div>
|
||||
- </div>
|
||||
- </div>
|
||||
- </div>
|
||||
- <div id="publishGithubModal" 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 on GitHub</h3>
|
||||
- </div>
|
||||
- <div class="modal-body">
|
||||
- <p>This will migrate your existing project to a new GitHub repository.</p>
|
||||
- <p>https://github.com/username/ <input id="githubRepoName" size="35" placeholder="Enter a project name"></input></p>
|
||||
- <p><input id="githubRepoDesc" size="60" placeholder="Enter a project description"></input></p>
|
||||
- <p>Your repository will be <select id="githubRepoPrivate">
|
||||
- <option value="public">Public</option>
|
||||
- <option value="private">Private</option>
|
||||
- </select></p>
|
||||
- <p>License: <select id="githubRepoLicense">
|
||||
- <option value="">Will decide later / all rights reserved</option>
|
||||
- <option value="cc0-1.0">CC Zero (public domain, remix-friendly)</option>
|
||||
- <option value="mit">MIT (must preserve notices)</option>
|
||||
- <option value="cc-by-4.0">CC BY (must attribute)</option>
|
||||
- <option value="cc-by-sa-4.0">CC BY-SA (must attribute, use same license)</option>
|
||||
- <option value="gpl-3.0">GPL v3 (must publish source)</option>
|
||||
- </select></p>
|
||||
- <p><button type="button" class="btn btn-primary" id="publishGithubButton">Upload Project</button></p>
|
||||
- <p>Your existing file will be moved to a new folder in the IDE.</p>
|
||||
- </div>
|
||||
- <div class="modal-footer">
|
||||
- <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
- </div>
|
||||
- </div>
|
||||
- </div>
|
||||
- </div>
|
||||
- <div id="pushGithubModal" class="modal fade">
|
||||
- <div class="modal-dialog modal-md" role="document">
|
||||
- <div class="modal-content">
|
||||
- <div class="modal-header">
|
||||
- <h3 class="modal-title">Push Project Changes to GitHub</h3>
|
||||
- </div>
|
||||
- <div class="modal-body">
|
||||
- <p><input id="githubCommitMsg" size="50" placeholder="Enter a commit message"></input></p>
|
||||
- <p><button type="button" class="btn btn-primary" id="pushGithubButton">Push Changes</button></p>
|
||||
- </div>
|
||||
- <div class="modal-footer">
|
||||
- <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
- </div>
|
||||
- </div>
|
||||
- </div>
|
||||
- </div>
|
||||
|
||||
<script src="jquery/jquery.min.js"></script>
|
||||
|
||||
--- 343,348 ----
|
||||
*************** $( ".dropdown-submenu" ).click(function(
|
||||
*** 629,640 ****
|
||||
startUI();
|
||||
</script>
|
||||
|
||||
- <script>
|
||||
- /*
|
||||
- var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
|
||||
- if (!isFirefox && platform_id != 'vcs') { $("#best_in_firefox").show(); }
|
||||
- */
|
||||
- </script>
|
||||
-
|
||||
</body>
|
||||
</html>
|
||||
--- 434,438 ----
|
438
electron.html
Normal file
@ -0,0 +1,438 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<title>8bitworkshop IDE</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=yes">
|
||||
<style type="text/css" media="screen">
|
||||
body {
|
||||
overflow: hidden;
|
||||
font-size: 11px;
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" href="css/ui.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- for file upload -->
|
||||
<input type="file" id="uploadFileElem" multiple accept="*" style="display:none" onchange="handleFileUpload(this.files)">
|
||||
|
||||
<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 Project...</a></li>
|
||||
<li><a class="dropdown-item" href="#" id="item_upload_file">Upload...</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>
|
||||
</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 ROM Image</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>
|
||||
</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_record_video">Record Video...</a></li>
|
||||
<li><a class="dropdown-item" href="#" id="item_export_cassette">Make Cassette Audio...</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown dropdown-submenu">
|
||||
<a tabindex="-1" href="#">Debug</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a class="dropdown-item" href="#" id="item_debug_expr">Break Expression...</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=nes">NES</a></li>
|
||||
<hr>
|
||||
<li><a class="dropdown-item" href="?platform=astrocade">Bally Astrocade</a></li>
|
||||
<li><a class="dropdown-item" href="?platform=coleco">ColecoVision</a></li>
|
||||
<li><a class="dropdown-item" href="?platform=sms-sg1000-libcv">Sega SG-1000</a></li>
|
||||
<li><a class="dropdown-item" href="?platform=sms-sms-libcv">Sega Master System</a></li>
|
||||
<li><a class="dropdown-item" href="?platform=atari7800">Atari 7800</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=c64">Commodore 64</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=apple2">Apple ][+</a></li>
|
||||
<li><a class="dropdown-item" href="?platform=zx">ZX Spectrum</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown dropdown-submenu">
|
||||
<a tabindex="-1" href="#">Arcade Systems</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a class="dropdown-item" href="?platform=vicdual">VIC Dual</a></li>
|
||||
<li><a class="dropdown-item" href="?platform=mw8080bw">Midway 8080</a></li>
|
||||
<li><a class="dropdown-item" href="?platform=galaxian-scramble">Galaxian/Scramble</a></li>
|
||||
<li><a class="dropdown-item" href="?platform=vector-z80color">Atari Color Vector (Z80)</a></li>
|
||||
<li><a class="dropdown-item" href="?platform=williams-z80">Williams (Z80)</a></li>
|
||||
<li><a class="dropdown-item" href="?platform=sound_williams-z80">Williams Sound (Z80)</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown dropdown-submenu">
|
||||
<a tabindex="-1" href="#">Hardware</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a class="dropdown-item" href="?platform=verilog">Verilog</a></li>
|
||||
<li><a class="dropdown-item" href="?platform=verilog-vga">Verilog (VGA @ 25 Mhz)</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown dropdown-submenu">
|
||||
<a tabindex="-1" href="#">MAME Emulators</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a class="dropdown-item" href="?platform=atari8-800xl.mame">Atari 800XL (MAME)</a></li>
|
||||
<li><a class="dropdown-item" href="?platform=atari8-5200.mame">Atari 5200 (MAME)</a></li>
|
||||
<hr>
|
||||
<li><a class="dropdown-item" href="?platform=vcs.mame">Atari 2600 (MAME)</a></li>
|
||||
<li><a class="dropdown-item" href="?platform=coleco.mame">ColecoVision (MAME)</a></li>
|
||||
<li><a class="dropdown-item" href="?platform=nes.mame">NES (MAME)</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown dropdown-submenu">
|
||||
<a tabindex="-1" href="#">Other</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a class="dropdown-item" href="?platform=vector-ataricolor">Atari Color Vector (6502)</a></li>
|
||||
<li><a class="dropdown-item" href="?platform=x86">x86 (FreeDOS)</a></li>
|
||||
<li><a class="dropdown-item" href="?platform=zmachine">Z-Machine</a></li>
|
||||
<li><a class="dropdown-item" href="?platform=markdown">Markdown Text Editor</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" class="hidden-xs"></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>
|
||||
|
||||
<!-- 8bitworkshop logo -->
|
||||
<span class="logo-gradient hidden-xs hidden-sm hidden-md pull-right" style="margin-left:auto" onclick="window.open('/','_8bitws');">8bitworkshop</span>
|
||||
|
||||
</div><!-- controls_dynamic -->
|
||||
</div><!-- controls_top -->
|
||||
|
||||
<div id="notebook">
|
||||
<div id="sidebar">
|
||||
<ul id="windowMenuList">
|
||||
</ul>
|
||||
</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:flex; grid-gap:1em">
|
||||
<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">
|
||||
<button id="replay_fwd" class="btn" title="Ahead one frame"><span class="glyphicon glyphicon-forward" aria-hidden="true"></span></button>
|
||||
</div>
|
||||
<div style="display:flex; grid-gap:1em" id="clockdiv">
|
||||
<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">
|
||||
<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>
|
||||
<!-- 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 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 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>
|
||||
</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">Z</span> Button 1</span>
|
||||
<span class="control-def"><span class="control-key">X</span> Button 2</span>
|
||||
<span class="control-def"><span class="control-key">1</span> Start</span>
|
||||
</div>
|
||||
<!-- -->
|
||||
<div id="emuoverlay" class="emuoverlay" style="display:none">
|
||||
</div>
|
||||
</div>
|
||||
<div id="mem_info" class="mem_info" style="display:none">
|
||||
</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>
|
||||
<!--
|
||||
<div class="twitbtn">
|
||||
<a target="_new" href="https://twitter.com/8bitworkshop" class="twitter-follow-button" data-show-count="false">Follow @8bitworkshop</a>-->
|
||||
<!--<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>-->
|
||||
<!--</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="lib/bootstrap-tourist.js"></script>
|
||||
<script src="lib/browser-detect.umd.js"></script>
|
||||
|
||||
<script src="src/codemirror/codemirror.js"></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/gas/gas.js"></script>
|
||||
<script src="src/codemirror/6502.js"></script>
|
||||
<script src="src/codemirror/bataribasic.js"></script>
|
||||
<script src="src/codemirror/inform6.js"></script>
|
||||
<script src="src/codemirror/fastbasic.js"></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">
|
||||
<script src="javatari.js/release/javatari/javatari.js"></script>
|
||||
<script src="jsnes/dist/jsnes.min.js"></script>
|
||||
<script src="src/common/cpu/6809.js"></script>
|
||||
<script src="FileSaver.js/FileSaver.min.js"></script>
|
||||
<script src="lib/mousetrap.min.js"></script>
|
||||
<script src="lib/mousetrap-global-bind.min.js"></script>
|
||||
<!-- UI-only stuff -->
|
||||
<script src="localForage/dist/localforage.nopromises.js"></script>
|
||||
<script src="lib/split.min.js"></script>
|
||||
|
||||
<script>
|
||||
var exports = {};
|
||||
function require(modname) {
|
||||
if (modname == 'jquery') return $;
|
||||
else if (modname.startsWith('.')) return exports;
|
||||
else { console.log("Unknown require()", modname); return exports; }
|
||||
}
|
||||
</script>
|
||||
|
||||
<script src="lib/octokat.js"></script>
|
||||
<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>
|
||||
|
||||
<script src="gen/ide/vlist.js"></script>
|
||||
<script src="gen/common/video/tms9918a.js"></script>
|
||||
<script src="gen/common/util.js"></script>
|
||||
<script src="gen/ide/store.js"></script>
|
||||
<script src="gen/common/emu.js"></script>
|
||||
<script src="gen/common/baseplatform.js"></script>
|
||||
<script src="gen/common/analysis.js"></script>
|
||||
<script src="gen/common/audio.js"></script>
|
||||
<script src="gen/common/cpu/disasm6502.js"></script>
|
||||
<script src="gen/common/cpu/disasmz80.js"></script>
|
||||
<script src="gen/common/workertypes.js"></script>
|
||||
<script src="gen/ide/project.js"></script>
|
||||
<script src="gen/ide/windows.js"></script>
|
||||
<script src="gen/ide/views.js"></script>
|
||||
<script src="gen/common/recorder.js"></script>
|
||||
<script src="gen/ide/waveform.js"></script>
|
||||
<script src="gen/ide/pixeleditor.js"></script>
|
||||
<script src="gen/ide/services.js"></script>
|
||||
<script src="gen/ide/ui.js"></script>
|
||||
<script src="gen/common/devices.js"></script>
|
||||
<script src="gen/common/cpu/MOS6502.js"></script>
|
||||
<script src="gen/common/cpu/ZilogZ80.js"></script>
|
||||
<script src="gen/machine/vdp_z80.js"></script>
|
||||
|
||||
<script>
|
||||
// submenus open on click + hover
|
||||
$( ".dropdown-submenu" ).click(function(event) {
|
||||
event.stopPropagation();
|
||||
$(this).parent().siblings().removeClass('open');
|
||||
$(this).parent().toggleClass('open');
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
startUI();
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
252
electron.js
Normal file
@ -0,0 +1,252 @@
|
||||
const { app, ipcMain, ipcRenderer, Menu, BrowserWindow } = require('electron')
|
||||
const modpath = require('path')
|
||||
const fs = require('fs')
|
||||
const {URLSearchParams} = require('url')
|
||||
const isMac = process.platform === 'darwin'
|
||||
const chokidar = require('chokidar')
|
||||
|
||||
// file watcher
|
||||
class Workspace {
|
||||
constructor(directory, mainfile, wnd) {
|
||||
this.directory = directory;
|
||||
this.mainfile = mainfile;
|
||||
this.watcher = chokidar.watch(modpath.join(directory, mainfile));
|
||||
this.watcher.on('all', (event, path) => {
|
||||
console.log(event, path);
|
||||
switch (event) {
|
||||
case 'add':
|
||||
/*
|
||||
wnd.webContents.send('updateFile', {
|
||||
main: modpath.relative(mainDirectoryPath, mainFilePath),
|
||||
path: modpath.relative(mainDirectoryPath, path),
|
||||
data: data,
|
||||
});
|
||||
*/
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function openFile(path) {
|
||||
var data = new Uint8Array(fs.readFileSync(path));
|
||||
var dirname = modpath.dirname(path);
|
||||
var filename = modpath.basename(path);
|
||||
//var platform_id = 'vcs'; // TODO: which platform?
|
||||
//var wnd = createWindow({repo_id:dirname, file:filename, platform_id:platform_id});
|
||||
var wnd = BrowserWindow.getFocusedWindow();
|
||||
var ws = new Workspace(dirname, filename, wnd);
|
||||
wnd.workspace = ws;
|
||||
var qs = new URLSearchParams();
|
||||
qs.set('ws', dirname);
|
||||
qs.set('file', filename);
|
||||
wnd.loadURL(`file://${__dirname}/electron.html?${qs}`);
|
||||
}
|
||||
|
||||
function openFileDialog() {
|
||||
const { dialog } = require('electron')
|
||||
dialog.showOpenDialog({
|
||||
title: "Open File",
|
||||
properties: ['openFile','promptToCreate'],
|
||||
}).then((rtn) => {
|
||||
if (!rtn.canceled && rtn.filePaths && rtn.filePaths.length > 0) {
|
||||
var path = rtn.filePaths[0];
|
||||
openFile(path);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function openWorkspace() {
|
||||
const { dialog } = require('electron')
|
||||
console.log(dialog.showOpenDialog({
|
||||
title: "Open Workspace",
|
||||
properties: ['openDirectory','createDirectory','promptToCreate'],
|
||||
message: "Choose a directory that holds your source files.",
|
||||
}))
|
||||
}
|
||||
|
||||
function openURL(url) {
|
||||
return async () => {
|
||||
const { shell } = require('electron')
|
||||
await shell.openExternal(url);
|
||||
}
|
||||
}
|
||||
|
||||
function buildMenu() {
|
||||
|
||||
const template = [
|
||||
// { role: 'appMenu' }
|
||||
...(isMac ? [{
|
||||
label: app.name,
|
||||
submenu: [
|
||||
{ role: 'about' },
|
||||
{ type: 'separator' },
|
||||
{ role: 'services' },
|
||||
{ type: 'separator' },
|
||||
{ role: 'hide' },
|
||||
{ role: 'hideothers' },
|
||||
{ role: 'unhide' },
|
||||
{ type: 'separator' },
|
||||
{ role: 'quit' }
|
||||
]
|
||||
}] : []),
|
||||
// { role: 'fileMenu' }
|
||||
{
|
||||
label: 'File',
|
||||
submenu: [
|
||||
/*
|
||||
{
|
||||
label: 'Open File...',
|
||||
click: openFileDialog,
|
||||
accelerator: 'CmdOrCtrl+O',
|
||||
},
|
||||
*/
|
||||
{ type: 'separator' },
|
||||
isMac ? { role: 'close' } : { role: 'quit' }
|
||||
]
|
||||
},
|
||||
// { role: 'editMenu' }
|
||||
{
|
||||
label: 'Edit',
|
||||
submenu: [
|
||||
{ role: 'undo' },
|
||||
{ role: 'redo' },
|
||||
{ type: 'separator' },
|
||||
{ role: 'cut' },
|
||||
{ role: 'copy' },
|
||||
{ role: 'paste' },
|
||||
...(isMac ? [
|
||||
{ role: 'pasteAndMatchStyle' },
|
||||
{ role: 'delete' },
|
||||
{ role: 'selectAll' },
|
||||
{ type: 'separator' },
|
||||
{
|
||||
label: 'Speech',
|
||||
submenu: [
|
||||
{ role: 'startspeaking' },
|
||||
{ role: 'stopspeaking' }
|
||||
]
|
||||
}
|
||||
] : [
|
||||
{ role: 'delete' },
|
||||
{ type: 'separator' },
|
||||
{ role: 'selectAll' }
|
||||
])
|
||||
]
|
||||
},
|
||||
// { role: 'viewMenu' }
|
||||
{
|
||||
label: 'View',
|
||||
submenu: [
|
||||
{ role: 'reload' },
|
||||
{ role: 'forcereload' },
|
||||
{ role: 'toggledevtools' },
|
||||
{ type: 'separator' },
|
||||
{ role: 'resetzoom' },
|
||||
{ role: 'zoomin' },
|
||||
{ role: 'zoomout' },
|
||||
{ type: 'separator' },
|
||||
{ role: 'togglefullscreen' }
|
||||
]
|
||||
},
|
||||
// { role: 'windowMenu' }
|
||||
{
|
||||
label: 'Window',
|
||||
submenu: [
|
||||
{ role: 'minimize' },
|
||||
{ role: 'zoom' },
|
||||
...(isMac ? [
|
||||
{ type: 'separator' },
|
||||
{ role: 'front' },
|
||||
{ type: 'separator' },
|
||||
{ role: 'window' }
|
||||
] : [
|
||||
{ role: 'close' }
|
||||
])
|
||||
]
|
||||
},
|
||||
{
|
||||
role: 'help',
|
||||
submenu: [
|
||||
{
|
||||
label: 'IDE Help',
|
||||
click: openURL('https://8bitworkshop.com/blog/docs/ide.md.html')
|
||||
},
|
||||
{
|
||||
label: 'Latest News',
|
||||
click: openURL('https://8bitworkshop.com/blog/')
|
||||
},
|
||||
{
|
||||
label: 'Follow @8bitworkshop on Twitter',
|
||||
click: openURL('https://twitter.com/8bitworkshop')
|
||||
},
|
||||
{
|
||||
label: 'Report an Issue',
|
||||
click: openURL('https://github.com/sehugg/8bitworkshop/issues/new')
|
||||
},
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
const menu = Menu.buildFromTemplate(template)
|
||||
Menu.setApplicationMenu(menu)
|
||||
}
|
||||
|
||||
function createWindow () {
|
||||
// Create the browser window.
|
||||
const win = new BrowserWindow({
|
||||
width: 1024,
|
||||
height: 768,
|
||||
backgroundColor: '#fff',
|
||||
webPreferences: {
|
||||
preload: modpath.join(__dirname, './electron-preload.js'),
|
||||
nodeIntegration: false,
|
||||
enableRemoteModule: false,
|
||||
contextIsolation: true,
|
||||
sandbox: true,
|
||||
}
|
||||
})
|
||||
|
||||
// and load the index.html of the app.
|
||||
win.loadFile('electron.html')
|
||||
|
||||
// Open the DevTools.
|
||||
//win.webContents.openDevTools()
|
||||
|
||||
// Maximize
|
||||
win.maximize();
|
||||
return win;
|
||||
}
|
||||
|
||||
// This method will be called when Electron has finished
|
||||
// initialization and is ready to create browser windows.
|
||||
// Some APIs can only be used after this event occurs.
|
||||
app.whenReady().then(buildMenu).then(createWindow)
|
||||
|
||||
// Quit when all windows are closed, except on macOS. There, it's common
|
||||
// for applications and their menu bar to stay active until the user quits
|
||||
// explicitly with Cmd + Q.
|
||||
app.on('window-all-closed', () => {
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
|
||||
app.on('activate', () => {
|
||||
// On macOS it's common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (BrowserWindow.getAllWindows().length === 0) {
|
||||
createWindow()
|
||||
}
|
||||
})
|
||||
|
||||
// In this file you can include the rest of your app's specific main process
|
||||
// code. You can also put them in separate files and require them here.
|
||||
|
||||
// Register IPC messages
|
||||
// https://stackoverflow.com/questions/52236641/electron-ipc-and-nodeintegration
|
||||
/*
|
||||
ipcMain.on('hello', (event, message) => {
|
||||
console.log(event);
|
||||
});
|
||||
*/
|
BIN
images/8bitworkshop-icon-1024.icns
Normal file
BIN
images/8bitworkshop-icon-1024.ico
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
images/8bitworkshop-icon-1024.png
Normal file
After Width: | Height: | Size: 67 KiB |
12
index.html
@ -131,8 +131,8 @@ if (window.location.host.endsWith('8bitworkshop.com')) {
|
||||
<li class="dropdown dropdown-submenu">
|
||||
<a tabindex="-1" href="#">Tools</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a class="dropdown-item" target="_8bws_tools" href="//8bitworkshop.com/dithertron/">Dithertron Image Converter</a></li>
|
||||
<li><a class="dropdown-item" target="_8bws_tools" href="//8bitworkshop.com/bitmapfontgenerator/">Bitmap Font Generator</a></li>
|
||||
<li><a class="dropdown-item" target="_8bws_tools" href="https://8bitworkshop.com/dithertron/">Dithertron Image Converter</a></li>
|
||||
<li><a class="dropdown-item" target="_8bws_tools" href="https://8bitworkshop.com/bitmapfontgenerator/">Bitmap Font Generator</a></li>
|
||||
<li><a class="dropdown-item" target="_8bws_tools" href="http://tomeko.net/online_tools/file_to_hex.php?lang=en">Binary File to Hex Converter</a></li>
|
||||
<li class="dropdown dropdown-submenu">
|
||||
<a tabindex="-1" href="#">Atari 2600</a>
|
||||
@ -568,14 +568,8 @@ if (window.location.host.endsWith('8bitworkshop.com')) {
|
||||
<script src="codemirror/addon/selection/active-line.js"></script>
|
||||
<link rel="stylesheet" href="codemirror/addon/dialog/dialog.css">
|
||||
<script src="javatari.js/release/javatari/javatari.js"></script>
|
||||
<!--
|
||||
<script src="javatari.js/src/main/Javatari.js"></script>
|
||||
<script src="javatari.js/temp/javatari.part.concat.js"></script>
|
||||
<script src="src/common/cpu/z80.js"></script>
|
||||
-->
|
||||
<script src="jsnes/dist/jsnes.min.js"></script>
|
||||
<script src="src/common/cpu/6809.js"></script>
|
||||
<!--<script src="jsnes/lib/dynamicaudio-min.js" type="text/javascript" charset="utf-8"></script>-->
|
||||
<script src="FileSaver.js/FileSaver.min.js"></script>
|
||||
<script src="lib/mousetrap.min.js"></script>
|
||||
<script src="lib/mousetrap-global-bind.min.js"></script>
|
||||
@ -617,8 +611,6 @@ function require(modname) {
|
||||
<script src="gen/ide/pixeleditor.js"></script>
|
||||
<script src="gen/ide/services.js"></script>
|
||||
<script src="gen/ide/ui.js"></script>
|
||||
<!-- <script src="src/audio/votrax.js"></script> -->
|
||||
<!-- <script src="local/lzg.js"></script> -->
|
||||
<script src="gen/common/devices.js"></script>
|
||||
<script src="gen/common/cpu/MOS6502.js"></script>
|
||||
<script src="gen/common/cpu/ZilogZ80.js"></script>
|
||||
|
1432
package-lock.json
generated
14
package.json
@ -11,6 +11,7 @@
|
||||
"dependencies": {
|
||||
"bootstrap-tourist": "^0.2.1",
|
||||
"browser-detect": "^0.2.28",
|
||||
"chokidar": "^3.4.1",
|
||||
"jquery": "^3.5.1",
|
||||
"reflect-metadata": "^0.1.13"
|
||||
},
|
||||
@ -22,6 +23,8 @@
|
||||
"atob": "^2.1.x",
|
||||
"btoa": "^1.2.x",
|
||||
"clipboard": "^2.0.6",
|
||||
"electron": "^9.1.2",
|
||||
"electron-packager": "^15.0.0",
|
||||
"jsdom": "^12.2.0",
|
||||
"lzg": "^1.0.x",
|
||||
"mocha": "^7.2.0",
|
||||
@ -32,7 +35,6 @@
|
||||
"typescript-formatter": "^7.2.2",
|
||||
"vgm-parser": "^0.6.3"
|
||||
},
|
||||
"main": "main.js",
|
||||
"directories": {
|
||||
"doc": "doc",
|
||||
"test": "tests"
|
||||
@ -44,10 +46,16 @@
|
||||
"test-node": "NODE_PATH=$(pwd) mocha --recursive --timeout 60000 test/cli",
|
||||
"test-worker": "NODE_PATH=$(pwd) mocha --recursive --timeout 60000 test/cli/testworker.js",
|
||||
"test-platforms": "NODE_PATH=$(pwd) mocha --recursive --timeout 60000 test/cli/testplatforms.js",
|
||||
"test-profile": "NODE_PATH=$(pwd) mocha --recursive --timeout 60000 --prof test/cli"
|
||||
"test-profile": "NODE_PATH=$(pwd) mocha --recursive --timeout 60000 --prof test/cli",
|
||||
"start": "electron ."
|
||||
},
|
||||
"main": "electron.js",
|
||||
"keywords": [
|
||||
"8bit"
|
||||
"8bit",
|
||||
"ide",
|
||||
"retrodev",
|
||||
"6502",
|
||||
"z80"
|
||||
],
|
||||
"bugs": {
|
||||
"url": "https://github.com/sehugg/8bitworkshop/issues"
|
||||
|
@ -1,6 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ./scripts/env.sh
|
||||
DESTPATH=$RSYNC_PATH/dev/
|
||||
git ls-files -z | rsync --stats -riltz --exclude '.*' --exclude 'scripts/*' --exclude=node_modules --chmod=a+rx -e "ssh" --files-from - -0 . $DESTPATH
|
||||
rsync --stats -riltz --chmod=a+rx -e "ssh" ./gen config.js $DESTPATH/
|
||||
make dist
|
||||
rsync --stats -riltz --chmod=a+rx -e "ssh" ./tmp/dist/ config.js $DESTPATH/
|
||||
|
@ -445,6 +445,7 @@ export function rle_unpack(src : Uint8Array) : Uint8Array {
|
||||
}
|
||||
|
||||
// firefox doesn't do GET with binary files
|
||||
// TODO: replace with fetch()?
|
||||
export function getWithBinary(url:string, success:(text:string|Uint8Array)=>void, datatype:'text'|'arraybuffer') {
|
||||
var oReq = new XMLHttpRequest();
|
||||
oReq.open("GET", url, true);
|
||||
@ -462,6 +463,9 @@ export function getWithBinary(url:string, success:(text:string|Uint8Array)=>void
|
||||
throw Error("Error " + oReq.status + " loading " + url);
|
||||
}
|
||||
}
|
||||
oReq.onerror = function (oEvent) {
|
||||
success(null);
|
||||
}
|
||||
oReq.ontimeout = function (oEvent) {
|
||||
throw Error("Timeout loading " + url);
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ var TOOL_TO_SOURCE_STYLE = {
|
||||
}
|
||||
|
||||
function gaEvent(category:string, action:string, label?:string, value?:string) {
|
||||
if (ga) ga('send', 'event', category, action, label, value);
|
||||
if (window['ga']) ga('send', 'event', category, action, label, value);
|
||||
}
|
||||
function alertError(s:string) {
|
||||
gaEvent('error', platform_id||'error', s);
|
||||
@ -1072,7 +1072,7 @@ function showErrorAlert(errors : WorkerError[]) {
|
||||
var measureTimeStart : Date = new Date();
|
||||
var measureTimeLoad : Date;
|
||||
function measureBuildTime() {
|
||||
if (ga && measureTimeLoad) {
|
||||
if (window['ga'] && measureTimeLoad) {
|
||||
var measureTimeBuild = new Date();
|
||||
ga('send', 'timing', 'load', platform_id, (measureTimeLoad.getTime() - measureTimeStart.getTime()));
|
||||
ga('send', 'timing', 'build', platform_id, (measureTimeBuild.getTime() - measureTimeLoad.getTime()));
|
||||
@ -1759,12 +1759,6 @@ function showWelcomeMessage() {
|
||||
// Instance the tour
|
||||
var is_vcs = platform_id.startsWith('vcs');
|
||||
var steps = [
|
||||
{
|
||||
element: "#dropdownMenuButton",
|
||||
placement: 'right',
|
||||
title: "Cookie Consent",
|
||||
content: 'Before we start, we should tell you that this website stores cookies and other data in your browser. You can review our <a href="/privacy.html" target="_new">privacy policy</a>.'
|
||||
},
|
||||
{
|
||||
element: "#platformsMenuButton",
|
||||
placement: 'right',
|
||||
@ -1805,12 +1799,6 @@ function showWelcomeMessage() {
|
||||
content: "Pull right to expose the sidebar. It lets you switch between source files, view assembly listings, and use other tools like Disassembler, Memory Browser, and Asset Editor."
|
||||
}
|
||||
];
|
||||
steps.push({
|
||||
element: "#booksMenuButton",
|
||||
placement: 'left',
|
||||
title: "Books",
|
||||
content: "Get some books that explain how to program all of this stuff, and write some games!"
|
||||
});
|
||||
if (!isLandscape()) {
|
||||
steps.unshift({
|
||||
element: "#controls_top",
|
||||
@ -1819,6 +1807,20 @@ function showWelcomeMessage() {
|
||||
content: "This site works best on desktop browsers. For best results, rotate your device to landscape orientation."
|
||||
});
|
||||
}
|
||||
if (window.location.host.endsWith('8bitworkshop.com')) {
|
||||
steps.unshift({
|
||||
element: "#dropdownMenuButton",
|
||||
placement: 'right',
|
||||
title: "Cookie Consent",
|
||||
content: 'Before we start, we should tell you that this website stores cookies and other data in your browser. You can review our <a href="/privacy.html" target="_new">privacy policy</a>.'
|
||||
});
|
||||
steps.push({
|
||||
element: "#booksMenuButton",
|
||||
placement: 'left',
|
||||
title: "Books",
|
||||
content: "Get some books that explain how to program all of this stuff, and write some games!"
|
||||
});
|
||||
}
|
||||
var tour = new Tour({
|
||||
autoscroll:false,
|
||||
//storage:false,
|
||||
@ -1925,7 +1927,7 @@ function showInstructions() {
|
||||
}
|
||||
|
||||
function installGAHooks() {
|
||||
if (ga) {
|
||||
if (window['ga']) {
|
||||
$(".dropdown-item").click((e) => {
|
||||
if (e.target && e.target.id) {
|
||||
gaEvent('menu', e.target.id);
|
||||
@ -2191,3 +2193,8 @@ function redirectToHTTPS() {
|
||||
|
||||
// redirect to HTTPS after script loads?
|
||||
redirectToHTTPS();
|
||||
|
||||
// listen for messages
|
||||
window.onmessage = function(event) {
|
||||
console.log("WINDOW", event);
|
||||
};
|
||||
|
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 1023 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 783 B |
Before Width: | Height: | Size: 2.3 KiB |