New demo, skipdraw with isb

Subject: New demo, skipdraw with isb
From: "Aaron" <stella-receiver@xxxxxxxxxxxxxxxxx>
Date: Wed, 10 Nov 2004 01:28:36 -0600 (CST)
Hi everyone, I've been working on a new game lately and I have a little
tech-demo to show off.

The main thing of interest I guess is that I've used a variant of skipdraw
with the isb instruction (inc, sbc) instead of the usual dcp, i.e.

isb SpriteEnd
bcc .skipDraw

The nice thing is that it leaves the a register with useful information
that you can use to draw the sprite.  In the dcp version you need to
reload the value out of SpriteEnd, which for me at least outweighed the
extra 2 cycles from the sec (which you might not even need).  The other
difference is that you need to store the negative of the distance from the
top of the screen in SpriteEnd, but that's no problem, right? :)

I'm assuming isb is ok to use since it's in the same group as dcp and
lax... probably would still be a good idea if someone could check though.

Anyway, the actual demo is a 6-line kernel with asymmetric playfield
displayed on lines 3 and 6, and single-resolution sprites using both P0
and P1 (P0 gets color changes too).  The skipdraw code isn't used to
actually draw the sprites, rather it selects which sprite pointer is to be
used for the next 6 lines.  On every line I just have:

lda (sp1ptr),y
sta GRP1
lda (sp0ptr),y
;wait until HBLANK...
sta GRP0


Attachment: main.bin
Description: application/macbinary

Current Thread