Posted By
 Csabo on 2024-11-16 08:13:34
| Re: Scrolling a bitmap
Sorry, I missed your reply. It's fairly simple to use, you can set it at any time. Here's a basic example of scrolling the entire bitmap up:
org $1001-2 dw $1001 ptr = $D0 db $24,$40,$00,$00,$DE,$31,$2C,$31,$3A,$E2,$31,$2C,$31,$36,$30,$2C db $39,$39,$2C,$39,$39,$2C,$2C,$2C,$2C,$2C,$31,$31,$3A db $9E db "0"+(start/1000)%10,"0"+(start/100)%10,"0"+(start/10)%10,"0"+start%10 db 0,0,0
start sei ; lda #0 sta ptr sta ptr+1 ; loop lda #$03 cmp $FF1D bne *-3 lda #$02 cmp $FF1D bne *-3 cmp $FF1D beq *-3 ; lda ptr sta $FF1B lda ptr+1 sta $FF1A ; lda ptr clc adc #40 sta ptr lda ptr+1 adc #0 sta ptr+1 ; jmp loop ;eof
You can download the PRG and run it to see it in action. Adding 40 to the offset is exactly one line, but you can replace that with any number.
This, combined with soft scrolling via $FF06 would allow you to scroll the entire screen, all you have to do is make sure you draw the new part that's being scrolled in. |