Code: Select all
cycles = (scanline +20) *341 /3 +176
The game I am modifying right now (Kirby's Adventure) has no unused space anywhere to store such a 240 word table. Since parts of the game require a variable scanline at which to generate the IRQ, I cannot use a hard-coded count like one would use for a simple status bar. So I wonder whether it is possible to make the above computation entirely without a table, space-saving and reasonably fast. I have started reading up on the subject [1][2], but am at my limits when it comes to combining both the multiplication and the division into one short routine.