It can be run from the command line on Windows. Download basic.js and run as: cscript basic.js myprogram.txt
Text display is 80 columns (can be toggled with PR#0 and PR#3). Lores display is always 40 columns (single-lores, not double-lores as found on the //c+)
Now that the text display is performed with graphics you can't copy/paste program output
Handling of source code that does not match the canonical LIST output format may not behave as on an Apple
Keyword parsing differs from Applesoft command line. For example FOR I = S TO P doesn't collapse into FOR I = STOP.
The interpreter doesn't actually care about line numbers for statement ordering (just for GOTO/GOSUB targets and IF statements). So 20 PRINT "A", 10 PRINT "B" will just print A, then B
Commands that refer to assembly routines (CALL, USR etc.), shape tables, or tape I/O are not implemented.
Commands that operate on the program itself (LIST, RUN, DEL, etc.) are not yet implemented.
Only primary graphics pages are supported (no HGR2)
Slight performance tweaks for IE c/o explicit sizing
2009-05-08:
Tracked down source of IE perf issues when drawing with paddles; when the thumb/stick moves,
IE does a relayout/repaint of any content above the paddle in the HTML flow. If I delete the
page header it's silky-smooth. Unfortunately, any text above the screen seems to make it fall
off the deep end - so no fix yet without gutting the page.
Undid "Line breaks from PRINT now clear to the right edge" - doesn't repro on Apple. What was I thinking?
2009-05-06:
A bunch of performance tweaks based on IE8's JavaScript profiler. While they look good on paper,
they mean diddly-squat to perceived performance. Don't precalc default variable values, avoid DOM
changes that are no-ops, and (sigh) don't scan the whole screen looking for FLASH-styled
cells - maintain a list instead so perf isn't impacted if there are none.
2009-05-01:
Expressions are now just-in-time compiled to JavaScript. Screen updates are the real bottleneck, though,
so this isn't a big performance boost. Performance comparison (on my 1.73GHz machine) of the lores Mandelbrot set demo:
Google Chrome (V8 JavaScript compiler): 25% faster (21s vs. 27s)
Firefox 3: 14% faster (64s vs. 73s)
Internet Explorer 8: <1% faster (249s vs. 251s)
So not a huge win except on faster execution engines. But this is just the first step...
Fixed POKE 216,x shim to disable ONERR handler
2009-04-30:
Rejiggered internal value storage/passing system to use fundamental JavaScript types instead of {number: value} or
{string: value}. I didn't trust JavaScript's type system when I first wrote this code.
2009-04-26:
Performance - made GOTO/GOSUB not do a linear scan to find the line (d'oh). Significant perf boost for IE.
Added Unit Tests sample. Coverage is not complete but it's getting there.
RND() with negative now consistently reseeds (added custom pseudoranom number generator)
FOR I = 10 TO 1 : PRINT I : NEXT now correctly prints 10 then finishes (was previously incorrectly inferring STEP -1)
2009-04-25:
Line breaks from PRINT now clear to the right edge of the text window
Automatically show input devices if PDL() called
Added Zhodani Relay Station Placement example (run after generating a sector with Traveller Sector Generator)
2009-04-24:
Fixed a bug where changing text mode (e.g. PR#3) after calling HGR would break split-screen mode.