-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplayfield.dasm
124 lines (96 loc) · 2.04 KB
/
playfield.dasm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
processor 6502
INCLUDE "vcs.h"
INCLUDE "macro.h"
INCLUDE "xmacro.h"
seg code
org $F000
Reset
CLEAN_START
ldx #$80
stx COLUBK
lda #$1C
sta COLUPF
StartFrame
;; Turn on VSYNC & VBLANK
lda #02
sta VSYNC
sta VBLANK
;; OUTPUT VSYNC
REPEAT 3
sta WSYNC
REPEND
lda #00
sta VSYNC
;; OUTPUT VBLANK
REPEAT 37
sta WSYNC
REPEND
;; TURN OFF VSYNC & VBLANK
lda #00
sta VBLANK
;;;;;;;;;;;;;;;;;;;;;;;;
;; OUTPUT VIEW AREA
;;;;;;;;;;;;;;;;;;;;;;;;
;; SET UP PF
ldx #%00000001
stx CTRLPF
; clear PF
ldx #0
stx PF0
stx PF1
stx PF2
;; Top PF area
REPEAT 7
sta WSYNC
REPEND
;; Top border of PF
ldx #%11100000
stx PF0
ldx #%11111111
stx PF1
stx PF2
REPEAT 7
sta WSYNC
REPEND
;; Side borders
ldx #%01100000
stx PF0
ldx #%00000000
stx PF1
ldx #%10000000
stx PF2
REPEAT 164
sta WSYNC
REPEND
;; Lower border
ldx #%11101111
stx PF0
ldx #%11111111
stx PF1
stx PF2
REPEAT 7
sta WSYNC
REPEND
;; lower Playfield
ldx #0
stx PF0
stx PF1
stx PF2
REPEAT 7
sta WSYNC
REPEND
;;;;;;;;;;;;;;;;;;;;;;;;
;; OUTPUT OVERSCAN
;;;;;;;;;;;;;;;;;;;;;;;;
lda #2
sta VBLANK
REPEAT 30
sta WSYNC
REPEND
lda #00
sta VBLANK
jmp StartFrame
;; EPILOGUE
org $FFFC
.word Reset
.word Reset