Repository navigation
Ultimate Basic v1.5.7
Ultimate Basic v1.5.7 – Release Notes
2026-09-21 – Tracker tunes and an inline-assembler fix
New language elements
- Added
tune ... end: describe a 3-voice SID tracker tune (instruments,
order list, per-voice pattern rows such as "C-4 01 V24") directly in the
source. The compiler builds a self-contained, zero-page-free player at
compile time and definessid_init/sid_play, somusic play|stop| pause|resumework exactly as withload sid. Vibrato, slide, note cut
and speed change are supported.tune at $addrmoves the blob (default
$8000). This is what the Visual Assembler SID editor's "Export to
UltimateBasic" now generates.
Fixes
- Inline
asm { }:label,X,label,YandJMP (label)were assembled
as plain absolute instructions (the index/indirect mode was dropped), so
table lookups such asLDA table,Xread the wrong byte. The addressing
mode is now kept. music play: the CIA1 IRQ wrapper acknowledged the timer by WRITING $01 to
$DC0D, which clears the interrupt mask, so the music IRQ stopped after the
first tick. It now acknowledges by reading $DC0D.
2026-09-21 – Custom charsets, code layout and non-blocking sound
New language elements
- Added
charset on/charset off.charset addr(default $3800) used to
only set the destination ofchardef;charset onnow points the VIC-II
at that RAM set (read-modify-write of $D018 bits 1-3, the screen-matrix
bits are kept) andcharset offrestores the ROM set ($1000, or $1800
afterlowercase). The base must be a multiple of $800 inside VIC bank 0. - Added a build-time check that generated code does not overlap the charset:
charset onclaims the 2 KB set and everychardefits 8 bytes; a
program that reaches into them stops with "the program code (...)
overlaps the charset area ...". Data in anorggap is not counted. - Added
org addr. Placed between sub/fn definitions it continues the
subroutine code ataddrand zero-fills the gap, which stays free for
data (fonts, sprites, tables). Subs never fall through, so this is safe;
orgbelow the current code end is an error. - Extended
incbinwithincbin "file", addr, skip [, len]: skip a header
(e.g. a .prg load address) and/or take only a slice.incbin ..., addrcan
now be written into anorggap. - Added
sfx channel, freq, frames [, wave]: a non-blocking SID note. It
sets attack 0 / sustain 0 / release 0 and picks the decay fromframes
(1 frame = 20 ms) at compile time, re-triggers the voice and returns at
once.waveis 16 (triangle), 32 (saw, default), 64 (pulse) or 128
(noise). Unlikesoundit is safe inside a game loop.
Fixes
soundwaited on raster line 0, which $D012 (low 8 bits) shows twice per
frame (lines 0 and 256), so notes were half as long as requested; two of
its branches were also patched over their opcode, crashing the program
for any non-zero duration. It now waits on raster line 200 likedelay.wordassignments computed products in 8 bits:w += 300 * level,
w = w + 100 * levelandw = 100 * level + 900now keep all 16 bits.print a / 10(and other arithmetic on afloat) printed the raw Q8.8
value as an integer; it now printsN.DD.- Arrays are zeroed once at program start (RAM contents at power-up are
random;array(N)previously started with whatever was there). - Running out of permanent zero page ($02-$4F) is now a compile-time
error ("out of zero page"). Before, variables andforlimit/step
bytes silently spilled into the scratch area and broke loops. Sequential
forloops now release their two limit/step bytes when the loop ends
(if the body declared no variables), so many loops no longer exhaust it. - Manual corrections:
%binary literals were documented but never
supported by the lexer (use $hex or decimal); thecharsetexample used
the $D018 value of another address ($1E selects $3800, $1A selects $2800). - Tests: a missing
ROL zpopcode in the test CPU was added, and the koala
tests no longer race on a shared temp file.