1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-12-23 03:29:39 +00:00

minor changes

This commit is contained in:
Steven Hugg 2018-12-05 08:33:40 -05:00
parent d575cda583
commit 13a48c34c6
6 changed files with 24 additions and 11 deletions

View File

@ -19,7 +19,7 @@ TODO:
- breakpoints
- debug inspector
- MAME single step (?)
- step over
- step over (line, instruction)
- slowdown beam for all platforms?
- PC x86 support
- show errors in list (maybe window list?)
@ -76,14 +76,15 @@ TODO:
- workermain: split build functions, better msg types
- vcs: INPTx needs to be added to control state
- rename, delete, save as
- sdcc: can't link asm files before c files
- sdcc: can't link asm files before c files (e.g. acheader.s must be last)
- what if >1 file with same name? (local/nonlocal/directory)
- what if .c and .s names collide?
- live coding URL
- memory viewer: ROM/RAM/VRAM/etc
- resize memory browser when split resize
- resize memory browser when split resize (any div resize)
- preroll the emulator so optimizer does its thing before loading rom
- wasm dynamic linking of emulators (https://github.com/WebAssembly/tool-conventions/blob/master/DynamicLinking.md)
- z80 HALT works?
WEB WORKER FORMAT

File diff suppressed because one or more lines are too long

View File

@ -228,13 +228,14 @@ export class AnimationTimer {
}
scheduleFrame(msec:number) {
var fn = () => { this.nextFrame(); }
if (this.useReqAnimFrame)
window.requestAnimationFrame(this.nextFrame.bind(this));
window.requestAnimationFrame(fn);
else
setTimeout(this.nextFrame.bind(this), msec);
setTimeout(fn, msec);
}
nextFrame(ts:number) {
nextFrame(ts?:number) {
if (!ts) ts = Date.now();
if (ts - this.lastts < this.intervalMsec*10) {
this.lastts += this.intervalMsec;

View File

@ -70,6 +70,10 @@ export var Assembler = function(spec : AssemblerSpec) {
function rule2regex(rule : AssemblerRule, vars : AssemblerVarList) {
var s = rule.fmt;
if (!s || !(typeof s === 'string'))
throw Error('Each rule must have a "fmt" string field');
if (!rule.bits || !(rule.bits instanceof Array))
throw Error('Each rule must have a "bits" array field');
var varlist = [];
rule.prefix = s.split(/\s+/)[0];
s = s.replace(/\+/g, '\\+');
@ -84,13 +88,17 @@ export var Assembler = function(spec : AssemblerSpec) {
var v = vars[varname];
varlist.push(varname);
if (!v)
throw Error("Could not find rule for ~" + varname);
throw Error('Could not find variable definition for "~' + varname + '"');
else if (v.toks)
return '(\\w+)';
else
return '([0-9]+|[$][0-9a-f]+|\\w+)';
});
rule.re = new RegExp('^'+s+'$', 'i');
try {
rule.re = new RegExp('^'+s+'$', 'i');
} catch (e) {
throw Error("Bad regex for rule \"" + rule.fmt + "\": /" + s + "/ -- " + e);
}
rule.varlist = varlist;
// TODO: check rule constraints
return rule;

View File

@ -1775,7 +1775,7 @@ function executeBuildSteps() {
}
}
function handleMessage(data) {
function handleMessage(data : WorkerMessage) : WorkerResult {
// preload file system
if (data.preload) {
var fs = TOOL_PRELOADFS[data.preload];

View File

@ -60,7 +60,10 @@ export interface WorkerBuildStep {
mainfile?:boolean
};
export interface WorkerMessage {
export interface WorkerMessage extends WorkerBuildStep {
preload:string,
reset:boolean,
code:string,
updates:WorkerFileUpdate[],
buildsteps:WorkerBuildStep[]
}