[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Apple II Graphics Programming (Assembly)
On 8 Jul., 17:14, BLuRry <brendan.rob...@gmail.com> wrote:
>
> Very nice unrolling, Paul! That must be pretty speedy! Is it
> possible to avoid screen holes without losing too much performance?
Insert "CPY #$F8" directly after the INY and you should be done.
The memory gain is negligible (unless you absolutely want to
preserve the screen holes) but it's infact a bit speedier!
While you need additional cycles for the comparison:
(CPY #)= 2 cycles x 248 runs = 496 cycles
you save more cycles because you avoid eight index runs:
(STA $aaaa,Y) = 5 cycles x 32 instructions x 8 runs = 1280 cycles
(INY) = 2 cycles x 8 runs = 16 cycles
(BNE with branch) = 3 cycles x 8 runs = 24 cycles
total = 1320
Cycles gained: 1320 - 496 = 824
Branches over page boundaries ignored in both cases and the
final BNE with no branch (2 cycles) happens in both variants.
bye
Marcus