Skip to content

Commit

Permalink
Merge pull request #50 from EremusOne/develop
Browse files Browse the repository at this point in the history
1.2 ready!
  • Loading branch information
EremusOne authored May 25, 2024
2 parents d68a1c7 + b64517b commit c4a926b
Show file tree
Hide file tree
Showing 50 changed files with 15,265 additions and 1,579 deletions.
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,27 @@ This project is based on David Crespo excellent work on [ZX-ESPectrum-Wiimote](h
## Features

- ZX Spectrum 48K, 128K and Pentagon 128K 100% cycle accurate emulation (no PSRAM needed).
- Perfect Z80 emulation (Authored by [José Luis Sánchez](https://github.com/jsanchezv/z80cpp))
- State of the art Z80 emulation (Authored by [José Luis Sánchez](https://github.com/jsanchezv/z80cpp))
- Selectable Sinclair 48K, Sinclair 128K and Amstrad +2 english and spanish ROMs.
- Possibility of using one 48K and one 128K custom ROM with easy flashing procedure from SD card.
- ZX81+ IF2 ROM by courtesy Paul Farrow with .P file loading from SD card.
- 6 bpp VGA output in three modes: Standard VGA (60 and 70hz), VGA 50hz and CRT 15khz 50hz.
- VGA fake scanlines effect.
- 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).
- Snow effect accurate emulation (as [described](https://spectrumcomputing.co.uk/forums/viewtopic.php?t=8240) by Weiv and MartianGirl).
- Contended memory and contended I/O emulation.
- AY-3-8912 sound emulation.
- Beeper & Mic emulation (Cobra’s Arc).
- Dual PS/2 keyboard support: you can connect two devices using PS/2 protocol at the same time.
- PS/2 Joystick emulation (Cursor, Sinclair, Kempston and Fuller).
- Two real joysticks support (Up to 8 button joysticks) using [ESPjoy adapter](https://antoniovillena.es/store/product/espjoy-for-espectrum/) or DIY DB9 to PS/2 converter.
- Emulation of Betadisk interface with four drives and TRD (read and write) and SCL (read only) support.
- Realtime (with OSD) and fast TAP file loading.
- Realtime (with OSD) TZX and TAP file loading.
- Flashload of TAP files.
- Rodolfo Guerra's ROMs fast load routines support with on the fly standard speed blocks translation.
- TAP file saving to SD card.
- SNA and Z80 snapshot loading.
- Snapshot saving and loading.
Expand All @@ -38,9 +42,7 @@ This project is based on David Crespo excellent work on [ZX-ESPectrum-Wiimote](h
## Work in progress

- +2A/+3 models.
- TZX support.
- DSK support.
- On screen keyboard.

## Installing

Expand Down Expand Up @@ -170,8 +172,9 @@ Pin assignment in `hardpins.h` is set to match the boards we've tested emulator
- David Carrión for hardware and ZX keyboard code.
- ZjoyKiLer for his testing, code and ideas.
- [Ackerman](https://github.com/rpsubc8/ESP32TinyZXSpectrum) for his code and ideas.
- [Mark Woodmass](https://specemu.zxe.io) and [Juan Carlos González Amestoy](https://www.retrovirtualmachine.org) for his excellent emulators and his help with wd1793 emulation.
- [Mark Woodmass](https://specemu.zxe.io) and [Juan Carlos González Amestoy](https://www.retrovirtualmachine.org) for his excellent emulators and his help with wd1793 emulation and many other things.
- [Rodolfo Guerra](https://sites.google.com/view/rodolfoguerra) for his wonderful enhanced ROMs and his help for adding tape load turbo mode support to the emulator.
- Weiv and [MartianGirl](https://github.com/MartianGirl) for his detailed analysis of Snow effect.
- [Antonio Villena](https://antoniovillena.es/store) for creating the ESPectrum board.
- Tsvetan Usunov from [Olimex Ltd](https://www.olimex.com).
- [Amstrad PLC](http://www.amstrad.com) for the ZX-Spectrum ROM binaries [liberated for emulation purposes](http://www.worldofspectrum.org/permits/amstrad-roms.txt).
Expand Down
4 changes: 4 additions & 0 deletions components/fabgl/src/devdrivers/kbdlayouts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ const KeyboardLayout USLayout {
// note1: pressing CTRL + PAUSE will generate "E0 7E" instead of normal Pause sequence. Here is translated to VK_BREAK.
// note2: pressing CTRL + PAUSE generates both keydown and keyup at the same time (hence the sequence E0 7E E0 F0 7E)
{ 0x7E, VK_BREAK },
// Add volume up, down and mute keys
{ 0x32, VK_VOLUMEUP },
{ 0x21, VK_VOLUMEDOWN },
{ 0x23, VK_VOLUMEMUTE },
// these codes are discarded. They are a sort of extended left and right shifts.
// They are prefixed/postfixed on some special keys (insert, cursor,...) in combination with SHIFT or NUM LOCK, and even in unshifted PRINTSCREEN
{ 0x12, VK_NONE },
Expand Down
2 changes: 1 addition & 1 deletion components/fabgl/src/devdrivers/kbdlayouts.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ struct KeyboardLayout {
const char * desc; /**< Layout description. */
KeyboardLayout const * inherited; /**< Inherited layout. Useful to avoid to repeat the same scancode-virtualkeys associations. */
VirtualKeyDef scancodeToVK[86]; /**< Direct one-byte-scancode->virtualkey associations. */
VirtualKeyDef exScancodeToVK[22]; /**< Direct extended-scancode->virtualkey associations. Extended scancodes begin with 0xE0. */
VirtualKeyDef exScancodeToVK[25]; /**< Direct extended-scancode->virtualkey associations. Extended scancodes begin with 0xE0. */
AltVirtualKeyDef alternateVK[73]; /**< Virtualkeys generated by other virtualkeys and shift combinations. */

VirtualKey deadKeysVK[8]; /**< Dead keys identifiers. */
Expand Down
4 changes: 4 additions & 0 deletions components/fabgl/src/fabutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -1529,6 +1529,10 @@ enum VirtualKey {
VK_FULLER_UP,
VK_FULLER_FIRE,

VK_VOLUMEUP, /**< Volume UP */
VK_VOLUMEDOWN, /**< Volume DOWN */
VK_VOLUMEMUTE, /**< MUTE */

VK_ASCII, /**< Specifies an ASCII code - used when virtual key is embedded in VirtualKeyItem structure and VirtualKeyItem.ASCII is valid */
VK_LAST, // marks the last virtual key

Expand Down
2 changes: 1 addition & 1 deletion include/AySound.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ESPectrum, a Sinclair ZX Spectrum emulator for Espressif ESP32 SoC
AY SOUND EMULATION, based on libayemu by:
Sashnov Alexander <sashnov@ngs.ru> and Roman Scherbakov <v_soft@nm.ru>
Copyright (c) 2023 Víctor Iborra [Eremus] and David Crespo [dcrespo3d]
Copyright (c) 2023, 2024 Víctor Iborra [Eremus] and 2023 David Crespo [dcrespo3d]
https://github.com/EremusOne/ZX-ESPectrum-IDF
Based on ZX-ESPectrum-Wiimote
Expand Down
7 changes: 5 additions & 2 deletions include/CPU.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ESPectrum, a Sinclair ZX Spectrum emulator for Espressif ESP32 SoC
Copyright (c) 2023 Víctor Iborra [Eremus] and David Crespo [dcrespo3d]
Copyright (c) 2023, 2024 Víctor Iborra [Eremus] and 2023 David Crespo [dcrespo3d]
https://github.com/EremusOne/ZX-ESPectrum-IDF
Based on ZX-ESPectrum-Wiimote
Expand Down Expand Up @@ -50,7 +50,7 @@ visit https://zxespectrum.speccy.org/contacto
#define INT_START48 0
#define INT_END48 32
#define INT_START128 0
#define INT_END128 36
#define INT_END128 36 // 35 in real +2 and Weiv's Spectramine. I'll have to check those numbers
#define INT_START_PENTAGON 0
#define INT_END_PENTAGON 36

Expand Down Expand Up @@ -83,6 +83,9 @@ class CPU
static uint8_t IntStart;
static uint8_t IntEnd;

// CPU Tstates in frame - IntEnd
static uint32_t stFrame;

};

#endif // CPU_h
2 changes: 1 addition & 1 deletion include/CaptureBMP.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ESPectrum, a Sinclair ZX Spectrum emulator for Espressif ESP32 SoC
Copyright (c) 2023 Víctor Iborra [Eremus] and David Crespo [dcrespo3d]
Copyright (c) 2023, 2024 Víctor Iborra [Eremus] and 2023 David Crespo [dcrespo3d]
https://github.com/EremusOne/ZX-ESPectrum-IDF
Based on ZX-ESPectrum-Wiimote
Expand Down
9 changes: 8 additions & 1 deletion include/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ESPectrum, a Sinclair ZX Spectrum emulator for Espressif ESP32 SoC
Copyright (c) 2023 Víctor Iborra [Eremus] and David Crespo [dcrespo3d]
Copyright (c) 2023, 2024 Víctor Iborra [Eremus] and 2023 David Crespo [dcrespo3d]
https://github.com/EremusOne/ZX-ESPectrum-IDF
Based on ZX-ESPectrum-Wiimote
Expand Down Expand Up @@ -116,6 +116,13 @@ class Config
static uint8_t DSK_fdMode;
static string DSK_fileSearch;

static uint8_t scanlines;
static uint8_t render;

static bool TABasfire1;

static bool StartMsg;

};

#endif // Config.h
11 changes: 9 additions & 2 deletions include/ESPectrum.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ESPectrum, a Sinclair ZX Spectrum emulator for Espressif ESP32 SoC
Copyright (c) 2023 Víctor Iborra [Eremus] and David Crespo [dcrespo3d]
Copyright (c) 2023, 2024 Víctor Iborra [Eremus] and 2023 David Crespo [dcrespo3d]
https://github.com/EremusOne/ZX-ESPectrum-IDF
Based on ZX-ESPectrum-Wiimote
Expand Down Expand Up @@ -76,6 +76,10 @@ class ESPectrum
static void readKbdJoy();
static fabgl::PS2Controller PS2Controller;
static fabgl::VirtualKey JoyVKTranslation[24];
static fabgl::VirtualKey VK_ESPECTRUM_FIRE1;
static fabgl::VirtualKey VK_ESPECTRUM_FIRE2;
static fabgl::VirtualKey VK_ESPECTRUM_TAB;
static fabgl::VirtualKey VK_ESPECTRUM_GRAVEACCENT;

// Audio
static void BeeperGetSample();
Expand Down Expand Up @@ -106,8 +110,11 @@ class ESPectrum
static double totalsecondsnodelay;
static int64_t elapsed;
static int64_t idle;
static int ESPoffset;

static int ESPoffset; // Testing
static int ESPtestvar;
static int ESPtestvar1;
static int ESPtestvar2;

static volatile bool vsync;

Expand Down
6 changes: 5 additions & 1 deletion include/FileUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ESPectrum, a Sinclair ZX Spectrum emulator for Espressif ESP32 SoC
Copyright (c) 2023 Víctor Iborra [Eremus] and David Crespo [dcrespo3d]
Copyright (c) 2023, 2024 Víctor Iborra [Eremus] and 2023 David Crespo [dcrespo3d]
https://github.com/EremusOne/ZX-ESPectrum-IDF
Based on ZX-ESPectrum-Wiimote
Expand Down Expand Up @@ -79,6 +79,10 @@ class FileUtils
static bool hasSNAextension(string filename);
static bool hasZ80extension(string filename);
static bool hasPextension(string filename);
static bool hasTAPextension(string filename);
static bool hasTZXextension(string filename);

static void deleteFilesWithExtension(const char *folder_path, const char *extension);

static string MountPoint;
static bool SDReady;
Expand Down
2 changes: 1 addition & 1 deletion include/MemESP.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ESPectrum, a Sinclair ZX Spectrum emulator for Espressif ESP32 SoC
Copyright (c) 2023 Víctor Iborra [Eremus] and David Crespo [dcrespo3d]
Copyright (c) 2023, 2024 Víctor Iborra [Eremus] and 2023 David Crespo [dcrespo3d]
https://github.com/EremusOne/ZX-ESPectrum-IDF
Based on ZX-ESPectrum-Wiimote
Expand Down
2 changes: 1 addition & 1 deletion include/OSDMain.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ESPectrum, a Sinclair ZX Spectrum emulator for Espressif ESP32 SoC
Copyright (c) 2023 Víctor Iborra [Eremus] and David Crespo [dcrespo3d]
Copyright (c) 2023, 2024 Víctor Iborra [Eremus] and 2023 David Crespo [dcrespo3d]
https://github.com/EremusOne/ZX-ESPectrum-IDF
Based on ZX-ESPectrum-Wiimote
Expand Down
2 changes: 1 addition & 1 deletion include/Ports.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ESPectrum, a Sinclair ZX Spectrum emulator for Espressif ESP32 SoC
Copyright (c) 2023 Víctor Iborra [Eremus] and David Crespo [dcrespo3d]
Copyright (c) 2023, 2024 Víctor Iborra [Eremus] and 2023 David Crespo [dcrespo3d]
https://github.com/EremusOne/ZX-ESPectrum-IDF
Based on ZX-ESPectrum-Wiimote
Expand Down
2 changes: 1 addition & 1 deletion include/Snapshot.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ESPectrum, a Sinclair ZX Spectrum emulator for Espressif ESP32 SoC
Copyright (c) 2023 Víctor Iborra [Eremus] and David Crespo [dcrespo3d]
Copyright (c) 2023, 2024 Víctor Iborra [Eremus] and 2023 David Crespo [dcrespo3d]
https://github.com/EremusOne/ZX-ESPectrum-IDF
Based on ZX-ESPectrum-Wiimote
Expand Down
Loading

0 comments on commit c4a926b

Please sign in to comment.