base:acme_1x1_scroll
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | base:acme_1x1_scroll [2015-04-17 04:30] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ==== 1x1 Scrolling message inside IRQ interrupts ==== | ||
+ | This routine shows you how to create a 1x1 smooth scrolling message inside an IRQ raster interrupt routine. Looking below you will see that this scroller uses 2 iterrupts. As we cut the raster positions into two parts. Most of the upper raster ramains as normal, while the bottom raster has a smooth scroll effect. | ||
+ | |||
+ | Note: Source is programmed in ACME cross-assembler and it has been tested beforehand too. | ||
+ | < | ||
+ | ;1x1 scrolling message inside IRQ by Richard Bayliss | ||
+ | |||
+ | smooth = $02 ;Control for smooth scroll | ||
+ | screenloc = $0798 ;This is the line for where the scroll is placed | ||
+ | |||
+ | !to " | ||
+ | * = $4000 | ||
+ | sei | ||
+ | jsr $ff81 | ||
+ | lda #< | ||
+ | ldy #> | ||
+ | sta read+1 | ||
+ | sty read+2 | ||
+ | lda #< | ||
+ | ldx #> | ||
+ | ldy #$1b | ||
+ | sta $314 | ||
+ | stx $315 | ||
+ | sty $d011 | ||
+ | lda #$7f | ||
+ | sta $dc0d | ||
+ | lda #$01 | ||
+ | sta $d01a | ||
+ | cli | ||
+ | hold jmp hold | ||
+ | interrupt1 | ||
+ | lda #$00 | ||
+ | sta $d012 | ||
+ | lda smooth ;Scroll section | ||
+ | sta $d016 | ||
+ | lda #< | ||
+ | ldx #> | ||
+ | sta $314 | ||
+ | stx $315 | ||
+ | jmp $ea7e | ||
+ | interrupt2 | ||
+ | lda #$e0 | ||
+ | sta $d012 | ||
+ | lda #$08 ;No scroll section here | ||
+ | sta $d016 | ||
+ | lda #< | ||
+ | ldx #> | ||
+ | sta $314 | ||
+ | stx $315 | ||
+ | jsr scroll | ||
+ | jmp $ea7e | ||
+ | |||
+ | scroll | ||
+ | sec | ||
+ | sbc #$01 ;Speed of scroll can be edited to how you want it, but don't go too mad :) | ||
+ | and #$07 ;We need this to make the variable smooth into something smooth :) | ||
+ | sta smooth | ||
+ | bcs endscroll | ||
+ | ldx #$00 | ||
+ | wrapmessage | ||
+ | sta screenloc,x | ||
+ | inx | ||
+ | cpx #$28 | ||
+ | bne wrapmessage | ||
+ | read lda screenloc+$27 | ||
+ | cmp #$00 ;Is byte 0 (@) read? | ||
+ | bne nowrap ;If not, goto label nowrap | ||
+ | lda #< | ||
+ | ldy #> | ||
+ | sta read+1 | ||
+ | sty read+2 | ||
+ | jmp read | ||
+ | nowrap | ||
+ | inc read+1 | ||
+ | lda read+1 | ||
+ | cmp #$00 | ||
+ | bne endscroll | ||
+ | inc read+2 | ||
+ | endscroll | ||
+ | |||
+ | message | ||
+ | !scr " inside an IRQ interrupt, coded by richard bayliss" | ||
+ | !scr " of the new dimension, in acme cross assembler ... " | ||
+ | !scr "we do hope you like it ;o)) ... hopefully you should" | ||
+ | !scr "find the source code useful for future demos and stu" | ||
+ | !scr "ff if you want to learn to do scroll texts ... " | ||
+ | !scr "wrap time! " | ||
+ | !byte 0 | ||
+ | |||
+ | </ | ||
base/acme_1x1_scroll.txt · Last modified: 2015-04-17 04:30 by 127.0.0.1