Created
September 14, 2017 02:45
-
-
Save futureperfect/e9ee4fef95e4b5aa3773387bae66048d to your computer and use it in GitHub Desktop.
Atari 2600 - Draw colored stripes to screen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; stripes.asm | |
; | |
; Example Atari 2600 program - paints | |
; colored stripes to the screen | |
; | |
; dasm stripes.asm -f3 -ostripes.bin | |
; | |
; | |
processor 6502 | |
include "vcs.h" | |
include "macro.h" | |
SEG | |
ORG $F000 | |
Reset: | |
StartOfFrame: | |
lda #0 ; Start of vertical blank processing | |
sta VBLANK | |
lda #2 | |
sta VSYNC | |
REPEAT 3 | |
sta WSYNC | |
REPEND | |
lda #0 | |
sta VSYNC | |
REPEAT 37 ; 37 scanlines of vertical blank... | |
sta WSYNC | |
REPEND | |
ldx #0 | |
REPEAT 192 ; 192 scanlines of picture... | |
inx | |
stx COLUBK | |
sta WSYNC | |
REPEND | |
Overscan: | |
lda #%01000010 ; turn "off" beam | |
sta VBLANK ; end of screen - enter blanking | |
REPEAT 30 ; 30 scanlines of overscan... | |
sta WSYNC | |
REPEND | |
jmp StartOfFrame | |
ORG $FFFA ; Cart config (so 6502 can start it up) | |
.word Reset ; NMI | |
.word Reset ; RESET | |
.word Reset ; IRQ | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment