home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / zsus / progpack / debug11.lbr / HARDVID.LZB / HARDVID.LIB
Encoding:
Text File  |  1992-05-13  |  1.6 KB  |  120 lines

  1. ; HARDVID.LIB - Rob Friefeld
  2.  
  3. ; Hard-coded CRT protocol to replace some VLIB routines.
  4.  
  5. ;STANDARD EQUATES REQUIRED
  6. ;wrconf    equ    2    ; bdos function
  7. ;cr    equ    0dh
  8. ;lf    equ    0ah
  9. ;esc    equ    1bh
  10. ;dim    equ    1    ; vprint functions
  11. ;bright    equ    2
  12.  
  13. rcpuse    equ    -1    ; if used for assembling an RCP, true = -1
  14.  
  15. clr_scr    macro
  16.     db    1ah+80h
  17.     endm
  18.  
  19. clr_eol    macro
  20.     db    esc,'T'+80h
  21.     endm
  22.  
  23. dim_on    macro
  24.     db    esc,')'+80h
  25.     endm
  26.  
  27. dim_off    macro
  28.     db    esc,'('+80h
  29.     endm
  30.  
  31. ; Clear screen.  Return NZ.
  32.  
  33.      if    rcpuse
  34.      if    [not clson]
  35. cls:    call    vprint
  36.     clr_scr
  37.     or    -1
  38.     ret
  39.      endif    ; not clson
  40.      endif    ; rcpuse
  41.  
  42. ; Erase to end of line.  Return NZ.
  43. ereol:    call    vprint
  44.     clr_eol
  45.     or    -1
  46.     ret
  47.  
  48. ; Dim video
  49. stndout:
  50.     call    vprint
  51.     dim_on
  52.     or    -1
  53.     ret
  54.  
  55. ; Normal video
  56. stndend:
  57.     call    vprint
  58.     dim_off
  59.     or    -1
  60.     ret
  61.  
  62. ; Position cursor to row, column of next two data bytes.  Home = 1,1!!!
  63. ; Use sequence esc,'=',row+20h,col+20h
  64. ; Affect no regs
  65.  
  66. at:    ex    (sp),hl
  67.     call    at1        ; HL -> position bytes
  68.     ex    (sp),hl
  69.     ret
  70. at1:
  71.     push    af
  72.     ld    a,(hl)        ; Row
  73.     add    31        ; Offset
  74.     ld    (atrow),a    ; Save it
  75.     inc    hl        ; Col byte
  76.     ld    a,(hl)
  77.     add    31
  78.     ld    (atcol),a
  79.     inc    hl        ; Return address from AT
  80.     call    vprint        ; Print leadin sequence
  81.     db    esc,'='
  82. atrow:    ds    1        ; Output computed row,col
  83. atcol:    ds    1
  84.     db    0
  85.     pop    af
  86.     ret
  87.  
  88. ; Position cursor to H = row, L = column
  89. ; Return NZ
  90. gotoxy:
  91.     ld    a,h    ; Save row, col bytes and use AT routine
  92.     ld    (gtxyr),a
  93.     ld    a,l
  94.     ld    (gtxyc),a
  95.     call    at
  96. gtxyr:    ds    1
  97. gtxyc:    ds    1
  98.     or    -1
  99.     ret
  100.  
  101.  
  102. tinit:
  103.     ret
  104.  
  105. dinit:
  106.     ret
  107.  
  108. ; END
  109. gtxyr),a
  110.     ld    a,l
  111.     ld    (gtxyc),a
  112.     call    at
  113. gtxyr:    ds    1
  114. gtxyc:    ds    1
  115.     or    -1
  116.     ret
  117.  
  118.  
  119. tinit:
  120.     ret