[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Apple II Graphics Programming (Assembly)
On Jul 7, 7:40 pm, cerebral_monkey <berkleycame...@gmail.com> wrote:
> Am I doing something wrong here? The screen is still filled with
> random data after execution. (I wrote a subroutine to clear the
> screen, but the built-in version is probably much faster)
My standard way of clearing the hi-res screen is:
LDA #0 ;FILL BYTE
LDY #PAGE ;PAGE=$20, $40, or $60
STY PTR+1
LDY #0 ;INIT INDEX
STY PTR
LDX #$20 ;PAGE COUNT
a STA (PTR),Y
INY
BNE a
INC PTR+1
DEX
BNE a
RTS
If I need speed, then I use
; clear hi-res page 1
LDA #0 ;FILL BYTE
LDY #0 ;INIT INDEX
a STA $2000,Y
STA $2100,Y
STA $2200,Y
STA $2300,Y
...
STA $3E00,Y
STA $3F00,Y
INY
BNE a
RTS
--
Paul Santa Maria
Maumee, Ohio USA