[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Apple II Graphics Programming (Assembly)



Calibrator <calibrator@freenet.de> wrote:
> 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.

I'm not sure about this. Aren't there screen holes at 78-7F as well
as F8-FF? Assuming my memory's right, I can come up with three options.

If you have tons of code space, you can do the thoughtless thing
and just double the loop length:

LDA #0
LDY #$77
a STA $2000,Y
STA $2080,Y
...
STA $3F00,Y
STA $3F80,Y
DEY
BPL a

Or you can do something like what Calibrator said but skip over the
middle hole along the way:

LDA #0
LDY #0
a STA $2000,Y
...
STA $3F00,Y
INY
CPY #$F8
BEQ end
CPY #$78
BNE a
LDY #$80
BNE a
end

Or involve the X register and run the same loop twice with different
index values but the same exit condition:

LDA #0
LDY #$77
b LDX #$77
a STA $2000,Y
STA $2100,Y
...
STA $3F00,Y
DEY
DEX
BPL a
CPY #$7F
BEQ end
LDY #$F7
BNE b
end