Expand description
RetroShield Z80 Workbench
A framework for building Z80 ROMs for RetroShield projects.
§Example
use retroshield_z80_workbench::prelude::*;
let mut rom = CodeGen::new();
// Setup
rom.label("start");
rom.ld_sp(0x3FFF);
rom.di();
// Include standard I/O
rom.emit_io_routines();
rom.emit_terminal_routines();
rom.emit_math_routines();
// Your code here
rom.label("main");
rom.call("clear_screen");
rom.ld_hl_label("hello_msg");
rom.call("print_string");
rom.jp("main");
// Data
rom.label("hello_msg");
rom.emit_string("Hello, RetroShield!\r\n");
// Finalize and write
rom.resolve_fixups();
rom.write_bin("output.bin").unwrap();§Module Structure
codegen- Core emit/label/fixup machineryinstructions- Z80 instruction helpersstdlib::io- MC6850 serial I/O routinesstdlib::terminal- VT100/ANSI terminal sequencesstdlib::math- Number conversion and math routines
Modules§
- prelude
- Prelude - import this for convenient access to common types
- stdlib
- Standard library routines for RetroShield Z80 projects