Colour clash query

For experts to discuss very technical stuff and newbies to ask why the Spectrum they bought off ebay doesn't work.
Bolton80
Microbot
Posts: 103
Joined: Thu Sep 01, 2022 9:06 am
Location: London, England

Colour clash query

Post by Bolton80 »

Probably discussed loads of times already, but I'm curious. If a bit more time and effort was spent on designing the Speccy in 1982, could colour clash have potentially been eliminated? Or is it a more fundamental design flaw of the Spectrum hardware?
User avatar
ParadigmShifter
Manic Miner
Posts: 671
Joined: Sat Sep 09, 2023 4:55 am

Re: Colour clash query

Post by ParadigmShifter »

It was done to save memory for the screen layout.

I think some Russian enhanced clones used more memory for more attribute memory.

Amstrad screen used 16K speccy only uses 6912 bytes = 6.75K. That means you need to write a lot less data around to fill the screen as well.
zx64
Manic Miner
Posts: 211
Joined: Sat Jul 11, 2020 3:25 am
Location: Australia

Re: Colour clash query

Post by zx64 »

Memory is one reason. Very first Spectrums only had 16K.

Also, completely eliminating color clash would increase traffic between ULA and lower RAM - more delays for CPU
User avatar
TMD2003
Rick Dangerous
Posts: 2045
Joined: Fri Apr 10, 2020 9:23 am
Location: Airstrip One
Contact:

Re: Colour clash query

Post by TMD2003 »

Don't worry, get a Next! That's got no colour clash for the same resolution (if you're using LAYER 2), with 256 colours available on screen at a time...

...only thing is, that takes up 48K. Yes, an entire rubber-key's worth of memory just for the screen. Which was a problem then. It isn't now.

Isn't (some) technological progress marvellous?
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
ParadigmShifter
Manic Miner
Posts: 671
Joined: Sat Sep 09, 2023 4:55 am

Re: Colour clash query

Post by ParadigmShifter »

Many art assets these days can be 64MB+ in size since the artists don't like (lossless compression) PNG since the transparency layer is "kind of undefined" so here's a 4096x4096 texture with 32 bit colour depth so 48K is not an issue these days no lol ;)
berarma
Microbot
Posts: 106
Joined: Thu Mar 09, 2023 10:55 am

Re: Colour clash query

Post by berarma »

It's a fundamental design feature. It saved memory, made the computer faster without needing special hardware, and also cheaper. Removing colour clash would have compromised all these.

Think it was conceived as a personal business computer, not a gaming computer. Thus the screen optimized for character based display.
zx64
Manic Miner
Posts: 211
Joined: Sat Jul 11, 2020 3:25 am
Location: Australia

Re: Colour clash query

Post by zx64 »

berarma wrote: Tue Dec 12, 2023 1:24 am It's a fundamental design feature.
Indeed. They even have patent for this.
catmeows
Manic Miner
Posts: 718
Joined: Tue May 28, 2019 12:02 pm
Location: Prague

Re: Colour clash query

Post by catmeows »

With more silicon they could have something like Radastan mode (128*96 16 colors). But it would make ZX more expensive.
Proud owner of Didaktik M
RST#08
Drutt
Posts: 30
Joined: Sun Jul 24, 2022 6:29 pm

Re: Colour clash query

Post by RST#08 »

zx64 wrote: Tue Dec 12, 2023 1:51 am Indeed. They even have patent for this.
Yep, here it is:
https://patents.google.com/patent/EP010 ... Ltd&page=3
User avatar
Lethargeek
Manic Miner
Posts: 744
Joined: Wed Dec 11, 2019 6:47 am

Re: Colour clash query

Post by Lethargeek »

zx64 wrote: Mon Dec 11, 2023 11:10 pm Memory is one reason. Very first Spectrums only had 16K.

Also, completely eliminating color clash would increase traffic between ULA and lower RAM - more delays for CPU
4-colours no-attribute mode (similar to what cpc had) would have the same amount of traffic
hovewer, 12k just for the screen was out of question for 16k model (which was a mistake in itself if you ask me)
with an extra/bigger ULA a low-res 4-colours attribute mode was possible (even mix hi-res and lo-res tiles on the same screen)
this would take both the same amount of memory for the screen and traffic at some extra cost
AndyC
Dynamite Dan
Posts: 1409
Joined: Mon Nov 13, 2017 5:12 am

Re: Colour clash query

Post by AndyC »

Everything on 8-bit machines was an active compromise somewhere. You could use a lot of screen RAM and take the hit on performance, like the CPC. Or you could go for a mostly text/tile oriented display like the C64, but pay the price in terms of flexibility to some extent.

Sinclair seemed to be keen on two features: high resolution graphics and some sort of colours on the screen. The attribute system is a sort of halfway house between the CPC and C64 models and a reasonable compromise as long as you mostly only care about colour for text purposes.
User avatar
Oloturia
Manic Miner
Posts: 476
Joined: Sat Jan 15, 2022 9:11 pm

Re: Colour clash query

Post by Oloturia »

OK maybe I'm a bit naïve, but what about the expansion port?
I recently bought a converter that adds a VGA port to the Spectrum, so in that port there are video signals. Could it be used, even with vivid imagination, to add some colour overlay?
Yes probably the cost would be high, but people bought peripherals that often were more expensive than computers themselves.
AndyC
Dynamite Dan
Posts: 1409
Joined: Mon Nov 13, 2017 5:12 am

Re: Colour clash query

Post by AndyC »

Oloturia wrote: Tue Dec 12, 2023 9:53 am OK maybe I'm a bit naïve, but what about the expansion port?
I recently bought a converter that adds a VGA port to the Spectrum, so in that port there are video signals. Could it be used, even with vivid imagination, to add some colour overlay?
Yes probably the cost would be high, but people bought peripherals that often were more expensive than computers themselves.
Well the expansion port is essentially all the signals from the Z80 Plus a few extra bits. You could theoretically add just about anything too it.

But you'd have to write entirely new software for it. There isn't any capacity in how the spectrum actually stores "what is on the screen" to obtain more data than is there. I.e. it's not the case that the hardware is being told "this pixel should be green" but is having to display something else.

Now, that said, there have been varying attempts over the years to try and throw much more powerful hardware at it and use that to try and "guess" what the best outcome should be. It works to varying degrees, but it's not something that could have been done practically back in the day (the hardware is vastly more complicated than just supporting a totally different video display). And for software whee it guesses wrong, the results are usually much worse than just colour clashing.
User avatar
clebin
Manic Miner
Posts: 979
Joined: Thu Jun 25, 2020 1:06 pm
Location: Vale of Glamorgan
Contact:

Re: Colour clash query

Post by clebin »

I used to think that colour clash was just an unfortunate design decision, rather than an inevitable result of having a higher resolution display. Eventually I learned that the best of Spectrum, CPC & C64 worlds was incompatible with the hardware that was available back then (at a reasonable price anyway). It gave me new appreciation for the Speccy's design. I'm so glad they didn't opt for a 4-colour high-res mode like the CPC, because it looks very plain and ugly to me in most cases.

One thing I think most people agree is that FLASH is a waste of a precious bit. Having BRIGHTINK and BRIGHTPAPER bits would have been a huge graphical upgrade, and I'm sure it would have opened up loads of interesting ways to disguise colour clash. But that's the legacy of Sir Clive wanting a "serious" computer.
User avatar
Lethargeek
Manic Miner
Posts: 744
Joined: Wed Dec 11, 2019 6:47 am

Re: Colour clash query

Post by Lethargeek »

AndyC wrote: Tue Dec 12, 2023 9:27 am Everything on 8-bit machines was an active compromise somewhere. You could use a lot of screen RAM and take the hit on performance, like the CPC. Or you could go for a mostly text/tile oriented display like the C64, but pay the price in terms of flexibility to some extent.
doesn't mean better compromises were impossible
AndyC wrote: Tue Dec 12, 2023 9:27 am Sinclair seemed to be keen on two features: high resolution graphics and some sort of colours on the screen. The attribute system is a sort of halfway house between the CPC and C64 models and a reasonable compromise as long as you mostly only care about colour for text purposes.
but more importantly, he seemed even more keen on extreme cost-cutting (that not always paid off in the long run)
User avatar
Lethargeek
Manic Miner
Posts: 744
Joined: Wed Dec 11, 2019 6:47 am

Re: Colour clash query

Post by Lethargeek »

AndyC wrote: Tue Dec 12, 2023 10:19 am Well the expansion port is essentially all the signals from the Z80 Plus a few extra bits. You could theoretically add just about anything too it.

But you'd have to write entirely new software for it. There isn't any capacity in how the spectrum actually stores "what is on the screen" to obtain more data than is there. I.e. it's not the case that the hardware is being told "this pixel should be green" but is having to display something else.
Not entirely new, just a small patch/driver could be enough. And for this you don't need to know "what IS on the screen", but "what IS BEING PUT on the screen" all the time. This is how the ULAX logic works.
AndyC wrote: Tue Dec 12, 2023 10:19 am Now, that said, there have been varying attempts over the years to try and throw much more powerful hardware at it and use that to try and "guess" what the best outcome should be. It works to varying degrees, but it's not something that could have been done practically back in the day (the hardware is vastly more complicated than just supporting a totally different video display). And for software whee it guesses wrong, the results are usually much worse than just colour clashing.
as i said, no need to guess, just a little hack
but i agree about the impractical (at the time) cost
User avatar
Joefish
Rick Dangerous
Posts: 2059
Joined: Tue Nov 14, 2017 10:26 am

Re: Colour clash query

Post by Joefish »

Cost-cutting meant keeping the size of the ULA down. Adding alternate screen modes would have needed a bigger ULA chip, so one fixed mode made things a lot cheaper.

These modern expansion devices monitor the expansion ports and can detect when data is written to the screen memory. They then keep their own copy of that memory and generate their version of the screen from that. Way back when this would have meant the interface would need 16K of RAM and its own version of the ULA, plus supporting logic chips, and would have been pretty expensive. So much so that it wouldn't have been anywhere near popular enough to target with dedicated software.

About the only practical option for an upgrade would have been to add a Timex-style 8x1 attribute mode (with maybe, at a stretch, two BRIGHT bits or half-green bits to expand the palette) on the 128K's ULA. This wouldn't eliminate colour clash, but would allow for more colourful games. The very minimal option of 8x1 attributes would only have needed a minor modification to the ULA (Timex managed it), but if the ULA was already maxed out then even that may not have been possible. Really though the 128K design was really just a minimal rush-job to throw in some extra memory to get around peculiar Spanish tax laws!

Within the same memory footprint and ULA capability as the regular screen, you could perhaps pair up pixels to make a fatter pixel 4-colour screen, with 2 colours from the attributes and the other 2 fixed for the whole screen. But you'd need a completely different ULA, or one twice the size to operate two different modes. Or you could have a 12K screen with two bits per pixel held in two separate 6K 'bitplanes' (Timex hi-res mode does this to double the number of horizontal pixels, but it could be used for 2-bits per normal-sized pixel). But then there'd be no time left in the ULA operations for a third 'fetch' to read any attributes, so it'd be a fixed four-colour screen. And it'd take longer to redraw in a game, as the Amstrad suffers from.

Hardware sprites are right out though. Then you're into dedicated hardware chips; too much to implement on a ULA.
User avatar
Lethargeek
Manic Miner
Posts: 744
Joined: Wed Dec 11, 2019 6:47 am

Re: Colour clash query

Post by Lethargeek »

Joefish wrote: Tue Dec 12, 2023 10:55 am About the only practical option for an upgrade would have been to add a Timex-style 8x1 attribute mode (with maybe, at a stretch, two BRIGHT bits or half-green bits to expand the palette) on the 128K's ULA. This wouldn't eliminate colour clash, but would allow for more colourful games. The very minimal option of 8x1 attributes would only have needed a minor modification to the ULA (Timex managed it), but if the ULA was already maxed out then even that may not have been possible. Really though the 128K design was really just a minimal rush-job to throw in some extra memory to get around peculiar Spanish tax laws!
wasn't there better/cheaper tech available in 1986? so something like
Lethargeek wrote: Tue Dec 12, 2023 8:55 am a low-res 4-colours attribute mode was possible (even mix hi-res and lo-res tiles on the same screen)
was possible that eliminates the colour clash - at the cost of resolution, but at the same time it makes some game conversions much easier
Joefish wrote: Tue Dec 12, 2023 10:55 am Within the same memory footprint and ULA capability as the regular screen, you could perhaps pair up pixels to make a fatter pixel 4-colour screen, with 2 colours from the attributes and the other 2 fixed for the whole screen. But you'd need a completely different ULA, or one twice the size to operate two different modes. Or you could have a 12K screen with two bits per pixel held in two separate 6K 'bitplanes' (Timex hi-res mode does this to double the number of horizontal pixels, but it could be used for 2-bits per normal-sized pixel). But then there'd be no time left in the ULA operations for a third 'fetch' to read any attributes, so it'd be a fixed four-colour screen. And it'd take longer to redraw in a game, as the Amstrad suffers from.
definitely not "completely" different and definitely not "twice the size"
would need only some extra logic for colour selection on lo-res tiles
Ralf
Rick Dangerous
Posts: 2289
Joined: Mon Nov 13, 2017 11:59 am
Location: Poland

Re: Colour clash query

Post by Ralf »

Probably the best way to deal with colour clash without serious increase of the screen memory would be hardware sprites.

You could even keep the background as it is, with the clash rules. It would have its limitations but with clever design most people
wouldn't even notice it.

The worst clash happened when you had to move sprites. They were either "transparent" and taking colour of the background or the
"bleeding" and giving colour to background.

But it would make everything more complicated and expensive.
And Spectrum was supposed to be an educational machine. You were supposed to write programs in Basic on it, which didn't
support sprites anyway.
AndyC
Dynamite Dan
Posts: 1409
Joined: Mon Nov 13, 2017 5:12 am

Re: Colour clash query

Post by AndyC »

Lethargeek wrote: Tue Dec 12, 2023 10:52 am Not entirely new, just a small patch/driver could be enough. And for this you don't need to know "what IS on the screen", but "what IS BEING PUT on the screen" all the time. This is how the ULAX logic works.
ULAX is, as far as old software not written for it, entirely based on guesswork. Sure it's educated guesswork, based on studying lots of existing code, but it's still seeing a sequence of changes and makinba big assumption about what the end result should be on screen as a result. And any system that does that can easily be broken by code that takes the pathological opposite approach to updating the screen. This isn't a criticism of the hardware, it's just the reality of trying to interpret intent from code than never entirely had to express it in the first place.

Now software that is written explicitly for ULAX (or modified for it), knowing how it works, can obviously accomplish more but then you're into "write new software" territory rather than simply working as it was.
AndyC
Dynamite Dan
Posts: 1409
Joined: Mon Nov 13, 2017 5:12 am

Re: Colour clash query

Post by AndyC »

Lethargeek wrote: Tue Dec 12, 2023 11:08 am was possible that eliminates the colour clash - at the cost of resolution, but at the same time it makes some game conversions much easier
Sure, but then you get "fat pixels". If you ask me, that's a reasonable compromise - but then I think CPC Mode 0 graphics look good, not everyone agrees.
User avatar
Lethargeek
Manic Miner
Posts: 744
Joined: Wed Dec 11, 2019 6:47 am

Re: Colour clash query

Post by Lethargeek »

AndyC wrote: Tue Dec 12, 2023 11:30 am ULAX is, as far as old software not written for it, entirely based on guesswork. Sure it's educated guesswork, based on studying lots of existing code, but it's still seeing a sequence of changes and makinba big assumption about what the end result should be on screen as a result. And any system that does that can easily be broken by code that takes the pathological opposite approach to updating the screen. This isn't a criticism of the hardware, it's just the reality of trying to interpret intent from code than never entirely had to express it in the first place.

Now software that is written explicitly for ULAX (or modified for it), knowing how it works, can obviously accomplish more but then you're into "write new software" territory rather than simply working as it was.
No, you're completely wrong. Analysis is not limited to "guesswork" (although taking guesses and then checking the immediate result - so no "assumptions" - usually makes things faster). For 100% analysis the end result is 100% deterministic (but in practice there's no need to dive too deep).
User avatar
Lethargeek
Manic Miner
Posts: 744
Joined: Wed Dec 11, 2019 6:47 am

Re: Colour clash query

Post by Lethargeek »

AndyC wrote: Tue Dec 12, 2023 11:32 am Sure, but then you get "fat pixels"
just like many other systems games asking to be ported/converted ;)
berarma
Microbot
Posts: 106
Joined: Thu Mar 09, 2023 10:55 am

Re: Colour clash query

Post by berarma »

Lethargeek wrote: Tue Dec 12, 2023 10:39 am doesn't mean better compromises were impossible


but more importantly, he seemed even more keen on extreme cost-cutting (that not always paid off in the long run)
Better for what?

This computer wasn't made for games although that's what it ended being most used for. It was the best and the cheapest for the task Sinclair had in mind. And let's not forget it was a success. So many things were right in the design, even those seen as flaws made it affordable and relatively fast for its very modest hardware.

I don't think they could have done better without increasing significantly its price or sacrificing some features. This was 1982, let's not forget.
User avatar
Lethargeek
Manic Miner
Posts: 744
Joined: Wed Dec 11, 2019 6:47 am

Re: Colour clash query

Post by Lethargeek »

berarma wrote: Tue Dec 12, 2023 12:55 pm Better for what?
for overall user experience
berarma wrote: Tue Dec 12, 2023 12:55 pm This computer wasn't made for games although that's what it ended being most used for. It was the best and the cheapest for the task Sinclair had in mind.
you can't be sure what exactly Sinclair had in his mind
berarma wrote: Tue Dec 12, 2023 12:55 pm And let's not forget it was a success.
and let's not forget that "success" is relative
berarma wrote: Tue Dec 12, 2023 12:55 pm So many things were right in the design, even those seen as flaws made it affordable and relatively fast for its very modest hardware.

I don't think they could have done better without increasing significantly its price or sacrificing some features. This was 1982, let's not forget.
oh, they definitely could have done better even in 1982
like, no contention or more convenient screen addressing
...and then there was a chance in 1986
Post Reply