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 / CPM / C128 / WS-C128.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  6KB  |  177 lines

  1. ;
  2. ; WS.MAC  --  Overlay for WordStar Release 4 on the Commodore 128
  3. ;
  4. ; This is an overlay for WS.COM that will allow you to use all the
  5. ; video attributes to show printer codes on the screen of a color
  6. ; monitor.  The overlay provides for the following attributes:
  7. ;    Normal text            bright video
  8. ;    Strike-out (^PX)        alternate color
  9. ;    Error messages            blink
  10. ;    Marked block (^KB, ^KK)        reverse video
  11. ;    Underlined text (^PS)        underlined
  12. ;    Subscripts (^PV)        alternate color
  13. ;    Superscripts (^PT)        alternate color
  14. ;    Boldface text (^PB and ^PD)    dim video
  15. ;    Italic text (^PY)        alternate color
  16. ;
  17. ; This particular selection will allow for all the various printer
  18. ; codes to appear differently and it combination (e.g, boldfaced
  19. ; italic text will be in dim alternate color).  Italic, Strike-out,
  20. ; Superscripts, and Subscripts all appear in the same alternate 
  21. ; color because two colors cannot be displayed simultaneously and
  22. ; these codes are less commonly used.
  23. ;
  24. ; A few other changes are made to WS.COM by this overlay:
  25. ;    The delete character will be display by the standard Commodore
  26. ;        CP/M delete character, instead of DEL.
  27. ;    The BRITE label is set so WordStar displays normal text in 
  28. ;        brite video, instead of dim (which doesn't look too
  29. ;        good on a color monitor).
  30. ;    Various delays have been changed to MicroPro's recommendations
  31. ;        for a 2-megahertz CPU.
  32. ;
  33. ; Before using this overlay, you MUST change the colors at the labels
  34. ; ColOn and ColOff to suit the colors you will be using.  You should
  35. ; just use the name of the colors as listed in the equates below.
  36. ; Color names beginning with 'd' indicate a dark color, e.g., 'dred' means
  37. ; dark red.  ColOn is for the color you will use to highlight the 
  38. ; alternate color modes listed above.  ColOff is the color you use for
  39. ; normal text.  If you don't change them, your alternate color will be
  40. ; cyan and your normal text will be in yellow.
  41. ;
  42. ; After you've selected the colors, assemble the overlay with MAC:
  43. ;    A>MAC WS-C128
  44. ; Then use MLOAD or SID to overlay your WS.COM:
  45. ;    A>MLOAD NEWWS.COM=OLDWS.COM,WS-C128.HEX
  46. ; After you've tested it, rename NEWWS.COM to WS.COM and put it on your
  47. ; WordStar disk.  Enjoy!
  48. ;
  49. ;    Gene Pizzetta
  50. ;    481 Revere Street
  51. ;    Revere, MA  02151
  52. ;    Voice (617) 284-0891
  53. ;    Compuserve 72060,505
  54. ;    QuantumLink GeneP
  55. ;
  56. ;
  57. String    equ    0283h        ; WS string out routine
  58. esc    equ    1Bh
  59. cr    equ    0Dh
  60. lf    equ    0Ah
  61. ;
  62. black    equ    20h        ; these equates use physical color numbers
  63. white    equ    21h        ; ..rather than logical color numbers.
  64. dred    equ    22h        ; ..Ordinarily it's best to use logical
  65. cyan    equ    23h        ; ..color numbers, but they aren't affected
  66. purple    equ    24h        ; ..by the 'dim' escape sequence.  So, in
  67. dgreen    equ    25h        ; ..this case, physical colors are best.
  68. dblue    equ    26h
  69. yellow    equ    27h
  70. dpurple    equ    28h
  71. dyellow    equ    29h
  72. red    equ    2Ah
  73. dcyan    equ    2Bh
  74. mgray    equ    2Ch
  75. green    equ    2Dh
  76. blue    equ    2Eh
  77. gray    equ    2Fh
  78. ;
  79. ;
  80. ; Delete Display String
  81. ;
  82. ; The following string indicates to WordStar how to display a delete
  83. ; character (hex 7F) on the screen while editing.  On terminals that
  84. ; interpret the delete character code into a displayable character, it
  85. ; is recommended that DELSTR be translated into the delete code itself
  86. ; (length of 1, then 7Fh).  All characters in the string must display.
  87. ;
  88.     org    0326h
  89. ;
  90. DELSTR:    db    1,7Fh        ; Commodore displays it ...
  91. ;
  92. ;
  93. ; The following string is used at sign-on to describe the type
  94. ; of terminal being used by WordStar.  Up to 40 bytes are available
  95. ; for the string, including its null terminator.
  96. ;
  97.     org    0342h
  98. ;
  99. CRTID:    db    'Commodore 128  --  CP/M Plus',cr,lf,0
  100. ;
  101. ;
  102. ; Video attributes are used in various places on the WordStar display.
  103. ; (for complete information see PATCH.LST on your WordStar disk.)
  104. ; The VIDATT subroutine is used to change video attributes on the screen.
  105. ; This subroutine is called only when a video attribute changes.
  106. ;
  107.     org    03C1h        ; org at VIDATT
  108. ;
  109. VIDATT:    mov    a,c
  110.     xra    b
  111.     ani    00001111b    ; any change in the 'G' codes?
  112.     jz    VIDA0        ; (no)
  113.     lxi    h,AttOff    ; yes, turn them all off
  114.     call    String
  115.     lxi    h,RevOn        ; is it a marked block?
  116.     mov    a,c
  117.     ani    00000100b
  118.     cnz    String
  119.     lxi    h,BliOn        ; is it an error message?
  120.     mov    a,c
  121.     ani    00000010b
  122.     cnz    String
  123.     lxi    h,UndOn        ; is it underlined text?
  124.     mov    a,c
  125.     ani    00001000b
  126.     cnz    String
  127. VIDA0:    mov    a,c        ; strike-out, italic, super-, subscript?
  128.     ani    10110001b
  129.     jz    VIDA1
  130.     lxi    h,ColOn        ; change to the alternate color
  131.     call    String
  132.     jmp    VIDA2
  133. VIDA1:    lxi    h,ColOff    ; change to normal color
  134.     call    String
  135. VIDA2:    lxi    h,DimOn        ; do we have bold or doublestrike?
  136.     mov    a,c        ; (dim must be last attribute selected)
  137.     ani    01000000b
  138.     jz    String        ; yes, go dim
  139.     lxi    h,DimOff
  140.     jmp    String        ; no, go bright
  141. ;
  142. AttOff:    db    3,esc,'G0'
  143. RevOn:    db    3,esc,'G4'
  144. BliOn:    db    3,esc,'G2'
  145. UndOn:    db    3,esc,'G3'
  146. DimOff:    db    2,esc,'('
  147. DimOn:    db    2,esc,')'
  148. ColOff:    db    4,esc,esc,esc,yellow    ; this sets normal text color
  149. ColOn:    db    4,esc,esc,esc,cyan    ; this sets alternate color
  150. ;
  151. ;
  152. ; Normally the status line, text and directories are displayed in
  153. ; dim intensity so that bold and doublestruck text can be shown in
  154. ; high intensity.  Setting BRITE to OFFh reverses the usage of
  155. ; bright and dim for the status line, text, and directories; normally
  156. ; zero.
  157. ;
  158.     org    0441h
  159. ;
  160. BRITE:    db    0FFh        ; 0 = text dim, 0FFh = text bright
  161. ;
  162. ;
  163. ; Delays -- Each delay is approximately the number of milliseconds
  164. ; on a 4-Mhz Z80 processor, about twice as long on a 2-Mhz 8080.
  165. ;
  166.     org    0444h
  167. ;
  168. DXOFF:    dw    1000        ; time-out for terminal (was 2000)
  169. DLONG:    dw    1000        ; long delays (was 2000)
  170. DMED:    dw    500        ; medium delays (was 1000)
  171. DSHORT:    dw    100        ; short delays (was 200)
  172. UPDLY:    dw    100        ; update delay (was 200)
  173. DDISK:    dw    500        ; disk access delay (no change)
  174. DFAST:    dw    25        ; delay when fast typing (was 50)
  175. ;
  176.     end
  177.