4 releases

0.2.1 May 3, 2019
0.2.0 May 2, 2019
0.1.1 Mar 17, 2019
0.1.0 Mar 16, 2019

#144 in Emulators

Apache-2.0

125KB
3K SLoC

crates.io docs.rs Build Status codecov

Zeerust

Something — a character design, a building, anything — used to be someone's idea of futuristic.

Zeerust is a Z80 emulator written entirely in rust. It contains modules for parsing Z80 opcodes, executing a symbolic representation, and attaching input and output devices.

There is also a binary that will print any bytes written to OUT (0) to stdout.

Take a look at the tests/ directory for some example programs and usage!

Debugging

Debug output will be provided when compiled in debug mode:

$ target/debug/zeerust tests/zeerust.bin
DEBUG - Running LD8(Reg(A), Immediate(90))
DEBUG - A: 00, B: 00, C: 00, D: 00, HL: 0000, F: 00000000, PC: 00
DEBUG - Running OUT(Reg(A), Immediate(0))
DEBUG - A: 5a, B: 00, C: 00, D: 00, HL: 0000, F: 00000000, PC: 02
DEBUG - Running LD8(Reg(A), Immediate(69))
DEBUG - A: 5a, B: 00, C: 00, D: 00, HL: 0000, F: 00000000, PC: 04
DEBUG - Running OUT(Reg(A), Immediate(0))
DEBUG - A: 45, B: 00, C: 00, D: 00, HL: 0000, F: 00000000, PC: 06
DEBUG - Running OUT(Reg(A), Immediate(0))
DEBUG - A: 45, B: 00, C: 00, D: 00, HL: 0000, F: 00000000, PC: 08
DEBUG - Running LD8(Reg(A), Immediate(82))
DEBUG - A: 45, B: 00, C: 00, D: 00, HL: 0000, F: 00000000, PC: 0a
DEBUG - Running OUT(Reg(A), Immediate(0))
DEBUG - A: 52, B: 00, C: 00, D: 00, HL: 0000, F: 00000000, PC: 0c
DEBUG - Running LD8(Reg(A), Immediate(85))
DEBUG - A: 52, B: 00, C: 00, D: 00, HL: 0000, F: 00000000, PC: 0e
DEBUG - Running OUT(Reg(A), Immediate(0))
DEBUG - A: 55, B: 00, C: 00, D: 00, HL: 0000, F: 00000000, PC: 10
DEBUG - Running LD8(Reg(A), Immediate(83))
DEBUG - A: 55, B: 00, C: 00, D: 00, HL: 0000, F: 00000000, PC: 12
DEBUG - Running OUT(Reg(A), Immediate(0))
DEBUG - A: 53, B: 00, C: 00, D: 00, HL: 0000, F: 00000000, PC: 14
DEBUG - Running LD8(Reg(A), Immediate(84))
DEBUG - A: 53, B: 00, C: 00, D: 00, HL: 0000, F: 00000000, PC: 16
DEBUG - Running OUT(Reg(A), Immediate(0))
DEBUG - A: 54, B: 00, C: 00, D: 00, HL: 0000, F: 00000000, PC: 18
DEBUG - Running HALT
DEBUG - A: 54, B: 00, C: 00, D: 00, HL: 0000, F: 00000000, PC: 1a
ZEERUST%

TODO

  • Loading registers
  • Arithmetic (8-bit)
  • Opcode parsing
  • Other operations!
  • CALL/RET
  • Jumping / Looping
  • 8-bit Bitwise operations
  • Input/Output
  • 16-bit arithmetic
  • Interrupts
  • BCD support (DAA)
  • Memory mapping
  • ZX Spectrum or TI83 graphical emulation
  • Debugger
  • ???

Show me!

cargo install --path .
zeerust tests/zeerust.bin
ZEERUST%

Dependencies

~2.2–3MB
~59K SLoC