Git Product home page Git Product logo

RustZX

RustZX CI Crates.io License Discord

logo

ZX Spectrum emulator written in Rust

  • Watch this video showcase (v0.9.x)
  • Read CHANGELOG.md for info on the latest version changes

Features

  • Written in pure rust
  • Cross-platform
  • Full ZX Spectrum 48K and 128K emulation
  • Perfect emulation of Z80 core
  • Highly precise AY chip emulation
  • Beeper sound emulation
  • Supported formats:
    • tap - tape
    • sna - snapshot, both 48K and 128K versions supported
    • scr - screenshot
  • Fast loading of tap files with standard loader
  • Precise timings
  • Full border emulation
  • Joystick emulation: Kempston, Sinclair
  • Kempston mouse emulation
  • Extended 128K keys emulation (arrows, backspace, caps lock)
  • Quick save/load
  • Compressed assets support (only .gz for now)
  • Separate no_std core library which can be used to port emulator almost anywhere.
    • Global allocator is still needed, but all dynamic allocations were minimized
    • All resource-heavy features are configurable via cargo features
  • Obscure Z80 features emulation:
    • WZ/memptr register (F3/F5 flags obscure behavior in BIT n, (HL))
    • Q register (F3/F5 flags obscure behavior in SCF and CCF)
    • Block instruction flags oddities (LDxR/CPxR/INxR/OTxR)

Install

  1. Sure that you have C compiller and CMake to build bundled sdl2
  2. (Linux-specific) Install required development packages: [libasound2-dev]
  3. Install it with cargo
cargo install rustzx

How to use

rustzx --help # Show help
rustzx test.tap # Autodetect file type and run in 48K mode
rustzx --ay test.tap # Run in 48K mode with AY sound chip
rustzx -m128 --tape test128.tap # Run in 128K mode with tape
rustzx --rom tester.rom -s3 # Run with custom rom and 3x screen scaling
rustzx --nofastload test.tap # Run without fast tape loading
rustzx --mouse test.tap # Run with Kempston mouse support

For loading tape in 48K mode, press j then Ctrl+p twice, as on real Spectrum. You should see LOAD "" on emulator's screen, then press Enter (in 128K mode just press enter). In --nofastload mode, press Insert to play the tape and Delete to stop

If you have choppy audio, try --sound-latency option with bigger values.

Default key bindings:

  • F1 - quick save
  • F2 - quick load
  • F3 - set normal emulation speed
  • F4 - set 2x emulation speed
  • F5 - max possible emulation speed
  • F6 - enable frame trace info
  • F9 - enable kempston/sinclair joy keyboard layer
  • Insert - start tape
  • Delete- stop tape
  • End - break command
  • Caps Lock - caps lock command
  • Backspace - delete
  • <Arrows> - 128K arrow keys
  • Esc - unlock mouse (if --mouse is used)

In joy keyboard layer mode (F9)

  • <Arrows> - Kempston joy arrows
  • Alt - Kempston fire
  • WASD- Siclair Joy 1 arrows
  • Caps Lock - Sinclair Joy 1 fire
  • IJKL- Siclair Joy 2 arrows
  • Enter - Sinclair Joy 2 fire

Screenshots

References

Many resources were used to find out, how to buildthis emulator. Huge thanks to the following resources which helped to figure out a lot of defails about ZX Spectrum.

ROM's

Emulator contains ROMs, created by by Sinclair Research Ltd (now owned by Amstrad plc), Amstrad has given permission to distribute their ROM's in conjunction with emulators. In RustZX these ROMs included in source of the core emulator library mod rustzx_core::zx::roms. Embedded roms can be opted-out from the core library by disabling feature embedded-roms.

RustZX's Projects

rustzx icon rustzx

ZX Spectrum emulator written in Rust

rustzx-esp32 icon rustzx-esp32

ESP32 implementation of RustZX Spectrum emulator for ESP32-USB-OTG

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.