Ich habe mich jetzt mal mit den TED-Registern beschäftigt und eine kleine Scroll-Routine geschrieben. $ff07 (X-Scrollposition: 0-7) habe ich wie beim C64: $D016 verwendet. Die Verzögerung, damit es nicht viel zu schnell wird, habe ich mit Zählen der Rasterdurchläufe gelöst. Mit den Rückwärtszählern wurde es etwas hakelig.
Ist es das oder geht da noch etwas ?
Code
- !to "p4scroll.prg",cbm
- ; Basicstart
- TEDGraph1 = $FF06 ; $FF06: TED Graphic-Register 1
- TEDGraph2 = $FF07 ; $FF07: TED Graphic-Register 2
- TEDKLatch = $FF08 ; $FF08: TED Keyboard Latch
- TEDIRQ = $FF09 ; $FF09: TED IRQ Status Register
- TEDIRQM = $FF0A ; $FF0A: TED IRQ Mask Register
- TEDIRQR = $FF0B ; $FF0B: TED Raster IRQ Register
- TEDCUR_H = $FF0C ; $FF0C: TED Cursor H
- TEDCUR_L = $FF0D ; $FF0D: TED Cursor L
- TEDSND1 = $FF0E ; $FF0E: TED Sound Voice #1 L
- TEDSND2 = $FF0F ; $FF0F: TED Sound Voice #2 L
- TEDSND1H = $FF10 ; $FF10: TED Sound Voice #1 H
- TEDSND = $FF11 ; $FF11: TED Sound Volume,on/off,Wave,D/A
- TEDREG = $FF12 ; $FF12: TED Register
- TEDREGA = $FF13 ; $FF13: TED Register
- TEDVRAM = $FF14 ; $FF14: TED Video-RAM
- TEDBACK = $FF15 ; $FF15: Background-Color
- TEDCOL1 = $FF16 ; $FF16: TED Color 1
- TEDCOL2 = $FF17 ; $FF17: TED Color 2
- TEDCOL3 = $FF18 ; $FF18: TED Color 3
- TEDFRAME = $FF19 ; $FF19: TED FRAME
- TEDCHARH = $FF1A ; $FF1A: TED Char Position H
- TEDRASTH = $FF1C ; $FF1C: TED Rasterline H
- TEDRASTL = $FF1D ; $FF1D: TED Rasterline L
- TEDRASTC = $FF1E ; $FF1E: TED Rastercolumn
- TEDRASTV = $FF1F ; $FF1F: TED Raster vertical
- TEDROM = $FF3E ; $FF3E: TED ROM ON
- TEDRAM = $FF3F
- *= $1000
- !byte $00,$0c,$10,$0a,$00,$9e,$34,$31,$30,$39,$00,$00,$00
- ; main
- *=$100d
- ;--------------------------------------------------
- ; Commodore 16 Scroll + Color-Washer
- ;--------------------------------------------------
- screen=$0d90
- get =$ffe4
- colram =$0990
- coldstart = $f2a4
- sei
- ldx #$ff
- txs
- lda #$93
- jsr $ffd2
- lda #$ff
- sta $ff00
- sta $ff01
- sta $0a
- sta $0b
- lda #$00
- sta TEDBACK
- sta TEDFRAME
- sta TEDGraph2
- tax
- lda #%01111111
- - sta $0990,x
- inx
- cpx #$28
- bne -
- lda #<scroller
- sta $0314
- lda #>scroller
- sta $0315
- cli
- jmp*
- scroller:
- key: lda #$7f
- sta $fd30
- sta $ff08
- lda $ff08
- cmp #$ef ; space to end
- beq exit
- -- inc $0b ; waste time
- - lda TEDRASTL
- cmp #$ff
- bne -
- lda $0b
- cmp #$1a
- bne --
- and #$00
- sta $0b
- - inc $0a ; softscroll
- lda $0a
- and #$07
- sta TEDGraph2
- cmp #$07
- bne -
- lda #$ff
- sta $0a
- ldx txtpos
- inc txtpos
- lda text,x
- cmp #$00 ; at $00 repeat
- bne +
- ldx #00
- stx txtpos
- beq scroller
- + sta screen+39
- scroll:
- ldx #$00 ; hardscroll
- -- lda screen+1,x
- sta screen,x
- inx
- cpx #40
- bne --
- jsr col_washer
- pla
- tay
- pla
- tax
- pla
- rti
- exit: jmp coldstart
- col_washer:
- ldx #$27
- - lda colors,x
- sta colram,x
- dex
- bpl -
- ldy colors+39
- ldx #$27
- - lda colors-1,X
- sta colors,X
- dex
- bne -
- sty colors
- rts
- txtpos !by $00
- text:
- !scr " a tiny commodore c16 text scroll with green washing in luma stages. if you get"
- !scr " bored about this text or your eyes will burn, press space to end this ..... "
- !scr " this is only a short demonstration for testing several ted registers. "
- !by $00
- colors:
- !by $4c,$4c,$4c,$4c,$4c,$4c,$4c,$4c
- !by $4c,$4c,$4c,$4c,$5c,$5c,$7c,$7c
- !by $7c,$7c,$7c,$7c,$7c,$7c,$7c,$7c
- !by $7c,$7c,$5c,$5c,$4c,$4c,$4c,$4c
- !by $4c,$4c,$4c,$4c,$4c,$4c,$4c,$4c