Subversion Repositories NedoOS

Rev

Rev 1536 | Details | Compare with Previous | Last modification | View Log

Rev Author Line No. Line
8 dimkam 1
 
2
getmarkedfiles
3
;ix = panel
1518 alone 4
;out: dehl = markedfiles
8 dimkam 5
        ld l,(ix+PANEL.markedfiles)
6
        ld h,(ix+PANEL.markedfiles+1)
1518 alone 7
        ld de,0
8 dimkam 8
        ret
73 Alone 9
 
8 dimkam 10
changemark_hl
11
        push hl
12
        ld a,(hl)
13
        xor 1
14
        ld (hl),a
23 dimkam 15
        ld bc,FCB_FSIZE
8 dimkam 16
        add hl,bc
17
        ld e,(hl)
18
        inc hl
19
        ld d,(hl)
20
        inc hl
21
        ld c,(hl)
22
        inc hl
23
        ld b,(hl)
24
;bcde = file size
25
        ld l,(ix+PANEL.markedfiles)
26
        ld h,(ix+PANEL.markedfiles+1)
27
        inc hl
28
        jr nz,changemark_hlq ;set mark
631 alone 29
;remove mark
8 dimkam 30
        dec hl
31
        dec hl
32
        xor a
33
        sub e
34
        ld e,a
35
        ld a,0
36
        sbc a,d
37
        ld d,a
38
        ld a,0
39
        sbc a,c
40
        ld c,a
41
        sbc a,b
42
        sub c
43
        ld b,a ;bcde= -bcde
44
changemark_hlq
45
        ld a,(ix+PANEL.markedsize)
46
        add a,e
47
        ld (ix+PANEL.markedsize),a
48
        ld a,(ix+PANEL.markedsize+1)
49
        adc a,d
50
        ld (ix+PANEL.markedsize+1),a
51
        ld a,(ix+PANEL.markedsize+2)
52
        adc a,c
53
        ld (ix+PANEL.markedsize+2),a
54
        ld a,(ix+PANEL.markedsize+3)
55
        adc a,b
56
        ld (ix+PANEL.markedsize+3),a
57
        ld (ix+PANEL.markedfiles),l
58
        ld (ix+PANEL.markedfiles+1),h
59
        pop hl
60
        ret
61
 
62
getmarkedfilessize
63
;ix = panel
1518 alone 64
;out: dehl = markedfilessize
8 dimkam 65
        ld l,(ix+PANEL.markedsize)
66
        ld h,(ix+PANEL.markedsize+1)
1518 alone 67
        ld e,(ix+PANEL.markedsize+2)
68
        ld d,(ix+PANEL.markedsize+3)
8 dimkam 69
        ret
70
 
71
getfiles
72
;ix = panel
1518 alone 73
;out: dehl=files (without ".", "..")
8 dimkam 74
        ld l,(ix+PANEL.filesdirs)
75
        ld h,(ix+PANEL.filesdirs+1)
1518 alone 76
        ld de,0
8 dimkam 77
        ret
78
 
79
countfiles
80
        ld hl,proc_count
1518 alone 81
        jp processfiles ;hl=files (without ".", "..")
8 dimkam 82
proc_count
83
        inc iy
84
        ret
85
 
86
getfilessize
87
;ix = panel
88
        ld l,(ix+PANEL.totalsize)
89
        ld h,(ix+PANEL.totalsize+1)
1518 alone 90
        ld e,(ix+PANEL.totalsize+2)
91
        ld d,(ix+PANEL.totalsize+3)
92
        ret ;dehl=size
73 Alone 93
 
8 dimkam 94
processfiles
95
;ix = panel address (kept)
1518 alone 96
;hl = procedure address (uses hl=fcb, iy = accumulator)
97
;out: hl = result
8 dimkam 98
        ld (processfiles_proc),hl
190 demige 99
 
8 dimkam 100
        call nv_getpanelfiles_bc
190 demige 101
 
8 dimkam 102
        ld l,(ix+PANEL.pointers)
103
        ld h,(ix+PANEL.pointers+1)
1518 alone 104
        ;exx
105
        ;ld hl,0
106
        ;exx
8 dimkam 107
        ld iy,0
185 demige 108
processfiles0
8 dimkam 109
        ld a,b
110
        or c
111
        jr z,processfilesq
112
        push bc
73 Alone 113
        call getfilepointer_de_fromhl
185 demige 114
        push hl
190 demige 115
        push ix
8 dimkam 116
        ex de,hl
117
        call isthisdotdir_hl
118
processfiles_proc=$+1
1956 alone 119
        call nz,0 ;copy  ४ ࠭ (ᥩ  ४砥) ;४ਨ   ᯥ⥪ ;  CHDIR
120
;᪮  横 ॡࠥ  䠩  ॠ쭮 ४ਨ,   㦭 ࠭ ࠢ 稪 䠩
190 demige 121
        pop ix
8 dimkam 122
        pop hl
123
        pop bc
124
        dec bc
125
        jp processfiles0
126
processfilesq
1518 alone 127
         ;exx
128
         ;push hl
8 dimkam 129
        push iy
702 alone 130
       push ix
131
        call nv_batch ;ᯮ ,    nv_batch_pushrecord?
132
       pop ix
198 demige 133
        pop hl
1518 alone 134
         ;pop de
8 dimkam 135
        ret
136
 
73 Alone 137
gotofilepointer_numberde
138
        ld l,(ix+PANEL.pointers)
139
        ld h,(ix+PANEL.pointers+1)
140
        add hl,de
141
        add hl,de
142
        ret
143
 
144
getfilepointer_de_fromhl
145
;out: hl=next pointer
109 demige 146
        ld a,(ix+PANEL.poipg)
1410 alone 147
        SETPGC000
658 alone 148
        ld a,(hl)
149
        and 0xe0
150
        ld e,a
151
        xor (hl)
73 Alone 152
        inc hl
153
        ld d,(hl)
154
        inc hl
658 alone 155
        ;ld a,e
156
        ;and 31
109 demige 157
        add a,(ix+PANEL.pgadd)
158
        PGW3strpg
658 alone 159
        ;push af
160
        ;ld a,e
161
        ;and 0xe0
162
        ;ld e,a
163
        ;pop af
73 Alone 164
        ret
165
 
166
putfilepointer_de_tohl
167
;out: hl=next pointer
109 demige 168
        ld a,(ix+PANEL.poipg)
1410 alone 169
        SETPGC000
658 alone 170
        ld (hl),e
73 Alone 171
        inc hl
172
        ld (hl),d
173
        inc hl
174
        ret
175
 
176
swapfilepointers_hl_de
177
;out: hl=next pointer
109 demige 178
        ld a,(ix+PANEL.poipg)
1410 alone 179
        SETPGC000
73 Alone 180
        ld a,(de)
181
        ldi
182
        dec hl
183
        ld (hl),a
109 demige 184
        inc hl
73 Alone 185
        ld a,(de)
186
        ldi
187
        dec hl
188
        ld (hl),a
189
        inc hl
190
        ret
191
 
8 dimkam 192
isthisdotdir_hl
193
;out: z="." or ".."
194
        inc hl
195
        ld a,(hl)
196
        cp '.'
197
        dec hl
198
        ret
199
 
200
drawpanelfilesandsize
201
;ix=panel
202
        call nv_getpanelxy_de
1410 alone 203
        ;ld a,CONST_HGT_TABLE+1
204
        ld a,(filesperpanel)
205
        inc a
206
        add a,d
8 dimkam 207
        ld d,a
208
        inc e
209
        inc e
889 alone 210
        call nv_setxy ;keeps de,hl,ix
1518 alone 211
        ;ld de,_PANELDIRCOLOR;_PANELFILECOLOR
212
        ;call nv_setcolor
213
        call getmarkedfiles ;dehl
8 dimkam 214
        ld a,h
215
        or l
1518 alone 216
       push af ;z = no marked
8 dimkam 217
        call z,getfiles
1518 alone 218
        ;pop af
219
        ;push af
220
        push de
221
        ld de,_PANELDIRCOLOR
222
        jr z,$+5
574 alone 223
        ld de,_PANELSELECTCOLOR
1518 alone 224
        call nv_setcolor
225
        pop de
226
        ld bc,wordfiles
227
        call prdword_dehl_tobc;_withspaces
8 dimkam 228
        call getmarkedfilessize
1518 alone 229
       pop af ;z = no marked
230
        call z,getfilessize
231
        ld bc,wordbytes
232
        call prdword_dehl_tobc;_withspaces
8 dimkam 233
        push ix
658 alone 234
        ld hl,wordfiles;bytes
574 alone 235
         ld c,0
8 dimkam 236
        call prtext
237
        pop ix
238
        ret
239
 
240
nv_setxy
241
;de=yx (kept)
889 alone 242
;keeps de,hl,ix
8 dimkam 243
        push de
244
        push hl
245
        push ix
889 alone 246
        MYSETXY
8 dimkam 247
        pop ix
248
        pop hl
249
        pop de
250
        ret
667 alone 251
 
8 dimkam 252
setpanelcolor
574 alone 253
        ld de,_PANELCOLOR
8 dimkam 254
nv_setcolor
574 alone 255
;d=paper, e=ink
256
        push hl
8 dimkam 257
        push ix
841 alone 258
       if PRSTDIO
574 alone 259
        SETCOLOR_
841 alone 260
       else
261
        ;ld a,d
262
        ;add a,a
263
        ;add a,a
264
        ;add a,a
265
        ;add a,e
266
        ;ld e,a
267
        OS_SETCOLOR
268
       endif
8 dimkam 269
        pop ix
574 alone 270
        pop hl
8 dimkam 271
        ret
667 alone 272
 
8 dimkam 273
getfcbaddrundercursor
274
        call nv_getdirpos_hl
275
getfcbaddrunderhl
276
        ld ix,(curpanel)
73 Alone 277
        ;ld a,(ix+PANEL.pg)
1410 alone 278
        ;SETPGC000
73 Alone 279
        ex de,hl
667 alone 280
        call gotofilepointer_numberde ;hl=file pointer
73 Alone 281
        ;ld a,(hl)
282
        ;inc hl
283
        ;ld h,(hl)
284
        ;ld l,a ;hl=FCB
285
        call getfilepointer_de_fromhl
286
        ex de,hl ;hl=FCB
8 dimkam 287
        ret
667 alone 288
 
8 dimkam 289
getfcbundercursor
290
        call getfcbaddrundercursor
291
getfcbfromhl
292
        ld de,fcb
293
        ld bc,FCB_sz
294
        ldir
295
        ret
667 alone 296
 
8 dimkam 297
panelprtext
298
;print max 37 chars (dir)
299
;hl = text
300
;keeps ix
301
        push ix
302
panelprtext0
303
        ld a,(hl)
304
        or a
305
        jr z,panelprtextq
306
        push bc
307
        push hl
889 alone 308
        MYPRCHAR
8 dimkam 309
        pop hl
310
        pop bc
311
        inc c
312
        inc hl
313
        ld a,c
609 alone 314
        cp PANELDIRCHARS37
8 dimkam 315
        jp nz,panelprtext0
316
panelprtextq
317
        pop ix
318
        ret
319
 
320
changedir_fromfcb
321
        call setcurpaneldir
322
        ld hl,fcb_filename
323
        ld de,filenametext
324
        push de
325
        call cpmname_to_dotname
326
        pop de
327
        OS_CHDIR
328
        ret
608 alone 329
 
330
        if 1==0
8 dimkam 331
readfile_pages_dehl
332
        ld a,d
1410 alone 333
        SETPGC000
574 alone 334
        ld a,+(0xc000+PROGSTART)/256
8 dimkam 335
        call cmd_loadpage
336
        or a
337
        ret nz
338
 
339
        ld a,e
1410 alone 340
        SETPGC000
574 alone 341
        ld a,0xc000/256
8 dimkam 342
        call cmd_loadpage
343
        or a
344
        ret nz
345
 
346
        ld a,h
1410 alone 347
        SETPGC000
574 alone 348
        ld a,0xc000/256
8 dimkam 349
        call cmd_loadpage
350
        or a
351
        ret nz
352
 
353
        ld a,l
1410 alone 354
        SETPGC000
574 alone 355
        ld a,0xc000/256
8 dimkam 356
        jp cmd_loadpage
608 alone 357
        endif
8 dimkam 358
 
608 alone 359
readfile_pages_dehl
360
        ld a,d
1410 alone 361
        SETPGC000
608 alone 362
        ld a,0xc100/256
363
        call cmd_loadpage
364
        ret nz
365
        ld a,e
366
        call cmd_loadfullpage
367
        ret nz
368
        ld a,h
369
        call cmd_loadfullpage
370
        ret nz
371
        ld a,l
372
cmd_loadfullpage
1410 alone 373
        SETPGC000
608 alone 374
        ld a,0xc000/256
375
cmd_loadpage
376
;out: a=error, bc=bytes read
377
;keeps hl,de
378
        push de
379
        push hl
380
        ld d,a
381
        xor a
382
        ld l,a
383
        ld e,a
384
        sub d
385
        ld h,a ;de=buffer, hl=size
631 alone 386
        call readcurhandle
608 alone 387
        ld b,h
388
        ld c,l
389
        pop hl
390
        pop de
391
        or a
392
        ret
393
 
631 alone 394
readcurhandle
395
curhandle=$+1
396
        ld b,0
397
        OS_READHANDLE
398
        ret
399
 
8 dimkam 400
cmd_savepage
401
;hl=size
402
;out: a=error
608 alone 403
        ;push hl
574 alone 404
        ld de,0x8000
608 alone 405
        ;OS_SETDTA
406
        ;pop hl
407
        ;ld de,fcb2
408
        ;OS_FWRITE_NBYTES
409
        ld a,(curhandle)
410
        ld b,a
411
        OS_WRITEHANDLE
8 dimkam 412
        ret
600 alone 413
 
414
setdrawtablesneeded
1536 alone 415
        ld hl,leftpanel+PANEL.drawtableunneeded
416
        res 0,(hl)
417
        ld hl,rightpanel+PANEL.drawtableunneeded
418
        res 0,(hl)
600 alone 419
        ret
667 alone 420
 
421
 
8 dimkam 422
prtable
423
;de=yx
424
        ld hl,prbeginstroka
425
        call prtableline
671 alone 426
        push ix
1410 alone 427
        ;ld b,CONST_HGT_TABLE
428
        ld bc,(filesperpanel-1) ;b
667 alone 429
prtable0
8 dimkam 430
        inc d
671 alone 431
        ;ld hl,prmidstroka
432
        ;call prtableline
433
        push bc
434
        push de
889 alone 435
        call nv_setxy ;keeps de,hl,ix
671 alone 436
        ld de,tmidstroka
437
        ld hl,tmidstroka_sz
438
        call sendchars
439
        pop de
440
        pop bc
631 alone 441
        djnz prtable0
671 alone 442
        pop ix
8 dimkam 443
        inc d
444
        ld hl,prendstroka
1484 alone 445
        jp prtableline
8 dimkam 446
 
447
;;;;;;;;;;;;;;;;;;
671 alone 448
 
8 dimkam 449
cmdprchar
450
        push hl
451
        push ix
889 alone 452
        MYPRCHAR
8 dimkam 453
        pop ix
454
        pop hl
455
        ret
456
 
457
nv_getpanelxy_de
458
        ld e,(ix+PANEL.xy)
459
        ld d,(ix+PANEL.xy+1)
460
        ret
461
 
462
nv_getdirscroll_bc
463
        ld c,(ix+PANEL.dirscroll)
464
        ld b,(ix+PANEL.dirscroll+1)
465
        ret
466
nv_setdirscroll_bc
467
        ld (ix+PANEL.dirscroll),c
468
        ld (ix+PANEL.dirscroll+1),b
469
        ret
470
 
471
nv_getpanelfiles_bc
472
        ld c,(ix+PANEL.files)
473
        ld b,(ix+PANEL.files+1)
474
        ret
475
nv_getdirpos_hl
476
        ld l,(ix+PANEL.dirpos)
477
        ld h,(ix+PANEL.dirpos+1)
478
        ret
479
 
480
cpfiles_setdirpos
481
;hl=suggested dirpos (might be >= files)
482
;out: hl=dirpos
483
        call nv_getpanelfiles_bc
484
        dec bc
485
        call minhl_bc_tobc
486
        ld h,b
487
        ld l,c
488
nv_setdirpos_hl
489
        ld (ix+PANEL.dirpos),l
490
        ld (ix+PANEL.dirpos+1),h
491
        ret
492
nv_setdirpos_zero
493
        ld hl,0
494
        jr nv_setdirpos_hl
495
 
1410 alone 496
count_filecursor_logy
8 dimkam 497
;out: a=y, de=PANEL.xy
1410 alone 498
        ;call nv_getpanelxy_de
8 dimkam 499
        ld a,(ix+PANEL.dirpos)
500
        sub (ix+PANEL.dirscroll)
1410 alone 501
        ;add a,d;(ix+PANEL.xy+1) ;y
8 dimkam 502
        ret
503
 
504
setfilecursorxy
574 alone 505
        ;push af
8 dimkam 506
        ld ix,(curpanel)
1410 alone 507
        call nv_getpanelxy_de
508
        call count_filecursor_logy
509
        add a,d
8 dimkam 510
        ld d,a
511
        ;ld e,(ix+PANEL.xy)
512
        inc d
513
        inc e
574 alone 514
        ;pop af
515
        ;push af
1410 alone 516
        jp nv_setxy
574 alone 517
        ;pop af ;color
1410 alone 518
        ;ret
8 dimkam 519
 
584 alone 520
prfilecursor_reprintfile
521
;hl=color
646 alone 522
        push hl
523
        ;ex de,hl
524
        ;SETCOLOR_
584 alone 525
        call setfilecursorxy
526
        ld ix,(curpanel)
646 alone 527
        ;call getfcbaddrundercursor
528
        ;jp prdirfile
529
        call getfcbundercursor
530
        ld ix,fcb
531
        pop de
532
        jp prdirfile_ix_decolor
533
        ;push hl
534
        ;pop ix
535
        ;call prdirfile_copyfilename
536
        ;;ld ix,(curpanel)
537
        ;ld de,filelinebuf
538
        ;ld hl,8+1+3
539
        ;jp sendchars
584 alone 540
 
8 dimkam 541
prfilecursor
574 alone 542
;hl=color
543
        push hl
8 dimkam 544
        call setfilecursorxy
574 alone 545
        pop hl
546
        ld b,12
547
        call drawfilecursor_sizeb_colorhl ;hl=old color
8 dimkam 548
        ld ix,(curpanel)
549
        ret
550
 
551
editcmd_readprompt_setendcmdx
552
        ld ix,(curpanel)
553
        call setpaneldir_makeprompt ;->prompt
554
        ld hl,cmdbuf
555
        call strlen
556
        ld a,l
557
        ld (curcmdx),a
558
        ret
559
 
889 alone 560
getanotherpanel_hl
8 dimkam 561
getanotherpanel_ix
562
curpanel=$+1
563
        ld bc,leftpanel
564
        ld hl,0xffff&(leftpanel+rightpanel)
565
        or a
566
        sbc hl,bc
567
        push hl
568
        pop ix
569
        ret
658 alone 570
 
8 dimkam 571
setanotherpaneldir
572
        call getanotherpanel_ix
573
        jr setpaneldir
574
 
575
setcurpaneldir
576
        ld ix,(curpanel)
577
setpaneldir
578
;ix=panel
579
        push ix
580
        pop hl
581
        ld de,PANEL.dir
582
        add hl,de
583
        ex de,hl ;de=path
584
        OS_CHDIR
585
        ret
658 alone 586
 
889 alone 587
getcurpaneldir_hl
588
        ld hl,(curpanel)
589
        ld de,PANEL.dir
590
        add hl,de
591
        ret
592
 
574 alone 593
drawfilecursor_sizeb_colorhl
8 dimkam 594
;de=yx
574 alone 595
;hl=color
596
;b=size
841 alone 597
       if PRSTDIO
8 dimkam 598
        push bc
667 alone 599
        push hl
8 dimkam 600
        call nv_setxy
574 alone 601
        pop de
602
        SETCOLOR_
603
        call setcolor_invisible
604
        pop bc
605
        ld de,tspaces
606
        ld h,0
607
        ld l,b
608
        call sendchars
667 alone 609
        jp setcolor_visible
841 alone 610
       else
611
        ;ld a,d
612
        ;add a,a
613
        ;add a,a
614
        ;add a,a
615
        ;add a,e
616
        ;ld e,a
617
        ;OS_SETCOLOR
618
drawfilecursor_sizeb0
619
        push bc
620
        push de
621
        push hl ;color
889 alone 622
        MYSETXY
841 alone 623
        pop de ;color
624
        push de ;color
625
        OS_PRATTR
626
        pop hl ;color
627
        pop de
628
        pop bc
629
        inc e ;x
630
        djnz drawfilecursor_sizeb0
631
        ret
632
       endif
574 alone 633
 
8 dimkam 634
copy_to_fcb_filename
635
        ld de,fcb_filename
878 alone 636
;copy_to_defcb_filename
8 dimkam 637
        ld bc,11
638
        ldir
639
        ret
640
 
608 alone 641
nv_closehandle
642
;keep de and flags!!!
643
        push af
644
        push de
645
        ld a,(curhandle)
646
        ld b,a
647
        OS_CLOSEHANDLE
648
        pop de
649
        pop af
650
        ret
651
 
609 alone 652
tdoublehoriz
653
        ds PANELDIRCHARS37,0xcd
654
 
8 dimkam 655
prbeginstroka
574 alone 656
        db 0xc9;''
8 dimkam 657
        db 1
574 alone 658
        db 0xcd;'='
653 alone 659
        db 14;wdtcolumn1 
647 alone 660
        db 0xcd;0xd1;'T'
8 dimkam 661
        db 1
574 alone 662
        db 0xcd;'='
8 dimkam 663
        db 10;wdtcolumn2
574 alone 664
        db 0xd1;'T'
8 dimkam 665
        db 1
574 alone 666
        db 0xcd;'='
653 alone 667
        db 12;wdtcolumn3 
574 alone 668
        db 0xbb;''
8 dimkam 669
        db 1
670
        db 0
671
 
671 alone 672
tmidstroka
673
        db 0xba;''
841 alone 674
       if PRSTDIO
671 alone 675
        db 0x1b,"[25C"
676
        db 0xb3;''
677
        db 0x1b,"[12C"
841 alone 678
       else
679
        ds 25,' '
680
        db 0xb3;''
681
        ds 12,' '
682
       endif
671 alone 683
        db 0xba;''
684
tmidstroka_sz=$-tmidstroka
685
        if 1==0
8 dimkam 686
prmidstroka
574 alone 687
        db 0xba;''
8 dimkam 688
        db 1
689
        db ' '
653 alone 690
        db 14;wdtcolumn1 
646 alone 691
        db ' ';0xb3;''
8 dimkam 692
        db 1
693
        db ' '
694
        db 10;wdtcolumn2
574 alone 695
        db 0xb3;''
8 dimkam 696
        db 1
697
        db ' '
653 alone 698
        db 12;wdtcolumn3 
574 alone 699
        db 0xba;''
667 alone 700
        db 1
8 dimkam 701
        db 0
671 alone 702
        endif
8 dimkam 703
 
704
prendstroka
574 alone 705
        db 0xc8;'L'
8 dimkam 706
        db 1
574 alone 707
        db 0xcd;;'='
653 alone 708
        db 14;wdtcolumn1 
647 alone 709
        db 0xcd;0xcf;''
8 dimkam 710
        db 1
574 alone 711
        db 0xcd;'='
8 dimkam 712
        db 10;wdtcolumn2
574 alone 713
        db 0xcf;''
8 dimkam 714
        db 1
574 alone 715
        db 0xcd;'='
653 alone 716
        db 12;wdtcolumn3 
574 alone 717
        db 0xbc;'-'
667 alone 718
        db 1
8 dimkam 719
        db 0
654 alone 720
 
721
prcrlf
722
        ld de,tcrlf
723
        ld hl,2
724
        jp sendchars
725
tcrlf
726
        db 0x0d,0x0a
190 demige 727
 
841 alone 728
        if PRSTDIO==0
190 demige 729
nv_copyscreen0to1
1509 alone 730
        ;OS_GETMAINPAGES
731
        ;push hl
732
        ;...
733
        ;pop hl
734
        ;ld a,l
735
        ;SETPGC000
736
        ;ld a,h
737
        ;SETPG8000
555 alone 738
        ld a,(user_scr1_low) ;ok
1509 alone 739
        ld hl,(user_scr0_low) ;ok
740
        call nv_copypg ;pg l -> pg a
555 alone 741
        ld a,(user_scr1_high) ;ok
1509 alone 742
        ld hl,(user_scr0_high) ;ok
743
nv_copypg
744
;pg l -> pg a
745
        SETPGC000
190 demige 746
        ld a,l
1410 alone 747
        SETPG8000
190 demige 748
        ld hl,0x8000
749
        ld de,0xC000
750
        ld bc,0x4000
751
        ldir
1509 alone 752
        ret
190 demige 753
 
754
nv_copyscreen1to0
1509 alone 755
        ;OS_GETMAINPAGES
756
        ;push hl
757
        ;...
758
        ;pop hl
759
        ;ld a,l
760
        ;SETPGC000
761
        ;ld a,h
762
        ;SETPG8000
555 alone 763
        ld a,(user_scr0_low) ;ok
1509 alone 764
        ld hl,(user_scr1_low) ;ok
765
        call nv_copypg ;pg l -> pg a
555 alone 766
        ld a,(user_scr0_high) ;ok
1509 alone 767
        ld hl,(user_scr1_high) ;ok
768
        jr nv_copypg
841 alone 769
 
770
sendchars
771
;de=buf, hl=size, c=x
772
;out: A=error, c=x
773
sendchars0
774
        push bc
775
        push de
776
        push hl
777
        ld a,(de)
778
        PRCHAR
779
        pop hl
780
        pop de
781
        pop bc
782
        inc de
783
        inc c ;x
784
        dec l
785
        jr nz,sendchars0
786
        xor a ;no error
787
        ret
788
 
842 alone 789
clearrestofline_crlf
790
        ;call clearrestofline
791
        ;ld a,0x0d
792
        ;PRCHAR
793
        ;ld a,0x0a
794
        ;PRCHAR
795
        ;ret
841 alone 796
clearrestofline
797
;c=x
798
clearrestofline0
799
        push bc
800
        ld a,' '
801
        PRCHAR
802
        pop bc
803
        inc c
804
        ld a,c
805
        cp 80
806
        jr nz,clearrestofline0
807
        ret
808
 
1509 alone 809
        endif