3 ms·
The Spectrum had major limitations with the graphics, which I'll get to, but the 'sound' was nothing more than a single io pin on the Z80 wired to a piezo sound
by midnightclubbed 7y ago
The Spectrum had major limitations with the graphics, which I'll get to, but the 'sound' was nothing more than a single io pin on the Z80 wired to a piezo sounder (or the cassette 'line-out'). To make a tone you had to run an assembly program to toggle the io port pin on and off at the correct frequency. When you made a tone in basic your program paused until the tone was done.
The graphics were a 256x192 memory mapped 1bit buffer (6144 bytes). There was an additional 768 byte buffer that determined what the on and off color was for each 8x8 square of screen pixels. There were 8 possible colors, the byte used 3 bits to select the on color, 3 bits to select the off color, 1 bit to determine if the colors were 'bright' and 1 bit to determine if the colors would flash (alternate every second).
Many games would have a 'play area' that was monochrome to avoid the issues of so called color clash where differently colored sprites overlapped and fought over the color selection.
The further problem with the screen (and the major headache as soon as you wanted to do anything performant) was that the buffer was not laid out linearly.
The top line of the screen (y=0) was at ram address 0 (byte 16384 in memory, rom space went first) and spanned 32 bytes (256 pixels).
The next 32 bytes were y=8 on screen. Then y=16 etc.
Once you got to byte 256 you were back at y=1 on the screen. Next 32 bytes was y=9 etc.
Line y=2 started at byte 512...
If you're paying attention (and if you are just imagine what the code to blit sprites looked like) we've only covered the top third of the screen.
At byte 2048 you get into the second third of the screen (y=64) and the pattern repeats.
I loved the Spectrum (had the 48k and +2, with MGT +D and Swift Disk disk interfaces) but damn that screen layout!
- karmakaze 7y agoThat's very interesting and unfortunate. The Atari had a brilliant 'display list' method where you defined the screen as a series of raster lines and each raster line could be in a different graphics mode varying from 1-bit monochrome graphics, 2-bit 4-color, 4-bit 16-color and there were scan-line doubling versions of many modes that used the same memory but covered more vertical lines. The character modes similarly defined 8x8 sized blocks that varied in size with each character mode, or 4x8 in 4 color which the character bitmaps being read from modifiable RAM. The display list itself was defined in RAM so you could dynamically change the screen layout, even in sync with the horizontal flyback swapping color definitions between lines. The player-missle 'sprites' were crippled compared to the C64 but worked well enough with hardware collision detection, but was limited to 4 on any scanline as Ms. Pacman would show unwanted flicker of ghosts being alternately rendered.
- regularfry 7y agoFairly late on (maybe 1989? 1990?) I came across a Spectrum music layout and composition app demo which did a fairly respectable score render and had 4-channel sound. I was gobsmacked.
- karmakaze 7y agoThat reminds me of when (around the same time) I discovered Composer 669 that on a i386 running in DOS flat (32-bit mode) could in real-time, mix 8 channels of sampled audio pitch shifted to each note.