home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / znode3 / uploads / ws4-my.lbr / WS4-MY.ZZ0 / WS4-MY.Z80
Encoding:
Text File  |  1993-02-13  |  6.3 KB  |  199 lines

  1. ; WS4-MY.Z80
  2. ;    Overlay for WordStar CP/M Release 4 under MYZ80.
  3. ;
  4. ; Version 1.0 -- February 13, 1993 -- Gene Pizzetta
  5. ;    This overlay has been adapted from the one I did for my
  6. ;    TeleVideo 965 several years ago, but MYZ80's attributes
  7. ;    required a bit of tweeking to get them to work properly
  8. ;    (see notes at VIDATT).
  9. ;
  10. ; This is an overlay for WS.COM that will allow you to use all the
  11. ; video attributes to show printer codes on the screen.  The overlay
  12. ; provides for the following attributes:
  13. ;    Normal text            dim video
  14. ;    Strike-out (^PX)        underlined (alternate color)
  15. ;    Error messages            blink
  16. ;    Marked block (^KB, ^KK)        reverse video
  17. ;    Underlined text (^PS)        underlined (alternate color)
  18. ;    Subscripts (^PV)        underlined (alternate color)
  19. ;    Superscripts (^PT)        underlined (alternate color)
  20. ;    Boldface text (^PB and ^PD)    bright video
  21. ;    Italic text (^PY)        underlined (alternate color)
  22. ;
  23. ; This particular selection will allow for all the various printer
  24. ; codes to appear differently and it combination (e.g, boldfaced
  25. ; italic text will be dim underlined.  Italic, Strike-out, Underlined,
  26. ; Superscripts, and Subscripts all appear underlined because we've
  27. ; run out of video attributes unless we can eventually use color.
  28. ; Note that since most IBM color adapters will not display underlined
  29. ; characters, underlining will appear as an alternate color on those
  30. ; screens.
  31. ;
  32. ; A few other changes are made to WS.COM by this overlay:
  33. ;
  34. ;     (1) The delete character will display as the standard IBM character
  35. ;    set delete character, instead of DEL.
  36. ;    (2) The BRITE label is set so WordStar displays normal text in 
  37. ;    dim video.
  38. ;    (3) Various delays have been changed to MicroPro's recommendations
  39. ;    for a 9-megahertz CPU, which seem to work under MYZ80 just like
  40. ;    do on my SB180.
  41. ;
  42. ; Assemble this overlay with Z80ASM:
  43. ;        A0>Z80ASM WS4-MY/H
  44. ;
  45. ; Then use MYLOAD to overlay your WS.COM:
  46. ;        A>MYLOAD NEWWS.COM=WS.COM,WS4-MY.HEX
  47. ;
  48. ; After you've tested it, rename NEWWS.COM to WS.COM and move it to your
  49. ; WordStar directory.
  50. ;
  51. ;    Gene Pizzetta
  52. ;    481 Revere Street
  53. ;    Revere, MA  02151
  54. ;    Voice (617) 284-0891
  55. ;    Newton Centre Z-Node (617) 965-7259
  56. ;
  57. String    equ    0283h        ; WS string out routine
  58. ESC    equ    1Bh
  59. CR    equ    0Dh
  60. LF    equ    0Ah
  61. ;
  62. ;
  63. ; Delete Display String
  64. ;
  65. ; The following string indicates to WordStar how to display a delete
  66. ; character (hex 7F) on the screen while editing.  On terminals that
  67. ; interpret the delete character code into a displayable character, it
  68. ; is recommended that DELSTR be translated into the delete code itself
  69. ; (length of 1, then 7Fh).  All characters in the string must display.
  70. ;
  71.     org    0326h
  72. ;
  73. DELSTR:    db    1,7Fh        ; IBM displays it
  74. ;
  75. ;
  76. ; The following string is used at sign-on to describe the type
  77. ; of terminal being used by WordStar.  Up to 40 bytes are available
  78. ; for the string, including its null terminator.
  79. ;
  80.     org    0342h
  81. ;
  82. CRTID:    db    'MyZ80 Emulator',cr,lf,0
  83. ;
  84. ;
  85. ; After the screen is erased, WordStar assumes that the video
  86. ; attributes are set to normal (dim for the example terminal),
  87. ; and that the cursor is at the home position (upper left hand
  88. ; corner).
  89. ;
  90.     org    0386h
  91. ;
  92. ERASCR:    db    4        ; number of characters
  93.     db    1Ah        ; to clear screen
  94.     db    ESC,'G0'    ; to set dim
  95. ;
  96. ;
  97. ; Terminal un-initialization string.  A string of bytes which will
  98. ; be sent tothe terminal at the end of a session.  See also UNISUB.
  99. ;
  100.     org    03B6h
  101. ;
  102. TRMUNI:    db    -1        ; number of bytes
  103.     dw    ERASCR        ; reset terminal to initial settings
  104.     db    0,0,0
  105. ;
  106. ;
  107. ; User-patchable initialization subroutine.  Called before TRINI string
  108. ; is sent.  This subroutine may be used for special console
  109. ; initialization or other purposes.
  110. ;
  111. INISUB:    nop
  112.     ret
  113. ;
  114. ; Video attributes are used in various places on the WordStar display.
  115. ; (for complete information see PATCH.LST on your WordStar disk.)
  116. ; The VIDATT subroutine is used to change video attributes on the screen.
  117. ; This subroutine is called only when a video attribute changes.
  118. ;
  119.     org    03C1h        ; org at VIDATT
  120. ;
  121. VIDATT:    ld    a,30h        ; set attributes to normal
  122.     ld    (AttChr),a
  123. ;
  124. ; MYZ80 doesn't properly clear attributes unless the attribute character
  125. ; is 30h ('0').  32h should set dim video on and turn other attributes off.
  126. ; It doesn't.  And dim video turns out to be bright video.  Oh, well . . .
  127. ; I didn't have to reset all the attributes first on my Televideo, so this
  128. ; was quite confusing to me at first.
  129. ;
  130.     call    VIDA4        ; clear everything
  131.     ld    a,c
  132.     and    11111111b    ; any attributes?
  133.     ret    z        ; (no, forget it!)
  134. ;
  135.     ld    a,c
  136.     and    00000100b    ; marked block (reverse)?
  137.     jr    z,VIDA0        ; (no)
  138.     ld    a,(AttChr)
  139.     or    4        ; add 4 to attribute char
  140.     ld    (AttChr),a
  141.  
  142. VIDA0:    ld    a,c
  143.     and    00000010b    ; error message (blink)?
  144.     jr    z,VIDA1        ; (no)
  145.     ld    a,(AttChr)
  146.     or    8        ; add 8 to attribute char
  147.     ld    (AttChr),a
  148.  
  149. VIDA1:    ld    a,c        ; is it underlined text, or strike-out,
  150.     and    10111001b    ; ..italic, super-, or subscript?
  151.     jr    z,VIDA2        ; (no)
  152.     ld    a,(AttChr)
  153.     or    1        ; add 1 to attribute char
  154.     ld    (AttChr),a
  155.  
  156. VIDA2:    ld    a,c
  157.     and    01000000b    ; do we have bold or doublestrike (bright)?
  158.     jr    z,VIDA4        ; (no, stay dim)
  159. VIDA3:    ld    a,(AttChr)
  160.     or    2        ; add 2 to attribute character
  161.     ld    (AttChr),a
  162.  
  163. VIDA4:    ld    hl,AttStg
  164.     jp    String        ; send string to terminal
  165. ;
  166.     org    04C0h
  167. ;
  168. AttStg:    db    3        ; number of characters
  169.     db    esc,'G'        ; lead-in
  170. AttChr:    db    30h        ; attribute character
  171. ;
  172. ; Normally the status line, text and directories are displayed in
  173. ; dim intensity so that bold and doublestruck text can be shown in
  174. ; high intensity.  Setting BRITE to OFFh reverses the usage of
  175. ; bright and dim for the status line, text, and directories; normally
  176. ; zero.
  177. ;
  178.     org    0441h
  179. ;
  180. BRITE:    db    0        ; 0 = text dim, 0FFh = text bright
  181. ;
  182. ;
  183. ; Delays -- Each delay is approximately the number of milliseconds
  184. ; on a 4-Mhz Z80 processor, about twice as long on a 2-Mhz 8080.
  185. ; They have been changed here for a 9-Mhz SB180; the original settings
  186. ; are noted in the comments.
  187. ;
  188.     org    0444h
  189. ;
  190. DXOFF:    dw    4000        ; time-out for terminal (was 2000)
  191. DLONG:    dw    2000        ; long delays (was 2000)
  192. DMED:    dw    2000        ; medium delays (was 1000)
  193. DSHORT:    dw    400        ; short delays (was 200)
  194. UPDLY:    dw    400        ; update delay (was 200)
  195. DDISK:    dw    500        ; disk access delay (no change)
  196. DFAST:    dw    100        ; delay when fast typing (was 50)
  197. ;
  198.     end
  199.