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:
@@ -0,0 +1,62 @@
|
||||
# Начало работы
|
||||
|
||||
## Что в tarball
|
||||
|
||||
После распаковки `sprinter-c-v1.0-<host>.tar.gz` вы получаете:
|
||||
|
||||
* **`bin/sprinter-cc`** — драйвер C → SprintEXE (bash-скрипт).
|
||||
* **`third_party/sdcc/`** — vendored SDCC 4.5 для шага C → Z80.
|
||||
* **`libc/include/`** — заголовки для подключения в ваших программах.
|
||||
* **`lib/sprinter.lib`** — целевая libc для Sprinter (предсобрана; пересобирается через `make`, если изменили исходники libc).
|
||||
* **`runtime/`** — варианты crt0 и runtime-помощники (ассемблируются per-build).
|
||||
* **`toolchain/mkexe/`** — host-утилита, упаковывающая `.ihx` SDCC в SprintEXE.
|
||||
* **`examples/`** — 27 готовых программ.
|
||||
* **`docs/{en,ru}/`** — эта документация.
|
||||
|
||||
## Первая сборка
|
||||
|
||||
```sh
|
||||
cd sprinter-c-v1.0-<host>
|
||||
make all # пересобрать lib + все примеры (~30 с)
|
||||
```
|
||||
|
||||
Если `make` жалуется на отсутствующий бинарник SDCC — загрузите его один раз:
|
||||
|
||||
```sh
|
||||
make sdcc # скачивает SDCC 4.5 если не vendored
|
||||
```
|
||||
|
||||
## Сборка своей программы
|
||||
|
||||
```sh
|
||||
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` теперь — корректный SprintEXE, который можно запустить на
|
||||
Sprinter / MAME / в любом ESTEX DSS шелле.
|
||||
|
||||
## Запуск на железе или в эмуляторе
|
||||
|
||||
Релиз **не содержит** эмулятор MAME или образы ROM / DSS / HDD Sprinter —
|
||||
они большие и имеют свои лицензии. Для тестирования:
|
||||
|
||||
* **MAME:** установите MAME 0.283+ отдельно, получите образы Sprinter Sp2000
|
||||
у Peters Plus, смонтируйте FAT12-флоп с вашими `.exe` файлами как `-flop1`.
|
||||
* **Реальный Sprinter:** скопируйте `.exe` на флоп или раздел HDD, видимый
|
||||
для DSS, затем `RUN HELLO` в шелле.
|
||||
|
||||
## Что дальше
|
||||
|
||||
* Прочитайте `sprinter_cc.md` про флаги компилятора.
|
||||
* Прочитайте `memory_modes.md` когда не хватит 14 КБ кода.
|
||||
* Просмотрите `examples/` — каждый файл это рабочая программа с комментариями.
|
||||
* `headers.md` — список публичных API.
|
||||
* `platform_reference.md` — глубокие нюансы платформы и компилятора (от граблей до подводных камней).
|
||||
Reference in New Issue
Block a user