-
Notifications
You must be signed in to change notification settings - Fork 1
/
v3.0 3d00.asm
377 lines (372 loc) · 7.57 KB
/
v3.0 3d00.asm
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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
* = $3D00
;.D V3.0 3D00
; *** INTERRUPT/ MISC ROUTINES.
JMP SETUP; 15616 / 1000 / SETUP INITIAL POINTERS/INITIALIZE INTERRUPTS
JMP LOCKUPS; 15619 / 2000 / INTERRUPTS
JMP OVERLAY; 15622 / 3000 / SET UP OVERLAY POINTERS
JMP UNDERLAY; 15625 / 4000 / RESET BASIC VECTORS
JMP CURSOR; 15628 / 5000 / 40 COLUMN CURSOR CONTROL
JMP ONWINDOW; 15631 / 6000 / SEND STRING TO POSITION ON WINDOW
JMP CLEAR1; 15634 / 7000 / SET VARS FOR CLEAR
JMP CLEAR2; 15637 / 7500 / RESET VARS FOR CLEAR
;******************SETUP INITIAL IMPORTANT VALUES********************
SETUP
SEI; ITS A DIRTY JOB...
LDA $0314
STA PLACE
LDA $0315
STA PLACE+1; IRQ VECTORS
LDA #$03
STA $0314
LDA #$3D
STA $0315; REPLACE WITH NEW IRQ
LDX $0BA9; * SAVE RAMDOS DRIVE
LDY #$00
TYA;***CLEAR POINTER AREA
CLRLOP
STA $0B02,Y
INY
CPY #$F0
BNE CLRLOP
STX $0BA9; * RESTORE RAMDOS DRIVE
LDA $D7
CMP #$80
BEQ CUR80; CHECK COLUMNS
LDA #$38
STA $1FF8; USING SPRITE NUMBER 1
LDA #$01
STA $D015; TURN SPRITE ON
LDA #$00
STA $D017
STA $D01B
STA $D01C
STA $D01D; DEFAULTS
LDA #$00
STA $D020
STA $D021; BACKGROUND DEFAULTS
JMP CUR40
CUR80
NOP;PUT 80 COL CURSOR SETUP HERE
CUR40
CLI
RTS
PLACE
NOP
NOP
;***********************INTERRUPT ROUTINES*****************
LOCKUPS
SEI
LDA $0B07
BNE NOCHK
LDA $DD01;****IGNORE CARRIER CHECKS FOR SYSOP
AND $0B24
CMP $0B25
BNE NOCHK
JMP LOGOFF;**CARRIER FAIL
NOCHK
LDA $0B62
BEQ LOCHK
LDA $DD0A
CMP #$05
BNE NOCHK2
LDA $DD0B
CMP #$12
BNE NOCHK2
LDA #$00
STA $0B62
LOCHK
LDA $DD0A
BNE NOCHK2
LDA $DD0B
CMP $0B90
BNE LICHK
LDA $0B91
BNE LICHK
LDA #$01
STA $0B91
LICHK
CMP #$12
BNE NOCHK2
LDA $0B40
LDX $0B3F
CMP $0B40,X
BEQ SKP1
INC $0B40
JMP SOCHK
SKP1
LDA #$01
STA $0B40
LDA $0B3F
CMP #$0C
BEQ SOCHK2
INC $0B3F
JMP SOCHK
SOCHK2
LDA #$01
STA $0B3F
INC $0B2F
SOCHK
LDA #$01
STA $0B62
NOCHK2
LDA $0B08
BEQ LOGOFF
LDA $D3
AND #$08;***CHECK ALT
STA $0B4D
BEQ NOALT
LDA $0B71
BEQ NOALT
LDA $0B72
BNE NOALT
JSR LOCKALT
NOALT
LDA $DC00
CMP #$6F
BNE INRR
LDA $D4
CMP #$58
BNE INRR
LDA #$08
STA $0B4D;**DO BUTTON
INRR
LDA $0B09
BEQ TIMEUP; TIME UP
LDA $0B0A; CHECK A TICK
CMP $DD0A
BNE INRC
JMP OUTA
TIMEUP
LDA #$00
STA $0B08
STA $0B09
LOGOFF
LDA #$01
STA $0B0B;***LOGOFFFLAG
OUTA
LDA $DD08
JMP (PLACE); GOODBYE
INRC
LDA $DD0A
STA $0B0A
DEC $0B09;*****LOSE ONE TICK
DEC $0BA7
LDA $0B09
BNE SLTM
LDA $0BA7
BEQ TIMEUP
SLTM
NOP
LDA $0B9E
BEQ INRR;**CHK IDLE
LDA $0B07
BNE INRR
DEC $0B9D
BNE INRR
JMP TIMEUP
;**************SET UP BASIC OVERLAY NEXTS****************
OVERLAY
LDA $0B05
BNE OVRCONT
LDA $1210
STA $0B02
LDA $1211
STA $0B03; SAVE END BASIC POINTERS
LDA $2D
STA $0B04
LDA $2E
STA $0B05; SAVE START OF BASIC POINTERS
OVRCONT
LDA $0B02
SEC
SBC #$02
STA $2D
LDA $0B03
SBC #$00
STA $2E
LDA #$01
STA $0B06
RTS
LOCKALT
LDY #$00
ALP
LDA BIXIT,Y
STA $034A,Y
INY
CPY #$08
BNE ALP
STY $D0
RTS
BIXIT
BYTE 83,89,83,56,50,52,51,13
;**********RESTORE OLD BASIC POINTERS***************
UNDERLAY
LDA $0B06
BEQ ALLSET
LDA $0B04
STA $2D
LDA $0B05
STA $2E; RESET START OF BASIC
ALLSET
LDA #$00
STA $0B06
RTS
;*************40 COLUMN CURSOR CONTROLER******************
CURSOR
LDA $D7
CMP #$80
BEQ CURS80; SKIP IF 80 COLUMNS
LDA #$01
STA $D015
LDA #$38
STA $1FF8
STA $07F8
LDA $F1
STA $D027; SPRITE COLOR
LDA $EB; CURSOR Y COORD CONTROL
CLC
ASL
ASL
ASL
ADC #$32
STA $D001
LDA $EC; CURSOR X COORD CONTROL
CMP #$28
BCC OVRBDR;OVER BOUNDRY
SEC
SBC #$28
OVRBDR
CMP #$1F
BCS SKIP0;FORGOT WHAT THIS DOES
ASL
ASL
ASL
ADC #$08
STA $D000
LDA #$00
STA $D010;LEFT SIDE OF BORDER
JMP CURS80
SKIP0
SEC
SBC #$1F
ASL
ASL
ASL
STA $D000
LDA #$01
STA $D010;RIGHT SIDE OF BORDER
CURS80
RTS
;**************ROUTINE TO POSITION A STRING ON THE WINDOW****************
ONWINDOW
LDY #$00
ONWINLP
LDA $E0,Y
STA $0B30,Y;*TEMP STORAGE
INY
CPY #$0F
BNE ONWINLP
LDA #$00
STA $E5
STA $E6;* RESET WINDOWS
LDA #$18
STA $E4
LDA $EE
STA $E7
LDA $0B2D
STA $EC
LDA $0B2E
STA $EB
JSR $C15C;*SET CRSR POSITIONS
LDY #$09
LDA #$2F
LDX #$01
JSR $FF74
STA $FB;*BEGIN STRING OUT
INY
LDA #$2F
LDX #$01
JSR $FF74
STA $FC
INY
LDA #$2F
LDX #$01
JSR $FF74
STA $FD
LDY #$00
ONWINLP2
LDA #$FC
LDX #$01
JSR $FF74
STA $FE
JSR $FFD2;*SEND STRING
INY
CPY $FB
BNE ONWINLP2
LDY #$00
ONWINLP3
LDA $0B30,Y
STA $E0,Y;*RESTORE OLD VALUES
INY
CPY #$0F
BNE ONWINLP3
LDA #$00
STA $F3
STA $F4
STA $F5
RTS
;****************ROUTINE TO SET VAR POINTERS BEFORE CLR*******************
CLEAR1
LDA $032C
STA $0B51
LDA $032D
STA $0B52
LDY #$00
CLRLP
LDA $2F,Y
STA $0B53,Y
INY
CPY #$0D
BNE CLRLP
LDA #$EF
STA $032C
LDA #$84
STA $032D
RTS
STA $7D
STY $7E
JSR $5AE1
LDX #$1B
STX $18
PLA
TAY
PLA
LDX #$FA
TXS
PHA
TYA
PHA
LDA #$00
STA $1203
STA $12
STA $03DF
CLI
RTS
;****************ROUTINE TO RESTORE POINTERS AFTER CLR*******************
CLEAR2
LDA $0B51
STA $032C
LDA $0B52
STA $032D
LDY #$00
CLRLP2
LDA $0B53,Y
STA $2F,Y
INY
CPY #$0D
BNE CLRLP2
RTS
PRINT
NOP
;
;'OPEN1,8,15,"S0:ML3D00,V3.0 3D00":CLOSE1:SAVE"ML3D00",8