9 ms·
Colour Clash: The Engineering Miracle of the Sinclair ZX Spectrum
- ddingus 8y agoAnother option is to use the attributes directly. Routines have been made to deliver 64 x scanline "pixels", essentially creating an Apple 2 like lowres display.
- ddingus 8y agoAsk Jim Bagley about doing that. :D
- dang 8y agoAlso https://paleotronic.com/2018/10/01/an-interview-with-zx-spectrum-designer-richard-altwasser/ https://paleotronic.com/2018/10/01/an-interview-with-zx-spec... (via https://news.ycombinator.com/item?id=18106246 https://news.ycombinator.com/item?id=18106246).
- mikorym 8y agoNo pics of its screen?
- chx 8y agoI learned programming on a ZX Spectrum 48K my parents smuggled into Hungary in 1985 summer at ten years old. I have since become a senior software architect and the Speccy will always have a special place in my heart. it's been quite the journey.
- shodan666 8y agoWorth to mention that it was NOT the communist "regime" who forbade citizens of Eastern Block to own personal computers but... USA under the Coordinating Committee for Multilateral Export Controls (COCOM) who banned import of personal computers or transistors to eastern block...
- chx 8y agoThe Commodore 64 (and I suspect the Spectrum 48K too) got off the COCOM list in 1985 -- but the legally available C64 in Hungary was beyond the means of individuals at the time. It was more used by corporations (well, what went for corporations at the time). OTOH my parents got the ZX Spectrum in Munich heavily discounted because by then it was several years old and did not count as particularly modern. The Amiga 1000 was already released even if not yet widely available. A community center in an outer district of Budapest have organized a "micro club" every week, I can't find a definite date of when it started, this photo is titled "some time around 1986" http://gpsgames.hu/data/games/2796/2796_1.jpg http://gpsgames.hu/data/games/2796/2796_1.jpg Every Friday people would haul their various microcomputers to this place and swap programs and chat. Copyright ... we kind of knew it was not "legal" but noone cared. Those were the days.
- forapurpose 8y agoThat may have been true, but IIRC the Soviet totalitarian dictatorships also tightly controlled access to communication and content creation devices. Fax and copy machines were tightly controlled to prevent unwanted communication and underground newsletters, for example. In fact, I read that one reason for the opening up of the USSR under Gorbachev was that the Soviets realized that they couldn't both maintain a totalitarian dictatorship and keep up in information technology. (I read this stuff awhile ago and my memory of the details is vague. For example, I don't know if those policies existed in Hungary specifically.)
- flohofwoe 8y agoThis is definitely true, at least for Eastern Germany where I grew up. The best you could get as a 'citizen' was a typewriter. Any sort of printing or copying machine was off-limits (edit: at least until the mid-80's, you could definitely buy a 9-needle-printer, but those things were scarce and expensive, I remember that I sent cassette tapes with source code via snail-mail halfway through the country to a guy who had access to a printer, and a few weeks later I got the printed listings sent back) :D East Germany put a lot of effort into tech-education though. The "glorious leadership" realized that they were quickly falling behind in high-technology during the 70's, and they actually tried to fix this. Most of the 8-bit computers that Eastern Germany started to manufacture in '84 were former 'grass-roots' designs done by hardware engineers as side projects. When the government desperately needed cheap hardware for education, those side projects got green-lit and were developed into official projects. This is where reality kicked in again unfortunately, the limited resources of the "real-socialist economy" didn't allow for the mass production necessary to fulfill private demand, so everything that was built went to schools and universities (at least!), but also military academies.
- Marazan 8y agoThen there's the amazing BiFrost and Nirvana engine which beat the colour clash limitations to produce huge full colour sprites on the Speccy. Amazing.
- Jaruzel 8y agoLinks: https://www.ime.usp.br/~einar/bifrost/ https://www.ime.usp.br/~einar/bifrost/
- Marazan 8y agoOh, actually mentioned in the article further down. Bizarre I missed that on first read.
- feintruled 8y agoAs someone whose childhood was consumed by "graphics envy" of the rival 8-bit computers, the fact that this exists now is mindblowing to me. How does it work, does it just use interrupts to change the attributes half way through a display (kind of like the Amiga's Copper?) I wonder how no-one came up with it back in the Speccy's heyday. Would have been absolutely mind blowing back then, the proverbial game changer!
- seanhunter 8y agoI remember that the border around the screen was one colour, but if you used interrupts you could change the colour half way through the TV's scan so you could produce a "horizon" with one colour at the top and another below. I wrote something that would do this, but it used to crash randomly for no apparent reason.
- TuringTest 8y agoI share the sentiment, being in the same situation. The principle is the same as the one producing colored strips in the BORDER, by changing the color really fast while the TV beam is jumping from one row to the next. It was easy with the border, as there was a single bit defining the color (the loading routines changed it with the current value read from the tape, that's why you got the crazy border strips, and these were synchronized with the sound). To change the main screen color though, you need to re-write the contents of the screen memory, really fast. With the limited development tools at the time, I can see how nobody got to create a graphic library as powerful as Nirvana or BiFrost. There were people who thought of doing it, though. I remember seeing a demo which painted 1-pixel-high horizontal strips in different colors across the whole screen, syncing the border and the screen. My mind certainly was blown :-)
- TuringTest 8y agoIt was actually 15 different colors. The "bright black" could have been shown as dark grey, but it didn't; it was the same as "black". That allowed showing bright colors against a uniform black background, which otherwise wouldn't have been possible, as the "bright" flag was set for the whole colour cell and shared for both figure and background pixels.
- jeffwass 8y agoReminds me of the monitor we got for my Tandy 1000 back in the 80’s. $50 for a CGA monitor at Trenton Computer Festival. A total bargain! But the case was made of styrofoam. And out of the box it only supported 8 colours, we had to build the logic board to apply the intensity bit to go to 16 colours. But it turned out to be actually 15 colours, unlike normal CGA or Tandy graphics, the ‘bright’ black came out as black and not dark gray, so occasionally had issues with software that depended on the contrast between color 8 and color 0.
- jacobush 8y agoReminds me of the ABC 800 (Swedish Z80 computer) color monitor. Heavy bastard, built like a tank in sheet metal and painted in some kind of brown shade suitable both for the tax office and the military radar station. Great high quality RGB monitor for your Amiga, Atari, or what not - except it had a logic board which "truncated" any analog signal into 16 (or thereabouts, possibly 8) colors. It could be rebuilt by your local geek for a case of beer or equivalent value. I was a little late to the party and without the electronics chops myself, I had to let my Amiga be bereft of 4080 of its 4096 colors.
- Theodores 8y agoIn the 1980's there were no fancy scanline tricks to get more colours out of the Spectrum. Game developers just did an extremely good job of working around the limitations of having two colours in an 8x8 block of pixels. Play anything by 'Ultimate Play The Game' to see how gameplay worked, unimpeded by attribute clashes. I am amazed that decades after the Spectrum was current that clever code has been written to get more colours than previously thought possible in an 8x8 area. However, none of this was available in the 1980's, when people actually used/played games on these home micros. The situation was different with the ZX81. Originally this had the lamest display ever, black and white, 40 x 25 characters. Some characters were graphics, i.e. a bit like very blocky unicode. Notionally that was the best you could get. However, you could re-map the characters to RAM and in RAM you could put your own character definitions, e.g. the letter 'A' could be made to be your own 8x8 pixel black and white character. If you re-mapped every character then you could create a rudimentary 'high resolution' game environment. This technique actually required 'shadow RAM' in the 8-16K part of memory. You then had to enter characters the hard way, working out from graph paper what the binary was to be. At the time this was mind blowing. The iphone launch was nothing compared to the excitement of getting high res black and white graphics on the ZX81. But, it was on the BBC Micro where real mind blowing stuff happened. The game Elite did something utterly crazy with graphics on the BBC B. The top part of the screen was in high res black and white and the lower dashboard/console was in chunkier four colour graphics. The Braben/Bell team had managed to not only think of switching modes mid screen, they implemented it and they did it all with genuine 3D. This only worked on the BBC Micro, other variants of Elite were not as good as there wasn't the hardware on other systems to do truly cool stuff. Imagine if you went to a web page and the top part had 4K monochrome video even if you didn't think your computer did 4K with the part below the video at 720p with HDR colours, with there being both modes on screen at once. You would be in awe of that, and this is the best analogy I can think of to think of what Elite did. Elite was a 1980's game and this hardcore hacking of the display modes was available at the time and not something developed demo-scene style decades later. Elite defied so many things that should not have been possible. As well as the funky screen modes there were things like the thousands of planets, far too many and far too detailed to fit into RAM. This was tantamount to magic. I never felt that any of the hacks on the Spectrum had that jaw-dropping awe factor, it is a shame that the subsequent video hacks were not available at the time, in the 1980's.
- flohofwoe 8y agoWhat's not mentioned in the article is that the pixel memory also had an interesting layout. It's organized as 32x192 bytes, with each byte holding 8 1-bit pixels. But the memory wasn't organized in a linear fashion. To get to the next pixel line you don't add 32 bytes, but 256 bytes (adding 32 bytes gets you to the next character line, 8 pixel lines below). My guess is that this was done to simplify and speed up character rendering. The Z80 has 8-bit registers, but 2 consecutive registers form a 16-bit register pair. E.g. you have the 8-bit registers H and L, which form the 16-bit register HL. To get to the next horizontal character, you simply increment L, continue incrementing past 31, and you get to the start of the next character line. To copy a font character, just increment H and write a font glyph byte to the address pointed to by HL 8 times. The East German KC85/4 (which borrows many ideas from the Spectrum) took this idea one step further, it had a 320x256 display, also organized as separate pixel and color banks (40x256 bytes each). But the video memory was 90 degree rotated. Put a video memory address into HL, incrementing L gets you to the next vertical pixel line, and incrementing H to the next horizontal 8-pixel byte. Each 8-bit home computer had it's own signature video memory layout, basically early attempts at hardware image compression (a bit similar to today's GPU texture compression formats).
- flohofwoe 8y agoBonus BASIC program demonstrating this :) Go here: https://floooh.github.io/tiny8bit/zx.html https://floooh.github.io/tiny8bit/zx.html, select "128 BASIC", enter the following program, then start it with "run": 10 for i=0 to 7 20 poke 16384+i*256,255 30 next i
- emilfihlman 8y agoThe emulator sucks btw, it can't handle alt+tab or ctrl+pageup/down for navigating away.
- flohofwoe 8y agoHuh? Weird, it works on Windows and Mac for me (Alt-Tab on both, and Ctrl PageUp/Down on Windows, no such keys on my Mac keyboard to test though). I had to consume the browser key events in order to catch the function keys for the emulator (e.g. Chrome uses F1 on Windows for showing the help, but F1 is also needed in the emulators), maybe you're seeing a side-effect of this. Feel free to write a ticket here with reproduction steps: https://github.com/floooh/chips-test/issues https://github.com/floooh/chips-test/issues
- megablast 8y agoA great video explaining the situation: https://www.youtube.com/watch?v=1PI6GwKVAeY https://www.youtube.com/watch?v=1PI6GwKVAeY
- AndrewStephens 8y agoThere is a good book on the creation of the ZX Spectrum version of R-Type, which was considered a minor miracle of graphics programming back in 1989[0]. It's Behind You by Bob Pape - available as a free ebook in various formats at from [1]. It doesn't go into extreme technical detail but is an interesting view of how the industry worked back then. [0] https://www.youtube.com/watch?time_continue=18&v=jiQxq98OYfA https://www.youtube.com/watch?time_continue=18&v=jiQxq98OYfA [1] http://www.bizzley.com http://www.bizzley.com
- pkaye 8y agoBack in the 80s I think the BBC did a short run educational series to get kids familiar with computers. I think they converted this over to the US computers on the PBS channels. That is where I got my initial interest in computers as I started experimenting with the program they provided on my Atari 800.