1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-06-17 19:29:44 +00:00

verilog: fixed keyboard strobe

This commit is contained in:
Steven Hugg 2021-07-16 07:34:00 -05:00
parent 06fb57e0d5
commit 6a21b467cf
2 changed files with 14 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "8bitworkshop", "name": "8bitworkshop",
"version": "3.8.0b1", "version": "3.8.0b2",
"author": "Steven Hugg", "author": "Steven Hugg",
"category": "Development", "category": "Development",
"description": "Desktop version of 8bitworkshop.com retro programming IDE", "description": "Desktop version of 8bitworkshop.com retro programming IDE",

View File

@ -415,6 +415,18 @@ var VerilogPlatform = function(mainElement, options) {
} }
} }
tick2(cycles: number) {
// if a key is pressed, check for strobe after every cycle
if (keycode >= 128) {
while (cycles-- > 0) {
top.tick2(1);
resetKbdStrobe();
}
} else {
top.tick2(cycles);
}
}
// use trace buffer to update video // use trace buffer to update video
updateVideoFrameFast(tmod: HDLModuleTrace) { updateVideoFrameFast(tmod: HDLModuleTrace) {
if (scanlineCycles <= 0) throw new Error(`scanlineCycles must be > 0`); if (scanlineCycles <= 0) throw new Error(`scanlineCycles must be > 0`);
@ -431,9 +443,8 @@ var VerilogPlatform = function(mainElement, options) {
} }
// generate frames in trace buffer // generate frames in trace buffer
if (nextlineCycles > 0) { if (nextlineCycles > 0) {
top.tick2(nextlineCycles); this.tick2(nextlineCycles);
} }
resetKbdStrobe();
// convert trace buffer to video/audio // convert trace buffer to video/audio
var n = 0; var n = 0;
// draw scanline visible pixels // draw scanline visible pixels