home *** CD-ROM | disk | FTP | other *** search
-
- :tb18=$c400
- :tb11=$c500
-
- org $c000
-
- sei
- ldx #0
- :tbgl
- txa
- clc
- adc #1
- and #7
- ora #$38
- sta tb11,x ;d011 funktionstabelle
- txa ;generieren
- adc #1
- asl
- asl
- asl
- asl
- ora #8
- and #$7f
- sta tb18,x ;d018 adresstabelle
- inx ;generieren
- cpx #200 ;200 rasterzeilen
- bne tbgl
- lda #$70 ;letzte zeile kein dma
- sta tb11+199 ;und restzeilen schwarz
- lda #$08 ;sowie ruecksetzen
- sta tb18+199 ;von d018
-
- lda #<niq ;neuer irq-vector
- sta $314
- lda #>niq
- sta $315
- lda #$1b
- sta $d011 ;d011 normal
- lda #$18
- sta $d016 ;multicolor
- lda #0
- sta $d015 ;keine sprite-dma stoerung
- sta $d021
- sta $d020
- sta $dc0e ;timer stop
-
- lda #$4c ;neuer timer wert
- sta $dc05 ;fuer ersten irq setzen
- lda #$c7-63 ;-63= 1 rasterzeile hoeher
- sta $dc04
-
- :wl1 ;auf zeile $030
- lda $d011 ;(und nicht $130)
- bpl wl1 ;warten
- :wl2
- lda $d011
- bmi wl2
-
- lda #$30
- :wl3
- cmp $d012
- bne wl3
-
- ldx #$11 ;synchronisation des
- lda #$18 ;timers auf immer dieselbe
- sta $d011 ;horiz. position durch
- stx $dc0e ;dma-zyklen ausgleich
-
- lda #$3b ;hires+normalwert
- sta $d011
-
- lda $dc0d ;evntl. altes irq-flag aus
-
- lda $dd00 ;bank $4000-$8000
- and #$fc ;anwaehlen
- ora #2
- sta $dd00
-
- cli ;los geht's
- rts
-
- :niq
- lda #$9f ;minimalwert der
- sec ;vergangenen zyklen
- sbc $dc04 ;abweichung messen
- cmp #12
- bcc ok
- jmp syncerr ;zuviele zyklen
- :ok
- lsr ;haelfte da nop=2 zyk.
- bcc onecycle ;branch=3 zyk.
- :onecycle ;kein branch 2
- sta restcycle+1
- :restcycle
- bpl restcycle ;einsprung zu nops
- nop ;ausgleich durch nops
- nop
- nop
- nop
- nop
- nop
-
- lda #$30 ;hires display
- sta $d011 ;und 1.dma in zeile $30
-
- nop ;weiteres timing
- nop
- nop
- ldx #0 ;tabellenzeiger reset
-
- :hamloop ;erzeugung
- lda tb18,x ;von 200 dma-zeilen
- sta $d018 ;mit adressumschaltung
- lda tb11,x
- sta $d011
- inx
- cpx #200
- bne hamloop
-
- :iend
- jmp $ea31 ;zur alten irq routine
-
- :syncerr ;timer auf exact
- lda #$4c ;einen bildschirmdurchlauf
- sta $dc05 ;stellen
- lda #$c7
- sta $dc04
- jmp iend
-
-
-