During the development of the ZX Spectrum SE, it was originally planned to replace the ULA (which creates the display) with something a little more advanced. However, it wasn't until nearly a decade later after the ULA was reverse engineered that this actually became possible.
FAQ
What is ULAplus?
ULAplus is a plug-in replacement ULA for the ZX Spectrum. It is scheduled for inclusion in the production Harlequin SE, but you can use it right now via emulation.
Which emulators support ULAplus?
Beta support is available in BASin (the Sinclair BASIC IDE), Fuse (via patches), SpecEmu, Spud, and ZXSpin.
Beta support is available in BASin (the Sinclair BASIC IDE), Fuse (via patches), SpecEmu, Spud, and ZXSpin.
How can I use Fuse with brand-x Linux?
The Fuse link is for the 32-bit Ubuntu binary and it requires libspectrum. The source is also known to compile on CentOS. The source for libspectrum is available here. Note: On a default Ubuntu install you'll need to sudo apt-get install the following; bison, flex, libsdl1.2-dev, then ./configure --with-sdl. You need to build libspectrum first, and on Krappy Koala you'll need to run with the sound off to avoid freezes.
How do I use the palette files?
To get the full 64 colours on screen a certain amount of hacking is required as most games do not use the FLASH and BRIGHT bits. However, up to around 32 colours are possible with no hacking at all. Simply load a palette file then load the game. A generic palette file is available that should work reasonably well for most titles. Game-specific palette files will be added as they are released. You'll have to get the actual games elsewhere.
How do I recolour a game?
A palette editor is available to enable you to create your own palettes. ZXSpin also has a built-in palette editor. The palette format is a BASIC file with an embedded machine code routine and the colour data. Just load the palette then load the game. Please submit any palettes you create for inclusion in this site to cheveron[at]gmail[dot]com. Improvements to existing palettes are also welcome.
Can I use it from BASIC?
Yes. Guesser has kindly produced a guide to using the mode in BASIC. Ref has kindly translated it into Turkish.
Is it just a simple palette swap?
Yes.
Is there a way for the Spectrum to automatically detect if ULAplus is present?
Yes. Write a palette register, PAUSE 1, and then read it back. If FFh is returned then it's a normal ULA. OUT 48955,0: OUT 65339,0: PAUSE 1: IN 65339 will return 00h if ULAplus is present.
Does it remove attribute clash?
No.
Are there any tools for converting 24-bit images?
Yes. AY Chip has created scrplus, a conversion tool for Linux which uses the SDL image library. It is still a work in progress, but already the results are excellent. Guesser has ported it to Windows, and Dunny has created MakeSlideshow for building slideshows. Note: you can only click Add once, but you can select multiple items.
Yes.
Is there a way for the Spectrum to automatically detect if ULAplus is present?
Yes. Write a palette register, PAUSE 1, and then read it back. If FFh is returned then it's a normal ULA. OUT 48955,0: OUT 65339,0: PAUSE 1: IN 65339 will return 00h if ULAplus is present.
Does it remove attribute clash?
No.
Are there any tools for converting 24-bit images?
Yes. AY Chip has created scrplus, a conversion tool for Linux which uses the SDL image library. It is still a work in progress, but already the results are excellent. Guesser has ported it to Windows, and Dunny has created MakeSlideshow for building slideshows. Note: you can only click Add once, but you can select multiple items.
Have I seen some of those screen shots before?
Tom-Cat has developed a tool-chain for converting hi-res Commodore 64 pics. If you ask him nicely on WoS he'll send you a copy.
Does ULAplus work on real hardware?
ULAplus is designed to work on real hardware. However, it has not been implemented yet.
How is the BORDER colour determined?
In the standard Spectrum display it is has the same value as the equivalent BRIGHT 0/FLASH 0 PAPER colour. In the Timex hi-res display it has the same value as the equivalent BRIGHT 1/FLASH 0 PAPER colour.
Does ULAplus support models besides the 48K?
In emulation all models are supported. In hardware you will need a different version depending on your machine. The 48K ULA will be the first model.
When can I get a real one to plug into my Spectrum?
When it's ready.
How will games that make active use of FLASH be affected?
FLASH doesn't work in the 64-colour mode. You get extra colours instead.
How do you turn on the 64-colour mode?
OUT 48955,64: OUT 65339,1.
Why is my screen black?
The hardware can't set the palette registers by itself. By default the whole palette is black. Set some colours before turning on 64-colour mode.
What drawing tools are available?
There's the palette editor and a 6-bit RGB palette for Artist III with more in development.
How many colours can I have on screen at once?
A static screen using no CPU time can have 64 colours on screen at once. Changing the palette while the screen is drawing enables you to have 256 colours on screen at once. Switching between the 64-colour mode and the standard mode gives you an additional four colours (BRIGHT 0/FLASH 0 INKs 1, 3, 5, and 7) which are not present in the standard palette for a total of 260 colours on screen.
Could Sinclair have done this back in the day?
Yes, but more than one ULA would have been required and it would have been much more complicated and therefore expensive. It would take "...gazillions of gates and flip-flops. 64 * 8 Flip-Flop/latches for the palette storage = 512, plus a 640 2-input-nor gates for the multiplexing (4*16*8 + 16*8 ). That would take 832 matrix cells of the ULA, plus the other necessary circuitry. The 5C000 ULA had 440 matrix cells in total, so you'd need at least two ULAs of that size. This is so impractical that external memory would have been required for the palette. Propagation delay will have been the major issue, leading to other colour effects similar to the two-levels-of-intensity effect and the edge-artifact with flashing cells. As devices are much larger and efficient these days, it is likely to fit into a reasonably cheap CPLD. Worse case, a small amount of external memory may be required, or FPGA is used instead, as this will have the internal memory required. The design has been proven, but not synthesized, so I don't know how big a CPLD/FPGA is required." -- Chris Smith.
How does ULAplus work and how do you get 256 colours on screen at once?
"It's not actually that complicated. Imagine there's a little imp, whose job it is to paint whatever is in the Spectrum's memory onto your TV. He starts at the top left of the screen, looks in the first screen memory location and discovers which colour he should be painting the first pixel. He then moves onto the second pixel on the first row, looks up the colour for that pixel, paints it, and moves on and on across the first row. When he's done all that, he has a little break, then moves onto the second row, and so on. On a normal Spectrum, the imp's got a paintbox which has 16 colours in it, and you can't give him new colours. The new ULA gives two new capabilities: firstly, it expands the imp's paintbox from 16 to 64 colours, and secondly it lets the programmer change the paintbox. The second effect is what's going on here: because the imp doesn't draw the entire screen at once, but takes a certain amount of time to do it, you can change his paintbox while he's in the middle of drawing the screen. If you switch his paintbox for a different one when he's a half way down the screen, he'll paint the lower half of the screen with different colours from the top half, and you can then switch it back again before he paints the top half. That gets you from 64 to 128 colours - to get to 256, you just need to switch his paintbox when he's 1/4, 1/2 and 3/4 of the way down the screen. (The new ULA has a limit of 256 colours it can ever display, so you can't do any better than that)." -- Philip Kendall
How many colours do you get in a remapped game without hacking?
From 17 to 32 colours in games that use BRIGHT, up to 64 for those that also use FLASH.
What about timings?
Standard ULA timings will not change. Timings for reading and writing the palette registers are unknown at this time.
Standard ULA timings will not change. Timings for reading and writing the palette registers are unknown at this time.
What about contention?
Don't spend hours creating wonderful colour effects via palette updates, as there will be contention to deal with in the real hardware.
Don't spend hours creating wonderful colour effects via palette updates, as there will be contention to deal with in the real hardware.
Will any soldering be required?
The aim is to have a simple plug-in replacement that can be fitted by anyone who is moderately competent with a screwdriver. Fiddlyness will be kept to a minimum.
The aim is to have a simple plug-in replacement that can be fitted by anyone who is moderately competent with a screwdriver. Fiddlyness will be kept to a minimum.
Does ULAplus clash with any existing hardware?
It clashes with the ZX Printer, and nothing else. This can be resolved by making sure the ZX Printer is fully decoded on port #FB, perhaps with a small hardware bridge.
It clashes with the ZX Printer, and nothing else. This can be resolved by making sure the ZX Printer is fully decoded on port #FB, perhaps with a small hardware bridge.
Will the specification change?
The specification is mature. It will not change unless it is absolutely necessary due to unforeseen issues with the hardware implementation.
The specification is mature. It will not change unless it is absolutely necessary due to unforeseen issues with the hardware implementation.
Will ULAplus support any extra modes?
Not unless there is a compelling reason to do so. However, the Timex screen modes will also work with ULAplus in the Harlequin clone.
Not unless there is a compelling reason to do so. However, the Timex screen modes will also work with ULAplus in the Harlequin clone.
What's a CLUT?
It's an acronym for Colour Look-Up Table. ULAplus uses four separate CLUTs, selected using the attribute bits formerly used to select BRIGHT and FLASH.
It's an acronym for Colour Look-Up Table. ULAplus uses four separate CLUTs, selected using the attribute bits formerly used to select BRIGHT and FLASH.
How was the 256 colour palette chosen?
The palette gives you half of the 9-bit RGB palette. It does this by using 8 levels for red and green but only 4 levels for blue. This is because the human eye is less sensitive to the colour blue. This palette was also used in the MSX.
Is there some way to enable FLASH?
Use palette cycling instead.
Site content Copyright (c) 2009 Andrew Owen. All rights reserved. The text on this site is licensed under the Creative Commons Attribution-Share Alike License 3.0 (Unported), except for the quote from Philip Kendall which is Copyright (c) 2009 Philip Kendall, and the quote from Chris Smith which is Copyright (c) 2009 Chris Smith.














