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
+79
View File
@@ -0,0 +1,79 @@
The tutorial procedure for colour printing at the graphic screen 640x256x16.
This procedure was used in the Flex Navigator v1.xx.
Written for Estex v1.xx or high.
Files description:
main.z80 - initial(main) file
print.z80 - printing procedure
Font format description:
In the font used 256 symbols with height 8 points and various width.
+000 [256] - width of a symbol on X (for each symbol) (in bytes)
+256 [256] - low byte of symbol image offset (for each symbol)
+512 [256] - high byte of symbol image offset (for each symbol)
+768 ... - images of symbols (from 0 to 255 symbol)
images stored as vertical lines, 8 bytes per line, 4 bits per point.
number of lines (in bytes) calculate from size of X
background colour = 0x00
foreground colour = 0x0F
for instance, image of "A" symbol:
width of symbol on X = 4 (bytes)
00 00 00 00
00 FF FF 00
0F 00 00 F0
0F 00 00 F0
0F FF FF F0
0F 00 00 F0
0F 00 00 F0
00 00 00 00
In the image of symbol it will stored as:
00 00 0F 0F 0F 0F 0F 00 00 FF 00 00 FF 00 00 00 00 FF 00 00 FF 00 00 00 00 00 F0 F0 F0 F0 F0 00
Algorithm description:
The main problem for the colour printing was fast transformation each point (background/foregraunf) to the necessary colour.
Here, I will showed, how I could solve this a "hard" problem. ;) If somebody will think up faster variant, I will be glad to see it. :)
The printing on the screen realized by vertical lines with the help of accelerator at once till 8 bytes.
We require 2 buffers, size in 8 bytes for the colors mixing (background and foreground). Because, to get mixed up we shall be at once till 1 vertical line. These buffers are initialized at each change of colour by function PreparePrintColors (It's made automatically and you don't need about it to care!).
Using print by function TextOut.
operation | - Logical Inclusive OR (in Z80 CPU instruction OR)
operation ^ - Logical Exclusive OR (in Z80 CPU instruction XOR)
Function PreparePrintColors:
1. initialize ForegroundBuffer
ForegroundBuffer = Foreground colour ^ 0xFF
2. initialize BackgroundBuffer
BackgroundBuffer = Background colour ^ ForegroundBuffer
Function TextOut (input parameters see in the source):
actually, a image printing:
Screen = (line_of_image | BackgroundBuffer) ^ ForegroundBuffer
Let's look at a point level:
assume the colors for printing Background = 0, Foreground = 1
then ForegroundBuffer = 1 ^ 0xFF and result 0xFE
also BackgroundBuffer = 0 ^ 0xFE and result 0xFE
for the background colour from a image (=0x00)
Screen = (0x00 | 0xFE) ^ 0xFE result 0x00
for the foreground colour from a image (=0xFF)
Screen = (0xFF | 0xFE) ^ 0xFE result 0x01
It's possible to do for any of colours...
This algorithm works slower when are printed of very small strings. It occurs because a lot of initialization are required. Also when made often change of colour (Though, I hadn't changing it in the Flex Navigator so often, only for necessary). ;)
27 june 2002
Anton Enin (C) Copyright 2002 R-lab
If you have the questions email me: r-lab@mail.ru or ask in the Sprinter's forum.