1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2025-02-26 22:29:56 +00:00

Merge branch 'master' of github.com:sehugg/8bitworkshop

This commit is contained in:
Steven Hugg 2018-09-26 14:43:16 -04:00
commit 504abf67bf
3 changed files with 13 additions and 16 deletions

View File

@ -225,11 +225,13 @@ div.emuoverlay {
top:0; top:0;
width:100%; width:100%;
height:100%; height:100%;
pointer-events:none;
} }
div.emuscope { div.emuscope {
background-color: #333; background-color: #333;
} }
div.emuspacer { div.emuspacer {
width:0;
} }
/* 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 {
@ -242,6 +244,7 @@ div.emuspacer {
margin-left:7.5%; margin-left:7.5%;
margin-right:7.5%; margin-right:7.5%;
width: 85%; width: 85%;
pointer-events:auto;
} }
canvas.pixelated { canvas.pixelated {
image-rendering: optimizeSpeed; /* Older versions of FF */ image-rendering: optimizeSpeed; /* Older versions of FF */

View File

@ -37,6 +37,9 @@ gcc6809 - need to check this out
SmallerC - https://github.com/alexfru/SmallerC SmallerC - https://github.com/alexfru/SmallerC
vbcc - Targets 68K, patch for z-machine
http://sun.hasenbraten.de/vbcc/\
OTHER COMPILERS OTHER COMPILERS

View File

@ -227,8 +227,6 @@ var VerilogPlatform = function(mainElement, options) {
var current_output; var current_output;
// control inputs // control inputs
var paddle_x = 0;
var paddle_y = 0;
var switches = [0,0,0]; var switches = [0,0,0];
// inspect feature // inspect feature
@ -340,14 +338,7 @@ var VerilogPlatform = function(mainElement, options) {
}, },
}); });
// setup mouse events // setup mouse events
topdiv.mousemove( (e) => { video.setupMouseEvents();
var x = e.pageX - vcanvas.offset().left;
var y = e.pageY - vcanvas.offset().top;
var new_x = Math.floor(x * video.canvas.width / vcanvas.width() - 20);
var new_y = Math.floor(y * video.canvas.height / vcanvas.height() - 20);
paddle_x = clamp(8, 240, new_x);
paddle_y = clamp(8, 240, new_y);
});
} }
setGenInputs() { setGenInputs() {
@ -482,8 +473,8 @@ var VerilogPlatform = function(mainElement, options) {
framehsync = false; framehsync = false;
framex = 0; framex = 0;
framey++; framey++;
gen.hpaddle = framey > paddle_x ? 1 : 0; gen.hpaddle = framey > video.paddle_x ? 1 : 0;
gen.vpaddle = framey > paddle_y ? 1 : 0; gen.vpaddle = framey > video.paddle_y ? 1 : 0;
} }
if (framey > maxVideoLines || gen.vsync) { if (framey > maxVideoLines || gen.vsync) {
framevsync = true; framevsync = true;
@ -725,16 +716,16 @@ var VerilogPlatform = function(mainElement, options) {
} }
saveControlsState() { saveControlsState() {
return { return {
p1x: paddle_x, p1x: video.paddle_x,
p1y: paddle_y, p1y: video.paddle_y,
sw0: switches[0], sw0: switches[0],
sw1: switches[1], sw1: switches[1],
sw2: switches[2], sw2: switches[2],
}; };
} }
loadControlsState(state) { loadControlsState(state) {
paddle_x = state.p1x; video.paddle_x = state.p1x;
paddle_y = state.p1y; video.paddle_y = state.p1y;
switches[0] = state.sw0; switches[0] = state.sw0;
switches[1] = state.sw1; switches[1] = state.sw1;
switches[2] = state.sw2; switches[2] = state.sw2;