Retrochallenge 2015/07 – Getting to Know the Electron

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
30 ?A=&11
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.

Retrochallenge 2015/07 – The Paddles

So what I naively thought was going to be a simple process of connecting up the Atari Paddles to the Acorn Electron’s joystick port via a cable adapter turned out to not be.

Though I suspected the Potentiometer’s may not be the same I was expecting to get a range of values that I could at least use (maybe via a calibration).

However it seems I wasn’t getting much range on the pot (only a small amount of it was giving me changing values, and also only a small amount of variation in the numbers).

I decided to ‘breakout’ the wires into a breadboard so I could experiment.

I thought I could overcome this by putting a resistor in parallel to bring the pot value down.  However, again this still only gave a small range of values being read by the Electron.

I then decided to open up the working joystick to see if I could get any clues from how it was wired up inside.  Immediately I noticed that all three wires of the Pot were wired up, not just the two I would expect.  This then reminded me that the Plus/1 pinout had an Analogue ground as well as the analogue reference voltage.

I decided to crack open one of my Atari Paddles and as I suspected this was wired up with just the two wires of the pot.

So it seems the Electron requires the voltage reference to be balanced between Ground and the 1.8V reference.

I so happen to have some old paddles from a long since passed Binatone pong style game.

I had already modded them years ago with a fire button, however they don’t currently have any cable.

The Pots are 10 kOhm as mentioned in the Plus/1 manual so they are a good match.

Once connected up with the 3 wires I managed to get values from 255 to 0.

So next step is to wire up the two paddles in a more permanent manner.

Retrochallenge 2015/07 – Starting out

So it is the 1st of July and the start of the Retrochallenge.

Initially my aim was to get everything gathered up and connected ready to go.

Apart from the Electron and it’s interfaces I needed a 15 pin Male D type connector and a 9 pin male to make up an adapter so I can connect my Atari Paddles to the Plus/1 interface.

While searching I found a BBC analogue joystick which has luckily allowed me to test reading from the Analogue port on day 1!

Once you plug all this in it becomes as big as a BBC Micro!

Once you plug all this in it becomes as big as a BBC Micro!

Retrochallenge 2015/07 – The Next Challenge – decision

So it’s decision time for the Retrochallenge.

Though I have been toying with doing a hardware challenge this time, as my initial idea involved the ZX Spectrum, which I used last time I thought I should really pick another system.

From several choices I have decided that this time I am going to use the Acorn Electron.

My intention is to develop a new game for the Electron using BASIC and maybe some in-line 6502 assembly.

Though I have programmed in BBC BASIC before I have yet to write anything ambitious such as a game so I have a lot to learn about how to do Graphics, Sound etc.!

I haven’t fully decided on what the game will be, but I want it to be paddle based, so I will first need to get some Atari or similar paddles connected up, and secondly I want it to be primarily a two player game.

Retrochallenge 2015/07 – The Next Challenge

I am taking part in the Retrochallenge 2015/7 however I need to decide what project / challenge to set myself.

My favourite retro system has to be the Sinclair machines, and though I favour the ZX Spectrum now, I cut my teeth on the ZX-81 and I am wondering if I should go right back to my roots?

Also I have several new additions to my collection, do I use the challenge to spend some time with them?

Just picking a system isn’t the end of it though, I then need to decide what I want to do, will it be software related? or hardware, or both?

To be continued… (I hope)


Retrochallenge 2015/01 – Finished

Publishing of the listing is now complete in both paper and electronic format.

If anyone wants a physical copy then we will be taken some printouts to the Retro Computer Video Game Market 2 in Leeds on February the 7th.

If you would like a copy reserved for collection at the above event then please tweet @oldcomputerclub and let me know.


Retrochallenge 2015/01 Publishing

I was just starting publishing preparations when I noticed a REMmed line reminding me of something I hadn’t finished.

Once done this changed the game dynamic but a little too much as it became a touch too difficult too early on.

I made some adjustments and mentally signed off the project (always a nice feeling). Next was the publishing which I (foolishly) thought would be straightforward.

I looked through the worldofspectrum archives to remind myself of how the publications of the time published these listings and like I thought the replicated ZX-Printer style output in columns was the order of the day.

I had two ideas in my head of how I was going to publish, the first (ambitious) idea was to fire up an old Macintosh running an old version of PageMaker. However I think that would take too long, so my second idea was to create a HTML5 layout and I can then physically print plus print to PDF for paper-less distribution.

CSS3 has had colums support within it for a while so I thought this would be ideal to help me layout the pages.

How wrong was I!

It took me longer than I thought it should have to get the columns layed out like I wanted. Column widths, word wrapping, multiple spaces all getting messed up in the layout. Eventually I managed to get the correct Alchemy to match the 32 column width and with the ZX font thrown in I was very happy with it.

All I have to do now is print…

This was when my problems really started.

It seems Chrome doesn’t support multi column layouts when you print, so I thought not a problem I am on a Mac I’ll try Safari. Again no column support on print. After reading lots online about people with similar issues, I read that Internet Explorer (modern at least) does support column printing.

So I booted up a Windows 8.1 PC and loaded my HTML into Internet Explorer. Of course I had to make some markup changes, hack the ZX Font so it would load etc. But in the end all was good and I had my layout on screen how I wanted.

I printed to PDF and there were the columns, now I’m getting somewhere…


Retrochallenge 2015/01 Nearing completion

Happily I am nearing completion of the BASIC code now.

Scoring and a high score table is in place.

An instruction screen (doubling up as the high score screen) is done.
sub rescue title screensubrescue play
Some between level sounds are in place to fill the time while the Spectrum clears screens and variables etc.

I am starting to consider the publishing method for the type-in listing.

I want to look at producing something physical in print, so I need to remind myself the sort of style that was used in the old magazines.

I also want to produce something electronic but I don’t want to output just the text as that could easily be copied and pasted (defeating the joy of the type-in).

Before I get to this point I need to test on some other Spectrum models though.

I booted up the Fuse emulator on my Mac, and configured the Spectranet emulated interface. This allowed me to directly access the code. My initial tests with this emulator everything seemed OK.

So now I need to dig out some of the other physical models of Spectrum in order to tick off the verify stage.

Retrochallenge 2015/01 Halfway

The halfway report.

Now it is about halfway through the challenge time to take stock on where I am.

I have changed the game idea since the start.
A lot of the Game Play is functioning.

To do:
Finish the game play, especially the higher difficulty levels.
Hall of Fame
Title / Instructions screen.
Improved graphics around play field.
Between level sounds.
Testing on other ZX Spectrum models.

And of course the final part is to publish the type in listing.

Retrochallenge 2015/01 Progressing Well

Progress is continuing well with the development.

I have added increasing difficulty as we progress up the levels, some tweaks to the gameplay too. Performance is still not what I would like and I’m sure if I could get it faster the gameplay would feel better.

I need to improve some more of the graphics, and see if there are any chances of optimising some of the code. However I’m forbidding myself the use of Machine code in this challenge.

I have an idea for a twist in the gameplay on higher levels which I need to try out, and hopefully the performance hit wont prevent me from using it.

On a side note I am enjoying the development experience and I am getting proficient at using the ZX Spectrum’s BASIC editor, The keyword system can actually be an aid to speedy editing when you begin remembering what keys they are all on.