mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2024-11-25 03:34:05 +00:00
added Split for main window
This commit is contained in:
parent
4034be10c4
commit
84c8c12092
29
css/ui.css
29
css/ui.css
@ -66,7 +66,8 @@
|
|||||||
}
|
}
|
||||||
#workspace {
|
#workspace {
|
||||||
background-color:#333;
|
background-color:#333;
|
||||||
width:50%;
|
float:left;
|
||||||
|
height:100%;
|
||||||
}
|
}
|
||||||
div.editor {
|
div.editor {
|
||||||
line-height:1.25;
|
line-height:1.25;
|
||||||
@ -217,16 +218,13 @@ a.dropdown-toggle {
|
|||||||
border-radius:6px 0 6px 6px;
|
border-radius:6px 0 6px 6px;
|
||||||
}
|
}
|
||||||
div.emulator {
|
div.emulator {
|
||||||
position:absolute;
|
float:left;
|
||||||
right:0;
|
|
||||||
top:0;
|
|
||||||
width:50%;
|
|
||||||
height:100%;
|
height:100%;
|
||||||
background-color: #666;
|
background-color: #666;
|
||||||
margin-top: 20px auto 0;
|
margin-top: 20px auto 0;
|
||||||
}
|
}
|
||||||
div.emuoverlay {
|
div.emuoverlay {
|
||||||
position:absolute;
|
position:relative;
|
||||||
left:0;
|
left:0;
|
||||||
top:0;
|
top:0;
|
||||||
width:100%;
|
width:100%;
|
||||||
@ -238,7 +236,7 @@ div.emuscope {
|
|||||||
pointer-events:auto;
|
pointer-events:auto;
|
||||||
}
|
}
|
||||||
div.emuspacer {
|
div.emuspacer {
|
||||||
width:0;
|
width:100%;
|
||||||
}
|
}
|
||||||
/* has to be here b/c renders differently after first load if in inline style */
|
/* has to be here b/c renders differently after first load if in inline style */
|
||||||
.emuvideo {
|
.emuvideo {
|
||||||
@ -312,10 +310,10 @@ canvas.pixelated {
|
|||||||
}
|
}
|
||||||
div.replaydiv {
|
div.replaydiv {
|
||||||
position:absolute;
|
position:absolute;
|
||||||
padding:20px;
|
padding:15px;
|
||||||
left:50%;
|
left:50%;
|
||||||
bottom:0;
|
bottom:0;
|
||||||
width:50%;
|
right:0;
|
||||||
background-color: #666;
|
background-color: #666;
|
||||||
}
|
}
|
||||||
.slider {
|
.slider {
|
||||||
@ -328,6 +326,14 @@ div.replaydiv {
|
|||||||
background-position: 50%;
|
background-position: 50%;
|
||||||
pointer-events:auto;
|
pointer-events:auto;
|
||||||
}
|
}
|
||||||
|
.gutter.gutter-horizontal {
|
||||||
|
background-image: url('grips/vertical.png');
|
||||||
|
cursor: col-resize;
|
||||||
|
}
|
||||||
|
.gutter.gutter-vertical {
|
||||||
|
background-image: url('grips/horizontal.png');
|
||||||
|
cursor: row-resize;
|
||||||
|
}
|
||||||
.gutter.gutter-vertical {
|
.gutter.gutter-vertical {
|
||||||
background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAFAQMAAABo7865AAAABlBMVEVHcEzMzMzyAv2sAAAAAXRSTlMAQObYZgAAABBJREFUeF5jOAMEEAIEEFwAn3kMwcB6I2AAAAAASUVORK5CYII=');
|
background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAFAQMAAABo7865AAAABlBMVEVHcEzMzMzyAv2sAAAAAXRSTlMAQObYZgAAABBJREFUeF5jOAMEEAIEEFwAn3kMwcB6I2AAAAAASUVORK5CYII=');
|
||||||
}
|
}
|
||||||
@ -335,6 +341,11 @@ div.replaydiv {
|
|||||||
background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAeCAYAAADkftS9AAAAIklEQVQoU2M4c+bMfxAGAgYYmwGrIIiDjrELjpo5aiZeMwF+yNnOs5KSvgAAAABJRU5ErkJggg==');
|
background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAeCAYAAADkftS9AAAAIklEQVQoU2M4c+bMfxAGAgYYmwGrIIiDjrELjpo5aiZeMwF+yNnOs5KSvgAAAABJRU5ErkJggg==');
|
||||||
height:100%;
|
height:100%;
|
||||||
}
|
}
|
||||||
|
.split,
|
||||||
|
.gutter.gutter-horizontal {
|
||||||
|
float: left;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
div.markdown {
|
div.markdown {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
width:94%;
|
width:94%;
|
||||||
|
@ -78,7 +78,7 @@ TODO:
|
|||||||
- batariBasic: proper line numbers, listing, syntax highlighting
|
- batariBasic: proper line numbers, listing, syntax highlighting
|
||||||
- show player controls for each platform, allow touch support
|
- show player controls for each platform, allow touch support
|
||||||
- granular control over time scrubbing, show CPU state
|
- granular control over time scrubbing, show CPU state
|
||||||
- __MAIN__ for main C file
|
- error showing replay div before rom starts
|
||||||
|
|
||||||
|
|
||||||
WEB WORKER FORMAT
|
WEB WORKER FORMAT
|
||||||
|
@ -203,9 +203,6 @@ if (window.location.host.endsWith('8bitworkshop.com')) {
|
|||||||
</div>
|
</div>
|
||||||
<div id="emuoverlay" class="emuoverlay" style="display:none">
|
<div id="emuoverlay" class="emuoverlay" style="display:none">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div id="mem_info" class="mem_info" style="display:none">
|
|
||||||
</div>
|
|
||||||
<div id="replaydiv" class="replaydiv" style="display:none">
|
<div id="replaydiv" class="replaydiv" style="display:none">
|
||||||
<div style="display:flex">
|
<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_min" type="button" title="Start of replay"><span class="glyphicon glyphicon-fast-backward" aria-hidden="true"></span></button>
|
||||||
@ -216,6 +213,9 @@ if (window.location.host.endsWith('8bitworkshop.com')) {
|
|||||||
<button id="replay_max" type="button" title="End of replay"><span class="glyphicon glyphicon-fast-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>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</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">
|
<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>
|
<button type="button" class="close" onclick="$('.alert').hide()" aria-hidden="true">×</button>
|
||||||
<div id="error_alert_msg"></div>
|
<div id="error_alert_msg"></div>
|
||||||
@ -351,7 +351,6 @@ function require(modname) {
|
|||||||
<script src="local/lzg.js"></script>
|
<script src="local/lzg.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
//Split(["#workspace", "#emulator"], {sizes: [50,50]});
|
|
||||||
startUI(true);
|
startUI(true);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -3,4 +3,4 @@
|
|||||||
. ./scripts/env.sh
|
. ./scripts/env.sh
|
||||||
DESTPATH=$RSYNC_PATH/dev/
|
DESTPATH=$RSYNC_PATH/dev/
|
||||||
git ls-files -z | rsync --stats --exclude '.*' --exclude 'scripts/*' --exclude=node_modules -ril --chmod=a+rx -e "ssh -p 2222" --files-from - -0 . $DESTPATH
|
git ls-files -z | rsync --stats --exclude '.*' --exclude 'scripts/*' --exclude=node_modules -ril --chmod=a+rx -e "ssh -p 2222" --files-from - -0 . $DESTPATH
|
||||||
rsync --stats -rpilvz --chmod=a+rx -e "ssh -p 2222" ./gen ./mame $DESTPATH/
|
rsync --stats -rpilvz --chmod=a+rx -e "ssh -p 2222" ./gen $DESTPATH/
|
||||||
|
@ -21,5 +21,5 @@ mkdir -p $TMPDIR
|
|||||||
git archive $VERSION | tar x -C $TMPDIR
|
git archive $VERSION | tar x -C $TMPDIR
|
||||||
echo "Copying to $DESTPATH..."
|
echo "Copying to $DESTPATH..."
|
||||||
rsync --stats --exclude '.*' --exclude 'scripts/*' --exclude=node_modules --copy-dest=$DEVPATH -rilz --chmod=a+rx -e "ssh -p 2222" $TMPDIR/ $SUBMODS $DESTPATH
|
rsync --stats --exclude '.*' --exclude 'scripts/*' --exclude=node_modules --copy-dest=$DEVPATH -rilz --chmod=a+rx -e "ssh -p 2222" $TMPDIR/ $SUBMODS $DESTPATH
|
||||||
rsync --stats -rpilvz --chmod=a+rx -e "ssh -p 2222" --copy-dest=$DEVPATH ./gen ./mame $DESTPATH/
|
rsync --stats -rpilvz --chmod=a+rx -e "ssh -p 2222" --copy-dest=$DEVPATH ./gen $DESTPATH/
|
||||||
echo "Done."
|
echo "Done."
|
||||||
|
@ -301,6 +301,7 @@ var VerilogPlatform = function(mainElement, options) {
|
|||||||
|
|
||||||
waveview : WaveformView;
|
waveview : WaveformView;
|
||||||
wavediv : JQuery;
|
wavediv : JQuery;
|
||||||
|
topdiv : JQuery;
|
||||||
split;
|
split;
|
||||||
hasvideo : boolean;
|
hasvideo : boolean;
|
||||||
|
|
||||||
@ -326,15 +327,18 @@ var VerilogPlatform = function(mainElement, options) {
|
|||||||
// setup scope
|
// setup scope
|
||||||
trace_buffer = new Uint32Array(0x20000);
|
trace_buffer = new Uint32Array(0x20000);
|
||||||
var overlay = $("#emuoverlay").show();
|
var overlay = $("#emuoverlay").show();
|
||||||
var topdiv = $('<div class="emuspacer">').appendTo(overlay);
|
this.topdiv = $('<div class="emuspacer">').appendTo(overlay);
|
||||||
|
vcanvas.appendTo(this.topdiv);
|
||||||
this.wavediv = $('<div class="emuscope">').appendTo(overlay);
|
this.wavediv = $('<div class="emuscope">').appendTo(overlay);
|
||||||
this.split = Split( [topdiv[0], this.wavediv[0]], {
|
this.split = Split( [this.topdiv[0], this.wavediv[0]], {
|
||||||
minSize: [0,0],
|
minSize: [0,0],
|
||||||
sizes: [99,1],
|
sizes: [99,1],
|
||||||
direction: 'vertical',
|
direction: 'vertical',
|
||||||
gutterSize: 16,
|
gutterSize: 16,
|
||||||
onDrag: () => {
|
onDrag: () => {
|
||||||
if (this.waveview) this.waveview.recreate();
|
if (this.waveview) this.waveview.recreate();
|
||||||
|
vcanvas.css('position','relative');
|
||||||
|
vcanvas.css('top', -this.wavediv.height()+'px');
|
||||||
},
|
},
|
||||||
onDragStart: () => {
|
onDragStart: () => {
|
||||||
$(".emuoverlay").css("pointer-events", "auto"); // allow drag
|
$(".emuoverlay").css("pointer-events", "auto"); // allow drag
|
||||||
@ -356,6 +360,7 @@ var VerilogPlatform = function(mainElement, options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateVideoFrame() {
|
updateVideoFrame() {
|
||||||
|
this.topdiv.show(); //show crt
|
||||||
this.setGenInputs();
|
this.setGenInputs();
|
||||||
var fps = this.getFrameRate();
|
var fps = this.getFrameRate();
|
||||||
// darken the previous frame?
|
// darken the previous frame?
|
||||||
@ -403,6 +408,7 @@ var VerilogPlatform = function(mainElement, options) {
|
|||||||
|
|
||||||
updateScopeFrame() {
|
updateScopeFrame() {
|
||||||
this.split.setSizes([0,100]); // ensure scope visible
|
this.split.setSizes([0,100]); // ensure scope visible
|
||||||
|
this.topdiv.hide();// hide crt
|
||||||
var done = this.fillTraceBuffer(32 * trace_signals.length); // TODO: const
|
var done = this.fillTraceBuffer(32 * trace_signals.length); // TODO: const
|
||||||
if (done)
|
if (done)
|
||||||
this.pause(); // TODO?
|
this.pause(); // TODO?
|
||||||
|
22
src/ui.ts
22
src/ui.ts
@ -15,7 +15,7 @@ import { getFilenameForPath, getFilenamePrefix, highlightDifferences, invertMap,
|
|||||||
import { StateRecorderImpl } from "./recorder";
|
import { StateRecorderImpl } from "./recorder";
|
||||||
|
|
||||||
// external libs (TODO)
|
// external libs (TODO)
|
||||||
declare var ga, Tour, GIF, saveAs, JSZip, Mousetrap;
|
declare var ga, Tour, GIF, saveAs, JSZip, Mousetrap, Split;
|
||||||
// in index.html
|
// in index.html
|
||||||
declare var exports;
|
declare var exports;
|
||||||
|
|
||||||
@ -1189,6 +1189,24 @@ function loadScript(scriptfn, onload) {
|
|||||||
document.getElementsByTagName('head')[0].appendChild(script);
|
document.getElementsByTagName('head')[0].appendChild(script);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function setupSplits() {
|
||||||
|
const splitName = 'workspace-split-' + platform_id;
|
||||||
|
var sizes = [50, 50];
|
||||||
|
var sizesStr = localStorage.getItem(splitName)
|
||||||
|
if (sizesStr) {
|
||||||
|
try {
|
||||||
|
sizes = JSON.parse(sizesStr);
|
||||||
|
} catch (e) { console.log(e); }
|
||||||
|
}
|
||||||
|
var split;
|
||||||
|
split = Split(['#workspace', '#emulator'], {
|
||||||
|
sizes: sizes,
|
||||||
|
onDragEnd: function() {
|
||||||
|
localStorage.setItem(splitName, JSON.stringify(split.getSizes()))
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// start
|
// start
|
||||||
export function startUI(loadplatform : boolean) {
|
export function startUI(loadplatform : boolean) {
|
||||||
installErrorHandler();
|
installErrorHandler();
|
||||||
@ -1198,6 +1216,7 @@ export function startUI(loadplatform : boolean) {
|
|||||||
platform_id = qs['platform'] = "vcs";
|
platform_id = qs['platform'] = "vcs";
|
||||||
}
|
}
|
||||||
$("#item_platform_"+platform_id).addClass("dropdown-item-checked");
|
$("#item_platform_"+platform_id).addClass("dropdown-item-checked");
|
||||||
|
setupSplits();
|
||||||
// parse query string
|
// parse query string
|
||||||
// is this a share URL?
|
// is this a share URL?
|
||||||
if (qs['sharekey']) {
|
if (qs['sharekey']) {
|
||||||
@ -1225,3 +1244,4 @@ export function startUI(loadplatform : boolean) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ body {
|
|||||||
<div id="notebook">
|
<div id="notebook">
|
||||||
<div id="workspace">
|
<div id="workspace">
|
||||||
</div>
|
</div>
|
||||||
<div class="emulator" id="emulator">
|
<div class="emulator" id="emulator" style="width:100%">
|
||||||
<div class="emuoverlay" id="emuoverlay">
|
<div class="emuoverlay" id="emuoverlay">
|
||||||
<span class="btn-group" role="group">
|
<span class="btn-group" role="group">
|
||||||
<button type="button" class="btn btn-xs" onclick="this.blur();" title="Go to start of trace"><span class="glyphicon glyphicon-fast-backward" aria-hidden="true"></span></button>
|
<button type="button" class="btn btn-xs" onclick="this.blur();" title="Go to start of trace"><span class="glyphicon glyphicon-fast-backward" aria-hidden="true"></span></button>
|
||||||
|
Loading…
Reference in New Issue
Block a user