[Coco] Let's figure out the best method to compile sprites for the CoCo - Please add your input
Steve Bamford
stevecindybamford at yahoo.co.uk
Sun May 14 16:34:55 EDT 2017
Hi Mark.
That's very interesting to know. Knight Lore was hugely influential when it launched in the UK and definitely raised the bar for the time. I imagine converting KL to the CoCo has proven very revealing?
A typical sprite in my game requires 48 (4x12) bytes of graphics data however to expedite rendering I create in total four pixel-shifted versions which takes us to 192 (4x48) bytes. If I need a sprite facing both left and right that figure doubles to 384 (2x192) bytes. At this point I have nice fast sprites running at 60Hz using a single buffer but memory is going to run out pretty quick on a 32k machine. So I created a temporary `sprite bank', large enough to accommodate four shifted sprites, mainly for enemies and during appropriate moments of the game I refresh the data using sprite copy, shift and mirror routines.
So in a nutshell sprites that aren't needed all of the time need only take up 48 bytes which means I can have much more variety overall without compromising performance.
Cheers,Steve.
From: Mark McDougall <msmcdoug at iinet.net.au>
To: Steve Bamford via Coco <coco at maltedmedia.com>
Sent: Sunday, 14 May 2017, 1:59
Subject: Re: [Coco] Let's figure out the best method to compile sprites for the CoCo - Please add your input
On 13/05/2017 10:00 PM, Steve Bamford via Coco wrote:
> I strike a memory/performance balance by shifting and mirroring some
sprite data into a common buffer only when it's required and overwrite
it as necessary.
You mention mirroring. Knight Lore mirrors sprite data in-place, with a
flag to indicate the current orientation. Works well if you are
generally using only 1 orientation per screen, not so well if you
usually need both...
Regards,
--
Mark McDougall
<http://retroports.blogspot.com.au>
--
Coco mailing list
Coco at maltedmedia.com
https://pairlist5.pair.net/mailman/listinfo/coco
More information about the Coco
mailing list