[Coco] Coco game engine demo

Richard Goedeken Richard at fascinationsoftware.com
Mon Feb 4 02:01:31 EST 2013


Using the horizontal irq would solve the vertical scrolling limitation, but I 
didn't want to use this high frequency interrupt for 2 reasons.  First, the 
overhead is too high: at 15.7khz this interrupt happens every 113 or so cpu 
cycles.  There's probably no way you would be able to get the total execution 
time per interrupt under 20 or 30 cycles, meaning the overhead would be 20% or 
more.  Second, I'm drawing the background blocks by using the S stack pointer 
and all of the other registers to hold data, so I have to turn off interrupts 
for a while during the drawing.  If I had to re-enable irqs every 113 cycles 
it would hurt the efficiency of these drawing routines.

If I ditched the requirement for 1-byte horizontal scrolling and went to 
2-byte scrolling I think I could almost double the speed of the background 
drawing code.  It's a classic speed/quality trade-off.

Richard

> Can't you wrap? Use the HBLANK interrupt to wrap the address when you run
> out of address space?
>
> Regards,
>
> -- | Mark McDougall | "Electrical Engineers do it |
> <http://members.iinet.net.au/~msmcdoug> | with less resistance!"





More information about the Coco mailing list