home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / BEEHIVE / UTILITYS / PRNTEP06.ARK / EPSON.MAC < prev    next >
Text File  |  1989-09-27  |  2KB  |  113 lines

  1.     .z80
  2.     .comment    ~
  3.  
  4. This is a printing module for any Epson ?X-??? printer. It prints the contents
  5. of the line buffer to the printer, using an <esc>*04<n2><n1> sequence to set up
  6. the graphics.
  7.  
  8.     ~
  9.  
  10. true    equ    -1
  11. false    equ    0
  12.  
  13.  
  14.     dseg
  15. grafixon:    db    '*',4,'$';the character (string) to send to the printer
  16.                 ;to turn on bit-image mode 
  17.  
  18. hib4low        equ    false    ;Look in your printer manual to determine how
  19.                 ;to set this. If true, then the high byte
  20.                 ;of the line length is sent first
  21.  
  22.  
  23. prset2::        ;<--- DO NOT CHANGE THIS
  24.  
  25. ;    Set line spacing to 8/72", set condensed type.
  26. ;[Setting condensed type is a damn good idea since the header line tends
  27. ; to be on the long side!!]
  28.  
  29.     db    27,'@',27,'C',70,27,'A',8,15    ;string to set the spacing for the printer
  30.     db    '$'
  31.  
  32. preset::        ;<--- DO NOT CHANGE THIS
  33.  
  34. ;    Line spacing at 12/72" (1/6"), condensed type off
  35.  
  36.     db    12,27,'@',27,'C',70,13
  37.     db    '$'        ;reset string
  38.  
  39. prtype::        ;<--- DO NOT CHANGE THIS
  40.  
  41.     db    'Epson LX-800, 70 line paper'
  42.     db    13,10,'$'
  43.  
  44.     cseg
  45.  
  46. pline::            ;<--- DO NOT CHANGE THIS. This symbol is the entry
  47.             ;                         point to the routine
  48.  
  49.     ld    hl,print_bufr##    ;find first thing to print to
  50.     ld    de,575
  51.     add    hl,de
  52.  
  53. ploop2:    ld    a,(hl)
  54.     or    a
  55.     jr    nz,found_end
  56.     dec    hl
  57.     jr    ploop2
  58. found_end:
  59.     ld    de,print_bufr##    ;tell printer how many things to print
  60.     and    a        ;trash carry
  61.     sbc    hl,de
  62.     inc    hl        ;this since the value in hl was an offset from
  63.                 ;the start of the buffer
  64.     ld    a,h
  65.     or    l
  66.     jr    z,pnewline    ;nothing, so skip the line
  67.     ld    a,27
  68.     call    wrlst##
  69.     ld    de,grafixon
  70.     call    lpstr##
  71.  
  72.     if hib4low
  73.     ld    a,h
  74.     else
  75.     ld    a,l
  76.     endif
  77.     call    wrlst##
  78.  
  79.     if hib4low
  80.     ld    a,l
  81.     else
  82.     ld    a,h
  83.     endif
  84.     call    wrlst##
  85.  
  86.  
  87.     ld    c,l
  88.     ld    b,h        ;transfer to bc
  89.     ld    hl,print_bufr##
  90. prit:    ld    a,(hl)
  91.     call    wrlst##
  92.     inc    hl
  93.     dec    bc
  94.     ld    a,c
  95.     or    b
  96.     jr    nz,prit        ;do a line
  97. pnewline:
  98.     ld    a,13
  99.     call    wrlst##
  100.     ld    a,10
  101.     call    wrlst##
  102.     ld    hl,prlincnt##
  103.  
  104. ;    The main program uses prlincnt## to determine when it reaches the
  105. ;    end of the file, hence it is essential to increment it if you want
  106. ;    to avoid grabage after your picture. [note this doesn't happen very
  107. ;    often, but better safe than sorry, eh?]
  108.  
  109.     inc    (hl)
  110.     ret            ;done!
  111.  
  112.     end
  113.