Drawing graphics at horizontal pixel, rather than character, positions isn’t quite as straightforward as doing it vertically. Vertically, as each pixel row has it’s own address on the screen, we just had to find the correct address to start from, and work down from there. Horizontally however, groups of 8 pixels are held within a single byte, using a single bit each, which makes things more complicated to know which bits to set. Continue reading
Now that we’ve done drawing graphics at character positions, ala BASIC, lets start drawing them at pixel positions – starting with placing them vertically at any pixel row. This is very similar to the character position code, with a couple of changes…
Firstly we need to make a pixel row address look-up table, which is simply a version of the character table, but for all 192 rows: Continue reading
And so we come to drawing graphics on the screen! (‘FINALLY!’, you all cheer)
We’ve now got a simple program where you can move a little coloured block around the screen using the joystick, but wouldn’t it be so much better if it was a smiley face instead?
The pixel display on the Spectrum is a bit… erm… ‘special’, as it’s not arranged in what you’d call a logical way (as we discovered in an earlier post when we filled some of it) and it’s a little complicated to describe, but here goes… Continue reading
Right! Let’s try something – our first game! Okay, it’s not going to be a great game, more like Etch-A-Sketch actually, but it’ll use everything we’ve learnt already, and add a couple of new instructions. Continue reading
In most games, you’ll need to provide joystick control. The Spectrum has quite a few different types of joystick interface – Protek/Cursor, Sinclair Interface 2, and Kempston – with Kempston being the most popular. The Kempston interface is also special as it’s the only one of those which isn’t actually keyboard-based, and so is logically separate from controlling a game via keyboard. It’s also pretty easy to use to! Continue reading
Quick post today, just covering a single concept, but it’s such a big concept. Even already our programs are becoming a bit big and monolithic, and so could do with a bit of structure. Most languages have the concept of ‘functions’ or ‘sub-routines’, and Z80 is no different. Continue reading
So, that’s a few posts now – how’s everybody doing? If there’s anything I’ve covered so far which you’re not sure about, or have any queries, post up a comment and I’ll do my best to answer them.
So we now have some code to find the address of any colour on the screen, given it’s X & Y co-ordinates. It’s a relatively straightforward calculation, but imagine if it was more difficult and/or slow to calculate? What’s the alternative? Tables! Continue reading
So we’ve set the colour on the screen, and we’ve set graphics on the screen, but only in a very simple way – from a preset address. How do we put something exactly where we want it? Continue reading
“At last!”, the followers cheer, “He’s doing the screen!!” 🙂 Continue reading