Skip to content

Commit c4a926b

Browse files
authored
Merge pull request #50 from EremusOne/develop
1.2 ready!
2 parents d68a1c7 + b64517b commit c4a926b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+15265
-1579
lines changed

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,27 @@ This project is based on David Crespo excellent work on [ZX-ESPectrum-Wiimote](h
1111
## Features
1212

1313
- ZX Spectrum 48K, 128K and Pentagon 128K 100% cycle accurate emulation (no PSRAM needed).
14-
- Perfect Z80 emulation (Authored by [José Luis Sánchez](https://github.com/jsanchezv/z80cpp))
14+
- State of the art Z80 emulation (Authored by [José Luis Sánchez](https://github.com/jsanchezv/z80cpp))
1515
- Selectable Sinclair 48K, Sinclair 128K and Amstrad +2 english and spanish ROMs.
1616
- Possibility of using one 48K and one 128K custom ROM with easy flashing procedure from SD card.
1717
- ZX81+ IF2 ROM by courtesy Paul Farrow with .P file loading from SD card.
1818
- 6 bpp VGA output in three modes: Standard VGA (60 and 70hz), VGA 50hz and CRT 15khz 50hz.
19+
- VGA fake scanlines effect.
1920
- Support for two aspect ratios: 16:9 or 4:3 monitors (using 360x200 or 320x240 modes)
2021
- Multicolor attribute effects emulated (Bifrost*2, Nirvana and Nirvana+ engines).
2122
- Border effects emulated (Aquaplane, The Sentinel, Overscan demo).
2223
- Floating bus effect emulated (Arkanoid, Sidewize).
24+
- Snow effect accurate emulation (as [described](https://spectrumcomputing.co.uk/forums/viewtopic.php?t=8240) by Weiv and MartianGirl).
2325
- Contended memory and contended I/O emulation.
2426
- AY-3-8912 sound emulation.
2527
- Beeper & Mic emulation (Cobra’s Arc).
2628
- Dual PS/2 keyboard support: you can connect two devices using PS/2 protocol at the same time.
2729
- PS/2 Joystick emulation (Cursor, Sinclair, Kempston and Fuller).
2830
- 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.
2931
- Emulation of Betadisk interface with four drives and TRD (read and write) and SCL (read only) support.
30-
- Realtime (with OSD) and fast TAP file loading.
32+
- Realtime (with OSD) TZX and TAP file loading.
33+
- Flashload of TAP files.
34+
- Rodolfo Guerra's ROMs fast load routines support with on the fly standard speed blocks translation.
3135
- TAP file saving to SD card.
3236
- SNA and Z80 snapshot loading.
3337
- Snapshot saving and loading.
@@ -38,9 +42,7 @@ This project is based on David Crespo excellent work on [ZX-ESPectrum-Wiimote](h
3842
## Work in progress
3943

4044
- +2A/+3 models.
41-
- TZX support.
4245
- DSK support.
43-
- On screen keyboard.
4446

4547
## Installing
4648

@@ -170,8 +172,9 @@ Pin assignment in `hardpins.h` is set to match the boards we've tested emulator
170172
- David Carrión for hardware and ZX keyboard code.
171173
- ZjoyKiLer for his testing, code and ideas.
172174
- [Ackerman](https://github.com/rpsubc8/ESP32TinyZXSpectrum) for his code and ideas.
173-
- [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.
175+
- [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.
174176
- [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.
177+
- Weiv and [MartianGirl](https://github.com/MartianGirl) for his detailed analysis of Snow effect.
175178
- [Antonio Villena](https://antoniovillena.es/store) for creating the ESPectrum board.
176179
- Tsvetan Usunov from [Olimex Ltd](https://www.olimex.com).
177180
- [Amstrad PLC](http://www.amstrad.com) for the ZX-Spectrum ROM binaries [liberated for emulation purposes](http://www.worldofspectrum.org/permits/amstrad-roms.txt).

components/fabgl/src/devdrivers/kbdlayouts.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@ const KeyboardLayout USLayout {
161161
// note1: pressing CTRL + PAUSE will generate "E0 7E" instead of normal Pause sequence. Here is translated to VK_BREAK.
162162
// note2: pressing CTRL + PAUSE generates both keydown and keyup at the same time (hence the sequence E0 7E E0 F0 7E)
163163
{ 0x7E, VK_BREAK },
164+
// Add volume up, down and mute keys
165+
{ 0x32, VK_VOLUMEUP },
166+
{ 0x21, VK_VOLUMEDOWN },
167+
{ 0x23, VK_VOLUMEMUTE },
164168
// these codes are discarded. They are a sort of extended left and right shifts.
165169
// They are prefixed/postfixed on some special keys (insert, cursor,...) in combination with SHIFT or NUM LOCK, and even in unshifted PRINTSCREEN
166170
{ 0x12, VK_NONE },

components/fabgl/src/devdrivers/kbdlayouts.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ struct KeyboardLayout {
8484
const char * desc; /**< Layout description. */
8585
KeyboardLayout const * inherited; /**< Inherited layout. Useful to avoid to repeat the same scancode-virtualkeys associations. */
8686
VirtualKeyDef scancodeToVK[86]; /**< Direct one-byte-scancode->virtualkey associations. */
87-
VirtualKeyDef exScancodeToVK[22]; /**< Direct extended-scancode->virtualkey associations. Extended scancodes begin with 0xE0. */
87+
VirtualKeyDef exScancodeToVK[25]; /**< Direct extended-scancode->virtualkey associations. Extended scancodes begin with 0xE0. */
8888
AltVirtualKeyDef alternateVK[73]; /**< Virtualkeys generated by other virtualkeys and shift combinations. */
8989

9090
VirtualKey deadKeysVK[8]; /**< Dead keys identifiers. */

components/fabgl/src/fabutils.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1529,6 +1529,10 @@ enum VirtualKey {
15291529
VK_FULLER_UP,
15301530
VK_FULLER_FIRE,
15311531

1532+
VK_VOLUMEUP, /**< Volume UP */
1533+
VK_VOLUMEDOWN, /**< Volume DOWN */
1534+
VK_VOLUMEMUTE, /**< MUTE */
1535+
15321536
VK_ASCII, /**< Specifies an ASCII code - used when virtual key is embedded in VirtualKeyItem structure and VirtualKeyItem.ASCII is valid */
15331537
VK_LAST, // marks the last virtual key
15341538

include/AySound.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ESPectrum, a Sinclair ZX Spectrum emulator for Espressif ESP32 SoC
55
AY SOUND EMULATION, based on libayemu by:
66
Sashnov Alexander <sashnov@ngs.ru> and Roman Scherbakov <v_soft@nm.ru>
77
8-
Copyright (c) 2023 Víctor Iborra [Eremus] and David Crespo [dcrespo3d]
8+
Copyright (c) 2023, 2024 Víctor Iborra [Eremus] and 2023 David Crespo [dcrespo3d]
99
https://github.com/EremusOne/ZX-ESPectrum-IDF
1010
1111
Based on ZX-ESPectrum-Wiimote

include/CPU.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
ESPectrum, a Sinclair ZX Spectrum emulator for Espressif ESP32 SoC
44
5-
Copyright (c) 2023 Víctor Iborra [Eremus] and David Crespo [dcrespo3d]
5+
Copyright (c) 2023, 2024 Víctor Iborra [Eremus] and 2023 David Crespo [dcrespo3d]
66
https://github.com/EremusOne/ZX-ESPectrum-IDF
77
88
Based on ZX-ESPectrum-Wiimote
@@ -50,7 +50,7 @@ visit https://zxespectrum.speccy.org/contacto
5050
#define INT_START48 0
5151
#define INT_END48 32
5252
#define INT_START128 0
53-
#define INT_END128 36
53+
#define INT_END128 36 // 35 in real +2 and Weiv's Spectramine. I'll have to check those numbers
5454
#define INT_START_PENTAGON 0
5555
#define INT_END_PENTAGON 36
5656

@@ -83,6 +83,9 @@ class CPU
8383
static uint8_t IntStart;
8484
static uint8_t IntEnd;
8585

86+
// CPU Tstates in frame - IntEnd
87+
static uint32_t stFrame;
88+
8689
};
8790

8891
#endif // CPU_h

include/CaptureBMP.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
ESPectrum, a Sinclair ZX Spectrum emulator for Espressif ESP32 SoC
44
5-
Copyright (c) 2023 Víctor Iborra [Eremus] and David Crespo [dcrespo3d]
5+
Copyright (c) 2023, 2024 Víctor Iborra [Eremus] and 2023 David Crespo [dcrespo3d]
66
https://github.com/EremusOne/ZX-ESPectrum-IDF
77
88
Based on ZX-ESPectrum-Wiimote

include/Config.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
ESPectrum, a Sinclair ZX Spectrum emulator for Espressif ESP32 SoC
44
5-
Copyright (c) 2023 Víctor Iborra [Eremus] and David Crespo [dcrespo3d]
5+
Copyright (c) 2023, 2024 Víctor Iborra [Eremus] and 2023 David Crespo [dcrespo3d]
66
https://github.com/EremusOne/ZX-ESPectrum-IDF
77
88
Based on ZX-ESPectrum-Wiimote
@@ -116,6 +116,13 @@ class Config
116116
static uint8_t DSK_fdMode;
117117
static string DSK_fileSearch;
118118

119+
static uint8_t scanlines;
120+
static uint8_t render;
121+
122+
static bool TABasfire1;
123+
124+
static bool StartMsg;
125+
119126
};
120127

121128
#endif // Config.h

include/ESPectrum.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
ESPectrum, a Sinclair ZX Spectrum emulator for Espressif ESP32 SoC
44
5-
Copyright (c) 2023 Víctor Iborra [Eremus] and David Crespo [dcrespo3d]
5+
Copyright (c) 2023, 2024 Víctor Iborra [Eremus] and 2023 David Crespo [dcrespo3d]
66
https://github.com/EremusOne/ZX-ESPectrum-IDF
77
88
Based on ZX-ESPectrum-Wiimote
@@ -76,6 +76,10 @@ class ESPectrum
7676
static void readKbdJoy();
7777
static fabgl::PS2Controller PS2Controller;
7878
static fabgl::VirtualKey JoyVKTranslation[24];
79+
static fabgl::VirtualKey VK_ESPECTRUM_FIRE1;
80+
static fabgl::VirtualKey VK_ESPECTRUM_FIRE2;
81+
static fabgl::VirtualKey VK_ESPECTRUM_TAB;
82+
static fabgl::VirtualKey VK_ESPECTRUM_GRAVEACCENT;
7983

8084
// Audio
8185
static void BeeperGetSample();
@@ -106,8 +110,11 @@ class ESPectrum
106110
static double totalsecondsnodelay;
107111
static int64_t elapsed;
108112
static int64_t idle;
113+
static int ESPoffset;
109114

110-
static int ESPoffset; // Testing
115+
static int ESPtestvar;
116+
static int ESPtestvar1;
117+
static int ESPtestvar2;
111118

112119
static volatile bool vsync;
113120

include/FileUtils.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
ESPectrum, a Sinclair ZX Spectrum emulator for Espressif ESP32 SoC
44
5-
Copyright (c) 2023 Víctor Iborra [Eremus] and David Crespo [dcrespo3d]
5+
Copyright (c) 2023, 2024 Víctor Iborra [Eremus] and 2023 David Crespo [dcrespo3d]
66
https://github.com/EremusOne/ZX-ESPectrum-IDF
77
88
Based on ZX-ESPectrum-Wiimote
@@ -79,6 +79,10 @@ class FileUtils
7979
static bool hasSNAextension(string filename);
8080
static bool hasZ80extension(string filename);
8181
static bool hasPextension(string filename);
82+
static bool hasTAPextension(string filename);
83+
static bool hasTZXextension(string filename);
84+
85+
static void deleteFilesWithExtension(const char *folder_path, const char *extension);
8286

8387
static string MountPoint;
8488
static bool SDReady;

0 commit comments

Comments
 (0)