# 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

```sh
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:

```sh
make sdcc                   # downloads SDCC 4.5 if not vendored
```

## Build your own program

```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` 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.
