EXAMPLE CODE : Z80 Centipede routine

Do you live and breathe hexadecimal? Do you like speaking to hardware directly?

Moderator: Programming Moderators

kevman3d
Posts: 9
Joined: Mon Apr 02, 2018 6:35 am

Re: EXAMPLE CODE : Z80 Centipede routine

Post by kevman3d » Fri May 11, 2018 8:50 am

Well, its been a while but its at a stage where it can now be played (until (a) centipede is dead or (b) player has died). In the latest update I built a quicky centipede generator to make the data (rather than poke it in basic) using some preset tables. That way I can define a variety of more complex centipede layouts for levels as they increase in complexity. I also have defined level info at this stage, but have yet to build the 'next level' routines.

The code is set to make a 'triple' centipede layout... But it does slow down a bit when so many segments are active. It will need to be optimised a lot once the whole thing is completed and working. When there are too many things on screen, obviously in comes the flickering. I may set a maximum amount of centipede segments allowed and refine all that code to remove a few T-states.

Throw on some lives, add a 'next level' switch and polish it up and its almost finished.

If you want to play, there's a .sna file (dated 110518) which you can run. The full source code is centipede_complete_game.asm... Which of course gets updated often.

https://github.com/kevman3d/ZXSpeccy-z80-projects

kevman3d
Posts: 9
Joined: Mon Apr 02, 2018 6:35 am

Re: EXAMPLE CODE : Z80 Centipede routine

Post by kevman3d » Fri May 11, 2018 8:59 am

Oh yeh - you can shoot the spider/centipede, but the flea and scorpion are not 'killable'. I figure shouldn't make it too easy, eh! :wink:
Keys are Q,A,O,P and M(fire). There is a redefine keys routine that you can call if you want at 42254.

kevman3d
Posts: 9
Joined: Mon Apr 02, 2018 6:35 am

Re: EXAMPLE CODE : Z80 Centipede routine

Post by kevman3d » Wed May 16, 2018 8:02 am

16-May update : No more flickering... Created a 'print' buffer which now removes any need to erase and redraw - it just draws over the top of whatever has changed (including blanking out chars when they're no longer there). Code is messy, but its at least working - mostly. Will clean it up, optimise and finish up once its more bug free-ish... Though its not far off. :smile:

Of course, its moved the address for the redefine keys with the added code. New call is at 42287

New 16-05-18 Snapshot and gameplay video file is also on github.

Post Reply