base:1x1_scrolling_message
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | base:1x1_scrolling_message [2015-04-17 04:30] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | A simple 1x1 smooth scroller, in this example the text should be placed at $3000, end the text with the value $ff to wrap the text. | ||
+ | Don't mind the irq routine, it's just provided to have a working example. | ||
+ | < | ||
+ | *=4000 | ||
+ | jsr $ff81 | ||
+ | jsr $ff84 | ||
+ | jsr $ff8a | ||
+ | ldx #$00 | ||
+ | stx $d020 ; | ||
+ | stx $d021 ; | ||
+ | dex | ||
+ | stx $0286 ; | ||
+ | jsr $e544 ; | ||
+ | |||
+ | lda #$00 | ||
+ | sta smooth | ||
+ | sta $f0 | ||
+ | lda #$30 ;set text start to $3000 (zp $f0+$f1) | ||
+ | sta $f1 | ||
+ | |||
+ | sei ;set up irq | ||
+ | lda #$01 | ||
+ | sta $d01a | ||
+ | sta $dc0d | ||
+ | lda #<irq | ||
+ | sta $0314 | ||
+ | lda #>irq | ||
+ | sta $0315 | ||
+ | lda #$1b | ||
+ | sta $d011 | ||
+ | lda #$fa | ||
+ | sta $d012 | ||
+ | cli | ||
+ | jmp * | ||
+ | |||
+ | |||
+ | irq inc $d019 | ||
+ | jsr scroller | ||
+ | lda #$1b | ||
+ | sta $d011 | ||
+ | lda #$fa | ||
+ | sta $d012 | ||
+ | lda smooth | ||
+ | sta $d016 | ||
+ | jmp $ea31 | ||
+ | |||
+ | scroller | ||
+ | lda smooth | ||
+ | sec | ||
+ | sbc #$01 ;$01-$07 Higher is faster scroll | ||
+ | bcc scroll0 | ||
+ | sta smooth | ||
+ | rts | ||
+ | scroll0 | ||
+ | sta smooth | ||
+ | ldx #$00 | ||
+ | move0 lda $0401, | ||
+ | sta $0400,x | ||
+ | inx | ||
+ | cpx #$28 | ||
+ | bne move0 | ||
+ | ldy #$00 | ||
+ | lda ($f0), | ||
+ | cmp #$ff ;if value is $ff reset text to $3000 | ||
+ | beq zp0 | ||
+ | inc $f0 ;inc $f0/$f1 to fetch next scrolltext char | ||
+ | lda $f0 | ||
+ | bne noc0 | ||
+ | inc $f1 | ||
+ | noc0 rts | ||
+ | zp0 lda #$00 | ||
+ | sta $f0 | ||
+ | lda #$30 | ||
+ | sta $f1 | ||
+ | rts | ||
+ | |||
+ | smooth | ||
+ | </ |
base/1x1_scrolling_message.txt · Last modified: 2015-04-17 04:30 by 127.0.0.1