Crash-tan Crash-tan

Obligatory 1.40.1 Fix Pack

Crash BASIC 1.40.1 Release Notes

written by Crash-tan

THE "LITTLE STUFF, FIXED" UPDATE

A small, friendly one. A handful of papercuts — two in how I read your
source files, one in how shaders keep time, and one nasty mobile crash —
all gone.


IMPORT goes where you want it

IMPORT used to be a stickler: it had to sit at the very top of your file,
above every real statement. Put one lower down and I'd choke on it.

No longer. IMPORT can appear anywhere in the file now. The imported
file's contents get spliced in right where the IMPORT sits:

SCREEN 320, 240
PRINT "Booting..."

IMPORT "enemies.bas"       ' totally fine here now
IMPORT "powerups.bas"

CALL SpawnWave()

A couple of things worth knowing:

  • Error reporting still points at the right file. A mistake inside an
    imported file is reported against that file's name and line, not some
    shifted line in the host file — wherever the IMPORT lands.
  • No include-once guard. Import the same file twice and its contents
    splice in twice (which means defining the same function twice). Import
    each module once, like before.
  • Circular imports are still caught and rejected.

Blank lines at the top are fine

You could always put blank lines between statements. But blank lines at
the very top of a file? I'd throw a parse error before reading a single
line. Silly.

Fixed. Any number of leading blank lines is allowed now — so a file
that opens with some breathing room (or a few blank lines above your header
comment) just works:




' My Game
SCREEN 320, 240

Line numbers in error messages still count from the real top of the file,
so nothing about your debugging shifts.


Shaders keep time the same everywhere

If you drive a shader off the TIME builtin, you may have noticed it ran
faster on a desktop with a high-refresh display than it did in the
browser. On a 120 or 144Hz monitor a TIME-driven effect could animate
roughly twice as fast as the same shader in WASM — and any TIME * TIME
term made it worse.

The cause: native was ticking TIME forward a fixed slice every frame, so
the more frames your monitor drew, the faster the clock ran. The browser
was already sampling real wall-clock seconds.

Now both platforms sample real elapsed seconds. TIME is exactly
"seconds since your program started," frame-rate independent and
identical whether you run native or on the web. A shader that looks right
in the browser looks right on your 144Hz desktop, no retuning.


A mobile launch crash, gone

On Android, a game with a large icon could crash before it ever got to
launch — the launcher was trying to hand the whole game record, icon and
all, across to the game screen, and a big enough icon blew past Android's
size limit for that handoff and killed the process.

Fixed. The launcher now passes just a lightweight reference and re-reads
the full game details on the other side, so the icon never has to make
that trip. Big, beautiful icons are safe again.


Compatibility

Nothing breaks. The file-reading changes are pure leniency — they only
accept things that used to be rejected, so every file that parsed before
parses exactly the same way. The shader timing fix brings native in line
with the documented contract (and with WASM); if you'd hand-tuned a shader
around the old fast-on-native behavior, it'll now run at the intended
speed.