How tinteam/sn-50 works
Project Type & Purpose
• SN-50 is an open-source “Fantasy Computer” toolkit written in Rust, organized as a Cargo workspace.
• It consists of three crates:
• tinlib – the core library implementing the console specification (CPU, memory, graphics, input, cartridges, etc.)
• devkit – a CLI tool for building and packaging games (cartridges) using tinlib
• player – a CLI tool (runtime) for loading and running cartridges using tinlib
Top‐Level Components
a. Cargo Workspace (root)
b. Crates:
• tinlib (library)
• devkit (CLI “builder”)
• player (CLI “emulator”)
c. External Dependencies & Tools
• Rust/Cargo (build system)
• .cartridge files (artifact format)
tinlib Subcomponents
• Cartridge module: chunk, error, pack/unpack
• Machine module: CPU code interpreter, memory/ram/vram, input, screen
• Common utilities: coords, sizes, errors
• Module (optional game maps)
Relationships & Data Flows
• devkit → tinlib
– Uses tinlib’s cartridge API to pack code, graphics, sound into .cartridge
• player → tinlib
– Uses tinlib’s machine+graphics+input APIs to load and run .cartridge at runtime
• User interacts with devkit (CLI) to produce cartridges; interacts with player (CLI) to run them.
Architectural Patterns & Principles
• Modular library core (tinlib) with well‐defined public API
• Two thin front-ends (devkit, player) that depend on tinlib
• Separation of concerns:
• tinlib = pure logic + console spec
• devkit = build pipeline
• player = execution loop + I/O
Essential Elements Checklist
[ ] All components labeled (tinlib, devkit, player, .cartridge, User)
[ ] Nested modules inside tinlib clearly shown
[ ] Clear note of Rust/Cargo as the build system