The Bear Essentials: Developing a Commodore 64 game – Part 4
Jun26

The Bear Essentials: Developing a Commodore 64 game – Part 4

Part 4: Studying SID It’s been over a year now since I started work on my platform game, and there is still plenty of work to do on it. I would never have imagined it would take me this long to make a Commodore 64 game, but I constantly find myself revisiting things that I thought previously completed to improve them.  I’m without a doubt past the 50% progress marker now anyway, which is definitely a positive. And on another positive note, Bear has found a really nice home with new Commodore 64 game developers Pond Software. Pond’s first release earlier this year, ‘Spaceman Splorf: Planet of Doom’ is a very polished score chasing game with excellent sound and graphics and can be downloaded for free from: http://pondsoft.uk You can also read about Pond’s upcoming releases, which include entries for the 2016 Reset 4kb Game Coding Competition, which I would encourage any C64 coders to take part in! Details of the competition can be found here: http://cloud.cbm8bit.com/resetc64/crapgamecompo2016v1.1.pdf The Sound Interface Device I’m sure at some point everybody has been impressed by a piece of music played by the Commodore 64’s SID chip.  Over the years there have been many names associated with squeezing excellent pieces of music from the three sound channels of the SID – Rob Hubbard, Ben Daglish, Jereon Tel, Steve Rowlands…  Look them up on YouTube if you still need convincing. Before I started writing my C64 platform game, I had a small amount of knowledge of how the SID chip worked having read about it in various books and magazines.  When it came to making use of it in my own programs however, I only really managed to get the most basic of sounds working. For some games this is absolutely fine (my Snake clone had small noises to indicate picking up, crashing and starting the game, and also a very simple tune when the game first loads), but for other more complicated games it really is deemed unacceptable for a C64 game to not have some cool music and sound effects. This was the case with RockMaze, my first attempt at creating a C64 game.  I can’t remember if I ran out of time, or if I failed at attempts to get sound effects working, but either way the game ended up being completely mute.  When I was asked recently if I would like to contribute to the Reset magazine cover disk, I thought this would be an ideal time to read up on the SID chip once again and try to add some music and sound effects to RockMaze. After a quick internet...

Read More
ZX Spectrum + keyboard membrane replacement – how to
Jan02

ZX Spectrum + keyboard membrane replacement – how to

So you have got your old Spectrum+ out from the loft because you don’t like the look of that ‘orrible thing called the Vega. You plug it in but alas, some or all of the keys don’t work. Well, the keyboard membrane has failed but don’t go binning your 80s pride and joy just yet – all is not lost and you will get to explore the Jet Set Willy mansion once more… Keyboard membrane failure was and still is probably the most common issue to arise from the use of an original Spectrum + and it can be remedied for approximately £16 and 20 minutes of your time. Disclaimer: I take no responsibility for any damage you do to yourself or your Spectrum during this process. You proceed at your own (and your Spectrum’s) risk! What you will need: A crosshead screwdriver A new ZX Spectrum keyboard membrane (available from either www.sellmyretro.com or www.dataserveretro.co.uk) ensuring it is for the Spectrum+ 48K/128K. Step 1: Dissassembly A. B. C. Turn your Spectrum over to expose the screws that hold your Spectrum together (8 altogether – see pic A). Take all of the screws out and carefully put them to one side. There should be one countersunk screw on the Spectrum+ next to the I/O interface port with the rest being round headed screws. Make a mental note of where the countersunk screw goes for re-assembly later on. Carefully turn your Spectrum right way up bearing in mind the top case is now loose and you still have ribbon connectors attached to the bottom case (pic B). Lift the top case up enough to prise the 2 keyboard ribbon connectors out of their sockets (pic C). The ribbon connectors are notoriously brittle when old so be sure to hold the ribbon as close to the socket as possible and gently but firmly pull upward and out of the sockets. You can now put the bottom casing to one side. Step 2: Removing the old membrane D. E. With the top casing keyboard down, remove the 10 screws indicated in pic D and put to one side. Remove the metal plate and the plastic sheet underneath exposing the soon-to-be-replaced keyboard membrane (pic E). F. G. Now unscrew and remove the two ribbon clamps that hold the ribbon connectors in place and put the clamps to one side (pics F and G). Remove the old membrane exposing the rubber mat underneath. If you like, you can now take this opportunity to remove the rubber mat and suck away its 30 year build up of dust, fluff, food and dead skin with a vacuum...

Read More
The Bear Essentials: Developing a Commodore 64 game – Part 3
Dec28

The Bear Essentials: Developing a Commodore 64 game – Part 3

Part Three: The Joy of Plex Things have been progressing well with my Commodore 64 platform game since part two, and I have now put together a trailer showing the first two areas of the game. Before I begin retelling my joyous experiences of learning C64 sprite multiplexing, I’d like to show a couple of screenshots that show the origins of Bear, who actually started life in Unity 3D. I had numerous attempts at making a platform game in Unity, with the goal then to be able to publish it to numerous platforms (probably starting with iOS). However, I found it difficult to get the pixel perfect platforming I was aiming for, and I struggled to make graphics assets that would suit the game I had in mind. In the end, I gave up on the idea, and Bear sat untouched for a good long while. I’m really glad that I decided to get my C64 out of the loft and set it up.  This is what sparked the idea of making Bear into a C64 sprite, and attempting to make my platform game again.  I’m surprised that the restrictions of working with a C64 has helped to bring the game to life, and that I found it much easier to create graphics with a 16 colour limit and a low resolution.  Something to Bear in mind if I ever attempt to make the game in Unity again! Speaking of restrictions, one quite large restriction on the Commodore 64, is that it only has eight hardware sprites available to use, which looking on the bright side, is more than enough for some games.  In fact, the first two games I made for the C64 didn’t even use sprites in the main game, and were just used to show things like the game logo and score, and everything else was built from screen characters. Some games require many more than the eight available sprites though, and so a technique called sprite multiplexing is needed to allow this. This technique takes advantage of the register which tracks where the screen refresh is currently happening, and re-uses sprites that have already been displayed by moving them down the screen underneath the refresh so that they are drawn again, giving the impression that there are actually more than eight sprites. This is quite a commonly used technique on the C64, one famous example is of the massive ‘fist’ boss in Turrican. The fist is made up of rows of sprites that are reused again and again to make one very impressive giant enemy! There are very helpful sprite multiplexing code examples (along with...

Read More
The Bear Essentials: Developing a Commodore 64 game – Part 2
Oct03

The Bear Essentials: Developing a Commodore 64 game – Part 2

Part Two:  Pixel perfect platforming Since the last instalment, I made the decision to go completely back to basics and do some research before progressing any further with my platform game. Why?  It has been a dream of mine to make a C64 platform game for a long, long time, and I want to make the best job of it that I possibly can. And it’s always good to learn something new, right? Since I am (possibly quite badly) self taught in machine language and it has been many years since I used it last, there are a fair few gaps in my knowledge of how machine language and the C64 work, so I figured it would be a good idea to try to fill in some of these gaps to make progressing with coding as easy as possible. I already owned The Commodore 64 Programmers Reference Guide, which is very handy to refer to and learn the basics of machine language, but I needed something a little more advanced.  I sought out some recommendations from the Lemon64 forums, and one book that cropped up again and again was Jim Butterfield’s ‘Machine Language for the Commodore 64‘. I recommend the revised and expanded edition, which you can download along with lots of other great books from here: http://www.bombjack.org/commodore/books.htm Jim’s book is widely regarded as being the best way to get started and to advance with machine language.   Another great suggestion given to me was to study some source code from other C64 games. This was a very valuable step to take as it has taught me many programming tricks, ways to structure code and some great ways to conserve memory.  It can be a little daunting diving in to somebody else’s code, but with the right approach and some patience can be incredibly rewarding when you discover something new. Armed with all of this new information, I actually decided to start my game again from scratch, which although has cost me time and was somewhat painful, it will now ensure that my project is structured correctly and that all of my code is up to date with the new knowledge I have gained. Another piece of  ‘research’ I decided was needed was to play some platform games for inspiration.  One of these was the first game I remember playing on my Dad’s ZX Spectrum 48k, which had only three buttons to control the main character, the simplicity of which I adore: Left, Right, Jump. Simple. Too many games these days have you clumsily looking down at your hands trying to remember what does what. None of that here....

Read More
Sega Saturn clock battery replacement – how to
Sep05

Sega Saturn clock battery replacement – how to

Imagine this. You plug in your Sega Saturn, grab your Virtua gun, load up your well loved copy of Virtua Cop… and this appears: You almost rage destroy the gun as its a royal ball-ache trying to navigate the time and date setting process using the buttons on your gun and you’re being too lazy to reach for a pad. Well the answer to all your prayers is here. Now before I begin, this is probably the most difficult console fix ever. It involves a no-solder technique and should not be attempted by anyone under the age of 2. So here goes. Take your Saturn and turn it around to look at the back, That flap to the left? Take it off. Grab your replacement battery – a CR2032, I bought this pack from a £1 shop for…  you guessed it, £1 !!! Flick the old battery out, replace it with a new one and replace the flap. Fire up your console, and set your time and date! Switch off and back on to ensure its working properly and BOOM!  You’ve done it, give yourself a pat on the...

Read More
The Bear Essentials: Developing a Commodore 64 game
Aug19

The Bear Essentials: Developing a Commodore 64 game

Part One: Initialising and moving a sprite I find it absolutely incredible that the Commodore 64 development scene is alive and well.  Thanks to companies like Psytronik there is still a healthy stream of games arriving on the C64 25 years after I first got my machine in 1990. I was fairly late to the Commodore party, having had my first 8-Bit computer experiences on my Dad’s ZX Spectrum 48k.  I loved every minute I spent with the little rubber-keyed beauty, but eventually wanted to branch off into a territory of my own choosing…  I wanted a computer of my own. I chose the C64 after reading about a recent price drop and an influx of new cartridge releases which promised to give the 64 a new lease of life.  This didn’t turn out exactly as Commodore had planned though, and it wasn’t long after I first owned the machine that the 8-Bit computer scene gave way to the 16-Bit computers and consoles. I never once regretted my decision to follow the C64 route though. Like all 8-Bit computer owners, my first programming attempts were in the BASIC language, but I soon grew frustrated that I couldn’t make the type of games I wanted to make as BASIC just wasn’t fast enough.  And so, armed with an Action Replay cartridge and the Commodore 64 Programmer’s Reference Guide, I taught myself the basics of 6502 machine language. My first creation was a Boulderdash / Repton clone called RockMaze, written mainly in BASIC but using the speed of machine language for scrolling the screen and copying levels in and out of memory.  It was a fun little game to make (and play), and even had a level editor. After this, I was determined to write another game, but this time made in 100% machine language.  For this, I decided it would be better to use a very simple concept, and created a clone of the Snake game (which was later made very popular by a certain mobile phone company!) My bedroom programming time soon disappeared in favour of the usual teenage pastimes (pubs and girls if I remember correctly!), and the games I made were destined to be forgotten at the back of a dusty loft. Fast forward to 2015, and after joining the Lemon64 community, I was asked if I would like to give RockMaze and Worm! an official release. Wow!  Finally my games would actually get played by somebody other than myself! After some rummaging in the loft for the old tapes and converting the games to run on disk, they were uploaded to the Commodore 64 Scene Database...

Read More