Rev 665 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
623 | savelij | 1 | |
761 | savelij | 2 | ;LAST UPDATE: 06.08.2017 savelij |
623 | savelij | 3 | |
4 | include ../../macros.a80 |
||
761 | savelij | 5 | include ../../bas_trd_vars.a80 |
623 | savelij | 6 | |
7 | ORG 0 |
||
8 | di |
||
9 | ld a,7 |
||
10 | OUT (0XFE),A |
||
11 | jr loc_9 |
||
12 | |||
13 | DB 1 |
||
14 | RST_8 JP $ |
||
15 | |||
16 | loc_9 ld a,3Fh |
||
17 | jr loc_1B |
||
18 | |||
19 | nop |
||
20 | RST_10 jp PRINT_A_ |
||
21 | |||
22 | DUPL 0X0018-$,0XFF |
||
23 | RST_18 jp PRINT_MSG ; |
||
24 | |||
25 | loc_1B LD I,A |
||
26 | XOR A |
||
27 | JR loc_24 |
||
28 | |||
29 | DUPL 0X0020-$,0XFF |
||
30 | RST_20 jp CALL2BASIC |
||
31 | |||
32 | ret |
||
33 | |||
34 | loc_24 LD B,A |
||
35 | LD C,A |
||
36 | jr loc_2B |
||
37 | |||
38 | DUPL 0X0028-$,0XFF |
||
39 | RST_28 jp ADR_OPEN_CHAN |
||
40 | |||
41 | loc_2B LD SP,0XFFFF |
||
42 | jr loc_3A |
||
43 | |||
44 | RST_30 JP $ |
||
45 | |||
665 | savelij | 46 | loc_33 |
47 | |||
623 | savelij | 48 | DUPL 0X0038-$,0FFh |
49 | RST_38 ei |
||
50 | ret |
||
51 | |||
52 | loc_3A REPT 8 |
||
53 | PUSH BC |
||
54 | ENDM |
||
55 | LD HL,0XA500 |
||
56 | ADD HL,SP |
||
57 | JR C,loc_3A |
||
58 | ld (P_RAMT),hl |
||
59 | ld de,3EAFh ; UDG 48 |
||
60 | ld bc,0A8h |
||
61 | ld a,e |
||
62 | ex de,hl |
||
63 | ld sp,6000h |
||
64 | ld (TRD_5F00),hl |
||
65 | ld hl,loc_79 |
||
66 | push hl |
||
67 | ld hl,loc_3D2F |
||
68 | push hl |
||
69 | ld hl,0B8EDh ; LDDR |
||
70 | jr EXECUTECOM2HL |
||
71 | |||
72 | jp MAGIC |
||
73 | |||
74 | EXECUTECOM2HL ld (TRD_5F10),hl |
||
75 | push af |
||
76 | ld a,0C9h |
||
77 | ld (TRD_5F12),a |
||
78 | pop af |
||
79 | ld hl,(TRD_5F00) |
||
80 | jp TRD_5F10 |
||
81 | |||
82 | loc_79 ex de,hl |
||
83 | inc hl |
||
84 | ld (UDG),hl |
||
85 | dec hl |
||
86 | ld bc,40h |
||
87 | ld (RASP),bc |
||
88 | ld (RAMTOP),hl |
||
89 | ld hl,3C00h ; 48 |
||
90 | ld (CHARS),hl |
||
91 | ld hl,(RAMTOP) |
||
92 | ld (hl),3Eh |
||
93 | dec hl |
||
94 | ld sp,hl |
||
95 | dec hl |
||
96 | dec hl |
||
97 | ld (ERR_SP),hl |
||
98 | ld de,1303h |
||
99 | push de |
||
100 | im 1 |
||
101 | ld iy,ERR_NR |
||
102 | ld hl,TRD_5CB6 ; INTERFACE1 |
||
103 | ld (CHANS),hl |
||
104 | ld de,15AFh |
||
105 | ld bc,15h |
||
106 | ex de,hl |
||
107 | call COPY_BAS2VARS |
||
108 | ex de,hl |
||
109 | dec hl |
||
110 | ld (DATADD),hl |
||
111 | inc hl |
||
112 | ld (PROG),hl |
||
113 | loc_BE ld (VARS),hl |
||
114 | ld (hl),80h |
||
115 | inc hl |
||
116 | ld (E_LINE),hl ; |
||
117 | ld (hl),0Dh |
||
118 | inc hl |
||
119 | ld (hl),80h |
||
120 | inc hl |
||
121 | ld (WORKSP),hl |
||
122 | ld (STKBOT),hl |
||
123 | ld (STKEND),hl |
||
124 | ld a,38h |
||
125 | ld (ATTR_P),a |
||
126 | ld (ATTR_T),a |
||
127 | ld (BORDCR),a |
||
128 | ld hl,223h |
||
129 | ld (REPDEL),hl |
||
130 | dec (iy-3Ah) |
||
131 | dec (iy-36h) |
||
132 | ld hl,15C6h |
||
133 | ld de,STRMS |
||
134 | ld bc,0Eh |
||
135 | call COPY_BAS2VARS |
||
136 | set 1,(iy+1) |
||
137 | ld hl,TRD_5CC2 ; #C9. TR-DOS BASIC |
||
138 | ld (hl),0C9h |
||
139 | rst 20h |
||
140 | dw 0EDFh ; ฎ็จแโช กใไฅเ ฏเจญโฅเ |
||
141 | ld hl,DF_SZ |
||
142 | ld (hl),2 |
||
143 | ld hl,128Bh |
||
144 | push hl |
||
145 | ld a,0AAh |
||
146 | LD (NOT_USED),A |
||
147 | ei |
||
148 | jp IN_DOS_15616 |
||
149 | |||
150 | COPY_BAS2VARS ld (TRD_5F00),hl |
||
151 | ld hl,loc_3D2F |
||
152 | push hl |
||
153 | ld hl,0B0EDh ; LDIR |
||
154 | ld (TRD_5F10),hl |
||
155 | ld hl,(TRD_5F00) |
||
156 | jp TRD_5F10 |
||
157 | |||
158 | WORK4AUTORUN call DELETE_BUF ; |
||
159 | call CLEAR_SCREEN ; |
||
160 | ld hl,(E_LINE) ; |
||
161 | inc hl |
||
162 | ld e,(hl) |
||
163 | inc hl |
||
164 | ld d,(hl) |
||
165 | ld a,d |
||
166 | or e |
||
167 | ex de,hl |
||
168 | jr z,loc_140 |
||
169 | xor a |
||
170 | ld (TRD_5D10),a ; |
||
171 | loc_140 push hl |
||
172 | call RESTORE_SP ; |
||
173 | pop hl |
||
174 | ld (NEWPPC),hl |
||
175 | xor a |
||
176 | ld (NSPPS),a |
||
177 | rst 20h |
||
178 | dw 16B0h ; ใแโ ญฎขช ฎกซ แโจ เฅค ชโจเฎข ญจ๏ คฎ ฌจญจฌใฌ |
||
179 | ld hl,(PROG) |
||
180 | dec hl |
||
181 | ld (DATADD),hl |
||
182 | ld sp,(ERR_SP) |
||
183 | ld a,(TRD_5D10) ; |
||
184 | or a |
||
185 | ld hl,1B76h |
||
186 | jr z,loc_166 |
||
187 | rst 20h |
||
188 | dw 1BB0h ; แฎฎก้ฅญจฅ "Ok" |
||
189 | loc_166 push hl |
||
190 | ld hl,TRD_5CC2 ; #C9. TR-DOS BASIC |
||
191 | push hl |
||
192 | ret |
||
193 | |||
194 | loc_16C DUPL 3,0 |
||
195 | call CREATE_BUF ; |
||
196 | ld a,0FFh |
||
197 | ld (TRD_5D15),a ; 0, TR-DOS. |
||
198 | xor a |
||
199 | ld (TRD_5CF7),a |
||
200 | ld a,0AAh |
||
201 | ld (TRD_5D17),a ; , #AA |
||
202 | ld hl,CP_ERROR ; |
||
203 | ld (TRD_5D1A),hl ; |
||
204 | ld hl,0 |
||
205 | add hl,sp |
||
206 | ld (TRD_5D1C),hl ; SP |
||
207 | dec hl |
||
208 | dec hl |
||
209 | ld sp,hl |
||
210 | call MARK_SP ; |
||
211 | ld hl,(RAMTOP) |
||
212 | ld de,(CH_ADD) |
||
213 | sbc hl,de |
||
214 | ex de,hl |
||
215 | jr nc,loc_1A5 |
||
216 | or a |
||
217 | ld de,257 |
||
218 | sbc hl,de |
||
219 | loc_1A5 ld (CH_ADD),hl |
||
220 | loc_1A8 call CP_0D_OR_80 |
||
221 | loc_1AB jp z,END_COMAND |
||
222 | cp 0EAh ; REM |
||
223 | inc hl |
||
224 | jr nz,loc_1A8 |
||
225 | call CP_0D_OR_80 |
||
226 | jr z,loc_1AB |
||
665 | savelij | 227 | cp ':' |
623 | savelij | 228 | jp nz,END_COMAND |
229 | inc hl |
||
230 | call SAE2_HL_ |
||
231 | ld hl,(TRD_5D11) ; TR_DOS |
||
232 | jp loc_30A |
||
233 | |||
234 | CP_0D_OR_80 ld a,(hl) |
||
235 | cp 0Dh |
||
236 | ret z |
||
237 | cp 80h |
||
238 | ret z |
||
239 | or a |
||
240 | ret |
||
241 | |||
242 | call REWRITE_9SEC |
||
243 | ;
|
||
244 | END_COMAND ld hl,0 |
||
245 | ld (TRD_5CF8),hl ; 2 |
||
246 | call DELETE_BUF |
||
247 | call CLEAR_WORKSPACE |
||
248 | ld hl,TRD_5D17 ; , #AA |
||
249 | ld (hl),0AAh |
||
250 | ld hl,TRD_5D1F |
||
251 | ld a,(hl) |
||
252 | or a |
||
253 | ld (hl),0 |
||
254 | jr nz,loc_1F3 |
||
255 | call DEL_5BYTES |
||
256 | call FIND_ENDSTR ; |
||
257 | loc_1F3 ld sp,(TRD_5D1C) ; SP |
||
258 | ld hl,(TRD_5D1A) ; |
||
259 | ld bc,(TRD_5D0F) ; TR-DOS |
||
260 | ld b,0 |
||
261 | jp (hl) |
||
262 | |||
263 | CP_ERROR call RESTORE_SP ; |
||
264 | bit 7,(iy+0) |
||
265 | ret nz |
||
266 | ld de,TRD_5CC2 ; #C9. TR-DOS BASIC |
||
267 | ld sp,(ERR_SP) |
||
268 | push de |
||
269 | ret |
||
270 | |||
271 | ; |
||
272 | FIND_ENDSTR call GET_SYMSTR |
||
273 | cp 0Dh |
||
274 | ret z |
||
275 | call GET_NEXT_SYM |
||
276 | jr FIND_ENDSTR ; |
||
277 | |||
278 | ;
|
||
279 | MARK_SP ld hl,(ERR_SP) |
||
280 | ld (TRD_5D13),hl ; ERR_SP |
||
281 | ld hl,(TRD_5D1C) ; SP |
||
282 | dec hl |
||
283 | dec hl |
||
284 | ld (ERR_SP),hl |
||
285 | ld de,loc_3D16 |
||
286 | ld (hl),e |
||
287 | inc hl |
||
288 | ld (hl),d |
||
289 | ret |
||
290 | |||
291 | ;
|
||
292 | RESTORE_SP ld hl,(TRD_5D13) ; ERR_SP |
||
293 | LOC_235 ld (ERR_SP),hl |
||
294 | ret |
||
295 | |||
296 | IN_COMMAND_CPU ld hl,0 ; |
||
297 | ld (TRD_5CF7),hl |
||
298 | add hl,sp |
||
299 | ld (TRD_5D1C),hl ; SP |
||
300 | dec hl |
||
301 | dec hl |
||
302 | ld sp,hl |
||
303 | call MARK_SP ; |
||
304 | ;2
|
||
305 | ;
TR-DOS
BASIC 128 |
||
306 | call CLEAR_SCREEN ; |
||
307 | call OPEN_CHAN_2 ; 2 |
||
308 | ld hl,TRD_5D17 ; , #AA |
||
309 | ld a,(hl) |
||
310 | cp 0AAh |
||
311 | ld a,0 |
||
312 | ld (TRD_5D0F),a ; TR-DOS |
||
313 | jp z,COMMAND_CPU |
||
314 | ld (hl),0AAh |
||
315 | ld hl,ZASTAVKA ; FIX |
||
316 | ;
|
||
317 | rst 18h |
||
318 | call OUT_COLOR_LINE ; |
||
319 | DUPL 0X026D-$,0 |
||
320 | loc_271 LD A,(NOT_USED) ; #AA |
||
321 | cp 0AAh |
||
322 | jr nz,COMMAND_CPU ; #AA, |
||
323 | DUPL 0X027B-$,0 |
||
324 | loc_27B ld hl,(E_LINE) ; |
||
325 | ld a,0 |
||
326 | ld (TRD_5D0E),a ; #FE- BASIC, TR-DOS |
||
327 | ld (hl),0F7h |
||
328 | inc hl |
||
665 | savelij | 329 | ld (hl),'"' |
623 | savelij | 330 | inc hl |
665 | savelij | 331 | ld (hl),'b' |
623 | savelij | 332 | inc hl |
665 | savelij | 333 | ld (hl),'o' |
623 | savelij | 334 | inc hl |
665 | savelij | 335 | ld (hl),'o' |
623 | savelij | 336 | inc hl |
665 | savelij | 337 | ld (hl),'t' |
623 | savelij | 338 | inc hl |
665 | savelij | 339 | ld (hl),'"' |
623 | savelij | 340 | inc hl |
341 | ld (K_CUR),hl |
||
342 | ld (hl),0Dh |
||
343 | inc hl |
||
344 | ld (hl),80h |
||
345 | inc hl |
||
346 | ld (WORKSP),hl |
||
347 | ld (STKBOT),hl |
||
348 | ld (STKEND),hl |
||
349 | set 3,(iy+1) |
||
350 | jr GO2RUNBOOT |
||
351 | |||
352 | ;
3 |
||
353 | LDI3_HL2DE ld b,3 |
||
354 | loc_2B2 ld a,(hl) |
||
355 | ld (de),a |
||
356 | inc hl |
||
357 | inc de |
||
358 | djnz loc_2B2 |
||
359 | ret |
||
360 | |||
361 | ; FIX |
||
362 | ; |
||
363 | STOP_MOTOR ld b,20h |
||
364 | loc_2BB push bc |
||
365 | xor 8 |
||
665 | savelij | 366 | out (0FFh),a |
623 | savelij | 367 | push af |
368 | ld a,5 |
||
369 | call PAUSE_C_A |
||
370 | pop af |
||
371 | pop bc |
||
372 | djnz loc_2BB |
||
373 | ret |
||
374 | |||
375 | COMMAND_CPU ld hl,(TRD_5D1C) ; SP |
||
376 | dec hl |
||
377 | dec hl |
||
378 | ld sp,hl |
||
379 | call OPEN_CHAN_0 ; 0 |
||
380 | ld a,(TRD_5D16) ; ( #FF) |
||
381 | or 3 |
||
382 | call STOP_MOTOR ; FIX |
||
383 | ; |
||
384 | ld a,(TRD_5D16) ; ( #FF) |
||
385 | call STOP_MOTOR ; FIX |
||
386 | ; |
||
387 | xor a |
||
388 | ld (TRD_5D15),a ; 0, TR-DOS. |
||
389 | call GET_COMMAND ; |
||
390 | call SAE2E_LINE |
||
391 | GO2RUNBOOT call CLEAR_DOWN_SCR ; |
||
392 | ld hl,COMMAND_CPU |
||
393 | ld (TRD_5D1A),hl ; |
||
394 | xor a |
||
395 | ld (TRD_5D0F),a ; TR-DOS |
||
396 | LD (TRD_5CEF),A |
||
397 | ld hl,(E_LINE) ; |
||
398 | push hl |
||
399 | ld de,TRD_5D20 ; 3 |
||
400 | call LDI3_HL2DE ; 3 |
||
401 | pop hl |
||
402 | ld (TRD_5D11),hl ; TR_DOS |
||
403 | loc_30A ld a,(hl) |
||
404 | ld b,a |
||
405 | and 80h |
||
406 | ld a,b |
||
407 | jr z,loc_31A |
||
408 | cp 0FEh ; RETURN |
||
409 | jr z,loc_31A |
||
410 | push af |
||
411 | call ACTIV_DEF_DISK ; |
||
412 | pop af |
||
413 | loc_31A ld hl,CODE_BYTE_COM ; TR-DOS |
||
414 | ; CAT |
||
415 | dec hl |
||
416 | ld c,0 |
||
417 | loc_320 inc c |
||
418 | ld d,a |
||
419 | ld a,15h |
||
420 | cp c |
||
421 | jp c,END_COMAND |
||
422 | ld a,d |
||
423 | inc hl |
||
424 | cp (hl) |
||
425 | jr nz,loc_320 |
||
426 | cp 0FEh ; RETURN |
||
427 | call nz,CREATE_BUF ; |
||
428 | ld a,9 |
||
429 | ld (TRD_5D06),a ; |
||
430 | xor a |
||
431 | ld (TRD_5D0F),a ; TR-DOS |
||
432 | ld (TRD_5CD6),a ; #FF- |
||
433 | ld (TRD_5D10),a ; |
||
434 | ld hl,FLAGS |
||
435 | res 7,(hl) |
||
436 | ld b,0 |
||
437 | ld hl,SPIS_ADR_COM ; |
||
438 | dec c |
||
439 | sla c |
||
440 | add hl,bc |
||
441 | ld e,(hl) |
||
442 | inc hl |
||
443 | ld d,(hl) |
||
444 | ex de,hl |
||
445 | push hl |
||
446 | ld de,END_COM |
||
447 | push de |
||
448 | jp (hl) |
||
449 | |||
450 | END_COM ld hl,FLAGS |
||
451 | set 7,(hl) |
||
452 | pop hl |
||
453 | jp (hl) |
||
454 | |||
455 | ; FIX |
||
456 | ;
|
||
457 | ZASTAVKA db 16h,1,5,"* TR-DOS Ver 5.03 *",0Dh,0Dh,7Fh |
||
458 | db " 1986 Technology Research Ltd.",16h,5,0Bh |
||
459 | db "(U.K.)",16h,7,5 |
||
460 | db "BETA 128",0 |
||
461 | |||
462 | END_OUT_DIR call READ_9SEC ; 9 |
||
463 | call PRINT_0D |
||
464 | call PRINT_0D |
||
465 | loc_3B5 ld bc,(TRD_5E0A) |
||
466 | call PRINT_CHISLO ; |
||
467 | ld hl,TXT_FREE_ ; " Free" |
||
468 | rst 18h |
||
469 | GOTO_END jp END_COMAND |
||
470 | |||
471 | ;
|
||
472 | PRINT_ERROR push af |
||
473 | ld a,(TRD_5D0E) ; #FE- BASIC, TR-DOS |
||
474 | cp 0FEh |
||
475 | jr nz,CP4PRINT_HEAD |
||
476 | pop af |
||
477 | ret |
||
478 | |||
479 | CP4PRINT_HEAD pop af |
||
480 | ld (TRD_5D0F),a ; TR-DOS |
||
481 | ld a,(TRD_5D15) ; 0, TR-DOS. |
||
482 | or a |
||
483 | call z,PRINT_MSG ; |
||
484 | ret |
||
485 | |||
486 | ERR_NOFILES ld hl,TXT_NOFILES_ |
||
487 | ld a,1 |
||
488 | jp PRINT_TXTERR |
||
489 | |||
490 | ERR_OK ld hl,TXT_OK_ ; "O.K." |
||
491 | xor a |
||
492 | jp PRINT_TXTERR |
||
493 | |||
494 | ;
0 |
||
495 | RD_0SEC2BUF xor a |
||
496 | ld (TRD_5CCC),a ; |
||
497 | ;
|
||
498 | READ_NUM_SEC ld de,(TRD_5CCC) ; |
||
499 | ld d,0 |
||
500 | READ_SEC4NEM call CREATE_BUF ; |
||
501 | ld hl,TRD_5D25 |
||
502 | ld b,1 |
||
503 | jp COM_05 ; |
||
504 | |||
505 | ;
9
|
||
506 | READ_9SEC call CREATE_BUF ; |
||
507 | ld de,8 |
||
508 | jr READ_SEC4NEM |
||
509 | |||
510 | ;
|
||
511 | COM_18 call READ_9SEC ; 9 |
||
512 | ld a,(TRD_5E0C) |
||
513 | cp 10h |
||
514 | jr z,CP_TYPE_DISK |
||
515 | DISCERROR_ ld hl,TXT_DISCERROR_ |
||
516 | JP DISCERROR_7 |
||
517 | |||
518 | CP_TYPE_DISK call GET_TYPE_DISK ; |
||
519 | res 0,(hl) |
||
520 | res 1,(hl) |
||
521 | ld a,(TRD_5E08) |
||
522 | bit 0,a |
||
523 | jr nz,loc_425 |
||
524 | set 0,(hl) |
||
525 | loc_425 bit 3,a |
||
526 | ret nz |
||
527 | set 1,(hl) |
||
528 | ret |
||
529 | |||
530 | ;
|
||
531 | CP_SECOND_SYM ld hl,(TRD_5D11) ; TR_DOS |
||
532 | inc hl |
||
533 | ld a,(hl) |
||
534 | cp 0Dh |
||
535 | ret |
||
536 | |||
537 | CAT call CP_SECOND_SYM ; CAT |
||
538 | ld bc,2 |
||
539 | ld (TRD_5CDB),bc |
||
540 | jr z,loc_46A |
||
541 | cp "#" |
||
542 | jr nz,CODES |
||
543 | ld (CH_ADD),hl |
||
544 | call SET_NUM_CHAN |
||
545 | call GET_SYMSTR |
||
546 | cp 0Dh |
||
547 | jr z,loc_46A |
||
548 | cp "," |
||
549 | jp nz,SINTAX_ERROR |
||
550 | call GET_NEXT_SYM |
||
551 | call PUT_NUMDSK_STK |
||
552 | jr loc_460 |
||
553 | |||
554 | CODES call SET_AND_PUT |
||
555 | loc_460 call EXIT_IF_SINTAX ; , |
||
556 | call GET_STKBOT_ |
||
557 | ex de,hl |
||
558 | call SETUP_DISK |
||
559 | loc_46A call EXIT_IF_SINTAX ; , |
||
560 | ld a,(TRD_5CF6) ; |
||
561 | ld (TRD_5CF9),a ; 2 |
||
562 | call COM_18 ; |
||
563 | ld a,(TRD_5CDB) |
||
564 | loc_479 cp 2 |
||
565 | push af |
||
566 | call z,CLEAR_SCREEN ; |
||
567 | pop af |
||
568 | cp 11h |
||
569 | jp nc,SINTAX_ERROR |
||
570 | call OPENSTREAM |
||
571 | ld a,0FFh |
||
572 | ld (TRD_5CF8),a ; 2 |
||
573 | ld hl,TXT_TITLE_ ; "Title:" |
||
574 | rst 18h |
||
575 | ld hl,TRD_5E1A |
||
576 | rst 18h |
||
577 | call PRINT_0D |
||
578 | ld a,(TRD_5E09) |
||
579 | ld hl,TRD_5E19 |
||
580 | sub (hl) |
||
581 | push hl |
||
582 | call PRINT_CHISLO_A_ |
||
583 | ld hl,TXT_FILES_ ; " File(s)" |
||
584 | rst 18h |
||
585 | pop hl |
||
586 | ld c,(hl) |
||
587 | call CONV2_2BYTES |
||
588 | ld hl,TXT_DELFILE_ ; " Del. File" |
||
589 | rst 18h |
||
590 | call RD_0SEC2BUF ; 0 |
||
591 | ld hl,TRD_5D25 |
||
592 | loc_4B6 call CP_END_DIR ; |
||
593 | call PRINT_0D |
||
594 | ld a,(TRD_5CF6) ; |
||
595 | add a,"A" |
||
596 | rst 10h |
||
597 | ld b,2 |
||
598 | loc_4C4 call CP_END_DIR ; |
||
599 | push bc |
||
600 | ld a,":" |
||
601 | rst 10h |
||
602 | push hl |
||
603 | call PRINT_FILENAME ; |
||
604 | ld bc,0Dh |
||
605 | pop hl |
||
606 | push hl |
||
607 | add hl,bc |
||
608 | ld c,(hl) |
||
609 | push bc |
||
610 | ld a,c |
||
611 | ld b,2 |
||
612 | cp 10 |
||
613 | jr c,loc_4DF |
||
614 | dec b |
||
615 | loc_4DF cp 100 |
||
616 | jr nc,loc_4E8 |
||
617 | loc_4E3 ld a," " |
||
618 | rst 10h |
||
619 | djnz loc_4E3 |
||
620 | loc_4E8 pop bc |
||
621 | call PRINT_CHISLO ; |
||
622 | pop hl |
||
623 | pop bc |
||
624 | ld de,10h |
||
625 | add hl,de |
||
626 | djnz loc_4C4 |
||
627 | jr loc_4B6 |
||
628 | |||
629 | ;
|
||
630 | CP_END_DIR push hl |
||
631 | push bc |
||
632 | ld a,(TRD_5CF9) ; 2 |
||
633 | ld hl,TRD_5CF6 ; |
||
634 | cp (hl) |
||
635 | call nz,COM_01 ; |
||
636 | pop bc |
||
637 | pop hl |
||
638 | jp CP_END_CAT |
||
639 | |||
640 | ADD_10 ld de,10h |
||
641 | add hl,de |
||
642 | ret |
||
643 | |||
644 | ;
|
||
645 | CP_END_BUF push hl |
||
646 | push bc |
||
647 | ld bc,0A1DBh |
||
648 | add hl,bc |
||
649 | jr c,READ_SEC2BUF |
||
650 | pop bc |
||
651 | pop hl |
||
652 | ret |
||
653 | |||
654 | READ_SEC2BUF ld hl,TRD_5CCC ; |
||
655 | inc (hl) |
||
656 | call READ_NUM_SEC ; |
||
657 | pop bc |
||
658 | pop hl |
||
659 | ld hl,TRD_5D25 |
||
660 | ret |
||
661 | |||
662 | NUMDSK2BYTE and 0DFh |
||
663 | sbc a,"A" |
||
664 | jp c,SINTAX_ERROR |
||
665 | cp 4 |
||
666 | jp nc,SINTAX_ERROR |
||
667 | ret |
||
668 | |||
669 | CP_ON_STKBOT call GET_STKBOT_ |
||
670 | ld a,c |
||
671 | OR B |
||
672 | jp z,SINTAX_ERROR |
||
673 | ret |
||
674 | |||
675 | NEW call INP_STR2STKBOT |
||
676 | call EXIT_IF_SINTAX ; , |
||
677 | call INP_EXTFILENAME ; |
||
678 | call SET_CP_FILENAME |
||
679 | ld a,(TRD_5CF6) ; |
||
680 | ld (TRD_5CF8),a ; 2 |
||
681 | jp nz,ERR_NOFILES |
||
682 | push bc |
||
683 | call RDHEAD_FILENAME ; |
||
684 | call SET_CP_FILENAME |
||
685 | push af |
||
686 | ld a,(TRD_5CF8) ; 2 |
||
687 | ld hl,TRD_5CF6 ; |
||
688 | cp (hl) |
||
689 | jp nz,SINTAX_ERROR |
||
690 | call COM_18 ; |
||
691 | pop af |
||
692 | jp z,FILE_EXISTS |
||
693 | pop bc |
||
694 | loc_569 call SETHEADFILENAME |
||
695 | call REWRITE_9SEC ; 9 |
||
696 | jp ERR_OK |
||
697 | |||
698 | CP_HIGH_ERR ld a,(TRD_5D10) ; |
||
699 | or a |
||
700 | ret |
||
701 | |||
702 | CP_ERASED_FILES ld a,(TRD_5D07) ; |
||
703 | or a |
||
704 | jp z,ERR_NOFILES |
||
705 | jp ERR_OK |
||
706 | |||
707 | ;
|
||
708 | GET_OVERWRITE_ push bc |
||
709 | call CLEAR_SCREEN ; |
||
710 | ld a,(TRD_5CF6) ; |
||
711 | add a,"A" |
||
712 | call PRINT_A_ |
||
713 | ld a,":" |
||
714 | call PRINT_A_ |
||
715 | ld hl,TRD_5CDD ; |
||
716 | call PRINT_FILENAME ; |
||
717 | ld hl,TXT_FILEEXIST ; "File exists" |
||
718 | call PRINT_MSG ; |
||
719 | call GET_KEYS ; |
||
720 | cp "Y" |
||
721 | push af |
||
722 | call CLEAR_SCREEN ; |
||
723 | pop af |
||
724 | pop bc |
||
725 | ret nz |
||
726 | push bc |
||
727 | call CLEAR_SCREEN ; |
||
728 | pop bc |
||
729 | call ERASE_FILE ; |
||
730 | xor a |
||
731 | ret |
||
732 | |||
733 | CP_EXT_SHARP ld a,(TRD_5CE5) ; |
||
734 | cp "#" |
||
735 | jr z,FINDFILENAME_0A |
||
736 | xor a |
||
737 | ret |
||
738 | |||
739 | FINDFILENAME_0A ld a,0Ah |
||
740 | ld (TRD_5D06),a ; |
||
741 | call FIND_FILENAME ; |
||
742 | ld a,9 |
||
743 | ld (TRD_5D06),a ; |
||
744 | ret |
||
745 | |||
746 | COPY_STAR_STAR ld a,(TRD_5CDD) ; COPY *,* |
||
747 | cp "*" |
||
748 | jp nz,ERR_NOFILES |
||
749 | call GET_STKBOT_ |
||
750 | ex de,hl |
||
751 | call SETUP_DISK |
||
752 | ld a,(hl) |
||
753 | cp "*" |
||
754 | jp nz,SINTAX_ERROR |
||
755 | ld a,(TRD_5CF6) ; |
||
756 | ld (TRD_5CF9),a ; 2 |
||
757 | ld a,(TRD_5CF9) ; 2 |
||
758 | call COM_01 ; |
||
759 | call COM_18 ; |
||
760 | ld a,0FFh |
||
761 | ld (TRD_5D0D),a |
||
762 | loc_5F4 ld a,(TRD_5CF8) ; 2 |
||
763 | call COM_01 ; |
||
764 | call COM_18 ; |
||
765 | ld a,(TRD_5D0D) |
||
766 | inc a |
||
767 | ld (TRD_5D0D),a |
||
768 | ld c,a |
||
769 | call RDHEAD_FILENAME ; |
||
770 | ld a,(TRD_5CDD) ; |
||
771 | cp 0 |
||
772 | jp z,ERR_OK |
||
773 | cp 1 |
||
774 | jr z,loc_5F4 |
||
775 | ld hl,TRD_5CE6 ; <C>- , <B>- |
||
776 | ld de,TRD_5CED ; |
||
777 | ld bc,7 |
||
778 | ldir |
||
779 | ld a,(TRD_5CF9) ; 2 |
||
780 | call COM_01 ; |
||
781 | call FIND_FILENAME ; |
||
782 | jr nz,loc_634 |
||
783 | call CP_EXT_SHARP |
||
784 | jr nz,loc_634 |
||
785 | call GET_OVERWRITE_ ; |
||
786 | jr nz,loc_5F4 |
||
787 | loc_634 call COPYFILE_ON2DSK ; 2 |
||
788 | call REWRITE_9SEC ; 9 |
||
789 | jr loc_5F4 |
||
790 | |||
791 | ;
2 |
||
792 | COPYFILE_ON2DSK call READ_9SEC ; 9 |
||
793 | ld a,(TRD_5E09) |
||
794 | cp 80h |
||
795 | JP Z,ERR_DIRFULL ; 0X2723 |
||
796 | ld hl,TRD_5CED ; |
||
797 | ld de,TRD_5CE6 ; <C>- , <B>- |
||
798 | ld bc,7 |
||
799 | ldir |
||
800 | ld de,(TRD_5CEA) ; |
||
801 | ld d,0 |
||
802 | or a |
||
803 | ld hl,(TRD_5E0A) |
||
804 | sbc hl,de |
||
805 | jp c,loc_1C45 |
||
806 | ld (TRD_5E0A),hl |
||
807 | ld hl,(TRD_5E06) |
||
808 | ld (TRD_5CEB),hl ; |
||
809 | push hl |
||
810 | call COPY_FILE ; 2 |
||
811 | pop hl |
||
812 | ld (TRD_5CEB),hl ; |
||
813 | ld hl,(TRD_5CF4) |
||
814 | ld (TRD_5E06),hl |
||
815 | ld hl,TRD_5E09 |
||
816 | inc (hl) |
||
817 | ld c,(hl) |
||
818 | dec c |
||
819 | ld b,0 |
||
820 | push bc |
||
821 | ld de,9 |
||
822 | ld (TRD_5CF4),de |
||
823 | call REWRITE_9SEC ; 9 |
||
824 | pop bc |
||
825 | call SETHEADFILENAME |
||
826 | ret |
||
827 | |||
828 | COPY ld hl,(TRD_5D11) ; TR_DOS |
||
829 | inc hl |
||
830 | ld a,(hl) |
||
831 | and 0DFh |
||
832 | cp "S" |
||
833 | jp z,COPY_S |
||
834 | cp "B" |
||
835 | jp z,COPY_B |
||
836 | call INP_STR2STKBOT |
||
837 | call EXIT_IF_SINTAX ; , |
||
838 | call RESERVED_RAM |
||
839 | call INP_EXTFILENAME ; |
||
840 | call SET_CP_FILENAME |
||
841 | ld a,(TRD_5CF6) ; |
||
842 | ld (TRD_5CF8),a ; 2 |
||
843 | jp nz,COPY_STAR_STAR ; COPY *,* |
||
844 | call RDHEAD_FILENAME ; |
||
845 | ld hl,TRD_5CE6 ; <C>- , <B>- |
||
846 | ld de,TRD_5CED ; |
||
847 | ld bc,7 |
||
848 | ldir |
||
849 | call SET_CP_FILENAME |
||
850 | push af |
||
851 | push bc |
||
852 | ld a,(TRD_5CF6) ; |
||
853 | ld (TRD_5CF9),a ; 2 |
||
854 | ld a,(TRD_5CF8) ; 2 |
||
855 | call COM_01 ; |
||
856 | call COM_18 ; |
||
857 | ld a,(TRD_5CF9) ; 2 |
||
858 | call COM_01 ; |
||
859 | call COM_18 ; |
||
860 | pop bc |
||
861 | pop af |
||
862 | jr nz,loc_6F3 |
||
863 | call CP_EXT_SHARP |
||
864 | jr nz,loc_6F3 |
||
865 | call GET_OVERWRITE_ ; |
||
866 | jp nz,ERR_OK |
||
867 | loc_6F3 call COPYFILE_ON2DSK ; 2 |
||
868 | call REWRITE_9SEC ; 9 |
||
869 | ld a,(TRD_5CE5) ; |
||
870 | cp "#" |
||
871 | jp nz,ERR_OK |
||
872 | ld a,10 |
||
873 | ld (TRD_5D06),a ; |
||
874 | ld hl,TRD_5CE6 ; <C>- , <B>- |
||
875 | inc (hl) |
||
876 | ld a,(TRD_5CF8) ; 2 |
||
877 | call COM_01 ; |
||
878 | call CP_EXT_SHARP |
||
879 | jp nz,ERR_OK |
||
880 | call RDHEAD_FILENAME ; |
||
881 | ld hl,TRD_5CE6 ; <C>- , <B>- |
||
882 | ld de,TRD_5CED ; |
||
883 | ld bc,7 |
||
884 | ldir |
||
885 | ld a,(TRD_5CF9) ; 2 |
||
886 | call COM_01 ; |
||
887 | call COM_18 ; |
||
888 | jr loc_6F3 |
||
889 | |||
890 | ;
2 |
||
891 | COPY_FILE ld a,(TRD_5CF1) |
||
892 | or a |
||
893 | ret z |
||
894 | push hl |
||
895 | ld hl,TRD_5D23 |
||
896 | sub (hl) |
||
897 | pop hl |
||
898 | jr nc,loc_775 |
||
899 | ld a,(TRD_5CF1) |
||
900 | ld b,a |
||
901 | xor a |
||
902 | ld (TRD_5CF1),a |
||
903 | loc_744 push bc |
||
904 | ld a,(TRD_5CF8) ; 2 |
||
905 | call COM_01 ; |
||
906 | pop bc |
||
907 | push bc |
||
908 | ld hl,(TRD_5CCF) ; WORK_SP |
||
909 | push hl |
||
910 | ld de,(TRD_5CF2) |
||
911 | call COM_05 ; |
||
912 | ld hl,(TRD_5CF4) |
||
913 | ld (TRD_5CF2),hl |
||
914 | ld a,(TRD_5CF9) ; 2 |
||
915 | call COM_01 ; |
||
916 | pop hl |
||
917 | pop bc |
||
918 | ld de,(TRD_5CEB) ; |
||
919 | call COM_06 ; |
||
920 | ld hl,(TRD_5CF4) |
||
921 | ld (TRD_5CEB),hl ; |
||
922 | jr COPY_FILE ; 2 |
||
923 | |||
924 | loc_775 ld (TRD_5CF1),a |
||
925 | push hl |
||
926 | ld hl,TRD_5D23 |
||
927 | ld b,(hl) |
||
928 | pop hl |
||
929 | xor a |
||
930 | jr loc_744 |
||
931 | |||
932 | ;
|
||
933 | ERASE_FILE xor a |
||
934 | ld (TRD_5D07),a ; |
||
935 | jr ERASE_FILES ; |
||
936 | |||
937 | ERASE call SET_AND_PUT |
||
938 | call EXIT_IF_SINTAX ; , |
||
939 | call INP_EXTFILENAME ; |
||
940 | xor a |
||
941 | ld (TRD_5D07),a ; |
||
942 | call FIND_FILE ; |
||
943 | call ERASE_FILES ; |
||
944 | jp nz,CP_ERASED_FILES |
||
945 | jp ERR_OK |
||
946 | |||
947 | ERASE_FILES ld a,(TRD_5CDD) ; |
||
948 | ld (TRD_5D08),a ; |
||
949 | ret nz |
||
950 | ld hl,TRD_5D07 ; |
||
951 | inc (hl) |
||
952 | push bc |
||
953 | call READ_9SEC ; 9 |
||
954 | ld a,(TRD_5E09) |
||
955 | pop bc |
||
956 | inc c |
||
957 | cp c |
||
958 | jr nz,loc_7BC |
||
959 | dec a |
||
960 | ld (TRD_5E09),a |
||
961 | xor a |
||
962 | loc_7BC push af |
||
963 | jr z,loc_7C3 |
||
964 | ld hl,TRD_5E19 |
||
965 | inc (hl) |
||
966 | loc_7C3 push bc |
||
967 | call REWRITE_9SEC ; 9 |
||
968 | pop bc |
||
969 | dec c |
||
970 | call RDHEAD_FILENAME ; |
||
971 | pop af |
||
972 | jp z,loc_7D2 |
||
973 | ld a,1 |
||
974 | loc_7D2 ld (TRD_5CDD),a ; |
||
975 | push af |
||
976 | call WRHEAD_FILENAME ; |
||
977 | ld a,(TRD_5D08) ; |
||
978 | ld (TRD_5CDD),a ; |
||
979 | pop af |
||
980 | jr z,WR_NEW_FREE_SEC |
||
981 | call FIND_FILENAME ; |
||
982 | jr ERASE_FILES ; |
||
983 | |||
984 | WR_NEW_FREE_SEC call READ_9SEC ; 9 |
||
985 | ld hl,(TRD_5CEB) ; |
||
986 | ld (TRD_5E06),hl |
||
987 | ld de,(TRD_5CEA) ; |
||
988 | ld hl,(TRD_5E0A) |
||
989 | ld d,0 |
||
990 | add hl,de |
||
991 | ld (TRD_5E0A),hl |
||
992 | jp REWRITE_9SEC ; 9 |
||
993 | |||
994 | DUPL 0X1018-$,0XFF |
||
995 | COM_STAR call SET_AND_PUT |
||
996 | call EXIT_IF_SINTAX ; , |
||
997 | call CP_ON_STKBOT |
||
998 | ld a,(de) |
||
999 | call NUMDSK2BYTE |
||
1000 | ld (TRD_5D19),a ; |
||
1001 | call COM_01 ; |
||
1002 | jp ERR_OK |
||
1003 | |||
1004 | ;
|
||
1005 | INP_EXTFILENAME ld b,"C" |
||
1006 | ld a,(TRD_5CD6) ; #FF- |
||
1007 | or a |
||
1008 | jr nz,loc_104D |
||
1009 | call GET_SYMSTR |
||
1010 | cp 0AFh ; CODE |
||
1011 | ld b,"C" |
||
1012 | jr z,loc_104D |
||
1013 | cp 0E4h ; DATA |
||
1014 | ld b,"D" |
||
1015 | jr z,loc_104D |
||
1016 | cp "#" |
||
1017 | ld b,"#" |
||
1018 | jr z,loc_104D |
||
1019 | ld b,"B" |
||
1020 | loc_104D ld hl,TRD_5CE5 ; |
||
1021 | ld (hl),b |
||
1022 | ret |
||
1023 | |||
1024 | ;
|
||
1025 | GET_KEYS di |
||
1026 | push hl |
||
1027 | push bc |
||
1028 | push de |
||
1029 | loc_1056 rst 20h |
||
1030 | dw 28Eh ; แช ญจเฎข ญจฅ ชซ ขจ โใเ๋ |
||
1031 | ld c,0 |
||
1032 | jr nz,loc_1056 |
||
1033 | rst 20h |
||
1034 | dw 31Eh ; ฏเฎขฅเช งญ ็ฅญจ๏ ญ ฆ โฎฉ ชซ ขจ่จ |
||
1035 | jr nc,loc_1056 |
||
1036 | dec d |
||
1037 | ld e,a |
||
1038 | rst 20h |
||
1039 | dw 333h ; คฅชฎคจเฎข ญจฅ ชซ ขจ โใเ๋ |
||
1040 | pop de |
||
1041 | pop bc |
||
1042 | pop hl |
||
1043 | and 0DFh |
||
1044 | ei |
||
1045 | ret |
||
1046 | |||
1047 | ;
|
||
1048 | OUT_COLOR_LINE ld hl,58E5h |
||
1049 | ld b,0Ah |
||
1050 | loc_1073 ld (hl),7 |
||
1051 | inc hl |
||
1052 | djnz loc_1073 |
||
1053 | ld (hl),2 |
||
1054 | inc hl |
||
1055 | ld (hl),16h |
||
1056 | inc hl |
||
1057 | ld (hl),34h |
||
1058 | inc hl |
||
1059 | ld (hl),25h |
||
1060 | inc hl |
||
1061 | ld (hl),28h |
||
1062 | inc hl |
||
1063 | ld (hl),7 |
||
1064 | ld hl,40EEh |
||
1065 | ld b,8 |
||
1066 | xor a |
||
1067 | loc_108F push bc |
||
1068 | scf |
||
1069 | rla |
||
1070 | push hl |
||
1071 | push af |
||
1072 | ld b,5 |
||
1073 | loc_1096 inc hl |
||
1074 | ld (hl),a |
||
1075 | djnz loc_1096 |
||
1076 | pop af |
||
1077 | pop hl |
||
1078 | pop bc |
||
1079 | ld de,100h |
||
1080 | add hl,de |
||
1081 | djnz loc_108F |
||
1082 | ret |
||
1083 | |||
1084 | ret |
||
1085 | |||
1086 | TXT_DELFILES db " Del." |
||
1087 | TXT_FILE_S_ db " File(s)",0 |
||
665 | savelij | 1088 | TXT_TITLE DC "Title: " |
623 | savelij | 1089 | TXT_DISKDRIVE db 17h,11h," Disk Drive: ",0 |
1090 | TXT_1SPACE db 17h,10h,20h,0 |
||
1091 | TXT_40TRK_SS db 17h,10h," 40 Track S. Side",0 |
||
1092 | TXT_80TRK_SS db 17h,10h," 80 Track S. Side",0 |
||
1093 | TXT_40TRK_DS db 17h,10h," 40 Track D. Side",0 |
||
1094 | TXT_80TRK_DS db 17h,10h," 80 Track D. Side",0 |
||
1095 | TXT_FREESECS db 17h,10h," Free Sector ",0 |
||
1096 | TXT_FILENAME db 0Dh,0Dh," File Name Start Length Line",0 |
||
1097 | |||
1098 | ;
0X222 |
||
1099 | CREATE_222BYTES ld hl,(WORKSP) |
||
1100 | ld (TRD_5CCF),hl ; WORK_SP |
||
1101 | ld bc,222h ; |
||
1102 | jp CREATE_FREERAM |
||
1103 | |||
1104 | PRINT_HL_CHISLO xor a |
||
1105 | ld de,10000 |
||
1106 | loc_1161 sbc hl,de |
||
1107 | jr c,loc_1168 |
||
1108 | inc a |
||
1109 | jr loc_1161 |
||
1110 | |||
1111 | loc_1168 add a,"0" |
||
1112 | call PRINT_A_CHISLO |
||
1113 | add hl,de |
||
1114 | xor a |
||
1115 | ld de,1000 |
||
1116 | loc_1172 sbc hl,de |
||
1117 | jr c,loc_1179 |
||
1118 | inc a |
||
1119 | jr loc_1172 |
||
1120 | |||
1121 | loc_1179 add a,"0" |
||
1122 | call PRINT_A_CHISLO |
||
1123 | add hl,de |
||
1124 | xor a |
||
1125 | ld de,100 |
||
1126 | loc_1183 sbc hl,de |
||
1127 | jr c,loc_118A |
||
1128 | inc a |
||
1129 | jr loc_1183 |
||
1130 | |||
1131 | loc_118A add a,"0" |
||
1132 | call PRINT_A_CHISLO |
||
1133 | add hl,de |
||
1134 | xor a |
||
1135 | ld de,10 |
||
1136 | loc_1194 sbc hl,de |
||
1137 | jr c,loc_119B |
||
1138 | inc a |
||
1139 | jr loc_1194 |
||
1140 | |||
1141 | loc_119B add a,"0" |
||
1142 | call PRINT_A_CHISLO |
||
1143 | add hl,de |
||
1144 | ld a,l |
||
1145 | add a,"0" |
||
1146 | call PRINT_A_CHISLO |
||
1147 | ret |
||
1148 | |||
1149 | PRINT_A_CHISLO push hl |
||
1150 | push de |
||
1151 | call PRINT_A_ |
||
1152 | pop de |
||
1153 | pop hl |
||
1154 | ret |
||
1155 | |||
1156 | FIND_END_BUFDIR push hl |
||
1157 | push bc |
||
1158 | ld a,(TRD_5CF9) ; 2 |
||
1159 | ld hl,TRD_5CF6 ; |
||
1160 | cp (hl) |
||
1161 | call nz,COM_01 ; |
||
1162 | pop bc |
||
1163 | pop hl |
||
1164 | call CP_END_BUF ; |
||
1165 | ld a,(hl) |
||
1166 | or a |
||
1167 | jp z,END_COMAND |
||
1168 | cp 1 |
||
1169 | call z,ADD_10 |
||
1170 | ret nz |
||
1171 | jr FIND_END_BUFDIR |
||
1172 | |||
1173 | LIST call CP_SECOND_SYM ; |
||
1174 | ld bc,2 |
||
1175 | ld (TRD_5CDB),bc |
||
1176 | jr z,loc_1205 |
||
1177 | cp "#" |
||
1178 | jr nz,LIST4CODES |
||
1179 | ld (CH_ADD),hl |
||
1180 | call SET_NUM_CHAN |
||
1181 | call GET_SYMSTR |
||
1182 | cp 0Dh |
||
1183 | jr z,loc_1205 |
||
1184 | cp "," |
||
1185 | jp nz,SINTAX_ERROR |
||
1186 | call GET_NEXT_SYM |
||
1187 | call PUT_NUMDSK_STK |
||
1188 | jr loc_11FB |
||
1189 | |||
1190 | LIST4CODES call SET_AND_PUT |
||
1191 | loc_11FB call EXIT_IF_SINTAX ; , |
||
1192 | call GET_STKBOT_ |
||
1193 | ex de,hl |
||
1194 | call SETUP_DISK |
||
1195 | loc_1205 call EXIT_IF_SINTAX ; , |
||
1196 | ld a,(TRD_5CF6) ; |
||
1197 | ld (TRD_5CF9),a ; 2 |
||
1198 | call COM_18 ; |
||
1199 | ld a,(TRD_5CDB) |
||
1200 | cp 2 |
||
1201 | push af |
||
1202 | call z,CLEAR_SCREEN ; |
||
1203 | pop af |
||
1204 | cp 11h |
||
1205 | jp nc,SINTAX_ERROR |
||
1206 | call OPENSTREAM |
||
1207 | ld a,0FFh |
||
1208 | ld (TRD_5CF8),a ; 2 |
||
1209 | call CREATE_222BYTES ; 0X222 |
||
1210 | ld hl,TRD_5E06 |
||
1211 | ld de,(TRD_5CCF) ; WORK_SP |
||
1212 | ld bc,20h |
||
1213 | ldir |
||
1214 | call RD_0SEC2BUF ; 0 |
||
1215 | ld hl,TRD_5D25 |
||
1216 | push hl |
||
1217 | loc_123E ld hl,TXT_TITLE ; "Title:" |
||
1218 | push bc |
||
1219 | rst 18h |
||
1220 | ld hl,(TRD_5CCF) ; WORK_SP |
||
1221 | ld bc,14h |
||
1222 | add hl,bc |
||
1223 | rst 18h |
||
1224 | ld hl,TXT_DISKDRIVE |
||
1225 | rst 18h |
||
1226 | ld a,(TRD_5CF6) ; |
||
1227 | add a,"A" |
||
1228 | call PRINT_A_ |
||
1229 | call PRINT_0D |
||
1230 | ld hl,(TRD_5CCF) ; WORK_SP |
||
1231 | ld bc,3 |
||
1232 | add hl,bc |
||
1233 | ld a,(hl) |
||
1234 | ld hl,(TRD_5CCF) ; WORK_SP |
||
1235 | ld bc,13h |
||
1236 | add hl,bc |
||
1237 | sub (hl) |
||
1238 | push hl |
||
1239 | call PRINT_CHISLO_A_ |
||
1240 | ld hl,TXT_FILE_S_ ; " File(s)" |
||
1241 | rst 18h |
||
1242 | ld hl,(TRD_5CCF) ; WORK_SP |
||
1243 | ld bc,2 |
||
1244 | add hl,bc |
||
1245 | ld a,(hl) |
||
1246 | ld hl,TXT_40TRK_SS |
||
1247 | cp 19h |
||
1248 | jr z,loc_1292 |
||
1249 | ld hl,TXT_80TRK_SS |
||
1250 | cp 18h |
||
1251 | jr z,loc_1292 |
||
1252 | ld hl,TXT_40TRK_DS |
||
1253 | cp 17h |
||
1254 | jr z,loc_1292 |
||
1255 | ld hl,TXT_80TRK_DS |
||
1256 | loc_1292 rst 18h |
||
1257 | pop hl |
||
1258 | ld c,(hl) |
||
1259 | call CONV2_2BYTES |
||
1260 | ld hl,TXT_DELFILES ; " Del." |
||
1261 | rst 18h |
||
1262 | ld hl,TXT_FREESECS |
||
1263 | rst 18h |
||
1264 | ld hl,(TRD_5CCF) ; WORK_SP |
||
1265 | ld bc,4 |
||
1266 | add hl,bc |
||
1267 | ld c,(hl) |
||
1268 | inc hl |
||
1269 | ld b,(hl) |
||
1270 | call PRINT_CHISLO ; |
||
1271 | ld hl,TXT_FILENAME |
||
1272 | rst 18h |
||
1273 | pop bc |
||
1274 | pop hl |
||
1275 | ld b,10h |
||
1276 | loc_12B5 call FIND_END_BUFDIR |
||
1277 | call PRINT_0D |
||
1278 | push bc |
||
1279 | push hl |
||
1280 | call PRINT_FILENAME ; |
||
1281 | ld bc,0Dh |
||
1282 | pop hl |
||
1283 | push hl |
||
1284 | add hl,bc |
||
1285 | ld c,(hl) |
||
1286 | push bc |
||
1287 | ld a,c |
||
1288 | ld b,2 |
||
1289 | cp 10 |
||
1290 | jr c,loc_12D0 |
||
1291 | dec b |
||
1292 | loc_12D0 cp 100 |
||
1293 | jr nc,loc_12D9 |
||
1294 | loc_12D4 ld a," " |
||
1295 | rst 10h |
||
1296 | djnz loc_12D4 |
||
1297 | loc_12D9 pop bc |
||
1298 | call PRINT_CHISLO ; |
||
1299 | ld hl,TXT_1SPACE |
||
1300 | rst 18h |
||
1301 | pop hl |
||
1302 | push hl |
||
1303 | ld bc,9 |
||
1304 | add hl,bc |
||
1305 | ld e,(hl) |
||
1306 | inc hl |
||
1307 | ld d,(hl) |
||
1308 | push hl |
||
1309 | ex de,hl |
||
1310 | call PRINT_HL_CHISLO |
||
1311 | ld a," " |
||
1312 | call PRINT_A_ |
||
1313 | pop hl |
||
1314 | inc hl |
||
1315 | ld e,(hl) |
||
1316 | inc hl |
||
1317 | ld d,(hl) |
||
1318 | ex de,hl |
||
1319 | call PRINT_HL_CHISLO |
||
1320 | pop hl |
||
1321 | push hl |
||
1322 | ld bc,8 |
||
1323 | add hl,bc |
||
1324 | ld a,(hl) |
||
1325 | cp "B" |
||
1326 | call z,PRN_ADR_ASTART |
||
1327 | pop hl |
||
1328 | pop bc |
||
1329 | ld de,10h |
||
1330 | add hl,de |
||
1331 | djnz loc_12B5 |
||
1332 | push hl |
||
1333 | call PRINT_0D |
||
1334 | call PRINT_0D |
||
1335 | jp loc_123E |
||
1336 | |||
1337 | PRN_ADR_ASTART ld bc,5 |
||
1338 | add hl,bc |
||
1339 | ld b,(hl) |
||
1340 | inc hl |
||
1341 | ld e,(hl) |
||
1342 | inc hl |
||
1343 | ld d,(hl) |
||
1344 | dec b |
||
1345 | jr z,loc_1335 |
||
1346 | dec b |
||
1347 | jr z,loc_1335 |
||
1348 | ld a,10h |
||
1349 | loc_132C inc e |
||
1350 | cp e |
||
1351 | jr nz,loc_1333 |
||
1352 | ld e,0 |
||
1353 | inc d |
||
1354 | loc_1333 djnz loc_132C |
||
1355 | loc_1335 ld hl,(TRD_5CCF) ; WORK_SP |
||
1356 | ld bc,21h |
||
1357 | add hl,bc |
||
1358 | ld b,2 |
||
1359 | push hl |
||
1360 | call COM_05 ; |
||
1361 | ld a,80h |
||
1362 | pop hl |
||
1363 | ld bc,200h |
||
1364 | cpir |
||
1365 | ld a,(hl) |
||
1366 | cp 0AAh |
||
1367 | ret nz |
||
1368 | inc hl |
||
1369 | ld c,(hl) |
||
1370 | inc hl |
||
1371 | ld b,(hl) |
||
1372 | ld a,b |
||
1373 | or c |
||
1374 | ret z |
||
1375 | push bc |
||
1376 | ld a," " |
||
1377 | call PRINT_A_ |
||
1378 | pop bc |
||
1379 | call PRINT_CHISLO ; |
||
1380 | ret |
||
1381 | |||
1382 | COPY_S call SET_CH_ADD ; CH_ADD |
||
1383 | call GET_NEXT_SYM |
||
1384 | call PUT_NUMDSK_STK |
||
1385 | call EXIT_IF_SINTAX ; , |
||
1386 | call RESERVED_RAM |
||
1387 | ld hl,TXT_INS_SRC ; "Insert Source disk then press Y" |
||
1388 | call PRINT_MSG ; |
||
1389 | loc_1375 call GET_KEYS ; |
||
1390 | cp "Y" |
||
1391 | jr nz,loc_1375 |
||
1392 | call CLEAR_DOWN_SCR ; |
||
1393 | call INP_EXTFILENAME ; |
||
1394 | call SET_CP_FILENAME |
||
1395 | jp nz,ERR_NOFILES |
||
1396 | call COPY_ON1DISK |
||
1397 | ld a,(TRD_5CE5) ; |
||
1398 | cp "#" |
||
1399 | jp nz,ERR_OK |
||
1400 | loc_1393 ld a,10 |
||
1401 | ld (TRD_5D06),a ; |
||
1402 | ld hl,TRD_5CE6 ; <C>- , <B>- |
||
1403 | inc (hl) |
||
1404 | call CLEAR_SCREEN ; |
||
1405 | ld hl,TXT_INS_SRC ; "Insert Source disk then press Y" |
||
1406 | call PRINT_MSG ; |
||
1407 | loc_13A5 call GET_KEYS ; |
||
1408 | cp "Y" |
||
1409 | jr nz,loc_13A5 |
||
1410 | call FIND_FILENAME ; |
||
1411 | jp nz,ERR_OK |
||
1412 | call COPY_ON1DISK |
||
1413 | jr loc_1393 |
||
1414 | |||
1415 | COPY_ON1DISK call RDHEAD_FILENAME ; |
||
1416 | ld hl,TRD_5CE6 ; <C>- , <B>- |
||
1417 | ld de,TRD_5CED ; |
||
1418 | ld bc,7 |
||
1419 | ldir |
||
1420 | ld a,(TRD_5CF1) |
||
1421 | ld (TRD_5D10),a ; |
||
1422 | call COM_18 ; |
||
1423 | call GET_TYPE_DISK ; |
||
1424 | ld (TRD_5CD9),a ; <B> <C> |
||
1425 | ld a,0FFh |
||
1426 | ld (TRD_5D21),a |
||
1427 | call COPY_ON1DISK_ |
||
1428 | ld hl,(TRD_5D1F) |
||
1429 | ld (TRD_5CEB),hl ; |
||
1430 | ld hl,(TRD_5CF4) |
||
1431 | ld (TRD_5E06),hl |
||
1432 | ld hl,TRD_5E09 |
||
1433 | inc (hl) |
||
1434 | ld c,(hl) |
||
1435 | dec c |
||
1436 | ld b,0 |
||
1437 | push bc |
||
1438 | ld de,9 |
||
1439 | ld (TRD_5CF4),de |
||
1440 | call REWRITE_9SEC ; 9 |
||
1441 | pop bc |
||
1442 | call SETHEADFILENAME |
||
1443 | call REWRITE_9SEC ; 9 |
||
1444 | ret |
||
1445 | |||
1446 | CP_FREESEC xor a |
||
1447 | ld (TRD_5D21),a |
||
1448 | call COM_18 ; |
||
1449 | call GET_TYPE_DISK ; |
||
1450 | ld (TRD_5CDA),a |
||
1451 | call FIND_FILENAME ; |
||
1452 | jp z,FILE_EXISTS |
||
1453 | call READ_9SEC ; 9 |
||
1454 | ld a,(TRD_5E09) |
||
1455 | cp 80h |
||
1456 | jp z,ERR_DIRFULL |
||
1457 | ld hl,TRD_5CED ; |
||
1458 | ld de,TRD_5CE6 ; <C>- , <B>- |
||
1459 | ld bc,7 |
||
1460 | ldir |
||
1461 | call READ_9SEC ; 9 |
||
1462 | ld a,(TRD_5D10) ; |
||
1463 | ld (TRD_5CEA),a ; |
||
1464 | ld de,(TRD_5CEA) ; |
||
1465 | ld d,0 |
||
1466 | or a |
||
1467 | ld hl,(TRD_5E0A) |
||
1468 | sbc hl,de |
||
1469 | jp c,loc_1C45 |
||
1470 | ld (TRD_5E0A),hl |
||
1471 | ld hl,(TRD_5E06) |
||
1472 | ld (TRD_5CEB),hl ; |
||
1473 | ld (TRD_5D1F),hl |
||
1474 | ret |
||
1475 | |||
1476 | COPY_ON1DISK_ ld a,(TRD_5CF1) |
||
1477 | or a |
||
1478 | ret z |
||
1479 | ld a,(TRD_5D21) |
||
1480 | or a |
||
1481 | jr nz,loc_146F |
||
1482 | call CLEAR_SCREEN ; |
||
1483 | ld hl,TXT_INS_SRC ; "Insert Source disk then press Y" |
||
1484 | call PRINT_MSG ; |
||
1485 | loc_1465 call GET_KEYS ; |
||
1486 | cp "Y" |
||
1487 | jr nz,loc_1465 |
||
1488 | call CLEAR_DOWN_SCR ; |
||
1489 | loc_146F ld a,(TRD_5CF1) |
||
1490 | or a |
||
1491 | ret z |
||
1492 | push hl |
||
1493 | ld hl,TRD_5D23 |
||
1494 | sub (hl) |
||
1495 | pop hl |
||
1496 | jr nc,loc_14CB |
||
1497 | ld a,(TRD_5CF1) |
||
1498 | ld b,a |
||
1499 | xor a |
||
1500 | ld (TRD_5CF1),a |
||
1501 | loc_1484 push bc |
||
1502 | ld (TRD_5CCE),a ; #00- ,#FF- |
||
1503 | ld hl,(TRD_5CCF) ; WORK_SP |
||
1504 | push hl |
||
1505 | ld de,(TRD_5CF2) |
||
1506 | call SET_DISK_SOURCE |
||
1507 | call COM_05 ; |
||
1508 | ld hl,(TRD_5CF4) |
||
1509 | ld (TRD_5CF2),hl |
||
1510 | call CLEAR_SCREEN ; |
||
1511 | ld hl,TXT_INS_DEST ; "Insert Destination disk" |
||
1512 | call PRINT_MSG ; |
||
1513 | loc_14A5 call GET_KEYS ; |
||
1514 | cp "Y" |
||
1515 | jr nz,loc_14A5 |
||
1516 | call CLEAR_DOWN_SCR ; |
||
1517 | ld a,(TRD_5D21) |
||
1518 | or a |
||
1519 | call nz,CP_FREESEC |
||
1520 | pop hl |
||
1521 | pop bc |
||
1522 | ld de,(TRD_5CEB) ; |
||
1523 | call SETUP_DISK_DEST |
||
1524 | call COM_06 ; |
||
1525 | ld hl,(TRD_5CF4) |
||
1526 | ld (TRD_5CEB),hl ; |
||
1527 | jp COPY_ON1DISK_ |
||
1528 | |||
1529 | loc_14CB ld (TRD_5CF1),a |
||
1530 | push hl |
||
1531 | ld hl,TRD_5D23 |
||
1532 | ld b,(hl) |
||
1533 | pop hl |
||
1534 | xor a |
||
1535 | jp loc_1484 |
||
1536 | |||
1537 | SET_DISK_SOURCE push hl |
||
1538 | push de |
||
1539 | call GET_TYPE_DISK ; |
||
1540 | ld a,(TRD_5CD9) ; <B> <C> |
||
1541 | ld (hl),a |
||
1542 | pop de |
||
1543 | pop hl |
||
1544 | ret |
||
1545 | |||
1546 | SETUP_DISK_DEST push hl |
||
1547 | push de |
||
1548 | call GET_TYPE_DISK ; |
||
1549 | ld a,(TRD_5CDA) |
||
1550 | ld (hl),a |
||
1551 | pop de |
||
1552 | pop hl |
||
1553 | ret |
||
1554 | |||
1555 | CP_FREE_DEST xor a |
||
1556 | ld (TRD_5D21),a |
||
1557 | call COM_18 ; |
||
1558 | call GET_TYPE_DISK ; |
||
1559 | ld (TRD_5CDA),a |
||
1560 | ld a,(TRD_5E08) |
||
1561 | ld (TRD_5CE6+1),a ; <C>- , <B>- |
||
1562 | ld hl,640 |
||
1563 | cp 19h ; 40 1 |
||
1564 | jr z,SAVE_SECS_DEST |
||
1565 | ld hl,1280 |
||
1566 | cp 18h ; 80 1 |
||
1567 | jr z,SAVE_SECS_DEST |
||
1568 | cp 17h ; 40 2 |
||
1569 | jr z,SAVE_SECS_DEST |
||
1570 | ld hl,2560 |
||
1571 | cp 16h ; 80 2 |
||
1572 | jr z,SAVE_SECS_DEST |
||
1573 | jp SINTAX_ERROR |
||
1574 | |||
1575 | SAVE_SECS_DEST ld (TRD_5CDD),hl ; |
||
1576 | ld bc,(TRD_5CDF) |
||
1577 | sbc hl,bc |
||
1578 | jp c,loc_1C45 |
||
1579 | ret |
||
1580 | |||
1581 | COPY_B call EXIT_IF_SINTAX ; , |
||
1582 | call RESERVED_RAM |
||
1583 | ld hl,TXT_BACKUPDISK ; "BACKUP DISK" |
||
1584 | call PRINT_MSG ; |
||
1585 | ld hl,TXT_INS_SRC ; "Insert Source disk then press Y" |
||
1586 | call PRINT_MSG ; |
||
1587 | loc_153E call GET_KEYS ; |
||
1588 | cp "Y" |
||
1589 | jr nz,loc_153E |
||
1590 | call CLEAR_DOWN_SCR ; |
||
1591 | ld a,0FFh |
||
1592 | ld (TRD_5D21),a |
||
1593 | call COM_18 ; |
||
1594 | call GET_TYPE_DISK ; |
||
1595 | ld (TRD_5CD9),a ; <B> <C> |
||
1596 | ld a,(TRD_5E08) |
||
1597 | cp 19h ; 40 1 |
||
1598 | ld hl,640 |
||
1599 | jr z,loc_1575 |
||
1600 | ld hl,1280 |
||
1601 | cp 18h ; 80 1 |
||
1602 | jr z,loc_1575 |
||
1603 | cp 17h ; 40 2 |
||
1604 | jr z,loc_1575 |
||
1605 | ld hl,2560 |
||
1606 | cp 16h ; 80 2 |
||
1607 | jr z,loc_1575 |
||
1608 | JP DISCERROR_ |
||
1609 | |||
1610 | loc_1575 ld bc,(TRD_5E0A) |
||
1611 | sbc hl,bc |
||
1612 | ld (TRD_5CE5),hl ; |
||
1613 | ld (TRD_5CDF),hl |
||
1614 | ld hl,0 |
||
1615 | ld (TRD_5CE1),hl |
||
1616 | ld (TRD_5CE3),hl |
||
1617 | call COPY_SECTORS |
||
1618 | call COM_18 ; |
||
1619 | ld a,(TRD_5CE6+1) ; <C>- , <B>- |
||
1620 | ld (TRD_5E08),a |
||
1621 | ld hl,(TRD_5CDD) ; |
||
1622 | ld bc,(TRD_5CDF) |
||
1623 | sbc hl,bc |
||
1624 | ld (TRD_5E0A),hl |
||
1625 | call SETUP_DISK_DEST |
||
1626 | ld de,9 |
||
1627 | ld (TRD_5CF4),de |
||
1628 | call REWRITE_9SEC ; 9 |
||
1629 | jp ERR_OK |
||
1630 | |||
1631 | CP_COPY_SECS ld hl,(TRD_5CE5) ; |
||
1632 | ld a,h |
||
1633 | or l |
||
1634 | ret |
||
1635 | |||
1636 | COPY_SECTORS call CP_COPY_SECS |
||
1637 | ret z |
||
1638 | ld a,(TRD_5D21) |
||
1639 | or a |
||
1640 | jr nz,loc_15DB |
||
1641 | call CLEAR_SCREEN ; |
||
1642 | ld hl,TXT_BACKUPDISK ; "BACKUP DISK" |
||
1643 | call PRINT_MSG ; |
||
1644 | ld hl,TXT_INS_SRC ; "Insert Source disk then press Y" |
||
1645 | call PRINT_MSG ; |
||
1646 | loc_15D1 call GET_KEYS ; |
||
1647 | cp "Y" |
||
1648 | jr nz,loc_15D1 |
||
1649 | call CLEAR_DOWN_SCR ; |
||
1650 | loc_15DB call CP_COPY_SECS |
||
1651 | ret z |
||
1652 | push bc |
||
1653 | push hl |
||
1654 | ld hl,TRD_5D23 |
||
1655 | ld c,(hl) |
||
1656 | ld b,0 |
||
1657 | pop hl |
||
1658 | sbc hl,bc |
||
1659 | pop bc |
||
1660 | jp nc,loc_1644 |
||
1661 | ld bc,(TRD_5CE5) ; |
||
1662 | ld hl,0 |
||
1663 | ld (TRD_5CE5),hl ; |
||
1664 | loc_15F8 push bc |
||
1665 | ld hl,(TRD_5CCF) ; WORK_SP |
||
1666 | push hl |
||
1667 | call SET_DISK_SOURCE |
||
1668 | ld de,(TRD_5CE1) |
||
1669 | ld b,c |
||
1670 | call COM_05 ; |
||
1671 | ld hl,(TRD_5CF4) |
||
1672 | ld (TRD_5CE1),hl |
||
1673 | call CLEAR_SCREEN ; |
||
1674 | ld hl,TXT_BACKUPDISK ; "BACKUP DISK" |
||
1675 | call PRINT_MSG ; |
||
1676 | ld hl,TXT_INS_DEST ; "Insert Destination disk" |
||
1677 | call PRINT_MSG ; |
||
1678 | loc_161D call GET_KEYS ; |
||
1679 | cp "Y" |
||
1680 | jr nz,loc_161D |
||
1681 | call CLEAR_DOWN_SCR ; |
||
1682 | ld a,(TRD_5D21) |
||
1683 | or a |
||
1684 | call nz,CP_FREE_DEST |
||
1685 | pop hl |
||
1686 | pop bc |
||
1687 | ld de,(TRD_5CE3) |
||
1688 | ld b,c |
||
1689 | call SETUP_DISK_DEST |
||
1690 | call COM_06 ; |
||
1691 | ld hl,(TRD_5CF4) |
||
1692 | ld (TRD_5CE3),hl |
||
1693 | jp COPY_SECTORS |
||
1694 | |||
1695 | loc_1644 ld (TRD_5CE5),hl ; |
||
1696 | push hl |
||
1697 | ld hl,TRD_5D23 |
||
1698 | ld c,(hl) |
||
1699 | ld b,0 |
||
1700 | pop hl |
||
1701 | xor a |
||
1702 | jp loc_15F8 |
||
1703 | |||
1704 | CP_ERASED_FILE call RDHEAD_FILENAME ; |
||
1705 | ld a,(TRD_5CDD) ; |
||
1706 | cp 1 |
||
1707 | ret |
||
1708 | |||
1709 | COM_08 ld c,a ; #5CDD |
||
1710 | ;
|
||
1711 | RDHEAD_FILENAME xor a |
||
1712 | loc_165E push bc |
||
1713 | call RD_HEAD_COPY |
||
1714 | pop bc |
||
1715 | ret |
||
1716 | |||
1717 | COM_09 ld c,a ; |
||
1718 | call SETHEADFILENAME |
||
1719 | jp REWRITE_9SEC ; 9 |
||
1720 | |||
1721 | SETHEADFILENAME ld a,0FFh |
||
1722 | jr loc_165E |
||
1723 | |||
1724 | RESERVED_RAM ld a,0FFh |
||
1725 | ld (TRD_5D0E),a ; #FE- BASIC, TR-DOS |
||
1726 | call CP_FREE_SECS |
||
1727 | ld hl,(WORKSP) |
||
1728 | ld (TRD_5CCF),hl ; WORK_SP |
||
1729 | jp CREATE_FREERAM |
||
1730 | |||
1731 | CP_FREE_SECS rst 20h |
||
1732 | dw 1F1Ah ; ฏเฎขฅเช เ งฌฅเ แขฎกฎคญฎฉ ฏ ฌ๏โจ |
||
1733 | ld hl,0FFFFh |
||
1734 | sbc hl,bc |
||
1735 | ld a,h |
||
1736 | cp 10h |
||
1737 | jr nc,loc_168F |
||
1738 | ld a,11h |
||
1739 | loc_168F dec a |
||
1740 | ld (TRD_5D23),a |
||
1741 | ld b,a |
||
1742 | ld c,0 |
||
1743 | ret |
||
1744 | |||
1745 | ADD_FILESIZE ld (TRD_5CD7),hl ; - |
||
1746 | ;
|
||
1747 | ld (TRD_5CDB),hl |
||
1748 | ld de,(TRD_5CEA) ; |
||
1749 | ld hl,(TRD_5CD9) ; <B> <C> |
||
1750 | ld d,0 |
||
1751 | add hl,de |
||
1752 | ld (TRD_5CD9),hl ; <B> <C> |
||
1753 | ret |
||
1754 | |||
1755 | MOVE call EXIT_IF_SINTAX ; , |
||
1756 | call RESERVED_RAM |
||
1757 | call COM_18 ; |
||
1758 | ld a,(TRD_5E19) |
||
1759 | or a |
||
1760 | jp z,ERR_OK |
||
1761 | ld hl,0 |
||
1762 | ld (TRD_5CD9),hl ; <B> <C> |
||
1763 | ld c,0FFh |
||
1764 | loc_16C3 inc c |
||
1765 | call CP_ERASED_FILE |
||
1766 | jr nz,loc_16C3 |
||
1767 | ld a,c |
||
1768 | ld (TRD_5CD4),a |
||
1769 | ld hl,(TRD_5CEB) ; |
||
1770 | ld (TRD_5CD5),hl |
||
1771 | call ADD_FILESIZE |
||
1772 | loc_16D6 inc c |
||
1773 | call CP_ERASED_FILE |
||
1774 | jr z,loc_16D6 |
||
1775 | cp 0 |
||
1776 | jp nz,loc_1710 |
||
1777 | ld a,(TRD_5CD4) |
||
1778 | ld c,a |
||
1779 | loc_16E5 inc c |
||
1780 | call CP_ERASED_FILE |
||
1781 | cp 0 |
||
1782 | jr z,REINIT_9SEC |
||
1783 | xor a |
||
1784 | ld (TRD_5CDD),a ; |
||
1785 | call WRHEAD_FILENAME ; |
||
1786 | call ADD_FILESIZE |
||
1787 | jr loc_16E5 |
||
1788 | |||
1789 | DUPL 0X1710-$,0FFh |
||
1790 | loc_1710 ld a,(TRD_5CEA) ; |
||
1791 | ld (TRD_5CD3),a |
||
1792 | ld (TRD_5CD1),a |
||
1793 | ld hl,(TRD_5CEB) ; |
||
1794 | ld (TRD_5CD5),hl |
||
1795 | push bc |
||
1796 | call MOVE_FILE |
||
1797 | pop bc |
||
1798 | ld hl,(TRD_5CF4) |
||
1799 | ld (TRD_5CD5),hl |
||
1800 | ld (TRD_5CEB),hl ; |
||
1801 | xor a |
||
1802 | ld (TRD_5CEA),a ; |
||
1803 | ld a,(TRD_5CDD) ; |
||
1804 | push af |
||
1805 | ld a,1 |
||
1806 | ld (TRD_5CDD),a ; |
||
1807 | call WRHEAD_FILENAME ; |
||
1808 | pop af |
||
1809 | ld (TRD_5CDD),a ; |
||
1810 | ld a,(TRD_5CD4) |
||
1811 | ld c,a |
||
1812 | ld hl,(TRD_5CDB) |
||
1813 | ld (TRD_5CEB),hl ; |
||
1814 | ld a,(TRD_5CD1) |
||
1815 | ld (TRD_5CEA),a ; |
||
1816 | call WRHEAD_FILENAME ; |
||
1817 | ld a,(TRD_5CD4) |
||
1818 | inc a |
||
1819 | ld c,a |
||
1820 | call RDHEAD_FILENAME ; |
||
1821 | ld hl,(TRD_5CD5) |
||
1822 | ld (TRD_5CEB),hl ; |
||
1823 | call WRHEAD_FILENAME ; |
||
1824 | ld a,(TRD_5CD4) |
||
1825 | ld c,a |
||
1826 | jp loc_16C3 |
||
1827 | |||
1828 | REINIT_9SEC ld hl,(TRD_5CCF) ; WORK_SP |
||
1829 | ld bc,1000h |
||
1830 | call DEL_WORKRAM |
||
1831 | call READ_9SEC ; 9 |
||
1832 | ld hl,(TRD_5E0A) |
||
1833 | ld de,(TRD_5CD9) ; <B> <C> |
||
1834 | add hl,de |
||
1835 | ld (TRD_5E0A),hl |
||
1836 | ld a,(TRD_5E09) |
||
1837 | ld hl,TRD_5E19 |
||
1838 | sub (hl) |
||
1839 | ld (TRD_5E09),a |
||
1840 | ld (hl),0 |
||
1841 | ld hl,(TRD_5CD5) |
||
1842 | ld (TRD_5E06),hl |
||
1843 | push af |
||
1844 | call REWRITE_9SEC ; 9 |
||
1845 | pop af |
||
1846 | ld c,a |
||
1847 | call RDHEAD_FILENAME ; |
||
1848 | xor a |
||
1849 | ld (TRD_5CDD),a ; |
||
1850 | jp loc_569 |
||
1851 | |||
1852 | MOVE_FILE ld a,(TRD_5CD3) |
||
1853 | or a |
||
1854 | ret z |
||
1855 | push hl |
||
1856 | ld hl,TRD_5D23 |
||
1857 | sub (hl) |
||
1858 | pop hl |
||
1859 | jr nc,loc_17DD |
||
1860 | ld a,(TRD_5CD3) |
||
1861 | ld b,a |
||
1862 | xor a |
||
1863 | ld (TRD_5CD3),a |
||
1864 | loc_17BA push bc |
||
1865 | ld hl,(TRD_5CCF) ; WORK_SP |
||
1866 | push hl |
||
1867 | ld de,(TRD_5CD5) |
||
1868 | call COM_05 ; |
||
1869 | ld hl,(TRD_5CF4) |
||
1870 | ld (TRD_5CD5),hl |
||
1871 | pop hl |
||
1872 | pop bc |
||
1873 | ld de,(TRD_5CD7) ; - |
||
1874 | ;
|
||
1875 | call COM_06 ; |
||
1876 | ld hl,(TRD_5CF4) |
||
1877 | ld (TRD_5CD7),hl ; - |
||
1878 | ;
|
||
1879 | jr MOVE_FILE |
||
1880 | |||
1881 | loc_17DD ld (TRD_5CD3),a |
||
1882 | push hl |
||
1883 | ld hl,TRD_5D23 |
||
1884 | ld b,(hl) |
||
1885 | pop hl |
||
1886 | xor a |
||
1887 | jr loc_17BA |
||
1888 | |||
1889 | RD_HEAD_COPY push af |
||
1890 | ld hl,TRD_5CCC ; |
||
1891 | ld (hl),0 |
||
1892 | ld a,c |
||
1893 | loc_17F0 sub 10h |
||
1894 | jr c,loc_17F7 |
||
1895 | inc (hl) |
||
1896 | jr loc_17F0 |
||
1897 | |||
1898 | loc_17F7 add a,10h |
||
1899 | ld c,a |
||
1900 | push bc |
||
1901 | call READ_NUM_SEC ; |
||
1902 | pop bc |
||
1903 | pop af |
||
1904 | call FIND_HEAD_BUF |
||
1905 | ld de,TRD_5CDD ; |
||
1906 | ld bc,10h |
||
1907 | or a |
||
1908 | jr z,loc_180D ; FIX |
||
1909 | ex de,hl |
||
1910 | loc_180D ldir ; FIX |
||
1911 | ret |
||
1912 | |||
1913 | VERIFY ld a,0FFh |
||
1914 | ld (TRD_5CF9),a ; 2 |
||
1915 | LOAD call ZERO2HIGH_ERR |
||
1916 | loc_1818 call LOAD_FILE |
||
1917 | call EXIT_IF_SINTAX ; , |
||
1918 | ld a,0FFh |
||
1919 | ld (TRD_5D10),a ; |
||
1920 | ld a,(TRD_5CF9) ; 2 |
||
1921 | cp 0FFh |
||
1922 | jp z,ERR_OK |
||
1923 | ld a,(TRD_5CE5) ; |
||
1924 | cp "B" |
||
1925 | jp z,WORK4AUTORUN ; |
||
1926 | jp ERR_OK |
||
1927 | |||
1928 | LOAD_FILE call GET_PARAMS |
||
1929 | call EXIT_IF_SINTAX ; , |
||
1930 | call CP_PARAMS ; |
||
1931 | jp RD_FILE |
||
1932 | |||
1933 | ;
,
|
||
1934 | GET_LOAD_CODE ld hl,(CH_ADD) |
||
1935 | inc hl |
||
1936 | ld a,(hl) |
||
1937 | cp 0Dh ; "ENTER"? |
||
1938 | ret z ; , - |
||
1939 | ld a,1 |
||
1940 | ld (TRD_5CD6),a ; #FF- |
||
1941 | call INPUT_PARAMS ; |
||
1942 | ZERO2HIGH_ERR xor a |
||
1943 | ld (TRD_5D10),a ; |
||
1944 | ret |
||
1945 | |||
1946 | sub_1857 call INP_EXTFILENAME ; |
||
1947 | ld a,"B" |
||
1948 | cp b |
||
1949 | jr nz,loc_1866 |
||
1950 | ld hl,(CH_ADD) |
||
1951 | dec hl |
||
1952 | ld (CH_ADD),hl |
||
1953 | loc_1866 call INPUT_PARAMS |
||
1954 | ld hl,(TRD_5CD9) ; <B> <C> |
||
1955 | ld (TRD_5CD7),hl ; - |
||
1956 | ;
|
||
1957 | ld hl,(TRD_5CDB) |
||
1958 | ld (TRD_5CD9),hl ; <B> <C> |
||
1959 | xor a |
||
1960 | ld (TRD_5CD6),a ; #FF- |
||
1961 | ret |
||
1962 | |||
1963 | GET_PARAMS call CP_SECOND_SYM ; |
||
1964 | jp z,loc_27B |
||
1965 | call SET_AND_PUT |
||
1966 | call CP_HIGH_ERR |
||
1967 | call nz,sub_1857 |
||
1968 | call GET_SYMSTR |
||
1969 | cp 0AFh ; CODE |
||
1970 | call z,GET_LOAD_CODE ; , |
||
1971 | cp 0E4h ; DATA |
||
1972 | push af |
||
1973 | call CP_HIGH_ERR |
||
1974 | call z,INP_EXTFILENAME ; |
||
1975 | pop af |
||
1976 | call z,READ_MASSIV |
||
1977 | call EXIT_IF_SINTAX ; , |
||
1978 | call FIND_FILE ; |
||
1979 | FIND_RD_HEAD jp nz,ERR_NOFILES |
||
1980 | call RDHEAD_FILENAME ; |
||
1981 | ret |
||
1982 | |||
1983 | ;
|
||
1984 | CP_PARAMS ld a,(TRD_5CD6) ; #FF- |
||
1985 | or a |
||
1986 | ld hl,(TRD_5CE6) ; <C>- , <B>- |
||
1987 | jr z,loc_18B7 |
||
1988 | ld hl,(TRD_5CD9) ; <B> <C> |
||
1989 | loc_18B7 CALL ADR_START_COM |
||
1990 | NOP |
||
1991 | cp 3 |
||
1992 | ld a,(TRD_5CEA) ; |
||
1993 | push de |
||
1994 | ld de,(TRD_5CE8) ; |
||
1995 | jr nz,loc_18CB |
||
1996 | ld de,(TRD_5CDB) |
||
1997 | loc_18CB ld b,a |
||
1998 | ld (TRD_5CDB),de |
||
1999 | ld a,(TRD_5CE5) ; |
||
2000 | cp "C" |
||
2001 | ld a,b |
||
2002 | jr nz,loc_18FD |
||
2003 | ld a,b |
||
2004 | cp d |
||
2005 | jr z,loc_18F6 |
||
2006 | dec a |
||
2007 | cp d |
||
2008 | ld a,b |
||
2009 | jr z,loc_18F6 |
||
2010 | ld a,(TRD_5CD6) ; #FF- |
||
2011 | cp 3 |
||
2012 | ld a,b |
||
2013 | jr z,loc_18F6 |
||
2014 | xor a |
||
2015 | ld (TRD_5CD6),a ; #FF- |
||
2016 | ld d,b |
||
2017 | ld e,0 |
||
2018 | ld (TRD_5CDB),de |
||
2019 | jr loc_18F9 |
||
2020 | |||
2021 | loc_18F6 call LOAD_FULLFILE |
||
2022 | loc_18F9 ld a,b |
||
2023 | call KOLWO_SECS |
||
2024 | loc_18FD ld b,a |
||
2025 | ld a,(TRD_5CE5) ; |
||
2026 | cp "C" |
||
2027 | pop de |
||
2028 | ret z |
||
2029 | push de |
||
2030 | cp "B" |
||
2031 | push af |
||
2032 | call z,LOAD4BASIC |
||
2033 | pop af |
||
2034 | cp "D" |
||
2035 | call z,LOAD4DATA |
||
2036 | call LOAD_FULLFILE |
||
2037 | ld a,(TRD_5CDC) |
||
2038 | ld b,a |
||
2039 | pop de |
||
2040 | ret |
||
2041 | |||
2042 | LOAD_FULLFILE ld a,3 |
||
2043 | ld (TRD_5CD6),a ; #FF- |
||
2044 | ret |
||
2045 | |||
2046 | RD_FILE call CP_HIGH_ERR |
||
2047 | jr z,loc_192D |
||
2048 | push af |
||
2049 | call NUM_SEC_FILE |
||
2050 | pop af |
||
2051 | cp 0FFh |
||
2052 | loc_192D push af |
||
2053 | call z,RD_SECTORS |
||
2054 | pop af |
||
2055 | jr z,loc_1937 |
||
2056 | jp COM_06 ; |
||
2057 | |||
2058 | loc_1937 ld a,(TRD_5CD6) ; #FF- |
||
2059 | cp 3 |
||
2060 | call z,RD_OR_VERIFY |
||
2061 | ld hl,(E_LINE) ; |
||
2062 | dec hl |
||
2063 | ld (hl),80h |
||
2064 | ret |
||
2065 | |||
2066 | RD_OR_VERIFY ld a,(TRD_5CF9) ; 2 |
||
2067 | cp 0FFh |
||
2068 | jp nz,LOAD_END_FILE |
||
2069 | ld a,(TRD_5CDB) |
||
2070 | or a |
||
2071 | ret z |
||
2072 | ld c,a |
||
2073 | ld b,1 |
||
2074 | ld de,(TRD_5CF4) |
||
2075 | jr loc_196A |
||
2076 | |||
2077 | RD_SECTORS ld a,(TRD_5CF9) ; 2 |
||
2078 | cp 0FFh |
||
2079 | jp nz,COM_05 ; |
||
2080 | ld (TRD_5CF4),de |
||
2081 | ld c,0 |
||
2082 | loc_196A ld a,b |
||
2083 | or a |
||
2084 | ret z |
||
2085 | ld (TRD_5CD7),hl ; - |
||
2086 | ;
|
||
2087 | ld (TRD_5CD9),de ; <B> <C> |
||
2088 | loc_1974 push bc |
||
2089 | ld b,1 |
||
2090 | ld de,(TRD_5CD9) ; <B> <C> |
||
2091 | ld hl,TRD_5D25 |
||
2092 | call COM_05 ; |
||
2093 | ld hl,(TRD_5CF4) |
||
2094 | ld (TRD_5CD9),hl ; <B> <C> |
||
2095 | pop bc |
||
2096 | ld hl,(TRD_5CD7) ; - |
||
2097 | ;
|
||
2098 | ld de,TRD_5D25 |
||
2099 | loc_198E ld a,(de) |
||
2100 | cp (hl) |
||
2101 | jr nz,loc_199D |
||
2102 | inc hl |
||
2103 | inc de |
||
2104 | dec c |
||
2105 | jr nz,loc_198E |
||
2106 | ld (TRD_5CD7),hl ; - |
||
2107 | ;
|
||
2108 | djnz loc_1974 |
||
2109 | ret |
||
2110 | |||
2111 | loc_199D ld hl,TXT_VERIFYERR ; "Verify Error." |
||
2112 | ld a,0Dh |
||
2113 | jp PRINT_TXTERR |
||
2114 | |||
2115 | PEEK ld a,0FFh |
||
2116 | jr loc_19AB |
||
2117 | |||
2118 | POKE ld a,0EEh |
||
2119 | loc_19AB ld (TRD_5D10),a ; |
||
2120 | jp loc_1818 |
||
2121 | |||
2122 | MERGE ld a,0FFh |
||
2123 | ld (TRD_5D1F),a |
||
2124 | call GET_PARAMS |
||
2125 | call EXIT_IF_SINTAX ; , |
||
2126 | ld a,(TRD_5CE5) ; |
||
2127 | cp "B" |
||
2128 | jp nz,SINTAX_ERROR |
||
2129 | ld bc,(TRD_5CE6) ; <C>- , <B>- |
||
2130 | ld (TRD_5CDB),bc |
||
2131 | push bc |
||
2132 | inc bc |
||
2133 | rst 20h |
||
2134 | dw 30h ; แฎงค ญจฅ แขฎกฎคญฎฃฎ ฌฅแโ |
||
2135 | ld (hl),80h |
||
2136 | ex de,hl |
||
2137 | pop de |
||
2138 | push hl |
||
2139 | ld de,(TRD_5CEB) ; |
||
2140 | call LOAD_FULLFILE |
||
2141 | ld a,(TRD_5CDC) |
||
2142 | ld b,a |
||
2143 | call ZERO2HIGH_ERR |
||
2144 | call RD_FILE |
||
2145 | pop hl |
||
2146 | ld de,(PROG) |
||
2147 | rst 20h |
||
2148 | dw 8D2h ; เ กฎโ แฎ แโเฎช ฌจ ฏเฎฃเ ฌฌ๋ ญ ฅฉแจชฅ |
||
2149 | jp ERR_OK |
||
2150 | |||
2151 | CP_FREE4PROG ex de,hl |
||
2152 | scf |
||
2153 | sbc hl,de |
||
2154 | ret c |
||
2155 | ld de,0Ah |
||
2156 | add hl,de |
||
2157 | ld b,h |
||
2158 | ld c,l |
||
2159 | |||
2160 | CP_FREE_RAM rst 20h |
||
2161 | dw 1F05h ; ฏเฎขฅเช แขฎกฎคญฎฉ ฏ ฌ๏โจ |
||
2162 | ret |
||
2163 | |||
2164 | LOAD4BASIC ld de,(PROG) |
||
2165 | ld hl,(E_LINE) ; |
||
2166 | dec hl |
||
2167 | push hl |
||
2168 | push de |
||
2169 | sbc hl,de |
||
2170 | ld de,(TRD_5CE6) ; <C>- , <B>- |
||
2171 | push de |
||
2172 | push hl |
||
2173 | ld hl,0 |
||
2174 | ld a,(TRD_5CF9) ; 2 |
||
2175 | cp 0FFh |
||
2176 | jr z,loc_1A20 |
||
2177 | ld hl,5 |
||
2178 | loc_1A20 add hl,de |
||
2179 | ld (TRD_5CDB),hl |
||
2180 | pop hl |
||
2181 | ld a,(TRD_5CF9) ; 2 |
||
2182 | cp 0FFh |
||
2183 | jr nz,loc_1A31 |
||
2184 | pop de |
||
2185 | pop de |
||
2186 | pop hl |
||
2187 | jr loc_1A48 |
||
2188 | |||
2189 | loc_1A31 call CP_FREE4PROG |
||
2190 | pop bc |
||
2191 | pop de |
||
2192 | pop hl |
||
2193 | push bc |
||
2194 | rst 20h |
||
2195 | dw 19E5h ; ขฎแแโ ญฎขซฅญจฅ |
||
2196 | pop bc |
||
2197 | call RESERV_RAM |
||
2198 | inc hl |
||
2199 | ld bc,(TRD_5CE8) ; |
||
2200 | add hl,bc |
||
2201 | ld (VARS),hl |
||
2202 | loc_1A48 ld hl,(PROG) |
||
2203 | ret |
||
2204 | |||
2205 | LOAD4DATA ld de,(TRD_5CE8) ; |
||
2206 | ld (TRD_5CDB),de |
||
2207 | ld hl,(TRD_5CD7) ; - |
||
2208 | ;
|
||
2209 | ld a,(TRD_5CF9) ; 2 |
||
2210 | cp 0FFh |
||
2211 | ret z |
||
2212 | ld hl,(TRD_5CD9) ; <B> <C> |
||
2213 | push hl |
||
2214 | call CP_FREE4PROG |
||
2215 | pop hl |
||
2216 | ld a,h |
||
2217 | or l |
||
2218 | jr z,loc_1A79 |
||
2219 | ld hl,(TRD_5CD7) ; - |
||
2220 | ;
|
||
2221 | dec hl |
||
2222 | dec hl |
||
2223 | dec hl |
||
2224 | ld bc,(TRD_5CD9) ; <B> <C> |
||
2225 | inc bc |
||
2226 | inc bc |
||
2227 | inc bc |
||
2228 | call DEL_WORKRAM |
||
2229 | loc_1A79 ld hl,(E_LINE) ; |
||
2230 | dec hl |
||
2231 | ld bc,(TRD_5CE8) ; |
||
2232 | push bc |
||
2233 | inc bc |
||
2234 | inc bc |
||
2235 | inc bc |
||
2236 | call RESERV_RAM |
||
2237 | inc hl |
||
2238 | ld a,(TRD_5CD2) |
||
2239 | ld (hl),a |
||
2240 | inc hl |
||
2241 | pop de |
||
2242 | ld (hl),e |
||
2243 | inc hl |
||
2244 | ld (hl),d |
||
2245 | inc hl |
||
2246 | ret |
||
2247 | |||
2248 | NUM_SEC_FILE ld a,(TRD_5CD9) ; <B> <C> |
||
2249 | ld c,b |
||
2250 | ld b,a |
||
2251 | ld a,c |
||
2252 | cp b |
||
2253 | jr c,loc_1AB6 |
||
2254 | ld a,b |
||
2255 | or a |
||
2256 | jp z,SINTAX_ERROR |
||
2257 | dec b |
||
2258 | jr z,loc_1AB0 |
||
2259 | ld a,10h |
||
2260 | loc_1AA7 inc e |
||
2261 | cp e |
||
2262 | jr nz,loc_1AAE |
||
2263 | ld e,0 |
||
2264 | inc d |
||
2265 | loc_1AAE djnz loc_1AA7 |
||
2266 | loc_1AB0 ld b,1 |
||
2267 | ld hl,(TRD_5CD7) ; - |
||
2268 | ;
|
||
2269 | ret |
||
2270 | |||
2271 | loc_1AB6 ld hl,TXT_R_O |
||
2272 | ld a,5 |
||
2273 | jp PRINT_TXTERR |
||
2274 | |||
2275 | CP_FILE_FREE call FIND_FILE ; |
||
2276 | jp z,FILE_EXISTS |
||
665 | savelij | 2277 | CP_FREE_ON_DISK call READ_9SEC ; |
623 | savelij | 2278 | ld a,(TRD_5E09) |
2279 | cp 80h |
||
2280 | jp z,ERR_DIRFULL |
||
2281 | ret |
||
2282 | |||
2283 | SAVE call ZERO2HIGH_ERR |
||
2284 | ld hl,0 |
||
2285 | ld (TRD_5CD1),hl |
||
2286 | call SET_AND_PUT |
||
2287 | call GET_SYMSTR |
||
2288 | cp 0AFh ; CODE |
||
2289 | jr z,loc_1B39 |
||
2290 | cp 0CAh ; LINE |
||
2291 | jr nz,loc_1AF8 ; SCREEN$ |
||
2292 | call SET_NUM_CHAN |
||
2293 | call EXIT_IF_SINTAX ; , |
||
2294 | ld hl,(TRD_5CDB) |
||
2295 | ld (TRD_5CD1),hl |
||
2296 | ld hl,TRD_5CE5 ; |
||
2297 | jr loc_1B1F |
||
2298 | |||
2299 | loc_1AF8 cp 0AAh ; SCREEN$ |
||
2300 | jr nz,loc_1B0D |
||
2301 | ld hl,4000h |
||
2302 | ld (TRD_5CD7),hl ; - |
||
2303 | ;
|
||
2304 | ld hl,1B00h |
||
2305 | ld (TRD_5CD9),hl ; <B> <C> |
||
2306 | ld (TRD_5CDB),hl |
||
2307 | jr loc_1B48 |
||
2308 | |||
2309 | loc_1B0D call EXIT_IF_SINTAX ; , |
||
2310 | call GET_SYMSTR |
||
2311 | ld hl,TRD_5CE5 ; |
||
2312 | cp 0E4h ; DATA |
||
2313 | jr z,loc_1B2C |
||
2314 | cp 0Dh |
||
2315 | jp nz,SINTAX_ERROR |
||
2316 | loc_1B1F ld (hl),"B" |
||
2317 | call CP_FILE_FREE |
||
2318 | call DEL_5BYTES |
||
2319 | loc_1B27 call SET_START_SIZE |
||
2320 | jr loc_1B53 |
||
2321 | |||
2322 | loc_1B2C ld (hl),"D" |
||
2323 | call CP_FILE_FREE |
||
2324 | call CP_MASSIV |
||
2325 | jr nc,loc_1B53 |
||
2326 | jp c,SINTAX_ERROR |
||
2327 | loc_1B39 call GET_START_SIZE |
||
2328 | ld hl,(TRD_5CD9) ; <B> <C> |
||
2329 | ld (TRD_5CD7),hl ; - |
||
2330 | ;
|
||
2331 | ld hl,(TRD_5CDB) |
||
2332 | ld (TRD_5CD9),hl ; <B> <C> |
||
2333 | loc_1B48 call EXIT_IF_SINTAX ; , |
||
2334 | ld a,"C" |
||
2335 | ld (TRD_5CE5),a ; |
||
2336 | call CP_FILE_FREE |
||
2337 | loc_1B53 call SAVE_FILE |
||
2338 | jp loc_569 |
||
2339 | |||
2340 | SAVE_FILE ld hl,(TRD_5CD7) ; - |
||
2341 | ;
|
||
2342 | ld (TRD_5CE6),hl ; <C>- , <B>- |
||
2343 | ex de,hl |
||
2344 | ld hl,(TRD_5CD9) ; <B> <C> |
||
2345 | ld a,l |
||
2346 | or h |
||
2347 | jp z,SINTAX_ERROR |
||
2348 | ld a,l |
||
2349 | or a |
||
2350 | jr z,loc_1B6D |
||
2351 | inc h |
||
2352 | loc_1B6D ld a,h |
||
2353 | ld (TRD_5CEA),a ; |
||
2354 | ld e,a |
||
2355 | ld d,0 |
||
2356 | ld hl,(TRD_5E0A) |
||
2357 | sbc hl,de |
||
2358 | jp c,loc_1C45 |
||
2359 | push hl |
||
2360 | ld hl,(E_LINE) ; |
||
2361 | ld (hl),0AAh ; SCREEN$ |
||
2362 | inc hl |
||
2363 | ld de,(TRD_5CD1) |
||
2364 | ld (hl),e |
||
2365 | inc hl |
||
2366 | ld (hl),d |
||
2367 | ld hl,(TRD_5CDB) |
||
2368 | ld (TRD_5CE8),hl ; |
||
2369 | ld hl,(TRD_5E06) |
||
2370 | ld (TRD_5CEB),hl ; |
||
2371 | ex de,hl |
||
2372 | ld hl,(TRD_5CE6) ; <C>- , <B>- |
||
2373 | ld a,(TRD_5CEA) ; |
||
2374 | ld b,a |
||
2375 | call COM_06 ; |
||
2376 | ld hl,(TRD_5CF4) |
||
2377 | push hl |
||
2378 | call READ_9SEC ; 9 |
||
2379 | pop hl |
||
2380 | ld (TRD_5E06),hl |
||
2381 | pop hl |
||
2382 | ld (TRD_5E0A),hl |
||
2383 | ld hl,TRD_5E09 |
||
2384 | ld a,(hl) |
||
2385 | ld (TRD_5D1E),a |
||
2386 | inc (hl) |
||
2387 | push hl |
||
2388 | call REWRITE_9SEC ; 9 |
||
2389 | pop hl |
||
2390 | ld c,(hl) |
||
2391 | dec c |
||
2392 | ld a,(TRD_5CE5) ; |
||
2393 | cp "B" |
||
2394 | call z,SET_HEAD_STSZ |
||
2395 | ret |
||
2396 | |||
2397 | SET_HEAD_STSZ ld hl,(E_LINE) ; |
||
2398 | ld de,(PROG) |
||
2399 | scf |
||
2400 | sbc hl,de |
||
2401 | ld (TRD_5CE6),hl ; <C>- , <B>- |
||
2402 | ld hl,(VARS) |
||
2403 | sbc hl,de |
||
2404 | ld (TRD_5CE8),hl ; |
||
2405 | ret |
||
2406 | |||
2407 | SET_START_SIZE ld hl,(VARS) |
||
2408 | ld de,(PROG) |
||
2409 | sbc hl,de |
||
2410 | ld (TRD_5CDB),hl |
||
2411 | ld hl,(PROG) |
||
2412 | ld (TRD_5CD7),hl ; - |
||
2413 | ;
|
||
2414 | ld hl,(E_LINE) ; |
||
2415 | inc hl |
||
2416 | inc hl |
||
2417 | inc hl |
||
2418 | sbc hl,de |
||
2419 | ld (TRD_5CD9),hl ; <B> <C> |
||
2420 | ret |
||
2421 | |||
2422 | READ_MASSIV call FIND_MASSIV |
||
2423 | ret nc |
||
2424 | ld hl,0 |
||
2425 | ld (TRD_5CD9),hl ; <B> <C> |
||
2426 | ld a,(TRD_5CF9) ; 2 |
||
2427 | cp 0FFh |
||
2428 | ret nz |
||
2429 | jp loc_1C13 |
||
2430 | |||
2431 | CP_MASSIV call FIND_MASSIV |
||
2432 | ret nc |
||
2433 | loc_1C13 ld a,0Eh |
||
2434 | ld hl,TXT_ARRAYNOT ; "Array not found" |
||
2435 | jp PRINT_TXTERR |
||
2436 | |||
2437 | FIND_MASSIV call GET_NEXT_SYM |
||
2438 | call LOOK_VARS |
||
2439 | set 7,c |
||
2440 | ld a,c |
||
2441 | ld (TRD_5CD2),a |
||
2442 | jr nc,loc_1C2B |
||
2443 | loc_1C29 scf |
||
2444 | ret |
||
2445 | |||
2446 | loc_1C2B jr nz,loc_1C29 |
||
2447 | inc hl |
||
2448 | ld e,(hl) |
||
2449 | inc hl |
||
2450 | ld d,(hl) |
||
2451 | inc hl |
||
2452 | ld (TRD_5CD7),hl ; - |
||
2453 | ;
|
||
2454 | ld (TRD_5CDB),de |
||
2455 | ld (TRD_5CD9),de ; <B> <C> |
||
2456 | call GET_NEXT_SYM |
||
2457 | cp ")" |
||
2458 | jr nz,loc_1C2B |
||
2459 | ret |
||
2460 | |||
2461 | loc_1C45 ld hl,TXT_NOSPACE_ |
||
2462 | ld a,3 |
||
2463 | PRINT_TXTERR call PRINT_ERROR ; |
||
2464 | jp END_COMAND |
||
2465 | |||
2466 | FILE_EXISTS ld hl,TXT_FILEEXISTS_ |
||
2467 | ld a,2 |
||
2468 | jr PRINT_TXTERR |
||
2469 | |||
2470 | ;
#5CDD |
||
2471 | SET_FILENAME ld hl,TRD_5CDD ; |
||
2472 | ld b,8 |
||
2473 | loc_1C5C ld (hl)," " |
||
2474 | inc hl |
||
2475 | djnz loc_1C5C |
||
2476 | call CP_ON_STKBOT |
||
2477 | ex de,hl |
||
2478 | call SETUP_DISK |
||
2479 | ld a,c |
||
2480 | or a |
||
2481 | jp z,SINTAX_ERROR |
||
2482 | cp 9 |
||
2483 | jr c,loc_1C73 |
||
2484 | ld c,8 |
||
2485 | loc_1C73 ld a,(hl) |
||
2486 | cp " " |
||
2487 | jp c,SINTAX_ERROR |
||
2488 | ld de,TRD_5CDD ; |
||
2489 | push bc |
||
2490 | ldir |
||
2491 | pop bc |
||
2492 | ret |
||
2493 | |||
2494 | SETUP_DISK inc hl |
||
2495 | ld a,(hl) |
||
2496 | cp ":" |
||
2497 | jr nz,loc_1C98 |
||
2498 | dec hl |
||
2499 | ld a,(hl) |
||
2500 | call NUMDSK2BYTE |
||
2501 | push bc |
||
2502 | push hl |
||
2503 | call COM_01 ; |
||
2504 | pop hl |
||
2505 | pop bc |
||
2506 | dec bc |
||
2507 | dec bc |
||
2508 | inc hl |
||
2509 | inc hl |
||
2510 | ret |
||
2511 | |||
2512 | loc_1C98 dec hl |
||
2513 | ld a,(TRD_5D19) ; |
||
2514 | push bc |
||
2515 | push hl |
||
2516 | call COM_01 ; |
||
2517 | pop hl |
||
2518 | pop bc |
||
2519 | ret |
||
2520 | |||
2521 | FIND_HEAD_BUF ld l,c |
||
2522 | ld h,0 |
||
2523 | add hl,hl |
||
2524 | add hl,hl |
||
2525 | add hl,hl |
||
2526 | add hl,hl |
||
2527 | ld bc,TRD_5D25 |
||
2528 | add hl,bc |
||
2529 | ret |
||
2530 | |||
2531 | SET_CP_FILENAME call SET_FILENAME ; #5CDD |
||
2532 | ;
|
||
2533 | FIND_FILENAME call RD_0SEC2BUF ; 0 |
||
2534 | ld b,80h |
||
2535 | ld c,0 |
||
2536 | loc_1CBA push bc |
||
2537 | call FIND_HEAD_BUF |
||
2538 | call CP_END_BUF ; |
||
2539 | pop bc |
||
2540 | push bc |
||
2541 | ld a,c |
||
2542 | cp 10h |
||
2543 | jr nz,loc_1CCD |
||
2544 | pop bc |
||
2545 | ld c,0 |
||
2546 | jr loc_1CBA |
||
2547 | |||
2548 | loc_1CCD ld de,TRD_5CDD ; |
||
2549 | ld a,(TRD_5D06) ; |
||
2550 | ld b,a |
||
2551 | xor a |
||
2552 | cp (hl) |
||
2553 | jr nz,loc_1CDB |
||
2554 | pop bc |
||
2555 | jr loc_1CE4 |
||
2556 | |||
2557 | loc_1CDB call COMPARE_B_SYM |
||
2558 | pop bc |
||
2559 | jr z,loc_1CE7 |
||
2560 | inc c |
||
2561 | djnz loc_1CBA |
||
2562 | loc_1CE4 or 0FFh |
||
2563 | ret |
||
2564 | |||
2565 | loc_1CE7 ld a,80h |
||
2566 | sub b |
||
2567 | ld c,a |
||
2568 | ld (TRD_5D1E),a |
||
2569 | xor a |
||
2570 | ret z |
||
2571 | |||
2572 | COM_0A call FIND_FILENAME ; |
||
2573 | ld hl,TRD_5D0F ; TR-DOS |
||
2574 | ld (hl),c |
||
2575 | ret z |
||
2576 | ld (hl),0FFh |
||
2577 | ret |
||
2578 | |||
2579 | RETURN call EXIT_IF_SINTAX ; , |
||
2580 | call DELETE_BUF_ |
||
2581 | res 3,(iy+1) |
||
2582 | call RESTORE_SP ; |
||
2583 | ld sp,(TRD_5D1C) ; SP |
||
665 | savelij | 2584 | exx |
2585 | ld hl,2758h |
||
2586 | exx |
||
2587 | dec hl |
||
2588 | ld a,12h |
||
2589 | cp (hl) |
||
2590 | ret nz |
||
2591 | dec hl |
||
623 | savelij | 2592 | JP LOC_235 |
2593 | |||
2594 | SINTAX_ERROR bit 7,(iy+0) |
||
2595 | jr z,loc_1D25 |
||
2596 | ld a,0Bh |
||
2597 | ld (ERR_NR),a |
||
2598 | loc_1D25 inc a |
||
2599 | ld hl,TXT_ERROR_ |
||
2600 | PRT_TEXT_ERROR call PRINT_ERROR ; |
||
2601 | jp END_COMAND |
||
2602 | |||
2603 | loc_1D2F ld a,(ERR_NR) |
||
2604 | ld hl,TXT_BREAK ; "*BREAK*" |
||
2605 | cp 14h |
||
2606 | jr z,PRT_TEXT_ERROR |
||
2607 | cp 0Ch |
||
2608 | jr z,PRT_TEXT_ERROR |
||
2609 | ld hl,TXT_OUTRAM ; "Out of RAM" |
||
2610 | cp 3 |
||
2611 | jr z,PRT_TEXT_ERROR |
||
2612 | ld hl,TXT_ARRAYNOT ; "Array not found" |
||
2613 | cp 1 |
||
2614 | jr z,PRT_TEXT_ERROR |
||
2615 | jr SINTAX_ERROR |
||
2616 | |||
2617 | RUN call ZERO2HIGH_ERR |
||
2618 | call LOAD_FILE |
||
2619 | call EXIT_IF_SINTAX ; , |
||
2620 | JP RUN_FILE ;LD HL,(TRD_5CE6) |
||
2621 | ld a,(TRD_5CE5) ; |
||
2622 | cp "B" |
||
2623 | jp z,WORK4AUTORUN ; |
||
2624 | push hl |
||
2625 | ret |
||
2626 | |||
2627 | CLEAR_WORKSPACE ld hl,TRD_5D0E ; #FE- BASIC, TR-DOS |
||
2628 | ld a,(hl) |
||
2629 | loc_1D67 cp 0FFh |
||
2630 | ld (hl),0 |
||
2631 | ret nz |
||
2632 | rst 20h |
||
2633 | dw 16BFh ; ฎ็จแโช เ กฎ็ฅฉ ฎกซ แโจ จ แโฅช ช ซ์ชใซ๏โฎเ |
||
2634 | ret |
||
2635 | |||
2636 | CP_SINTAX bit 7,(iy+1) |
||
2637 | ret |
||
2638 | |||
2639 | ;
,
|
||
2640 | EXIT_IF_SINTAX call CP_SINTAX |
||
2641 | ret nz |
||
2642 | pop hl |
||
2643 | ret |
||
2644 | |||
2645 | ;
|
||
2646 | CHISLO2STKBOT call GET_NEXT_SYM |
||
2647 | call BC2STKBOT |
||
2648 | jr CP_SINTAX |
||
2649 | |||
2650 | ;
0 |
||
2651 | OPEN_CHAN_0 xor a |
||
2652 | OPENSTREAM rst 20h |
||
2653 | dw 1601h ; ฎโชเ๋โจฅ ช ญ ซ |
||
2654 | ret |
||
2655 | |||
2656 | ;
2 |
||
2657 | OPEN_CHAN_2 ld a,2 |
||
2658 | jr OPENSTREAM |
||
2659 | |||
2660 | GET_SYMSTR rst 20h |
||
2661 | dw 18h ; ข๋กฎเช แจฌขฎซ จง (CH_ADD) |
||
2662 | ret |
||
2663 | |||
2664 | CALL2BASEDIT call OPEN_CHAN_0 ; 0 |
||
2665 | rst 20h |
||
2666 | dw 0F2Ch ; เฅค ชโฎเ ชฎฌ ญคญฎฉ แโเฎชจ |
||
2667 | ret |
||
2668 | |||
2669 | ; |
||
2670 | CLEAR_SCREEN rst 20h |
||
2671 | dw 0D6Bh ; ฎ็จแโช ํชเ ญ |
||
2672 | ret |
||
2673 | |||
2674 | LOOK_VARS rst 20h |
||
2675 | dw 28B2h ; Look-Vars. ไจฃ งญ ฅโ ็ฅ คฅซ ฅโ |
||
2676 | ret |
||
2677 | |||
2678 | ;
|
||
2679 | CLEAR_DOWN_SCR rst 20h |
||
2680 | dw 0D6Eh ; ฎ็จแโช ญจฆญฅฉ ็ แโจ ํชเ ญ |
||
2681 | ret |
||
2682 | |||
2683 | PRINT_CHISLO_A_ ld c,a |
||
2684 | CONV2_2BYTES ld b,0 |
||
2685 | jp PRINT_CHISLO |
||
2686 | |||
2687 | PRINT_CHISLO push bc ; |
||
2688 | DUPL 3,0 |
||
2689 | pop bc |
||
2690 | rst 20h |
||
2691 | dw 1A1Bh ; ฏฅ็ โ์ แฎฎก้ฅญจฉ จ ญฎฌฅเฎข แโเฎช |
||
2692 | DUPL 3,0 |
||
2693 | ret |
||
2694 | |||
2695 | GET_STKBOT_ rst 20h |
||
2696 | dw 2BF1h ; ็โฅญจฅ คญ แโฅช ช ซ์ชใซ๏โฎเ |
||
2697 | ret |
||
2698 | |||
2699 | FIND_LAST rst 20h |
||
2700 | dw 1E99h ; ฏฎจแช ฏฎแซฅคญฅฃฎ ๆฅซฎฃฎ ็จแซ |
||
2701 | ret |
||
2702 | |||
2703 | PUT_NUMDSK_STK rst 20h |
||
2704 | dw 1C8Ch |
||
2705 | ret |
||
2706 | |||
2707 | BC2STKBOT rst 20h |
||
2708 | dw 1C82h |
||
2709 | ret |
||
2710 | |||
2711 | ; CH_ADD |
||
2712 | SET_CH_ADD ld hl,(TRD_5D11) ; TR_DOS |
||
2713 | inc hl |
||
2714 | ld (CH_ADD),hl |
||
2715 | ret |
||
2716 | |||
2717 | INP_STR2STKBOT call SET_AND_PUT |
||
2718 | loc_1DD0 call GET_SYMSTR |
||
2719 | cp "," |
||
2720 | jp nz,SINTAX_ERROR |
||
2721 | call GET_NEXT_SYM |
||
2722 | call PUT_NUMDSK_STK |
||
2723 | ret |
||
2724 | |||
2725 | SET_AND_PUT call SET_CH_ADD ; CH_ADD |
||
2726 | jp PUT_NUMDSK_STK |
||
2727 | |||
2728 | GET_START_SIZE call GET_SYMSTR |
||
2729 | cp 0AFh ; CODE |
||
2730 | ret nz |
||
2731 | INPUT_PARAMS call CHISLO2STKBOT ; |
||
2732 | jr z,loc_1DFB |
||
2733 | call FIND_LAST |
||
2734 | ld (TRD_5CD9),bc ; <B> <C> |
||
2735 | ld (TRD_5CDB),bc |
||
2736 | loc_1DFB call GET_SYMSTR |
||
2737 | cp "," |
||
2738 | jr z,SET_NUM_CHAN |
||
2739 | cp 0Dh |
||
2740 | jp nz,SINTAX_ERROR |
||
2741 | call EXIT_IF_SINTAX ; , |
||
2742 | ret |
||
2743 | |||
2744 | SET_NUM_CHAN call CHISLO2STKBOT ; |
||
2745 | ret z |
||
2746 | call FIND_LAST |
||
2747 | ld (TRD_5CDB),bc |
||
2748 | ld a,3 |
||
2749 | ld (TRD_5CD6),a ; #FF- |
||
2750 | ret |
||
2751 | |||
2752 | DEL_5BYTES ld hl,(TRD_5D11) ; TR_DOS |
||
2753 | rst 20h |
||
2754 | dw 11A7h ; ใค ซฅญจฅ จง ชฎฌ ญคญฎฉ แโpฎชจ ฏ๏โจก ฉโญ๋ๅ ็จแฅซ |
||
2755 | ret |
||
2756 | |||
2757 | CREATE_FREERAM ld hl,(WORKSP) |
||
2758 | rst 20h |
||
2759 | dw 30h ; แฎงค ญจฅ แขฎกฎคญฎฃฎ ฌฅแโ |
||
2760 | ret |
||
2761 | |||
2762 | GET_NEXT_SYM rst 20h |
||
2763 | dw 20h ; |
||
2764 | ret |
||
2765 | |||
2766 | DEL_WORKRAM rst 20h |
||
2767 | dw 19E8h ; ค ซฅญจฅ ฎกซ แโจ ฏ ฌ๏โจ |
||
2768 | ret |
||
2769 | |||
2770 | RESERV_RAM rst 20h |
||
2771 | dw 1655h |
||
2772 | ret |
||
2773 | |||
2774 | WR_NUM_TRACK call GET_NUM_TRACK |
||
2775 | ld a,h |
||
665 | savelij | 2776 | out (3Fh),a |
623 | savelij | 2777 | ret |
2778 | |||
2779 | ;
|
||
2780 | COM_05 xor a |
||
2781 | jr loc_1E64 |
||
2782 | |||
2783 | WRHEAD_FILENAME call SETHEADFILENAME ; |
||
2784 | REWRITE_9SEC ld de,(TRD_5CF4) ; 9 |
||
2785 | dec de |
||
2786 | ld b,1 |
||
2787 | ld hl,TRD_5D25 |
||
2788 | COM_06 push hl ; |
||
2789 | push de |
||
2790 | call GET_TYPE_DISK ; |
||
2791 | bit 7,(hl) |
||
2792 | jr z,loc_1E60 |
||
2793 | bit 0,(hl) |
||
2794 | jr nz,loc_1E60 |
||
2795 | ld hl,READ_ONLY |
||
2796 | jp PRT_TEXT_ERROR |
||
2797 | |||
2798 | loc_1E60 pop de |
||
2799 | pop hl |
||
2800 | SAVE_SECTORS ld a,0FFh |
||
2801 | loc_1E64 ld (TRD_5CCE),a ; #00- ,#FF- |
||
2802 | loc_1E67 ld (TRD_5CF4),de |
||
2803 | push bc |
||
2804 | push hl |
||
2805 | call WR_NUM_TRACK |
||
2806 | pop hl |
||
2807 | pop bc |
||
2808 | xor a |
||
2809 | or b |
||
2810 | ret z |
||
2811 | loc_1E75 push bc |
||
2812 | push hl |
||
2813 | call COM_04 ; |
||
2814 | ld a,(TRD_5CF4) |
||
2815 | call COM_03 ; |
||
2816 | ld a,(TRD_5CF5) |
||
2817 | call COM_02 ; |
||
2818 | ld a,(TRD_5CCE) ; #00- ,#FF- |
||
2819 | or a |
||
2820 | push af |
||
2821 | call z,LOAD_SECTOR |
||
2822 | pop af |
||
2823 | call nz,SAVE_SECTOR |
||
2824 | pop hl |
||
2825 | ld de,100h |
||
2826 | add hl,de |
||
2827 | push hl |
||
2828 | ld a,10h |
||
2829 | ld hl,TRD_5CF4 |
||
2830 | inc (hl) |
||
2831 | cp (hl) |
||
2832 | jr nz,loc_1EA7 |
||
2833 | ld (hl),0 |
||
2834 | ld hl,TRD_5CF5 |
||
2835 | inc (hl) |
||
2836 | loc_1EA7 pop hl |
||
2837 | pop bc |
||
2838 | djnz loc_1E75 |
||
2839 | ret |
||
2840 | |||
2841 | KOLWO_SECS push hl |
||
2842 | ld h,a |
||
2843 | ld l,0 |
||
2844 | push hl |
||
2845 | sbc hl,de |
||
2846 | call c,LOAD_FILLFILE |
||
2847 | pop hl |
||
2848 | ld a,h |
||
2849 | pop hl |
||
2850 | ret c |
||
2851 | ld a,d |
||
2852 | ret |
||
2853 | |||
2854 | LOAD_FILLFILE xor a |
||
2855 | ld (TRD_5CD6),a ; #FF- |
||
2856 | scf |
||
2857 | ret |
||
2858 | |||
2859 | FORMAT ld hl,0FFFFh |
||
2860 | ld (TRD_5CD7),hl ; - |
||
2861 | ;
|
||
2862 | ld (TRD_5CD9),hl ; <B> <C> |
||
2863 | ld (TRD_5CD1),hl |
||
2864 | call CP_SECOND_SYM ; |
||
2865 | jp z,SINTAX_ERROR |
||
2866 | call SET_AND_PUT |
||
2867 | call EXIT_IF_SINTAX ; , |
||
2868 | call SET_FILENAME ; #5CDD |
||
2869 | call GET_TYPE_DISK ; |
||
2870 | and 80h |
||
2871 | ld a,40 ; 40 |
||
2872 | jr z,loc_1EE8 |
||
2873 | ld a,80 ; 80 |
||
2874 | loc_1EE8 ld (TRD_5CD7),a ; - |
||
2875 | ;
|
||
2876 | call COM_00 ; 93 |
||
2877 | call COM_17 ; 1 |
||
2878 | call PAUSE_3_C_A |
||
2879 | ld e,1 |
||
2880 | call FORMAT_TREK ; |
||
2881 | call COM_16 ; 0 |
||
2882 | ld e,0 |
||
2883 | call FORMAT_TREK ; |
||
2884 | ld a,(TRD_5CDD) ; |
||
2885 | cp "$" |
||
2886 | jr z,loc_1F1B |
||
2887 | call COM_17 ; 1 |
||
2888 | call PAUSE_3_C_A |
||
2889 | call loc_3EB5 |
||
2890 | ld a,h |
||
2891 | cp 1 |
||
2892 | jr nz,loc_1F1B |
||
2893 | ld a,80h |
||
2894 | ld (TRD_5CDA),a |
||
2895 | loc_1F1B call FORMAT_DISK |
||
2896 | ld hl,TRD_5D25 |
||
2897 | ld (hl),0 |
||
2898 | ld de,TRD_5D26 |
||
2899 | ld bc,0FFh |
||
2900 | ldir |
||
2901 | ld bc,TRD_5CD7 ; - |
||
2902 | ;
|
||
2903 | ld de,TRD_5CDA |
||
2904 | ld a,(bc) |
||
2905 | cp 50h |
||
2906 | jr z,loc_1F49 |
||
2907 | ld a,(de) |
||
2908 | cp 80h |
||
2909 | jr z,loc_1F42 ; 80 1 |
||
2910 | ld a,19h ; 40 1 |
||
2911 | ld hl,624 ; |
||
2912 | jr loc_1F55 |
||
2913 | |||
2914 | loc_1F42 ld a,17h ; 80 1 |
||
2915 | loc_1F44 ld hl,1264 ; |
||
2916 | jr loc_1F55 |
||
2917 | |||
2918 | loc_1F49 ld a,(de) |
||
2919 | cp 80h |
||
2920 | ld a,18h ; 40 2 |
||
2921 | jr nz,loc_1F44 ; |
||
2922 | ld a,16h ; 80 2 |
||
2923 | ld hl,2544 ; |
||
2924 | loc_1F55 ld (TRD_5E08),a |
||
2925 | ld (TRD_5E0A),hl |
||
2926 | ld a,1 |
||
2927 | ld (TRD_5E07),a |
||
2928 | ld a,10h |
||
2929 | ld (TRD_5E0C),a |
||
2930 | ld hl,TRD_5E0F |
||
2931 | ld de,TRD_5E10 |
||
2932 | ld bc,8 |
||
2933 | ld (hl)," " |
||
2934 | ldir |
||
2935 | ld hl,TRD_5CDD ; |
||
2936 | ld de,TRD_5E1A |
||
2937 | ld bc,8 |
||
2938 | ldir |
||
2939 | call COM_16 ; 0 |
||
2940 | ld b,1 |
||
2941 | ld de,8 |
||
2942 | ld hl,TRD_5D25 |
||
2943 | call SAVE_SECTORS |
||
2944 | ld a,(TRD_5CD6) ; #FF- |
||
2945 | push af |
||
2946 | xor a |
||
2947 | ld (TRD_5CE5),a ; |
||
2948 | ld hl,(TRD_5E0A) |
||
2949 | ld (TRD_5CD7),hl ; - |
||
2950 | ;
|
||
2951 | ld hl,TRD_5CDD ; |
||
2952 | rst 18h |
||
2953 | ld a,0Dh |
||
2954 | rst 10h |
||
2955 | ld hl,(TRD_5CD7) ; - |
||
2956 | ;
|
||
2957 | pop af |
||
2958 | push hl |
||
2959 | ld d,0 |
||
2960 | ld e,a |
||
2961 | sbc hl,de |
||
2962 | ld b,h |
||
2963 | ld c,l |
||
2964 | call PRINT_CHISLO ; |
||
2965 | ld a,"/" |
||
2966 | rst 10h |
||
2967 | pop bc |
||
2968 | call PRINT_CHISLO ; |
||
2969 | jp END_COMAND |
||
2970 | |||
2971 | TABL_SECTORS db 1,9,2,0Ah,3,0Bh,4,0Ch,5,0Dh,6,0Eh,7,0Fh,8,10h,1 |
||
2972 | |||
665 | savelij | 2973 | CP_DISK_TRACK call GET_TIME_HEAD ; |
623 | savelij | 2974 | or 11h |
2975 | ld b,a |
||
2976 | ld a,32h |
||
2977 | call HEAD_POSITION |
||
2978 | ld a,2 |
||
2979 | call HEAD_POSITION |
||
2980 | call PAUSE725779T |
||
665 | savelij | 2981 | in a,(1Fh) |
623 | savelij | 2982 | and 4 |
2983 | ld a,80 ; 80 |
||
2984 | jr z,loc_1FE7 |
||
2985 | ld a,40 ; 40 |
||
2986 | loc_1FE7 ld (TRD_5CD7),a ; - |
||
2987 | ;
|
||
2988 | ret |
||
2989 | |||
2990 | ; 0 |
||
2991 | COM_16 ld a,(TRD_5D16) ; ( #FF) |
||
2992 | or 3Ch |
||
2993 | SET_REG_FF ld (TRD_5D16),a ; #FF |
||
665 | savelij | 2994 | out (0FFh),a |
623 | savelij | 2995 | ret |
2996 | |||
2997 | ; 1 |
||
2998 | COM_17 ld a,(TRD_5D16) ; ( #FF) |
||
2999 | and 6Fh |
||
3000 | jr SET_REG_FF ; #FF |
||
3001 | |||
3002 | ;
|
||
3003 | FORMAT_TREK di |
||
3004 | ld a,0F4h |
||
665 | savelij | 3005 | out (1Fh),a |
623 | savelij | 3006 | ld hl,TABL_SECTORS |
3007 | ld c,7Fh |
||
3008 | loc_2007 ld b,0Ah |
||
3009 | ld d,4Eh |
||
3010 | call WRITE_C_D_B |
||
3011 | ld b,0Ch |
||
3012 | ld d,0 |
||
3013 | call WRITE_C_D_B |
||
3014 | ld b,3 |
||
3015 | ld d,0F5h |
||
3016 | call WRITE_C_D_B |
||
3017 | ld d,0FEh |
||
3018 | call WRITE_C_D_1 |
||
3019 | ld d,e |
||
3020 | call WRITE_C_D_1 |
||
3021 | ld d,0 |
||
3022 | call WRITE_C_D_1 |
||
3023 | ld d,(hl) |
||
3024 | call WRITE_C_D_1 |
||
3025 | ld d,1 |
||
3026 | call WRITE_C_D_1 |
||
3027 | ld d,0F7h |
||
3028 | call WRITE_C_D_1 |
||
3029 | ld b,16h |
||
3030 | ld d,4Eh |
||
3031 | call WRITE_C_D_B |
||
3032 | ld b,0Ch |
||
3033 | ld d,0 |
||
3034 | call WRITE_C_D_B |
||
3035 | ld b,3 |
||
3036 | ld d,0F5h |
||
3037 | call WRITE_C_D_B |
||
3038 | ld d,0FBh |
||
3039 | call WRITE_C_D_1 |
||
3040 | ld b,0 |
||
3041 | ld d,0 |
||
3042 | call WRITE_C_D_B |
||
3043 | ld d,0F7h |
||
3044 | call WRITE_C_D_1 |
||
3045 | ld b,3Ch |
||
3046 | ld d,4Eh |
||
3047 | call WRITE_C_D_B |
||
3048 | ld a,(hl) |
||
3049 | inc hl |
||
3050 | cp 10h |
||
3051 | jr nz,loc_2007 |
||
3052 | ld b,0 |
||
3053 | call WRITE_C_D_B |
||
3054 | jp m,loc_2076 |
||
3055 | call WRITE_C_D_B |
||
665 | savelij | 3056 | loc_2076 in a,(1Fh) |
623 | savelij | 3057 | and 40h |
3058 | jp nz,loc_3F39 ; Read Only |
||
3059 | CP_NUM_TRACK ld a,(TRD_5CD7+1) ; - |
||
3060 | ;
|
||
3061 | or a |
||
3062 | ret nz |
||
3063 | ld c,7Fh |
||
3064 | ld a,e |
||
665 | savelij | 3065 | out (3Fh),a |
623 | savelij | 3066 | ld hl, TABL_SECTORS+1 |
3067 | loc_208A ld b,3 |
||
3068 | ld a,(hl) |
||
665 | savelij | 3069 | out (5Fh),a |
623 | savelij | 3070 | push hl |
3071 | loc_2090 di |
||
3072 | ld a,80h |
||
665 | savelij | 3073 | out (1Fh),a |
623 | savelij | 3074 | push bc |
3075 | call RD_DATAPORT |
||
665 | savelij | 3076 | in a,(1Fh) |
623 | savelij | 3077 | and 7Fh |
3078 | pop bc |
||
3079 | jr z,loc_20A6 |
||
3080 | djnz loc_2090 |
||
3081 | ld hl,TRD_5CD6 ; #FF- |
||
3082 | inc (hl) |
||
3083 | loc_20A6 pop hl |
||
3084 | ld a,(hl) |
||
3085 | inc hl |
||
3086 | cp 1 |
||
3087 | jr nz,loc_208A |
||
3088 | ei |
||
3089 | ret |
||
3090 | |||
3091 | WRITE_C_D_1 ld b,1 |
||
665 | savelij | 3092 | WRITE_C_D_B in a,(0FFh) |
623 | savelij | 3093 | and 0C0h |
3094 | jr z,WRITE_C_D_B |
||
3095 | ret m |
||
665 | savelij | 3096 | out (c),d |
623 | savelij | 3097 | djnz WRITE_C_D_B |
3098 | ret |
||
3099 | |||
3100 | FORMAT_DISK ld hl,TRD_5CD7 ; - |
||
3101 | ;
|
||
3102 | ld b,(hl) |
||
3103 | xor a |
||
3104 | inc hl |
||
3105 | ld (hl),a |
||
3106 | ld e,0FFh |
||
3107 | loc_20C6 push bc |
||
3108 | inc e |
||
3109 | ld a,e |
||
3110 | LD B,0X18 |
||
3111 | call HEAD_POSITION |
||
3112 | call COM_16 ; 0 |
||
3113 | AND A |
||
3114 | CALL FORMAT_TREK_ |
||
3115 | NOP |
||
3116 | CP 0X80 |
||
3117 | JR NZ,loc_20E1 |
||
3118 | CALL COM_17 |
||
3119 | SCF |
||
3120 | CALL FORMAT_TREK_ |
||
3121 | loc_20E1 pop bc |
||
3122 | djnz loc_20C6 |
||
3123 | ret |
||
3124 | |||
3125 | DELETE_BUF push af |
||
3126 | ld a,(TRD_5CF8) ; 2 |
||
3127 | cp 0FFh |
||
3128 | jr z,loc_211C |
||
3129 | pop af |
||
3130 | JP DEL_BUF ; , |
||
3131 | ;
INTERFACE1 |
||
3132 | CP_INTERFACE1 push af |
||
3133 | ld a,(TRD_5CB6) ; INTERFACE1 |
||
3134 | cp 0F4h |
||
3135 | jr loc_211C |
||
3136 | xor a |
||
3137 | ld hl,TRD_5D18 |
||
3138 | or (hl) |
||
3139 | ld (hl),0FFh |
||
3140 | jr z,loc_211C |
||
3141 | ld a,(TRD_5D0C) |
||
3142 | or a |
||
3143 | ld hl,TRD_5CC3 |
||
3144 | ld de,TRD_5D33 |
||
3145 | jr nz,loc_2111 |
||
3146 | ld de,TRD_5E34 |
||
3147 | loc_2111 ld b,2Dh |
||
3148 | loc_2113 ld c,(hl) |
||
3149 | ld a,(de) |
||
3150 | ld (hl),a |
||
3151 | ld a,c |
||
3152 | ld (de),a |
||
3153 | inc hl |
||
3154 | inc de |
||
3155 | djnz loc_2113 |
||
3156 | loc_211C pop af |
||
3157 | ret |
||
3158 | |||
3159 | CLRBUF_EDITOR CALL CLRBUF_EDITOR_ |
||
3160 | ld (hl),0Dh |
||
3161 | ld (K_CUR),hl |
||
3162 | inc hl |
||
3163 | ld (hl),80h |
||
3164 | ret |
||
3165 | |||
3166 | RESTORE_COMSTR ld de,(E_LINE) ; |
||
3167 | ld hl,TRD_5D20 ; 3 |
||
3168 | call LDI3_HL2DE ; 3 |
||
3169 | ret |
||
3170 | |||
3171 | ;
|
||
3172 | GET_COMMAND ld a,(TRD_5D0F) ; TR-DOS |
||
3173 | or a |
||
3174 | push af |
||
3175 | call nz,RESTORE_COMSTR |
||
3176 | pop af |
||
3177 | call z,CLRBUF_EDITOR |
||
3178 | ld hl,(E_LINE) ; |
||
3179 | call PRINT_0D |
||
3180 | ld a,(TRD_5D19) ; |
||
3181 | add a,"A" |
||
3182 | rst 10h |
||
3183 | ld a,">" |
||
3184 | rst 10h |
||
3185 | ld hl,ERR_NR |
||
3186 | ld (hl),0FFh |
||
3187 | jp CALL2BASEDIT |
||
3188 | |||
3189 | sub_2158 call GET_NEXT_SYM |
||
3190 | call GET_SYMSTR |
||
3191 | cp "," |
||
3192 | jp nz,SINTAX_ERROR |
||
3193 | ld hl,(TRD_5CDB) |
||
3194 | ld (TRD_5CD9),hl ; <B> <C> |
||
3195 | call SET_NUM_CHAN |
||
3196 | call EXIT_IF_SINTAX ; , |
||
3197 | ld hl,(TRD_5CDB) |
||
3198 | ld a,h |
||
3199 | or a |
||
3200 | jp nz,SINTAX_ERROR |
||
3201 | inc hl |
||
3202 | ld (TRD_5CD7),hl ; - |
||
3203 | ;
|
||
3204 | ld hl,(TRD_5CD9) ; <B> <C> |
||
3205 | ld (TRD_5CDB),hl |
||
3206 | ret |
||
3207 | |||
3208 | OPEN ld hl,(TRD_5D11) ; TR_DOS |
||
3209 | ld (CH_ADD),hl |
||
3210 | call SET_NUM_CHAN |
||
3211 | call loc_1DD0 |
||
3212 | loc_218E call GET_SYMSTR |
||
3213 | cp "A" |
||
3214 | jr nc,loc_219A |
||
3215 | call GET_NEXT_SYM |
||
3216 | jr loc_218E |
||
3217 | |||
3218 | loc_219A cp 0A5h |
||
3219 | push af |
||
3220 | call z,sub_2158 |
||
3221 | pop af |
||
3222 | jr z,loc_21AE |
||
3223 | and 0DFh |
||
3224 | cp "R" |
||
3225 | jr z,loc_21AE |
||
3226 | cp "W" |
||
3227 | jp nz,SINTAX_ERROR |
||
3228 | loc_21AE ld (TRD_5D09),a |
||
3229 | call EXIT_IF_SINTAX ; , |
||
3230 | ld a,"#" |
||
3231 | ld (TRD_5CE5),a ; |
||
3232 | ld a,0 |
||
3233 | ld (TRD_5CE6),a ; <C>- , <B>- |
||
3234 | call FIND_ENDFILE |
||
3235 | push af |
||
3236 | call CP_STREAMS |
||
3237 | pop af |
||
3238 | push af |
||
3239 | call nz,CREATE_BLOCK0 |
||
3240 | pop af |
||
3241 | call OPEN_STREAM |
||
3242 | ld hl,(TRD_5D11) ; TR_DOS |
||
3243 | ld bc,124h |
||
3244 | add hl,bc |
||
3245 | ld (TRD_5D11),hl ; TR_DOS |
||
3246 | jp END_COMAND |
||
3247 | |||
3248 | FIND_ENDFILE ld a,0Ah |
||
3249 | ld (TRD_5D06),a ; |
||
3250 | call SET_CP_FILENAME |
||
3251 | push af |
||
3252 | call COM_18 ; |
||
3253 | pop af |
||
3254 | jr nz,loc_2206 |
||
3255 | ld a,(TRD_5D09) |
||
3256 | cp "R" |
||
3257 | jr z,loc_2201 |
||
3258 | loc_21F1 ld hl,TRD_5CE6 ; <C>- , <B>- |
||
3259 | inc (hl) |
||
3260 | call FIND_FILENAME ; |
||
3261 | jr z,loc_21F1 |
||
3262 | ld hl,TRD_5CE6 ; <C>- , <B>- |
||
3263 | dec (hl) |
||
3264 | call FIND_FILENAME ; |
||
3265 | loc_2201 call RDHEAD_FILENAME ; |
||
3266 | xor a |
||
3267 | ret |
||
3268 | |||
3269 | loc_2206 ld a,(TRD_5D09) |
||
3270 | cp "R" |
||
3271 | ret nz |
||
3272 | jp ERR_NOFILES |
||
3273 | |||
3274 | CP_STREAMS ld a,(TRD_5CDB) |
||
3275 | rst 20h |
||
3276 | dw 1727h |
||
3277 | ld a,b |
||
3278 | or c |
||
3279 | jp nz,loc_221B |
||
3280 | ret |
||
3281 | |||
3282 | loc_221B ld a,19h |
||
3283 | ld (ERR_NR),a |
||
3284 | ld hl,TXT_STREAMOPEN ; "Stream opened" |
||
3285 | ld a,0Ah |
||
3286 | loc_2225 jp PRINT_TXTERR |
||
3287 | |||
3288 | loc_2228 ld a,0Bh |
||
3289 | ld hl,TXT_NODISKFILE ; "Not disk file" |
||
3290 | jr loc_2225 |
||
3291 | |||
3292 | INITFREEACCESS push hl |
||
3293 | ld c,20h |
||
3294 | rst 28h |
||
3295 | ld a,(TRD_5CD7) ; - |
||
3296 | ;
|
||
3297 | ld (hl),a |
||
3298 | inc hl |
||
3299 | xor a |
||
3300 | ld (hl),a |
||
3301 | inc hl |
||
3302 | ld (hl),a |
||
3303 | inc hl |
||
3304 | ld (hl),a |
||
3305 | ld a,7Fh |
||
3306 | pop hl |
||
3307 | ret |
||
3308 | |||
3309 | OPEN_STREAM push af |
||
3310 | call CP_STREAMS |
||
3311 | ex de,hl |
||
3312 | ld hl,(PROG) |
||
3313 | ld bc,(CHANS) |
||
3314 | sbc hl,bc |
||
3315 | ex de,hl |
||
3316 | ld (hl),e |
||
3317 | inc hl |
||
3318 | ld (hl),d |
||
3319 | call CREATE_HEADCHAN |
||
3320 | ld a,(TRD_5D09) |
||
3321 | cp 0A5h |
||
3322 | call z,INITFREEACCESS |
||
3323 | jr z,loc_226B |
||
3324 | ld a,(TRD_5D09) |
||
3325 | cp "R" |
||
3326 | ld a,0FFh |
||
3327 | jr nz,loc_226B |
||
3328 | xor a |
||
3329 | loc_226B ld (hl),a |
||
3330 | pop af |
||
3331 | jp loc_2270 |
||
3332 | loc_2270 push af |
||
3333 | ld bc,14h |
||
3334 | add hl,bc |
||
3335 | push hl |
||
3336 | call GET_TEKSECFILE |
||
3337 | pop hl |
||
3338 | inc hl |
||
3339 | ld b,1 |
||
3340 | pop af |
||
3341 | or a |
||
3342 | push af |
||
3343 | call nz,COM_06 ; |
||
3344 | pop af |
||
3345 | call z,COM_05 ; |
||
3346 | ret |
||
3347 | |||
3348 | CREATE_BLOCK0 ld hl,(TRD_5CD7) ; - |
||
3349 | ;
|
||
3350 | push hl |
||
3351 | ld hl,2000h |
||
3352 | ld (TRD_5CD7),hl ; - |
||
3353 | ;
|
||
3354 | call CREATE_BLOCK |
||
3355 | pop hl |
||
3356 | ld (TRD_5CD7),hl ; - |
||
3357 | ;
|
||
3358 | ret |
||
3359 | |||
3360 | CREATE_BLOCK ld hl,1000h |
||
3361 | ld (TRD_5CD9),hl ; <B> <C> |
||
665 | savelij | 3362 | call CP_FREE_ON_DISK ; |
623 | savelij | 3363 | call SAVE_FILE |
3364 | ld hl,0 |
||
3365 | ld (TRD_5CE8),hl ; |
||
3366 | call SETHEADFILENAME |
||
3367 | jp REWRITE_9SEC ; 9 |
||
3368 | |||
3369 | CREATE_HEADCHAN ld hl,(PROG) |
||
3370 | dec hl |
||
3371 | ld (CURCHL),hl |
||
3372 | push hl |
||
3373 | ld bc,124h |
||
3374 | call RESERV_RAM |
||
3375 | ld a,0 |
||
3376 | ld b,0 |
||
3377 | loc_22C4 ld (de),a |
||
3378 | dec de |
||
3379 | djnz loc_22C4 |
||
3380 | pop hl |
||
3381 | push hl |
||
3382 | ld de,loc_3D0E |
||
3383 | ld (hl),e |
||
3384 | inc hl |
||
3385 | ld (hl),d |
||
3386 | inc hl |
||
3387 | ld de,loc_3D06 |
||
3388 | ld (hl),e |
||
3389 | inc hl |
||
3390 | ld (hl),d |
||
3391 | inc hl |
||
3392 | ld (hl),"D" |
||
3393 | inc hl |
||
3394 | inc hl |
||
3395 | inc hl |
||
3396 | inc hl |
||
3397 | inc hl |
||
3398 | ld (hl),"$" |
||
3399 | inc hl |
||
3400 | ld (hl),1 |
||
3401 | inc hl |
||
3402 | ld a,(TRD_5CF6) ; |
||
3403 | ld (hl),a |
||
3404 | inc hl |
||
3405 | ld a,(TRD_5D1E) |
||
3406 | ld (hl),a |
||
3407 | inc hl |
||
3408 | ld a,(TRD_5D09) |
||
3409 | cp "R" |
||
3410 | ld (hl),0 |
||
3411 | jr z,loc_22FC |
||
3412 | ld a,(TRD_5CE8) ; |
||
3413 | ld (hl),a |
||
3414 | loc_22FC inc hl |
||
3415 | ld (hl),b |
||
3416 | jr z,loc_2304 |
||
3417 | ld a,(TRD_5CE8+1) ; |
||
3418 | ld (hl),a |
||
3419 | loc_2304 inc hl |
||
3420 | ex de,hl |
||
3421 | pop hl |
||
3422 | push de |
||
3423 | ld de,10h |
||
3424 | add hl,de |
||
3425 | ex de,hl |
||
3426 | ld hl,TRD_5CDD ; |
||
3427 | ld bc,10h |
||
3428 | ldir |
||
3429 | pop hl |
||
3430 | ret |
||
3431 | |||
3432 | GET_ADRTEKSYM ld c,0Dh |
||
3433 | rst 28h |
||
3434 | ld c,(hl) |
||
3435 | rst 28h |
||
3436 | ld bc,24h |
||
3437 | add hl,bc |
||
3438 | ret |
||
3439 | |||
3440 | GET_ADRTEKFRG ld c,24h |
||
3441 | ADR_OPEN_CHAN ld b,0 |
||
3442 | ld hl,(CURCHL) |
||
3443 | add hl,bc |
||
3444 | ret |
||
3445 | |||
3446 | CP_ENDOFSECTOR ld c,0Dh |
||
3447 | rst 28h |
||
3448 | inc (hl) |
||
3449 | ret nz |
||
3450 | push hl |
||
3451 | call SET_DISK |
||
3452 | call SAVE_1_SECTOR ; |
||
3453 | pop hl |
||
3454 | inc hl |
||
3455 | inc (hl) |
||
3456 | push hl |
||
3457 | call LOAD_1_SECTOR |
||
3458 | pop hl |
||
3459 | ld a,10h |
||
3460 | cp (hl) |
||
3461 | ret nz |
||
3462 | push hl |
||
3463 | ld c,0Fh |
||
3464 | rst 28h |
||
3465 | ld a,(hl) |
||
3466 | cp 7Fh |
||
3467 | pop hl |
||
3468 | jr z,loc_2358 |
||
3469 | ld hl,(CURCHL) |
||
3470 | call SAVE_HEAD_BLK |
||
3471 | ld c,0Eh |
||
3472 | rst 28h |
||
3473 | jp loc_2379 |
||
3474 | |||
3475 | loc_2358 call FIND_NEXT_BLK |
||
3476 | push af |
||
3477 | call z,LOAD_1_SECTOR |
||
3478 | ld c,0Eh |
||
3479 | rst 28h |
||
3480 | pop af |
||
3481 | call nz,CREATE_NEWBLOCK |
||
3482 | ret |
||
3483 | |||
3484 | sub_2367 ld (hl),0 |
||
3485 | ld c,19h |
||
3486 | rst 28h |
||
3487 | ld d,20h |
||
3488 | ld e,(hl) |
||
3489 | ret |
||
3490 | |||
3491 | CREATE_NEWBLOCK call sub_2367 |
||
3492 | ld (TRD_5CD7),de ; - |
||
3493 | ;
|
||
3494 | jr CREATE_BLK |
||
3495 | |||
3496 | loc_2379 call sub_2367 |
||
3497 | inc e |
||
3498 | ld (TRD_5CD7),de ; - |
||
3499 | ;
|
||
3500 | CREATE_BLK call CREATE_BLOCK |
||
3501 | call DEL_BUF ; , |
||
3502 | ld c,10h |
||
3503 | rst 28h |
||
3504 | ex de,hl |
||
3505 | ld hl,TRD_5CDD ; |
||
3506 | ld bc,10h |
||
3507 | ldir |
||
3508 | ld c,0Ch |
||
3509 | rst 28h |
||
3510 | ld a,(TRD_5D1E) |
||
3511 | ld (hl),a |
||
3512 | ret |
||
3513 | |||
3514 | FIND_END_SEC ld c,0Dh |
||
3515 | rst 28h |
||
3516 | inc (hl) |
||
3517 | ret nz |
||
3518 | inc hl |
||
3519 | inc (hl) |
||
3520 | push hl |
||
3521 | call SET_DISK |
||
3522 | ld c,23h |
||
3523 | rst 28h |
||
3524 | ld a,(hl) |
||
3525 | or a |
||
3526 | jr z,loc_23B6 |
||
3527 | pop hl |
||
3528 | push hl |
||
3529 | dec (hl) |
||
3530 | call SAVE_1_SECTOR ; |
||
3531 | pop hl |
||
3532 | push hl |
||
3533 | inc (hl) |
||
3534 | loc_23B6 call LOAD_1_SECTOR |
||
3535 | pop hl |
||
3536 | ld a,10h |
||
3537 | cp (hl) |
||
3538 | call z,OPEN_NEXT_BLK |
||
3539 | ret |
||
3540 | |||
3541 | OPEN_NEXT_BLK call FIND_NEXT_BLK |
||
3542 | push af |
||
3543 | call DEL_BUF ; , |
||
3544 | pop af |
||
3545 | jp nz,ERR_ENDOFFILE |
||
3546 | jp LOAD_1_SECTOR |
||
3547 | |||
3548 | FIND_NEXT_BLK ld (hl),0 |
||
3549 | ld c,19h |
||
3550 | rst 28h |
||
3551 | inc (hl) |
||
3552 | ld c,10h |
||
3553 | rst 28h |
||
3554 | ld de,TRD_5CDD ; |
||
3555 | ld bc,10h |
||
3556 | ldir |
||
3557 | call FIND_FILENAME ; |
||
3558 | ret nz |
||
3559 | OPEN_BLK call RDHEAD_FILENAME ; |
||
3560 | ld c,10h |
||
3561 | rst 28h |
||
3562 | ex de,hl |
||
3563 | ld hl,TRD_5CDD ; |
||
3564 | ld bc,10h |
||
3565 | ldir |
||
3566 | ld c,0Ch |
||
3567 | rst 28h |
||
3568 | ld a,(TRD_5D1E) |
||
3569 | ld (hl),a |
||
3570 | xor a |
||
3571 | ret |
||
3572 | |||
3573 | ;
|
||
3574 | SAVE_1_SECTOR call GET_TEKSECFILE |
||
3575 | call GET_ADRTEKFRG |
||
3576 | ld b,1 |
||
3577 | call COM_06 ; |
||
3578 | ld c,0Fh |
||
3579 | rst 28h |
||
3580 | ld a,(hl) |
||
3581 | cp 7Fh |
||
3582 | ret z |
||
3583 | call GET_ADRTEKFRG |
||
3584 | xor a |
||
3585 | ld b,a |
||
3586 | loc_2413 ld (hl),a |
||
3587 | inc hl |
||
3588 | djnz loc_2413 |
||
3589 | ret |
||
3590 | |||
3591 | LOAD_1_SECTOR call GET_TEKSECFILE |
||
3592 | call GET_ADRTEKFRG |
||
3593 | ld b,1 |
||
3594 | jp COM_05 ; |
||
3595 | |||
3596 | GET_TEKSECFILE ld hl,(CURCHL) |
||
3597 | ld bc,1Eh |
||
3598 | add hl,bc |
||
3599 | ld e,(hl) |
||
3600 | inc hl |
||
3601 | ld d,(hl) |
||
3602 | ld c,0Eh |
||
3603 | rst 28h |
||
3604 | ld b,(hl) |
||
3605 | dec b |
||
3606 | inc b |
||
3607 | push af |
||
3608 | ld a,10h |
||
3609 | jr z,loc_2441 |
||
3610 | loc_2438 inc e |
||
3611 | cp e |
||
3612 | jr nz,loc_243F |
||
3613 | ld e,0 |
||
3614 | inc d |
||
3615 | loc_243F djnz loc_2438 |
||
3616 | loc_2441 pop af |
||
3617 | ret |
||
3618 | |||
3619 | SET_DISK ld c,0Bh |
||
3620 | rst 28h |
||
3621 | ld a,(hl) |
||
3622 | jp COM_01 ; |
||
3623 | |||
3624 | OUT_SYM2FILE ld hl,TRD_5CC2 ; #C9. TR-DOS BASIC |
||
3625 | push hl |
||
3626 | DUPL 4,0 |
||
3627 | push af |
||
3628 | DUPL 3,0 |
||
3629 | ld a,0Ah |
||
3630 | ld (TRD_5D06),a ; |
||
3631 | pop af |
||
3632 | call WORK4FREEACCESS |
||
3633 | push af |
||
3634 | call CP_FILE_OPENED |
||
3635 | jp z,ERR_INVALID_IO |
||
3636 | pop af |
||
3637 | call GET_ADRTEKSYM |
||
3638 | ld (hl),a |
||
3639 | jp CP_ENDOFSECTOR |
||
3640 | |||
3641 | CP_END_BLK ld c,0Dh |
||
3642 | rst 28h |
||
3643 | ld a,(hl) |
||
3644 | ld bc,0Eh |
||
3645 | add hl,bc |
||
3646 | cp (hl) |
||
3647 | ret nz |
||
3648 | ld c,0Eh |
||
3649 | rst 28h |
||
3650 | ld a,(hl) |
||
3651 | ld bc,0Eh |
||
3652 | add hl,bc |
||
3653 | cp (hl) |
||
3654 | ret nz |
||
3655 | ld hl,TRD_5CB6 ; INTERFACE1 |
||
3656 | ld a,(hl) |
||
3657 | cp 0F4h |
||
3658 | jr z,ERR_ENDOFFILE |
||
3659 | bit 4,(hl) |
||
3660 | jr z,ERR_ENDOFFILE |
||
3661 | or 1 |
||
3662 | pop hl |
||
3663 | ret |
||
3664 | |||
3665 | ERR_ENDOFFILE ld a,7 |
||
3666 | loc_2494 ld (ERR_NR),a |
||
3667 | call DELETE_BUF |
||
3668 | rst 20h |
||
3669 | dw 58h |
||
3670 | ret |
||
3671 | |||
3672 | ERR_INVALID_IO ld a,17h |
||
3673 | jr loc_2494 |
||
3674 | |||
3675 | WORK4FREEACCESS ld d,a |
||
3676 | ld c,0Fh |
||
3677 | rst 28h |
||
3678 | ld a,(hl) |
||
3679 | cp 7Fh |
||
3680 | ld a,d |
||
3681 | ret nz |
||
3682 | ld bc,13h |
||
3683 | add hl,bc |
||
3684 | ld a,(hl) |
||
3685 | or a |
||
3686 | ld a,d |
||
3687 | jr nz,loc_24D5 |
||
3688 | dec hl |
||
3689 | ld a,(hl) |
||
3690 | or a |
||
3691 | jr nz,loc_24C2 |
||
3692 | push bc |
||
3693 | push hl |
||
3694 | push de |
||
3695 | call W16B2WORKSP |
||
3696 | pop de |
||
3697 | pop hl |
||
3698 | pop bc |
||
3699 | loc_24C2 ld c,(hl) |
||
3700 | ld a,d |
||
3701 | ex de,hl |
||
3702 | ld hl,(TRD_5CCF) ; WORK_SP |
||
3703 | add hl,bc |
||
3704 | cp 6 |
||
3705 | ld (hl),a |
||
3706 | call z,WORK_NUMSAVE |
||
3707 | ld c,21h |
||
3708 | rst 28h |
||
3709 | inc (hl) |
||
3710 | pop hl |
||
3711 | ret |
||
3712 | |||
3713 | loc_24D5 dec hl |
||
3714 | ld a,(hl) |
||
3715 | dec hl |
||
3716 | inc a |
||
3717 | cp (hl) |
||
3718 | inc hl |
||
3719 | inc (hl) |
||
3720 | push hl |
||
3721 | push af |
||
3722 | ld c,23h |
||
3723 | rst 28h |
||
3724 | ld (hl),0FFh |
||
3725 | pop af |
||
3726 | pop hl |
||
3727 | jr c,loc_24EE |
||
3728 | ld a,d |
||
3729 | cp 0Dh |
||
3730 | jr z,loc_24F2 |
||
3731 | pop bc |
||
3732 | ret |
||
3733 | |||
3734 | loc_24EE ld a,d |
||
3735 | cp 0Dh |
||
3736 | ret nz |
||
3737 | loc_24F2 xor a |
||
3738 | ld (hl),a |
||
3739 | inc hl |
||
3740 | ld (hl),a |
||
3741 | ld a,d |
||
3742 | ret |
||
3743 | |||
3744 | W16B2WORKSP ld hl,(WORKSP) |
||
3745 | ld (TRD_5CCF),hl ; WORK_SP |
||
3746 | ld bc,10h |
||
3747 | jp CREATE_FREERAM |
||
3748 | |||
3749 | WORK_NUMSAVE ld (hl),0Dh |
||
3750 | ld hl,(CH_ADD) |
||
3751 | ld (TRD_5CD7),hl ; - |
||
3752 | ;
|
||
3753 | ld hl,(TRD_5CCF) ; WORK_SP |
||
3754 | ld (CH_ADD),hl |
||
3755 | ld hl,FLAGS |
||
3756 | res 7,(hl) |
||
3757 | call BC2STKBOT |
||
3758 | ld hl,FLAGS |
||
3759 | set 7,(hl) |
||
3760 | ld hl,(TRD_5CCF) ; WORK_SP |
||
3761 | ld (CH_ADD),hl |
||
3762 | call BC2STKBOT |
||
3763 | call FIND_LAST |
||
3764 | push bc |
||
3765 | pop de |
||
3766 | ld c,20h |
||
3767 | rst 28h |
||
3768 | ld b,(hl) |
||
3769 | xor a |
||
3770 | ld hl,0 |
||
3771 | ld (TRD_5CDB),hl |
||
3772 | loc_2538 add hl,de |
||
3773 | jr nc,loc_2544 |
||
3774 | push hl |
||
3775 | ld hl,(TRD_5CDB) |
||
3776 | inc hl |
||
3777 | ld (TRD_5CDB),hl |
||
3778 | pop hl |
||
3779 | loc_2544 djnz loc_2538 |
||
3780 | ld (TRD_5CD9),hl ; <B> <C> |
||
3781 | ld a,(TRD_5CDB) |
||
3782 | ld hl,TRD_5CDA |
||
3783 | rrd |
||
3784 | and 0Fh |
||
3785 | ld (TRD_5CDB),a |
||
3786 | ld hl,(TRD_5CD7) ; - |
||
3787 | ;
|
||
3788 | ld (CH_ADD),hl |
||
3789 | call OPEN_SAVED |
||
3790 | ld c,21h |
||
3791 | rst 28h |
||
3792 | ld a,0FFh |
||
3793 | ld (hl),a |
||
3794 | inc hl |
||
3795 | ld (hl),a |
||
3796 | ret |
||
3797 | |||
3798 | OPEN_SAVED ld c,19h |
||
3799 | rst 28h |
||
3800 | ld a,(TRD_5CDA) |
||
3801 | cp (hl) |
||
3802 | jp nz,loc_2584 |
||
3803 | ld c,0Eh |
||
3804 | rst 28h |
||
3805 | ld a,(TRD_5CDB) |
||
3806 | cp (hl) |
||
3807 | jp nz,loc_25A7 |
||
3808 | loc_257C ld c,0Dh |
||
3809 | rst 28h |
||
3810 | ld a,(TRD_5CD9) ; <B> <C> |
||
3811 | ld (hl),a |
||
3812 | ret |
||
3813 | |||
3814 | loc_2584 call CPANDZERO23 |
||
3815 | call nz,SAVE_TEK_SEC |
||
3816 | ld a,(TRD_5CDA) |
||
3817 | ld c,19h |
||
3818 | rst 28h |
||
3819 | ld (hl),a |
||
3820 | ld c,10h |
||
3821 | rst 28h |
||
3822 | ld de,TRD_5CDD ; |
||
3823 | ld bc,10h |
||
3824 | ldir |
||
3825 | call FIND_FILENAME ; |
||
3826 | jp nz,loc_25D2 |
||
3827 | call OPEN_BLK |
||
3828 | jr loc_25AD |
||
3829 | |||
3830 | loc_25A7 call CPANDZERO23 |
||
3831 | call nz,SAVE_TEK_SEC |
||
3832 | loc_25AD ld a,(TRD_5CDB) |
||
3833 | ld c,0Eh |
||
3834 | rst 28h |
||
3835 | ld (hl),a |
||
3836 | push hl |
||
3837 | call SET_DISK |
||
3838 | call LOAD_1_SECTOR |
||
3839 | pop hl |
||
3840 | dec hl |
||
3841 | ld a,(TRD_5CD9) ; <B> <C> |
||
3842 | ld (hl),a |
||
3843 | jr loc_257C |
||
3844 | |||
3845 | SAVE_TEK_SEC call SET_DISK |
||
3846 | call SAVE_1_SECTOR ; |
||
3847 | ret |
||
3848 | |||
3849 | CPANDZERO23 ld c,23h |
||
3850 | rst 28h |
||
3851 | ld a,(hl) |
||
3852 | or a |
||
3853 | ld (hl),0 |
||
3854 | ret |
||
3855 | |||
3856 | loc_25D2 ld hl,(TRD_5CDA) |
||
3857 | ld h,20h |
||
3858 | ld (TRD_5CD7),hl ; - |
||
3859 | ;
|
||
3860 | ld hl,(TRD_5CD9) ; <B> <C> |
||
3861 | push hl |
||
3862 | ld hl,(TRD_5CDB) |
||
3863 | push hl |
||
3864 | call CREATE_BLK |
||
3865 | pop hl |
||
3866 | ld (TRD_5CDB),hl |
||
3867 | pop hl |
||
3868 | ld (TRD_5CD9),hl ; <B> <C> |
||
3869 | jr loc_25AD |
||
3870 | |||
3871 | INPUTDATAFILE DUPL 3,0 |
||
3872 | ld hl,TV_FLAG |
||
3873 | res 3,(hl) |
||
3874 | ld hl,(ERR_SP) |
||
3875 | ld e,(hl) |
||
3876 | inc hl |
||
3877 | ld d,(hl) |
||
3878 | or a |
||
3879 | ld hl,107Fh |
||
3880 | sbc hl,de |
||
3881 | jr nz,loc_2626 |
||
3882 | ld sp,(ERR_SP) |
||
3883 | pop de |
||
3884 | pop de |
||
3885 | ld (ERR_SP),de |
||
3886 | loc_260F call INPUT_SYM_FILE |
||
3887 | jr c,loc_261D |
||
3888 | loc_2614 ld hl,TRD_5CC2 ; #C9. TR-DOS BASIC |
||
3889 | push hl |
||
3890 | ld hl,DELETE_BUF |
||
3891 | push hl |
||
3892 | ret |
||
3893 | |||
3894 | loc_261D cp 0Dh |
||
3895 | jr z,loc_2614 |
||
3896 | rst 20h |
||
3897 | dw 0F85h |
||
3898 | jr loc_260F |
||
3899 | |||
3900 | loc_2626 call INPUT_SYM_FILE |
||
3901 | jr loc_2614 |
||
3902 | |||
3903 | INPUT_SYM_FILE ld a,0Ah |
||
3904 | ld (TRD_5D06),a ; |
||
3905 | call CP_FILE_OPENED |
||
3906 | jr z,loc_2642 |
||
3907 | cp 7Fh |
||
3908 | jp nz,ERR_INVALID_IO |
||
3909 | ld bc,13h |
||
3910 | add hl,bc |
||
3911 | ld (hl),0 |
||
3912 | jr loc_2645 |
||
3913 | |||
3914 | loc_2642 call CP_END_BLK |
||
3915 | loc_2645 call GET_ADRTEKSYM |
||
3916 | ld a,(hl) |
||
3917 | push af |
||
3918 | call FIND_END_SEC |
||
3919 | pop af |
||
3920 | scf |
||
3921 | ret |
||
3922 | |||
3923 | CP_FILE_OPENED ld c,0Fh |
||
3924 | rst 28h |
||
3925 | ld a,(hl) |
||
3926 | or a |
||
3927 | ret |
||
3928 | |||
3929 | CLOSE ld hl,(TRD_5D11) ; TR_DOS |
||
3930 | ld (CH_ADD),hl |
||
3931 | call SET_NUM_CHAN |
||
3932 | call EXIT_IF_SINTAX ; , |
||
3933 | ld a,(TRD_5CDB) |
||
3934 | rst 20h |
||
3935 | dw 1727h |
||
3936 | ld a,b |
||
3937 | or c |
||
3938 | jp z,END_COMAND |
||
3939 | push hl |
||
3940 | ld hl,(CHANS) |
||
3941 | add hl,bc |
||
3942 | ld a,(hl) |
||
3943 | ld hl,loc_3D0E |
||
3944 | cp h |
||
3945 | pop hl |
||
3946 | jp nz,loc_2228 |
||
3947 | ld (hl),0 |
||
3948 | inc hl |
||
3949 | ld (hl),0 |
||
3950 | ld (TRD_5CD9),bc ; <B> <C> |
||
3951 | ld hl,(CHANS) |
||
3952 | add hl,bc |
||
3953 | dec hl |
||
3954 | ld (TRD_5CD7),hl ; - |
||
3955 | ;
|
||
3956 | call sub_26CE |
||
3957 | ld hl,(TRD_5CD7) ; - |
||
3958 | ;
|
||
3959 | ld bc,124h |
||
3960 | call DEL_WORKRAM |
||
3961 | ld hl,STRMS |
||
3962 | ld b,10h |
||
3963 | loc_269D push bc |
||
3964 | ld bc,(TRD_5CD9) ; <B> <C> |
||
3965 | ld e,(hl) |
||
3966 | inc hl |
||
3967 | ld d,(hl) |
||
3968 | ex de,hl |
||
3969 | sbc hl,bc |
||
3970 | ex de,hl |
||
3971 | jr c,loc_26BC |
||
3972 | ld d,(hl) |
||
3973 | dec hl |
||
3974 | ld e,(hl) |
||
3975 | inc hl |
||
3976 | push hl |
||
3977 | ex de,hl |
||
3978 | ld bc,124h |
||
3979 | sbc hl,bc |
||
3980 | ex de,hl |
||
3981 | pop hl |
||
3982 | ld (hl),d |
||
3983 | dec hl |
||
3984 | ld (hl),e |
||
3985 | inc hl |
||
3986 | loc_26BC inc hl |
||
3987 | pop bc |
||
3988 | djnz loc_269D |
||
3989 | ld hl,(TRD_5D11) ; TR_DOS |
||
3990 | ld bc,124h |
||
3991 | sbc hl,bc |
||
3992 | ld (TRD_5D11),hl ; TR_DOS |
||
3993 | jp END_COMAND |
||
3994 | |||
3995 | sub_26CE ld bc,0Fh |
||
3996 | add hl,bc |
||
3997 | ld a,(hl) |
||
3998 | or a |
||
3999 | ret z |
||
4000 | ld hl,(TRD_5CD7) ; - |
||
4001 | ;
|
||
4002 | ld (CURCHL),hl |
||
4003 | call SAVE_HEAD_BLK |
||
4004 | jp SAVE_1_SECTOR ; |
||
4005 | |||
4006 | SAVE_HEAD_BLK ld bc,0Dh |
||
4007 | add hl,bc |
||
4008 | ld e,(hl) |
||
4009 | inc hl |
||
4010 | ld d,(hl) |
||
4011 | ld bc,0Dh |
||
4012 | add hl,bc |
||
4013 | ld (hl),e |
||
4014 | inc hl |
||
4015 | ld (hl),d |
||
4016 | ld c,10h |
||
4017 | rst 28h |
||
4018 | ld de,TRD_5CDD ; |
||
4019 | ld bc,10h |
||
4020 | ldir |
||
4021 | call SET_DISK |
||
4022 | ld c,0Ch |
||
4023 | rst 28h |
||
4024 | ld c,(hl) |
||
4025 | call SETHEADFILENAME |
||
4026 | jp REWRITE_9SEC ; 9 |
||
4027 | |||
4028 | ;
|
||
4029 | PRINT_MSG ld a,(hl) |
||
4030 | or a |
||
4031 | ret z |
||
4032 | and 7Fh |
||
4033 | rst 10h |
||
4034 | bit 7,(hl) |
||
4035 | ret nz |
||
4036 | inc hl |
||
4037 | jr PRINT_MSG ; |
||
4038 | |||
4039 | COMPARE_B_SYM ld a,(de) |
||
4040 | cp (hl) |
||
4041 | ret nz |
||
4042 | inc de |
||
4043 | inc hl |
||
4044 | djnz COMPARE_B_SYM |
||
4045 | ret |
||
4046 | |||
4047 | loc_271B ld hl,TXT_NODISK_ ; "No disk" |
||
4048 | ld a,6 |
||
4049 | jp PRINT_TXTERR |
||
4050 | |||
4051 | ERR_DIRFULL ld hl,TXT_DIRFULL ; "Directory full" |
||
4052 | ld a,4 |
||
4053 | jp PRINT_TXTERR |
||
4054 | |||
4055 | SET_TAPELDERR ld a,1Ah |
||
4056 | jr SET_NUM_ERR |
||
4057 | |||
4058 | ld a,12h |
||
4059 | SET_NUM_ERR ld (ERR_NR),a |
||
4060 | ret |
||
4061 | |||
4062 | ld a,3 |
||
4063 | jr SET_NUM_ERR |
||
4064 | |||
4065 | COM_15 xor a ; |
||
4066 | ld (TRD_5CD7+1),a ; - |
||
4067 | ;
|
||
4068 | ld (TRD_5CD6),a ; #FF- |
||
665 | savelij | 4069 | in a,(1Fh) |
623 | savelij | 4070 | ld (TRD_5CCD),a ; #80- |
4071 | ld e,d |
||
4072 | push de |
||
4073 | ld a,e |
||
665 | savelij | 4074 | out (7Fh),a |
623 | savelij | 4075 | LD A,0X18 |
4076 | call COM2VG_WAIT |
||
4077 | ld a,(TRD_5CCD) ; #80- |
||
4078 | and 80h |
||
4079 | call nz,PAUSE_3_C_A |
||
4080 | pop de |
||
4081 | call CP_NUM_TRACK |
||
4082 | ld a,(TRD_5CD6) ; #FF- |
||
4083 | or a |
||
4084 | ret z |
||
4085 | ld a,7 |
||
4086 | ld (TRD_5D0F),a ; TR-DOS |
||
4087 | ret |
||
4088 | |||
4089 | TXT_OK_ db "O.K.",0 |
||
4090 | TXT_VERIFYERR db "Verify Error.",8Dh |
||
4091 | TXT_BACKUPDISK db "BACKUP DISK",8Dh |
||
4092 | TXT_INS_DEST db "Insert Destination disk",0Dh,"then press Y",0 |
||
4093 | TXT_INS_SRC db "Insert Source disk then press Y",0 |
||
4094 | TXT_BREAK db "*BREAK*",8Dh |
||
4095 | TXT_OUTRAM db "Out of RAM",8Dh |
||
4096 | TXT_ARRAYNOT db "Array not found",8Dh |
||
4097 | TXT_DIRFULL db "Directory full",8Dh |
||
4098 | TXT_NODISK_ db "No disk",8Dh |
||
4099 | TXT_STREAMOPEN db "Stream opened",8Dh |
||
4100 | TXT_NODISKFILE db "Not disk file",8Dh |
||
665 | savelij | 4101 | TXT_FILEEXIST DB "File exists",0Dh |
4102 | DC "Over write?(Y/N)" |
||
623 | savelij | 4103 | |
4104 | CALL_3D13 push af |
||
4105 | push bc |
||
4106 | ld (TRD_5D04),de |
||
4107 | ld (TRD_5D02),hl |
||
4108 | DUPL 3,0 |
||
4109 | ld a,0FFh |
||
4110 | ld (TRD_5D15),a ; 0, TR-DOS. |
||
4111 | ld (TRD_5D1F),a |
||
4112 | pop bc |
||
4113 | pop af |
||
4114 | ld hl,CP_ERROR ; คเฅแ ง ขฅเ่ฅญจ๏ จญโฅเฏเฅโ โฎเ |
||
4115 | ld (TRD_5D1A),hl ; |
||
4116 | ld hl,0 |
||
4117 | add hl,sp |
||
4118 | ld (TRD_5D1C),hl ; แฎๅเ ญฅญจฅ โฅชใ้ฅฃฎ แโฅช |
||
4119 | dec hl |
||
4120 | dec hl |
||
4121 | ld sp,hl |
||
4122 | push af |
||
4123 | call MARK_SP ; |
||
4124 | ld hl,COMAND_TBL |
||
4125 | LD A,C |
||
4126 | CP LOW ((ECOMAND_TBL-COMAND_TBL)/2)+1 |
||
4127 | JP NC,END_COMAND |
||
4128 | ADD A,A |
||
4129 | LD E,A |
||
4130 | POP AF |
||
4131 | LD D,0 |
||
4132 | ADD HL,DE |
||
4133 | LD E,(HL) |
||
4134 | INC HL |
||
4135 | LD D,(HL) |
||
4136 | LD HL,END_COMAND |
||
4137 | PUSH HL |
||
4138 | PUSH DE |
||
4139 | LD HL,(TRD_5D02) |
||
4140 | LD DE,(TRD_5D04) |
||
4141 | RET |
||
4142 | |||
4143 | COMAND_TBL DW COM_00 ; 93 |
||
4144 | DW COM_01 ; |
||
4145 | DW COM_02 ; |
||
4146 | DW COM_03 ; |
||
4147 | DW COM_04 ; |
||
4148 | DW COM_05 ; |
||
4149 | DW COM_06 ; |
||
4150 | DW COM_07 ; |
||
4151 | DW COM_08 ; 0X5CDD |
||
4152 | DW COM_09 ; |
||
4153 | DW COM_0A ; |
||
4154 | DW COM_0B ; |
||
4155 | DW COM_0C ; |
||
4156 | DW END_COMAND |
||
4157 | DW COM_0E ; |
||
4158 | DW END_COMAND |
||
4159 | DW END_COMAND |
||
4160 | DW END_COMAND |
||
4161 | DW COM_12 ; |
||
4162 | DW COM_13 ; 0X5CDD |
||
4163 | DW COM_14 ; 0X5CDD |
||
4164 | DW COM_15 ; |
||
4165 | DW COM_16 ; 0 |
||
4166 | DW COM_17 ; 1 |
||
4167 | DW COM_18 ; |
||
4168 | ECOMAND_TBL |
||
4169 | |||
4170 | DUPL 0X28D8-$,0XFF |
||
4171 | COM_07 push af ; |
||
4172 | call COM_18 ; |
||
4173 | pop af |
||
4174 | jp loc_479 |
||
4175 | |||
4176 | COM_13 xor a ; #5CDD |
||
4177 | jr loc_28E5 |
||
4178 | |||
4179 | COM_14 ld a,0FFh ; #5CDD |
||
4180 | loc_28E5 ld de,TRD_5CDD ; |
||
4181 | ld bc,10h |
||
4182 | or a |
||
4183 | jr z,loc_28EF ; FIX |
||
4184 | ex de,hl |
||
4185 | loc_28EF ldir ; FIX |
||
4186 | ret |
||
4187 | |||
4188 | COM_0C call COM_18 ; |
||
665 | savelij | 4189 | call CP_FREE_ON_DISK ; |
623 | savelij | 4190 | jp loc_1B27 |
4191 | |||
4192 | COM_0B ld (TRD_5CD7),hl ; |
||
4193 | ld (TRD_5CD9),de ; <B> <C> |
||
4194 | ld (TRD_5CDB),de |
||
4195 | call COM_18 ; |
||
665 | savelij | 4196 | call CP_FREE_ON_DISK ; |
623 | savelij | 4197 | jp loc_1B53 |
4198 | |||
4199 | COM_0E or a ; |
||
4200 | ld (TRD_5CD6),a ; #FF- |
||
4201 | ld (TRD_5CD9),hl ; <B> <C> |
||
4202 | ld (TRD_5CDB),de |
||
4203 | call FIND_FILENAME ; |
||
4204 | call FIND_RD_HEAD |
||
4205 | call CP_PARAMS ; |
||
4206 | jp RD_FILE |
||
4207 | |||
4208 | COM_12 call COM_18 ; |
||
4209 | call FIND_FILENAME ; |
||
4210 | jp ERASE_FILES ; |
||
4211 | |||
4212 | ;
|
||
4213 | FIND_FILE call SET_FILENAME ; #5CDD |
||
4214 | call COM_18 ; |
||
4215 | jp FIND_FILENAME ; |
||
4216 | |||
4217 | ;
|
||
4218 | PRINT_FILENAME push bc |
||
4219 | ld b,8 |
||
4220 | loc_293B ld a,(hl) |
||
4221 | rst 10h |
||
4222 | inc hl |
||
4223 | djnz loc_293B |
||
4224 | ld a,"<" |
||
4225 | rst 10h |
||
4226 | ld a,(hl) |
||
4227 | rst 10h |
||
4228 | ld a,">" |
||
4229 | rst 10h |
||
4230 | pop bc |
||
4231 | ret |
||
4232 | |||
4233 | ;
|
||
4234 | CREATE_BUF push hl |
||
4235 | push de |
||
4236 | push bc |
||
4237 | push af |
||
4238 | ld hl,TRD_5D0C |
||
4239 | ld a,(hl) |
||
4240 | or a |
||
4241 | jr z,loc_2992 |
||
4242 | push hl |
||
4243 | ld bc,257 ; |
||
4244 | push bc |
||
4245 | call CP_FREE_RAM |
||
4246 | pop bc |
||
4247 | pop hl |
||
4248 | ld (hl),0 |
||
4249 | ld hl,TRD_5D25 |
||
4250 | call RESERV_RAM |
||
4251 | ld hl,(TRD_5D11) ; TR_DOS |
||
4252 | ld bc,257 ; |
||
4253 | add hl,bc |
||
4254 | jr loc_298F |
||
4255 | |||
4256 | ;
,
|
||
4257 | DEL_BUF push hl |
||
4258 | push de |
||
4259 | push bc |
||
4260 | push af |
||
4261 | ld hl,TRD_5D0C |
||
4262 | ld a,(hl) |
||
4263 | or a |
||
4264 | jr nz,loc_2992 |
||
4265 | ld (hl),0FFh |
||
4266 | ld hl,TRD_5D25 |
||
4267 | ld bc,257 ; |
||
4268 | call DEL_WORKRAM |
||
4269 | or a |
||
4270 | ld bc,257 ; |
||
4271 | ld hl,(TRD_5D11) ; TR_DOS |
||
4272 | sbc hl,bc |
||
4273 | loc_298F ld (TRD_5D11),hl ; TR_DOS |
||
4274 | loc_2992 pop af |
||
4275 | pop bc |
||
4276 | pop de |
||
4277 | pop hl |
||
4278 | ret |
||
4279 | |||
4280 | COM_40 xor a |
||
4281 | loc_2998 ld (TRD_5CD7),a ; - |
||
4282 | ;
|
||
4283 | call EXIT_IF_SINTAX ; , |
||
4284 | call CP_SECOND_SYM ; |
||
4285 | jp z,SINTAX_ERROR |
||
4286 | call GET_TYPE_DISK ; |
||
4287 | ld a,(TRD_5CD7) ; - |
||
4288 | ;
|
||
4289 | ld (hl),a |
||
4290 | jp ERR_OK |
||
4291 | |||
4292 | COM_80 ld a,80h |
||
4293 | jr loc_2998 |
||
4294 | |||
4295 | TXT_ERROR_ db 0Dh,"*ERROR*",8Dh |
||
4296 | TXT_NOSPACE_ db 0Dh,"No space",8Dh |
||
4297 | TXT_FILEEXISTS_ db 0Dh,"File exists",8Dh |
||
4298 | TXT_FREE_ db " Free",8Dh |
||
665 | savelij | 4299 | READ_ONLY db 0Dh |
4300 | DC "Read Only" |
||
4301 | TXT_DISCERROR_ db 0Dh |
||
4302 | DC "Disc Error" |
||
4303 | TXT_R_O db 0Dh |
||
4304 | DC "Rec. O/F" |
||
4305 | TXT_TITLE_ DC "Title: " |
||
623 | savelij | 4306 | TXT_RIA_ db 0Dh,"Retry,Abort,Ignore?",0 |
665 | savelij | 4307 | TXT_TRK_ db 0Dh |
4308 | DC "Trk " |
||
4309 | TXT_SEC_ DC " sec " |
||
623 | savelij | 4310 | TXT_DELFILE_ db " Del. File",8Dh |
4311 | TXT_NOFILES_ db 0Dh |
||
4312 | TXT_NOFILES db "No" |
||
4313 | TXT_FILES_ db " File(s)",8Dh,0 |
||
4314 | |||
4315 | sub_2A35 ld hl,loc_2A41 |
||
4316 | ld de,4080h |
||
4317 | ld bc,20h |
||
4318 | ldir ; FIX |
||
4319 | ret |
||
4320 | |||
4321 | loc_2A41 ld a,(loc_3B5) |
||
4322 | cp 0F3h |
||
4323 | ld a,10h |
||
4324 | jr z,loc_2A4B |
||
4325 | xor a |
||
4326 | loc_2A4B ld (KSTATE1),a |
||
4327 | ld bc,7FFDh |
||
4328 | ld a,10h |
||
665 | savelij | 4329 | out (c),a |
623 | savelij | 4330 | ret |
4331 | |||
4332 | MAGIC push af |
||
4333 | push bc |
||
4334 | push de |
||
4335 | push hl |
||
4336 | push ix |
||
4337 | push iy |
||
4338 | exx |
||
4339 | push bc |
||
4340 | push de |
||
4341 | push hl |
||
4342 | ex af,af' |
||
4343 | push af |
||
4344 | ld a,i |
||
4345 | push af |
||
4346 | ld a,r |
||
4347 | push af |
||
4348 | ld hl,0 |
||
4349 | add hl,sp |
||
4350 | push hl |
||
4351 | ld a,3Ch |
||
665 | savelij | 4352 | out (0FFh),a |
623 | savelij | 4353 | ld a,3Fh |
4354 | ld i,a |
||
665 | savelij | 4355 | in a,(1Fh) |
623 | savelij | 4356 | and 80h |
4357 | rrca |
||
4358 | rrca |
||
4359 | rrca |
||
4360 | ld (KSTATE1),a |
||
4361 | call sub_2F65 |
||
4362 | call PAUSE_3_C_A |
||
4363 | call PAUSE_3_C_A |
||
4364 | ld de,0Ah |
||
4365 | ld hl,4000h |
||
4366 | push hl |
||
4367 | call sub_2D73 |
||
4368 | ld hl,4100h |
||
4369 | ld de,0Bh |
||
4370 | call sub_2D73 |
||
4371 | pop hl |
||
4372 | push hl |
||
4373 | ld de,8 |
||
4374 | call sub_2F1B |
||
4375 | ld hl,40E3h |
||
4376 | ld a,(hl) |
||
4377 | ld (KSTATE0),a |
||
4378 | inc hl |
||
4379 | ld a,(hl) |
||
4380 | inc (hl) |
||
4381 | inc hl |
||
4382 | ld e,(hl) |
||
4383 | inc hl |
||
4384 | ld d,(hl) |
||
4385 | or a |
||
4386 | ex de,hl |
||
4387 | ld de,0C0h |
||
4388 | sbc hl,de |
||
4389 | ld (40E5h),hl |
||
4390 | ld hl,4000h |
||
4391 | ld de,8 |
||
4392 | call sub_2D73 |
||
4393 | pop hl |
||
4394 | ld de,(40E1h) |
||
4395 | push de |
||
4396 | ld de,0Ah |
||
4397 | call sub_2F1B |
||
4398 | pop de |
||
4399 | call sub_2D4C |
||
4400 | push de |
||
4401 | ld a,3Ch |
||
665 | savelij | 4402 | out (0FFh),a |
623 | savelij | 4403 | call sub_2F65 |
4404 | ld hl,4000h |
||
4405 | ld de,8 |
||
4406 | ld b,1 |
||
4407 | call sub_2F1B |
||
4408 | pop de |
||
4409 | ld hl,(40E1h) |
||
4410 | ld (40E1h),de |
||
4411 | push hl |
||
4412 | ld hl,4000h |
||
4413 | ld de,8 |
||
4414 | ld b,1 |
||
4415 | call sub_2D73 |
||
4416 | ld a,(40E4h) |
||
4417 | dec a |
||
4418 | call sub_2CE5 |
||
4419 | ld (hl),"@" |
||
4420 | inc hl |
||
4421 | ld b,7 |
||
4422 | loc_2B09 ld (hl)," " |
||
4423 | inc hl |
||
4424 | djnz loc_2B09 |
||
4425 | ld (hl),"C" |
||
4426 | pop de |
||
4427 | pop bc |
||
4428 | inc hl |
||
4429 | ld (hl),c |
||
4430 | inc hl |
||
4431 | ld (hl),b |
||
4432 | inc hl |
||
4433 | inc hl |
||
4434 | inc hl |
||
4435 | ld (hl),0C0h |
||
4436 | inc hl |
||
4437 | ld (hl),e |
||
4438 | inc hl |
||
4439 | ld (hl),d |
||
4440 | ld hl,4000h |
||
4441 | ld de,0 |
||
665 | savelij | 4442 | in a,(5Fh) |
623 | savelij | 4443 | dec a |
4444 | ld e,a |
||
4445 | ld b,1 |
||
4446 | call sub_2D73 |
||
4447 | ld hl,0 |
||
4448 | add hl,sp |
||
4449 | ld (4140h),hl |
||
4450 | ld sp,41FFh |
||
4451 | call sub_2A35 |
||
4452 | ld hl,0C000h |
||
4453 | xor a |
||
4454 | loc_2B3F add a,(hl) |
||
4455 | inc hl |
||
4456 | ld b,a |
||
4457 | ld a,h |
||
4458 | or a |
||
4459 | ld a,b |
||
4460 | jr nz,loc_2B3F |
||
4461 | ld hl,4100h |
||
4462 | ld (hl),a |
||
4463 | push hl |
||
4464 | ld hl,loc_2B58 |
||
4465 | push hl |
||
4466 | ld hl,loc_3D2F |
||
4467 | push hl |
||
4468 | di |
||
4469 | jp 4080h |
||
4470 | |||
4471 | loc_2B58 pop hl |
||
4472 | ld bc,7FFDh |
||
4473 | ld a,0AAh |
||
4474 | ld (4130h),a |
||
4475 | ld d,5 |
||
4476 | ld a,(KSTATE1) |
||
4477 | or d |
||
4478 | ld d,a |
||
665 | savelij | 4479 | out (c),d |
623 | savelij | 4480 | ld a,(0C130h) |
4481 | cp 0AAh |
||
4482 | jp nz,loc_2C1B |
||
4483 | ld a,d |
||
4484 | and 0F8h |
||
4485 | ld d,a |
||
4486 | inc hl |
||
4487 | ld b,8 |
||
4488 | loc_2B79 ld (hl),d |
||
665 | savelij | 4489 | out (c),d |
623 | savelij | 4490 | xor a |
4491 | ld hl,0C000h |
||
4492 | loc_2B80 add a,(hl) |
||
4493 | inc hl |
||
4494 | ld e,a |
||
4495 | ld a,h |
||
4496 | or a |
||
4497 | ld a,e |
||
4498 | jr nz,loc_2B80 |
||
4499 | ld hl,4100h |
||
4500 | cp (hl) |
||
4501 | inc hl |
||
4502 | jr z,loc_2B93 |
||
4503 | inc d |
||
4504 | djnz loc_2B79 |
||
4505 | dec d |
||
4506 | loc_2B93 ld b,8 |
||
4507 | loc_2B95 push bc |
||
4508 | call sub_2C37 |
||
4509 | pop bc |
||
4510 | djnz loc_2B95 |
||
4511 | ld c,0 |
||
4512 | call sub_2F3A |
||
4513 | call sub_2D2A |
||
4514 | ld a,(40E4h) |
||
4515 | ld (4102h),a |
||
4516 | inc a |
||
4517 | ld (40E4h),a |
||
4518 | ld hl,(40E5h) |
||
4519 | ld de,1 |
||
4520 | sbc hl,de |
||
4521 | ld (40E5h),hl |
||
4522 | ret c |
||
4523 | ld hl,(40E1h) |
||
4524 | ld (411Eh),hl |
||
4525 | call sub_2D1E |
||
4526 | ld a,38h |
||
4527 | ld (4111h),a |
||
4528 | ld a,1 |
||
4529 | ld (411Dh),a |
||
4530 | ld hl,4100h |
||
4531 | ld (4119h),hl |
||
4532 | ld hl,100h |
||
4533 | ld (411Bh),hl |
||
4534 | ld de,(40E1h) |
||
4535 | call sub_2F65 |
||
4536 | ld c,d |
||
4537 | call sub_2F3A |
||
4538 | ld hl,4100h |
||
4539 | ld b,1 |
||
4540 | call loc_2D58 |
||
4541 | ld (40E1h),de |
||
4542 | ld c,0 |
||
4543 | call sub_2F3A |
||
4544 | call sub_2D34 |
||
4545 | ld a,(4102h) |
||
4546 | call sub_2CE5 |
||
4547 | ld de,4110h |
||
4548 | ld bc,10h |
||
4549 | ex de,hl |
||
4550 | ldir |
||
665 | savelij | 4551 | in a,(5Fh) |
623 | savelij | 4552 | dec a |
4553 | ld e,a |
||
4554 | ld d,0 |
||
4555 | ld hl,4000h |
||
4556 | call sub_2D73 |
||
4557 | ld bc,7FFDh |
||
4558 | ld a,(4101h) |
||
665 | savelij | 4559 | out (c),a |
623 | savelij | 4560 | loc_2C1B ld hl,(4140h) |
4561 | ld sp,hl |
||
4562 | ld hl,4000h |
||
4563 | ld de,0Ah |
||
4564 | call sub_2F1B |
||
4565 | ld hl,4100h |
||
4566 | ld de,0Bh |
||
4567 | call sub_2F1B |
||
4568 | ld a,3Ch |
||
4569 | push af |
||
4570 | jp loc_2EBC |
||
4571 | |||
4572 | sub_2C37 ld a,b |
||
4573 | dec a |
||
4574 | ld (4103h),a |
||
4575 | ld b,a |
||
4576 | ld a,(4101h) |
||
4577 | and 7 |
||
4578 | cp b |
||
4579 | ret z |
||
4580 | ld a,2 |
||
4581 | cp b |
||
4582 | ret z |
||
4583 | ld a,(4101h) |
||
4584 | and 8 |
||
4585 | jr z,loc_2C55 |
||
4586 | ld a,b |
||
4587 | cp 7 |
||
4588 | ret z |
||
4589 | jr loc_2C59 |
||
4590 | |||
4591 | loc_2C55 ld a,b |
||
4592 | cp 5 |
||
4593 | ret z |
||
4594 | loc_2C59 call sub_2C5D |
||
4595 | ret |
||
4596 | |||
4597 | sub_2C5D ld hl,4101h |
||
4598 | ld a,(hl) |
||
4599 | and 0F8h |
||
4600 | ld c,a |
||
4601 | ld a,b |
||
4602 | or c |
||
4603 | push bc |
||
4604 | ld bc,7FFDh |
||
665 | savelij | 4605 | out (c),a |
623 | savelij | 4606 | pop bc |
4607 | ld hl,0C000h |
||
4608 | loc_2C70 ld a,(hl) |
||
4609 | or a |
||
4610 | jr nz,loc_2C7A |
||
4611 | inc hl |
||
4612 | ld a,h |
||
4613 | or a |
||
4614 | jr nz,loc_2C70 |
||
4615 | ret |
||
4616 | |||
4617 | loc_2C7A call sub_2C7E |
||
4618 | ret |
||
4619 | |||
4620 | sub_2C7E ld c,0 |
||
4621 | call sub_2F3A |
||
4622 | call sub_2D2A |
||
4623 | ld a,(40E4h) |
||
4624 | ld (4102h),a |
||
4625 | inc a |
||
4626 | ld (40E4h),a |
||
4627 | ld hl,(40E5h) |
||
4628 | ld de,40h |
||
4629 | sbc hl,de |
||
4630 | ld (40E5h),hl |
||
4631 | ret c |
||
4632 | ld hl,(40E1h) |
||
4633 | ld (411Eh),hl |
||
4634 | call sub_2D1E |
||
4635 | ld a,40h |
||
4636 | ld (411Dh),a |
||
4637 | ld hl,0C000h |
||
4638 | ld (4119h),hl |
||
4639 | ld hl,4000h |
||
4640 | ld (411Bh),hl |
||
4641 | ld de,(40E1h) |
||
4642 | call sub_2D3E |
||
4643 | ld (40E1h),de |
||
4644 | ld c,0 |
||
4645 | call sub_2F3A |
||
4646 | call sub_2D34 |
||
4647 | ld a,(4102h) |
||
4648 | call sub_2CE5 |
||
4649 | ld de,4110h |
||
4650 | ld bc,10h |
||
4651 | ex de,hl |
||
4652 | ldir |
||
665 | savelij | 4653 | in a,(5Fh) |
623 | savelij | 4654 | dec a |
4655 | ld e,a |
||
4656 | ld d,0 |
||
4657 | ld hl,4000h |
||
4658 | call sub_2D73 |
||
4659 | ret |
||
4660 | |||
4661 | sub_2CE5 ld c,a |
||
4662 | and 0F0h |
||
4663 | rrca |
||
4664 | rrca |
||
4665 | rrca |
||
4666 | rrca |
||
4667 | ld b,a |
||
4668 | push bc |
||
4669 | ld e,b |
||
4670 | ld d,0 |
||
4671 | ld hl,4000h |
||
4672 | push de |
||
4673 | call sub_2F1B |
||
4674 | pop de |
||
4675 | pop bc |
||
4676 | ld b,0 |
||
4677 | ld a,c |
||
4678 | and 0Fh |
||
4679 | rlca |
||
4680 | rlca |
||
4681 | rlca |
||
4682 | rlca |
||
4683 | ld hl,4000h |
||
4684 | add a,l |
||
4685 | ld l,a |
||
4686 | ret |
||
4687 | |||
4688 | sub_2D09 ld hl,4110h |
||
4689 | ld b,9 |
||
4690 | loc_2D0E ld (hl)," " |
||
4691 | inc hl |
||
4692 | djnz loc_2D0E |
||
4693 | ld a,"@" |
||
4694 | ld (4110h),a |
||
4695 | ld a,"C" |
||
4696 | ld (4118h),a |
||
4697 | ret |
||
4698 | |||
4699 | sub_2D1E call sub_2D09 |
||
4700 | ld a,(4103h) |
||
4701 | add a,"0" |
||
4702 | ld (4111h),a |
||
4703 | ret |
||
4704 | |||
4705 | sub_2D2A ld hl,4000h |
||
4706 | ld de,8 |
||
4707 | call sub_2F1B |
||
4708 | ret |
||
4709 | |||
4710 | sub_2D34 ld hl,4000h |
||
4711 | ld de,8 |
||
4712 | call sub_2D73 |
||
4713 | ret |
||
4714 | |||
4715 | sub_2D3E call sub_2F65 |
||
4716 | ld c,d |
||
4717 | call sub_2F3A |
||
4718 | ld hl,0C000h |
||
4719 | ld b,40h |
||
4720 | jr loc_2D58 |
||
4721 | |||
4722 | sub_2D4C call sub_2F65 |
||
4723 | ld c,d |
||
4724 | call sub_2F3A |
||
4725 | ld hl,4000h |
||
4726 | ld b,0C0h |
||
4727 | loc_2D58 push bc |
||
4728 | push de |
||
4729 | call sub_2D73 |
||
4730 | ld de,100h |
||
4731 | add hl,de |
||
4732 | pop de |
||
4733 | inc e |
||
4734 | ld a,e |
||
4735 | cp 10h |
||
4736 | jr nz,loc_2D6F |
||
4737 | ld e,0 |
||
4738 | inc d |
||
4739 | ld c,d |
||
4740 | call sub_2F3A |
||
4741 | loc_2D6F pop bc |
||
4742 | djnz loc_2D58 |
||
4743 | ret |
||
4744 | |||
4745 | sub_2D73 ld a,e |
||
4746 | inc a |
||
665 | savelij | 4747 | out (5Fh),a |
623 | savelij | 4748 | push hl |
4749 | ld d,14h |
||
4750 | push de |
||
4751 | loc_2D7B di |
||
4752 | ld c,7Fh |
||
4753 | ld a,0A0h |
||
665 | savelij | 4754 | out (1Fh),a |
623 | savelij | 4755 | call WR_DATAPORT |
4756 | pop de |
||
4757 | pop hl |
||
665 | savelij | 4758 | in a,(1Fh) |
623 | savelij | 4759 | and 7Fh |
4760 | ret z |
||
4761 | dec d |
||
4762 | push hl |
||
4763 | push de |
||
4764 | jr nz,loc_2D7B |
||
4765 | halt |
||
4766 | |||
4767 | loc_2D92 ld hl,(TRD_5CE6) ; <C>-
, <B>- |
||
4768 | ld de,(TRD_5CEB) ;
|
||
4769 | ld a,(TRD_5CEA) ;
|
||
4770 | ld b,a |
||
4771 | call COM_05 ;
|
||
4772 | ret |
||
4773 | |||
4774 | GOTO call SET_AND_PUT |
||
4775 | call EXIT_IF_SINTAX ;
,
|
||
4776 | call INP_EXTFILENAME ;
|
||
4777 | call SET_FILENAME ;
#5CDD |
||
4778 | ld (4020h),bc |
||
4779 | ld a,c |
||
4780 | cp 8 |
||
4781 | jr nc,loc_2DD2 |
||
4782 | call COM_18 ;
|
||
4783 | call FIND_FILENAME ;
|
||
4784 | jp nz,ERR_NOFILES |
||
4785 | ld hl,TRD_5CDD ; |
||
4786 | ld bc,(4020h) |
||
4787 | add hl,bc |
||
4788 | ld (hl),"8" |
||
4789 | push hl |
||
4790 | call FIND_FILENAME ;
|
||
4791 | pop hl |
||
4792 | jr z,loc_2DD8 |
||
4793 | ld (hl)," " |
||
4794 | loc_2DD2 call FIND_FILENAME ;
|
||
4795 | jp loc_2E33 |
||
4796 | |||
4797 | loc_2DD8 call RDHEAD_FILENAME ;
|
||
4798 | call loc_2D92 |
||
4799 | ld sp,40FFh |
||
4800 | ld b,8 |
||
4801 | loc_2DE3 push bc |
||
4802 | ld a,b |
||
4803 | ld bc,7FFDh |
||
4804 | dec a |
||
4805 | push af |
||
4806 | or 10h |
||
665 | savelij | 4807 | out (c),a |
623 | savelij | 4808 | pop af |
4809 | add a,30h |
||
4810 | ld hl,TRD_5CDD ; |
||
4811 | ld bc,(4020h) |
||
4812 | add hl,bc |
||
4813 | ld (hl),a |
||
4814 | call FIND_FILENAME ;
|
||
4815 | jr nz,loc_2E05 |
||
4816 | call RDHEAD_FILENAME ;
|
||
4817 | call loc_2D92 |
||
4818 | loc_2E05 pop bc |
||
4819 | djnz loc_2DE3 |
||
4820 | ld a,20h |
||
4821 | ld hl,TRD_5CDD ; |
||
4822 | ld bc,(4020h) |
||
4823 | add hl,bc |
||
4824 | ld (hl),a |
||
4825 | call FIND_FILENAME ;
|
||
4826 | call RDHEAD_FILENAME ;
|
||
4827 | push bc |
||
4828 | push af |
||
4829 | ld bc,7FFDh |
||
4830 | ld a,(4101h) |
||
665 | savelij | 4831 | out (c),a |
623 | savelij | 4832 | pop af |
4833 | pop bc |
||
4834 | jr loc_2E39 |
||
4835 | |||
4836 | call SET_AND_PUT |
||
4837 | call EXIT_IF_SINTAX ;
,
|
||
4838 | call INP_EXTFILENAME ;
|
||
4839 | call FIND_FILE ;
|
||
4840 | loc_2E33 jp nz,ERR_NOFILES |
||
4841 | call RDHEAD_FILENAME ;
|
||
4842 | loc_2E39 ld a,(TRD_5CDD) ; |
||
4843 | cp "$" |
||
4844 | di |
||
4845 | jr nz,loc_2E43 |
||
4846 | im 2 |
||
4847 | loc_2E43 ld sp,40F0h |
||
4848 | call GET_TYPE_DISK ;
|
||
4849 | ld (4010h),a |
||
4850 | ld a,(TRD_5D16) ;
( #FF) |
||
4851 | ld (4011h),a |
||
4852 | ld hl,(TRD_5CE6) ; <C>-
, <B>- |
||
4853 | push hl |
||
4854 | ld de,(TRD_5CEB) ;
|
||
4855 | push de |
||
4856 | inc e |
||
4857 | ld a,e |
||
4858 | cp 10h |
||
4859 | jr nz,loc_2E64 |
||
4860 | ld e,0 |
||
4861 | inc d |
||
4862 | loc_2E64 ld c,d |
||
4863 | call sub_2F07 |
||
4864 | ld a,(4010h) |
||
4865 | and 2 |
||
4866 | call nz,sub_2F0F |
||
4867 | ld a,c |
||
4868 | call loc_2F50 |
||
4869 | ld hl,4100h |
||
4870 | ld b,0BFh |
||
4871 | loc_2E79 push bc |
||
4872 | push de |
||
4873 | call sub_2F1B |
||
4874 | ld de,100h |
||
4875 | add hl,de |
||
4876 | pop de |
||
4877 | inc e |
||
4878 | ld a,e |
||
4879 | cp 10h |
||
4880 | jr nz,loc_2E9C |
||
4881 | ld e,0 |
||
4882 | inc d |
||
4883 | ld c,d |
||
4884 | call sub_2F07 |
||
4885 | ld a,(4010h) |
||
4886 | and 2 |
||
4887 | call nz,sub_2F0F |
||
4888 | ld a,c |
||
4889 | call loc_2F50 |
||
4890 | loc_2E9C pop bc |
||
4891 | djnz loc_2E79 |
||
4892 | pop de |
||
4893 | pop hl |
||
4894 | ld sp,hl |
||
4895 | ld a,(4011h) |
||
4896 | push af |
||
4897 | ld c,d |
||
4898 | call sub_2F07 |
||
4899 | ld a,(4010h) |
||
4900 | and 2 |
||
4901 | call nz,sub_2F0F |
||
4902 | ld a,c |
||
4903 | call loc_2F50 |
||
4904 | ld hl,4000h |
||
4905 | call sub_2F1B |
||
4906 | loc_2EBC pop af |
||
4907 | ex af,af' |
||
4908 | pop af |
||
4909 | ld r,a |
||
4910 | pop af |
||
4911 | ld i,a |
||
4912 | di |
||
4913 | ld a,0FFh |
||
4914 | jp po,loc_2ECC |
||
4915 | ld a,0 |
||
4916 | loc_2ECC ld (KSTATE0),a |
||
4917 | pop af |
||
4918 | pop hl |
||
4919 | pop de |
||
4920 | pop bc |
||
4921 | exx |
||
4922 | ex af,af' |
||
4923 | pop iy |
||
4924 | pop ix |
||
4925 | pop hl |
||
4926 | pop de |
||
4927 | pop bc |
||
4928 | ld a,(BORDCR) |
||
4929 | and 38h |
||
4930 | rrca |
||
4931 | rrca |
||
4932 | rrca |
||
4933 | out (0FEh),a |
||
4934 | ld a,(SWAP_8) |
||
4935 | cp 0EEh |
||
4936 | jr nz,loc_2EF7 |
||
4937 | push bc |
||
4938 | ld bc,7FFDh |
||
4939 | ld a,(BANKM) |
||
665 | savelij | 4940 | out (c),a |
623 | savelij | 4941 | pop bc |
4942 | loc_2EF7 ld a,(KSTATE0) |
||
4943 | or a |
||
4944 | ld a,0C9h |
||
4945 | ld (KSTATE0),a |
||
4946 | jr nz,loc_2F03 |
||
4947 | ei |
||
4948 | loc_2F03 pop af |
||
4949 | jp KSTATE0 |
||
4950 | |||
4951 | sub_2F07 ld a,(4011h) |
||
4952 | or 3Ch |
||
665 | savelij | 4953 | loc_2F0C out (0FFh),a |
623 | savelij | 4954 | ret |
4955 | |||
4956 | sub_2F0F ld a,c |
||
4957 | or a |
||
4958 | rra |
||
4959 | ld c,a |
||
4960 | ret nc |
||
4961 | ld a,(4011h) |
||
4962 | and 6Fh |
||
4963 | jr loc_2F0C |
||
4964 | |||
4965 | sub_2F1B ld a,e |
||
4966 | inc a |
||
665 | savelij | 4967 | out (5Fh),a |
623 | savelij | 4968 | push hl |
4969 | ld d,14h |
||
4970 | push de |
||
4971 | loc_2F23 di |
||
4972 | ld c,7Fh |
||
4973 | ld a,80h |
||
665 | savelij | 4974 | out (1Fh),a |
623 | savelij | 4975 | call RD_DATAPORT |
4976 | pop de |
||
4977 | pop hl |
||
665 | savelij | 4978 | in a,(1Fh) |
623 | savelij | 4979 | and 7Fh |
4980 | ret z |
||
4981 | dec d |
||
4982 | push hl |
||
4983 | push de |
||
4984 | jr nz,loc_2F23 |
||
4985 | halt |
||
4986 | |||
4987 | sub_2F3A ld a,3Ch |
||
665 | savelij | 4988 | out (0FFh),a |
623 | savelij | 4989 | ld a,(KSTATE0) |
4990 | and 8 |
||
4991 | jr nz,loc_2F4F |
||
4992 | ld a,c |
||
4993 | or a |
||
4994 | rra |
||
4995 | ld c,a |
||
4996 | jr nc,loc_2F4F |
||
4997 | ld a,2Ch |
||
665 | savelij | 4998 | out (0FFh),a |
623 | savelij | 4999 | loc_2F4F ld a,c |
665 | savelij | 5000 | loc_2F50 out (7Fh),a |
623 | savelij | 5001 | call PAUSE725779T |
5002 | LD A,0X18 |
||
665 | savelij | 5003 | loc_2F57 out (1Fh),a |
5004 | loc_2F59 in a,(0FFh) |
||
623 | savelij | 5005 | and 80h |
5006 | jr z,loc_2F59 |
||
5007 | push bc |
||
5008 | call PAUSE725779T |
||
5009 | pop bc |
||
5010 | ret |
||
5011 | |||
5012 | sub_2F65 LD A,8 |
||
5013 | jr loc_2F57 |
||
5014 | |||
5015 | WORK4ERROR ld hl,(TRD_5D1C) ;
SP |
||
5016 | dec hl |
||
5017 | dec hl |
||
5018 | ld sp,hl |
||
5019 | jp loc_1D2F |
||
5020 | |||
5021 | CALL2BASIC ld (TRD_5D02),hl |
||
5022 | ld (TRD_5D04),de |
||
5023 | pop hl |
||
5024 | ld e,(hl) |
||
5025 | inc hl |
||
5026 | ld d,(hl) |
||
5027 | inc hl |
||
5028 | push hl |
||
5029 | ld hl,loc_3D2F |
||
5030 | push hl |
||
5031 | push de |
||
5032 | ld hl,TRD_5CC2 ;
#C9.
TR-DOS BASIC |
||
5033 | push hl |
||
5034 | ld hl,(TRD_5D02) |
||
5035 | ld de,(TRD_5D04) |
||
5036 | ret |
||
5037 | |||
5038 | SET_VARS ld hl,0FFFFh |
||
5039 | ld (TRD_5CFA),hl ;
A |
||
5040 | ld (TRD_5CFC),hl ;
C |
||
5041 | ld (TRD_5CC8),hl ;
A |
||
5042 | ld (TRD_5CCA),hl ;
C |
||
5043 | xor a |
||
5044 | ld (TRD_5D17),a ;
,
#AA |
||
5045 | ld (TRD_5D19),a ; |
||
5046 | ld (TRD_5D18),a |
||
5047 | ld (TRD_5D0F),a ;
TR-DOS |
||
5048 | ld (TRD_5D1F),a |
||
5049 | ld a,0FFh |
||
665 | savelij | 5050 | out (0FFh),a |
623 | savelij | 5051 | ld (ERR_NR),a |
5052 | ld (TRD_5D16),a ;
( #FF) |
||
5053 | ld (TRD_5D0C),a |
||
5054 | ld a,0C9h |
||
5055 | ld (TRD_5CC2),a ;
#C9.
TR-DOS BASIC |
||
5056 | ld a,0D0h |
||
665 | savelij | 5057 | out (1Fh),a |
623 | savelij | 5058 | ret |
5059 | |||
5060 | CP_END_CAT call CP_END_BUF ;
|
||
5061 | ld a,(hl) |
||
5062 | or a |
||
5063 | jp z,END_OUT_DIR |
||
5064 | cp 1 |
||
5065 | call z,ADD_10 |
||
5066 | ret nz |
||
5067 | jr CP_END_CAT |
||
5068 | |||
5069 | LOAD_SEC2BUF ld b,1 |
||
5070 | ld hl,TRD_5D25 |
||
5071 | jp loc_1E67 |
||
5072 | |||
5073 | LOAD_END_FILE push hl |
||
5074 | ld de,(TRD_5CF4) |
||
5075 | call LOAD_SEC2BUF |
||
5076 | ld a,(TRD_5CDB) |
||
5077 | pop de |
||
5078 | or a |
||
5079 | ret z |
||
5080 | ld c,a |
||
5081 | ld hl,TRD_5D25 |
||
5082 | ldir ; FIX |
||
5083 | ret |
||
5084 | |||
5085 | ;
TR-DOS |
||
5086 | CODE_BYTE_COM db 0CFh ; CAT |
||
5087 | db "*" |
||
5088 | db 0D0h ; FORMAT |
||
5089 | db 0D1h ; MOVE |
||
5090 | db 0E6h ; NEW |
||
5091 | db 0D2h ; ERASE |
||
5092 | db 0EFh ; LOAD |
||
5093 | db 0F8h ; SAVE |
||
5094 | db 0FEh ; RETURN |
||
5095 | db 0BEh ; PEEK |
||
5096 | db 0F4h ; POKE |
||
5097 | db 0D5h ; MERGE |
||
5098 | db 0F7h ; RUN |
||
5099 | db 0D3h ; OPEN |
||
5100 | db 0D4h ; CLOSE |
||
5101 | db 0FFh ; COPY |
||
5102 | db "4" ; 40 |
||
5103 | db 0ECh ; GOTO |
||
5104 | db "8" ; 80 |
||
5105 | db 0F0h ; LIST |
||
5106 | db 0D6h ; VERIFY |
||
5107 | |||
5108 | ;
|
||
5109 | SPIS_ADR_COM dw CAT |
||
5110 | dw COM_STAR |
||
5111 | dw FORMAT |
||
5112 | dw MOVE |
||
5113 | dw NEW |
||
5114 | dw ERASE |
||
5115 | dw LOAD |
||
5116 | dw SAVE |
||
5117 | dw RETURN |
||
5118 | dw PEEK |
||
5119 | dw POKE |
||
5120 | dw MERGE |
||
5121 | dw RUN |
||
5122 | dw OPEN |
||
5123 | dw CLOSE |
||
5124 | dw COPY |
||
5125 | dw COM_40 |
||
5126 | dw GOTO |
||
5127 | dw COM_80 |
||
5128 | dw LIST |
||
5129 | dw VERIFY |
||
5130 | |||
5131 | SAE2E_LINE ld hl,(E_LINE) ;
|
||
5132 | ld (TRD_5D11),hl ;
TR_DOS |
||
5133 | ld (TRD_5CD9),hl ;
<B> <C> |
||
5134 | ld a,0FFh |
||
5135 | ld (TRD_5CD6),a ; #FF-
|
||
5136 | ld hl,TRD_5CDB |
||
5137 | ld (TRD_5CD7),hl ;
-
|
||
5138 | ;
|
||
5139 | jr loc_3057 |
||
5140 | |||
5141 | SAE2_HL_ ld (TRD_5D11),hl ;
TR_DOS |
||
5142 | ld (TRD_5CD9),hl ;
<B> <C> |
||
5143 | call CP_ADR_STR |
||
5144 | ret nz |
||
5145 | inc hl |
||
5146 | inc hl |
||
5147 | ld (TRD_5CD7),hl ;
-
|
||
5148 | ;
|
||
5149 | loc_3057 CALL CMP_SPECSYM ;CALL FIND_KEYWORD |
||
5150 | jr nz,loc_3087 |
||
5151 | ex de,hl |
||
5152 | inc de |
||
5153 | ld b,0 |
||
5154 | ld hl,BYTES_COM ; SAVE |
||
5155 | add hl,bc |
||
5156 | ld a,(hl) |
||
5157 | ld hl,(TRD_5CD9) ;
<B> <C> |
||
5158 | ld (hl),a |
||
5159 | inc hl |
||
5160 | ex de,hl |
||
5161 | rst 20h |
||
5162 | dw 19DDh |
||
5163 | push bc |
||
5164 | CALL FOR_LOC_306F |
||
5165 | pop bc |
||
5166 | ld a,(TRD_5CD6) ; #FF-
|
||
5167 | or a |
||
5168 | jr nz,loc_3087 |
||
5169 | ld hl,(TRD_5CD7) ;
-
|
||
5170 | ;
|
||
5171 | ld e,(hl) |
||
5172 | inc hl |
||
5173 | ld d,(hl) |
||
5174 | ex de,hl |
||
5175 | or a |
||
5176 | sbc hl,bc |
||
5177 | ex de,hl |
||
5178 | ld (hl),d |
||
5179 | dec hl |
||
5180 | ld (hl),e |
||
5181 | loc_3087 ld hl,(TRD_5CD9) ;
<B> <C> |
||
5182 | ld a,(hl) |
||
5183 | cp 0Dh |
||
5184 | ret z |
||
5185 | inc hl |
||
5186 | ld (TRD_5CD9),hl ;
<B> <C> |
||
5187 | ld a,(hl) |
||
5188 | cp 0Dh |
||
5189 | ret z |
||
5190 | cp 22h |
||
5191 | jr nz,loc_3057 |
||
5192 | loc_309A inc hl |
||
5193 | ld a,(hl) |
||
5194 | cp 0Dh |
||
5195 | ret z |
||
5196 | cp 22h |
||
5197 | jr nz,loc_309A |
||
5198 | inc hl |
||
5199 | ld (TRD_5CD9),hl ;
<B> <C> |
||
5200 | jr loc_3057 |
||
5201 | |||
5202 | FIND_KEYWORD ld hl,(TRD_5CD9) ;
<B> <C> |
||
5203 | ld de,TBL_KEYWORD ; "SAVE" |
||
5204 | ld c,0 |
||
5205 | loc_30B1 ld a,(hl) |
||
5206 | and 0DFh |
||
5207 | ld b,a |
||
5208 | or a |
||
5209 | jr nz,loc_30BB |
||
5210 | inc hl |
||
5211 | jr loc_30B1 |
||
5212 | |||
5213 | loc_30BB ld a,(de) |
||
5214 | and 80h |
||
5215 | jr nz,loc_30C8 |
||
5216 | ld a,(de) |
||
5217 | cp b |
||
5218 | jr nz,loc_30D9 |
||
5219 | inc hl |
||
5220 | inc de |
||
5221 | jr loc_30B1 |
||
5222 | |||
5223 | loc_30C8 ld a,(de) |
||
5224 | and 7Fh |
||
5225 | cp b |
||
5226 | ret z |
||
5227 | loc_30CD inc c |
||
5228 | ld hl,(TRD_5CD9) ;
<B> <C> |
||
5229 | inc de |
||
5230 | ld a,(de) |
||
5231 | cp 0FFh |
||
5232 | jr nz,loc_30B1 |
||
5233 | or a |
||
5234 | ret |
||
5235 | |||
5236 | loc_30D9 inc de |
||
5237 | ld a,(de) |
||
5238 | and 80h |
||
5239 | jr z,loc_30D9 |
||
5240 | jr loc_30CD |
||
5241 | |||
5242 | CP_ADR_STR ld hl,(PPC) |
||
5243 | inc hl |
||
5244 | inc hl |
||
5245 | ld a,h |
||
5246 | or l |
||
5247 | jr z,loc_30F4 |
||
5248 | xor a |
||
5249 | ld (TRD_5CD6),a ; #FF-
|
||
5250 | dec hl |
||
5251 | dec hl |
||
5252 | rst 20h |
||
5253 | dw 196Eh |
||
5254 | ret |
||
5255 | |||
5256 | loc_30F4 ld a,0FFh |
||
5257 | ld (TRD_5CD6),a ; #FF-
|
||
5258 | ld hl,(E_LINE) ;
|
||
5259 | ret |
||
5260 | |||
5261 | TBL_KEYWORD db "SAVE",80h |
||
665 | savelij | 5262 | DC "SAVE" |
623 | savelij | 5263 | db "LOAD",80h |
665 | savelij | 5264 | DC "LOAD" |
623 | savelij | 5265 | db "RUN",80h |
665 | savelij | 5266 | DC "RUN" |
623 | savelij | 5267 | db "CAT",80h |
665 | savelij | 5268 | DC "CAT" |
623 | savelij | 5269 | db "ERASE",80h |
665 | savelij | 5270 | DC "ERASE" |
623 | savelij | 5271 | db "NEW",80h |
665 | savelij | 5272 | DC "NEW" |
623 | savelij | 5273 | db "MOVE",80h |
665 | savelij | 5274 | DC "MOVE" |
623 | savelij | 5275 | db "MERGE",80h |
665 | savelij | 5276 | DC "MERGE" |
623 | savelij | 5277 | db "PEEK",80h |
665 | savelij | 5278 | DC "PEEK" |
623 | savelij | 5279 | db "POKE",80h |
665 | savelij | 5280 | DC "POKE" |
623 | savelij | 5281 | db "OPEN",83h |
5282 | db "CLOSE",83h |
||
5283 | db "CODE",80h |
||
665 | savelij | 5284 | DC "CODE" |
623 | savelij | 5285 | db "RND",80h |
665 | savelij | 5286 | DC "RND" |
623 | savelij | 5287 | db "DATA",80h |
665 | savelij | 5288 | DC "DATA" |
623 | savelij | 5289 | db "SCREEN",4,84h |
5290 | db "SCREEN",84h |
||
5291 | db "COPY",80h |
||
665 | savelij | 5292 | DC "COPY" |
623 | savelij | 5293 | db "FORMAT",80h |
665 | savelij | 5294 | DC "FORMAT" |
623 | savelij | 5295 | db "GOTO",80h |
665 | savelij | 5296 | DC "GOTO" |
623 | savelij | 5297 | db "LIST",80h |
665 | savelij | 5298 | DC "LIST" |
623 | savelij | 5299 | db "LINE",80h |
665 | savelij | 5300 | DC "LINE" |
623 | savelij | 5301 | db "VERIFY",80h |
665 | savelij | 5302 | DC "VERIFY" |
623 | savelij | 5303 | db 0FFh,0FFh |
5304 | |||
5305 | BYTES_COM dw 0F8F8h ; SAVE |
||
5306 | dw 0EFEFh ; LOAD |
||
5307 | dw 0F7F7h ; RUN |
||
5308 | dw 0CFCFh ; CAT |
||
5309 | dw 0D2D2h ; ERASE |
||
5310 | dw 0E6E6h ; NEW |
||
5311 | dw 0D1D1h ; MOVE |
||
5312 | dw 0D5D5h ; MERGE |
||
5313 | dw 0BEBEh ; PEEK |
||
5314 | dw 0F4F4h ; POKE |
||
5315 | dw 0D4D3h ; OPEN CLOSE |
||
5316 | dw 0AFAFh ; CODE |
||
5317 | dw 0A5A5h ; RND |
||
5318 | dw 0E4E4h ; DATA |
||
5319 | dw 0AAAAh ; SCREEN |
||
5320 | dw 0FFFFh ; COPY |
||
5321 | dw 0D0D0h ; FORMAT |
||
5322 | dw 0ECECh ; GOTO |
||
5323 | dw 0F0F0h ; LIST |
||
5324 | dw 0CACAh ; LINE |
||
5325 | dw 0D6D6h ; VERIFY |
||
5326 | db 0 |
||
5327 | |||
5328 | ;
TR-DOS
|
||
5329 | CP_VARSTRDOS ld hl,(CHANS) |
||
5330 | or a |
||
5331 | ld bc,TRD_5D25 |
||
5332 | sbc hl,bc |
||
5333 | ret |
||
5334 | |||
5335 | include patch.a80 |
||
5336 | |||
5337 | DUPL 0X3C01-$,0FFh |
||
5338 | jr loc_3C06 |
||
5339 | |||
5340 | db 0FFh |
||
5341 | jr loc_3C09 |
||
5342 | |||
5343 | loc_3C06 jp loc_3D00 |
||
5344 | |||
5345 | loc_3C09 jp loc_3D03 |
||
5346 | |||
5347 | DUPL 0X3C30-$,0XFF |
||
665 | savelij | 5348 | IN A,(0X1F) |
623 | savelij | 5349 | RET |
5350 | |||
5351 | DUPL 0X3CFA-$,0FFh |
||
5352 | FOR_INTERFACE1 NOP |
||
5353 | JR loc_3D2F |
||
5354 | |||
5355 | loc_3CFD jp CALL_3D13 |
||
5356 | |||
5357 | loc_3D00 nop |
||
5358 | jr IN_DOS_15616 |
||
5359 | |||
5360 | loc_3D03 nop |
||
5361 | jr IN_DOS_15619 |
||
5362 | |||
5363 | loc_3D06 nop |
||
5364 | jp INPUTDATAFILE |
||
5365 | |||
5366 | loc_3D0A jp OUT_SYM2FILE |
||
5367 | |||
5368 | nop |
||
5369 | loc_3D0E jr loc_3D0A |
||
5370 | |||
5371 | nop |
||
5372 | jr FOR_INTERFACE1 |
||
5373 | |||
5374 | nop |
||
5375 | jr loc_3CFD |
||
5376 | |||
5377 | loc_3D16 nop |
||
5378 | jp WORK4ERROR |
||
5379 | |||
5380 | IN_DOS_15619 call CREATE_VARS_TRD |
||
5381 | push hl |
||
5382 | jp loc_16C |
||
5383 | |||
5384 | CREATE_VARS_TRD call CP_VARSTRDOS ;
TR-DOS
|
||
5385 | nop |
||
5386 | nop |
||
665 | savelij | 5387 | call c,loc_3D67;CREATE_VARS |
623 | savelij | 5388 | ld hl,TRD_5CC2 ;
#C9.
TR-DOS BASIC |
5389 | ret |
||
5390 | |||
5391 | nop |
||
5392 | nop |
||
5393 | loc_3D2F nop |
||
5394 | ret |
||
5395 | |||
5396 | IN_DOS_15616 call CREATE_VARS_TRD |
||
5397 | push hl |
||
5398 | jp IN_COMMAND_CPU ;
|
||
5399 | |||
665 | savelij | 5400 | INI_INTERFACE1 xor a |
5401 | DW 0 ;out (0F7h),a |
||
623 | savelij | 5402 | in a,(0F7h) |
5403 | cp 1Eh |
||
5404 | jr z,loc_3D44 |
||
5405 | cp 1Fh |
||
5406 | ret nz |
||
5407 | loc_3D44 rst 8 |
||
5408 | db 31h |
||
5409 | ld a,1 |
||
5410 | ld (TRD_5CEF),a ;
1
INTERFACE1 |
||
5411 | ret |
||
5412 | |||
665 | savelij | 5413 | CREATE_VARS xor a |
5414 | out (0FFh),a |
||
623 | savelij | 5415 | in a,(0F6h) |
5416 | ld hl,INI_INTERFACE1 |
||
5417 | ld de,MEMBOT |
||
5418 | ld bc,14h |
||
5419 | ldir |
||
665 | savelij | 5420 | ld hl,loc_3D67 |
623 | savelij | 5421 | push hl |
5422 | ld hl,loc_3D2F |
||
5423 | push hl |
||
5424 | jp MEMBOT |
||
5425 | |||
665 | savelij | 5426 | loc_3D67 ld hl,SET_VARS |
623 | savelij | 5427 | push hl |
5428 | ld hl,loc_3D2F |
||
5429 | push hl |
||
5430 | ld hl,1655h |
||
5431 | push hl |
||
665 | savelij | 5432 | ld hl,TRD_5CC2 |
623 | savelij | 5433 | push hl |
5434 | ld (hl),0C9h |
||
5435 | ld hl, P_RAMT+1 |
||
5436 | ld bc,70h |
||
5437 | ret |
||
5438 | |||
5439 | PRINT_0D ld a,0Dh |
||
5440 | PRINT_A_ push hl |
||
5441 | push bc |
||
5442 | push de |
||
5443 | push af |
||
5444 | DUPL 3,0 |
||
5445 | pop af |
||
5446 | call PRINT_SYM |
||
5447 | DUPL 3,0 |
||
5448 | pop de |
||
5449 | pop bc |
||
5450 | pop hl |
||
5451 | ret |
||
5452 | |||
5453 | PRINT_SYM rst 20h |
||
5454 | dw 10h |
||
5455 | ret |
||
5456 | |||
5457 | ;
93 |
||
5458 | COM_00 LD A,8 |
||
665 | savelij | 5459 | COM2VG_WAIT out (1Fh),a |
623 | savelij | 5460 | COM2VGWAIT1 push hl |
5461 | rst 20h |
||
5462 | dw 1F54h ;
BREAK |
||
5463 | jr c,COM2VGWAIT2 |
||
5464 | rst 20h |
||
5465 | dw 1B7Bh ;
,
BREAK |
||
5466 | COM2VGWAIT2 pop hl |
||
665 | savelij | 5467 | in a,(0FFh) |
623 | savelij | 5468 | and 80h |
5469 | jr z,COM2VGWAIT1 |
||
5470 | ret |
||
5471 | |||
5472 | ;
|
||
5473 | CP_PRESENT_DISK LD A,8 |
||
5474 | call COM2VG_WAIT |
||
5475 | ld de,0 |
||
665 | savelij | 5476 | in a,(1Fh) |
623 | savelij | 5477 | and 2 |
5478 | ld b,a |
||
665 | savelij | 5479 | CPPRESENTDSK1 in a,(1Fh) |
623 | savelij | 5480 | and 2 |
5481 | cp b |
||
5482 | ret nz |
||
5483 | inc de |
||
5484 | ld a,e |
||
5485 | or d |
||
5486 | jr nz,CPPRESENTDSK1 |
||
5487 | jp DISK_NOT_FOUND |
||
5488 | |||
5489 | ; |
||
5490 | ACTIV_DEF_DISK ld a,(TRD_5D19) ; |
||
5491 | COM_01 ld (TRD_5CF6),a ; |
||
5492 | ld hl,TRD_5D16 ;
( #FF) |
||
5493 | ld c,a |
||
5494 | ld a,3Ch |
||
5495 | or c |
||
665 | savelij | 5496 | out (0FFh),a |
623 | savelij | 5497 | ld (hl),a |
5498 | call GET_TIME_HEAD ;
|
||
5499 | and 80h |
||
5500 | jr z,loc_3DFA |
||
5501 | call CP_PRESENT_DISK ;
|
||
5502 | call CP_TIME_GOHEAD ;
|
||
5503 | call GET_TYPE_DISK ;
|
||
5504 | cp 0FFh |
||
5505 | jr nz,loc_3DFA |
||
5506 | push hl |
||
665 | savelij | 5507 | call CP_DISK_TRACK |
623 | savelij | 5508 | pop hl |
5509 | cp 80 ;
80
|
||
5510 | ld a,0 |
||
5511 | jr nz,loc_3DF9 |
||
5512 | ld a,80h |
||
5513 | loc_3DF9 ld (hl),a |
||
5514 | loc_3DFA call WR_NUM_TRACK |
||
5515 | PAUSE725779T ld a,50h |
||
5516 | PAUSE_C_A ld c,0FFh |
||
5517 | loc_3E01 dec c |
||
5518 | jr nz,loc_3E01 |
||
5519 | dec a |
||
5520 | jr nz,PAUSE_C_A |
||
5521 | ret |
||
5522 | |||
5523 | ;
|
||
5524 | GET_TIME_HEAD ld de,TRD_5CFA ;
A |
||
5525 | loc_3E0B ld hl,(TRD_5CF6) ;
|
||
5526 | add hl,de |
||
5527 | ld a,(hl) |
||
5528 | ret |
||
5529 | |||
5530 | ;
|
||
5531 | GET_TYPE_DISK ld de,TRD_5CC8 ;
A |
||
5532 | jr loc_3E0B |
||
5533 | |||
5534 | ;
|
||
5535 | CP_TIME_GOHEAD call GET_TIME_HEAD ;
|
||
5536 | ld b,8 |
||
5537 | ld c,4 |
||
5538 | loc_3E1D ld (hl),b |
||
5539 | ld a,0Bh |
||
5540 | call COM2VG_WAIT |
||
5541 | ld a,20h |
||
5542 | ld b,0Bh |
||
5543 | call HEAD_POSITION |
||
5544 | ld b,(hl) |
||
5545 | ld a,1 |
||
5546 | call HEAD_POSITION |
||
665 | savelij | 5547 | in a,(1Fh) |
623 | savelij | 5548 | and 4 |
5549 | jr nz,loc_3E3F |
||
5550 | xor a |
||
5551 | call HEAD_POSITION |
||
665 | savelij | 5552 | in a,(1Fh) |
623 | savelij | 5553 | and 4 |
5554 | ret nz |
||
5555 | loc_3E3F inc b |
||
5556 | dec c |
||
5557 | ret z |
||
5558 | jr loc_3E1D |
||
5559 | |||
665 | savelij | 5560 | HEAD_POSITION out (7Fh),a |
623 | savelij | 5561 | ld a,b |
5562 | or 18h |
||
5563 | jp COM2VG_WAIT |
||
5564 | |||
665 | savelij | 5565 | POSITIONIREN out (7Fh),a |
623 | savelij | 5566 | push bc |
5567 | ld b,a |
||
665 | savelij | 5568 | in a,(3Fh) |
623 | savelij | 5569 | cp b |
5570 | pop bc |
||
5571 | push af |
||
5572 | ld a,b |
||
5573 | or 18h |
||
5574 | call COM2VG_WAIT |
||
5575 | pop af |
||
5576 | ret z |
||
5577 | push bc |
||
5578 | call PAUSE725779T |
||
5579 | pop bc |
||
5580 | ret |
||
5581 | |||
5582 | ; |
||
5583 | COM_02 ld c,a |
||
5584 | call COM_16 ; 0 |
||
5585 | call GET_TYPE_DISK ;
|
||
5586 | and 2 |
||
5587 | call nz,SET_SIDE_DISK |
||
5588 | push bc |
||
5589 | bit 7,(hl) |
||
5590 | jr z,loc_3E83 |
||
5591 | bit 0,(hl) |
||
5592 | jr nz,loc_3E83 |
||
665 | savelij | 5593 | in a,(3Fh) |
623 | savelij | 5594 | cp c |
5595 | jr z,loc_3E82 |
||
5596 | rlca |
||
665 | savelij | 5597 | out (3Fh),a |
623 | savelij | 5598 | ld a,c |
5599 | rlca |
||
5600 | loc_3E82 ld c,a |
||
5601 | loc_3E83 call GET_TIME_HEAD ;
|
||
5602 | ld b,a |
||
665 | savelij | 5603 | in a,(3Fh) |
623 | savelij | 5604 | cp c |
5605 | push bc |
||
5606 | call nz,PAUSE725779T |
||
5607 | pop bc |
||
5608 | ld a,c |
||
5609 | call POSITIONIREN |
||
5610 | pop bc |
||
5611 | ld a,c |
||
665 | savelij | 5612 | out (3Fh),a |
623 | savelij | 5613 | ld a,(TRD_5CCD) ; #80- |
5614 | or a |
||
5615 | ret z |
||
5616 | xor a |
||
5617 | ld (TRD_5CCD),a ; #80- |
||
5618 | PAUSE_3_C_A ld b,3 |
||
5619 | loc_3EA2 ld a,0FFh |
||
5620 | call PAUSE_C_A |
||
5621 | djnz loc_3EA2 |
||
5622 | ret |
||
5623 | |||
5624 | SET_SIDE_DISK ld a,c |
||
5625 | or a |
||
5626 | rra |
||
5627 | ld c,a |
||
5628 | ret nc |
||
5629 | jp COM_17 ; 1 |
||
5630 | |||
5631 | GET_NUM_TRACK call COM_16 ; 0 |
||
665 | savelij | 5632 | loc_3EB5 in a,(1Fh) |
623 | savelij | 5633 | and 80h |
5634 | ld (TRD_5CCD),a ; #80- |
||
665 | savelij | 5635 | in a,(3Fh) |
623 | savelij | 5636 | ld h,a |
5637 | CALL BUGFIX_3EBF |
||
5638 | ld c,7Fh |
||
5639 | ld d,1 |
||
5640 | di |
||
5641 | ld a,0C0h |
||
665 | savelij | 5642 | out (1Fh),a |
623 | savelij | 5643 | push bc |
5644 | ld b,3 |
||
665 | savelij | 5645 | loc_3ECE in a,(0FFh) |
623 | savelij | 5646 | and 0C0h |
5647 | jr nz,loc_3EF2 |
||
5648 | inc de |
||
5649 | ld a,e |
||
5650 | or d |
||
5651 | jr nz,loc_3ECE |
||
5652 | djnz loc_3ECE |
||
5653 | pop bc |
||
5654 | ei |
||
5655 | ld a,0D0h |
||
665 | savelij | 5656 | out (1Fh),a |
623 | savelij | 5657 | LD A,(TRD_5D17) |
5658 | cp 0FFh |
||
5659 | ret z |
||
5660 | DISK_NOT_FOUND call SET_TAPELDERR |
||
5661 | ld a,0FFh |
||
5662 | ld (TRD_5D17),a ;
,
#AA |
||
5663 | jp loc_271B |
||
5664 | |||
5665 | loc_3EF2 pop bc |
||
5666 | in h,(c) |
||
665 | savelij | 5667 | loc_3EF5 in a,(0FFh) |
623 | savelij | 5668 | and 0C0h |
5669 | jr z,loc_3EF5 |
||
5670 | ei |
||
5671 | ret m |
||
5672 | di |
||
665 | savelij | 5673 | in a,(7Fh) |
623 | savelij | 5674 | jr loc_3EF5 |
5675 | |||
5676 | ;
|
||
5677 | COM_03 ld (TRD_5CFF),a |
||
5678 | ret |
||
5679 | |||
5680 | ;
|
||
5681 | COM_04 ld (TRD_5D00),hl |
||
5682 | ret |
||
5683 | |||
5684 | SAVE_SECTOR ld a,0A0h |
||
5685 | jr loc_3F10 |
||
5686 | |||
5687 | LOAD_SECTOR ld a,80h |
||
5688 | loc_3F10 ld (TRD_5CFE),a |
||
5689 | RD_OR_WR_SEC ld d,0Ah |
||
5690 | loc_3F15 push de |
||
5691 | di |
||
5692 | ld a,(TRD_5CFF) |
||
5693 | inc a |
||
665 | savelij | 5694 | out (5Fh),a |
623 | savelij | 5695 | ld hl,(TRD_5D00) |
5696 | ld c,7Fh |
||
5697 | ld a,(TRD_5CFE) |
||
665 | savelij | 5698 | out (1Fh),a |
623 | savelij | 5699 | cp 0A0h |
5700 | push af |
||
5701 | call z,WRITE_SEC ;
|
||
5702 | pop af |
||
5703 | call nz,READ_SEC |
||
5704 | pop de |
||
5705 | ei |
||
665 | savelij | 5706 | in a,(1Fh) |
623 | savelij | 5707 | ld b,a |
5708 | and 7Fh |
||
5709 | ret z |
||
5710 | loc_3F39 ld hl,READ_ONLY ; Read Only |
||
5711 | and 40h |
||
5712 | jr nz,loc_3F4B |
||
5713 | ld a,b |
||
5714 | and 4 |
||
5715 | jr z,loc_3FA0 |
||
5716 | dec d |
||
5717 | jr nz,loc_3F15 |
||
5718 | loc_3F48 ld hl,TXT_DISCERROR_ |
||
5719 | loc_3F4B ld a,0D0h |
||
665 | savelij | 5720 | out (1Fh),a |
623 | savelij | 5721 | ld a,b |
5722 | and 1 |
||
5723 | jp nz,DISK_NOT_FOUND |
||
665 | savelij | 5724 | in a,(3Fh) |
623 | savelij | 5725 | or a |
5726 | jr nz,loc_3F5F |
||
665 | savelij | 5727 | in a,(5Fh) |
623 | savelij | 5728 | cp 0Ah |
5729 | ret z |
||
5730 | loc_3F5F push hl |
||
5731 | call CLEAR_SCREEN ; |
||
5732 | pop hl |
||
5733 | rst 18h |
||
5734 | ld hl,TXT_TRK_ |
||
5735 | rst 18h |
||
665 | savelij | 5736 | in a,(3Fh) |
623 | savelij | 5737 | call PRINT_CHISLO_A_ |
5738 | ld hl,TXT_SEC_ ; " sec" |
||
5739 | rst 18h |
||
665 | savelij | 5740 | in a,(5Fh) |
623 | savelij | 5741 | call PRINT_CHISLO_A_ |
5742 | ld hl,TXT_RIA_ |
||
5743 | rst 18h |
||
5744 | loc_3F7B call GET_KEYS ;
|
||
5745 | cp "I" ; Ignore-RET ข คเฅแ #1E8E |
||
5746 | ret z |
||
5747 | cp "R" ; Retry |
||
5748 | jr z,PRESSED_RETRY |
||
5749 | cp "A" ; Abort |
||
5750 | jr nz,loc_3F7B |
||
5751 | call SET_TAPELDERR ; Press Abort |
||
5752 | ld a,7 |
||
5753 | ld (TRD_5D0F),a ;
TR-DOS |
||
5754 | jp END_COMAND |
||
5755 | |||
5756 | PRESSED_RETRY ld a,(TRD_5CF5) |
||
5757 | call COM_02 ; |
||
5758 | call PAUSE_3_C_A |
||
5759 | jp RD_OR_WR_SEC |
||
5760 | |||
5761 | loc_3FA0 dec d |
||
5762 | jp z,loc_3F48 |
||
5763 | push de |
||
5764 | call GET_TIME_HEAD ;
|
||
5765 | and 2 |
||
5766 | jr nz,loc_3FAD |
||
5767 | inc (hl) |
||
5768 | loc_3FAD call COM_00 ;
93 |
||
5769 | ld a,(TRD_5CF5) |
||
5770 | call COM_02 ; |
||
5771 | pop de |
||
5772 | jp loc_3F15 |
||
5773 | |||
5774 | ;
|
||
5775 | WRITE_SEC ld b,4 |
||
665 | savelij | 5776 | WAIT4WRITE in a,(0FFh) |
623 | savelij | 5777 | and 0C0h |
5778 | jr nz,WR_DATAPORT1 |
||
5779 | inc de |
||
5780 | ld a,e |
||
5781 | or d |
||
5782 | jr nz,WAIT4WRITE |
||
5783 | djnz WAIT4WRITE |
||
5784 | ret |
||
5785 | |||
665 | savelij | 5786 | WR_DATAPORT in a,(0FFh) |
623 | savelij | 5787 | and 0C0h |
5788 | jr z,WR_DATAPORT |
||
5789 | ret m |
||
665 | savelij | 5790 | WR_DATAPORT1 outi |
623 | savelij | 5791 | jr WR_DATAPORT |
5792 | |||
5793 | READ_SEC ld b,4 |
||
665 | savelij | 5794 | WAIT4READ in a,(0FFh) |
623 | savelij | 5795 | and 0C0h |
5796 | jr nz,RD_DATAPORT1 |
||
5797 | inc de |
||
5798 | ld a,e |
||
5799 | or d |
||
5800 | jr nz,WAIT4READ |
||
5801 | djnz WAIT4READ |
||
5802 | ret |
||
5803 | |||
665 | savelij | 5804 | RD_DATAPORT in a,(0FFh) |
623 | savelij | 5805 | and 0C0h |
5806 | jr z,RD_DATAPORT |
||
5807 | ret m |
||
5808 | RD_DATAPORT1 ini |
||
5809 | jr RD_DATAPORT |
||
5810 | |||
5811 | OUT (C),A |
||
5812 | RET |
||
5813 | |||
5814 | IN A,(C) |
||
5815 | RET |
||
5816 | |||
761 | savelij | 5817 | DUPL 0X3FF8-$,0FFh |
5818 | DB "TRD503" |
||
5819 | DW DATA_VERS |