NHacker Next
login
▲ZX Spectrum graphics magiczxonline.net
68 points by ibobev 2 days ago | 13 comments
Loading comments...
utopcell 41 minutes ago [-]
We can probably trace a ton of greatly influential programmers back to Sinclair machines (Linus Torvalds used a Sinclair QL for example, I think Demis Hasabis had a Speccy.. maybe), but the original ZX Spectrum 48k stands separate from all the rest. The whole hardware architecture was a series of hacks to make the machine as cheap as possible. A few fascinating facts that come to mind:

(1) the 48k Speccy had a total of ..96KiB of memory: 16KiB of "proper" DRAM, 16KiB of ROM for its BASIC and ..64KiB of DRAM of which half of was non-functional! Sinclair was buying broken memory chips and binning them to get sets whose either the top or the bottom 32KiB worked. They could get these chips for way cheaper. Each machine would have a jumper to select either the top or the bottom 32KiB working region.

(2) Both the "graphics card" chip (the ULA, or Uncommitted Logic Array, an early form of an FPGA) and the Z80 CPU needed to read from memory. Instead of having multiplexers, the ZX Spectrum just connected the two address buses with resistors, such that the ULA would overpower the Z80 if both tried to set an address to read from. The CPU was completely unaware of this: the ULA would ..freeze its clock signal for a few clock cycles, do its thing, and then let the CPU continue with its read. It was actually slower to read from a specific region of RAM that contained the framebuffer because of this.

(3) the article describes the weird out-of-order memory layout for the screen. The reason it was done this way was because of the 4116 DRAM chips the machine was using. These were 16,384 (2^14) 1-bit memories, arranged in 2^7 rows and 2^7 columns. To address a random location, one would need to first clock in the 7-bit row, followed by clocking in the 7-bit column. If you wanted to access consecutive memory locations with the same row address, the chips had a "fast page mode", where you would only need to clock in the next 7-bit column address. The memory was laid out in such a way that would minimize row address settings.

Hacks, all the way down to the core.

vitesse_oblige 15 minutes ago [-]
Good times! I wonder if you remember this bit:

Graphics often looked a little weird, because of the hard limit of one color 'palette' (1 ink color and 1 paper color) per 8x8 pixel grid.

However, if you had cycles to spare, there was a cool hack that allowed one palette for each 8x1 pixel slice. By synchronizing with the ULA, you could overwrite the attribute row at each horizontal blanking interval.

The only time you'd have cycles to spare, of course, is when you weren't doing anything else whatsoever. But it made for pretty "press any key" welcome screens.

paol 18 minutes ago [-]
The hacks paid off though. The cheapness made the Spectrum ubiquitous across whole swaths of europe. Not only was it the first computer of an entire generation, it was the first generation where many people had a computer.
jpecar 10 minutes ago [-]
I still don't get what

POKE 23641,194

RUN

does on zx spectrum. And you get different patterns for different values, say 197. And wait for a minute or so to see something even more interesting.

77pt77 4 hours ago [-]
It's still inconceivable to me how people developed for these platforms.

A good discussion about the setup for Manic Miner by the author is here:

https://www.youtube.com/watch?v=LymCezUg7HI

ggambetta 19 minutes ago [-]
In retrospect, it was the limitations that made it so fun. The system was so simple that it was entirely knowable by a single brain, which has become enormously more challenging nowadays.

I recently ported my teaching raytracer to the Spectrum [0], not even using assembler, but the horribly slow native BASIC. It was a ton of fun! It's super slow especially when run on the original hardware, but even then I can't remember something like this from back in the day (and I'd bet something like Microhobby would have listed this as some kind of curiosity); makes me think the Spectrum's limitations weren't even fully explored. Raytracing people were probably working on beefier machines and more serious projects.

[0] https://gabrielgambetta.com/zx-raytracer.html

js8 2 hours ago [-]
Playing a devil's advocate - if you have to scrap by with little memory and few services, you focus on your mission, not distractions like code elegance, library choices and build systems.
pjmlp 2 hours ago [-]
We had no alternatives, it was either whatever we managed to get hold of, with whatever information that we could gather from the provided manuals, a few magazines, and if lucky, the local library.

Ironically, the BASIC + Assembly combo continues to this day, even if done in different tongues.

utopcell 34 minutes ago [-]
It wasn't that bad if you put in context of its era: for example, the computer that landed on the moon just 10 or so years earlier, had 4 KiB RAM, 72 KiB ROM and was running at a speed of 40k instructions per second.
nine_k 4 hours ago [-]
ZX Spectrum was one of the few inexpensive options, especially with color support. However terrible it was, it was also very enticing, or just the only thing you had at home, and could tinker with.
stas2k 59 minutes ago [-]
I still remember getting a USSR clone(Leningrad) at 5 years old. It is probably earliest memory I have.

Did not know English, could not read anything, but still spent hundreds of hours first playing, and then tinkering with it.

There was no OS to mess up, and it booted instantly to a Sinclair BASIC prompt.

MichaelRo 1 hours ago [-]
I was in high school (about 14-15 years old) when I recall drawing lines and circles with BASIC on ZX-Spectrum and it was horribly slow. Was thinking of making some simple games and tried graphics mode but it was just too slow to achieve anything.

So I switched to HiSoft Pascal and line and circle became instantaneous but still I didn't dare program Tetris in graphics mode. So I used text/character mode, compiled from Pascal and was fast enough to play. (In regular BASIC, I couldn't make it work).

Then I installed HiSoft BASIC compiler and my regular BASIC was now fast enough for TETRIS. On the other hand if you think that in 48Kb of RAM they had to fit the video RAM about 8 Kb, the BASIC compiler, my BASIC code, the compiled code and use some RAM for stack and variables ... crazy. Fun times...

mdtrooper 3 hours ago [-]
There is some bug in the article, because it shows:

MD content is not available