rampa069 / ZX-ESPectrum-IDF

A ZX spectrum 48K/128K emulator running on ESP32 powered Lilygo TTGo VGA32 board

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ESPectrum

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.

Features

  • 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.

Work in progress

  • TZX Support
  • Being able to use SAVE command to save to SPIFFS and/or SD Card.
  • Fast tape load.

Installing

You can flash the binaries directly to the board if do not want to mess with code and compilers. Check the releases section

Compiling and installing

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.

Install platformIO:

  • There is an extension for Atom and VSCode, please check this website.
  • Select your board, pico32 which behaves just like the TTGo VGA32.

Customize platformio.ini

PlatformIO now autodetects port, so there is no need to specify it (unless autodetection fails).

Select your aspect ratio

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).

Upload the data filesystem

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).

Using a external micro SD Card and copying games into it

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.

Compile and flash it

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.

Keyboard functions

  • 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)

Hardware configuration and pinout

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.

Thanks to

And all the involved people from the golden age

And all the writters, hobbist and documenters

A lot of programmers, especially

  • GreenWeb Sevilla for its Fantasy Zone game.
  • Julián Urbano Muñoz for Speccy Pong.
  • Others who have donated distribution rights for this project.

About

A ZX spectrum 48K/128K emulator running on ESP32 powered Lilygo TTGo VGA32 board

License:GNU General Public License v3.0


Languages

Language:C 50.1%Language:C++ 49.0%Language:Python 0.7%Language:CMake 0.1%Language:Makefile 0.0%