mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2025-02-27 13:29:32 +00:00
Merge branch 'master' of github.com:sehugg/8bitworkshop
This commit is contained in:
commit
3b18217f4e
@ -121,6 +121,7 @@ div.mem_info a.selected {
|
||||
padding-right:4px;
|
||||
padding-top:2px;
|
||||
padding-bottom:2px;
|
||||
margin:1px;
|
||||
}
|
||||
.btn_label {
|
||||
color: #ccc;
|
||||
@ -130,14 +131,17 @@ div.mem_info a.selected {
|
||||
.btn_group.view_group {
|
||||
}
|
||||
.btn_active {
|
||||
color: #33cc33;
|
||||
color: #33cc33 !important;
|
||||
}
|
||||
.btn_stopped {
|
||||
color: #ff9933;
|
||||
color: #ff9933 !important;
|
||||
}
|
||||
.btn_recording {
|
||||
color: #ff3333;
|
||||
}
|
||||
.btn_toolbar {
|
||||
margin:4px;
|
||||
}
|
||||
span.hilite {
|
||||
color: #ff66ff;
|
||||
}
|
||||
|
@ -93,6 +93,7 @@ TODO:
|
||||
- put globals into view/controller objects
|
||||
- upload binary files doesn't do what's expected, changing pulldown and whatnot
|
||||
- chrome autostart audio: https://github.com/processing/p5.js-sound/issues/249
|
||||
- firefox autostart audio: https://support.mozilla.org/en-US/kb/block-autoplay
|
||||
- show player controls for each platform, allow touch support, navigator.getGamepads
|
||||
- better undo/diff for mistakes?
|
||||
- ide bug/feature visualizer for sponsors
|
||||
@ -111,6 +112,8 @@ TODO:
|
||||
- per-View keyboard shortcuts
|
||||
- crt0.s compiled each time?
|
||||
- debug highlight doesn't go away when debugging -> running
|
||||
- parse labels
|
||||
- editing too fast refreshes kills the editor
|
||||
|
||||
WEB WORKER FORMAT
|
||||
|
||||
|
52
index.html
52
index.html
@ -137,49 +137,49 @@ if (window.location.host.endsWith('8bitworkshop.com')) {
|
||||
|
||||
<img id="compile_spinner" src="images/spinner.gif" height="20em" style="visibility:hidden;margin-left:8px;margin-right:8px">
|
||||
<span class="btn_group debug_group hidden-xs" id="debug_bar">
|
||||
<button id="dbg_reset" type="button" title="Reset and Break"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span></button>
|
||||
<button id="dbg_pause" type="button" title="Pause"><span class="glyphicon glyphicon-pause" aria-hidden="true"></span></button>
|
||||
<button id="dbg_go" type="button" title="Run"><span class="glyphicon glyphicon-play" aria-hidden="true"></span></button>
|
||||
<button id="dbg_step" type="button" title="Step"><span class="glyphicon glyphicon-step-forward" aria-hidden="true"></span></button>
|
||||
<button id="dbg_tovsync" type="button" title="Next Frame/Interrupt"><span class="glyphicon glyphicon-forward" aria-hidden="true"></span></button>
|
||||
<button id="dbg_toline" type="button" title="Run To Line"><span class="glyphicon glyphicon-save" aria-hidden="true"></span></button>
|
||||
<button id="dbg_stepout" type="button" title="Step Out of Subroutine"><span class="glyphicon glyphicon-hand-up" aria-hidden="true"></span></button>
|
||||
<button id="dbg_stepback" type="button" title="Step Backwards"><span class="glyphicon glyphicon-step-backward" aria-hidden="true"></span></button>
|
||||
<button id="dbg_reset" class="btn" title="Reset and Break"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span></button>
|
||||
<button id="dbg_pause" class="btn" title="Pause"><span class="glyphicon glyphicon-pause" aria-hidden="true"></span></button>
|
||||
<button id="dbg_go" class="btn" title="Run"><span class="glyphicon glyphicon-play" aria-hidden="true"></span></button>
|
||||
<button id="dbg_step" class="btn" title="Step"><span class="glyphicon glyphicon-step-forward" aria-hidden="true"></span></button>
|
||||
<button id="dbg_tovsync" class="btn" title="Next Frame/Interrupt"><span class="glyphicon glyphicon-forward" aria-hidden="true"></span></button>
|
||||
<button id="dbg_toline" class="btn" title="Run To Line"><span class="glyphicon glyphicon-save" aria-hidden="true"></span></button>
|
||||
<button id="dbg_stepout" class="btn" title="Step Out of Subroutine"><span class="glyphicon glyphicon-hand-up" aria-hidden="true"></span></button>
|
||||
<button id="dbg_stepback" class="btn" title="Step Backwards"><span class="glyphicon glyphicon-step-backward" aria-hidden="true"></span></button>
|
||||
</span>
|
||||
<span class="btn_group view_group hidden-sm hidden-xs" id="extra_bar">
|
||||
<button id="dbg_timing" type="button" title="Analyze CPU Timing" style="display:none"><span class="glyphicon glyphicon-time" aria-hidden="true"></span></button>
|
||||
<button id="dbg_disasm" type="button" title="Show Disassembly" style="display:none"><span class="glyphicon glyphicon-list" aria-hidden="true"></span></button>
|
||||
<button id="dbg_memory" type="button" title="Show Memory" style="display:none"><span class="glyphicon glyphicon-sunglasses" aria-hidden="true"></span></button>
|
||||
<button id="dbg_profile" type="button" title="Show Profile" style="display:none"><span class="glyphicon glyphicon-stats" aria-hidden="true"></span></button>
|
||||
<button id="dbg_record" type="button" title="Start/Stop Replay Recording" style="display:none"><span class="glyphicon glyphicon-record" aria-hidden="true"></span></button>
|
||||
<button id="dbg_help" type="button" title="Help" style="display:none"><span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span></button>
|
||||
<button id="dbg_timing" class="btn" title="Analyze CPU Timing" style="display:none"><span class="glyphicon glyphicon-time" aria-hidden="true"></span></button>
|
||||
<button id="dbg_disasm" class="btn" title="Show Disassembly" style="display:none"><span class="glyphicon glyphicon-list" aria-hidden="true"></span></button>
|
||||
<button id="dbg_memory" class="btn" title="Show Memory" style="display:none"><span class="glyphicon glyphicon-sunglasses" aria-hidden="true"></span></button>
|
||||
<button id="dbg_profile" class="btn" title="Show Profile" style="display:none"><span class="glyphicon glyphicon-stats" aria-hidden="true"></span></button>
|
||||
<button id="dbg_record" class="btn" title="Start/Stop Replay Recording" style="display:none"><span class="glyphicon glyphicon-record" aria-hidden="true"></span></button>
|
||||
<button id="dbg_help" class="btn" title="Help" style="display:none"><span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span></button>
|
||||
</span>
|
||||
<span class="btn_group view_group hidden-sm hidden-xs" id="speed_bar" style="display:none">
|
||||
<button id="dbg_slowest" type="button" title="Slowest"><span class="glyphicon glyphicon-fast-backward" aria-hidden="true"></span></button>
|
||||
<button id="dbg_slower" type="button" title="Slower"><span class="glyphicon glyphicon-backward" aria-hidden="true"></span></button>
|
||||
<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" type="button" title="Faster"><span class="glyphicon glyphicon-forward" aria-hidden="true"></span></button>
|
||||
<button id="dbg_fastest" type="button" title="Faster"><span class="glyphicon glyphicon-fast-forward" aria-hidden="true"></span></button>
|
||||
<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>
|
||||
|
||||
<span class="dropdown" style="float:right">
|
||||
<span class="logo-gradient hidden-xs hidden-sm">8bitworkshop</span>
|
||||
<span class="logo-gradient hidden-xs hidden-sm hidden-md">8bitworkshop</span>
|
||||
|
||||
<a class="btn btn-secondary dropdown-toggle" id="booksMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<a class="btn btn-secondary dropdown-toggle hidden-xs" id="booksMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
GET BOOKS <span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu pull-right" aria-labelledby="dropdownMenuButton">
|
||||
<li>
|
||||
<a class="dropdown-item dropdown-link" 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"/>
|
||||
<b>Making Games For The Atari 2600</b><!-- (Print/Kindle Editions)-->
|
||||
<b>Making Games For The Atari 2600</b>
|
||||
</a>
|
||||
<a class="dropdown-item dropdown-link" 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"/>
|
||||
<b>Making 8-bit Arcade Games in C</b><!-- (Print Edition)-->
|
||||
<b>Making 8-bit Arcade Games in C</b>
|
||||
</a>
|
||||
<a class="dropdown-item dropdown-link" 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">
|
||||
<img src="images/book_verilog.png"/>
|
||||
@ -200,12 +200,12 @@ if (window.location.host.endsWith('8bitworkshop.com')) {
|
||||
<div class="emulator" id="emulator">
|
||||
<div id="replaydiv" class="replaydiv" style="display:none">
|
||||
<div style="display:flex">
|
||||
<button id="replay_min" type="button" title="Start of replay"><span class="glyphicon glyphicon-fast-backward" aria-hidden="true"></span></button>
|
||||
<button id="replay_back" type="button" title="Back one frame"><span class="glyphicon glyphicon-backward" aria-hidden="true"></span></button>
|
||||
<button id="replay_min" class="btn" title="Start of replay"><span class="glyphicon glyphicon-fast-backward" aria-hidden="true"></span></button>
|
||||
<button id="replay_back" class="btn" title="Back one frame"><span class="glyphicon glyphicon-backward" aria-hidden="true"></span></button>
|
||||
<span id="replay_frame" style="text-align:center;width:3em;margin-left:1em;color:#ccc">-</span>
|
||||
<input type="range" min="0" max="0" value="0" class="slider" id="replayslider">
|
||||
<button id="replay_fwd" type="button" title="Ahead one frame"><span class="glyphicon glyphicon-forward" aria-hidden="true"></span></button>
|
||||
<button id="replay_max" type="button" title="End of replay"><span class="glyphicon glyphicon-fast-forward" aria-hidden="true"></span></button>
|
||||
<button id="replay_fwd" class="btn" title="Ahead one frame"><span class="glyphicon glyphicon-forward" aria-hidden="true"></span></button>
|
||||
<button id="replay_max" class="btn" title="End of replay"><span class="glyphicon glyphicon-fast-forward" aria-hidden="true"></span></button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="javatari-div" style="float:center;margin:10px;display:none">
|
||||
|
46
src/emu.ts
46
src/emu.ts
@ -4,6 +4,7 @@ import { hex, clamp } from "./util";
|
||||
|
||||
// external modules
|
||||
declare var jt, Javatari, Z80_fast, CPU6809;
|
||||
declare var Mousetrap;
|
||||
|
||||
// Emulator classes
|
||||
|
||||
@ -497,3 +498,48 @@ export function newAddressDecoder(table : AddressDecoderEntry[], options?:Addres
|
||||
return new (AddressDecoder as any)(table, options);
|
||||
}
|
||||
|
||||
/// TOOLBAR
|
||||
|
||||
export class Toolbar {
|
||||
div : JQuery;
|
||||
grp : JQuery;
|
||||
mousetrap;
|
||||
boundkeys = [];
|
||||
|
||||
constructor(parentDiv:HTMLElement) {
|
||||
this.mousetrap = new Mousetrap(parentDiv);
|
||||
this.div = $(document.createElement("div")).addClass("btn_toolbar");
|
||||
parentDiv.appendChild(this.div[0]);
|
||||
this.newGroup();
|
||||
}
|
||||
destroy() {
|
||||
if (this.div) {
|
||||
this.div.remove();
|
||||
this.div = null;
|
||||
}
|
||||
if (this.mousetrap) {
|
||||
for (var key of this.boundkeys) {
|
||||
this.mousetrap.unbind(key);
|
||||
}
|
||||
this.mousetrap = null;
|
||||
}
|
||||
}
|
||||
newGroup() {
|
||||
this.grp = $(document.createElement("span")).addClass("btn_group").appendTo(this.div);
|
||||
}
|
||||
add(key:string, alttext:string, icon:string, fn:(e,combo) => void) {
|
||||
if (icon) {
|
||||
var btn = $(document.createElement("button")).addClass("btn");
|
||||
if (icon.startsWith('glyphicon')) {
|
||||
icon = '<span class="glyphicon ' + icon + '" aria-hidden="true"></span>';
|
||||
}
|
||||
btn.html(icon);
|
||||
btn.prop("title", alttext + " (" + key + ")");
|
||||
btn.click(fn);
|
||||
this.grp.append(btn);
|
||||
}
|
||||
this.mousetrap.bind(key, fn);
|
||||
this.boundkeys.push(key);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
|
||||
import { Toolbar } from "./emu";
|
||||
|
||||
declare var VirtualList;
|
||||
declare var Mousetrap;
|
||||
|
||||
export interface WaveformMeta {
|
||||
label : string;
|
||||
@ -15,6 +16,7 @@ export interface WaveformProvider {
|
||||
export class WaveformView {
|
||||
parent : HTMLElement;
|
||||
wfp : WaveformProvider;
|
||||
toolbar : Toolbar;
|
||||
wavelist;
|
||||
meta : WaveformMeta[];
|
||||
lines : HTMLCanvasElement[] = [];
|
||||
@ -46,6 +48,11 @@ export class WaveformView {
|
||||
// remove old thing
|
||||
if (this.wavelist) {
|
||||
$(this.wavelist.container).remove();
|
||||
this.wavelist = null;
|
||||
}
|
||||
if (this.toolbar) {
|
||||
this.toolbar.destroy();
|
||||
this.toolbar = null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -77,6 +84,7 @@ export class WaveformView {
|
||||
var wlc = this.wavelist.container;
|
||||
wlc.tabIndex = -1; // make it focusable
|
||||
//wlc.style = "overflow-x: hidden"; // TODO?
|
||||
this.toolbar = new Toolbar(this.parent);
|
||||
$(this.parent).append(wlc);
|
||||
var down = false;
|
||||
var selfn = (e) => {
|
||||
@ -94,32 +102,32 @@ export class WaveformView {
|
||||
down = false;
|
||||
//if (e['pointerId']) e.target.releasePointerCapture(e['pointerId']);
|
||||
});
|
||||
Mousetrap(wlc).bind('=', (e,combo) => {
|
||||
this.toolbar.add('=', 'Zoom In', 'glyphicon-zoom-in', (e,combo) => {
|
||||
this.setZoom(this.zoom * 2);
|
||||
});
|
||||
Mousetrap(wlc).bind('+', (e,combo) => {
|
||||
this.toolbar.add('+', 'Zoom In', null, (e,combo) => {
|
||||
this.setZoom(this.zoom * 2);
|
||||
});
|
||||
Mousetrap(wlc).bind('-', (e,combo) => {
|
||||
this.toolbar.add('-', 'Zoom Out', 'glyphicon-zoom-out', (e,combo) => {
|
||||
this.setZoom(this.zoom / 2);
|
||||
});
|
||||
Mousetrap(wlc).bind('left', (e,combo) => {
|
||||
this.setSelTime(this.tsel - 1);
|
||||
});
|
||||
Mousetrap(wlc).bind('right', (e,combo) => {
|
||||
this.setSelTime(this.tsel + 1);
|
||||
});
|
||||
Mousetrap(wlc).bind('ctrl+left', (e,combo) => {
|
||||
this.setSelTime(this.tsel - this.clocksPerPage/4);
|
||||
});
|
||||
Mousetrap(wlc).bind('ctrl+right', (e,combo) => {
|
||||
this.setSelTime(this.tsel + this.clocksPerPage/4);
|
||||
});
|
||||
Mousetrap(wlc).bind('ctrl+shift+left', (e,combo) => {
|
||||
this.toolbar.add('ctrl+shift+left', 'Move to beginning', 'glyphicon-backward', (e,combo) => {
|
||||
this.setSelTime(0);
|
||||
this.setOrgTime(0);
|
||||
});
|
||||
Mousetrap(wlc).bind('h', (e,combo) => {
|
||||
this.toolbar.add('ctrl+left', 'Move left 1/4 page', 'glyphicon-fast-backward', (e,combo) => {
|
||||
this.setSelTime(this.tsel - this.clocksPerPage/4);
|
||||
});
|
||||
this.toolbar.add('left', 'Move left 1 clock', 'glyphicon-step-backward', (e,combo) => {
|
||||
this.setSelTime(this.tsel - 1);
|
||||
});
|
||||
this.toolbar.add('right', 'Move right 1 clock', 'glyphicon-step-forward', (e,combo) => {
|
||||
this.setSelTime(this.tsel + 1);
|
||||
});
|
||||
this.toolbar.add('ctrl+right', 'Move right 1/4 page', 'glyphicon-fast-forward', (e,combo) => {
|
||||
this.setSelTime(this.tsel + this.clocksPerPage/4);
|
||||
});
|
||||
this.toolbar.add('h', 'Switch between hex/decimal format', 'glyphicon-barcode', (e,combo) => {
|
||||
this.hexformat = !this.hexformat;
|
||||
this.refresh();
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user