Friday 26 April 2013

Writing my first program (Again)

The first program I ever wrote was on a commodore 64 computer.  Since my wonderful wife has managed to buy me one I decided to write my first program again.  Here is the source code:


I had no spare tapes to save my work so I had to take a picture!  The program started out in the usual style as a "Hello World" program.  I then hacked around and changed a few bits and eventually ended up with the above.
So what does it do? - well THIS:



Yes I know its simple, egotistic and self promoting, but I don't care.  The amount of enjoyment I got from doing that is huge.  20 years ago when I wrote a program for the first time I could save it on a cassette tape.  Where on earth am I going to find one of them in 2013???

I have found some good resources online that helped a lot when building this program.
A list of memory address that can POKEd
An e-book about an awesome line of code!
A wiki page detailing the VERBS in the version of basic installed on the commodore
An online version of the C64 Manual

2 comments:

James O'Grady said...

I typed in an adventure game into a Spectrum Emulator (a PROPER computer) and then ran it. You were some sort of deep sea diver dude. I particularly like the way it drew pearls by drawing many nested white circles on a blue background. No need to POKE to change the screen border on the Speccy... just use BORDER and a number! 0 being black, 1 being blue, 2 red, 3 magenta, 4 green, 5 cyan, 6 yellow and 7 white. Velnor's lair had the border as your health bar!

Will Yates said...

Cheers James. I think the spectrum had more of the concept of a proper SDK API than the commodore which seems to rely a lot on PEEK, POKE and some particularly dirty sprite handling. Can you remember the name of the game?