This is an emulator of the Sinclair ZX Spectrum computer running on a, Espressif ESP32 SoC powered, Lilygo TTGo VGA32 board.
Just connect a VGA monitor, a PS/2 keyboard, a SD Card (optional) and power via microUSB.
This project is based on David Crespo excellent work on ZX-ESPectrum-Wiimote which is a fork of the ZX-ESPectrum project by Rampa and Queru which was inspired by Pete's Todd PaseVGA project.
- Spectrum 48K and 128K emulation (no PSRAM needed).
- Accurate Z80 emulation (Authored by José Luis Sánchez)
- VGA output (6 bpp, BRIGHT attribute kept) with good emulation of Spectrum screen.
- Support for two aspect ratios: 16:9 or 4:3 monitors (using 360x200 or 320x240 modes)
- Multicolor attribute effects emulated (Bifrost*2, Nirvana and Nirvana+ engines).
- Border effects emulated (Aquaplane, The Sentinel, Overscan demo).
- Floating bus effect emulated (Arkanoid, Sidewize).
- Contended memory and contended I/O emulation.
- AY-3-8912 sound emulation.
- Beeper & Mic emulation (Cobra’s Arc)
- PS/2 keyboard support
- Kempston and Cursor type Joystick emulation.
- Complete OSD menu in two languages: English & Spanish.
- Realtime TAP file loading.
- SNA and Z80 snapshot loading.
- Snapshot saving and loading (both 48K and 128K supported).
- BMP screen capture to SD Card (thanks David Crespo 😉)
- Simultaneous internal (SPIFFS) and external (SD card) storage support.
- TZX Support
- Being able to use SAVE command to save to SPIFFS and/or SD Card.
- Fast tape load.
You can flash the binaries directly to the board if do not want to mess with code and compilers. Check the releases section
Quick start from PlatformIO:
- Clone this repo and Open from VSCode/PlatFormIO
- Execute task: Upload File System Image
- Execute task: Upload
- Enjoy
Windows, GNU/Linux and MacOS/X. This version has been developed using PlatformIO.
- There is an extension for Atom and VSCode, please check this website.
- Select your board, pico32 which behaves just like the TTGo VGA32.
PlatformIO now autodetects port, so there is no need to specify it (unless autodetection fails).
Default aspect ratio is 16:9, so if your monitor has this, you don't need to change anything.
(If you change aspect ratio to 4:3 and get no image, re-flash board or re-upload file system image to roll back to default settings).
PlatformIO > Project Tasks > Upload File System Image
All files under the /data
subdirectory will be copied to the SPIFFS filesystem partition. Run this task whenever you add any file to the data subdirectory (e.g, adding games in .SNA or .Z80 format, into the /data/s
subdirectory).
If using external micro sd card, you must create the following folders in root directory:
- "p" folder -> Will be used for persist snapshots.
- "s" folder -> Put .SNA and .Z80 files here.
- "t" folder -> Put .TAP files here.
- "c" folder -> For SCR (not yet!) and BMP screen captures.
The SD card should be formatted in FAT16 / FAT32.
First time the emulator access sna or tape directories, it will create and index for sorting the files in it. It may take some time if you put many archives (15-20 seconds in my tests for about 1000 files, about 3 minutes for about 6000 files). Once created, file dialogs will open fast but if you extract the card and add files, you must later use "Options/Storage/Refresh directories" to be able to view new files on the files dialogs.
PlatformIO > Project Tasks > Build
, then
PlatformIO > Project Tasks > Upload
.
Run these tasks (Upload
also does a Build
) whenever you make any change in the code.
- F1 Main menu
- F2 Load .sna, .z80
- F3 Load snapshot
- F4 Save snapshot
- F5 Select .tap file
- F6 Play/Pause tap
- F7 Stop tap
- F8 Stats OSD ( [CPU] microsecs per CPU cycle, [IDL] idle microsecs, [FPS] Frames per second, [FND] FPS w/no delay applied )
- F9 Volume down
- F10 Volume up
- F12 Reset ESP32
- Pause Pause
- PrntScr BMP screen capture (Folder /c at SDCard)
Pin assignment in hardpins.h
is set to match the TTGo VGA32, use it as-is, or change it to your own preference. It is already set for the TTGo version 1.4.
- David Crespo for his friendly help and support and his excellent work at his Youtube Channel and the ZX-ESPectrum-Wiimote emulator.
- Pete Todd, developer of the original project PaseVGA.
- Ramón Martínez "Rampa" and Jorge Fuertes "Queru" who improved PaseVGA in the first ZX-ESPectrum.
- Ackerman for his code and ideas.
- Azesmbog for testing and providing very valuable info to make the emu more precise.
- VGA Driver from ESP32Lib by BitLuni.
- AY-3-8912 emulation from libayemu by Alexander Sashnov.
- PS2 Driver from Fabrizio di Vittorio for his FabGL library.
- Z80 Emulation derived from z80cpp, authored by José Luis Sánchez.
- Amstrad PLC for the ZX-Spectrum ROM binaries liberated for emulation purposes.
- Jean Thomas for his ESP32 APLL calculator, useful for getting a rebel TTGO board to work at 320x240.
- Sir Clive Sinclair.
- Christopher Curry.
- The Sinclair Team.
- Lord Alan Michael Sugar.
- Investrónica team.
- Matthew Smith for Manic Miner.
- Retrowiki especially the people at ESP32 TTGO VGA32 subforum.
- El Mundo del Spectrum
- Microhobby magazine.
- The World of Spectrum
- Dr. Ian Logan & Dr. Frank O'Hara for The Complete Spectrum ROM Disassembly book.
- Chris Smith for the The ZX-Spectrum ULA book.
- GreenWeb Sevilla for its Fantasy Zone game.
- Julián Urbano Muñoz for Speccy Pong.
- Others who have donated distribution rights for this project.