• v1.3.7 4666ccb9ad

    SBC7 v1.3.7
    Some checks failed
    Release / build-rpm (push) Successful in 22m39s
    Release / build-deb (push) Successful in 15m11s
    Release / build-android (push) Successful in 22m37s
    Release / build-wasm (push) Failing after 8m2s
    Release / release (push) Has been skipped
    Stable

    bcox released this 2026-04-12 19:39:44 +00:00 | 13 commits to main since this release

    Signed by bcox
    GPG key ID: 1C87BFF7FAC89089

    If v1.2.0 was the release where SBC7 went from simulator to silicon, and
    v1.3.x is the release series where it became genuinely useful to live with,
    then v1.3.7 is the one where you can actually sit down at the thing, write
    a BASIC program, save it to disk, come back later, and load it again. That
    may sound modest. For a 7-bit computer, it is a complete arc. The gap
    between v1.3.1 and v1.3.7 spans six tagged versions that never made a
    public release, which means this notes entry covers rather a lot of ground.
    Here is all of it.

    (Why no v1.3.2 through v1.3.6? Because each one found something broken in
    the thing that had just shipped. Consider them the iterative part of
    "iterative development," now over.)

    Real-Time Clock

    The SBC7 has a clock now. The RTC peripheral (ports 48-55) tracks year,
    month, day, hour, minute, and second, seeded at reset from the host system's
    UTC clock in the emulator and from the MiSTer ARM HPS on hardware. There is
    no battery -- the clock does not survive power loss -- but it is accurate
    while it runs, it handles leap years correctly through 2127, and the boot
    banner now prints the date and time alongside the RAM and ROM sizes.

    The latch mechanism deserves a mention: writing CONTROL with LATCH=1
    snapshots all six time fields atomically, so a burst of IN instructions
    cannot catch a carry propagating from 23:59:59 to 00:00:00 in mid-read.
    This is the kind of detail that only becomes obvious after you have
    debugged the alternative.

    Gamepad Controller Port

    Two NES-style controller ports (ports 56-58) with a change-of-state
    interrupt at RST 5. D-pad, A, B, Select, and Start per controller; the ROM
    installs a bare RETI at the RST 5 vector, so programs can simply HALT and
    wake on any button event. On MiSTer, joystick_0 and joystick_1 from the HPS
    map to the two pads. In the emulator, player 1 is on the keyboard (arrows
    for D-pad, Z/X for A/B, A/S for Select/Start).

    Display Hardware: Color, Font, and Vertical Blanking

    This release effectively rebuilds the VGA output from the front panel
    inward.

    Indexed color per character cell. Every cell on the 64x24 display now
    has its own foreground and background color, selected from a 16-entry
    palette. The attribute byte format is compact: 3 bits of background (indices
    0-7) and 4 bits of foreground (indices 0-15), which gives brighter options
    for text while keeping dark backgrounds the sensible default. The palette
    itself lives in the color bank and is updated from the CPU's write side
    during vertical blanking.

    Per-channel gamma-corrected color expansion. The 7-bit native color
    encoding (2R 3G 2B) is expanded to 24-bit for display with different gamma
    curves per channel: R=1.6, G=1.5, B=1.4. The human eye does not perceive
    linear intensity as linear brightness, and the three channels do not agree
    on exactly how wrong the linear approximation is. The result is a more
    natural-looking palette, particularly in the mid-range colors that text
    actually lives in.

    Font data moved to ROM bank 7. The 128-glyph character set is now stored
    in a dedicated ROM bank rather than in the VGA hardware itself. The
    CHAR_BANK register (port 39) selects which bank feeds the character renderer,
    and the default points at ROM bank 7. This means custom fonts are possible
    by writing glyph data (128 glyphs x 14 rows) into any RAM bank and pointing
    port 39 at it.

    Vertical blanking interrupt at RST 4. The VGA controller fires RST 4
    at the start of each vblank, about 60 times per second. The ROM installs a
    bare RETI by default; programs that need synchronized palette updates or
    animation timing can install their own handler at &00:20. A boot-time RETI
    fix that had been shipped with a wrong opcode is also corrected here.

    Console control characters. The console driver gained cursor movement
    codes ($01-$06 for left/right/up/down), HOME ($0B), form-feed / clear-screen
    ($0C), foreground color select ($10-$1F for palette indices 0-15), and color
    swap/reset ($0E-$0F). Keyboard handling grew corresponding support for arrow
    keys, the Home key, Ctrl+digit color codes, and a properly timed ESC
    timeout. Scanline registers (ports 33-34) expose the current beam position
    and the vblank flag as readable values, useful for timing-sensitive code.

    ROM capability flags. The signature block at &7F:7F now carries a
    feature-flags byte: bit 0 = banking, bit 1 = disk, bit 2 = RTC, bit 3 =
    gamepad, bit 4 = color VGA. Programs that need to run on multiple ROM
    versions can read this byte to confirm what they are dealing with before
    trying to use features that may not be present.

    Filesystem: Full Read/Write

    S7FS now has a complete read/write story. The previous release had mount,
    open, read, close, directory listing, and free-space query. This release
    adds OPENW (open existing file for read/write), CREATE (create or truncate),
    WRITE, REMOVE, MKDIR, RMDIR, and SEEK -- syscalls 16 through 22. Timestamps
    are live: the ROM's _rtc_stamp helper reads the RTC and writes the
    creation timestamp when a file or directory is created, and the modification
    timestamp when a write-mode file is closed.

    The write driver is spread across ROM banks 4 and 5 to keep each bank within
    the 2 KB limit. Write operations go through the same FAT cluster-chain
    machinery as reads, with bank 8 used as scratch space during sector transfers.
    SEEK takes a 28-bit byte offset in the DSK_LBA registers, shared with the
    OPENW return value so appending is a single extra syscall.

    A race condition in the interrupt vector setup and a multi-cluster read bug
    in the filesystem driver are both fixed here.

    TinyBASIC: DIR, SAVE, and LOAD

    TinyBASIC now has a complete file I/O story at the BASIC level.

    DIR lists files with sizes and modification timestamps in long format,
    optionally targeting a subdirectory or a second drive. Directories are shown
    in brackets. Timestamps have quarter-hour resolution, which is the finest
    the RTC format stores.

    SAVE writes the current program to a named file on disk, in the same
    format that LIST produces. If the file already exists it is overwritten.

    LOAD reads a program back from disk, clearing whatever was in memory
    first. Files that span multiple disk clusters are handled transparently;
    the LOAD command walks the FAT chain as many times as needed. A related
    fix to the TIB (terminal input buffer) memory layout resolved an overlap
    with the B segment that had been quietly waiting to cause trouble in
    multi-cluster loads.

    Demos and Examples

    The factory disk now ships with an oscilloscope-style sine wave demo and
    palette display and logo display programs. The sine wave demo is a reasonable
    stress test for VBI-synchronized output and makes a good screensaver if you
    are the sort of person who runs a 7-bit computer unattended. The palette
    display shows all 16 palette entries with their expanded RGB values, which is
    useful when tuning color output on new hardware.

    Build System

    The justfile has been merged into the Makefile. The build system is now a
    single make invocation for all targets, including the examples, the
    language interpreters, and the cross-compilation workflow. Existing
    make-based habits are unaffected; just is no longer required.

    MiSTer Fixes

    H7X loading and disk I/O on MiSTer both received fixes during this cycle.
    The color pipeline was also corrected to match the emulator's output, so
    what you see in emu7 is what you see on the DE10-Nano.

    Downloads