Rev 2292 | Details | Compare with Previous | Last modification | View Log
Rev | Author | Line No. | Line |
---|---|---|---|
1386 | Kulich | 1 | |
1679 | kulich | 2 | MODULE TIME |
3 | PUBLIC time |
||
1464 | alone | 4 | #include "sysdefs.asm" |
5 | RSEG CODE |
||
6 | time: |
||
7 | push ix |
||
8 | push iy |
||
1510 | alone | 9 | ld c,CMD_GETTIMER ;out: dehl=timer |
1464 | alone | 10 | call BDOS |
1510 | alone | 11 | ld b,d |
12 | ld c,e |
||
1464 | alone | 13 | pop iy |
14 | pop ix |
||
15 | ret ;return bchl |
||
16 | ENDMOD |
||
17 | |||
1666 | kulich | 18 | |
19 | ;unsigned long OS_GETTIME (struct diskOp *); //out: ix=date, hl=time |
||
20 | |||
21 | |||
22 | MODULE OS_GETTIME |
||
23 | PUBLIC OS_GETTIME |
||
24 | #include "sysdefs.asm" |
||
25 | RSEG CODE |
||
26 | OS_GETTIME: |
||
27 | push ix |
||
28 | push iy |
||
29 | ld c,CMD_GETTIME ;out: ix=date, hl=time |
||
30 | call BDOS |
||
31 | di |
||
32 | push ix |
||
33 | pop bc |
||
34 | ei |
||
35 | pop iy |
||
36 | pop ix |
||
37 | ret ;return bchl |
||
38 | ENDMOD |
||
39 | |||
1386 | Kulich | 40 | MODULE ERRNOMOD |
41 | PUBLIC errno |
||
42 | RSEG NO_INIT |
||
43 | errno: |
||
44 | defs 1 |
||
45 | ENDMOD |
||
46 | |||
47 | MODULE MYGETCHAR |
||
48 | PUBLIC getchar |
||
49 | EXTERN _low_level_get |
||
50 | RSEG CODE |
||
51 | getchar: |
||
52 | call _low_level_get |
||
53 | or a |
||
54 | jr z,getchar |
||
55 | ld l,a |
||
56 | ld h,0 |
||
57 | ret |
||
58 | ENDMOD |
||
59 | |||
60 | MODULE OS_RESERV_1 |
||
61 | PUBLIC os_reserv_1 |
||
62 | #include "sysdefs.asm" |
||
63 | RSEG CODE |
||
64 | os_reserv_1: |
||
65 | push bc |
||
66 | push ix |
||
67 | push iy |
||
68 | ld c,CMD_RESERV_1 |
||
69 | call BDOS |
||
70 | pop iy |
||
71 | pop ix |
||
72 | pop bc |
||
73 | ret |
||
74 | ENDMOD |
||
75 | |||
76 | MODULE SCRREDRAW |
||
77 | PUBLIC scrredraw |
||
78 | RSEG CODE |
||
79 | scrredraw: |
||
80 | xor a |
||
81 | ret |
||
82 | ENDMOD |
||
83 | |||
84 | MODULE OSLOWGET |
||
85 | PUBLIC bdosgetkey |
||
86 | EXTERN scrredraw,exit,YIELD |
||
87 | #include "sysdefs.asm" |
||
88 | RSEG CODE |
||
89 | bdosgetkey: |
||
90 | push de |
||
91 | push bc |
||
92 | push ix |
||
93 | push iy |
||
94 | ld c,CMD_YIELD |
||
95 | call BDOS |
||
96 | rst 0x08 |
||
97 | cp key_esc |
||
98 | jp z,exit |
||
99 | cp key_redraw |
||
100 | call z,scrredraw |
||
101 | ld l,a |
||
102 | ld h,0 |
||
103 | pop iy |
||
104 | pop ix |
||
105 | pop bc |
||
106 | pop de |
||
107 | ret |
||
108 | ENDMOD |
||
109 | |||
110 | MODULE conv1251to866 |
||
111 | PUBLIC conv1251to866, t1251to866 |
||
112 | RSEG CODE |
||
113 | conv1251to866: ;DE-string |
||
114 | push de |
||
115 | ploop: |
||
116 | ld a,(de) |
||
117 | or a |
||
118 | jr z,pexit |
||
119 | cp 128 |
||
120 | jr c,asci |
||
121 | add a,low(t1251to866-128) |
||
122 | ld l,a |
||
123 | ld a,0 |
||
124 | adc a,high(t1251to866-128) |
||
125 | ld h,a |
||
126 | ld a,(hl) |
||
127 | ld (de),a |
||
128 | asci: |
||
129 | inc de |
||
130 | jr ploop |
||
131 | pexit: |
||
132 | pop de |
||
133 | ret |
||
134 | RSEG CONST |
||
135 | t1251to866: |
||
136 | DEFB 0x3F, 0x3F, 0x27, 0x3F, 0x22, 0x3A, 0xC5, 0xD8, 0x3F, 0x25, 0x3F, 0x3C, 0x3F, 0x3F, 0x3F, 0x3F |
||
137 | DEFB 0x30, 0x3F, 0x27, 0x27, 0x22, 0x22, 0x07, 0x2D, 0x2D, 0x54, 0x3F, 0x3E, 0x3F, 0x3F, 0x3F, 0x3F |
||
138 | DEFB 0xFF, 0xF6, 0xF7, 0x3F, 0xFD, 0x3F, 0xB3, 0x15, 0xF0, 0x63, 0xF2, 0x3C, 0xBF, 0x2D, 0x52, 0xF4 |
||
139 | DEFB 0xF8, 0x2B, 0x3F, 0x3F, 0x3F, 0xE7, 0x14, 0xFA, 0xF1, 0xFC, 0xF3, 0x3E, 0x3F, 0x3F, 0x3F, 0xF5 |
||
140 | DEFB 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F |
||
141 | DEFB 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F |
||
142 | DEFB 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF |
||
143 | DEFB 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF |
||
144 | ENDMOD |
||
145 | |||
146 | MODULE YIELD |
||
147 | PUBLIC YIELD |
||
148 | #include "sysdefs.asm" |
||
149 | RSEG CODE |
||
150 | YIELD: |
||
151 | push bc |
||
152 | push de |
||
153 | push ix |
||
154 | push iy |
||
155 | ld c,CMD_YIELD |
||
156 | call BDOS |
||
157 | pop iy |
||
158 | pop ix |
||
159 | pop de |
||
160 | pop bc |
||
161 | ret |
||
162 | ENDMOD |
||
163 | |||
164 | MODULE SETMUSIC |
||
165 | PUBLIC OS_SETMUSIC |
||
166 | #include "sysdefs.asm" |
||
167 | RSEG CODE |
||
168 | OS_SETMUSIC: ;DE - proc_ptr, A - ? |
||
169 | ld h,d |
||
170 | ld l,e |
||
171 | ld a,c |
||
172 | ex af,af' |
||
173 | push ix |
||
174 | push iy |
||
175 | ld c,CMD_SETMUSIC ;hl=muzaddr (0x4000..0x7fff), a=muzpg |
||
176 | call BDOS |
||
177 | pop iy |
||
178 | pop ix |
||
179 | ret |
||
180 | ENDMOD |
||
181 | |||
182 | MODULE OSGETCONFIG |
||
183 | PUBLIC OS_GETCONFIG |
||
184 | #include "sysdefs.asm" |
||
185 | RSEG CODE |
||
186 | OS_GETCONFIG: |
||
187 | push bc |
||
188 | ld c,CMD_GETCONFIG |
||
189 | push de |
||
190 | push ix |
||
191 | push iy |
||
192 | call BDOS |
||
193 | pop iy |
||
194 | pop ix |
||
195 | pop de |
||
196 | pop bc |
||
197 | ret |
||
198 | ENDMOD |
||
199 | |||
200 | MODULE GETMAINPAGES |
||
201 | PUBLIC OS_GETMAINPAGES,OS_GETAPPMAINPAGES |
||
202 | EXTERN errno |
||
203 | #include "sysdefs.asm" |
||
204 | RSEG CODE |
||
205 | OS_GETAPPMAINPAGES: |
||
206 | ld c,CMD_GETAPPMAINPAGES |
||
207 | jr l1 |
||
208 | OS_GETMAINPAGES: |
||
209 | ld c,CMD_GETMAINPAGES |
||
210 | l1 |
||
211 | push de |
||
1814 | kulich | 212 | push ix |
1386 | Kulich | 213 | push iy |
1814 | kulich | 214 | call BDOS |
215 | ld b,d ;out: d,e,h,l=pages in 0000,4000,8000,c000, c=flags, a=error |
||
1386 | Kulich | 216 | ld c,e |
217 | pop iy |
||
218 | pop ix |
||
1814 | kulich | 219 | pop de |
220 | LD (errno), a |
||
1386 | Kulich | 221 | ret |
222 | ENDMOD |
||
223 | |||
224 | MODULE SETPG32KHIGH |
||
225 | PUBLIC SETPG32KHIGH |
||
226 | #include "sysdefs.asm" |
||
227 | RSEG CODE |
||
228 | SETPG32KHIGH: |
||
229 | push bc |
||
230 | push ix |
||
231 | push iy |
||
232 | ld a,e |
||
233 | rst 0x28 |
||
234 | pop iy |
||
235 | pop ix |
||
236 | pop bc |
||
237 | ret |
||
238 | ENDMOD |
||
1814 | kulich | 239 | |
2281 | kulich | 240 | MODULE OS_SETSCREEN |
241 | PUBLIC OS_SETSCREEN |
||
242 | #include "sysdefs.asm" |
||
243 | RSEG CODE |
||
244 | OS_SETSCREEN: |
||
2292 | kulich | 245 | ;halt |
2281 | kulich | 246 | push bc |
247 | push hl |
||
248 | push ix |
||
249 | push iy |
||
250 | ld c,CMD_SETSCREEN ;e=screen=0..1 |
||
251 | call BDOS |
||
252 | pop iy |
||
253 | pop ix |
||
254 | pop hl |
||
255 | pop bc |
||
256 | ret |
||
257 | ENDMOD |
||
258 | |||
2279 | kulich | 259 | MODULE OS_SETPG8000 |
260 | PUBLIC OS_SETPG8000 |
||
261 | #include "sysdefs.asm" |
||
262 | RSEG CODE |
||
263 | OS_SETPG8000: |
||
264 | push bc |
||
265 | push ix |
||
266 | push iy |
||
267 | ld a,e |
||
268 | rst 0x20 |
||
269 | pop iy |
||
270 | pop ix |
||
271 | pop bc |
||
272 | ret |
||
273 | ENDMOD |
||
274 | |||
1386 | Kulich | 275 | MODULE MAIN_ARGS |
276 | PUBLIC main_args |
||
277 | RSEG CODE |
||
278 | main_args |
||
279 | ld hl,args |
||
280 | ld de,0x0080 |
||
281 | get_cmd_args_l2 |
||
282 | ld (hl),e |
||
283 | inc hl |
||
284 | ld (hl),d |
||
285 | inc hl |
||
286 | dec de |
||
287 | get_cmd_args_l |
||
288 | inc de |
||
289 | ld a,(de) |
||
290 | or a |
||
291 | jr z,get_cmd_args_end |
||
292 | cp ' ' |
||
293 | jr nz,get_cmd_args_l |
||
294 | xor a |
||
295 | ld (de),a |
||
296 | skipspaces |
||
297 | inc de |
||
298 | ld a,(de) |
||
299 | or a |
||
300 | jr z,get_cmd_args_end |
||
301 | cp ' ' |
||
302 | jr nz,get_cmd_args_l2 |
||
303 | jr skipspaces |
||
304 | get_cmd_args_end: |
||
305 | ld bc,args |
||
306 | sbc hl,bc |
||
307 | ex de,hl |
||
308 | srl e |
||
309 | ret |
||
310 | RSEG NO_INIT |
||
311 | args: |
||
312 | defs 32 |
||
313 | ENDMOD |
||
314 | |||
315 | |||
316 | MODULE OSDROPAPP |
||
317 | PUBLIC OS_DROPAPP |
||
318 | #include "sysdefs.asm" |
||
319 | RSEG CODE |
||
320 | OS_DROPAPP: ;e=id ; hl=result |
||
321 | ld c,CMD_DROPAPP |
||
322 | push ix |
||
323 | push iy |
||
324 | call BDOS |
||
325 | pop iy |
||
326 | pop ix |
||
327 | ret |
||
328 | ENDMOD |
||
329 | |||
1684 | kulich | 330 | MODULE OS_SETGFX |
331 | PUBLIC OS_SETGFX |
||
332 | #include "sysdefs.asm" |
||
333 | RSEG CODE |
||
2292 | kulich | 334 | OS_SETGFX: ;e=0:EGA, e=2:MC, e=3:6912, e=6:text ;+SET FOCUS ;e=-1: disable gfx (out: e=old gfxmode) |
2281 | kulich | 335 | push bc |
1684 | kulich | 336 | push hl |
337 | push ix |
||
338 | push iy |
||
339 | ld c,CMD_SETGFX |
||
2281 | kulich | 340 | halt |
1684 | kulich | 341 | call BDOS |
342 | pop iy |
||
343 | pop ix |
||
344 | pop hl |
||
345 | pop bc |
||
2292 | kulich | 346 | ld a, e |
1684 | kulich | 347 | ret |
348 | ENDMOD |
||
1386 | Kulich | 349 | |
350 | MODULE OSGETPAGEOWNER ;e=page ;out: e=owner id (0=free, 0xff=system) |
||
351 | PUBLIC OS_GETPAGEOWNER |
||
352 | #include "sysdefs.asm" |
||
353 | RSEG CODE |
||
354 | OS_GETPAGEOWNER: |
||
355 | push bc |
||
356 | push ix |
||
357 | push iy |
||
2292 | kulich | 358 | ld c,CMD_GETPAGEOWNER |
1386 | Kulich | 359 | call BDOS |
360 | LD a, e |
||
361 | pop iy |
||
362 | pop ix |
||
363 | pop bc |
||
364 | ret |
||
365 | ENDMOD |
||
366 | |||
367 | MODULE my_im2 |
||
368 | PUBLIC my_im2_init |
||
369 | RSEG INTJP |
||
370 | DEFS 3 |
||
371 | RSEG INTTABLE |
||
372 | DEFS 257 |
||
373 | RSEG CODE |
||
374 | my_im2_init |
||
375 | di |
||
376 | ld a,0xc3 |
||
377 | ld (SFB(INTJP)),a |
||
378 | ld (SFB(INTJP)+1),de |
||
379 | ld a,HIGH(SFB(INTTABLE)) |
||
380 | ld i,a |
||
381 | inc a |
||
382 | ld hl,SFB(INTTABLE)-1 |
||
383 | tloop |
||
384 | inc hl |
||
385 | ld (hl),HIGH(SFB(INTJP)) |
||
386 | cp h |
||
387 | jr nz,tloop |
||
388 | im 2 |
||
389 | ret |
||
390 | ENDMOD |
||
391 | |||
1679 | kulich | 392 | ;Kulich Area |
1386 | Kulich | 393 | |
1679 | kulich | 394 | MODULE OS_NEWPAGE ;out: a=0 (OK)/!=0 (fail), e=page |
395 | PUBLIC OS_NEWPAGE |
||
396 | #include "sysdefs.asm" |
||
397 | RSEG CODE |
||
398 | OS_NEWPAGE: |
||
399 | push bc |
||
400 | ld c,CMD_NEWPAGE |
||
401 | push ix |
||
402 | push iy |
||
403 | call BDOS |
||
404 | pop iy |
||
405 | pop ix |
||
406 | pop bc |
||
407 | ld h,a ;error |
||
408 | ld l,e ;page |
||
409 | ret |
||
410 | ENDMOD |
||
1386 | Kulich | 411 | |
2279 | kulich | 412 | MODULE OS_DELPAGE ;out: a=0 (OK)/!=0 (fail), e=page |
413 | PUBLIC OS_DELPAGE |
||
414 | #include "sysdefs.asm" |
||
415 | RSEG CODE |
||
416 | OS_DELPAGE: |
||
417 | push bc |
||
418 | push hl |
||
419 | ld c,CMD_DELPAGE |
||
420 | push ix |
||
421 | push iy |
||
422 | call BDOS |
||
423 | pop iy |
||
424 | pop ix |
||
425 | pop hl |
||
426 | pop bc |
||
427 | ret |
||
428 | ENDMOD |
||
1767 | kulich | 429 | |
2279 | kulich | 430 | MODULE OS_GETSCR0 |
431 | PUBLIC OS_GETSCR0 |
||
432 | #include "sysdefs.asm" |
||
433 | RSEG CODE |
||
434 | OS_GETSCR0: |
||
435 | |||
436 | |||
437 | ld a,(user_scr0_high) |
||
438 | ld h,a |
||
439 | ld a,(user_scr0_low) |
||
440 | ld l, a |
||
441 | ret |
||
442 | ENDMOD |
||
443 | |||
444 | MODULE OS_GETSCR1 |
||
445 | PUBLIC OS_GETSCR1 |
||
446 | #include "sysdefs.asm" |
||
447 | RSEG CODE |
||
448 | OS_GETSCR1: |
||
449 | ld a,(user_scr1_high) |
||
450 | ld h,a |
||
451 | ld a,(user_scr1_low) |
||
452 | ld l,a |
||
453 | ret |
||
454 | ENDMOD |
||
455 | |||
1767 | kulich | 456 | MODULE OS_RENAME |
457 | PUBLIC OS_RENAME |
||
458 | #include "sysdefs.asm" |
||
459 | RSEG CODE |
||
460 | OS_RENAME: |
||
461 | ; ld de, oldname |
||
462 | ; ld bc, newname |
||
463 | ld h,b |
||
464 | ld l,c |
||
465 | push ix |
||
466 | push iy |
||
467 | ld c,CMD_RENAME |
||
468 | call BDOS |
||
469 | pop iy |
||
470 | pop ix |
||
471 | ret |
||
472 | ENDMOD |
||
473 | |||
2279 | kulich | 474 | MODULE OS_SETBORDER |
475 | PUBLIC OS_SETBORDER |
||
476 | #include "sysdefs.asm" |
||
477 | RSEG CODE |
||
478 | OS_SETBORDER: |
||
2281 | kulich | 479 | push bc |
2279 | kulich | 480 | push hl |
481 | push ix |
||
482 | push iy |
||
483 | ld c,CMD_SETBORDER ;e=0..15 |
||
484 | call BDOS |
||
485 | pop iy |
||
486 | pop ix |
||
487 | pop hl |
||
488 | pop bc |
||
489 | ret |
||
490 | ENDMOD |
||
491 | |||
1768 | kulich | 492 | MODULE OS_DELETE |
493 | PUBLIC OS_DELETE |
||
494 | #include "sysdefs.asm" |
||
495 | RSEG CODE |
||
496 | OS_DELETE: |
||
497 | push bc |
||
498 | push ix |
||
499 | push iy |
||
500 | ld c,CMD_DELETE |
||
501 | call BDOS |
||
502 | pop iy |
||
503 | pop ix |
||
504 | pop bc |
||
505 | ld h,0 |
||
506 | ld l,a |
||
507 | ret |
||
508 | ENDMOD |
||
509 | |||
510 | |||
511 | |||
512 | |||
513 | |||
1386 | Kulich | 514 | MODULE OS_READSECTORS ;de= pointer to diskOp structure |
515 | PUBLIC OS_READSECTORS |
||
516 | #include "sysdefs.asm" |
||
517 | RSEG CODE |
||
518 | OS_READSECTORS: |
||
519 | push bc |
||
520 | push de |
||
521 | push ix |
||
522 | push iy |
||
523 | |||
524 | ex de,hl |
||
525 | ld b,(hl) ;drive |
||
526 | inc l |
||
527 | ld e,(hl) ;buffer L |
||
528 | inc l |
||
529 | ld d,(hl) ;buffer H |
||
530 | inc l |
||
531 | push de |
||
532 | ld e,(hl) ;sector L |
||
533 | inc l |
||
534 | ld d,(hl) ;sector H |
||
535 | inc l |
||
536 | ld a,(hl) ;sector X |
||
537 | ld ixl,a |
||
538 | inc l |
||
539 | ld a,(hl) ;sector I |
||
540 | ld ixh,a |
||
541 | inc l |
||
542 | ld a,(hl) ;count |
||
543 | pop hl |
||
544 | ex de,hl |
||
545 | ld c,CMD_READSECTORS |
||
546 | ex af,af' ;' |
||
547 | call BDOS ;c=CMD |
||
548 | pop iy |
||
549 | pop ix |
||
550 | pop de |
||
551 | pop bc |
||
552 | ret ;BCHL |
||
553 | ENDMOD |
||
554 | |||
555 | MODULE OS_WRITESECTORS ;de= pointer to diskOp structure |
||
556 | PUBLIC OS_WRITESECTORS |
||
557 | #include "sysdefs.asm" |
||
558 | RSEG CODE |
||
559 | OS_WRITESECTORS: |
||
560 | push bc |
||
561 | push de |
||
562 | push ix |
||
563 | push iy |
||
564 | |||
565 | ex de,hl |
||
566 | ld b,(hl) ;drive |
||
567 | inc l |
||
568 | ld e,(hl) ;buffer L |
||
569 | inc l |
||
570 | ld d,(hl) ;buffer H |
||
571 | inc l |
||
572 | push de |
||
573 | ld e,(hl) ;sector L |
||
574 | inc l |
||
575 | ld d,(hl) ;sector H |
||
576 | inc l |
||
577 | ld a,(hl) ;sector X |
||
578 | ld ixl,a |
||
579 | inc l |
||
580 | ld a,(hl) ;sector I |
||
581 | ld ixh,a |
||
582 | inc l |
||
583 | ld a,(hl) ;count |
||
584 | pop hl |
||
585 | ex de,hl |
||
586 | ld c,CMD_WRITESECTORS |
||
587 | ex af,af' ;' |
||
588 | call BDOS ;c=CMD |
||
1679 | kulich | 589 | pop iy |
590 | pop ix |
||
591 | pop de |
||
592 | pop bc |
||
593 | ret ;BCHL |
||
594 | ENDMOD |
||
1386 | Kulich | 595 | |
1679 | kulich | 596 | MODULE OS_GETPATH |
597 | PUBLIC OS_GETPATH |
||
598 | #include "sysdefs.asm" |
||
599 | RSEG CODE |
||
600 | OS_GETPATH: |
||
601 | push bc |
||
602 | push ix |
||
603 | push iy |
||
604 | ld c,CMD_GETPATH |
||
605 | call BDOS |
||
1386 | Kulich | 606 | pop iy |
607 | pop ix |
||
1679 | kulich | 608 | pop bc |
609 | ld hl,0 |
||
610 | ret |
||
611 | ENDMOD |
||
612 | |||
613 | MODULE OS_SETSYSDRV |
||
614 | PUBLIC OS_SETSYSDRV |
||
615 | #include "sysdefs.asm" |
||
616 | RSEG CODE |
||
617 | OS_SETSYSDRV |
||
618 | push bc |
||
619 | push de |
||
620 | push ix |
||
621 | push iy |
||
622 | ld c,CMD_SETSYSDRV ; out: A: A!=0 -- системный диск не примонтирован. L: -- общее количество примонтированных дисков. |
||
623 | call BDOS |
||
624 | pop iy |
||
625 | pop ix |
||
1386 | Kulich | 626 | pop de |
627 | pop bc |
||
1679 | kulich | 628 | ld h,a ;h = error l = No of disks |
629 | ret |
||
630 | ENDMOD |
||
631 | |||
632 | MODULE OS_CHDIR |
||
633 | PUBLIC OS_CHDIR |
||
634 | #include "sysdefs.asm" |
||
635 | RSEG CODE |
||
636 | OS_CHDIR: |
||
637 | push bc |
||
638 | push ix |
||
639 | push iy |
||
640 | ld c,CMD_CHDIR ;DE = Pointer to ASCIIZ string. Out A=error |
||
641 | call BDOS |
||
642 | pop iy |
||
643 | pop ix |
||
644 | pop bc |
||
645 | ld l,0 |
||
646 | ld h,a ;h = error |
||
647 | ret |
||
648 | ENDMOD |
||
649 | |||
1775 | kulich | 650 | |
1679 | kulich | 651 | MODULE OS_NEWAPP |
652 | PUBLIC OS_NEWAPP |
||
653 | #include "sysdefs.asm" |
||
654 | RSEG CODE |
||
655 | OS_NEWAPP: |
||
656 | push bc |
||
657 | ld (strPtr), de |
||
658 | push ix |
||
659 | push iy |
||
660 | ld c,CMD_NEWAPP ;out: b=id, a=error, dehl=newapp pages in 0000,4000,8000,c000 ;MAKE NEW DISABLED APP |
||
661 | call BDOS |
||
662 | pop iy |
||
663 | pop ix |
||
664 | ld c,a |
||
665 | push hl |
||
666 | ld hl,(strPtr) |
||
667 | ld (hl),d |
||
668 | inc hl |
||
669 | ld (hl),e |
||
670 | pop hl |
||
671 | ex de,hl |
||
672 | ld hl,(strPtr) |
||
673 | inc hl |
||
674 | inc hl |
||
675 | ld (hl),d |
||
676 | inc hl |
||
677 | ld (hl),e |
||
678 | inc hl |
||
679 | ld (hl),b |
||
680 | inc hl |
||
681 | ld (hl),c |
||
682 | pop bc |
||
683 | ret |
||
684 | strPtr |
||
685 | DEFW 0000 |
||
686 | ENDMOD |
||
687 | |||
688 | MODULE OS_RUNAPP |
||
689 | PUBLIC OS_RUNAPP |
||
690 | #include "sysdefs.asm" |
||
691 | RSEG CODE |
||
692 | OS_RUNAPP: |
||
693 | push hl |
||
694 | push bc |
||
695 | push ix |
||
696 | push iy |
||
697 | ld c,CMD_RUNAPP ;e=id ;ACTIVATE DISABLED APP |
||
698 | call BDOS |
||
699 | pop iy |
||
700 | pop ix |
||
701 | pop bc |
||
702 | pop hl |
||
703 | ret |
||
704 | ENDMOD |
||
705 | |||
706 | MODULE OS_WAITPID |
||
707 | PUBLIC OS_WAITPID |
||
708 | #include "sysdefs.asm" |
||
709 | RSEG CODE |
||
710 | OS_WAITPID: |
||
711 | push bc |
||
712 | push ix |
||
713 | push iy |
||
714 | ld c,CMD_SETWAITING |
||
715 | call BDOS |
||
716 | ld c,CMD_YIELD |
||
717 | call BDOS |
||
718 | ld c,CMD_GETCHILDRESULT |
||
719 | call BDOS |
||
720 | pop iy |
||
721 | pop ix |
||
722 | pop bc |
||
723 | ret |
||
724 | ENDMOD |
||
725 | |||
1684 | kulich | 726 | |
727 | |||
728 | |||
729 | MODULE OS_HIDEFROMPARENT |
||
730 | PUBLIC OS_HIDEFROMPARENT |
||
731 | #include "sysdefs.asm" |
||
732 | RSEG CODE |
||
733 | OS_HIDEFROMPARENT: |
||
734 | push bc |
||
735 | push ix |
||
736 | push iy |
||
737 | ld c,CMD_HIDEFROMPARENT |
||
738 | call BDOS |
||
739 | pop iy |
||
740 | pop ix |
||
741 | pop bc |
||
742 | ret |
||
743 | ENDMOD |
||
744 | |||
1679 | kulich | 745 | MODULE OS_CLS |
746 | PUBLIC OS_CLS |
||
747 | #include "sysdefs.asm" |
||
748 | RSEG CODE |
||
749 | OS_CLS: |
||
750 | push bc |
||
1684 | kulich | 751 | push hl |
1679 | kulich | 752 | push ix |
753 | push iy |
||
754 | ld c,CMD_CLS |
||
755 | call BDOS |
||
756 | pop iy |
||
757 | pop ix |
||
758 | pop bc |
||
1684 | kulich | 759 | pop hl |
1679 | kulich | 760 | ret |
1814 | kulich | 761 | ENDMOD |
1679 | kulich | 762 | |
2046 | kulich | 763 | |
764 | |||
765 | MODULE OS_GETKEY |
||
766 | PUBLIC OS_GETKEY |
||
767 | RSEG CODE |
||
768 | OS_GETKEY: |
||
769 | push ix |
||
770 | push iy |
||
771 | rst 0x08 ;out: a=key (NOKEY=no key), de=mouse position (y,x), l=mouse buttons (bits 0,1,2: 0=pressed)+mouse wheel (bits 7..4), h=high bits of key|register, bc=keynolang, lx=kempston joystick, nz=no focus (mouse position=0, ignore it!) |
||
772 | pop iy |
||
773 | pop ix |
||
774 | ld l,a |
||
775 | ld h,c |
||
776 | ld bc,0x8000 |
||
777 | jp nz, focusFalse |
||
778 | ld bc,0x0000 |
||
779 | focusFalse: |
||
2184 | kulich | 780 | ret |
2046 | kulich | 781 | ENDMOD |
782 | |||
2121 | kulich | 783 | MODULE OS_GETMOUSE |
784 | PUBLIC OS_GETMOUSE |
||
785 | RSEG CODE |
||
786 | OS_GETMOUSE: |
||
787 | push ix |
||
788 | push iy |
||
789 | rst 0x08 ;out: a=key (NOKEY=no key), de=mouse position (y,x), l=mouse buttons (bits 0,1,2: 0=pressed)+mouse wheel (bits 7..4), h=high bits of key|register, bc=keynolang, lx=kempston joystick, nz=no focus (mouse position=0, ignore it!) |
||
790 | pop iy |
||
791 | pop ix |
||
2129 | kulich | 792 | ld h,c |
2121 | kulich | 793 | ld b,d |
794 | ld c,e |
||
2129 | kulich | 795 | ret |
2121 | kulich | 796 | ENDMOD |
797 | |||
798 | MODULE OS_SETCOLOR |
||
799 | PUBLIC OS_SETCOLOR |
||
800 | #include "sysdefs.asm" |
||
801 | RSEG CODE |
||
802 | OS_SETCOLOR |
||
803 | push bc |
||
804 | push hl |
||
805 | push ix |
||
806 | push iy |
||
807 | ld c,CMD_SETCOLOR |
||
808 | call BDOS |
||
809 | pop iy |
||
810 | pop ix |
||
811 | pop bc |
||
812 | pop hl |
||
813 | ret |
||
814 | ENDMOD |
||
815 | |||
1814 | kulich | 816 | MODULE OS_DIHALT |
817 | PUBLIC OS_DIHALT |
||
818 | RSEG CODE |
||
819 | OS_DIHALT: |
||
820 | DI |
||
821 | HALT |
||
822 | ret |
||
823 | //ENDMOD |
||
1386 | Kulich | 824 | END |
825 |