About the Project
DOWNLOAD SOURCE: FlashZXSpectrum48k_1.0.zip
The Sinclair ZX what?
The ZX Spectrum was an 8-bit microcomputer from the early 1980's manufactured by British company Sinclair Research (company history). The brainchild of inventor Sir Clive Sinclair, the ZX Spectrum had 48k of RAM and was powered by a 3.5 MHz Zilog Z80 processor.
It was only a matter of time...
ZX Spectrum emulators are certainly nothing new and have been available in many flavours ranging from native operating system apps to web Java applets. The release of the much improved Adobe Flash player 9.0 has heralded a new era of possibilities for Flash applications, now even writing an emulator in Flash is a possibility as shown by the great work of the award winning FC64 project. Given all this, it was only a matter of time before someone paid some ActionScript 3.0 style homage to the rather quirky ZX Spectrum.
The project
The main FlashZXSpectrum48k code was written between January and April 2006 with the finishing touches finally being added in October 2006 after a lengthy pause in the development. The emulator contains some ported code from the Java spectrum emulator QAOP - this emulator was chosen for three reasons: QAOP is an open source emulator, it has very accurate emulation (both in behaviour and speed) and thirdly it's written in Java and therefore porting the raw Z80 emulation code to ActionScript 3.0 was considered to be relatively straightforward.
Although the Z80 emulation code in FlashZXSpectrum48k was ported directly from QAOP, most other areas including the video translation routines are written from scratch (having been tested vigoursly with various code implementations to try and squeeze as many frames per second as possible from the Flash player).
Perfomance
The emulator runs well on a 2.8 GHz Pentium 4 and is just about fast enough for the simpler games on a 1.2 GHz Pentium III or 1.3 GHz Apple PowerBook G4.
Strangely enough the emulator seemed to run much faster with the 8.5 beta versions of the Flash player (particularly the third beta version around in spring 2006), so fast in fact that the emulator was able to run at full speed on all the test platforms. Unfortunately the project wasn't being developed when the released 9.0 player was available alongside the final 8.5 beta otherwise it may have been possible to devise some tests and establish what exactly was running slower.
Hopefully in the future with subsequent releases, the player's performance will pick up again.
No Sound?
The main feature missing is sound output. At present the Flash player doesn't support direct modulated sound output, only the playing of samples. For this reason sound hasn't been implemented yet. There are hacks out there to dynamically generate waveforms and it would certainly be interesting to look into these, the only concern is that there could be a performance hit.
Implementation
For those interested, the project was developed on a Mac using XCode. The full source is open source and available for download.
