EndBASIC 0.8.0
Released on 2021-11-11.
The main purpose of this release is to bring you the new hybrid graphics/text
console in the form of a feature preview. This feature brings EndBASIC closer
to its original secret goal, which is to become a platform with which to write
simple retro-looking games.
Please be aware that the new console is still quite rudimentary. There are
many missing drawing primitives, and performance isn't great yet. Fixing these
might require changes in the APIs so any code you write might need to be updated
in the future. But, remember that the same is true for all of EndBASIC right
now given its 0.x state.
This release lines up with the Handmade Seattle 2021 conference, during which it
was first announced.
Graphics support and related console changes:
-
Added a graphical console based on SDL2 behind a new optional
sdl
feature. This is to support graphics on all desktop platforms and has been
confirmed to work on FreeBSD, Linux, macOS, and Windows. -
Added the
GFX_LINE,GFX_PIXEL,GFX_RECT,GFX_RECTF, andGFX_SYNC
graphics commands. -
Added the
INKEYfunction. This is especially useful to implement event
loops in graphical applications. -
Fixed
LOCATEso that the first argument is the column number and the
second argument is the row number. It should always have been this way
(in fact, this is the syntax exposed by Locomotive BASIC), but this is now
necessary to match the ordering of the coordinates in all graphics commands
and avoid confusion. -
Modified console facilities (including
PRINTandINPUT) so that they do
not clear lines up to the right margin. I had originally added this as a
feature so that changing the background color in the REPL caused all
subsequent lines to be formatted consistently, but this prevented composing
overlapping text (with or without graphics), which is a necessary thing to
do when rendering UIs. -
Rewrote the web frontend from scratch to support graphics rendering. This
implies that we do not usexterm.jsany more and instead use a
custom-built console implementation. Beware of new bugs. -
Issue #67: Keyboard input on Android should now work when using a soft
keyboard. This isn't perfect due to limitations in the Android web APIs
but should do the trick for simple uses.
General command changes:
-
Extended the
CLEARandNEWcommands so that they reset various
properties of the machine, not just variables. This includes the state of
the console, whose color and video syncing bit are reset, and the GPIO
pins, which are set to their default state. -
Modified the
RUNcommand to issue aCLEARupfront. Maintaining the
previous state of the machine was just too confusing and error-prone due
to side-effects causing execution failures. -
Added the
MIND,MINI,MAXD, andMAXIfunctions. -
Added the
DEGandRADtrigonometric commands and theATN,COS,
PI,SIN, andTANfunctions. These are often needed to render
graphics.
Interactivity improvements:
-
Added support for the Home, End, Page Up, and Page Down keys in the text
editor. -
Made the Backspace and Tab keys aware of indentation in the editor.
-
Added support for the Home and End keys in text input fields.
-
Modified the storage commands to keep track of the currently-loaded program
path so that the editor can display it, so thatLOAD,EXIT, andNEW
can warn about unsaved changes, and so thatSAVEcan reuse the current
filename.
Internal changes:
-
Refactored the
endbasic-stdcrate to minimize optional features in
library crates by moving the textual console into a newendbasic-terminal
crate, the SDL console into a newendbasic-sdlcrate, and the Raspberry
Pi support into a newendbasic-rpicrate. -
Added a new
endbasic-replcrate to assimilate all of the features and
code that are specific to the REPL. This finally breaks the dependency
of theendbasic-webcrate on theendbasicCLI crate, which required
optional features to work.