R.A.Z.E. A ZX Spectrum Emulator

Overview

R.A.Z.E. A ZX Spectrum emulator

This project is part of a friendly competition to build an emulator using Rust and WebAssembly.

Check the live version here.

About this project

R.A.Z.E. stands for "Rusty Attempt to a Z80 Emulator", o something like that. It was build mainly to learn Rust, but then compiling to WebAssembly is just too easy not to do it.

Controls

You can use the keyboard mostly normally; right-control key is mapped to SymbolShift. The joystick emulation is mapped from the cursor keys for direction and left-control for fire. You can choose the type of joystick emulated in the drop-down menu Cursor keys.

There is also experimental support for gamepads: The gamepad will always emulate a Kempston joystick, great for multiplayer games. Remember that this is experimental, so your controller may or may not work. Patches are welcomed!

In the buttons below you can find the shortcut keys for some useful functions (such as F11 for fullscreen, etc.).

What can it do

R.A.Z.E. emulates the ZX Spectrum 48K and 128K more or less completely. It supports loading TAP and TZX tape dumps, and Z80 snapshots. It is also able to save snapshots using the same format.

You can also load ZIP files with tapes or snapshots inside. Just do not open a ZIP with several valid files, because it won't know what to do with them.

What works and what not

  • It includes the 48K ROM and the 128K ROM. You can add ?48k=N or ?48k=Y to the url to force an initial mode, or use the Reset buttons below.
  • All documented CPU instructions and most undocumented ones are emulated.
  • CPU flags X and Y are only partially emulated.
  • CPU timing is an approximation. In particular memory contention timing is not totally accurate, but good enough for most purposes (loading tapes, border bars, etc).
  • Loading TAP and TZX files, either directly or from ZIP files. TZX support is somewhat around 90% (if you have some file that does not work and you think it should, please send it to me). You can load a tape dump directly from the URL by adding ?tape=<url>.
  • Loading and saving Z80 snapshots. Only 48K and 128K snapshots, obviously. You can load a snapshot directly from the URL by adding ?snapshot=<url>.
  • Currently you cannot save tape files. You can try to save it and you will hear the sound, but there is no way to record the data.
  • Emulation of the internal speaker (thanks to MAME for some ideas about sound filtering). The 128K sound generator (AY-3-8910) is also emulated.
  • Support for joystick Kempston, Sinclair and Protek. Experimental support of gamepads.
  • It uses WebGL for rendereng if available. It falls back to Canvas2D if not. You can force the Canvas2D mode adding ?webgl=N to the url.
  • In 128k mode, it actually implements the banking of the +2A, although it does not ship the necessary ROMs. This is useful for the full RAM mode used by some programs, such as this great Pacman emulator.

How to build

If you want to build this project yourself, first of all you need a recent Rust toolchain and the wasm32-unknown-unknown target. If you use rustup just run:

$ rustup target add wasm32-unknown-unknown

You also need wasm-pack, so if you do not have it do:

$ cargo install wasm-pack

Then clone this repository and build it with this command (copied to ./pack for convenience):

$ wasm-pack build --no-typescript --target web --release

That that's all! Now you can launch a local sever such as python -m http.server and point your browser to the appropriate url.

LICENSE

As most of the Rust ecosystem, the source code of this projects is published under the MIT License. See LICENCE.MIT for the full details.

ZX Spectrum ROMs are copyrighted by Amstrad. Amstrad have kindly given their permission for the redistribution of their copyrighted material but retain that copyright. See the included ROMs.txt file for details.

You might also like...
An NES emulator written in Rust

Pinky Pinky is an NES emulator written in Rust completely from scratch based only on publicly available documentation. You can run it in your Web brow

NES emulator written in Rust

sprocketnes is an emulator for the Nintendo Entertainment System written in the Rust programming language. Its purpose is to serve as a technology dem

NES emulator in rust
NES emulator in rust

NES emulator in Rust plastic is a NES emulator built from scratch using Rust. This is a personal project for fun and to experience emulating hardware

Rustual Boy - A Virtual Boy emulator.
Rustual Boy - A Virtual Boy emulator.

Rustual Boy Description Rustual Boy is a Virtual Boy emulator. It can be used to play existing Virtual Boy games, as well as be a helpful development/

Intel 8080 cpu emulator by Rust
Intel 8080 cpu emulator by Rust

i8080 i8080 is a emulator for Intel 8080 cpu. 8080 Programmers Manual 8080 opcodes [dependencies] i8080 = { git = "https://github.com/mohanson/i8080"

TestSuite4 is a framework designed to simplify development and testing of TON Contracts. It includes light-weight emulator of blockchain making it easy to develop contracts.

TestSuite4 0.1.2 TestSuite4 is a framework designed to simplify development and testing of TON Contracts. It contains lightweight blockchain emulator

Learn emulator and programming languages, target chip8, nes, gbc, gba ...
Learn emulator and programming languages, target chip8, nes, gbc, gba ...

[WIP]learn emulator go-chip8 go run main.go source https://en.wikipedia.org/wiki/CHIP-8 http://devernay.free.fr/hacks/chip8/C8TECH10.HTM https://githu

CHIP-8 emulator written in Rust
CHIP-8 emulator written in Rust

CHIP-8 emulator written in Rust. This is intended to be a project for gaining experience writing emulators and practice Rust.

A CHIP-8 emulator for Rust in ~350 LOC
A CHIP-8 emulator for Rust in ~350 LOC

chip8 An implementation of the CHIP-8 for Rust in ~350 lines of code. What is CHIP-8? CHIP-8 is a virtual machine (along with a supporting programming

Comments
  • Lines drawn incorrectly in Elite.

    Lines drawn incorrectly in Elite.

    Probably some low level math issue specific to Elite, where the line drawn ships have line drawing issue, but only at specific angles. This doesn't appear to happen in other simulator with the same .z80 snapshot. (Or loading from tape image). on QOAP/JS for example.

    opened by m1zar 3
Owner
Rodrigo Rivas Costa
Rodrigo Rivas Costa
Site frequency spectrum estimation based on window expectation-maximisation algorithm

winsfs winsfs is a tool for inference of the site frequency spectrum ("SFS"). Quickstart Assuming SAF files have already been made, default estimation

Malthe Sebro Rasmussen 8 Nov 1, 2022
Nes-emulator - A NES emulator made to learn the Rust programming language

nes-emulator Building $ rustc --version rustc 1.32.0 (9fda7c223 2019-01-16) $ cargo --version cargo 1.32.0 (8610973aa 2019-01-02) $ cargo build --rel

Michael Burge 225 Dec 23, 2022
Commodore 64 emulator written in Rust

Rust64 - a C64 emulator written in Rust This is my attempt to study the Rust programming language and have fun at the same time. The goal is to presen

Krzysztof Kondrak 214 Dec 27, 2022
A Flash Player emulator written in Rust

website | demo | nightly builds | wiki Ruffle Ruffle is an Adobe Flash Player emulator written in the Rust programming language. Ruffle targets both t

Ruffle 11.2k Jan 8, 2023
A Game Boy research project and emulator written in Rust

Mooneye GB Mooneye GB is a Game Boy research project and emulator written in Rust. The main goals of this project are accuracy and documentation. Some

Joonas Javanainen 802 Dec 28, 2022
A Gameboy Emulator in Rust

RBoy A Gameboy Color Emulator written in Rust Implemented CPU All instructions correct All timings correct Double speed mode GPU Normal mode Color mod

Mathijs van de Nes 512 Dec 23, 2022
RGB (Rust Game Boy) is a simple emulator for the original game boy

RGB RGB (Rust Game Boy) is a simple emulator for the original game boy and the color game boy. Warning: This no longer compiles in the latest versions

Niven Achenjang 18 Dec 2, 2022
Full featured Cross-platform GameBoy emulator by Rust. Forever boys!.

Gameboy Full featured Cross-platform GameBoy emulator. Forever boys!. You can start a game with the following command, here with a built-in game "Boxe

Mohanson 1.2k Jan 2, 2023
RustBoyAdvance-NG is a Nintendo™ Game Boy Advance emulator and debugger, written in the rust programming language.

RustBoyAdvance-NG Nintendo GameBoy Advance ™ emulator and debugger, written in rust. WebAssembly Demo: https://michelhe.github.io/rustboyadvance-ng/ P

MishMish 510 Dec 30, 2022
NES emulator written in Rust to learn Rust

OxideNES A NES emulator in Rust. CPU should be accurate, PPU is mostly accurate, timing between the 2 is off for some corner cases and hardware qui

null 37 Nov 7, 2022