I have never written a game on a BBC Micro, and especially the Electron so I have no real knowledge of how to go about things.
So using the techniques I would have used on other systems I am trying to get to know how the Electron ticks. I have managed to read the Paddles which are now fully wired up via 6502 assembly and so I thought I would attack some simple graphics.
On other systems when coding games it always seems to be best to ‘poke’ the screen memory directly, and that is what I am trying to do here. Looking through the user guide if I want lots of colours then mode 2 seems the way to go (16 colours!).
Albeit I lose 20K of memory (which may be too much out of the 32K).
I found this page which seems to describe how the modes work, including memory layout. So I thought I would develop some simple BASIC code just to prove that I can write directly to the display.
However Mode 2 is completely baffling me!
According to the above article the pixels are a simple 4 bit affair, so in my head that is just a hex digit per pixel, so to write a red pixel in the bottom write I should do:
and to write two next to each other I should do:
However this is not what I am observing.
The test code I am using is below:
10 MODE 2
20 FOR A=&7FFF to &3000 STEP -16
50 GOTO 50
So, this is putting me behind, I’m not even sure that Mode 2 is the best for the game. I need to try some other information sources, plus trial and error to see if I can determine the best way to draw to the display. Alternatively I may need to try another screen mode.