Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- processor 6502
- include "vcs.h"
- include "macro.h"
- seg
- org $2000
- rorg $f000
- switch:
- lda $1ff9
- repeat 5
- nop
- repend
- lda #$20
- sta PF0
- lda $1ff8
- rts
- seg
- org $f000
- rorg $f000
- jsr switch
- Temp = $80
- ;PatternCounter = $81
- ;ScrollCounter = $82
- ;FrameCounter = $83
- ;Change = $84
- jsr ResetRAM
- lda #%10110000
- sta Temp
- Reset:
- StartFrame:
- ; Start vertical blank
- lda #$00
- sta VBLANK
- lda #2
- sta VSYNC
- sta WSYNC
- sta WSYNC
- sta WSYNC
- lda #$00
- sta VSYNC
- ; End of Vertical Sync
- ldx #37
- vbloop:
- sta WSYNC
- dex
- bne vbloop
- ;End of vertical blank
- ; Pre values for 192 scanlines
- sta COLUPF
- lda #%00000001
- ; 192 Scanlines of Visible Screen
- ldx #192
- l1:
- stx COLUBK
- sta WSYNC
- dex
- bne l1
- ; End of Visible Screen
- ; Start of VBLANK / Overscan
- lda #%01000010
- ldx #30
- sta VBLANK
- osloop:
- sta WSYNC
- dex
- bne osloop
- jmp StartFrame
- ResetRAM:
- lda #$00
- ldx #$80
- resetloop:
- sta Temp,x
- dex
- bne resetloop
- rts
- coltable:
- .byte $01,$02,$03,$04,$05,$06,$07
- .byte $0a,$0b,$0c,$0d,$0e,$0f,$10
- .byte $13,$14,$15,$16,$17,$18,$19
- .byte $1c,$1d,$1e,$1f,$20,$21,$22
- .byte $25,$26,$27,$28,$29,$2a,$2b
- .byte $2e,$2f,$30,$31,$32,$33,$34
- .byte $37,$38,$39,$3a,$3b,$3c,$3d
- .byte $40,$41,$42,$43,$44,$45,$46
- .byte $49,$4a,$4b,$4c,$4d,$4e,$4f
- .byte $52,$53,$54,$55,$56,$57,$58
- .byte $5b,$5c,$5d,$5e,$5f,$60,$61
- .byte $64,$65,$66,$67,$68,$69,$6a
- .byte $6d,$6e,$6f,$70,$71,$72,$73
- .byte $76,$77,$78,$79,$7a,$7b,$7c
- .byte $7f,$80,$81,$82,$83,$84,$85
- .byte $88,$89,$8a,$8b,$8c,$8d,$8e
- .byte $91,$92,$93,$94,$95,$96,$97
- .byte $9a,$9b,$9c,$9d,$9e,$9f,$a0
- .byte $a3,$a4,$a5,$a6,$a7,$a8,$a9
- .byte $ac,$ad,$ae,$af,$b0,$b1,$b2
- .byte $b5,$b6,$b7,$b8,$b9,$ba,$bb
- .byte $bc,$bd,$bc,$bd,$be,$bf
- org $fffa
- .word Reset
- .word Reset
- .word Reset
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement