Pages

Wednesday, 21 May 2014

3,000 lines

Wasn't going to post but I had a little bit of a win tonight. And I should mention that the 6809 code has reached approximately 3,000 lines (sans data).

I've got the guards running/swinging left (and falling) with the player, albeit with a handful of glitches on the screen and in the logic (eg. they tend to leave 'holes' in the bricks occasionally). But after porting all the 'scaffolding' code for the guards (look-up tables, calculation routines, etc) the mechanics of moving are in place and after fixing the bugs - which I suspect won't be too difficult - I'll just need to fill out the routines for the other 3 directions. That'll be a case of simply cranking the handle for a few sessions.

After that there's a bit more logic to fill out to do with guard status, picking up and dropping gold etc but that's all fairly straightforward - although I must admit there's a couple of memory variables related to the guards whose function I'm not 100% clear on.

I also took a quick peek at the guard AI routine just to gauge how much code there was, but stopped looking after scrolling down a few screens... mine's a bit simpler:

guard_ai:    ; $70D8
; A=col, B=row
; ret: B=0..4 (direction)

        lda     *key_1
        ldb     #1
        cmpa    #0xca
        beq     9$
        ldb     #0
9$:     rts
               

It effectively says, "move left if the player tries to move left, else don't move".

No comments:

Post a Comment