I got strange results:
Quote
;Scrolling color border thingy
processor 6502
include "vcs.h"
include "macro.h"
SEG
ORG $F000
Reset
; Clear RAM and all TIA registers
ldx #0
lda #0
Clear sta 0,x
inx
bne Clear
;------------------------------------------------
; Once-only initialisation...
;lda #0
lda #$45
sta COLUPF ; set the playfield colour
lda #$1F
sta COLUBK ; set the playfield colour
lda #%00000001
sta CTRLPF ; reflect playfield
StartOfFrame
; Start of vertical blank processing
lda #0
sta VBLANK
lda #2
sta VSYNC
; 3 scanlines of VSYNCH signal...
sta WSYNC
sta WSYNC
sta WSYNC
lda #0
sta VSYNC
sta WSYNC
; 37 scanlines of vertical blank...
ldx #0
VerticalBlank sta WSYNC
inx
cpx #36 ; Now waiting 36 lines
bne VerticalBlank
DrawField
ldx #0 ; this counts our scanline number
lda #%11111111
;lda #%00000000
sta PF0
sta PF1
sta PF2
Top2
sta WSYNC
lda #$45
sta COLUPF
lda #0
inx
cpx #15
bne Top2
lda #%11111111
sta PF0
sta PF1
sta PF2
Top3
sta WSYNC
lda #$45
sta COLUPF
lda #0
inx
cpx #30
bne Top3
lda #%11111111
sta PF0
lda #%11111111
sta PF1
lda #%00001111
sta PF2
Top4
sta WSYNC
lda #$45
sta COLUPF
lda #0
inx
cpx #45
bne Top4
lda #%11111111
sta PF0
sta PF1
lda #%00000000
sta PF2
Top5
sta WSYNC
lda #$45
sta COLUPF
lda #0
inx
cpx #60
bne Top5
lda #%11111111
sta PF0
lda #%11110000
sta PF1
lda #%00000000
sta PF2
Middle
sta WSYNC
lda #$45
sta COLUPF
lda #0
inx
cpx #105
bne Middle
lda #%00000000
sta PF0
sta PF1
sta PF2
Bottom1
sta WSYNC
lda #$45
sta COLUPF
lda #0
inx
cpx #120
bne Bottom1
lda #%11111111
sta PF0
lda #%11110000
sta PF1
lda #%00000000
sta PF2
Bottom2
sta WSYNC
lda #$45
sta COLUPF
lda #0
inx
cpx #135
bne Bottom2
lda #%11111111
sta PF0
sta PF1
lda #%00000000
sta PF2
Bottom3
sta WSYNC
lda #$45
sta COLUPF
lda #0
inx
cpx #150
bne Bottom3
lda #%11111111
sta PF0
sta PF1
lda #%00001111
sta PF2
Bottom4
sta WSYNC
lda #$45
sta COLUPF
lda #0
inx
cpx #165
bne Bottom4
lda #%11111111
sta PF0
sta PF1
sta PF2
Bottom5
sta WSYNC
lda #$45
sta COLUPF
lda #0
inx
cpx #192
bne Bottom5
lda #%0
;lda #%11111111
sta PF0
sta PF1
sta PF2
;------------------------------------------------
;lda #%01000010
sta VBLANK ; end of screen - enter blanking
; 30 scanlines of overscan...
ldx #0
Overscan sta WSYNC
inx
cpx #30
bne Overscan
jmp StartOfFrame
;------------------------------------------------------------------------------
ORG $FFFA
InterruptVectors
.word Reset ; NMI
.word Reset ; RESET
.word Reset ; IRQ
END
processor 6502
include "vcs.h"
include "macro.h"
SEG
ORG $F000
Reset
; Clear RAM and all TIA registers
ldx #0
lda #0
Clear sta 0,x
inx
bne Clear
;------------------------------------------------
; Once-only initialisation...
;lda #0
lda #$45
sta COLUPF ; set the playfield colour
lda #$1F
sta COLUBK ; set the playfield colour
lda #%00000001
sta CTRLPF ; reflect playfield
StartOfFrame
; Start of vertical blank processing
lda #0
sta VBLANK
lda #2
sta VSYNC
; 3 scanlines of VSYNCH signal...
sta WSYNC
sta WSYNC
sta WSYNC
lda #0
sta VSYNC
sta WSYNC
; 37 scanlines of vertical blank...
ldx #0
VerticalBlank sta WSYNC
inx
cpx #36 ; Now waiting 36 lines
bne VerticalBlank
DrawField
ldx #0 ; this counts our scanline number
lda #%11111111
;lda #%00000000
sta PF0
sta PF1
sta PF2
Top2
sta WSYNC
lda #$45
sta COLUPF
lda #0
inx
cpx #15
bne Top2
lda #%11111111
sta PF0
sta PF1
sta PF2
Top3
sta WSYNC
lda #$45
sta COLUPF
lda #0
inx
cpx #30
bne Top3
lda #%11111111
sta PF0
lda #%11111111
sta PF1
lda #%00001111
sta PF2
Top4
sta WSYNC
lda #$45
sta COLUPF
lda #0
inx
cpx #45
bne Top4
lda #%11111111
sta PF0
sta PF1
lda #%00000000
sta PF2
Top5
sta WSYNC
lda #$45
sta COLUPF
lda #0
inx
cpx #60
bne Top5
lda #%11111111
sta PF0
lda #%11110000
sta PF1
lda #%00000000
sta PF2
Middle
sta WSYNC
lda #$45
sta COLUPF
lda #0
inx
cpx #105
bne Middle
lda #%00000000
sta PF0
sta PF1
sta PF2
Bottom1
sta WSYNC
lda #$45
sta COLUPF
lda #0
inx
cpx #120
bne Bottom1
lda #%11111111
sta PF0
lda #%11110000
sta PF1
lda #%00000000
sta PF2
Bottom2
sta WSYNC
lda #$45
sta COLUPF
lda #0
inx
cpx #135
bne Bottom2
lda #%11111111
sta PF0
sta PF1
lda #%00000000
sta PF2
Bottom3
sta WSYNC
lda #$45
sta COLUPF
lda #0
inx
cpx #150
bne Bottom3
lda #%11111111
sta PF0
sta PF1
lda #%00001111
sta PF2
Bottom4
sta WSYNC
lda #$45
sta COLUPF
lda #0
inx
cpx #165
bne Bottom4
lda #%11111111
sta PF0
sta PF1
sta PF2
Bottom5
sta WSYNC
lda #$45
sta COLUPF
lda #0
inx
cpx #192
bne Bottom5
lda #%0
;lda #%11111111
sta PF0
sta PF1
sta PF2
;------------------------------------------------
;lda #%01000010
sta VBLANK ; end of screen - enter blanking
; 30 scanlines of overscan...
ldx #0
Overscan sta WSYNC
inx
cpx #30
bne Overscan
jmp StartOfFrame
;------------------------------------------------------------------------------
ORG $FFFA
InterruptVectors
.word Reset ; NMI
.word Reset ; RESET
.word Reset ; IRQ
END













