Subversion Repositories NedoOS

Rev

Rev 667 | Rev 841 | 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. processfiles_proc=$+1
  244.         call nz,0 ;copy может переключать страницу (сейчас не переключает)
  245.         pop ix
  246.         pop hl
  247.         pop bc
  248.         dec bc
  249.         jp processfiles0
  250. processfilesq
  251.         push iy
  252.         call nv_batch
  253.         pop hl
  254.         ret
  255.  
  256. gotofilepointer_numberde
  257.         ld l,(ix+PANEL.pointers)
  258.         ld h,(ix+PANEL.pointers+1)
  259.         add hl,de
  260.         add hl,de
  261.         ret
  262.  
  263. getfilepointer_de_fromhl
  264. ;out: hl=next pointer
  265.         ld a,(ix+PANEL.poipg)
  266.         SETPG32KHIGH
  267.         ld a,(hl)
  268.         and 0xe0
  269.         ld e,a
  270.         xor (hl)
  271.         inc hl
  272.         ld d,(hl)
  273.         inc hl
  274.         ;ld a,e
  275.         ;and 31
  276.         add a,(ix+PANEL.pgadd)
  277.         PGW3strpg
  278.         ;push af
  279.         ;ld a,e
  280.         ;and 0xe0
  281.         ;ld e,a
  282.         ;pop af
  283.         ret
  284.  
  285. putfilepointer_de_tohl
  286. ;out: hl=next pointer
  287.         ld a,(ix+PANEL.poipg)
  288.         SETPG32KHIGH
  289.         ld (hl),e
  290.         inc hl
  291.         ld (hl),d
  292.         inc hl
  293.         ret
  294.  
  295. swapfilepointers_hl_de
  296. ;out: hl=next pointer
  297.         ld a,(ix+PANEL.poipg)
  298.         SETPG32KHIGH
  299.         ld a,(de)
  300.         ldi
  301.         dec hl
  302.         ld (hl),a
  303.         inc hl
  304.         ld a,(de)
  305.         ldi
  306.         dec hl
  307.         ld (hl),a
  308.         inc hl
  309.         ret
  310.  
  311. isthisdotdir_hl
  312. ;out: z="." or ".."
  313.         inc hl
  314.         ld a,(hl)
  315.         cp '.'
  316.         dec hl
  317.         ret
  318.  
  319. drawpanelfilesandsize
  320. ;ix=panel
  321.         call nv_getpanelxy_de
  322.         ld a,d
  323.         add a,22
  324.         ld d,a
  325.         inc e
  326.         inc e
  327.         call nv_setxy
  328.         ld de,_PANELDIRCOLOR;_PANELFILECOLOR
  329.         call nv_setcolor
  330.         call getmarkedfiles
  331.         ld a,h
  332.         or l
  333.         push af ;z = no marked
  334.         call z,getfiles
  335.         pop af
  336.         push af
  337.         ld de,_PANELSELECTCOLOR
  338.         call nz,nv_setcolor
  339.         ;push ix
  340.         ld de,wordfiles
  341.         call prdword_de_withspaces
  342.         ;ld hl,wordfiles
  343.         ; ld c,0
  344.         ;call prtext
  345.         ;pop ix
  346.         pop af ;z = no marked
  347.         jr nz,drawpanelfilesandsize_markedsize
  348.         call getfilessize
  349.         jr drawpanelfilesandsize_markedsizeq
  350. drawpanelfilesandsize_markedsize
  351.         call getmarkedfilessize
  352. drawpanelfilesandsize_markedsizeq
  353.         ld de,wordbytes
  354.         call prdword_de_withspaces
  355.         push ix
  356.         ld hl,wordfiles;bytes
  357.          ld c,0
  358.         call prtext
  359.         pop ix
  360.         ret
  361.  
  362. nv_setxy
  363. ;de=yx (kept)
  364. ;keeps hl
  365.         push de
  366.         push hl
  367.         push ix
  368.         SETXY_
  369.         pop ix
  370.         pop hl
  371.         pop de
  372.         ret
  373.  
  374. setpanelcolor
  375.         ld de,_PANELCOLOR
  376. nv_setcolor
  377. ;d=paper, e=ink
  378.         push hl
  379.         push ix
  380.         SETCOLOR_
  381.         pop ix
  382.         pop hl
  383.         ret
  384.  
  385. getfcbaddrundercursor
  386.         call nv_getdirpos_hl
  387. getfcbaddrunderhl
  388.         ld ix,(curpanel)
  389.         ;ld a,(ix+PANEL.pg)
  390.         ;SETPG32KHIGH
  391.         ex de,hl
  392.         call gotofilepointer_numberde ;hl=file pointer
  393.         ;ld a,(hl)
  394.         ;inc hl
  395.         ;ld h,(hl)
  396.         ;ld l,a ;hl=FCB
  397.         call getfilepointer_de_fromhl
  398.         ex de,hl ;hl=FCB
  399.         ret
  400.  
  401. getfcbundercursor
  402.         call getfcbaddrundercursor
  403. getfcbfromhl
  404.         ld de,fcb
  405.         ld bc,FCB_sz
  406.         ldir
  407.         ret
  408.  
  409. panelprtext
  410. ;print max 37 chars (dir)
  411. ;hl = text
  412. ;keeps ix
  413.         push ix
  414. panelprtext0
  415.         ld a,(hl)
  416.         or a
  417.         jr z,panelprtextq
  418.         push bc
  419.         push hl
  420.         PRCHAR_
  421.         pop hl
  422.         pop bc
  423.         inc c
  424.         inc hl
  425.         ld a,c
  426.         cp PANELDIRCHARS37
  427.         jp nz,panelprtext0
  428. panelprtextq
  429.         pop ix
  430.         ret
  431.  
  432. changedir_fromfcb
  433.         call setcurpaneldir
  434.         ld hl,fcb_filename
  435.         ld de,filenametext
  436.         push de
  437.         call cpmname_to_dotname
  438.         pop de
  439.         OS_CHDIR
  440.         ret
  441.  
  442.         if 1==0
  443. readfile_pages_dehl
  444.         ld a,d
  445.         SETPG32KHIGH
  446.         ld a,+(0xc000+PROGSTART)/256
  447.         call cmd_loadpage
  448.         or a
  449.         ret nz
  450.        
  451.         ld a,e
  452.         SETPG32KHIGH
  453.         ld a,0xc000/256
  454.         call cmd_loadpage
  455.         or a
  456.         ret nz
  457.        
  458.         ld a,h
  459.         SETPG32KHIGH
  460.         ld a,0xc000/256
  461.         call cmd_loadpage
  462.         or a
  463.         ret nz
  464.        
  465.         ld a,l
  466.         SETPG32KHIGH
  467.         ld a,0xc000/256
  468.         jp cmd_loadpage
  469.         endif
  470.  
  471. readfile_pages_dehl
  472.         ld a,d
  473.         SETPG32KHIGH
  474.         ld a,0xc100/256
  475.         call cmd_loadpage
  476.         ret nz
  477.         ld a,e
  478.         call cmd_loadfullpage
  479.         ret nz
  480.         ld a,h
  481.         call cmd_loadfullpage
  482.         ret nz
  483.         ld a,l
  484. cmd_loadfullpage
  485.         SETPG32KHIGH
  486.         ld a,0xc000/256
  487. cmd_loadpage
  488. ;out: a=error, bc=bytes read
  489. ;keeps hl,de
  490.         push de
  491.         push hl
  492.         ld d,a
  493.         xor a
  494.         ld l,a
  495.         ld e,a
  496.         sub d
  497.         ld h,a ;de=buffer, hl=size
  498.         call readcurhandle
  499.         ld b,h
  500.         ld c,l
  501.         pop hl
  502.         pop de
  503.         or a
  504.         ret
  505.  
  506. readcurhandle
  507. curhandle=$+1
  508.         ld b,0
  509.         OS_READHANDLE
  510.         ret
  511.  
  512. cmd_savepage
  513. ;hl=size
  514. ;out: a=error
  515.         ;push hl
  516.         ld de,0x8000
  517.         ;OS_SETDTA
  518.         ;pop hl
  519.         ;ld de,fcb2
  520.         ;OS_FWRITE_NBYTES
  521.         ld a,(curhandle)
  522.         ld b,a
  523.         OS_WRITEHANDLE
  524.         ret
  525.  
  526. setdrawtablesneeded
  527.         ld ix,leftpanel
  528.         res 0,(ix+PANEL.drawtableunneeded)
  529.         ld ix,rightpanel
  530.         res 0,(ix+PANEL.drawtableunneeded)
  531.         ret
  532.  
  533. prwin
  534. ;de=yx
  535. ;bc=hgt,wid
  536.         call setdrawtablesneeded
  537.         ld a,c
  538.         sub 2
  539.         ld (winbeginstroka_wid),a
  540.         ld (winmidstroka_wid),a
  541.         ld (winendstroka_wid),a
  542.         ld hl,winbeginstroka
  543.         call prtableline
  544.         dec b
  545.         dec b
  546. winlineN_0
  547.         inc d
  548.         ld hl,winmidstroka
  549.         call prtableline
  550.         djnz winlineN_0
  551.         inc d
  552.         ld hl,winendstroka
  553.         jr prtableline
  554.  
  555. prtable
  556. ;de=yx
  557.         ld hl,prbeginstroka
  558.         call prtableline
  559.         push ix
  560.         ld b,CONST_HGT_TABLE
  561. prtable0
  562.         inc d
  563.         ;ld hl,prmidstroka
  564.         ;call prtableline
  565.         push bc
  566.         push de
  567.         call nv_setxy ;keeps de,hl
  568.         ld de,tmidstroka
  569.         ld hl,tmidstroka_sz
  570.         call sendchars
  571.         pop de
  572.         pop bc
  573.         djnz prtable0
  574.         pop ix
  575.         inc d
  576.         ld hl,prendstroka
  577. prtableline
  578. ;hl=tableline data
  579. ;de=yx
  580. ;b=hgt
  581. ;keeps bc,de,ix
  582.         push bc
  583.         call nv_setxy ;keeps de,hl
  584. prtableline0
  585.         ld a,(hl)
  586.         or a
  587.         jr z,prtablelineq
  588.         inc hl
  589.         ld b,(hl)
  590.         inc hl
  591.         call prNsymbol
  592.         jr prtableline0
  593. prtablelineq
  594.         pop bc
  595.         ret
  596.  
  597. prNsymbol
  598. ;a=symbol
  599. ;b=count
  600.         push de
  601.         push hl
  602.         push ix
  603.         ld c,a
  604. prNsymbol0
  605.         push bc
  606.         ld a,c
  607.         PRCHAR_
  608.         pop bc
  609.         djnz prNsymbol0
  610.         pop ix
  611.         pop hl
  612.         pop de
  613.         ret
  614.  
  615. ;;;;;;;;;;;;;;;;;;
  616.  
  617. cmdprchar
  618.         push hl
  619.         push ix
  620.         PRCHAR_
  621.         pop ix
  622.         pop hl
  623.         ret
  624.  
  625. nv_getpanelxy_de
  626.         ld e,(ix+PANEL.xy)
  627.         ld d,(ix+PANEL.xy+1)
  628.         ret
  629.  
  630. nv_getdirscroll_bc
  631.         ld c,(ix+PANEL.dirscroll)
  632.         ld b,(ix+PANEL.dirscroll+1)
  633.         ret
  634. nv_setdirscroll_bc
  635.         ld (ix+PANEL.dirscroll),c
  636.         ld (ix+PANEL.dirscroll+1),b
  637.         ret
  638.  
  639. nv_getpanelfiles_bc
  640.         ld c,(ix+PANEL.files)
  641.         ld b,(ix+PANEL.files+1)
  642.         ret
  643. nv_getdirpos_hl
  644.         ld l,(ix+PANEL.dirpos)
  645.         ld h,(ix+PANEL.dirpos+1)
  646.         ret
  647.  
  648. cpfiles_setdirpos
  649. ;hl=suggested dirpos (might be >= files)
  650. ;out: hl=dirpos
  651.         call nv_getpanelfiles_bc
  652.         dec bc
  653.         call minhl_bc_tobc
  654.         ld h,b
  655.         ld l,c
  656. nv_setdirpos_hl
  657.         ld (ix+PANEL.dirpos),l
  658.         ld (ix+PANEL.dirpos+1),h
  659.         ret
  660. nv_setdirpos_zero
  661.         ld hl,0
  662.         jr nv_setdirpos_hl
  663.  
  664. count_filecursor_y
  665. ;out: a=y, de=PANEL.xy
  666.         call nv_getpanelxy_de
  667.         ld a,(ix+PANEL.dirpos)
  668.         sub (ix+PANEL.dirscroll)
  669.         add a,d;(ix+PANEL.xy+1) ;y
  670.         ret
  671.  
  672. setfilecursorxy
  673.         ;push af
  674.         ld ix,(curpanel)
  675.         call count_filecursor_y
  676.         ld d,a
  677.         ;ld e,(ix+PANEL.xy)
  678.         inc d
  679.         inc e
  680.         ;pop af
  681.         ;push af
  682.         call nv_setxy
  683.         ;pop af ;color
  684.         ret
  685.  
  686. prfilecursor_reprintfile
  687. ;hl=color
  688.         push hl
  689.         ;ex de,hl
  690.         ;SETCOLOR_
  691.         call setfilecursorxy
  692.         ld ix,(curpanel)
  693.         ;call getfcbaddrundercursor
  694.         ;jp prdirfile
  695.         call getfcbundercursor
  696.         ld ix,fcb
  697.         pop de
  698.         jp prdirfile_ix_decolor
  699.         ;push hl
  700.         ;pop ix
  701.         ;call prdirfile_copyfilename
  702.         ;;ld ix,(curpanel)
  703.         ;ld de,filelinebuf
  704.         ;ld hl,8+1+3
  705.         ;jp sendchars
  706.  
  707. prfilecursor
  708. ;hl=color
  709.         push hl
  710.         call setfilecursorxy
  711.         pop hl
  712.         ld b,12
  713.         call drawfilecursor_sizeb_colorhl ;hl=old color
  714.         ld ix,(curpanel)
  715.         ret
  716.  
  717. editcmd_readprompt_setendcmdx
  718.         ld ix,(curpanel)
  719.         call setpaneldir_makeprompt ;->prompt
  720.         ld hl,cmdbuf
  721.         call strlen
  722.         ld a,l
  723.         ld (curcmdx),a
  724.         ret
  725.  
  726. getanotherpanel_ix
  727. curpanel=$+1
  728.         ld bc,leftpanel
  729.         ld hl,0xffff&(leftpanel+rightpanel)
  730.         or a
  731.         sbc hl,bc
  732.         push hl
  733.         pop ix
  734.         ret
  735.  
  736. setanotherpaneldir
  737.         call getanotherpanel_ix
  738.         jr setpaneldir
  739.  
  740. setcurpaneldir
  741.         ld ix,(curpanel)
  742. setpaneldir
  743. ;ix=panel
  744.         push ix
  745.         pop hl
  746.         ld de,PANEL.dir
  747.         add hl,de
  748.         ex de,hl ;de=path
  749.         OS_CHDIR
  750.         ret
  751.  
  752. drawfilecursor_sizeb_colorhl
  753. ;de=yx
  754. ;hl=color
  755. ;b=size
  756.         push bc
  757.         push hl
  758.         call nv_setxy
  759.         pop de
  760.         SETCOLOR_
  761.         call setcolor_invisible
  762.         pop bc
  763.         ld de,tspaces
  764.         ld h,0
  765.         ld l,b
  766.         call sendchars
  767.         jp setcolor_visible
  768.  
  769.         if 1==0
  770. nv_openfcb
  771. ;if success, autopush nv_closefcb
  772. ;out: nz=error
  773.         push ix
  774.         ld de,fcb
  775.         OS_FOPEN
  776.         pop ix
  777.         or a
  778.         ret nz ;error
  779.         ld hl,nv_closefcb
  780.         ex (sp),hl
  781.         jp (hl)
  782.  
  783. nv_createfcb2
  784. ;if success, autopush nv_closefcb2
  785. ;out: nz=error
  786.         ld de,fcb2
  787.         push ix
  788.         OS_FCREATE
  789.         pop ix
  790.         or a
  791.         ret nz ;error
  792.         ld hl,nv_closefcb2
  793.         ex (sp),hl
  794.         jp (hl)
  795.  
  796. nv_closefcb2
  797. ;keep de and flags!!!
  798.         push de
  799.         ld de,fcb2
  800.         jr nv_closefcb_de_
  801. nv_closefcb
  802. ;keep de and flags!!!
  803.         push de
  804.         ld de,fcb
  805. nv_closefcb_de_
  806. ;out: keep flags!!!
  807.         push af
  808.         push ix
  809.         OS_FCLOSE
  810.         pop ix
  811.         pop af
  812.         pop de
  813.         ;or a
  814.         ret
  815.         endif
  816.  
  817. copy_to_fcb_filename
  818.         ld de,fcb_filename
  819. copy_to_defcb_filename
  820.         ld bc,11
  821.         ldir
  822.         ret
  823.  
  824. nv_closehandle
  825. ;keep de and flags!!!
  826.         push af
  827.         push de
  828.         ld a,(curhandle)
  829.         ld b,a
  830.         OS_CLOSEHANDLE
  831.         pop de
  832.         pop af
  833.         ret
  834.  
  835. tdoublehoriz
  836.         ds PANELDIRCHARS37,0xcd
  837.  
  838. winbeginstroka
  839.         db 0xc9;'г'
  840.         db 1
  841.         db 0xcd;'='
  842. winbeginstroka_wid=$
  843.         db 12;wdtcolumn1
  844.         db 0xbb;'┐'
  845.         db 1
  846.         db 0
  847.        
  848. winmidstroka
  849.         db 0xba;'│'
  850.         db 1
  851.         db ' '
  852. winmidstroka_wid=$
  853.         db 12;wdtcolumn1
  854.         db 0xba;'│'
  855.         db 1
  856.         db 0
  857.  
  858. winendstroka
  859.         db 0xc8;'L'
  860.         db 1
  861.         db 0xcd;'='
  862. winendstroka_wid=$
  863.         db 12;wdtcolumn1
  864.         db 0xbc;'-'
  865.         db 1
  866.         db 0
  867.  
  868. prbeginstroka
  869.         db 0xc9;'г'
  870.         db 1
  871.         db 0xcd;'='
  872.         db 14;wdtcolumn1
  873.         db 0xcd;0xd1;'T'
  874.         db 1
  875.         db 0xcd;'='
  876.         db 10;wdtcolumn2
  877.         db 0xd1;'T'
  878.         db 1
  879.         db 0xcd;'='
  880.         db 12;wdtcolumn3
  881.         db 0xbb;'┐'
  882.         db 1
  883.         db 0
  884.  
  885. tmidstroka
  886.         db 0xba;'│'
  887.         db 0x1b,"[25C"
  888.         db 0xb3;'│'
  889.         db 0x1b,"[12C"
  890.         db 0xba;'│'
  891. tmidstroka_sz=$-tmidstroka
  892.         if 1==0
  893. prmidstroka
  894.         db 0xba;'│'
  895.         db 1
  896.         db ' '
  897.         db 14;wdtcolumn1
  898.         db ' ';0xb3;'│'
  899.         db 1
  900.         db ' '
  901.         db 10;wdtcolumn2
  902.         db 0xb3;'│'
  903.         db 1
  904.         db ' '
  905.         db 12;wdtcolumn3
  906.         db 0xba;'│'
  907.         db 1
  908.         db 0
  909.         endif
  910.  
  911. prendstroka
  912.         db 0xc8;'L'
  913.         db 1
  914.         db 0xcd;;'='
  915.         db 14;wdtcolumn1
  916.         db 0xcd;0xcf;'│'
  917.         db 1
  918.         db 0xcd;'='
  919.         db 10;wdtcolumn2
  920.         db 0xcf;'│'
  921.         db 1
  922.         db 0xcd;'='
  923.         db 12;wdtcolumn3
  924.         db 0xbc;'-'
  925.         db 1
  926.         db 0
  927.        
  928. prcrlf
  929.         ld de,tcrlf
  930.         ld hl,2
  931.         jp sendchars
  932. tcrlf
  933.         db 0x0d,0x0a
  934.  
  935.         if 1==0
  936. nv_copyscreen0to1
  937.         OS_GETMAINPAGES
  938.         push hl
  939.         ;OS_GETSCREENPAGES
  940.         ld a,(user_scr1_low) ;ok
  941.         ld l,a
  942.         ld a,(user_scr1_high) ;ok
  943.         ld h,a
  944.         ld a,(user_scr0_low) ;ok
  945.         ld e,a
  946.         ld a,(user_scr0_high) ;ok
  947.         ld d,a
  948.         push hl ;1 screen
  949.         push de ;0 screen
  950.         ld a,l
  951.         SETPG32KHIGH
  952.         pop de
  953.         push de
  954.         ld a,e
  955.         SETPG32KLOW
  956.         ld bc,0x4000
  957.         ld hl,0x8000
  958.         ld de,0xC000
  959.         ldir
  960.         pop de
  961.         pop hl
  962.         push de
  963.         ld a,h
  964.         SETPG32KHIGH
  965.         pop de
  966.         ld a,d
  967.         SETPG32KLOW
  968.         ld bc,0x4000
  969.         ld hl,0x8000
  970.         ld de,0xC000
  971.         ldir
  972.         pop hl
  973.         push hl
  974.         ld a,l
  975.         SETPG32KHIGH
  976.         pop hl
  977.         ld a,h
  978.         SETPG32KLOW
  979.         ret
  980.  
  981. nv_copyscreen1to0
  982.         OS_GETMAINPAGES
  983.         push hl
  984.         ;OS_GETSCREENPAGES
  985.         ld a,(user_scr1_low) ;ok
  986.         ld l,a
  987.         ld a,(user_scr1_high) ;ok
  988.         ld h,a
  989.         ld a,(user_scr0_low) ;ok
  990.         ld e,a
  991.         ld a,(user_scr0_high) ;ok
  992.         ld d,a
  993.         push hl ;1 screen
  994.         push de ;0 screen
  995.         ld a,l
  996.         SETPG32KHIGH
  997.         pop de
  998.         push de
  999.         ld a,e
  1000.         SETPG32KLOW
  1001.         ld bc,0x4000
  1002.         ld hl,0xc000
  1003.         ld de,0x8000
  1004.         ldir
  1005.         pop de
  1006.         pop hl
  1007.         push de
  1008.         ld a,h
  1009.         SETPG32KHIGH
  1010.         pop de
  1011.         ld a,d
  1012.         SETPG32KLOW
  1013.         ld bc,0x4000
  1014.         ld hl,0xc000
  1015.         ld de,0x8000
  1016.         ldir
  1017.         pop hl
  1018.         push hl
  1019.         ld a,l
  1020.         SETPG32KHIGH
  1021.         pop hl
  1022.         ld a,h
  1023.         SETPG32KLOW
  1024.         ret
  1025.         endif