8bitworkshop.com {"platform":"vcs"}
This file contains 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
;; Atari 2600 Recurse Center logo (or something resembling it...) | |
;; Julian Squires <julian@cipht.net> / 2017 | |
processor 6502 | |
include "vcs.h" | |
include "macro.h" | |
;; these macros are from 8bitworkshop | |
MAC TIMER_SETUP | |
.lines SET {1} | |
lda #(((.lines-1)*76-14)/64) | |
sta WSYNC | |
sta TIM64T | |
ENDM | |
MAC TIMER_WAIT | |
.waittimer | |
lda INTIM | |
bne .waittimer | |
ENDM | |
seg.u variables | |
org $80 | |
seg code | |
org $f000 | |
start | |
CLEAN_START | |
frame | |
VERTICAL_SYNC | |
TIMER_WAIT 37 | |
;; colors! | |
lda #$0e | |
sta COLUBK | |
lda #$c6 ; or maybe $c2, $c3, $d0 | |
sta COLUP0 | |
sta COLUP1 | |
lda #$00 | |
sta COLUPF | |
lda #%11000 | |
sta CTRLPF | |
TIMER_WAIT ; end of vbl | |
ldx #37 | |
.vblank sta WSYNC | |
dex | |
bne .vblank | |
; Disable VBLANK | |
stx VBLANK | |
ldy #7 | |
stx PF0 | |
stx PF1 | |
stx PF2 | |
sta WSYNC | |
SLEEP 39 | |
sta RESP0 | |
sta RESP1 | |
.initial_margin | |
sta WSYNC | |
dey | |
bne .initial_margin | |
;; 16 times: | |
ldy #16 | |
next_line: | |
ldx #7 | |
;; load next row of stuff | |
.1 lda #0 | |
sta PF0 | |
;lda pf1data,y | |
sta PF1 | |
lda pf2data,y | |
sta PF2 | |
lda grp0data,y | |
sta GRP0 | |
;lda grp1data,y | |
;sta GRP1 | |
lda nusiz0data,y | |
sta NUSIZ0 | |
lda pf0data1,y | |
sta PF0 | |
lda pf1data1,y | |
sta PF1 | |
lda #0 | |
sta PF2 | |
;; loop for 7 lines | |
sta WSYNC | |
dex | |
bne .1 | |
lda pf0data,y | |
sta PF0 | |
.if 0 | |
lda hmp0data,y | |
beq .2 | |
sta HMP0 | |
sta WSYNC | |
lda pf0data1,y | |
sta PF0 | |
SLEEP 70 | |
sta HMOVE | |
dey | |
bne next_line | |
.endif | |
.2 | |
lda pf1data,y | |
sta PF1 | |
lda pf2data,y | |
sta PF2 | |
SLEEP 4 | |
lda pf0data1,y | |
sta PF0 | |
lda pf1data1,y | |
sta PF1 | |
lda #0 | |
sta PF2 | |
sta WSYNC | |
dey | |
bne next_line | |
ldy #56 | |
lda #$00 | |
sta PF0 | |
sta PF1 | |
sta PF2 | |
.3 | |
sta WSYNC | |
dey | |
bne .3 | |
lda #2 | |
sta VBLANK | |
;; overscan | |
TIMER_SETUP 29 | |
TIMER_WAIT | |
jmp frame | |
align $100 | |
pf0data: .byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 | |
pf1data: .byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 | |
pf2data: .byte 0,$fc,$ac,$5c,$f8,$c0,$fc,$04,$f4,$f4,$f4,$f4,$f4,$f4,$04,$fc,0 | |
pf0data1: .byte 0,$f0,$a0,$50,$f0,$30,$f0,0,$f0,$f0,$f0,$f0,$f0,$f0,0,$f0,0 | |
pf1data1: .byte 0,$c0,$c0,$c0,$80,0,$c0,$40,$40,$40,$40,$40,$40,$40,$40,$c0,0 | |
grp0data: .byte 0,0,0,0,0,0,0,0,0,0, $6c, 0, $a8, 0,0,0 | |
nusiz0data: .byte 0,0,0,0,0,0,0,0,0,0, $37, 0, $37, 0,0,0 | |
hmp0data: .byte 0,0,0,0,0,0,0,0,0,0,0,0, 0, 0, 0,0,0 | |
org $fffc | |
.word start | |
.word start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment