Download
THOREAU_GM.TBGM · losslessly compressed wavetable · 513.5 MB
New in 3.5
3.5 is a correctness release. It settles behavior the manual left open, makes compiled code agree with the interpreter, and collects the fixes from a systematic review of the previous sources.
Numbers mean what you write. In arithmetic, an
unsuffixed literal now takes the type of the other operand:
X#+2.7 adds the double-precision 2.7 instead of
2.70000004768372, and under DEFI64
LOMEM+200000 is calculated exactly in 64-bit
integers. Whole numbers above 253 are exact 64-bit
integers, so A&&=9223372036854775807 stores
its value. Write a suffix (2.7!) where the old
single-precision value is wanted.
- JIT ON equals JIT OFF. More than 25 cases
where native code gave different results, errors or error lines
are fixed. An Escape break inside compiled code can now be
continued with
CONT. - GW-BASIC output rules. A
PRINTitem that does not fit in the rest of the row starts on the next row.PRINT USINGandWRITEcheck their arguments before printing anything, andWRITErequires a separator between values. - Stricter syntax.
GOTO,GOSUB,KILL,INPUTand many other statements reject invalid trailing text before they act, and anELSEwithout anIFis a Syntax error. RunAUDITto find such lines. - Language.
DEF FNDICE()=INT(6*RND+1)defines a function without arguments. Every line the editor accepts can run, however many tokens it holds.COMMONworks as in GW-BASIC, and aGOSUBtyped at the prompt continues the rest of the line. - PARFOR. Subroutines inside a parallel loop may
nest as deeply as in
FOR, and on UEFI every worker runs on its own 512 KiB stack. Unsafe reads of another worker's array elements are rejected with an explanation. - The prompt uses the visible page.
Ready, typed lines and direct-mode errors always appear on the page you see, andSCRNADRaddresses the active drawing surface on every display. - Fixes everywhere. Arithmetic accuracy,
PRINT USINGrounding, file I/O, graphics, sound, networking, the debugger, and UEFI and Windows platform details.
Check existing programs. Literal typing,
PRINT line breaks, stricter WRITE and
statement syntax can change the results of existing programs.
On Windows, WinMM joysticks get new slot numbers: slots 0–3
are XInput only, and every controller is listed once. Read
UPGRADING in the release notes, and re-create standalone EXE/EFI
applications to include the new runtime.
Also included from 3.4.x
Colors have one meaning everywhere: packed 24-bit RGB, built with
RGB(r,g,b) or converted from a classic palette index
with PALETTERGB(index). CREATEEXE and
CREATEEFI accept NODEBUG for packaged
applications. GETBMP and GETSPRITE
capture drawn rectangles as bitmaps and sprites, and gamepads and
joysticks have a polling interface (JOYAXIS,
JOYBUTTON, JOYHAT and more) with XInput
and WinMM on Windows and experimental generic USB HID support on
UEFI. Screen pages, named callbacks and SELECTBOX
remain available.
See the manual and 3.5 release notes for the complete changes, syntax, controller mappings and platform limits.
What it is
Thoreau BASIC starts from GW-BASIC-style syntax but is not
trapped in 1983. It has 64-bit memory, 24-bit graphics,
sprites, mouse and joystick input, TCP/IP and HTTP, a complete GM/GS
wavetable with MIDI/WAV/FLAC/Opus playback,
complex/quaternion/octonion values, a debugger, profiler,
source tools, multicore PARFOR, and native x64
JIT compilation with automatic loop SIMD.
The same BASIC language runs as a normal Windows program or directly from UEFI firmware without an operating system. BASIC programs can also be packaged as standalone Windows EXE or bootable EFI applications.
Still BASIC
10 CLS
20 PRINT "HELLO FROM THOREAU BASIC"
30 FOR I=1 TO 5
40 PRINT I
50 NEXT I
60 END
RUN
And now the orchestra is BASIC too:
SOUND PRELOAD
LOADMID 0,"BALLADE.MID"
PLAYMID 0
Graphics, networking and sound remain ordinary BASIC commands, not separate frameworks.
BASIC without an operating system
The UEFI build boots directly on x64 machines. It uses GOP graphics, firmware or raw HID keyboard input, mouse support with fallbacks, networking through firmware protocols or Thoreau's own SNP-based stack, HDA/Azalia PCM sound where available, and the same interpreter/JIT and GM wavetable used by the Windows version.
The UEFI build also includes experimental USB HID gamepad/joystick polling. It requires a compatible controller exposed by the firmware and connected at application startup; it is not a universal controller driver.
Project
The project page and downloads are on itch.io.
Contact
Bug reports, compatibility notes and strange BASIC edge cases are very welcome.
To support development, PayPal is available. No nag screens, no locked features.