Subversion Repositories NedoOS

Rev

Rev 671 | Rev 842 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download

  1. prwindow_edit
  2. ;hl=window DE=texteditaddr c=texteditsize
  3. ;out: CY=OK, de=filename
  4.         push de
  5.         push bc
  6.         call prwindow_text ;de=YX of last line
  7.         pop bc
  8.         pop hl
  9.         push hl
  10.         ld a,c ;a=maxsz
  11.         call editline
  12.         pop de ;de=filename
  13.         cp key_esc
  14.         ret z ;cancel
  15.         scf
  16.         ret
  17.  
  18. prwindow_waitkey
  19. ;hl=window
  20. ;out: CY=OK
  21. ;        ld (prwindow_waitkey_addr),hl; commented by demige 190511
  22.         call prwindow_text; insert by demige 190511
  23. ; comment by demige 190511: for why reprinting window after each keypress? On second print getmarkedfiles returns wrong value.
  24. prwindow_waitkey0
  25. ;prwindow_waitkey_addr=$+1 ; comment by demige 190511
  26. ;        ld hl,0 ; comment by demige 190511
  27. ;        call prwindow_text ; comment by demige 190511
  28.         call yieldgetkeyloop ;YIELDGETKEYLOOP
  29.         ld a,c
  30.         cp key_esc
  31.         ret z
  32.         cp 'n'
  33.         ret z
  34.         ;cp 'N'
  35.         ;ret z
  36.         cp key_redraw
  37.         ret z
  38.         cp 'y'
  39.         jr z, prwindow_waitkey_keyyes
  40.         ;cp 'Y'
  41.         ;jr z, prwindow_waitkey_keyyes
  42.         cp key_enter
  43.         jr nz,prwindow_waitkey0
  44. prwindow_waitkey_keyyes
  45.         scf
  46.         ret
  47.  
  48. upwindow_text
  49.         ld a,0
  50.         jr prwindow_text0
  51.  
  52. prwindow_text
  53.         ld a,1
  54. prwindow_text0
  55. ;hl = window text
  56. ;out: ;de=YX of last line
  57.         ld e,(hl) ;x
  58.         inc hl
  59.         ld d,(hl) ;y
  60.         inc hl
  61.         ld c,(hl) ;wid
  62.         inc hl
  63.         ld b,(hl) ;hgt
  64.         inc hl
  65.  
  66.         push hl ;text
  67.  
  68.         push de
  69.         or a
  70.         call nz,prwin
  71.         pop de
  72.         inc d
  73.         inc e
  74.         inc e
  75.         call nv_setxy ;keeps de,hl
  76.        
  77.         pop hl ;text
  78. prwindow_waitkey_text0
  79.         ld a,(hl)
  80.         or a
  81.         ret z
  82.         dec a;cp 1
  83.         jr z,prwindow_waitkey_textnfiles
  84.         dec a;cp 2
  85.         jr z,prwindow_waitkey_textoutertext
  86.         dec a;cp 3
  87.         jr z,prwindow_waitkey_textnextline
  88.         push de
  89.          ld c,0
  90.         call prtext
  91.         pop de
  92.         jr prwindow_waitkey_text0
  93. prwindow_waitkey_textnfiles
  94.         inc hl
  95.         push de
  96.         push hl
  97.         call getmarkedfiles;countmarkedfiles
  98.         call prdword
  99.         pop hl
  100.         pop de
  101.         jr prwindow_waitkey_text0
  102. prwindow_waitkey_textoutertext
  103.         inc hl
  104.         push de
  105.         ld e,(hl)
  106.         inc hl
  107.         ld d,(hl)
  108.         inc hl
  109.         push hl
  110.         ex de,hl
  111.          ld c,0
  112.         call prtext
  113.         pop hl
  114.         pop de
  115.         jr prwindow_waitkey_text0
  116. prwindow_waitkey_textnextline
  117.         inc hl
  118.         inc d
  119.         call nv_setxy ;keeps de,hl
  120.         jr prwindow_waitkey_text0
  121.  
  122. getmarkedfiles
  123. ;ix = panel
  124. ;out: hl'hl = files
  125.         ld hl,0
  126.         exx
  127.         ld l,(ix+PANEL.markedfiles)
  128.         ld h,(ix+PANEL.markedfiles+1)
  129.         ret
  130.  
  131. changemark_hl
  132.         push hl
  133.         ld a,(hl)
  134.         xor 1
  135.         ld (hl),a
  136.         ld bc,FCB_FSIZE
  137.         add hl,bc
  138.         ld e,(hl)
  139.         inc hl
  140.         ld d,(hl)
  141.         inc hl
  142.         ld c,(hl)
  143.         inc hl
  144.         ld b,(hl)
  145. ;bcde = file size
  146.         ld l,(ix+PANEL.markedfiles)
  147.         ld h,(ix+PANEL.markedfiles+1)
  148.         inc hl
  149.         jr nz,changemark_hlq ;set mark
  150. ;remove mark
  151.         dec hl
  152.         dec hl
  153.         xor a
  154.         sub e
  155.         ld e,a
  156.         ld a,0
  157.         sbc a,d
  158.         ld d,a
  159.         ld a,0
  160.         sbc a,c
  161.         ld c,a
  162.         sbc a,b
  163.         sub c
  164.         ld b,a ;bcde= -bcde
  165. changemark_hlq
  166.         ld a,(ix+PANEL.markedsize)
  167.         add a,e
  168.         ld (ix+PANEL.markedsize),a
  169.         ld a,(ix+PANEL.markedsize+1)
  170.         adc a,d
  171.         ld (ix+PANEL.markedsize+1),a
  172.         ld a,(ix+PANEL.markedsize+2)
  173.         adc a,c
  174.         ld (ix+PANEL.markedsize+2),a
  175.         ld a,(ix+PANEL.markedsize+3)
  176.         adc a,b
  177.         ld (ix+PANEL.markedsize+3),a
  178.         ld (ix+PANEL.markedfiles),l
  179.         ld (ix+PANEL.markedfiles+1),h
  180.         pop hl
  181.         ret
  182.  
  183. getmarkedfilessize
  184. ;ix = panel
  185. ;out: hl'hl = files
  186.         ld l,(ix+PANEL.markedsize+2)
  187.         ld h,(ix+PANEL.markedsize+3)
  188.         exx
  189.         ld l,(ix+PANEL.markedsize)
  190.         ld h,(ix+PANEL.markedsize+1)
  191.         ret
  192.        
  193. getfiles
  194. ;ix = panel
  195. ;out: hl'hl=files (without ".", "..")
  196.         ld hl,0
  197.         exx
  198.         ld l,(ix+PANEL.filesdirs)
  199.         ld h,(ix+PANEL.filesdirs+1)
  200.         ret
  201.  
  202. countfiles
  203.         ld hl,proc_count
  204.         jp processfiles ;hl'hl=files (without ".", "..")
  205. proc_count
  206.         inc iy
  207.         ret
  208.  
  209. getfilessize
  210. ;ix = panel
  211.         ;exx
  212.         ld l,(ix+PANEL.totalsize+2)
  213.         ld h,(ix+PANEL.totalsize+3)
  214.         exx
  215.         ld l,(ix+PANEL.totalsize)
  216.         ld h,(ix+PANEL.totalsize+1)
  217.         ret ;hl'hl=size
  218.  
  219. processfiles
  220. ;ix = panel address (kept)
  221. ;hl = procedure address (uses hl=fcb, hl'iy = accumulator)
  222. ;out: hl'hl = result
  223.         ld (processfiles_proc),hl
  224.  
  225.         call nv_getpanelfiles_bc
  226.  
  227.         ld l,(ix+PANEL.pointers)
  228.         ld h,(ix+PANEL.pointers+1)
  229.         exx
  230.         ld hl,0
  231.         exx
  232.         ld iy,0
  233. processfiles0
  234.         ld a,b
  235.         or c
  236.         jr z,processfilesq
  237.         push bc
  238.         call getfilepointer_de_fromhl
  239.         push hl
  240.         push ix
  241.         ex de,hl
  242.         call isthisdotdir_hl
  243.         display "processfiles_proc ",$
  244. processfiles_proc=$+1
  245.         call nz,0 ;copy может переключать страницу (сейчас не переключает)
  246.         pop ix
  247.         pop hl
  248.         pop bc
  249.         dec bc
  250.         jp processfiles0
  251. processfilesq
  252.         push iy
  253.        push ix
  254.         call nv_batch ;исполнить всё, что запомнили в nv_batch_pushrecord?
  255.        pop ix
  256.         pop hl
  257.         ret
  258.  
  259. gotofilepointer_numberde
  260.         ld l,(ix+PANEL.pointers)
  261.         ld h,(ix+PANEL.pointers+1)
  262.         add hl,de
  263.         add hl,de
  264.         ret
  265.  
  266. getfilepointer_de_fromhl
  267. ;out: hl=next pointer
  268.         ld a,(ix+PANEL.poipg)
  269.         SETPG32KHIGH
  270.         ld a,(hl)
  271.         and 0xe0
  272.         ld e,a
  273.         xor (hl)
  274.         inc hl
  275.         ld d,(hl)
  276.         inc hl
  277.         ;ld a,e
  278.         ;and 31
  279.         add a,(ix+PANEL.pgadd)
  280.         PGW3strpg
  281.         ;push af
  282.         ;ld a,e
  283.         ;and 0xe0
  284.         ;ld e,a
  285.         ;pop af
  286.         ret
  287.  
  288. putfilepointer_de_tohl
  289. ;out: hl=next pointer
  290.         ld a,(ix+PANEL.poipg)
  291.         SETPG32KHIGH
  292.         ld (hl),e
  293.         inc hl
  294.         ld (hl),d
  295.         inc hl
  296.         ret
  297.  
  298. swapfilepointers_hl_de
  299. ;out: hl=next pointer
  300.         ld a,(ix+PANEL.poipg)
  301.         SETPG32KHIGH
  302.         ld a,(de)
  303.         ldi
  304.         dec hl
  305.         ld (hl),a
  306.         inc hl
  307.         ld a,(de)
  308.         ldi
  309.         dec hl
  310.         ld (hl),a
  311.         inc hl
  312.         ret
  313.  
  314. isthisdotdir_hl
  315. ;out: z="." or ".."
  316.         inc hl
  317.         ld a,(hl)
  318.         cp '.'
  319.         dec hl
  320.         ret
  321.  
  322. drawpanelfilesandsize
  323. ;ix=panel
  324.         call nv_getpanelxy_de
  325.         ld a,d
  326.         add a,22
  327.         ld d,a
  328.         inc e
  329.         inc e
  330.         call nv_setxy
  331.         ld de,_PANELDIRCOLOR;_PANELFILECOLOR
  332.         call nv_setcolor
  333.         call getmarkedfiles
  334.         ld a,h
  335.         or l
  336.         push af ;z = no marked
  337.         call z,getfiles
  338.         pop af
  339.         push af
  340.         ld de,_PANELSELECTCOLOR
  341.         call nz,nv_setcolor
  342.         ;push ix
  343.         ld de,wordfiles
  344.         call prdword_de_withspaces
  345.         ;ld hl,wordfiles
  346.         ; ld c,0
  347.         ;call prtext
  348.         ;pop ix
  349.         pop af ;z = no marked
  350.         jr nz,drawpanelfilesandsize_markedsize
  351.         call getfilessize
  352.         jr drawpanelfilesandsize_markedsizeq
  353. drawpanelfilesandsize_markedsize
  354.         call getmarkedfilessize
  355. drawpanelfilesandsize_markedsizeq
  356.         ld de,wordbytes
  357.         call prdword_de_withspaces
  358.         push ix
  359.         ld hl,wordfiles;bytes
  360.          ld c,0
  361.         call prtext
  362.         pop ix
  363.         ret
  364.  
  365. nv_setxy
  366. ;de=yx (kept)
  367. ;keeps hl
  368.         push de
  369.         push hl
  370.         push ix
  371.         SETXY_
  372.         pop ix
  373.         pop hl
  374.         pop de
  375.         ret
  376.  
  377. setpanelcolor
  378.         ld de,_PANELCOLOR
  379. nv_setcolor
  380. ;d=paper, e=ink
  381.         push hl
  382.         push ix
  383.         SETCOLOR_
  384.         pop ix
  385.         pop hl
  386.         ret
  387.  
  388. getfcbaddrundercursor
  389.         call nv_getdirpos_hl
  390. getfcbaddrunderhl
  391.         ld ix,(curpanel)
  392.         ;ld a,(ix+PANEL.pg)
  393.         ;SETPG32KHIGH
  394.         ex de,hl
  395.         call gotofilepointer_numberde ;hl=file pointer
  396.         ;ld a,(hl)
  397.         ;inc hl
  398.         ;ld h,(hl)
  399.         ;ld l,a ;hl=FCB
  400.         call getfilepointer_de_fromhl
  401.         ex de,hl ;hl=FCB
  402.         ret
  403.  
  404. getfcbundercursor
  405.         call getfcbaddrundercursor
  406. getfcbfromhl
  407.         ld de,fcb
  408.         ld bc,FCB_sz
  409.         ldir
  410.         ret
  411.  
  412. panelprtext
  413. ;print max 37 chars (dir)
  414. ;hl = text
  415. ;keeps ix
  416.         push ix
  417. panelprtext0
  418.         ld a,(hl)
  419.         or a
  420.         jr z,panelprtextq
  421.         push bc
  422.         push hl
  423.         PRCHAR_
  424.         pop hl
  425.         pop bc
  426.         inc c
  427.         inc hl
  428.         ld a,c
  429.         cp PANELDIRCHARS37
  430.         jp nz,panelprtext0
  431. panelprtextq
  432.         pop ix
  433.         ret
  434.  
  435. changedir_fromfcb
  436.         call setcurpaneldir
  437.         ld hl,fcb_filename
  438.         ld de,filenametext
  439.         push de
  440.         call cpmname_to_dotname
  441.         pop de
  442.         OS_CHDIR
  443.         ret
  444.  
  445.         if 1==0
  446. readfile_pages_dehl
  447.         ld a,d
  448.         SETPG32KHIGH
  449.         ld a,+(0xc000+PROGSTART)/256
  450.         call cmd_loadpage
  451.         or a
  452.         ret nz
  453.        
  454.         ld a,e
  455.         SETPG32KHIGH
  456.         ld a,0xc000/256
  457.         call cmd_loadpage
  458.         or a
  459.         ret nz
  460.        
  461.         ld a,h
  462.         SETPG32KHIGH
  463.         ld a,0xc000/256
  464.         call cmd_loadpage
  465.         or a
  466.         ret nz
  467.        
  468.         ld a,l
  469.         SETPG32KHIGH
  470.         ld a,0xc000/256
  471.         jp cmd_loadpage
  472.         endif
  473.  
  474. readfile_pages_dehl
  475.         ld a,d
  476.         SETPG32KHIGH
  477.         ld a,0xc100/256
  478.         call cmd_loadpage
  479.         ret nz
  480.         ld a,e
  481.         call cmd_loadfullpage
  482.         ret nz
  483.         ld a,h
  484.         call cmd_loadfullpage
  485.         ret nz
  486.         ld a,l
  487. cmd_loadfullpage
  488.         SETPG32KHIGH
  489.         ld a,0xc000/256
  490. cmd_loadpage
  491. ;out: a=error, bc=bytes read
  492. ;keeps hl,de
  493.         push de
  494.         push hl
  495.         ld d,a
  496.         xor a
  497.         ld l,a
  498.         ld e,a
  499.         sub d
  500.         ld h,a ;de=buffer, hl=size
  501.         call readcurhandle
  502.         ld b,h
  503.         ld c,l
  504.         pop hl
  505.         pop de
  506.         or a
  507.         ret
  508.  
  509. readcurhandle
  510. curhandle=$+1
  511.         ld b,0
  512.         OS_READHANDLE
  513.         ret
  514.  
  515. cmd_savepage
  516. ;hl=size
  517. ;out: a=error
  518.         ;push hl
  519.         ld de,0x8000
  520.         ;OS_SETDTA
  521.         ;pop hl
  522.         ;ld de,fcb2
  523.         ;OS_FWRITE_NBYTES
  524.         ld a,(curhandle)
  525.         ld b,a
  526.         OS_WRITEHANDLE
  527.         ret
  528.  
  529. setdrawtablesneeded
  530.         ld ix,leftpanel
  531.         res 0,(ix+PANEL.drawtableunneeded)
  532.         ld ix,rightpanel
  533.         res 0,(ix+PANEL.drawtableunneeded)
  534.         ret
  535.  
  536. prwin
  537. ;de=yx
  538. ;bc=hgt,wid
  539.         call setdrawtablesneeded
  540.         ld a,c
  541.         sub 2
  542.         ld (winbeginstroka_wid),a
  543.         ld (winmidstroka_wid),a
  544.         ld (winendstroka_wid),a
  545.         ld hl,winbeginstroka
  546.         call prtableline
  547.         dec b
  548.         dec b
  549. winlineN_0
  550.         inc d
  551.         ld hl,winmidstroka
  552.         call prtableline
  553.         djnz winlineN_0
  554.         inc d
  555.         ld hl,winendstroka
  556.         jr prtableline
  557.  
  558. prtable
  559. ;de=yx
  560.         ld hl,prbeginstroka
  561.         call prtableline
  562.         push ix
  563.         ld b,CONST_HGT_TABLE
  564. prtable0
  565.         inc d
  566.         ;ld hl,prmidstroka
  567.         ;call prtableline
  568.         push bc
  569.         push de
  570.         call nv_setxy ;keeps de,hl
  571.         ld de,tmidstroka
  572.         ld hl,tmidstroka_sz
  573.         call sendchars
  574.         pop de
  575.         pop bc
  576.         djnz prtable0
  577.         pop ix
  578.         inc d
  579.         ld hl,prendstroka
  580. prtableline
  581. ;hl=tableline data
  582. ;de=yx
  583. ;b=hgt
  584. ;keeps bc,de,ix
  585.         push bc
  586.         call nv_setxy ;keeps de,hl
  587. prtableline0
  588.         ld a,(hl)
  589.         or a
  590.         jr z,prtablelineq
  591.         inc hl
  592.         ld b,(hl)
  593.         inc hl
  594.         call prNsymbol
  595.         jr prtableline0
  596. prtablelineq
  597.         pop bc
  598.         ret
  599.  
  600. prNsymbol
  601. ;a=symbol
  602. ;b=count
  603.         push de
  604.         push hl
  605.         push ix
  606.         ld c,a
  607. prNsymbol0
  608.         push bc
  609.         ld a,c
  610.         PRCHAR_
  611.         pop bc
  612.         djnz prNsymbol0
  613.         pop ix
  614.         pop hl
  615.         pop de
  616.         ret
  617.  
  618. ;;;;;;;;;;;;;;;;;;
  619.  
  620. cmdprchar
  621.         push hl
  622.         push ix
  623.         PRCHAR_
  624.         pop ix
  625.         pop hl
  626.         ret
  627.  
  628. nv_getpanelxy_de
  629.         ld e,(ix+PANEL.xy)
  630.         ld d,(ix+PANEL.xy+1)
  631.         ret
  632.  
  633. nv_getdirscroll_bc
  634.         ld c,(ix+PANEL.dirscroll)
  635.         ld b,(ix+PANEL.dirscroll+1)
  636.         ret
  637. nv_setdirscroll_bc
  638.         ld (ix+PANEL.dirscroll),c
  639.         ld (ix+PANEL.dirscroll+1),b
  640.         ret
  641.  
  642. nv_getpanelfiles_bc
  643.         ld c,(ix+PANEL.files)
  644.         ld b,(ix+PANEL.files+1)
  645.         ret
  646. nv_getdirpos_hl
  647.         ld l,(ix+PANEL.dirpos)
  648.         ld h,(ix+PANEL.dirpos+1)
  649.         ret
  650.  
  651. cpfiles_setdirpos
  652. ;hl=suggested dirpos (might be >= files)
  653. ;out: hl=dirpos
  654.         call nv_getpanelfiles_bc
  655.         dec bc
  656.         call minhl_bc_tobc
  657.         ld h,b
  658.         ld l,c
  659. nv_setdirpos_hl
  660.         ld (ix+PANEL.dirpos),l
  661.         ld (ix+PANEL.dirpos+1),h
  662.         ret
  663. nv_setdirpos_zero
  664.         ld hl,0
  665.         jr nv_setdirpos_hl
  666.  
  667. count_filecursor_y
  668. ;out: a=y, de=PANEL.xy
  669.         call nv_getpanelxy_de
  670.         ld a,(ix+PANEL.dirpos)
  671.         sub (ix+PANEL.dirscroll)
  672.         add a,d;(ix+PANEL.xy+1) ;y
  673.         ret
  674.  
  675. setfilecursorxy
  676.         ;push af
  677.         ld ix,(curpanel)
  678.         call count_filecursor_y
  679.         ld d,a
  680.         ;ld e,(ix+PANEL.xy)
  681.         inc d
  682.         inc e
  683.         ;pop af
  684.         ;push af
  685.         call nv_setxy
  686.         ;pop af ;color
  687.         ret
  688.  
  689. prfilecursor_reprintfile
  690. ;hl=color
  691.         push hl
  692.         ;ex de,hl
  693.         ;SETCOLOR_
  694.         call setfilecursorxy
  695.         ld ix,(curpanel)
  696.         ;call getfcbaddrundercursor
  697.         ;jp prdirfile
  698.         call getfcbundercursor
  699.         ld ix,fcb
  700.         pop de
  701.         jp prdirfile_ix_decolor
  702.         ;push hl
  703.         ;pop ix
  704.         ;call prdirfile_copyfilename
  705.         ;;ld ix,(curpanel)
  706.         ;ld de,filelinebuf
  707.         ;ld hl,8+1+3
  708.         ;jp sendchars
  709.  
  710. prfilecursor
  711. ;hl=color
  712.         push hl
  713.         call setfilecursorxy
  714.         pop hl
  715.         ld b,12
  716.         call drawfilecursor_sizeb_colorhl ;hl=old color
  717.         ld ix,(curpanel)
  718.         ret
  719.  
  720. editcmd_readprompt_setendcmdx
  721.         ld ix,(curpanel)
  722.         call setpaneldir_makeprompt ;->prompt
  723.         ld hl,cmdbuf
  724.         call strlen
  725.         ld a,l
  726.         ld (curcmdx),a
  727.         ret
  728.  
  729. getanotherpanel_ix
  730. curpanel=$+1
  731.         ld bc,leftpanel
  732.         ld hl,0xffff&(leftpanel+rightpanel)
  733.         or a
  734.         sbc hl,bc
  735.         push hl
  736.         pop ix
  737.         ret
  738.  
  739. setanotherpaneldir
  740.         call getanotherpanel_ix
  741.         jr setpaneldir
  742.  
  743. setcurpaneldir
  744.         ld ix,(curpanel)
  745. setpaneldir
  746. ;ix=panel
  747.         push ix
  748.         pop hl
  749.         ld de,PANEL.dir
  750.         add hl,de
  751.         ex de,hl ;de=path
  752.         OS_CHDIR
  753.         ret
  754.  
  755. drawfilecursor_sizeb_colorhl
  756. ;de=yx
  757. ;hl=color
  758. ;b=size
  759.         push bc
  760.         push hl
  761.         call nv_setxy
  762.         pop de
  763.         SETCOLOR_
  764.         call setcolor_invisible
  765.         pop bc
  766.         ld de,tspaces
  767.         ld h,0
  768.         ld l,b
  769.         call sendchars
  770.         jp setcolor_visible
  771.  
  772.         if 1==0
  773. nv_openfcb
  774. ;if success, autopush nv_closefcb
  775. ;out: nz=error
  776.         push ix
  777.         ld de,fcb
  778.         OS_FOPEN
  779.         pop ix
  780.         or a
  781.         ret nz ;error
  782.         ld hl,nv_closefcb
  783.         ex (sp),hl
  784.         jp (hl)
  785.  
  786. nv_createfcb2
  787. ;if success, autopush nv_closefcb2
  788. ;out: nz=error
  789.         ld de,fcb2
  790.         push ix
  791.         OS_FCREATE
  792.         pop ix
  793.         or a
  794.         ret nz ;error
  795.         ld hl,nv_closefcb2
  796.         ex (sp),hl
  797.         jp (hl)
  798.  
  799. nv_closefcb2
  800. ;keep de and flags!!!
  801.         push de
  802.         ld de,fcb2
  803.         jr nv_closefcb_de_
  804. nv_closefcb
  805. ;keep de and flags!!!
  806.         push de
  807.         ld de,fcb
  808. nv_closefcb_de_
  809. ;out: keep flags!!!
  810.         push af
  811.         push ix
  812.         OS_FCLOSE
  813.         pop ix
  814.         pop af
  815.         pop de
  816.         ;or a
  817.         ret
  818.         endif
  819.  
  820. copy_to_fcb_filename
  821.         ld de,fcb_filename
  822. copy_to_defcb_filename
  823.         ld bc,11
  824.         ldir
  825.         ret
  826.  
  827. nv_closehandle
  828. ;keep de and flags!!!
  829.         push af
  830.         push de
  831.         ld a,(curhandle)
  832.         ld b,a
  833.         OS_CLOSEHANDLE
  834.         pop de
  835.         pop af
  836.         ret
  837.  
  838. tdoublehoriz
  839.         ds PANELDIRCHARS37,0xcd
  840.  
  841. winbeginstroka
  842.         db 0xc9;'г'
  843.         db 1
  844.         db 0xcd;'='
  845. winbeginstroka_wid=$
  846.         db 12;wdtcolumn1
  847.         db 0xbb;'┐'
  848.         db 1
  849.         db 0
  850.        
  851. winmidstroka
  852.         db 0xba;'│'
  853.         db 1
  854.         db ' '
  855. winmidstroka_wid=$
  856.         db 12;wdtcolumn1
  857.         db 0xba;'│'
  858.         db 1
  859.         db 0
  860.  
  861. winendstroka
  862.         db 0xc8;'L'
  863.         db 1
  864.         db 0xcd;'='
  865. winendstroka_wid=$
  866.         db 12;wdtcolumn1
  867.         db 0xbc;'-'
  868.         db 1
  869.         db 0
  870.  
  871. prbeginstroka
  872.         db 0xc9;'г'
  873.         db 1
  874.         db 0xcd;'='
  875.         db 14;wdtcolumn1
  876.         db 0xcd;0xd1;'T'
  877.         db 1
  878.         db 0xcd;'='
  879.         db 10;wdtcolumn2
  880.         db 0xd1;'T'
  881.         db 1
  882.         db 0xcd;'='
  883.         db 12;wdtcolumn3
  884.         db 0xbb;'┐'
  885.         db 1
  886.         db 0
  887.  
  888. tmidstroka
  889.         db 0xba;'│'
  890.         db 0x1b,"[25C"
  891.         db 0xb3;'│'
  892.         db 0x1b,"[12C"
  893.         db 0xba;'│'
  894. tmidstroka_sz=$-tmidstroka
  895.         if 1==0
  896. prmidstroka
  897.         db 0xba;'│'
  898.         db 1
  899.         db ' '
  900.         db 14;wdtcolumn1
  901.         db ' ';0xb3;'│'
  902.         db 1
  903.         db ' '
  904.         db 10;wdtcolumn2
  905.         db 0xb3;'│'
  906.         db 1
  907.         db ' '
  908.         db 12;wdtcolumn3
  909.         db 0xba;'│'
  910.         db 1
  911.         db 0
  912.         endif
  913.  
  914. prendstroka
  915.         db 0xc8;'L'
  916.         db 1
  917.         db 0xcd;;'='
  918.         db 14;wdtcolumn1
  919.         db 0xcd;0xcf;'│'
  920.         db 1
  921.         db 0xcd;'='
  922.         db 10;wdtcolumn2
  923.         db 0xcf;'│'
  924.         db 1
  925.         db 0xcd;'='
  926.         db 12;wdtcolumn3
  927.         db 0xbc;'-'
  928.         db 1
  929.         db 0
  930.        
  931. prcrlf
  932.         ld de,tcrlf
  933.         ld hl,2
  934.         jp sendchars
  935. tcrlf
  936.         db 0x0d,0x0a
  937.  
  938.         if 1==0
  939. nv_copyscreen0to1
  940.         OS_GETMAINPAGES
  941.         push hl
  942.         ;OS_GETSCREENPAGES
  943.         ld a,(user_scr1_low) ;ok
  944.         ld l,a
  945.         ld a,(user_scr1_high) ;ok
  946.         ld h,a
  947.         ld a,(user_scr0_low) ;ok
  948.         ld e,a
  949.         ld a,(user_scr0_high) ;ok
  950.         ld d,a
  951.         push hl ;1 screen
  952.         push de ;0 screen
  953.         ld a,l
  954.         SETPG32KHIGH
  955.         pop de
  956.         push de
  957.         ld a,e
  958.         SETPG32KLOW
  959.         ld bc,0x4000
  960.         ld hl,0x8000
  961.         ld de,0xC000
  962.         ldir
  963.         pop de
  964.         pop hl
  965.         push de
  966.         ld a,h
  967.         SETPG32KHIGH
  968.         pop de
  969.         ld a,d
  970.         SETPG32KLOW
  971.         ld bc,0x4000
  972.         ld hl,0x8000
  973.         ld de,0xC000
  974.         ldir
  975.         pop hl
  976.         push hl
  977.         ld a,l
  978.         SETPG32KHIGH
  979.         pop hl
  980.         ld a,h
  981.         SETPG32KLOW
  982.         ret
  983.  
  984. nv_copyscreen1to0
  985.         OS_GETMAINPAGES
  986.         push hl
  987.         ;OS_GETSCREENPAGES
  988.         ld a,(user_scr1_low) ;ok
  989.         ld l,a
  990.         ld a,(user_scr1_high) ;ok
  991.         ld h,a
  992.         ld a,(user_scr0_low) ;ok
  993.         ld e,a
  994.         ld a,(user_scr0_high) ;ok
  995.         ld d,a
  996.         push hl ;1 screen
  997.         push de ;0 screen
  998.         ld a,l
  999.         SETPG32KHIGH
  1000.         pop de
  1001.         push de
  1002.         ld a,e
  1003.         SETPG32KLOW
  1004.         ld bc,0x4000
  1005.         ld hl,0xc000
  1006.         ld de,0x8000
  1007.         ldir
  1008.         pop de
  1009.         pop hl
  1010.         push de
  1011.         ld a,h
  1012.         SETPG32KHIGH
  1013.         pop de
  1014.         ld a,d
  1015.         SETPG32KLOW
  1016.         ld bc,0x4000
  1017.         ld hl,0xc000
  1018.         ld de,0x8000
  1019.         ldir
  1020.         pop hl
  1021.         push hl
  1022.         ld a,l
  1023.         SETPG32KHIGH
  1024.         pop hl
  1025.         ld a,h
  1026.         SETPG32KLOW
  1027.         ret
  1028.         endif