summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vcsdrive.asm62
1 files changed, 55 insertions, 7 deletions
diff --git a/vcsdrive.asm b/vcsdrive.asm
index c271652..22a9db0 100644
--- a/vcsdrive.asm
+++ b/vcsdrive.asm
@@ -24,6 +24,8 @@
include vcs.asm
+bgcolour equ $81
+
org $f000
; Set up stack pointer
@@ -40,13 +42,59 @@ start:
dex
bne zero
- ; Set background
- lda #$3e
- clc
-.loop:
- sta COLUBK
- adc #1
- jmp loop
+ ; Start frame
+next_frame:
+ lda #2
+ ldy bgcolour
+ sta VBLANK
+ sty COLUBK
+ iny
+ sta VSYNC
+ sty COLUBK
+ iny
+ sta WSYNC
+ sty COLUBK
+ iny
+ sta WSYNC
+ sty COLUBK
+ iny
+ sta WSYNC
+ sty COLUBK
+ iny
+ lda #0
+ sta VSYNC
+
+ ; Do VBLANK
+ ldx #37
+.vblank:
+ sta WSYNC
+ dex
+ bne vblank
+ lda #0
+ sta VBLANK
+
+ ; Draw 192 visible scan lines
+ ldx #192
+.scanlines:
+ sty COLUBK
+ sta WSYNC
+ iny
+ dex
+ bne scanlines
+
+ ; Complete the frame
+ lda #2
+ sta VBLANK
+ ldx #30
+.complete:
+ sty COLUBK
+ iny
+ sta WSYNC
+ dex
+ bne complete
+
+ dec bgcolour
+ jmp next_frame
; Set start adresses and pad ROM
org $fffc