home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / znode3 / uploads / zf11src.lbr / ZFSUBS4.ZZ0 / ZFSUBS4.Z80
Encoding:
Text File  |  1992-10-03  |  15.6 KB  |  839 lines

  1. .printx    Reading ZFSUBS4.Z80
  2. ;===========================================================================
  3. ;
  4. ; ZFSUBS4.Z80 - General Screen Output Routines
  5. ;
  6. ;===========================================================================
  7.  
  8. ; PRTSPAC - Print spaces - Reg B has number of spaces
  9.  
  10. prtspac:
  11.     inc    b        ; Test for B = 0
  12.     dec    b
  13.     ret    z
  14.     push    af        ; Save AF just in case
  15.     ld    a,' '
  16. prtspac1:
  17.     call    cout
  18.     djnz    prtspac1
  19.     pop    af
  20.     ret
  21.  
  22. ;---------------------------------------------------------------------------
  23.  
  24. ; PRDU - Print DU in HL
  25.  
  26. prdu:
  27.     push    hl        ; Save regs
  28.     push    bc
  29.  
  30.      if    revvideo
  31.     call    stndout        ; Dim
  32.       else
  33.     call    stndend
  34.      endif
  35.  
  36.     ld    a,h        ; Get drive
  37.     add    a,'A'        ; Convert to letter
  38.     call    cout
  39.     ld    a,l        ; Get user
  40.     ld    b,h        ; Get du in bc
  41.     ld    c,l
  42.     call    pafdc        ; Print user as floating
  43.     ld    a,':'        ; Print colon
  44.     call    cout
  45.     call    dutdir        ; Scan named directory table
  46.     jr    z,prdu2        ; No name?
  47.     ld    b,8        ; Print name
  48. prdu1:
  49.     ld    a,(hl)        ; Get char
  50.     cp    ' '        ; Done if space encountered
  51.     jr    z,prdu3
  52.     call    cout
  53.     inc    hl
  54.     djnz    prdu1
  55.     jr    prdu3
  56.  
  57. prdu2:
  58.     ld    hl,msg110    ; "Noname"
  59.     call    pstri
  60. prdu3:
  61.      if    revvideo
  62.     call    stndend        ; Bright
  63.      endif
  64.  
  65.     pop    bc        ; Restore regs
  66.     pop    hl
  67.     ret
  68.  
  69. ;---------------------------------------------------------------------------
  70.  
  71. ; File Name Printing Routines
  72.  
  73.  
  74. ; DISPCFN - Display file name of current file
  75.  
  76. dispcfn:
  77.     call    ringempt    ; Check ring empty
  78.     ret    z        ; Don't bother
  79.  
  80.      if    fcols eq 5
  81.     ld    hl,fnadr    ; Position cursor for file name print
  82.      else    ; four columns
  83.     ld    hl,fnadr-1    ; One position more to left
  84.      endif
  85.  
  86.     call    gotoxy
  87.     ld    hl,(ringpos)    ; Pt to current file name
  88.     inc    hl        ; Pt to first char
  89.  
  90. ; Use video to show file attributes.  Use '_' to show
  91. ;  spaces with attributes if not using reverse video, or to 
  92. ;  show all attributes if reverse/low video not available.
  93.  
  94.       if revvideo
  95.     push    af
  96.     call    stndout
  97.     pop    af
  98.       endif
  99.     ld    b,8        ; 8 chars
  100.     call    disp1
  101.     ld    a,'.'
  102.     call    cout
  103.     ld    b,3        ; File type and fall thru
  104. disp1:
  105.     ld    a,(hl)        ; Get char
  106.     cp    80h        ; 7th bit set?
  107.     jr    c,disp3        ; no
  108.  
  109.      if novid    ; terminals with no reverse/low video
  110.     ld    a,'_'        ; use '_' to show file attributes
  111.      else
  112.  
  113.      if not revvideo
  114.     cp    ' '+80h        ; space with 7th bit set?
  115.     jr    nz,disp2    ; no
  116.     ld    a,'_'        ; yes, use '_'
  117.      endif    ; not revvideo
  118. disp2:    
  119.     push    af
  120.       if    revvideo
  121.     call    stndend
  122.       else
  123.     call    stndout
  124.       endif
  125.     pop    af
  126.  
  127.      endif    ; novid
  128.  
  129. disp3:    
  130.     and    7fh        ; strip 7th bit 
  131.           call    cout        ; print char
  132.       if    revvideo
  133.     call    stndout
  134.       else
  135.     call    stndend
  136.       endif
  137.     inc    hl        ; Pt to next
  138.     djnz    disp1
  139.     ret
  140.  
  141.  
  142. ; PRFNS - Print File Name Pointed to by HL (saving HL)
  143.  
  144. prfnsx:
  145.     push    hl        ; Save hl
  146.     jr    prfns0
  147.  
  148. ; PRFNSX - Print file name in S$FCB (saving HL)
  149.  
  150. prfns:
  151.     push    hl        ; Affect only psw
  152.     ld    hl,s$fcb+1
  153.  
  154. prfns0:
  155.     push    bc        ; Save bc
  156.     call    prfnskip    ; Print file name with no spaces
  157.     pop    bc        ; Restore
  158.     pop    hl
  159.     ret
  160.  
  161.  
  162. ; PRFN - Print file name pted to by HL
  163.  
  164. prfn:
  165.     xor    a        ; Preset for no char skipping
  166.     jr    prfnsk
  167.  
  168. prfnskip:
  169.     ld    a,' '        ; Preset for skipping spaces
  170.  
  171. prfnsk:
  172.     ld    c,a        ; Save char to skip in C
  173.     ld    b,8        ; 8 chars
  174.     call    prfns1
  175.     ld    a,'.'
  176.     call    cout
  177.     ld    b,3        ; File type and fall thru
  178.  
  179. prfns1:
  180.     ld    a,(hl)        ; Get char
  181.     and    7fh
  182.     call    setcase        ; Possible shift to lower case
  183.     cp    c        ; Is it char to skip?
  184.     call    nz,cout
  185.     inc    hl        ; Pt to next
  186.     djnz    prfns1
  187.     ret
  188.  
  189. ;--------------------
  190.  
  191. setcase:
  192.     push    bc
  193.     ld    b,a        ; Save character to display
  194.     ld    a,(casefl)    ; Check desired case
  195.     or    a
  196.     ld    a,b
  197.     pop    bc
  198.     ret    nz        ; If upper case desired, quit now
  199.     cp    'A'
  200.     ret    c        ; If less than 'A', no change needed
  201.     cp    'Z'+1
  202.     ret    nc        ; If greater than 'Z', no change needed
  203.     add    a,20h        ; Shift to lower case
  204.     ret
  205.  
  206. ;---------------------------------------------------------------------------
  207.  
  208.      if datestamp
  209.  
  210. ; BTIME - If real-time clock available, print 12-hour time in Banner, 
  211. ;      no leading zeroes.
  212.  
  213.     extrn    @b2hh,@b2hl    ; SYSLIB4
  214.  
  215. btime:
  216.     call    cpm3
  217.     jr    c,btime0    ; Not CPM Plus
  218.     ld    c,105
  219.     ld    de,81h
  220.     call    bdosptr
  221.     jr    time$ret
  222. btime0:
  223.     call    checkds        ; Clock address returned in HL 
  224.     ret    z        ; No clock
  225.     ld    de,time$ret
  226.     push    de        ; Return address on stack
  227.     push    hl        ; Clock address on stack
  228.     ld    hl,80h        ; Point to buffer
  229.     ret            ; Call clock (buffer filled)
  230.  
  231. time$ret:
  232.     ld    hl,1*256+18    ; Cursor to time location
  233.     call    gotoxy
  234.  
  235.     ld    hl,msg120    ; "Time:"
  236.     call    pstri
  237.  
  238.     ld    hl,83h        ; Point to hours
  239.     ld    a,(hl)
  240.     bit    7,(hl)        ; If relative time
  241.     ret    nz        ; ..don't display
  242.  
  243.     sub    13h        ; Time past 12:59?
  244.     jr    c,btime1    ; No, don't change
  245.     daa            ; Yes, decimal adjust
  246.     inc    a        ; Xlate to 12-hour
  247.     daa
  248.     ld    (hl),a        ; Save 2nd digit
  249.     jr    btime2
  250. btime1:
  251.     ld    a,(hl)
  252. btime2:    call    @b2hh        ; High nybble of A --> ASCII in A
  253.     cp    '0'        ; Leading zero?
  254.     jr    nz,btime3    ; No, display digit
  255.     ld    a,' '        ; Yes, leading space instead
  256. btime3:    call    btime4        ; Print hours
  257.       if    revvideo
  258.     call    stndout
  259.       endif
  260.     ld    a,':'
  261.     call    cout
  262.     inc    hl        ; Point to minutes
  263.     ld    a,(hl)
  264.     call    @b2hh
  265. btime4:
  266.       if    revvideo
  267.     push    af
  268.     call    stndout
  269.     pop    af
  270.       endif
  271.     call    cout        ; Show digit 1
  272.     ld    a,(hl)        ; Restore A
  273.     call    @b2hl        ; Low nybble A --> ASCII
  274.     call    cout
  275.       if    revvideo
  276.     call    stndend
  277.       endif
  278.     ret
  279.  
  280.      endif            ; Datestamp
  281.  
  282.  
  283. ; Test for CPM Plus
  284.  
  285. cpm3:
  286.     ld    c,dosver
  287.     call    bdosptr
  288.     cp    30h
  289.     ret
  290.  
  291. ;---------------------------------------------------------------------------
  292.  
  293. ; PRINT$FRE - Print free space on disk
  294.  
  295. print$fre:
  296.     call    erclr        ; Position and set flags
  297.     ld    hl,(disksp)
  298.     ld    a,swcon        ; Switch to console
  299.     ld    (sctlfl),a
  300.     call    shlfdc        ; # of free k-bytes in hl
  301.     ld    hl,msg111    ; "K Bytes free on Disk X:"
  302.     call    pstri
  303.     ld    hl,free$drv
  304.     jp    vpstr
  305. free$drv:
  306.     db    'X:',0
  307.  
  308. ;---------------------------------------------------------------------------
  309.  
  310. ; File Screen Display Routines
  311.  
  312.  
  313. ; REBUILD - Build Entire Screen
  314.  
  315. rebuild:
  316.     ld    hl,(curat)    ; Save cursor and ring positions
  317.     ld    (scurat),hl
  318.     ld    hl,(ringpos)
  319.     ld    (sringpos),hl
  320.     call    banner        ; Print banner
  321.     call    dirmore        ; Print current du:dir (and '[more files]' msg).
  322.  
  323.      if    bihelp        ; Built-in help?
  324.     ld    a,(helpdisp)    ; Display help?
  325.     or    a        ; 0=no
  326.     jr    z,reb1
  327.     call    helpmsg        ; Print help message
  328.     jr    reb2
  329. reb1:
  330.      endif            ; Bihelp
  331.  
  332.     call    cur$first    ; Position cursor at first position
  333.     ld    hl,(locbeg)    ; Pt to first file name
  334.     call    dispfiles    ; Display files
  335.     call    cur$first    ; Re-position cursor at first position
  336. reb2:
  337.     ld    hl,cpmadr    ; Command prompt message
  338.     call    gotoxy
  339.     ld    hl,msg112    ; "Command (..."
  340.     call    pstri        ; Prompt with drive prefix
  341.     ld    a,(helpdisp)    ; In help now?
  342.     or    a        ; 0=no
  343.     jr    z,reb3
  344.     ld    hl,msg113    ; "Files"
  345.     call    pstri
  346.     jr    reb4
  347.  
  348. reb3:
  349.     ld    hl,msg114    ; "Help"
  350.     call    pstri
  351.  
  352. reb4:
  353.     ld    hl,msg115    ; "X=Quit"
  354.     call    pstri
  355.  
  356. reb5:
  357.     ld    hl,(scurat)    ; Restore cursor and ring positions
  358.     ld    (curat),hl
  359.     ld    hl,(sringpos)
  360.     ld    (ringpos),hl
  361.     call    ringempt    ; Ring empty?
  362.     ret    z        ; No cursor
  363.     jp    setcur        ; Restore cursor on screen and return
  364.  
  365. ;------------------------------
  366.  
  367. ; REFRESH - Refresh Files Portion of Screen
  368.  
  369. refresh:
  370.     ld    hl,(curat)    ; Save cursor and ring positions
  371.     ld    (scurat),hl
  372.     ld    hl,(ringpos)
  373.     ld    (sringpos),hl
  374.     ld    hl,(ring)
  375.     ld    (ringpos),hl    ; Beginning of file display
  376.     call    dirmore        ; Print current du:dir (and '[more files]' msg).
  377.  
  378.      if    bihelp        ; Built-in help?
  379.     ld    a,(helpdisp)    ; Display help?
  380.     or    a        ; 1=yes
  381.     jr    nz,ref1
  382.      endif            ; Bihelp
  383.  
  384.     call    cur$first    ; Set cursor top left
  385.     ld    hl,(locbeg)    ; Beginning of current screen
  386.     call    dispfiles    ; Display files
  387. ref1:
  388.     ld    hl,(scurat)    ; Restore cursor and ring positions
  389.     ld    (curat),hl
  390.     ld    hl,(sringpos)
  391.     ld    (ringpos),hl
  392.     ret
  393.  
  394. ;------------------------------
  395.  
  396. ; BANNER - Print ZFILER Banner
  397.  
  398. banner:
  399.     call    cls        ; Clear screen
  400.  
  401.      if    fcols eq 5
  402.     ld    hl,banadr
  403.      else ; four columns
  404.     ld    hl,banadr-2    ; Two spaces to left
  405.      endif
  406.  
  407.     call    gotoxy
  408.     call    vprint        ; Print banner
  409.      if    not revvideo
  410.     db    dim
  411.      endif
  412.     db    'ZFILER ',vers/10+'0','.',vers mod 10+'0'
  413.  
  414.      if    subvers eq ' '
  415.  
  416.     db    '  '
  417.  
  418.      else
  419.  
  420.     db    subvers
  421.  
  422.      if    usestk
  423.     db    ' '
  424.      else    ; using system file
  425.     db    'f'
  426.      endif    ; usestk
  427.  
  428.      endif    ; subvers eq ' '
  429.  
  430.     db    '   '
  431.  
  432.      if    not revvideo
  433.     db    dim
  434.      endif
  435.     db    0
  436.     
  437.     ld    hl,msg116    ; "Current File:"
  438.     jp    pstri
  439.  
  440. ;------------------------------
  441.  
  442. ; DIRMORE - Print Current Directory (and Possibly '[More Files]') messages
  443.  
  444. dirmore:
  445.      if    fcols eq 5
  446.     ld    hl,duadr    ; Du screen address
  447.      else    ; four columns
  448.     ld    hl,duadr+2    ; Two columns to right
  449.      endif
  450.  
  451.     call    gotoxy
  452.     ld    hl,(du$req)    ; Get current du
  453.     call    prdu        ; Print du:dir>
  454.  
  455.     call    public
  456.     jr    z,dirmr0    ; Not public
  457.     call    vprint
  458.     db    ' [PUBLIC]',0
  459.  
  460. dirmr0:
  461.      if    fcols eq 5
  462.     ld    hl,moreadr    ; More screen address
  463.      else    ; four columns
  464.     ld    hl,moreadr-1    ; One column more to left
  465.      endif
  466.  
  467.     call    gotoxy
  468.     ld    hl,(ringcnt)    ; Get # files in ring.
  469.     ld    de,eps        ; And maximum number that can be displayed.
  470.     call    cmpdehl
  471.     jr    nc,dirmr1    ; Br if all files will be displayed.
  472.     ld    hl,msg117    ; "[More Files]"
  473.     jp    pstri
  474.  
  475. dirmr1:
  476.     call    vprint
  477.     db    bright,0
  478.     ld    b,12        ; Print 12 spaces
  479.     jp    prtspac        ; And return
  480.  
  481. ;------------------------------
  482.  
  483. ; DISPFILES - Refresh File Display
  484.  
  485. dispfiles:
  486.     ld    a,(caseflag)
  487.     ld    (casefl),a
  488.     call    dispfils
  489.     ld    a,0ffh
  490.     ld    (casefl),a
  491.     ret
  492.  
  493. dispfils:
  494.     ld    (locpos),hl    ; Save local position
  495. dspf1:
  496.     ld    hl,(locend)    ; At end?
  497.     ex    de,hl
  498.     ld    hl,(locpos)
  499.     call    cmpdehl
  500.     ret    z        ; Return if done.
  501.  
  502.     call    vprint
  503.      if    fcols eq 4
  504.     db    '    ',0    ; 4 spaces
  505.      else
  506.     db    '  ',0        ; 2 spaces
  507.      endif
  508.  
  509.     push    hl        ; Save current local position in ring
  510.     call    reffnt        ; Print file name, tag.
  511.     pop    hl        ; Get current local position
  512.     ld    de,eltsiz
  513.     add    hl,de
  514.     ld    (locpos),hl
  515.     call    cur$next    ; Advance cursor
  516.     jr    dspf1
  517.  
  518. ;---------------------------------------------------------------------------
  519.  
  520. ; FINDSCR - Find screen containing file at RINGPOS
  521. ;   Set the screen accordingly and position cursor
  522.  
  523. findscr:
  524.     ld    hl,(ring)    ; Begin at the beginning
  525. fndscr1:
  526.     push    hl        ; Maybe this is it, save it
  527.     ld    de,eps*eltsiz    ; One screen
  528.     add    hl,de        ; Next screen
  529.     ld    de,(ringpos)
  530.     call    cmpdehl
  531.     jr    c,fndscr2    ; Found it
  532.     pop    de        ; Adjust the stack
  533.     jr    fndscr1        ; Try again
  534. fndscr2:
  535.     pop    hl        ; Beginning of this screen
  536.     call    setscr2        ; Set LOCBEG and LOCEND
  537.  
  538. ; Position cursor at RINGPOS
  539.  
  540.     ld    hl,curhome
  541.     ld    (curat),hl    ; First position
  542.     ld    hl,(locbeg)
  543. fndnxt:
  544.     ld    de,(ringpos)
  545.     call    cmpdehl
  546.     ret    z        ; We are there
  547.     ld    de,eltsiz    ; One element length
  548.     add    hl,de
  549.     push    hl
  550.     call    psn$next    ; Advance cursor
  551.     pop    hl
  552.     jr    fndnxt        ; Try again..
  553.  
  554.  
  555. ; SETSCR - Setup Screen Display Variables
  556.  
  557. setscr:
  558.     ld    hl,curhome    ; Set cursor home
  559.     ld    (curat),hl
  560.     ld    hl,(ring)    ; Set ring position
  561.  
  562. ; Entry to Reset Ring Position at HL
  563.  
  564. setscr1:
  565.     ld    (ringpos),hl
  566.  
  567. ; Entry to Reset Local Ring Position at HL
  568.  
  569. setscr2:
  570.     ld    (locbeg),hl    ; Front of ring
  571.     ld    de,eps*eltsiz    ; New end?
  572.     add    hl,de
  573.     ld    de,(ringend)    ; End of ring
  574.     call    cmpdehl
  575.     jr    nc,setscr3
  576.     ex    de,hl
  577. setscr3:
  578.     ld    (locend),hl
  579.     ret
  580.  
  581. ;---------------------------------------------------------------------------
  582.  
  583. ; CUR Subroutines to position the cursor
  584.  
  585.  
  586. ; CUR$FIRST - Home the Cursor
  587.  
  588. cur$first:
  589.     ld    hl,curhome    ; Home address
  590.     ld    (curat),hl    ; Set cursor position
  591.     jp    gotoxy
  592.  
  593.  
  594. ; CUR$LAST - Move Cursor to Last File Position
  595.  
  596. cur$last:
  597.     call    psn$last    ; Position cursor
  598. cur$new:
  599.     ld    hl,(curat)    ; Set new cursor position
  600.     jp    gotoxy
  601.  
  602.  
  603. ; CUR$NEXT - Move Cursor to Next File Position
  604.  
  605. cur$next:
  606.     call    psn$next    ; Position cursor
  607.     jr    cur$new        ; Set new cursor position
  608.  
  609.  
  610. ; CUR$BACK - Move Cursor to Previous File Position
  611.  
  612. cur$back:
  613.     call    psn$back    ; Position cursor
  614.     jr    cur$new        ; Set new cursor position
  615.  
  616.  
  617. ; CUR$DOW - Move Cursor Down a File Position
  618.  
  619. cur$down:
  620.     call    psn$down    ; Position cursor
  621.     jr    cur$new        ; Set new cursor position
  622.  
  623.  
  624. ; PSN Subroutines manipulate the CURAT value without moving cursor
  625.  
  626.  
  627. ; PSN$LAST - Set Last File Position
  628.  
  629. psn$last:
  630.     ld    hl,(ringpos)    ; Advance
  631. pl0:
  632.     ld    de,eltsiz
  633.     add    hl,de
  634.     ex    de,hl
  635.     ld    hl,(locend)    ; End of local ring?
  636.     call    cmpdehl
  637.     ret    z
  638.     call    psn$next    ; Advance cursor position.
  639.     ex    de,hl        ; Get position
  640.     jr    pl0
  641.  
  642.  
  643. ; PSN$NEXT - Advance the Cursor Position
  644.  
  645. psn$next:
  646.     ld    hl,(curat)    ; Compute new position
  647.     ld    a,l        ; Check for new line
  648.     add    a,entsiz    ; Size of each entry
  649.     cp    entsiz*[fcols-1]+2 ; Last column?
  650.     jr    nc,pn1        ; Advance to next line
  651.     ld    l,a        ; New position
  652.     ld    (curat),hl
  653.     ret
  654.  
  655. pn1:
  656.     ld    a,h        ; Get line
  657.     ld    hl,curhome    ; Get col
  658.     ld    h,a        ; Set line and continue with psn$down
  659.     ld    (curat),hl
  660.  
  661. ; PSN$DOWN - Move Cursor Position Down One Line
  662.  
  663. psn$down:
  664.     ld    hl,curhome    ; Get home address
  665.     ld    b,h        ; Line in b
  666.     ld    hl,(curat)    ; Get current address
  667.     inc    h        ; Move down
  668.     ld    a,h        ; Check for too far
  669.     sub    b
  670.     cp    eps/fcols
  671.     jr    c,pd1        ; Ok, so save position
  672.     ld    a,l        ; Get col
  673.     ld    hl,curhome
  674.     ld    l,a
  675. pd1:
  676.     ld    (curat),hl
  677.     ret
  678.  
  679. ; PSN$BACK - Back Up the Cursor Position
  680.  
  681. psn$back:
  682.     ld    de,curhome    ; Get home address
  683.     ld    hl,(curat)
  684.     call    cmpdehl        ; Compare
  685.     jr    z,psn$last    ; Goto end if last
  686.     ld    a,l        ; Check for first col
  687.     cp    e
  688.     jr    z,pb1
  689.     sub    entsiz        ; Back up one col
  690.     ld    l,a
  691.     ld    (curat),hl    ; New pos
  692.     ret
  693.  
  694. pb1:
  695.     ld    a,e        ; Get home col
  696.     add    a,entsiz*[fcols-1] ; Get last col
  697.     ld    l,a
  698.     dec    h        ; Prev line
  699.     ld    (curat),hl
  700.     ret
  701.  
  702. ; SETCUR - Position Cursor at CURAT
  703.  
  704. setcur:
  705.     ld    a,(helpdisp)    ; Nogo if help display is active.
  706.     or    a
  707.     ret    nz
  708.     ld    hl,(curat)
  709.     call    gotoxy
  710.     call    vprint
  711.  
  712.      if    revvideo
  713.  
  714.     db    dim
  715.      if    fcols eq 4
  716.     db    '-->',bright,' '
  717.      else    ; not fcols eq 4
  718.     db    '->',bright
  719.      endif    ; fcols eq 4
  720.  
  721.      else    ; not revvideo
  722.  
  723.      if    fcols eq 4
  724.     db    '--> '
  725.      else    ; not fcols eq 4
  726.     db    '->'
  727.      endif    ; fcols eq 4
  728.  
  729.      endif    ; revvideo
  730.  
  731.     db    0
  732.  
  733.     ret
  734.  
  735. ; CLRCUR - Clear Cursor
  736.  
  737. clrcur:
  738.     ld    a,(helpdisp)    ; Nogo if help display is active.
  739.     or    a
  740.     ret    nz
  741.     ld    hl,(curat)
  742.     call    gotoxy
  743.     call    vprint
  744.      if    fcols eq 4
  745.     db    bright,'    ',0
  746.      else
  747.     db    bright,'  ',0
  748.      endif
  749.     ret
  750.  
  751. ;---------------------------------------------------------------------------
  752.  
  753. ; Command Prompts and Messages
  754.  
  755.  
  756. ; CPRMPT - Command Prompt
  757.  
  758. ; Clear any existing prompt and position cursor for new prompt (either
  759. ; on the error message or command line).
  760.  
  761. erclr:
  762. eprmpt:
  763.     push    hl
  764.     ld    hl,eradr    ; Get error line cursor address
  765.     ld    a,(erecnt)    ; Get # chars to erase.
  766.     jr    xprmpt        ; Clear line and position cursor
  767.  
  768. cprmpt:
  769.     push    hl
  770.     ld    hl,cpadr    ; Get command line cursor address
  771.     ld    a,(cpecnt)    ; Get # chars to erase.
  772.  
  773. xprmpt:
  774.     push    bc
  775.     ld    b,a        ; Number of characters in B
  776.     push    hl        ; Save cursor address
  777.     call    gotoxy        ; Set cursor.
  778.  
  779.      if    revvideo
  780.     call    stndend        ; Dim
  781.       else
  782.     call    stndout
  783.      endif
  784.  
  785.     call    ereol        ; Erase to eol
  786.     pop    hl        ; Restore address
  787.     pop    bc
  788.     call    gotoxy        ; Position cursor
  789.     pop    hl
  790.     ret
  791.  
  792. ; Clear command prompt and print a language-dependent message.
  793.  
  794. cprmpt2:
  795.     call    cprmpt        ; Clear prompt and position cursor
  796.     jp    pstri        ; Print message and return
  797.  
  798. ; Clear command prompt and print a language-dependent message with yes/no
  799. ; suffix.
  800.  
  801. cprmptyn:
  802.     call    cprmpt        ; Clear prompt and position cursor
  803.     jp    pstriyn        ; Print message with '(Y/N)' and return
  804.  
  805. ; ERMSG - Error Message
  806.  
  807. ermsg2:
  808.     call    eprmpt        ; Clear error message line and position cursor
  809.     jp    pstri        ; Print message
  810.  
  811.  
  812. ; WORKMSG - Working Message
  813.  
  814. workmsg:
  815.     ld    hl,msg118    ; "Working ..."
  816.     jp    ermsg2
  817.  
  818.  
  819. ; ATCMD - Position at Command Prompt and Clear It
  820.  
  821. atcmd:
  822.      if datestamp
  823.     push    bc
  824.     call    btime        ; Refresh time
  825.     jr    atcmd2
  826.      endif
  827. atcmd1:                ; No time
  828.     push    bc
  829. atcmd2:
  830.     ld    hl,cpadr    ; Position cursor
  831.     call    gotoxy
  832.     ld    a,(cpecnt)    ; Get # chars to erase.
  833.     ld    b,a        ; In b.
  834.     call    ereol        ; Clear message
  835.     pop    bc
  836.     ret
  837.  
  838. ; End of ZFSUBS4.Z80
  839.