Skip to content

B65 BASIC v0.1-dev.1 (first preview)

Pre-release
Pre-release

Choose a tag to compare

@beniacm beniacm released this 08 Nov 16:55
· 142 commits to master since this release

First preview of B65 BASIC, a 45GS02 re-implementation of R.T. Russell's BBC BASIC (Z80) v5 for the MEGA65 (zlib licence). Built from commit e347057; the interpreter is the one verified on hardware (see "Status").

Files

file what it is
b65.d81 disk image with B65 (the interpreter) and the examples as text files: PARALLAX.BAS, RRBLISTB65.BAS, RRBLISTB65V2.BAS, plus PARALLAX65.PRG (the BASIC 65 twin of the parallax demo)
b65.prg the interpreter alone (load address $2001, 42 647 bytes) for loaders that push a PRG straight into memory
*.bas the example sources as text
SHA256SUMS checksums of the two binaries

How to use it

On a MEGA65 (any core with the MEGA65 ROM, tested with ROM 920413):

  1. Copy b65.d81 to the SD card.
  2. Mount it (the MEGA65's disk menu, or in BASIC 65: MOUNT "B65.D81").
  3. DLOAD "B65" then RUN. The banner shows the detected hardware (model, chip RAM, attic RAM).
  4. In B65: LOAD "PARALLAX" then RUN (LOAD "RRBLISTB65V2" and LOAD "RRBLISTB65" need the K325T core's RRB list mode; they say so in their first lines). Programs are typed in the BBC way: keywords in upper case, LIST, RUN, NEW, SAVE "NAME".
  5. Files: B65 reads and writes the SD card's FAT32 partition directly (LOAD, SAVE, OPENIN/OPENOUT, *CAT, *DELETE) and reads text programs from a mounted D81. A text program (plain ASCII, one line per program line, optional line numbers) loads with LOAD "NAME"; NAME.BBC (tokenised) is tried before NAME.BAS.

In Xemu (needs the MEGA65 ROM): xmega65 -8 b65.d81, then DLOAD "B65" and RUN in BASIC 65.

On the QMTech K325T rig (the board this was developed on, https://github.com/beniacm/mega65-k325t-cm4): scripts/b65_run.sh builds and starts it through the serial monitor; scripts/b65_run.sh demo FILE.bas also runs a program.

The language guide with the MEGA65 extensions (timers, SOUND/ENVELOPE, MODE 1 graphics, sprites, MOUSE, 28-bit ?/!/|, attic-RAM arrays, the list-mode demos) is docs/USER.md in the repository; docs/DESIGN.md describes the implementation and the memory map.

Status

  • Verified on the QMTech K325T build of the MEGA65 core (this repository's test rig): 22/22 smoke tests, the file tests on a real FAT32 card (fsck clean), MODE 1 graphics, sprites, MOUSE, SOUND, timers, 60 KB programs in bank 1, 2 MB attic-RAM arrays, and the parallax demo (pictured in the repository's README once the images are added).
  • A standard MEGA65 (R3–R6) has not been tested yet: HyperRAM timing for the attic arrays, the SD controller path and the non-K325T detection branch have only run in Xemu. Reports welcome.
  • Not yet implemented: see the feature table in the README (e.g. *EXEC, some * commands). Performance work is in progress: at this commit B65 is about as fast as BASIC 65 per statement.

Changes since the start

Everything is new. The highlights of this preview: the full BBC BASIC V statement set incl. whole-array operations and RETURN parameters, 40-bit floats on the MEGA65 math unit, files on FAT32 and D81, the MEGA65 extensions above, a 256-colour parallax demo written identically for B65 and BASIC 65.