animal-shell

A new Shell for Commodore 128 (and maybe C64) owners.

Active Pure Nim score 65/100 · last commit 2026-11-23 · 2 stars · tests present · no docs generated

Summary

Latest Version Unknown
License Unknown
CI Status Failing
Stars 2
Forks 0
Open Issues 0
Last Commit 2026-11-23
Downloads 0
Last Indexed 2026-11-23 09:07

Installation

nimble install animal-shell
choosenim install animal-shell
git clone https://gitlab.com/retro-coder/commodore/animal-shell

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
animal-shell ✓ ✓ ✓ - - - - - - -

README

Animal Shell

A command shell and application framework for the Commodore 64 and C128, written in 6502 assembly (Kick Assembler). Provides a layered OS with an expandable SCI (System Call Interface), O(1) dispatch, and support for commands, applications, drivers, and libraries.

Quick Start

Using a released build (disk, cartridge, or SD2IEC/CMD storage) rather than building from source? See USER.md.

Prerequisites

  • Java (for Kick Assembler)
  • VICE (C64/C128 emulator)
  • just (command runner — https://just.systems)
  • Python 3
  • Zig 0.17.0 for the disk-image engine — just cbmforge installs it for you

Build & Run

git submodule update --init --recursive   # cbmforge engine + bindings
just cbmforge           # build the disk-image engine (Zig)
just build all          # build everything
just dist shell         # create dist/animalshell.d81
just sd2iec             # card distribution -> a mounted SD card
just run                # boot in VICE (default: C128 disk)

Run Tests

just test               # build tests + shell, then run the native SCI smoke tests

Architecture

$8000  Shell (command interpreter, CLI, prompt, catalogs)
$a000  Core (banking, file I/O, strings, lists, memory management)
  • SCI dispatch: Dense 256-byte jump tables at $be00/$bf00 (core) and $9e00/$9f00 (shell). Call ID in $fa, param pointer in $fb/$fc.
  • Components: Standalone loadable images — commands ($1c00), apps ($4000), drivers ($2800), libraries ($3400).
  • Platform: Supports both C64 and C128. Conditional compilation via #if C64 / #if C128.

Project Layout

src/
  system/     Memory map, zero-page labels, macros, SCI constants
  core/       OS kernel — banking, I/O, strings, lists, memory
  shell/      Shell — CLI, command/app runner, catalogs, parameters
  app/        Application framework (macros, lifecycle)
  command/    Command framework
  driver/     Driver framework
  library/    Library framework
  c64/        C64 boot + start-up
  c128/       C128 boot + start-up
  build/      Build entry points for every target/platform combination
components/
  commands/   Shell commands (dir, dos, ver, run, ...)
  applications/  Interactive applications
  drivers/    Hardware device drivers
  libraries/  Reusable code libraries
  testing/    Unit test framework
  samples/    Reference code (Kick, ACME, DASM, TMPx)
tests/        Unit test sources
scripts/      Python build orchestration

Writing a Command

#importonce
#import "command/command.asm"

.encoding "petscii_mixed"

.filenamespace __command__
.namespace __mycmd__ {
.namespace __main__ {

.segment command_code "mycmd"

__CommandStart__()
    // init code
    rts

__CommandStateHandler__(COMMAND_STATE_RUN)
    // called each step while running
    lda #COMMAND_STATE_STOP
    sta COMMAND_NEXT_STATE
    rts

__CommandEnd__()

.file [name="mycmd.prg", segments="command"]
}
}

Register in scripts/__files__.py under the commands list.

Writing an App

Same pattern, using #import "app/app.asm" and __AppStart__ / __AppEnd__ macros. See CONTRIBUTE.md for the full guide.

Build Targets

Command Description
just build all Full build (shell + all components)
just build shell Shell only
just build commands Commands only
just dist shell Create dist/animalshell.d81
just dist all All disk images
just dist sd2iec The card distribution, in dist/sd2iec/
just sd2iec Build the card distribution and copy it to a mounted card
just run Boot in VICE (default: 128)
just run 64 Boot C64 disk
just run 128 @vdc Boot the C128 with its 80-column display
just test Build tests + shell, run the native SCI smoke tests
just bump Bump patch version in VERSION

A run line is a mode plus includes: @vdc adds the 80-column display, @testlib puts the CMD HD test library on drive 11, @toop puts toop.d64 on drive 10. The mode can come anywhere on the line, and an include on its own is added to the default mode, so just run @vdc and just run 128 @vdc boot the same machine.

Documentation

  • CONTRIBUTE.md — architecture, SCI guide, adding calls and components
  • TECHNICAL.md — full architecture, memory map, segments, dispatch model
  • AGENTS.md — rules for AI agents working on this codebase
  • TODO.md — open backlog
  • docs/TODO_ARCHIVE.md — completed/superseded roadmap (historical)
  • CHANGELOG.md — version history
  • USER.md — end-user guide (boot a released build)
  • RELEASE.md — how to cut a release (tag → CI → GitLab Release)
  • docs/MEMORY.md — generated memory map (just docs)
  • docs/MODULES.md — shell module overlay system (window, residency, paging)
  • src/core/README.md — core API reference

License

MIT License. See LICENSE.md.