In the shadowed corners of retro computing, a fascinating artifact has resurfaced: a software development kit (SDK) for the virtually unknown tony games console. Built around an 8MHz WDT65c02 processor with only 2kB of RAM and 8kB of fast ROM, this minimalist system forces radical architectural trade-offs that will intrigue embedded developers and retro enthusiasts alike.

Squeezing Performance from Scarcity

The tony’s extreme constraints dictate its entire design. With code unable to execute directly from ROM, the OS employs a chunk-based execution model:
- Programs are divided into chunks loaded into RAM at 0x0300
- CHUNKJUMP and CHUNKCALL OS commands manage transitions (with a 4-level stack)
- Flash reads occur at ~5µs/byte – critical for seamless chunk loading

Graphics leverage a display list system to bypass framebuffer needs:

SYSCALL 0x08: Add sprite to display list
Params: p0,p1 (X,Y), p3p2 (sprite index), p4/p5 (flags)

Sprites are RLE-encoded in flash and rendered directly via hardware acceleration, supporting up to 80 sprites per frame. A fixed 8-bit palette (transparency=0xFF) forces creative asset design.

Inside the SDK Toolkit

Reverse-engineered tools enable practical development:
- dechunker: Analyzes flash images, extracts chunks, and generates call graphs (via .dot files)
- deresourcer: Extracts sprite resources as PNGs from flash
- spritify: Converts images into tony-compatible sprites using palette quantization
- extractpalette: Pulls the console’s hardcoded palette from ROM

The build chain relies on llvm-mos, emphasizing assembly-level optimization. Memory is ruthlessly partitioned:

"The application gets 289 bytes of persistent RAM from 0x1df to 0x2ff; it also gets 80 bytes of zero page from 0xb0 to 0xff."
(Source: SDK Documentation)

Hardware Quirks and Unexplored Corners

The memory map reveals clever I/O handling:
- GPIO registers for input (d-pad, buttons) and output (LCD backlight, SPI CS)
- DMA controllers for fast flash-to-RAM transfers
- Dual SPI interfaces (primary/secondary) with mysterious secondary purpose

Sound remains partially enigmatic – likely FM synthesis with three channels, but SDK support is nascent. Flash encryption uses a quirky byte-scrambling algorithm, though the SDK defaults to zero-key for simplicity.

Why This Matters

Beyond nostalgia, the tony SDK exemplifies extreme system optimization techniques relevant to modern embedded work: display lists prefigure modern GPU command buffers, chunk loading mirrors microservice architectures, and memory partitioning teaches resource arbitration. For developers, it’s a masterclass in doing more with less – 160x128 pixels never felt so ambitious.

The project also highlights reverse engineering as preservation. Without efforts like David Given’s video teardown and this SDK, obscure hardware can vanish into oblivion. Now, a new generation can make the tony do something its creators never imagined.

Source: David Given's tony-sdk GitHub Repository