/tom80

a Z80-based fantasy console.

Primary LanguageGo

tom80

a Z80-based fantasy console.

pixel pattern

running emulator

go run ./cmd/tom80 -game <name>
# or, if you've `go install`ed
tom80 -game <name>

where name is the name of a program (compiled program should be at prgm/<name>/<name>.bin)

making programs

compiling

make sure you have asm80 installed

asm80 -m Z80 -t bin -o <name>.bin <path>/<name>.asm
# <name>.bin will be output in <path>

or use asm80.com (asm80 docs)

writing

programs should start like:

.cstr	"name:program name"
.cstr	"author:your name"
.cstr	"version:0.0"
.org	0x0C00

if you know what you're doing, you may add .cstr "clear:false", and VRAM will not be cleared after loading the ROM.

basic specs

  • Screen
    • 64 x 48 pixels
    • 6-bit colour (0b[__RRGGBB])
    • VRAM 0x0000 - 0x0BFF
  • Controls
    • ports 0x01 - 0x08
    • Up, Down, Left, Right, A, B, C, Menu (1<<7 - 1<<0)

todo

order of unfinished items is mostly arbitrary

  • rom loading
    • rom info in vram area on load
  • screen working
    • use screen in asm
  • controls working
    • use controls in asm
  • COMPLETE DOCS
  • use flag
  • add simple way to pause cpu (hajimehoshi/ebiten#1037)
  • folder layout
    • backend in /
    • frontend in /cmd/tom80
    • programs in /prgm
  • use port 0x00 for system commands
    • mode setting
    • debug print mode
    • file list mode
    • file load mode
  • OPTIMISE
    • use byte alias for controls
    • use lookup table for pixels (filled at init)
  • "loader" program
    • loaded into rom by default
    • uses file listing/loading
  • audio working
    • sample generation library (superloach/sampler)
    • make 8 sounds
      • sine 1 (port 9)
      • sine 2 (port 10)
      • sine 3 (port 11)
      • square 1 (port 12)
      • square 2 (port 13)
      • saw 1 (port 14)
      • saw 2 (port 15)
      • noise (port 16)
    • define event type (byte alias)
    • define bit values (0bVVPPPPPP)
      • VV: volume, 0-3 (25, 50, 75, 100)
      • PPPPP: pitch 0-63 (C2 - F7)
    • use audio in asm
  • standard library for asm
    • simplify control keys
    • shape drawing macros
    • fonts?
  • port asm80 to go-asm80
  • integrate go-asm80
    • compile from asm if bin is missing
    • attempt recompile if asm is newer