This is a ZGE port of Jasper ZX Spectrum emulator: https://github.com/begoon/jasper
Features:
- Kempston joystick emulation (use a PC joypad, or cursor + ctrl keys)
- Supports .sna and .z80 format files. More available here: http://www.planetemu.net/roms/sinclair-zx-spectrum-z80
I did this project as a test to see if the ZGE scripting language is fast and powerful enough to run a emulator at full speed and I'm pleased with the results. Recent optimizations such as function inlining and switch-statement jump tables make all the difference here.
ZX Spectrum emulator
Moderator: Moderators
ZX Spectrum emulator
- Attachments
-
- Jasper.zgeproj
- (183.8 KiB) Downloaded 720 times
-
- zge_jsw.png (95.83 KiB) Viewed 17027 times
Re: ZX Spectrum emulator
Very cool & nice benchmark! No sound though? Admittedly .. i can imagine it's a little tricky to do without being able to write to a sound buffer directly, especially when you want to for example support games that basically halt the program for a bit and write to the AY-3-8910 as fast as possible ( for rudimentary sample playback ).
K
Re: ZX Spectrum emulator
The Jasper emulator does not try to emulate sound so I didn't attempt either. And I think you are right that it would require a method of writing to the sound buffer directly.
The 48k Spectrum is a very simple device with no additional support chips so the emulator is basically just Z80 emulation together with a shader to convert the ZX Spectrum video memory layout to the screen. Later 128k Spectrum model had AY-sound chip but initially there was just a speaker with on/off control (like the original PC).
If you run exe-compressor then all this will fit in 65kb: The emulator, the 16k Spectrum ROM, a 48kb game, and the ZGE engine itself. Also a good benchmark for compactness.
The 48k Spectrum is a very simple device with no additional support chips so the emulator is basically just Z80 emulation together with a shader to convert the ZX Spectrum video memory layout to the screen. Later 128k Spectrum model had AY-sound chip but initially there was just a speaker with on/off control (like the original PC).
If you run exe-compressor then all this will fit in 65kb: The emulator, the 16k Spectrum ROM, a 48kb game, and the ZGE engine itself. Also a good benchmark for compactness.
Re: ZX Spectrum emulator
Hej Ville,
By the way, have you tried rendering to a 256×192 RenderTarget? Because of the complexity of the fragment-shader i suspect it might improve performance ( a bit ).
K
Oops .. i guess that's what i get by assuming the original ZX Spectrum even had a PSG ( and therefore Google'ing "ZX Spectrum PSG" )VilleK wrote:The 48k Spectrum is a very simple device with no additional support chips so the emulator is basically just Z80 emulation together with a shader to convert the ZX Spectrum video memory layout to the screen. Later 128k Spectrum model had AY-sound chip but initially there was just a speaker with on/off control (like the original PC).
By the way, have you tried rendering to a 256×192 RenderTarget? Because of the complexity of the fragment-shader i suspect it might improve performance ( a bit ).
K