Files
snark13 c71e249a4e Add full compiler toolchain, libc, examples and reference docs
First substantive commit: the entire Sprinter C compiler tree on top of
the bare README+gitignore initial commit.

What's in here:
  bin/sprinter-cc        — driver script invoking SDCC + linker + mkexe
  libc/                  — Sprinter-specific libc layer over ESTEX/BIOS
                           (conio, gfx, io, mem, stdio + headers)
  runtime/               — crt0 variants (default/small/banked/minimal)
                           + heap + bank trampolines
  toolchain/             — mkexe (SprintEXE packer, C + tests)
  examples/              — 30 demo programs (gfx, file I/O, env, time, …)
  lib/Makefile           — builds the libc archive (sprinter.lib)
  docs/                  — converted Sprinter manuals + asm reference samples
  third_party/           — solid-c reference compiler dump + sdcc setup script
  release_docs/          — packaging / release notes

gitignore overhaul:
  • Drop dangerous blanket patterns: *.asm (would hide docs/samples/*.asm)
    and *.exe (case-insensitive match was hiding third_party/solid-c/*.EXE
    on macOS APFS).  Replaced with examples/*/*.{asm,exe,…} and lib/*.lib.
  • Restore tracking of toolchain/mkexe/tests/{one,big}.bin — those are
    INPUT fixtures, not build outputs.
  • Collapse the duplicated SDCC/C/Sdcc sections into one section per
    concern (build outputs / vendored / OS-junk).
  • Add .sprinter-cc-*/, build/ (catches lib/build/ too), .claude/.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-03 16:13:21 +03:00

1.9 KiB

Getting started

What's in the tarball

After extracting sprinter-c-v1.0-<host>.tar.gz you've got:

  • bin/sprinter-cc — the C → SprintEXE driver (a bash script).
  • third_party/sdcc/ — vendored SDCC 4.5 used for the C → Z80 step.
  • libc/include/ — headers your programs include.
  • lib/sprinter.lib — the Sprinter target libc (prebuilt; rebuilt by make if you modify libc sources).
  • runtime/ — crt0 variants and runtime helpers (assembled per-build).
  • toolchain/mkexe/ — host utility that packs SDCC's .ihx into a SprintEXE.
  • examples/ — 27 ready-to-build programs.
  • docs/{en,ru}/ — this documentation.

First build

cd sprinter-c-v1.0-<host>
make all                    # rebuild lib + every example (~30 s)

If make complains about a missing SDCC binary, fetch it once:

make sdcc                   # downloads SDCC 4.5 if not vendored

Build your own program

cat > hello.c <<EOF
#include <stdio.h>
int main(void) {
    puts("Hello, Sprinter!");
    return 0;
}
EOF

bin/sprinter-cc -o hello.exe hello.c

hello.exe is now a valid SprintEXE you can run on Sprinter / MAME / any ESTEX DSS shell.

Running on hardware or in an emulator

The release does not include the MAME emulator or the Sprinter ROM / DSS / HDD images — those are large and have their own licensing. To test:

  • MAME: install MAME 0.283+ separately, obtain Sprinter Sp2000 images from Peters Plus, mount a FAT12 floppy with your .exe files as -flop1.
  • Real Sprinter: copy .exe to a floppy or HDD partition that DSS can see, then RUN HELLO from the shell.

Next steps

  • Read sprinter_cc.md for compiler flags.
  • Read memory_modes.md when you start needing more than 14 KB of code.
  • Browse examples/ — every file is a working program with comments.
  • See headers.md for the public API surface.