-
Notifications
You must be signed in to change notification settings - Fork 0
/
miner1.a
233 lines (208 loc) · 14.5 KB
/
miner1.a
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
;
; MINER1.a ($7400)
;
!src "constants.a"
* = $7400
; ***************************************************************************************
;
; event called on vsync
;
; ***************************************************************************************
eventV
pha ;
txa ;
pha ;
tya ;
pha ;
php ;
lda #$20 ;
sta $7bfd ; Write a space at the end of the second screen [why?]
sta fsBlockFlagByte ; [why?]
lda #0 ;
sta fsBlockNumberHigh ; [why?]
inc $70 ; increment vsync counter
lda $70 ;
cmp #$10 ;
beq copyToScreen ; show first screen
cmp #$20 ;
beq copyToScreenAgain ; show second screen
exitEventV
plp ;
pla ;
tay ;
pla ;
tax ;
pla ;
rts ;
; ***************************************************************************************
copyToScreen
ldx #0 ;
copyToScreenLoop
lda firstScreen + $0000,X ; copy to screen:
sta mode7Screen + $0000,X ; M N C
lda firstScreen + $0100,X ; A I
sta mode7Screen + $0100,X ;
lda firstScreen + $0200,X ; I E
sta mode7Screen + $0200,X ; M N R
inx ;
bne copyToScreenLoop ;
jmp animateMessageOnScreen ;
copyToScreenAgain
ldx #0
copyToScreenLoop2
lda secondScreen + $0000,X ; copy to screen:
sta mode7Screen + $0000,X ; A I
lda secondScreen + $0100,X ; M N C
sta mode7Screen + $0100,X ;
lda secondScreen + $0200,X ; M N R
sta mode7Screen + $0200,X ; I E
inx ;
bne copyToScreenLoop2 ;
lda #0 ; reset
sta $70 ; counter
animateMessageOnScreen
ldx #0 ;
animateLoop
lda $7f28,X ; read character of message from screen
sta $7f27,X ; write character one space to the left
inx ;
cpx #22 ; loop 22 times
bne animateLoop ;
ldx $71 ; message counter
lda scrollingMessage,X ; read next character of message
sta $7f3d ; write to right edge of the message on screen
inc $71 ; increment message counter
jmp exitEventV ;
fromMiner2
lda #<eventV ; }
sta vectorEVNTV ; }
lda #>eventV ; } install event vector
sta vectorEVNTV + 1 ; }
; *FX 14,4 enable start of vsync
lda #14 ;
ldx #4 ;
ldy #0 ;
jsr OSBYTE ;
; *FX 15,0 flush all internal buffers
waitForSpaceBar
lda #15 ;
ldx #0 ;
jsr OSBYTE ;
; OSBYTE 129 - Read key with time limit
ldx #$ff ;
ldy #$7f ;
lda #129 ;
jsr OSBYTE ;
cpx #charSPACE ;
bne waitForSpaceBar ; if not SPACE then loop back to continue waiting
; *FX 13,4 disable start of vertical sync event
lda #13 ;
ldx #4 ;
ldy #0 ;
jsr OSBYTE ;
; restore original EventV address
sei ;
eventVLow = * + 1
lda #0 ;
sta vectorEVNTV ;
eventVHigh = * + 1
lda #0 ;
sta vectorEVNTV + 1 ;
; enable interrupts
cli ;
jmp afterSpace ; jump back to MINER2.a
; ***************************************************************************************
unused1
!byte 0 ; [UNUSED]
; ***************************************************************************************
miner1Entry
ldx #<runMiner2 ;
ldy #>runMiner2 ;
jmp OSCLI ;
; ***************************************************************************************
runMiner2
!text "RUN MINER2",13,0 ;
; ***************************************************************************************
unused2
!byte 0,0,0,0,0,0,0,0,0,0,0,0 ; [UNUSED]
; ***************************************************************************************
setModeString
!byte 22,7 ; MODE 7 (VDU 22, mode)
!byte 28,5,24,31,22 ; Set text window (VDU 28, left, bottom, right, top)
setModeStringEnd
; ***************************************************************************************
whiteBackgroundString
!text " ",$87, $9d, $84, " ",$9c, 13, 0
unused3
!byte $00, $00, $00, $00, $00 ; [UNUSED]
; ***************************************************************************************
scrollingMessage
!text "Written By D.J.Coathupe Original Program By Matthew Smith "
!text "Guide Miner Willy around 20 lethal caverns collecting keys as you go. . . . . ."
!text " Z - left X - right Return - jump Q - Sound Off S - Sound On "
!text "Delete - Freeze Copy - Continue "
; ***************************************************************************************
;
; graphics
;
; ***************************************************************************************
; teletext graphic:
;
; M N C
; A I
;
; I E
; M N R
;
; (C) Software Projects
firstScreen
!byte ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', $91, $91, $ff, ' ', ' ', ' ', $ff, $93, ' ', ' ', ' ', ' ', ' ', $92, $ff, ' ', ' ', ' ', $ff, $94, ' ', ' ', ' ', $95, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', $91, $91, $ff, $ff, ' ', $ff, $ff, $93, ' ', $ff, $ff, $ff, ' ', $92, $ff, $ff, ' ', ' ', $ff, $94, ' ', ' ', ' ', $95, ' ', $ff, $ff, $ff, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', $91, $91, $ff, ' ', $ff, ' ', $ff, $93, $ff, ' ', ' ', ' ', $ff, $92, $ff, ' ', $ff, ' ', $ff, $94, $ff, $ff, $ff, $95, $ff, ' ', ' ', ' ', $ff, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', $91, $91, $ff, ' ', ' ', ' ', $ff, $93, $ff, ' ', ' ', ' ', $ff, $92, $ff, ' ', ' ', $ff, $ff, $94, ' ', $ff, ' ', $95, $ff, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', $91, $91, $ff, ' ', ' ', ' ', $ff, $93, $ff, $ff, $ff, $ff, $ff, $92, $ff, ' ', ' ', ' ', $ff, $94, ' ', $ff, ' ', $95, $ff, ' ', ' ', ' ', $ff, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', $91, $91, ' ', ' ', ' ', ' ', ' ', $93, $ff, ' ', ' ', ' ', $ff, $92, ' ', ' ', ' ', ' ', ' ', $94, ' ', $ff, ' ', $95, ' ', $ff, $ff, $ff, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', $91, $91, ' ', ' ', ' ', ' ', ' ', $93, ' ', ' ', ' ', ' ', ' ', $92, ' ', ' ', ' ', ' ', ' ', $94, $ff, $ff, $ff, $95, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', $94, ' ', ' ', ' ', ' ', ' ', ' ', $95, $ff, $ff, $ff, $91, ' ', ' ', ' ', ' ', ' ', $93, $ff, $ff, $ff, $ff, $92, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', $94, ' ', ' ', ' ', ' ', ' ', ' ', $95, ' ', $ff, ' ', $91, $ff, ' ', ' ', ' ', $ff, $93, $ff, ' ', ' ', ' ', $92, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', $94, ' ', $ff, ' ', ' ', ' ', $ff, $95, ' ', $ff, ' ', $91, $ff, $ff, ' ', ' ', $ff, $93, $ff, $ff, $ff, $ff, $92, $ff, $ff, $ff, $ff, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', $94, ' ', $ff, $ff, ' ', $ff, $ff, $95, ' ', $ff, ' ', $91, $ff, ' ', $ff, ' ', $ff, $93, $ff, ' ', ' ', ' ', $92, $ff, ' ', ' ', ' ', $ff, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', $94, ' ', $ff, ' ', $ff, ' ', $ff, $95, $ff, $ff, $ff, $91, $ff, ' ', ' ', $ff, $ff, $93, $ff, $ff, $ff, $ff, $92, $ff, $ff, $ff, $ff, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', $94, ' ', $ff, ' ', ' ', ' ', $ff, $95, ' ', ' ', ' ', $91, $ff, ' ', ' ', ' ', $ff, $93, ' ', ' ', ' ', ' ', $92, $ff, ' ', $ff, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', $94, ' ', $ff, ' ', ' ', ' ', $ff, $95, ' ', ' ', ' ', $91, ' ', ' ', ' ', ' ', ' ', $93, ' ', ' ', ' ', ' ', $92, $ff, ' ', ' ', $ff, $ff, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', ' ', ' ', ' ', ' ', '(', 'c', ')', ' ', 'S', 'o', 'f', 't', 'w', 'a', 'r', 'e', ' ', 'P', 'r', 'o', 'j', 'e', 'c', 't', 's', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
; teletext graphic:
;
; A I
; M N C
;
; M N R
; I E
;
; (C) Software Projects
secondScreen
!byte ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', $91, $91, ' ', ' ', ' ', ' ', ' ', $93, ' ', $ff, $ff, $ff, ' ', $92, ' ', ' ', ' ', ' ', ' ', $94, ' ', ' ', ' ', $95, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', $91, $91, ' ', ' ', ' ', ' ', ' ', $93, $ff, ' ', ' ', ' ', $ff, $92, ' ', ' ', ' ', ' ', ' ', $94, $ff, $ff, $ff, $95, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', $91, $91, $ff, ' ', ' ', ' ', $ff, $93, $ff, ' ', ' ', ' ', $ff, $92, $ff, ' ', ' ', ' ', $ff, $94, ' ', $ff, ' ', $95, ' ', $ff, $ff, $ff, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', $91, $91, $ff, $ff, ' ', $ff, $ff, $93, $ff, $ff, $ff, $ff, $ff, $92, $ff, $ff, ' ', ' ', $ff, $94, ' ', $ff, ' ', $95, $ff, ' ', ' ', ' ', $ff, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', $91, $91, $ff, ' ', $ff, ' ', $ff, $93, $ff, ' ', ' ', ' ', $ff, $92, $ff, ' ', $ff, ' ', $ff, $94, ' ', $ff, ' ', $95, $ff, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', $91, $91, $ff, ' ', ' ', ' ', $ff, $93, ' ', ' ', ' ', ' ', ' ', $92, $ff, ' ', ' ', $ff, $ff, $94, $ff, $ff, $ff, $95, $ff, ' ', ' ', ' ', $ff, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', $91, $91, $ff, ' ', ' ', ' ', $ff, $93, ' ', ' ', ' ', ' ', ' ', $92, $ff, ' ', ' ', ' ', $ff, $94, ' ', ' ', ' ', $95, ' ', $ff, $ff, $ff, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', $94, ' ', $ff, ' ', ' ', ' ', $ff, $95, ' ', ' ', ' ', $91, $ff, ' ', ' ', ' ', $ff, $93, ' ', ' ', ' ', ' ', $92, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', $94, ' ', $ff, $ff, ' ', $ff, $ff, $95, ' ', ' ', ' ', $91, $ff, $ff, ' ', ' ', $ff, $93, ' ', ' ', ' ', ' ', $92, $ff, $ff, $ff, $ff, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', $94, ' ', $ff, ' ', $ff, ' ', $ff, $95, $ff, $ff, $ff, $91, $ff, ' ', $ff, ' ', $ff, $93, $ff, $ff, $ff, $ff, $92, $ff, ' ', ' ', ' ', $ff, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', $94, ' ', $ff, ' ', ' ', ' ', $ff, $95, ' ', $ff, ' ', $91, $ff, ' ', ' ', $ff, $ff, $93, $ff, ' ', ' ', ' ', $92, $ff, $ff, $ff, $ff, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', $94, ' ', $ff, ' ', ' ', ' ', $ff, $95, ' ', $ff, ' ', $91, $ff, ' ', ' ', ' ', $ff, $93, $ff, $ff, $ff, $ff, $92, $ff, ' ', $ff, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', $94, ' ', ' ', ' ', ' ', ' ', ' ', $95, ' ', $ff, ' ', $91, ' ', ' ', ' ', ' ', ' ', $93, $ff, ' ', ' ', ' ', $92, $ff, ' ', ' ', $ff, $ff, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', $94, ' ', ' ', ' ', ' ', ' ', ' ', $95, $ff, $ff, $ff, $91, ' ', ' ', ' ', ' ', ' ', $93, $ff, $ff, $ff, $ff, $92, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', ' ', ' ', ' ', ' ', '(', 'c', ')', ' ', 'S', 'o', 'f', 't', 'w', 'a', 'r', 'e', ' ', 'P', 'r', 'o', 'j', 'e', 'c', 't', 's', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
!byte ' ', ' ', ' ', ' ', $00, $81, $00, $00