[Coco] Update on new Coco 3 game engine
Richard Goedeken
Richard at fascinationsoftware.com
Sat Aug 17 00:52:15 EDT 2013
On 08/16/2013 08:59 AM, John Kowalski wrote:
> There are two things you can do:
> A) In the 60hz IRQ, set up and enable the timer to trigger FIRQs. In
> the FIRQ, advance a counter. In the next 60hz IRQ, disable the
> timer/FIRQ again and check how many times the counter advanced. The
> count will be different from both '86 and '87 GIME ('87 will give a
> higher count value than '86)
>
> B) Use the 279.365 nsec source clock for the timer instead of the
> 63.695 usec source clock. The timer frequency will still be off by
> one count depending on GIME, but since you have to set the countdown
> to a high value to set your sample rate, the audible difference
> between the two will be imperceptible.
>
I think you will have to count cycles and detect the GIME version to make the
timing perfect if you are using the timer F/IRQ for adjusting the screen start
on horizontal lines (as Popstar Pilot will). Otherwise the time drift will
mess up your video screen breaks.
I also thought of another interesting optimization for a sprite engine today.
This has probably been used in a game before. You could save quite a few
cycles if the background color is fixed. You wouldn't need to save the
background pixels or reload the saved pixel data when erasing the sprite. It
would actually be pretty easy to add this kind of a mode to the compiled
sprites output by my python script, to be used in games or levels which have
flat backgrounds.
Richard
More information about the Coco
mailing list