June 15, 2013

zxsp 0.8.0pre16: SPECTRA Interface


the next version of zxsp is out right now. The major new thing is support for Paul Farrow's SPECTRA video interface. But let's start with the small modifications.

Rob Probin has pointed me to an improvement for the undocumented bits in the F register in the Z80 emulation which i now implemented. Hopefully programmes crash more accurate now. B-)

I replaced the default external AY extension, which was an AY-Magic, with the Didaktik Melodik, because i didn't get answer to my request for admittance to use the AY-Magic image.

Now to the big add-on:

Paul Farrow's SPECTRA video interface

Paul Farrow's SPECTRA video interface
This is a RGB-Scart interface to connect your ZX Spectrum to a TV set with much better image quality than with the standard HF lead.

It also incorporates new colour modes, a rom slot with Interface1-compatible paging, a Kempston joystick interface and an Interface1-compatible RS232 port.

Of course the "better image" is not emulated in zxsp, because you already get the best quality here :-) but colour modes, rom and joystick interface are emulated. The RS232 port is postponed for a while.

The new colour modes

Screenshot made with zxsp
There are 32 combinations for new modes combined from
  • extra colours: provides 64 colours
  • half cell mode: set colours for left and right 4 pixels in character cell separately
  • 2-byte attributes: doubles the available information which can be stored for attributes
  • 8, 4, 2 and 1-line mode: increase vertical colour resolution
Some combinations are a little bit pointless, but most provide certain trade-offs between memory consumption and added colour capabilities.

In addition the interface contains 2 x 16 kByte of ram which allows double buffering of video drawing.

All colour modes are supported by zxsp, you can also make GIF images and movies in these modes.

ROM support

The interface has a Sinclair Interface 2-like rom slot or, optionally, a DIL socket, but zxsp basically emulates the IF2 slot. There is the option to enable rom switching on the 3 positions where the Sinclair Interface 1 pages in and out. So you can "insert" an Interface 1 rom or a rom which is somehow based on this rom. You can test that it works if you enter the Basic command

    OPEN #4;"m";1;"foo"

which doesn't pass the parser of the plain Basic rom but works when an Interface 1 rom is inserted and the rom hooks are enabled, though it will only tell you that the microdrive 1 is not present.

Joystick support

The interface contains a Kempston-style joystick port and is emulated by zxsp.


The interface contains a RS232 port which works identical to the Interface 1 port, except that it only supports the RS232 mode of this port. This is not yet emulated in zxsp.

.Z80 file support

I have extended the .Z80 file standard to contain the SPECTRA interface. I just dump the information here, so that everybody who is interested can add support to his own emulator:

I have used 1 formerly unused bit to indicate presence of the SPECTRA interface:
  • Bit 3 in Byte "rldiremu'".

If this bit is set, then two bytes are added to the up-to-now defined header after byte "port_1ffd" introduced by xzx/warajewo:
  • Byte "spectra_bits" and
  • Byte "spectra_port_7fdf".

The first one contains some state information while the latter one the state of the port 0x7FDF colour mode register. 

The bits are:
  • Bit 0: new colour modes enabled
  • Bit 1: RS232 enabled            
  • Bit 2: Joystick enabled  
  • Bit 3: IF1 rom hooks enabled
  • Bit 4: rom paged in      
  • Bit 5: port 239: Comms out bit
  • Bit 6: port 239: CTS out bit 
  • Bit 7: port 247: Data out bit

After the header, pages with ID 12, 13 and 14 may be present.
  • Page 12: rom data of inserted rom
  • Page 13: ram data of ram bank 0
  • Page 14: ram data of ram bank 1

If page 12 is not present, then no rom is inserted.
If page 13 is not present, then it shall be copied from the contended ram page.
Same for page 14.

The zip archive of this release comes with some examples and links to my and Paul's website where you can get some more. Let's see how many people find it fancy to write a game or demo which uses this interface. You now have an emulator for convenient development. :-)

    ... Kio !

p.s.: Someone promised a download link here, so here's a link to the official download page: http://k1.spdns.de/Develop/projects/zxsp-osx/distributions/. The downloads are at the end of the page.


  1. Congratulations for being the first emulator (that I know of) to support the SPECTRA interface. It will make development software to support it.

  2. Thanks for your congratulations. :-)
    But you were the first to write a demo for it. Not bad either. ;-)

    ... Kio !