c71e249a4e
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>
2.4 KiB
2.4 KiB
Examples tour
The release ships with 27 example programs in examples/. Every one of them
is a self-contained demo with comments — they were used as regression tests
during development.
Build any example
cd examples/hello
make
That produces hello.exe next to hello.c using examples/example.mk.
Categories
Hello world / basics
hello— stdio + conio Turbo-C-style coloursargv— argv parsing in crt0conio— conio API smoke testattrprob— probe Sprinter text-attribute byte layout
File I/O
cat— read & print TEST.TXTseek— 32-bit lseek over a 100 KB filels— directory listing via ffirst/fnextfiletest— FILE* streams (fopen/fread/fwrite/fclose)stattest—stat/fstaton files and directoriesopenenv— open() flags + environment variables
Memory & banking
malloc— heap stress test (200+ allocations)mem_test— page allocator +bank_read/bank_writebanked— banked code in W3 (huge mode)bankedbg— banked code in W1 (big mode)banklocl— bank-local static data and BSS
Mouse
mouse— driver in text modegfx_mous— mouse with custom bitmap cursor in graphics mode
Graphics
gfx_demo— 320×256×256: lines, rectangles, fill via acceleratorgfx_d16— 640×256×16: same primitives in 16-color modegfx_text— bitmap-font text on graphics screen
Misc
errno— errno / strerror / perrortimedir— date/time + directory listingptime— POSIX time API (time / localtime / mktime)strtest—<string.h>test (from SDCC's z80.lib)stdlib—<stdlib.h>test (qsort / rand / strtol / etc.)assrtest— assert()rt_test— runtime helpers (sleep, setjmp, atexit)
Example.mk
Every example uses examples/example.mk. A minimal Makefile looks like:
PROJ_ROOT := $(abspath $(CURDIR)/../..)
EXAMPLE := my_app
include $(PROJ_ROOT)/examples/example.mk
Optional knobs (set before include):
MEMORY := huge # default tiny
STACK_SIZE := 4096 # default ~1278
EXTRA_SRCS := helper.c util.c # extra .c files in same dir
EXTRA_FLAGS := --bank 1=engine.c --debug # pass-through to sprinter-cc
Use this template for your own programs.