Extension: potential draw routine optimisations
kieranhj opened this issue · comments
Is it worth unrolling some draw routine loops?
E.g. screen clear, sky fill, sprite plot, etc.?
52c3962 fixes one obvious inefficiency in the screen clear. Saves 1,536 cycles in game - 256 * BIT abs + 256 * branch not taken. The main clear loop is ~23,000 cycles in total, so that's a useful 6%, without having some vast number of unrolls.
It's filling 15 pages, and 2 of those pages are copied data, so with indexed reads and writes it's always going to take up at least 15 * 256 * 5 + 2 * 256 * 4 = 21,248 cycles.