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>
This commit is contained in:
2026-06-03 16:13:21 +03:00
parent f542608b3f
commit c71e249a4e
404 changed files with 75155 additions and 58 deletions
+46
View File
@@ -0,0 +1,46 @@
/*
* videomode_raw.c — low-level ESTEX SETVMOD / GETVMOD ($50 / $51).
*
* Plain getters/setters with NO mode-class validation. Used by both
* conio (text-validated public API) and gfx (graphics modes). Lives
* in its own .c so a pure graphics program does not pull in the entire
* conio module to switch modes.
*
* Public conio functions in conio.c wrap these with a text-mode check;
* gfx_init / gfx_done in gfx_core.c call them directly.
*/
#include <stdint.h>
#include <errno.h>
uint8_t _videomode_raw_get(void) __naked
{
__asm
push ix
ld c, #0x51 ; ESTEX GETVMOD
rst #0x10
pop ix
;; uint8_t returns in A ESTEX already put mode there.
ret
__endasm;
}
int _videomode_raw_set(uint8_t mode) __naked
{
(void)mode;
__asm
;; SDCC __sdcccall(1) passes uint8_t in A leave it there.
push ix
ld bc, #0x0050 ; ESTEX SETVMOD (B=0 (page), C=0x50)
rst #0x10
jr c, _vmr_err
ld de, #0
pop ix
ret
_vmr_err:
call __errno_set
ld de, #-1
pop ix
ret
__endasm;
}