ZX Spectrum with 16 colors

Share graphical tips, notes and queries related to our favourite screen layout and its editors.
Post Reply
User avatar
Weiv
Microbot
Posts: 177
Joined: Fri Apr 06, 2018 5:28 pm
Location: Ukraine

ZX Spectrum with 16 colors

Post by Weiv »

While reading the comments on the fresh video about ZX Spectrum games on youtube, an idea came to mind. Instead of the bits of increased brightness and flashing, it was possible to make a normal 16-colour palette (4 bits per PAPER and per INK).
Questions arise:

1) what 8 colours would be worth adding to the basic Spectrum palette?
2) how much would it have complicated Spectrum's ULA?
3) what was Richard Altwasser's rationale for preferring an 8-colour palette with Flash and Bright?
4) why hasn't anyone implemented such an elementary extension of Spectrum's colour capabilities? After all, it's much simpler (and clearer) than ULAplus, for example. And with it, Spectrum turns into a much more colourful machine without any special tricks.
User avatar
PeterJ
Site Admin
Posts: 6879
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: ZX Spectrum with 16 colors

Post by PeterJ »

Hi @Weiv,

Similar options have been discussed previously. Just search for palette.

Best wishes

Peter
User avatar
1024MAK
Bugaboo
Posts: 3123
Joined: Wed Nov 15, 2017 2:52 pm
Location: Sunny Somerset in the U.K. in Europe

Re: ZX Spectrum with 16 colors

Post by 1024MAK »

Similar questions are asked why Acorn had only 8 colours plus 8 flashing colours on the BBC B microcomputer (a more expensive rival to the ZX Spectrum).

As Peter has said, this has been discussed before.

But to answer some of your questions:

2) the ULA is supposed to be a digital chip, extra colours would have needed even more tricks with the output pin circuitry in the ULA to try to get more useful colours. It’s not entirely clear how easy this would be, if indeed it is possible.
And all the pins are in use, so mixing the colours externally is not an option if the low price was to be maintained.
Also keep in mind that the design was put together rather quickly. The requirement was for the computer to have a colour video output. This requirement was met.

4) unless there is a software switch, such an extension would not be backwards compatible.

Mark
:!: Standby alert :!:
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :dance
Looking forward to summer later in the year.
User avatar
Weiv
Microbot
Posts: 177
Joined: Fri Apr 06, 2018 5:28 pm
Location: Ukraine

Re: ZX Spectrum with 16 colors

Post by Weiv »

1024MAK wrote: Sat Apr 22, 2023 11:14 pm As Peter has said, this has been discussed before.
I assumed so.
2) the ULA is supposed to be a digital chip, extra colours would have needed even more tricks with the output pin circuitry in the ULA to try to get more useful colours. It’s not entirely clear how easy this would be, if indeed it is possible.
And all the pins are in use, so mixing the colours externally is not an option if the low price was to be maintained.
Also keep in mind that the design was put together rather quickly. The requirement was for the computer to have a colour video output. This requirement was met.
Thanks. So it was not so easy to do.
4) unless there is a software switch, such an extension would not be backwards compatible.
Of course it could be switchable mode. Like one of 128k improvements :)
User avatar
1024MAK
Bugaboo
Posts: 3123
Joined: Wed Nov 15, 2017 2:52 pm
Location: Sunny Somerset in the U.K. in Europe

Re: ZX Spectrum with 16 colors

Post by 1024MAK »

So, if we ignore the limitations of the 1982 ULA design for the ZX Spectrum and the aim of very low cost (say for example by using two ULA chips instead of one, and the same colour encoder video chip from the 128K toastrack)…

The most useful extra colours would be orange, brown, light brown, light/creamy pink (or as close to flesh tone as possible), two extra shades of green, grey and light blue. Yes, some Commodore 64 colours! :lol:

BTW, in terms of “easy” extras, flash and bright are in this category. Both were fairly easy to include in the design. I can’t remember if hardware flash was a requirement.

Mark
:!: Standby alert :!:
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :dance
Looking forward to summer later in the year.
User avatar
PeterJ
Site Admin
Posts: 6879
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: ZX Spectrum with 16 colors

Post by PeterJ »

Some interesting conversations start here @Weiv:

viewtopic.php?p=46459#p46459
dfzx
Manic Miner
Posts: 683
Joined: Mon Nov 13, 2017 6:55 pm
Location: New Forest, UK
Contact:

Re: ZX Spectrum with 16 colors

Post by dfzx »

Weiv wrote: Sat Apr 22, 2023 10:40 pm 3) what was Richard Altwasser's rationale for preferring an 8-colour palette with Flash and Bright?
You have to remember that Sir Clive envisaged the Spectrum as a business machine. The ability to easily do things like highlight the result of a calculation in bright, or to flash an anomaly in some data, would have been seen as useful in that context.
Derek Fountain, author of the ZX Spectrum C Programmer's Getting Started Guide and various open source games, hardware and other projects, including an IF1 and ZX Microdrive emulator.
User avatar
Weiv
Microbot
Posts: 177
Joined: Fri Apr 06, 2018 5:28 pm
Location: Ukraine

Re: ZX Spectrum with 16 colors

Post by Weiv »

PeterJ wrote: Sun Apr 23, 2023 8:08 am Some interesting conversations start here @Weiv:

viewtopic.php?p=46459#p46459
Thank you. That's good :
Image
User avatar
Weiv
Microbot
Posts: 177
Joined: Fri Apr 06, 2018 5:28 pm
Location: Ukraine

Re: ZX Spectrum with 16 colors

Post by Weiv »

dfzx wrote: Sun Apr 23, 2023 10:11 am You have to remember that Sir Clive envisaged the Spectrum as a business machine. The ability to easily do things like highlight the result of a calculation in bright, or to flash an anomaly in some data, would have been seen as useful in that context.
I never heard that Sir Clive envisaged the Spectrum as a business machine, I read that it was for learning programming.
User avatar
TMD2003
Rick Dangerous
Posts: 2045
Joined: Fri Apr 10, 2020 9:23 am
Location: Airstrip One
Contact:

Re: ZX Spectrum with 16 colors

Post by TMD2003 »

Weiv wrote: Sun Apr 23, 2023 10:43 am I never heard that Sir Clive envisaged the Spectrum as a business machine, I read that it was for learning programming.
On that note, it sucsessed spectacurary.

Which brings us to the QL, the actual business machine: if the idea of BRIGHT and FLASH was to highlight anomalies in a (very small) Powerpoint-style presentation, the QL had neither of these, and only eight colours - or four in the high resolution mode, which all the Psion business software uses. QL-Abacus uses a black background, white text, green highlights on all the row and column markers, red highlights for the current cell, and that's really all you need. So I don't really buy the idea that the Spectrum's BRIGHT and FLASH were for the same purpose.
Spectribution: Dr. Jim's Sinclair computing pages.
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!
User avatar
1024MAK
Bugaboo
Posts: 3123
Joined: Wed Nov 15, 2017 2:52 pm
Location: Sunny Somerset in the U.K. in Europe

Re: ZX Spectrum with 16 colors

Post by 1024MAK »

I don’t know for certain where the idea or requirement (if there was one) came from. But some influence may have come from “dumb” terminals, some of which had additional attributes. Or from teletext.

As an example, some “dumb” terminals had:
  • reverse video
  • normal video
  • bold mode
  • low intensity mode
  • underline mode
  • blinking mode
Teletext has control codes for red, green, yellow, blue, magenta, cyan, white. Plus a flash control code.

Mark
:!: Standby alert :!:
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :dance
Looking forward to summer later in the year.
AndyC
Dynamite Dan
Posts: 1409
Joined: Mon Nov 13, 2017 5:12 am

Re: ZX Spectrum with 16 colors

Post by AndyC »

The spectrum colours come from a very simple combination of RGB, the bright bit adding just a single additional signal. Which is, I suspect, the reason you get those particular colours (anything else would require some sort of translation to a specific palette).

Flashing cursors were commonplace at the time too, so being able to do this in hardware might have seemed advantageous over a software solution.
dfzx
Manic Miner
Posts: 683
Joined: Mon Nov 13, 2017 6:55 pm
Location: New Forest, UK
Contact:

Re: ZX Spectrum with 16 colors

Post by dfzx »

1024MAK wrote: Sun Apr 23, 2023 7:00 pm As an example, some “dumb” terminals had:
  • reverse video
  • normal video
  • bold mode
  • low intensity mode
  • underline mode
  • blinking mode
Yes, pretty much up until the advent of the Spectrum that's how business machines worked - hardware support for character attributes. A very short time later, even into the QL timeframe as Jim says, the idea has already been dropped in favour of high resolution graphics. The Spectrum was caught in the middle ground and had at least some support for both old and new approaches.

Maybe it could be argued that the Spectrum was where the game changed. Once high resolution graphics appeared, the need for character attributes was identified as obsolete.
Derek Fountain, author of the ZX Spectrum C Programmer's Getting Started Guide and various open source games, hardware and other projects, including an IF1 and ZX Microdrive emulator.
User avatar
+3code
Manic Miner
Posts: 434
Joined: Sat Mar 19, 2022 7:40 am

Re: ZX Spectrum with 16 colors

Post by +3code »

1024MAK wrote: Sun Apr 23, 2023 7:00 pm I don’t know for certain where the idea or requirement (if there was one) came from.
Totally speculative, but maybe from the ''BBC Computer Literacy Project'' or something similar?
User avatar
Lee Bee
Dynamite Dan
Posts: 1297
Joined: Sat Nov 16, 2019 11:01 pm
Location: Devon, England
Contact:

Re: ZX Spectrum with 16 colors

Post by Lee Bee »

If I could 'improve' the Spectrum's colours, I'd add JUST TWO new colours, which I feel are sorely lacking from the Spectrum. The palette would look like this:

Image

How my system works:

• Like before, the PAPER and INK colour values are still only 3-bit (8 possible colours). However, if a tile has the same PAPER and INK colour, the PAPER will display as Sky.

• You still have the BRIGHT flag which can still be either HALF BRIGHT or BRIGHT (bottom two rows on the image above).

• The FLASH flag is scrapped, and replaced with a new flag called 'ADVANCED'. If a tile is ADVANCED, black is replaced with Brown, and every pixel is now 2-bit with 4 options:
          0 = Pixel is black
          1 = Pixel is INK colour
          2 = Pixel is PAPER colour
          3 = Pixel is PAPER colour only brighter

• In order to get an extra-bright colour (top row on the image above), a tile must be both BRIGHT and ADVANCED, which will allow you to have an extra-bright version of the PAPER colour. The INK can never be extra-bright.
AndyC
Dynamite Dan
Posts: 1409
Joined: Mon Nov 13, 2017 5:12 am

Re: ZX Spectrum with 16 colors

Post by AndyC »

Lee Bee wrote: Tue May 02, 2023 10:40 pm If I could 'improve' the Spectrum's colours, I'd add JUST TWO new colours, which I feel are sorely lacking from the Spectrum. The palette would look like this:

Image

How my system works:

• Like before, the PAPER and INK colour values are still only 3-bit (8 possible colours). However, if a tile has the same PAPER and INK colour, the PAPER will display as Sky.

• You still have the BRIGHT flag which can still be either HALF BRIGHT or BRIGHT (bottom two rows on the image above).

• The FLASH flag is scrapped, and replaced with a new flag called 'ADVANCED'. If a tile is ADVANCED, black is replaced with Brown, and every pixel is now 2-bit with 4 options:
          0 = Pixel is black
          1 = Pixel is INK colour
          2 = Pixel is PAPER colour
          3 = Pixel is PAPER colour only brighter

• In order to get an extra-bright colour (top row on the image above), a tile must be both BRIGHT and ADVANCED, which will allow you to have an extra-bright version of the PAPER colour. The INK can never be extra-bright.
I'm not entirely sure I've grasped that, it's pretty complicated, but assuming have it right I can see some issues:
  • All the areas of "sky" have to be mono-coloured rectangles. Maybe ok for some static images but pretty limiting otherwise - you couldn't display a yellow sun surrounded by sky for example, or have sky coloured background in a racing game.
  • Similarly, brown areas are going to end up looking very rectangular. It's marginally better in the you can kind of blend it with another colour although you'd have to do it with low Res pixels that everyone bemoans on other machines.
  • You lose the ability to have a black INK/PAPER combo, which lots of games use for screen masking at the edges and that means graphics are more likely to "pop" into existence (look at the original Amstrad port of R-Type and compare the right hand side of the screen to the Speccy original)
  • For "advanced" characters, you're going to have lower Res pixels which is going to complicate BASIC. Not necessarily an issue for games but Sinclair wanted everything to be accessible to beginners
  • I'd imagine the hardware to decide such a scheme would be massively more complex than simply having a definable palette of colours, as other machines did.
User avatar
4thRock
Manic Miner
Posts: 415
Joined: Thu Nov 09, 2017 9:35 am
Location: Portugal

Re: ZX Spectrum with 16 colors

Post by 4thRock »

The Spectrum used a 4-bit RGBI (Red, Green, Blue, Intensity) hardware palette. There are 3 ways of displaying it, with increasing hardware complexity:

A - most basic implementation)
Intensity changes brightness, like on the Spectrum.
Another simple possibility is to change saturation . The Thomson MO5 and TO7 did this, with the Intensity bit giving "saturated" or "pastel" colours.

B - a step further in complexity)
The Intensity bit changes brightness and saturation. The Mattel Aquarius did this, with a 75% luminance decrease for white, creating gray, and a 50% saturation decrease for all other colours.

C - even more complex )
Setting the intensity bit adds ⅓ of the maximum to all three channels' brightness, so the "bright" colors are whiter shades of their 3-bit counterparts. Each of the other bits increases a channel by ⅔, except that dark yellow had only ⅓ green and is therefore brown instead of ochre. CGA used this solution, creating the well-known CGA 16 color palette.

Other options, like definable palettes, are more complex and move away from the simple 4-bit RGBI concept.
User avatar
Lee Bee
Dynamite Dan
Posts: 1297
Joined: Sat Nov 16, 2019 11:01 pm
Location: Devon, England
Contact:

Re: ZX Spectrum with 16 colors

Post by Lee Bee »

AndyC wrote: Wed May 03, 2023 8:49 am I'm not entirely sure I've grasped that, it's pretty complicated, but assuming have it right I can see some issues:
Thanks for the excellent feedback! :-) It is kind of complicated, but once you get your head round it, it's kind of simple.

To clarify, you can definitely have Sky or Brown with any other colour. If you wanted Sky and Yellow, just make both the Paper and Ink yellow, and the paper will show as Sky! :-) If you want Brown and Green, then set the colours to Black and Green, set the tile to "advanced", and Black will show as Brown.

As for "advanced" tiles having low-res pixels, that's not a bad idea, though my idea was that "advanced" tiles would be full resolution but use twice the amount of data. So you wouldn't be able to have as many "advanced" graphics, but they would come in useful here and there.

The screen masking issue is valid, but if I were going to change the Speccy's colours then I'd probably also provide a way of masking, probably a hardware one. This is a fantasy, after all.
AndyC
Dynamite Dan
Posts: 1409
Joined: Mon Nov 13, 2017 5:12 am

Re: ZX Spectrum with 16 colors

Post by AndyC »

Ah, I see what you're saying, so when INK and PAPER match you get that colour as INK and "Sky" as PAPER. I doubt Clive would have gone for a design like that (complexity in hardware aside) because it would be even harder to explain what's going on when you draw coloured lines in BASIC than it already is - you'd get random blocks of "sky" whenever the same colours overlapped - and I do think BASIC was considered more important at the time.

As for using more memory for "advanced" tiles, I suspect that's a non-starter really. Either you have to have them in-line in the display file, which makes address calculation an absolute nightmare (because "next line down" now depends on what colour things are on screen) or you essentially have to mirror the current arrangement onto another 7K of video memory. And given that you'd have to have bus bandwidth to read RAM at twice the rate anyway, you might just as well apply it across the entire screen and effectively get four selectable colours per attribute square.
User avatar
1024MAK
Bugaboo
Posts: 3123
Joined: Wed Nov 15, 2017 2:52 pm
Location: Sunny Somerset in the U.K. in Europe

Re: ZX Spectrum with 16 colors

Post by 1024MAK »

AndyC wrote: Wed May 03, 2023 8:49 am
  • I'd imagine the hardware to decide such a scheme would be massively more complex than simply having a definable palette of colours, as other machines did.
Keep in mind when comparing complexity, a definable palette requires fast SRAM or registers inside the ULA, which eats up ULA resources.

I do agree though, @Lee Bee scheme is a bit too complex for my liking. Remember, as well as Sinclair wanting it to be simple and straightforward to use from BASIC, there is also the question of what ULA resources were still available in the type of ULA that was used in issue one and issue two machines (later ULAs did have the potential for more complex circuitry, but that was never actually needed or used).

And as I’ve previously said, the ULA is intended as a digital chip. The “analogue” video output pins (which were intended only for digital outputs) used clever use of the output buffer stage transistors to produce the “analogue” video signals. I’m not sure if it is possible to get more analogue voltages from them.

On the ULA used in the 128K toastrack and +2 (grey), it is certainly possible to do something different to get more colours, because these have digital RGB + bright output pins. Hence some extra circuitry can in theory be introduced.

Mark
:!: Standby alert :!:
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :dance
Looking forward to summer later in the year.
User avatar
4thRock
Manic Miner
Posts: 415
Joined: Thu Nov 09, 2017 9:35 am
Location: Portugal

Re: ZX Spectrum with 16 colors

Post by 4thRock »

(can't edit my last post, so let me add this here)

Original colour test chart:
Image

Test chart under 4-bit RGBI (Red, Green, Blue, Intensity) 16-colour hardware palettes (no dithering):

A - most basic implementation - Spectrum | Thomson MO5/TO7
Image Image

B - a step further in complexity - Mattel Aquarius
Image

C - even more complex - CGA
Image
Post Reply