Rev 1474 | Details | Compare with Previous | Last modification | View Log
Rev | Author | Line No. | Line |
---|---|---|---|
68 | Alone | 1 | DEVICE ZXSPECTRUM128 |
60 | Alone | 2 | include "../_sdk/sys_h.asm" |
3 | |||
4 | STACK=0x4000 |
||
61 | Alone | 5 | |
73 | Alone | 6 | FILE888TO=0x4000 ;,0x4800 |
7 | FILE888FROM=0xb800 |
||
61 | Alone | 8 | T888FOUND=0x8800 ;temp |
9 | |||
10 | deblcscradr=0xc000 |
||
11 | |||
73 | Alone | 12 | grfadr=#4000 |
61 | Alone | 13 | grfatr=grfadr+#84 |
60 | Alone | 14 | |
15 | org PROGSTART |
||
16 | cmd_begin |
||
17 | |||
18 | ld sp,STACK |
||
19 | |||
20 | ld e,3 ;6912 |
||
21 | OS_SETGFX ;e=0:EGA, e=2:MC, e=3:6912, e=6:text ;+SET FOCUS ;e=-1: disable gfx (out: e=old gfxmode) |
||
22 | |||
23 | OS_GETMAINPAGES |
||
344 | alone | 24 | ;dehl=����� ��࠭�� � 0000,4000,8000,c000 |
60 | Alone | 25 | ld a,e |
26 | ld (codepg4000),a |
||
27 | ld a,h |
||
28 | ld (temppg8000),a |
||
29 | ld a,l |
||
30 | ld (highpgc000),a |
||
31 | |||
528 | alone | 32 | ;OS_GETSCREENPAGES |
344 | alone | 33 | ;de=��࠭��� 0-�� ��࠭� (d=�����), hl=��࠭��� 1-�� ��࠭� (h=�����) |
528 | alone | 34 | ;ld a,e |
35 | ;ld (setpgs_scr_low),a |
||
36 | ;;ld (setpgs_scr_attr),a |
||
37 | ;ld a,d |
||
38 | ;ld (setpgs_scr_high),a |
||
39 | ;;ld (setpgs_scr_pixels),a |
||
40 | ;ld a,l |
||
41 | ;ld (setpgs_scr2_low),a |
||
42 | ;ld a,h |
||
43 | ;ld (setpgs_scr2_high),a |
||
60 | Alone | 44 | |
45 | |||
46 | ld hl,COMMANDLINE |
||
47 | call skipword |
||
48 | call skipspaces |
||
49 | ld a,(hl) |
||
50 | or a |
||
51 | jr nz,$+5 |
||
52 | ld hl,defaultfilename |
||
61 | Alone | 53 | push hl |
54 | call findlastdot ;out: de = after last dot or start |
||
60 | Alone | 55 | ex de,hl |
61 | Alone | 56 | ;commandline might contain spaces after extension |
57 | ld de,curext |
||
58 | ldi |
||
59 | ld a,(hl) |
||
60 | sub ' ' |
||
61 | ld (de),a |
||
62 | jr z,curextq |
||
63 | ldi |
||
64 | ld a,(hl) |
||
65 | sub ' ' |
||
66 | ld (de),a |
||
67 | jr z,curextq |
||
68 | ldi |
||
69 | curextq |
||
60 | Alone | 70 | |
61 | Alone | 71 | pop de |
72 | |||
60 | Alone | 73 | ;ld de,filename |
74 | call openstream_file |
||
75 | or a |
||
76 | jr nz,openerror |
||
77 | |||
78 | call setpgs_scr |
||
79 | ld hl,0xc000 |
||
80 | ld bc,0x1800 |
||
61 | Alone | 81 | call fillzero |
60 | Alone | 82 | ld bc,0x2ff |
83 | ld (hl),7 |
||
84 | ldir |
||
61 | Alone | 85 | |
86 | call runext |
||
1195 | alone | 87 | jr nc,wrongfile;quit |
60 | Alone | 88 | |
1195 | alone | 89 | ;ld bc,quit |
90 | ;push bc |
||
61 | Alone | 91 | |
60 | Alone | 92 | ld a,(filehandle) |
93 | ld b,a |
||
94 | OS_GETFILESIZE ;dehl=filesize |
||
95 | ld a,h |
||
96 | sub 0x1b |
||
97 | or l |
||
98 | or d |
||
99 | or e |
||
1481 | dimkam | 100 | jp z,loadscr ;TODO ��� 6913 |
60 | Alone | 101 | ld a,h |
102 | sub 0x18 |
||
103 | or l |
||
104 | or d |
||
105 | or e |
||
1481 | dimkam | 106 | jp z,loadscr |
1195 | alone | 107 | if 1==0 |
60 | Alone | 108 | ld a,h |
109 | sub 0x08 |
||
110 | or l |
||
111 | or d |
||
112 | or e |
||
113 | jr z,loadfnt |
||
114 | ld a,h |
||
115 | sub 0x03 |
||
116 | or l |
||
117 | or d |
||
118 | or e |
||
119 | jr z,loadfnt |
||
120 | ld a,h |
||
121 | sub 0x1b*2 |
||
122 | or l |
||
123 | or d |
||
124 | or e |
||
125 | jp z,loadimg |
||
126 | ld a,h |
||
127 | sub 0x18*3 |
||
128 | or l |
||
129 | or d |
||
130 | or e |
||
131 | jr z,load3 |
||
1195 | alone | 132 | endif |
60 | Alone | 133 | |
61 | Alone | 134 | |
135 | ;wrong file |
||
60 | Alone | 136 | call closestream_file |
137 | |||
1195 | alone | 138 | wrongfile |
60 | Alone | 139 | openerror |
1195 | alone | 140 | ld hl,-1 |
141 | ;jr quit |
||
142 | ;quit |
||
60 | Alone | 143 | QUIT |
144 | |||
61 | Alone | 145 | ;readerror |
146 | ;;TODO restore stack |
||
147 | ; call closestream_file |
||
148 | ; jr error |
||
1481 | dimkam | 149 | |
150 | zxsattr |
||
151 | |||
152 | loadzxs |
||
153 | call setpgs_scr |
||
154 | ld de,0x6000 |
||
155 | call readstream_file |
||
156 | call closestream_file |
||
157 | ; ��ਡ��� |
||
158 | ld de,0x6000 + 1676 |
||
159 | ld hl,0xd800 |
||
160 | ld bc,32 |
||
161 | zxs_attr_0 |
||
162 | ld a,(de) |
||
163 | ld (hl),a |
||
164 | inc de |
||
165 | ld bc,32 |
||
166 | add hl,bc |
||
167 | ld a,h |
||
168 | cp 0xdb |
||
169 | jr nz,zxs_attr_0 |
||
170 | ld h,0xd8 |
||
171 | inc l |
||
172 | ld a,l |
||
173 | cp c |
||
174 | jr nz,zxs_attr_0 |
||
175 | |||
176 | ; ������� |
||
177 | ld ix,0x6000 + 908 |
||
178 | ld de,0xc000 |
||
179 | |||
180 | zxs_sym_0 |
||
181 | ld a,(ix+0) |
||
182 | ld l,a |
||
183 | ld h,0 |
||
184 | add hl,hl |
||
185 | add hl,hl |
||
186 | add hl,hl |
||
187 | ld bc,0x6000 + 12 |
||
188 | add hl,bc |
||
189 | dup 8 |
||
190 | ld a,(hl) |
||
191 | ld (de),a |
||
192 | inc d |
||
193 | inc hl |
||
194 | edup |
||
195 | inc ix |
||
196 | call d_de |
||
197 | ld a,d |
||
198 | cp 0xd8 |
||
199 | jr nz,zxs_sym_0 |
||
200 | inc e |
||
201 | ld a,d |
||
202 | sub 0x18 |
||
203 | ld d,a |
||
204 | ld a,e |
||
205 | cp 32 |
||
206 | jr nz,zxs_sym_0 |
||
207 | ; ��थ� |
||
208 | display $ |
||
209 | ld e,0 |
||
210 | ld hl,0x6000 + 2444 |
||
211 | ld a,(hl) |
||
212 | inc hl |
||
213 | or a |
||
214 | jr z,zxs_no_r |
||
215 | inc e |
||
216 | inc e |
||
217 | zxs_no_r |
||
218 | ld a,(hl) |
||
219 | inc hl |
||
220 | or a |
||
221 | jr z,zxs_no_g |
||
222 | inc e |
||
223 | inc e |
||
224 | inc e |
||
225 | inc e |
||
226 | zxs_no_g |
||
227 | ld a,(hl) |
||
228 | inc hl |
||
229 | or a |
||
230 | jr z,zxs_no_b |
||
231 | inc e |
||
232 | zxs_no_b |
||
233 | OS_SETBORDER |
||
234 | jr waitkeyquit |
||
235 | d_de |
||
236 | ld a,e |
||
237 | add a,32 |
||
238 | ld e,a |
||
239 | ret c |
||
240 | ld a,d |
||
241 | sub 8 |
||
242 | ld d,a |
||
243 | ret |
||
244 | |||
1474 | alone | 245 | loadatr |
246 | load53c |
||
247 | ld hl,0xd800 |
||
248 | ld de,0xd801 |
||
249 | ld bc,0x2ff |
||
250 | ld (hl),l |
||
251 | ldir |
||
252 | ld hl,0xc000 |
||
253 | ld a,0x55 |
||
254 | ld b,24 |
||
255 | load53c0 |
||
256 | ld (hl),a |
||
257 | inc l |
||
258 | jr nz,$-2 |
||
259 | cpl |
||
260 | inc h |
||
261 | djnz load53c0 |
||
262 | ex de,hl ;ld de,0xd800 |
||
263 | ld hl,0x300 |
||
264 | call readstream_file |
||
265 | call closestream_file |
||
266 | jr waitkeyquit |
||
60 | Alone | 267 | loadscr |
268 | ;hl=size |
||
344 | alone | 269 | ;TODO ������ A �몫�祭��/��४��祭�� ��ਡ�⮢ |
60 | Alone | 270 | ld de,0xc000 |
271 | call readstream_file |
||
61 | Alone | 272 | call closestream_file |
273 | waitkeyquit |
||
274 | control0 |
||
275 | call yieldgetkeynolang |
||
276 | jr z,control0 |
||
1195 | alone | 277 | waitkeyq |
278 | ld hl,0 |
||
279 | ;���塞 ��५�� |
||
280 | cp key_left |
||
281 | jr z,quitwithkey |
||
282 | cp key_right |
||
283 | jr z,quitwithkey |
||
284 | cp key_up |
||
285 | jr z,quitwithkey |
||
286 | cp key_down |
||
287 | jr z,quitwithkey |
||
288 | QUIT |
||
289 | quitwithkey |
||
290 | ;�����頥� ��� ������ (��� nv) |
||
291 | ld l,a |
||
292 | QUIT |
||
61 | Alone | 293 | |
294 | loadplc |
||
295 | ;hl=size |
||
296 | ld de,0x6000 |
||
297 | push de |
||
298 | call readstream_file |
||
299 | call closestream_file |
||
300 | pop hl |
||
301 | call deblc |
||
302 | jr waitkeyquit |
||
60 | Alone | 303 | |
304 | loadfnt |
||
305 | ;hl=size |
||
306 | ld de,0xc000 |
||
307 | push de |
||
308 | call readstream_file |
||
61 | Alone | 309 | call closestream_file |
60 | Alone | 310 | pop hl |
344 | alone | 311 | ;�� ��砩 ��������� ���� - ��㥬 ��� ᭨�� |
60 | Alone | 312 | ld e,0 |
313 | loadfnt0 |
||
314 | ld d,0xd0 |
||
315 | ld b,8 |
||
316 | loadfnt1 |
||
317 | ld a,(hl) |
||
318 | inc hl |
||
319 | ld (de),a |
||
320 | inc d |
||
321 | djnz loadfnt1 |
||
322 | inc e |
||
323 | jr nz,loadfnt0 |
||
61 | Alone | 324 | jr waitkeyquit |
325 | |||
450 | alone | 326 | loadmlt |
327 | call read4000 |
||
328 | call closestream_file |
||
329 | call cleanafter8000 |
||
330 | ld e,2 |
||
331 | OS_SETGFX ;e=0:EGA, e=2:MC, e=3:6912, e=6:text ;+SET FOCUS ;e=-1: disable gfx (out: e=old gfxmode) |
||
332 | ld hl,0x4000 |
||
333 | ld de,0xc000+4 ;pixels |
||
334 | call convmgpixelscr_hlde |
||
335 | ;ld hl,convmcattrline |
||
336 | ;ld (convmgpixelscr_linepatch),hl |
||
337 | ld hl,0x5800 |
||
338 | ld de,0x8000+4 ;attrs |
||
339 | ld bc,0xc001 ;b=hgt in chrs ;c=hgt of chr |
||
340 | call convmgattrs |
||
341 | ;ld lx,40 |
||
342 | ;call convmgattrlines |
||
343 | ;call convmgpixelscr_hlde |
||
344 | ;ld hl,convmcline |
||
345 | ;ld (convmgpixelscr_linepatch),hl |
||
346 | jp waitkeyquit |
||
347 | |||
61 | Alone | 348 | loadmc |
73 | Alone | 349 | call read4000 |
61 | Alone | 350 | call closestream_file |
351 | call cleanafter8000 |
||
352 | ld e,2 |
||
353 | OS_SETGFX ;e=0:EGA, e=2:MC, e=3:6912, e=6:text ;+SET FOCUS ;e=-1: disable gfx (out: e=old gfxmode) |
||
354 | call convmcscr |
||
355 | jp waitkeyquit |
||
60 | Alone | 356 | |
61 | Alone | 357 | convmcscr |
358 | ld hl,0x4000 |
||
73 | Alone | 359 | ld de,0xc000+4 ;pixels |
61 | Alone | 360 | ld b,192 |
361 | loadmclines0 |
||
362 | push bc |
||
73 | Alone | 363 | call convmcline |
364 | ex de,hl |
||
365 | ld c,40 |
||
366 | add hl,bc |
||
367 | ex de,hl |
||
368 | pop bc |
||
369 | djnz loadmclines0 |
||
370 | ;ld bc,0xc001 |
||
371 | ;jr convmgattrs |
||
372 | ;convmcattrs |
||
373 | ld de,0x8000+4 ;attrs |
||
374 | ld bc,0xc020 |
||
375 | convmcattrlines |
||
376 | convmcattrlines0 |
||
377 | push bc |
||
378 | ld b,0 |
||
379 | call convmcattrline |
||
380 | ex de,hl |
||
381 | ld c,40 |
||
382 | add hl,bc |
||
383 | ex de,hl |
||
384 | pop bc |
||
385 | djnz convmcattrlines0 |
||
386 | ret |
||
387 | |||
388 | readconvmg1attrs |
||
389 | ld hl,0x0c00 |
||
390 | call read4000 |
||
391 | ld de,0x8000+4+8 ;attrs |
||
392 | ld bc,0xc010 |
||
393 | jr convmcattrlines |
||
394 | |||
395 | readconvmg1attrs8 |
||
396 | ld hl,0x0c00 |
||
397 | call read4000 |
||
398 | ld de,0x8000+4 ;attrs |
||
399 | ld b,24 |
||
400 | convmg1attr8lines0 |
||
401 | push bc |
||
402 | ld b,8 |
||
403 | convmg1attr8lines1 |
||
404 | push hl |
||
405 | push bc |
||
406 | ld bc,8 |
||
407 | call convmcattrline |
||
408 | ex de,hl |
||
409 | ld c,24 |
||
410 | add hl,bc |
||
411 | ex de,hl |
||
412 | ld c,8 |
||
413 | call convmcattrline |
||
414 | ex de,hl |
||
415 | ld c,40-24 |
||
416 | add hl,bc |
||
417 | ex de,hl |
||
418 | pop bc |
||
419 | pop hl |
||
420 | djnz convmg1attr8lines1 |
||
421 | ld c,16 |
||
422 | add hl,bc |
||
423 | pop bc |
||
424 | djnz convmg1attr8lines0 |
||
425 | ret |
||
426 | |||
427 | readconvmgattrs |
||
428 | push bc |
||
429 | call read4000 |
||
430 | pop bc |
||
431 | convmgattrs |
||
432 | ;hl=from |
||
433 | ;de=attrs addr |
||
434 | ;b=hgt in chrs |
||
435 | ;c=hgt of chr |
||
436 | ld de,0x8000+4 ;attrs |
||
437 | ld lx,40 |
||
438 | convmgattrlines |
||
439 | ;hl=from |
||
440 | ;de=attrs addr |
||
441 | ;b=hgt in chrs |
||
442 | ;c=hgt of chr |
||
443 | ;lx=40/80 step |
||
444 | convmg2attrlines0 |
||
445 | push bc |
||
446 | ld b,c;2 |
||
447 | convmg2attrlines1 |
||
448 | push hl |
||
449 | push bc |
||
450 | ld bc,32 |
||
451 | call convmcattrline |
||
452 | ex de,hl |
||
453 | ld c,lx;40 |
||
454 | add hl,bc |
||
455 | ex de,hl |
||
456 | pop bc |
||
457 | pop hl |
||
458 | djnz convmg2attrlines1 |
||
459 | ld c,32 |
||
460 | add hl,bc |
||
461 | pop bc |
||
462 | djnz convmg2attrlines0 |
||
463 | ret |
||
464 | |||
465 | convmcattrline |
||
61 | Alone | 466 | push de |
73 | Alone | 467 | convmcattrline0 |
468 | ld a,(hl) |
||
469 | ld (de),a |
||
470 | set 5,d |
||
471 | ldi |
||
472 | res 5,d |
||
473 | jp pe,convmcattrline0 |
||
474 | pop de |
||
475 | ret |
||
476 | |||
477 | convmcline |
||
478 | push de |
||
61 | Alone | 479 | ld b,32 |
73 | Alone | 480 | convmcline0 |
61 | Alone | 481 | dup 4 |
482 | rl (hl) |
||
483 | rla |
||
484 | add a,a |
||
485 | edup |
||
486 | ld c,a |
||
487 | rrca |
||
488 | or c |
||
489 | ld (de),a |
||
490 | set 5,d |
||
491 | dup 4 |
||
492 | rl (hl) |
||
493 | rla |
||
494 | add a,a |
||
495 | edup |
||
496 | ld c,a |
||
497 | rrca |
||
498 | or c |
||
499 | ld (de),a |
||
500 | res 5,d |
||
501 | inc de |
||
502 | inc hl |
||
73 | Alone | 503 | djnz convmcline0 |
61 | Alone | 504 | pop de |
73 | Alone | 505 | ret |
506 | |||
507 | readconvmgpixelscr |
||
508 | call cleanafter8000 |
||
509 | call read40001800 |
||
510 | ;ld hl,0x4000 |
||
511 | ld de,0xc000+4 ;pixels |
||
450 | alone | 512 | convmgpixelscr_hlde |
61 | Alone | 513 | ld b,192 |
73 | Alone | 514 | convmglines0 |
61 | Alone | 515 | push bc |
73 | Alone | 516 | push hl |
450 | alone | 517 | ;ld bc,32 ;for convmcattrline |
518 | ;convmgpixelscr_linepatch=$+1 |
||
519 | call convmcline ;/convmcattrline |
||
73 | Alone | 520 | pop hl |
521 | call downhl |
||
61 | Alone | 522 | ex de,hl |
73 | Alone | 523 | ld c,40 |
61 | Alone | 524 | add hl,bc |
525 | ex de,hl |
||
526 | pop bc |
||
73 | Alone | 527 | djnz convmglines0 |
61 | Alone | 528 | ret |
73 | Alone | 529 | |
61 | Alone | 530 | loadmcx |
531 | call cleanafter8000 |
||
532 | ld e,2 |
||
533 | OS_SETGFX ;e=0:EGA, e=2:MC, e=3:6912, e=6:text ;+SET FOCUS ;e=-1: disable gfx (out: e=old gfxmode) |
||
534 | ld hl,0x1800*2 |
||
73 | Alone | 535 | call read4000 |
61 | Alone | 536 | call convmcscr |
537 | call setpgs_scr2 |
||
538 | call cleanafter8000 |
||
539 | ld hl,0x1800*2 |
||
73 | Alone | 540 | call read4000 |
61 | Alone | 541 | call convmcscr |
73 | Alone | 542 | loadmcxq |
61 | Alone | 543 | call closestream_file |
544 | jp waitkeyblink |
||
545 | |||
73 | Alone | 546 | loadmg2 |
547 | ld bc,0x6002 |
||
548 | ld hl,0x0c00 |
||
549 | jr loadmg_go |
||
550 | loadmg4 |
||
551 | ld bc,0x3004 |
||
552 | ld hl,0x0600 |
||
553 | jr loadmg_go |
||
554 | loadmg8 |
||
555 | ld bc,0x1808 |
||
556 | ld hl,0x0300 |
||
557 | loadmg_go |
||
558 | push bc |
||
559 | push hl |
||
560 | call cleanafter8000 |
||
561 | ld e,2 |
||
562 | OS_SETGFX ;e=0:EGA, e=2:MC, e=3:6912, e=6:text ;+SET FOCUS ;e=-1: disable gfx (out: e=old gfxmode) |
||
563 | ld hl,0x100 ;header |
||
564 | call read4000 |
||
565 | call readconvmgpixelscr |
||
566 | call setpgs_scr2 |
||
567 | call readconvmgpixelscr |
||
568 | call setpgs_scr |
||
569 | pop hl |
||
570 | pop bc |
||
571 | push bc |
||
572 | push hl |
||
573 | call readconvmgattrs |
||
574 | call setpgs_scr2 |
||
575 | pop hl |
||
576 | pop bc |
||
577 | call readconvmgattrs |
||
578 | jr loadmcxq |
||
61 | Alone | 579 | |
73 | Alone | 580 | loadmg1 |
581 | call cleanafter8000 |
||
582 | ld e,2 |
||
583 | OS_SETGFX ;e=0:EGA, e=2:MC, e=3:6912, e=6:text ;+SET FOCUS ;e=-1: disable gfx (out: e=old gfxmode) |
||
584 | ld hl,0x100 ;header |
||
585 | call read4000 |
||
586 | call readconvmgpixelscr |
||
587 | call setpgs_scr2 |
||
588 | call readconvmgpixelscr |
||
589 | call setpgs_scr |
||
590 | call readconvmg1attrs |
||
591 | call setpgs_scr2 |
||
592 | call readconvmg1attrs |
||
593 | call setpgs_scr |
||
594 | call readconvmg1attrs8 |
||
595 | call setpgs_scr2 |
||
596 | call readconvmg1attrs8 |
||
597 | jr loadmcxq |
||
598 | |||
599 | read40001800 |
||
600 | ld hl,0x1800 |
||
601 | read4000 |
||
602 | ld de,0x4000 |
||
603 | push de |
||
604 | call readstream_file |
||
605 | pop hl |
||
606 | ret |
||
607 | |||
608 | |||
61 | Alone | 609 | loadgrf |
610 | ;hl=size |
||
611 | push hl |
||
612 | call cleanafter8000 |
||
73 | Alone | 613 | ld e,2 |
614 | OS_SETGFX ;e=0:EGA, e=2:MC, e=3:6912, e=6:text ;+SET FOCUS ;e=-1: disable gfx (out: e=old gfxmode) |
||
61 | Alone | 615 | pop hl |
616 | call setpgtemp8000 |
||
617 | ld de,grfadr |
||
73 | Alone | 618 | push de |
61 | Alone | 619 | call readstream_file |
620 | call closestream_file |
||
73 | Alone | 621 | pop hl;LD HL,grfadr |
622 | LD DE,TPAL |
||
623 | push de |
||
624 | CALL GRFPAL |
||
625 | pop de;LD de,TPAL |
||
626 | OS_SETPAL |
||
627 | CALL GRF2ATM |
||
61 | Alone | 628 | jp waitkeyquit |
629 | TPAL |
||
630 | ds 32 |
||
631 | |||
632 | cleanafter8000 |
||
633 | ld hl,0x8000 |
||
634 | ld bc,0xffff-0x8000 |
||
635 | jp fillzero |
||
636 | |||
73 | Alone | 637 | loadrmode |
344 | alone | 638 | ;scr1 (6144 �ࠩ⮬) (���� �३�) |
639 | ;scr2 (6144 �ࠩ⮬) (��ன �३�) |
||
640 | ;attr1 (768) ;G/M/C - ���(����) ��ࢮ�� �३�� |
||
641 | ;attr2 (768) ;R/C/M - ���(����) ��ண� �३�� |
||
642 | ;attr3 (768) ;B/Y - ����(���) ��ண� �३�� - ����⠢�� �� 1-� ��-�� ����� |
||
643 | ;attr4 (768) ;W - ����(���) ��ࢮ�� �३�� - ����⠢�� �� 2-� ��-�� ����� |
||
73 | Alone | 644 | call cleanafter8000 |
645 | ld e,2 |
||
646 | OS_SETGFX ;e=0:EGA, e=2:MC, e=3:6912, e=6:text ;+SET FOCUS ;e=-1: disable gfx (out: e=old gfxmode) |
||
647 | call read40001800 |
||
648 | call convmcscr |
||
649 | call setpgs_scr2 |
||
650 | call cleanafter8000 |
||
651 | call read40001800 |
||
652 | call convmcscr |
||
344 | alone | 653 | ;attr1 (768) ;G/M/C - ���(����) ��ࢮ�� �३�� |
73 | Alone | 654 | call setpgs_scr |
655 | ld de,0x8000+4+40 ;attrs |
||
656 | call readrmodeattrs |
||
344 | alone | 657 | ;attr2 (768) ;R/C/M - ���(����) ��ண� �३�� |
73 | Alone | 658 | call setpgs_scr2 |
659 | ld de,0x8000+4+40 ;attrs |
||
660 | call readrmodeattrs |
||
344 | alone | 661 | ;attr3 (768) ;B/Y - ����(���) ��ண� �३�� - ����⠢�� �� 1-� ��-�� ����� |
73 | Alone | 662 | call setpgs_scr |
663 | call readrmodeattrs_top |
||
344 | alone | 664 | ;attr4 (768) ;W - ����(���) ��ࢮ�� �३�� - ����⠢�� �� 2-� ��-�� ����� |
73 | Alone | 665 | call setpgs_scr2 |
666 | call readrmodeattrs_top |
||
667 | jp loadmcxq |
||
668 | |||
669 | readrmodeattrs_top |
||
670 | ld de,0x8000+4 ;attrs |
||
671 | readrmodeattrs |
||
672 | ;de=attrs |
||
673 | push de |
||
674 | ld hl,0x300 |
||
675 | call read4000 |
||
676 | pop de |
||
677 | ld bc,0x1804 |
||
678 | ld lx,80 |
||
679 | jp convmgattrlines |
||
680 | |||
681 | if 1==0 |
||
682 | ;TODO |
||
683 | call setEGA ;keeps hl |
||
684 | ld de,0x4000 |
||
685 | call readstream_file |
||
686 | call closestream_file |
||
344 | alone | 687 | ;0. ���� �� 梥� attr1,attr2,attr3,attr4 |
688 | ;1. ᣥ������ ������� (�� �������樨 attr4+attr3 2*3 ��, �� �������樨 attr1+attr2 4*4 ��) � ��뫪��� �� ᯥ毠����� |
||
689 | ;2. ������� ᯥ毠����� |
||
690 | ;3. �������� ���ᥫ� � ���⮬ ��ਡ�⮢ |
||
73 | Alone | 691 | |
692 | LD de,TRMODEPAL |
||
693 | OS_SETPAL |
||
694 | |||
695 | jp waitkeyquit |
||
696 | |||
697 | TRMODEPAL |
||
698 | ;0, r, c, m, g, y, gc, w, mr, mc, [M], [C], bw, yw, [rw], [cw] |
||
344 | alone | 699 | ;�ᯮ��㥬 ��� 8 (2 �� ATM), 15 (3 �� ATM) |
73 | Alone | 700 | _0=5*0 |
701 | _1=5*1;8 |
||
702 | _2=5*2;15 |
||
344 | alone | 703 | ;DDp palette: %grbG11RB(low),%grbG11RB(high), ������� |
73 | Alone | 704 | ;high B, high b, low B, low b |
705 | macro palcol r,g,b ;0..15 |
||
706 | db 0xff - (((g&1)<<7) + ((r&1)<<6) + ((b&1)<<5) + ((g&2)<<3) + (r&2) + ((b&2)>>1)) |
||
707 | db 0xff - (((g&4)<<5) + ((r&4)<<4) + ((b&4)<<3) + ((g&8)<<1) + ((r&8)>>2) + ((b&8)>>3)) |
||
708 | endm |
||
709 | palcol _0,_0,_0 ;0 |
||
710 | palcol _1,_0,_0 ;r |
||
711 | palcol _0,_1,_1 ;c |
||
712 | palcol _1,_0,_1 ;m |
||
713 | palcol _0,_1,_0 ;g |
||
714 | palcol _1,_1,_0 ;y |
||
715 | palcol _0,_2,_1 ;gc |
||
716 | palcol _1,_1,_1 ;w |
||
717 | palcol _2,_0,_1 ;mr |
||
718 | palcol _1,_1,_2 ;mc |
||
719 | palcol _2,_0,_2 ;[M] |
||
720 | palcol _0,_2,_2 ;[C] |
||
721 | palcol _1,_1,_2 ;bw |
||
722 | palcol _2,_2,_1 ;yw |
||
723 | palcol _2,_1,_1 ;[rw] |
||
724 | palcol _1,_2,_2 ;[cw] |
||
725 | endif |
||
726 | |||
275 | alone | 727 | load16c |
728 | ;jr $ |
||
729 | call setEGA ;keeps hl |
||
730 | ld hl,0x8000 |
||
731 | ld de,0x8000 |
||
732 | call readstream_file |
||
733 | ld de,TPAL;curpal |
||
734 | ld hl,32 |
||
735 | call readstream_file |
||
736 | call closestream_file |
||
737 | ld de,TPAL;curpal |
||
738 | OS_SETPAL |
||
739 | jp waitkeyquit |
||
740 | |||
741 | |||
60 | Alone | 742 | load3 |
743 | ;B,R,G |
||
61 | Alone | 744 | ;hl=size |
745 | call setEGA ;keeps hl |
||
60 | Alone | 746 | |
344 | alone | 747 | ;0.��ୠ� ������ (㦥) |
748 | ;1.����㧨� � 0x4000 |
||
749 | ;2.��४����㥬 � 0x8800 |
||
750 | ;3.�����㥬 � 0x8000 |
||
751 | ;4.��ଠ�쭠� ������ |
||
60 | Alone | 752 | ld de,0x4000 |
753 | call readstream_file |
||
61 | Alone | 754 | call closestream_file |
755 | conv3 |
||
756 | call cleanafter8800 |
||
757 | ld hl,0x4000 |
||
60 | Alone | 758 | ld de,0x8800 +4 |
759 | ld b,192 |
||
760 | load3lines |
||
761 | push bc |
||
61 | Alone | 762 | call load3line ;out: de=next line |
60 | Alone | 763 | call downhl |
764 | pop bc |
||
765 | djnz load3lines |
||
61 | Alone | 766 | conv3q |
60 | Alone | 767 | ld hl,0x8800 |
768 | ld de,0x8000 |
||
769 | call load3copylayer |
||
770 | ld de,0xa000 |
||
771 | call load3copylayer |
||
772 | ld de,0xc000 |
||
773 | call load3copylayer |
||
774 | ld de,0xe000 |
||
775 | call load3copylayer |
||
61 | Alone | 776 | ld de,palstandard |
777 | OS_SETPAL |
||
778 | jp waitkeyquit |
||
779 | |||
780 | loady |
||
781 | ;packed R,G,B (run from 0xb800, depack to 0xb800, depacker at 0x5b00) |
||
782 | call setEGA ;keeps hl |
||
783 | ld de,0xb800 |
||
784 | call readstream_file |
||
785 | call closestream_file |
||
786 | ld a,(0xb800) |
||
787 | cp 0xf3 |
||
788 | ret nz |
||
789 | call 0xb800 |
||
790 | ld hl,0xb800 |
||
791 | ld de,0x4000+0x1800 |
||
792 | ld bc,0x1800*2 |
||
60 | Alone | 793 | ldir |
61 | Alone | 794 | ld de,0x4000 |
795 | ld bc,0x1800 |
||
796 | ldir |
||
797 | ;ld b,192 |
||
798 | jr conv3;loadplusq |
||
799 | |||
800 | loadplus |
||
801 | ;MultiStudio |
||
802 | ;B,R,G sprites (hgt=128) |
||
803 | ;hl=size |
||
804 | call setEGA ;keeps hl |
||
344 | alone | 805 | ;0.��ୠ� ������ (㦥) |
806 | ;1.����㧨� � 0x4000 |
||
807 | ;2.��४����㥬 � 0x8800 |
||
808 | ;3.�����㥬 � 0x8000 |
||
809 | ;4.��ଠ�쭠� ������ |
||
61 | Alone | 810 | ld de,0x4000 |
811 | ld hl,0x1000 |
||
812 | call readstream_file |
||
813 | ld de,0x4000+0x1800 |
||
814 | ld hl,0x1000 |
||
815 | call readstream_file |
||
816 | ld de,0x4000+(2*0x1800) |
||
817 | ld hl,0x1000 |
||
818 | call readstream_file |
||
819 | call closestream_file |
||
820 | call cleanafter8800 |
||
821 | ld b,128 |
||
822 | loadplusq |
||
823 | ld hl,0x4000 |
||
824 | ld de,0x8800 +4 |
||
825 | loadpluslines |
||
826 | push bc |
||
827 | call load3line ;out: de=next line |
||
828 | ld bc,32 |
||
829 | add hl,bc |
||
830 | pop bc |
||
831 | djnz loadpluslines |
||
832 | jp conv3q |
||
60 | Alone | 833 | |
834 | loadimg |
||
835 | ld de,0xc000 |
||
836 | ld hl,0x1b00 |
||
837 | push de |
||
838 | push hl |
||
839 | call readstream_file |
||
840 | call setpgs_scr2 |
||
841 | pop hl |
||
842 | pop de |
||
843 | call readstream_file |
||
61 | Alone | 844 | call closestream_file |
845 | waitkeyblink |
||
60 | Alone | 846 | controlimg0 |
847 | ld a,1 |
||
848 | xor 0 |
||
849 | ld ($-1),a |
||
850 | ld e,a |
||
851 | OS_SETSCREEN ;e=screen=0..1 |
||
852 | call yieldgetkeynolang |
||
853 | jr z,controlimg0 |
||
1195 | alone | 854 | jp waitkeyq |
60 | Alone | 855 | |
61 | Alone | 856 | load888 |
857 | call setEGA ;keeps hl |
||
858 | ;jr $ |
||
859 | ld de,FILE888FROM |
||
860 | call readstream_file |
||
861 | call closestream_file |
||
862 | call DEP888 |
||
863 | jp conv3 |
||
864 | |||
865 | cleanafter8800 |
||
866 | ld hl,0x8800 |
||
867 | ld bc,0xffff-0x8800 |
||
868 | jp fillzero |
||
869 | |||
870 | palstandard |
||
871 | STANDARDPAL |
||
872 | palblack |
||
873 | ds 32,0xf3 |
||
874 | |||
875 | load3copylayer |
||
876 | ld bc,40*192 |
||
877 | ldir |
||
878 | push hl |
||
879 | ex de,hl |
||
880 | ld bc,40*(200-192)-1 |
||
881 | call fillzero |
||
882 | pop hl |
||
883 | ret |
||
884 | |||
885 | load3line |
||
886 | ;push de |
||
887 | call load3subline |
||
888 | ;set 6,d |
||
889 | ld bc,40*192*2 |
||
890 | ex de,hl |
||
891 | add hl,bc |
||
892 | ex de,hl |
||
893 | call load3subline |
||
894 | ;res 6,d |
||
895 | ;set 5,d |
||
896 | ld bc,-(40*192) |
||
897 | ex de,hl |
||
898 | add hl,bc |
||
899 | ex de,hl |
||
900 | call load3subline |
||
901 | ;set 6,d |
||
902 | ld bc,40*192*2 |
||
903 | ex de,hl |
||
904 | add hl,bc |
||
905 | ex de,hl |
||
906 | call load3subline |
||
907 | ld bc,40-(40*192*3) |
||
908 | ex de,hl |
||
909 | add hl,bc |
||
910 | ex de,hl |
||
911 | ret |
||
73 | Alone | 912 | |
60 | Alone | 913 | load3subline |
914 | push de |
||
915 | push hl |
||
916 | ld a,h |
||
917 | ld (load3_h0),a |
||
918 | ld (load3_h0a),a |
||
919 | add a,0x18 |
||
920 | ;ld (load3_h1),a |
||
921 | ;ld (load3_h1a),a |
||
922 | ld b,a |
||
923 | add a,0x18 |
||
924 | ;ld (load3_h2),a |
||
925 | ;ld (load3_h2a),a |
||
926 | ld c,a |
||
927 | load3subline0 |
||
928 | ;load3_h2=$+1 |
||
929 | ld h,c;0 |
||
930 | rl (hl) |
||
931 | rla |
||
932 | ;load3_h1=$+1 |
||
933 | ld h,b;0 |
||
934 | rl (hl) |
||
935 | rla |
||
936 | load3_h0=$+1 |
||
937 | ld h,0 |
||
938 | rl (hl) |
||
939 | rla |
||
940 | ;a=%GRB |
||
941 | add a,a |
||
942 | add a,a |
||
943 | ;a=%GRB00 |
||
944 | ;load3_h2a=$+1 |
||
945 | ld h,c;0 |
||
946 | rl (hl) |
||
947 | rla |
||
948 | ;load3_h1a=$+1 |
||
949 | ld h,b;0 |
||
950 | rl (hl) |
||
951 | rla |
||
952 | load3_h0a=$+1 |
||
953 | ld h,0 |
||
954 | rl (hl) |
||
955 | rla |
||
956 | ;a=%GRB00grb |
||
957 | rlca |
||
958 | rlca |
||
959 | rlca |
||
960 | ;a=%00grbGRB |
||
961 | ld (de),a |
||
962 | inc de |
||
963 | inc l |
||
964 | ld a,l |
||
965 | and 0x1f |
||
966 | jr nz,load3subline0 |
||
967 | pop hl |
||
968 | pop de |
||
969 | ret |
||
73 | Alone | 970 | |
60 | Alone | 971 | downhl |
972 | inc h |
||
973 | ld a,h |
||
974 | and 7 |
||
975 | ret nz |
||
976 | ld a,l |
||
977 | add a,32 |
||
978 | ld l,a |
||
979 | ret c |
||
980 | ld a,h |
||
981 | sub 8 |
||
982 | ld h,a |
||
983 | ret |
||
984 | |||
61 | Alone | 985 | setEGA |
986 | ;keeps hl |
||
987 | push hl |
||
988 | ld de,palblack |
||
989 | OS_SETPAL |
||
990 | ld e,0 |
||
991 | OS_SETGFX ;e=0:EGA, e=2:MC, e=3:6912, e=6:text ;+SET FOCUS ;e=-1: disable gfx (out: e=old gfxmode) |
||
992 | ld hl,0x8000 |
||
993 | ld bc,0x7fff |
||
994 | call fillzero |
||
995 | pop hl |
||
996 | ret |
||
997 | |||
60 | Alone | 998 | fillzero |
999 | ld d,h |
||
1000 | ld e,l |
||
1001 | inc de |
||
1002 | ld (hl),0 |
||
1003 | ldir |
||
1004 | ret |
||
1005 | |||
1006 | yieldgetkeynolang |
||
1007 | ;out: z=nokey |
||
1008 | YIELDGETKEY |
||
1009 | ld a,c |
||
1010 | ret |
||
1011 | |||
1012 | setpgcode4000 |
||
1013 | codepg4000=$+1 |
||
1014 | ld a,0 |
||
1015 | SETPG16K |
||
1016 | ret |
||
1017 | |||
1018 | setpgtemp8000 |
||
1019 | temppg8000=$+1 |
||
1020 | ld a,0 |
||
1021 | SETPG32KLOW |
||
1022 | ret |
||
1023 | |||
1024 | setpghighc000 |
||
1025 | highpgc000=$+1 |
||
1026 | ld a,0 |
||
1027 | SETPG32KHIGH |
||
1028 | ret |
||
1029 | |||
1030 | setpgs_scr |
||
555 | alone | 1031 | ld a,(user_scr0_low) ;ok |
60 | Alone | 1032 | SETPG32KLOW |
555 | alone | 1033 | ld a,(user_scr0_high) ;ok |
60 | Alone | 1034 | SETPG32KHIGH |
1035 | ret |
||
1036 | |||
1037 | setpgs_scr2 |
||
555 | alone | 1038 | ld a,(user_scr1_low) ;ok |
60 | Alone | 1039 | SETPG32KLOW |
555 | alone | 1040 | ld a,(user_scr1_high) ;ok |
60 | Alone | 1041 | SETPG32KHIGH |
1042 | ret |
||
1043 | |||
1044 | skipword |
||
1045 | ;hl=string |
||
1046 | ;out: hl=terminator/space addr |
||
1047 | getword0 |
||
1048 | ld a,(hl) |
||
1049 | or a |
||
1050 | ret z |
||
1051 | cp ' ' |
||
1052 | ret z |
||
1053 | inc hl |
||
1054 | jr getword0 |
||
1055 | |||
1056 | skipspaces |
||
1057 | ;hl=string |
||
1058 | ;out: hl=after last space |
||
1059 | ld a,(hl) |
||
1060 | cp ' ' |
||
1061 | ret nz |
||
1062 | inc hl |
||
1063 | jr skipspaces |
||
1064 | |||
61 | Alone | 1065 | ;hl = poi to filename in string |
1066 | ;out: de = after last dot or start |
||
1067 | findlastdot |
||
1068 | ld d,h |
||
1069 | ld e,l ;de = after last dot |
||
1070 | findlastdot0 |
||
1071 | ld a,[hl] |
||
1072 | inc hl |
||
1073 | or a |
||
1074 | ret z |
||
1075 | cp '.' |
||
1076 | jr nz,findlastdot0 |
||
1077 | jr findlastdot |
||
1078 | |||
1079 | strcplow |
||
1080 | ;hl=s1 (lowercase) |
||
1081 | ;de=s2 (any case) |
||
1082 | ;out: Z (equal, hl=terminator of s1+1, de=terminator of s2+1), NZ (not equal, hl=erroraddr in s1, de=erroraddr in s2) |
||
1083 | strcplow0. |
||
1084 | ld a,[de] ;s2 |
||
1085 | or a |
||
1086 | jr z,$+4 |
||
1087 | or 0x20 |
||
1088 | cp [hl] ;s1 |
||
1089 | ret nz |
||
1090 | inc hl |
||
1091 | inc de |
||
1092 | or a |
||
1093 | jr nz,strcplow0. |
||
1094 | ret ;z |
||
1095 | |||
1096 | runext |
||
1097 | ;out: CY=error |
||
1098 | ld hl,extlist ;list of internal commands |
||
1099 | strcpexec0 |
||
1100 | ld c,(hl) |
||
1101 | inc hl |
||
1102 | ld b,(hl) |
||
1103 | inc hl |
||
1104 | ld a,b |
||
1105 | cp -1 |
||
1106 | jr z,runext_error ;a!=0: no such ext |
||
1107 | ld de,curext |
||
1108 | push hl |
||
1109 | call strcplow |
||
1110 | pop hl |
||
1111 | jr nz,strcpexec_fail |
||
1112 | ld (runextaddr),bc |
||
1113 | ld a,(filehandle) |
||
1114 | ld b,a |
||
1115 | OS_GETFILESIZE ;dehl=filesize |
||
1116 | runextaddr=$+1 |
||
1117 | call 0 |
||
1118 | or a |
||
1119 | ret |
||
1120 | strcpexec_fail |
||
344 | alone | 1121 | ld b,-1 ;�⮡� �筮 ���� �ନ���� |
61 | Alone | 1122 | xor a |
344 | alone | 1123 | cpir ;����� ��易⥫쭮 |
61 | Alone | 1124 | jr strcpexec0 |
1125 | |||
1126 | runext_error |
||
1127 | ;no such ext |
||
1128 | scf |
||
1129 | ret |
||
1130 | |||
1131 | extlist |
||
1132 | dw loadplus |
||
1133 | db "+",0 |
||
1134 | dw loadplus |
||
1135 | db "-",0 |
||
1136 | dw load3 |
||
1137 | db "3",0 |
||
1138 | dw load888 |
||
1139 | db "888",0 |
||
1474 | alone | 1140 | dw loadatr |
1141 | db "atr",0 |
||
1481 | dimkam | 1142 | dw loadzxs |
1143 | db "zxs",0 |
||
1474 | alone | 1144 | dw load53c |
1145 | db "53c",0 |
||
61 | Alone | 1146 | dw loadfnt |
1147 | db "fnt",0 |
||
1148 | dw loady |
||
1149 | db "y",0 |
||
1150 | dw loadimg |
||
1151 | db "img",0 |
||
1152 | dw loadplc |
||
1153 | db "plc",0 |
||
1154 | dw loadgrf |
||
1155 | db "grf",0 |
||
1156 | dw loadmc |
||
1157 | db "mc",0 |
||
1158 | dw loadmcx |
||
1159 | db "mcx",0 |
||
1160 | dw loadchr |
||
1161 | db "ch$",0 |
||
73 | Alone | 1162 | dw loadmg1 |
1163 | db "mg1",0 |
||
1164 | dw loadmg2 |
||
1165 | db "mg2",0 |
||
1166 | dw loadmg4 |
||
1167 | db "mg4",0 |
||
1168 | dw loadmg8 |
||
1169 | db "mg8",0 |
||
1170 | dw loadrmode |
||
1171 | db "rm",0 |
||
275 | alone | 1172 | dw load16c |
1173 | db "16c",0 |
||
450 | alone | 1174 | dw loadmlt |
1175 | db "mlt",0 |
||
61 | Alone | 1176 | |
1177 | dw -1 ;end of list |
||
1178 | |||
1179 | |||
1180 | |||
60 | Alone | 1181 | defaultfilename |
260 | alone | 1182 | db "m:/scr/rockwell.888",0 |
61 | Alone | 1183 | curext |
1184 | ds 3 |
||
1185 | db 0 |
||
60 | Alone | 1186 | |
260 | alone | 1187 | ;oldtimer |
1188 | ; dw 0 |
||
60 | Alone | 1189 | |
1190 | |||
61 | Alone | 1191 | include "deblc.asm" |
1192 | include "chr.asm" |
||
1193 | include "888.asm" |
||
1194 | include "grf.asm" |
||
60 | Alone | 1195 | include "../_sdk/file.asm" |
1196 | |||
1197 | cmd_end |
||
1198 | |||
1199 | display "Size ",/d,cmd_end-cmd_begin," bytes" |
||
1200 | |||
1201 | savebin "view.com",cmd_begin,cmd_end-cmd_begin |
||
1202 | |||
1474 | alone | 1203 | LABELSLIST "../../us/user.l",1 |