Archive for the ‘ZX Spectrum’ Tag

sound card for your ZX Spectrum – ZX AY by

Thursday, September 21st, 2017

ZX AY is another solution to give your ZX Spectrum stereo AY sound. This is external unit, so both: you donot need to mod anything inside your ZX Spectrum 128k, it will work also with your older rubber ZX Spectrum 48k – to be honest – I had no single problem to use it with ZX Spectrum 48k, ZX Spectrum 128k, ZX Spectrum 128+2 (grey) and ZX Spectrum 128k +3. Not sure if Spanish toastrack (128k) model will be working without timing problems but – it’s anothoer case and something that should be fixed within one particular model. Ben Versteeg declares that ZX AY works with any ZX Spectrum model from 16k to 128k +3 – however – I will try to run it with Spanish Investronica models soon.

Hooking up ZX AY is damn simple – also it’s connection thru so pretty much universal to be included in any chain of interfaces. I was hooking up to ZX AY Lotharek’s DivIDE2k14 and it was working without any problems. One thing you should see on the pics – there is not much place around EAR/MIC inputs as ZX AY goes cross way, but fortunately not pressing much on these connectors in rubber ZX Spectrum 48k. This problem doesnot exists in 128k +2 and so on +3 models.


The whole interface is made with GI made AY-3-8912, for the bats – there are differences to the other chip makers, but as I wrote – for the bats.

The unit disables internal AY in 128k +2 and +3 models, so when using it – there is no sound on sound output from internal AY.

Generally you have two options to configure ZX AY and it concerts channel stereo setup.

There are two jumpers that are used two ways – horizontal – they will set up ABC Stereo, or vertical – they will set up then ACB Stereo.

ABC Stereo means left channel will contain A+B+Beeper, the right – B+C+Beeper.

ACB Stereo means left channel will contain A+C+Beeper, the right – B+C+Beeper

When plugging ZX AY to anything thru it’s output please remember – the output is STEREO minijack so you cannot use mono minijack as it put ground with one channel.

Enough talking about sound unit, let’s listen to it. I have three tracks for you – all with the same song “General Instruments Mandess Inc” done by v0yager ( member) for latest Riverwash 2017 compo.

All tracks are recorded on my Tascam DR60mk2 thru stereo input (as line signal) with gain set up in the middle.

First track is ABC setup, 2nd one is ACB one (so you can compare what it means to this one specific song) and 3rd track is directly from ZX Spectrum 128k +2 (grey one, issue 1 UK made, no mods, factory default) – so the third one is mono as you can hear as all 128k ZX Spectrum family has AY chip but in mono mode. To have it in stereo you have to add either Bytedelight stereo mod either mode advanced AmpY (which also plays as amplifier for ZX Spectrum).

Coming to final verdict – very nice unit, more expensive then Lotharek’s one, but with possibility to switch two ABC ACB modes. Very good sound level, connection thru, included manual.

you can buy ZX AY directly from bytedelight here.

converting binary to ASCII decimal data list on Mac OSX

Tuesday, September 19th, 2017

Personally I use it to include already compiled assembler binary data or to convert i.e. small portion of bitmap like sprite or tiles to simple ASCII source to be included as DEF… or DATA… either in Assembler or BASIC source.

Above 32x32pixels graphics – to do it just in binary it’s simple but time consuming. 01000000, 00111111, 11100000, 00001111 – this is binary for just first row of above graphics.

On ZX Spectrum BASIC (or text file to be coverted by zmakebas) you need to write it down as 999 DATA BIN 01000000, BIN 00111111, BIN 11100000, BIN 00001111 then in loop of FOR… READ… POKE… NEXT… commands. So to be honest – it’s easy to do by pen on paper, but time consuming to write it down without stupid mistakes in data. And we have computers, you know, to simply stuff like that. So let’s them working.

How to do it with Mac OSX? Of course we need AppleScript.

Let’s do it with converting graphics, in our example 32×32 pixels, monochrome. I will be using Photoshop, pretty old version as CS5.1 but you can easy find relevant options in other software to replicate my moves.

To convert to bitmap (so zero-one data – no colour, no grayscale) it needs to be 8bit (just tip if you convert from 16bit and stuck with greyed bitmap mode in Photoshop).

step 1: save as .pbm

step 2: use my read pbm and extract raw data.scpt Applescript. Adobe Photoshop saves not fully text version of .pbm as described around in the internet. First 9 bytes are text – in our example:


Three tags, between all of them we have $0A handler. One important to note – we have 32×32 bitmap and… bingo – it’s noted in the header, right?

So we can ommit first 9 bytes (as in my Applescript code) and read the rest.

step 3: select and copy everything between { }

step 4: paste do your editor (BBEdit in my example) add code (BASIC or Assembler) and you have it. 30 seconds max 🙂

I will be sharing here more simple code and workflow solutions so – until next time.

Let me know if it works for you, or if you have a problem using this. Cheers!

Assembling Z80 Assembler source files with BBEdit and Pasmo Z80 Assembler

Wednesday, September 13th, 2017

Inspired and with help from Derek Bolli I have made today two scripts for use with Pasmo and BBEdit.

Script #1 making .tap file with BASIC loader (option –tapbas) :

and script #2 making .tzx (option –tzxbas) like above with BASIC loader:

Both scripts are .scpt (Apple Script) files to be put into:

~/Library/Application Support/BBEdit/Scripts/

And from that point they will appear in BBEdit under scipts icon drop down menu.

Files are easy to modify, aspecially if you donot want them to open compiled filed in emulator. I have marked port of code to mark down if you want to turn it off. If any – ask.

Z80 IDE – placing our tools within MacOSX catalog structure (step 2)

Wednesday, September 13th, 2017

Step two for me with setting up IDE for Z80 for use in Mac OSX was placing our tools within MacOSX catalog structure. Why bother with it? The point is to have access to our tools like pasmo or zasm, zmakebas from any folder on the computer without playing with disk/path to them, so it should be “within” system path as other system tools.

For me, under MacOSX 10.11.6 worked copying in terminal to  /usr/local/bin by typing (i.e. copying pasmo) after changing path to folder containing pasmo file:

sudo cp pasmo /usr/local/bin

then enter the root (administrator) password after being asked.

From this point pasmo can be envoked from any disk location. I did it installing all command tools like pasmo, zasm, zmakebas etc.


I started to learn assembler for Z80 and ZX Spectrum (step 1)

Monday, April 3rd, 2017

A few months ago I decided to do something crazy – from the point where I am by profession and age – and start to learn Z80 assembler to start coding in small form for ZX Spectrum.

Biggest problem – as always is to have simple but effective IDE* – the problem is I’m Apple Mac user. I didn’t wanted to setup Windows on Mac just for that (well – I had to try ZX Spin under Windows and I like it, but overall – Pasmo was my target compiler so decided to try setup all under MacOSX).

So three programs: editor – my is Textmate I just have installed additional budle (actually for ZASM but also works fine . pasmo is my assebler – I managed to compile and install it on my old Macbookpro and the last part of IDE for this moment is emulator with debugger – ZX SP.

Step by step – reading books, analysing code, hitting walls, finding solutions. Stay tuned!

* An integrated development environment (IDE) is a software application that provides comprehensive facilities to computer programmers for software development. An IDE normally consists of a source code editor, build automation tools and a debugger.

TKPie HDMI interface by Piotr ‘zaxon Bugaj

Sunday, March 19th, 2017

Since annoucment fro Victor Trucco of TKPie (also known as ZXPie) in 20.Oct 2016 and fast declaration from Piotr ‘zaxon Bugaj to bring it to his offer I was keeping my thumbs to get it fast. Just before Christmas 2016 I got it, “soldered” my spare RaspberryPi Zero, put baremetal OS on microSD card… and have enjoyed the working unit for 5 minutes. After that it went really hot so I have turned my old rubber 48k off. After cooling turned it again… but it went to black screen. It’s interesting, as RaspberryPi Zero worked flawlessly alone running Retropi.

Piotr was so kind to inspect the unit, he has resoldered my Raspberrypi Zero’s connector and it works now, so assume my soldering skills was the reason of the problem 🙂

In between – it cames in real tests that initial version of baremetal OS won’t work correctly on 128k shadow screen switching, but on 10. January Victor Trucco updated the support of that in CPLD insert. It means – every unit of TKpie can be updated but of the level of CPLD (so you need to have a 3-4 USD “USB Blaster Programmer Cable For FPGA CPLD JTAG Development Board”.

So initial experience was a bit complicated as for the user, however with Piotr’s help it went all into working one.

This also may be a bit complicated for many others, also it’s not possible to stock Raspberrypi Zero as sales are limited to one unit per order – but actually if you are not skilled to make prober soldering of RaspberryPi Zero and female connector (more about it below) it may be a bit frustrating issue for you.

One thing I think is a bit “minor” is that Piotr decided to use male connector (pins) on TKpie. It’s logical from point of TKpie maker (where TKpie logially is main unit towards RaspberryPi Zero) but not towards RPizero typical distribution and connectors. Let me clear this: I’m user of RaspberryPi since first version. Raspberrypi Zero is first unit that has not soldered extension connector, so maybe that makes mess, but all extensions towards RPi works like: male pins are on Raspberrypi board, extension is with female connector. This makes mess when you order Raspberrypi with presoldered connector… and you will get it default with male connector (pins)… and try to connect it now to TKpie 🙂

When finally we have correctly soldered TKpie with Raspberrypi Zero, with new baremetal OS on microSD card we will hit another wall: there is no sound over HDMI, just video. Basically… the unit needs even simple analog-to-digital converter for sound and smart insert for this into RPizero. Or multicore Raspberrypi that will do this (as I read this is about processing limit on the RPizero). So if you use flat TV or monitor that allows you to insert separate audio signal to the video – that’s ok. If you use amplifier with speakers to run sound – that’s also ok.

I have found Tkpie to work a bit different on 48k ZX Spectrum and 128k ZX Spectrum (no matter if it’s 128k Toastrack or grey 128k +2).

For below examples and test I was using HDMI converted hooked into Avermedia Gamecapture HDII then whole thing was for my eyes on Eizo gaming FS2331 monitor. I wanted to be able to capture difference in quality of video and as screenshots – but that comes limits – cannot run the HDMI converter in other then 1080p/720p and be able to record video capture 🙁 so 1024x768px mode is not possible for that).

However I was able to hookup dual connection – so mirroring video output from speccy – (RGB Scart lead to Scart Input  or cheap HAMA composite to Scart converter inserted into Scart input in HDMI video conterter) and HDMI out directly from TKpie/RPizero, so please dig in details of the pictures and video capture.

What is important: TKPie and RPizero is powered from your ZX Spectrum, no need to power it other way. 

Starting up on 128k models is… longer, comes with kind of garbage on screen – as I know from Piotr – it’s memory test of Raspberrypi Zero, however it’s visible only on 128k models. After soft reset it becomes correct and clean – donot know why. On rubber 48k (6a issue board with composite mode) it’s instant and clean.

My conclusion is very simple: it’s great extension and solution for any 16k/48k models as composite won’t be that clear and crispy. This review brought me also thinking again (after a few years in digital connection) how proper cable and isolation is important for analog connection. I have used cinch-cinch cable that was around me – but this one was intended oryginally for stereo connection, not video, even the plug are correct, it gets a lot of garbage from PSU cable etc. So donot forget about it when connecting.

For 128k models – if you have proper RGB Scart cable – the scalling from RPizero won’t be that good as that simple 30USD unit like my HDMI converted does.

Why to have TKpie and HDMI output for your retro Spectrum?

  • if you need to test units that have no composite mod done, either you donot want to do this by making (even simple) changes inside your Spectrum and keep it original (however – when you do recapping I think it’s not issue to make composite mod also). Imagine you want to test 10 rubber units from car sale – with simple hook up to pocket HDMI monitor you can test them even outdoor at sale location.
  • if you want to hook up your Spectrum to any kind of modern HDMI monitor or LCD TV without Scart/composite input or there is a lot of noisy PSU or other sources that make your analog singal dirty and noisy.

So finally – I will pass over it for 128k Spectrums as my RGB Scart cable gives me better video… and audio together on HDMI connection thru additional but already owned HDMI converter.

Edit: above is strikethrought as I have found one thing that TKPie does: it works with every HDMI hardware I have: SmallHD 4″ monitor, HDMI converted, Avermedia Gamecapture HDII. I donot need to use flat TV or large monitor – so it can work for me as mobile solution to check or play with my speccy (just power speccy from powerbank and that’s it). 

But I will be using this for fast connect/test-pass routines as it’s very fast and reliable. The only minor with TKpie is… I cannot use it with my Retroleum Smartcard as not of these two are connection-thru unit. So I can use only one of them. Imagine you have to test rubber, you cannot open it, keyboard is not working. For Smartcard – it’s not a problem as you can run all test thru autorun ROM or use joystick thru Kemston port to go thru menu. So combining there two into one working connection is my dream. It’s possible then to test board alone, without hooking the keyboard…

Finally about the scores. From max (10) points on features I thought about three minors: no sound over HDMI, 128k screen quality is better over RGB to Scart connection then thru TKpie, no additional features (ULAplus support, different upscaling modes). For the money paid – even including RPi zero price with shipping, additional connectors, HDMI cable, paying someone to do job – it’s still bargain cost to have it as solution for old 16k/48k HDMI output. Compare to Spectra interface. 2,5x cheaper in total or even more. With price I had no wonders – it’s maximum value per money. I have divided points for quality for 48k and 128k models. For easy of use I had real dilemma. Typical use of this product for user with no soldering skills is painful at start. It will be hard to get solution as limits of buying RPizero make hard to create stock for Piotr. However I have to mention it and include in total score. It’s not for beginner until RPizero is soldered. Lack of manual makes things more for advanced one that will ask/search/get knowledge. Support/manual – also divided I would be max for support – Piotr is really helpful person, but lack of manual with TKpie, not much over internet makes for me average at 6 points in this category. But – this is easy to change – creating dedicated subpage, simple step-by-step manual with pictures. I highly suggest to reverse fale/female connectors of TKpie (to have female on TKpie and male on RPizero) as it’s more standard since all versions of RaspberryPi and some shops sell RPizero with option of presoldered connector (but as male on RPizero). In my opinion RPizero have to be lifted/supported from below as HDMI cables are hard/heavy enough to press on connector and whole unit so against computer extension connector. The 2nd unit I have received form Piotr was premade towards more durable – the pins from RPizero has been soldered directly to TKpie board.

When soldered – really nice combo with new DivMMC AY, aspecially for my old rubbers 16k/48k. For whole family of 128k prefer to use good quality of RGB2Scart leads.


Piotr ‘zaxon’ Bugaj on


The screenshot was taken from demo “Big things” done by team honoured 2nd place on Forever XVIII (March 2017). You can check/compare your video output by loading the demo here or just grabbing scr screenshot here.