Tuesday, 6 July 2010

Update.

Well, at least the weather has been good, and I've passed the first year of my University studies (phew!) - it was a close call on at least one unit anyway.

So, what's been going on? Well, I've been looking a little more into the wonderful world of assembly code on the Sinclair ZX Spectrum. Making things happen inside a television screen has never been so much fun - or so quirky. Interesting the way the screen is built up anyway. On the gaming front, I had the sad news of the passing of a true legend from the 'bedroom coding' generation, Jonathan 'Joffa' Smith who was just 43. I wrote a tribute to the modest and extremely talented guy for Micro Mart, coming up in the next couple of weeks. Since, I've been trying out some of his games again, especially those that I missed. I'd recommend to you all a Sinclair User cover tape game Hyper Active, which is a neat defender clone with great graphics and scrolly-type things.

Aside from games, things are slowly moving along and hopefully getting a little easier on a personal level. I *think* I can continue my studies into next year on a full-time basis. I had considered taking a year out or part-time studying - fingers crossed that this won't have to happen.

This weekend, I'll be going to Northampton to catch up with an old mate of mine who's a big TI99/4a. So, it should be a good weekend all round.

Saturday, 12 June 2010

Welcome to my gaming blog.

Well, I did have a blog on MySpace, but no one reads it and I've neglected it, so I posted some items on FaceBook using the 'notes' thingy which was okay but only people on my friends list could read it or something, so I thought I'd start a blog here. All the best writers have them apparently, so why not me? Well, maybe because my writing is generally the best aspects of mediocrity, and probably because I'll again neglect this, but never mind.

Anyway, a bit about myself: I'm a part-time freelance writer for the magazine Micro Mart (http://www.micromart.co.uk/) published weekly in the United Kingdom and available every Thursday for a partly £2 from your local news agents. I've just finished the first year of my Foundation Degree in Computer Enterprise and work part-time in social care. I have a young daughter, called Ruby Mae, who is fast approaching her second birthday. It's good now she's growing up a bit because it means that we can have a laugh.

But the important thing to know, as this is a gaming blog, is what games I'm playing at the moment... and to be honest, I've not had chance to indulge myself in any binary worlds lately, so here is some Z80 machine code which will happily work on the Sinclair ZX Spectrum for you to look at:

SCR EQU 16384   ; Screen Ram location
ORG $6000       ; This is where we want
                ; our program to start
                ; in RAM (6*4096)

LD BC,STRING    ; Right, let's get the
                ; location of where the
                ; text is that'll be
                ; written the screen
LD DE,SCR       ; And let's get the
                ; locator for the
                ; screen and put
                ; it into a register
                ; DE (or in otherwords
                ; LET DE=SCR)
LOOP            ; Here is our first
                ; label, called LOOP
LD A,(BC)       ; Let's put the first
                ; byte at BC into A,
                ; or in otherwords
                ; LET A=PEEK (BC)
CP 0            ; Compare this to
                ; zero, which is the
                ; marker for the end
                ; of the data which
                ; we're writing to
                ; the screen
JR Z,EXIT       ; If A does equal
                ; zero then let's
                ; go to the label
                ; EXIT
RST $10         ; Print A to the
                ; screen
INC BC          ; Let's increase BC
                ; by one so to get the
                ; next byte from our
                ; DATA string
INC DE          ; We'll increase DE
                ; as well to put the
                ; next char one step
                ; to the right of
                ; the previous
                ; outputted character
JR LOOP         ; This simply jumps back
                ; to the label LOOP to
                ; repeat the process
EXIT            ; Here's our EXIT label
LD BC,0         ; Let's clear the
                ; register BC to zero
RET             ; RET simply returns
                ; to BASIC
STRING          ; Here's our STRING
                ; label (or in other
                ; words, where out text
                ; is)
DEFB "Hello World!"
DEFB 13,0       ; 13 is a new line or
                ; carriage return,
                ; and zero says
                ; "end of data"
  

Good, innit? When assembled, load it into your favourite Speccy emulator and PRINT USR 24576 - amazing eh? But why do you get the zero displayed on the next line after Hello World! is drawn to the screen? Well, you could also try RANDOMIZE USR 24576, but you won't see anything. So, try INK 0: RANDOMIZE USR 24576 - there, it works without the zero being printed... so if you're going to execute the code using the latter method then you need to tell the Speccy to set a colour for what it's going to output first, whic of course you can do in the code itself. But how do you do that? Answers on a post-card.