home *** CD-ROM | disk | FTP | other *** search
- ; WS4-MY.Z80
- ; Overlay for WordStar CP/M Release 4 under MYZ80.
- ;
- ; Version 1.0 -- February 13, 1993 -- Gene Pizzetta
- ; This overlay has been adapted from the one I did for my
- ; TeleVideo 965 several years ago, but MYZ80's attributes
- ; required a bit of tweeking to get them to work properly
- ; (see notes at VIDATT).
- ;
- ; This is an overlay for WS.COM that will allow you to use all the
- ; video attributes to show printer codes on the screen. The overlay
- ; provides for the following attributes:
- ; Normal text dim video
- ; Strike-out (^PX) underlined (alternate color)
- ; Error messages blink
- ; Marked block (^KB, ^KK) reverse video
- ; Underlined text (^PS) underlined (alternate color)
- ; Subscripts (^PV) underlined (alternate color)
- ; Superscripts (^PT) underlined (alternate color)
- ; Boldface text (^PB and ^PD) bright video
- ; Italic text (^PY) underlined (alternate color)
- ;
- ; This particular selection will allow for all the various printer
- ; codes to appear differently and it combination (e.g, boldfaced
- ; italic text will be dim underlined. Italic, Strike-out, Underlined,
- ; Superscripts, and Subscripts all appear underlined because we've
- ; run out of video attributes unless we can eventually use color.
- ; Note that since most IBM color adapters will not display underlined
- ; characters, underlining will appear as an alternate color on those
- ; screens.
- ;
- ; A few other changes are made to WS.COM by this overlay:
- ;
- ; (1) The delete character will display as the standard IBM character
- ; set delete character, instead of DEL.
- ; (2) The BRITE label is set so WordStar displays normal text in
- ; dim video.
- ; (3) Various delays have been changed to MicroPro's recommendations
- ; for a 9-megahertz CPU, which seem to work under MYZ80 just like
- ; do on my SB180.
- ;
- ; Assemble this overlay with Z80ASM:
- ; A0>Z80ASM WS4-MY/H
- ;
- ; Then use MYLOAD to overlay your WS.COM:
- ; A>MYLOAD NEWWS.COM=WS.COM,WS4-MY.HEX
- ;
- ; After you've tested it, rename NEWWS.COM to WS.COM and move it to your
- ; WordStar directory.
- ;
- ; Gene Pizzetta
- ; 481 Revere Street
- ; Revere, MA 02151
- ; Voice (617) 284-0891
- ; Newton Centre Z-Node (617) 965-7259
- ;
- String equ 0283h ; WS string out routine
- ESC equ 1Bh
- CR equ 0Dh
- LF equ 0Ah
- ;
- ;
- ; Delete Display String
- ;
- ; The following string indicates to WordStar how to display a delete
- ; character (hex 7F) on the screen while editing. On terminals that
- ; interpret the delete character code into a displayable character, it
- ; is recommended that DELSTR be translated into the delete code itself
- ; (length of 1, then 7Fh). All characters in the string must display.
- ;
- org 0326h
- ;
- DELSTR: db 1,7Fh ; IBM displays it
- ;
- ;
- ; The following string is used at sign-on to describe the type
- ; of terminal being used by WordStar. Up to 40 bytes are available
- ; for the string, including its null terminator.
- ;
- org 0342h
- ;
- CRTID: db 'MyZ80 Emulator',cr,lf,0
- ;
- ;
- ; After the screen is erased, WordStar assumes that the video
- ; attributes are set to normal (dim for the example terminal),
- ; and that the cursor is at the home position (upper left hand
- ; corner).
- ;
- org 0386h
- ;
- ERASCR: db 4 ; number of characters
- db 1Ah ; to clear screen
- db ESC,'G0' ; to set dim
- ;
- ;
- ; Terminal un-initialization string. A string of bytes which will
- ; be sent tothe terminal at the end of a session. See also UNISUB.
- ;
- org 03B6h
- ;
- TRMUNI: db -1 ; number of bytes
- dw ERASCR ; reset terminal to initial settings
- db 0,0,0
- ;
- ;
- ; User-patchable initialization subroutine. Called before TRINI string
- ; is sent. This subroutine may be used for special console
- ; initialization or other purposes.
- ;
- INISUB: nop
- ret
- ;
- ; Video attributes are used in various places on the WordStar display.
- ; (for complete information see PATCH.LST on your WordStar disk.)
- ; The VIDATT subroutine is used to change video attributes on the screen.
- ; This subroutine is called only when a video attribute changes.
- ;
- org 03C1h ; org at VIDATT
- ;
- VIDATT: ld a,30h ; set attributes to normal
- ld (AttChr),a
- ;
- ; MYZ80 doesn't properly clear attributes unless the attribute character
- ; is 30h ('0'). 32h should set dim video on and turn other attributes off.
- ; It doesn't. And dim video turns out to be bright video. Oh, well . . .
- ; I didn't have to reset all the attributes first on my Televideo, so this
- ; was quite confusing to me at first.
- ;
- call VIDA4 ; clear everything
- ld a,c
- and 11111111b ; any attributes?
- ret z ; (no, forget it!)
- ;
- ld a,c
- and 00000100b ; marked block (reverse)?
- jr z,VIDA0 ; (no)
- ld a,(AttChr)
- or 4 ; add 4 to attribute char
- ld (AttChr),a
-
- VIDA0: ld a,c
- and 00000010b ; error message (blink)?
- jr z,VIDA1 ; (no)
- ld a,(AttChr)
- or 8 ; add 8 to attribute char
- ld (AttChr),a
-
- VIDA1: ld a,c ; is it underlined text, or strike-out,
- and 10111001b ; ..italic, super-, or subscript?
- jr z,VIDA2 ; (no)
- ld a,(AttChr)
- or 1 ; add 1 to attribute char
- ld (AttChr),a
-
- VIDA2: ld a,c
- and 01000000b ; do we have bold or doublestrike (bright)?
- jr z,VIDA4 ; (no, stay dim)
- VIDA3: ld a,(AttChr)
- or 2 ; add 2 to attribute character
- ld (AttChr),a
-
- VIDA4: ld hl,AttStg
- jp String ; send string to terminal
- ;
- org 04C0h
- ;
- AttStg: db 3 ; number of characters
- db esc,'G' ; lead-in
- AttChr: db 30h ; attribute character
- ;
- ; Normally the status line, text and directories are displayed in
- ; dim intensity so that bold and doublestruck text can be shown in
- ; high intensity. Setting BRITE to OFFh reverses the usage of
- ; bright and dim for the status line, text, and directories; normally
- ; zero.
- ;
- org 0441h
- ;
- BRITE: db 0 ; 0 = text dim, 0FFh = text bright
- ;
- ;
- ; Delays -- Each delay is approximately the number of milliseconds
- ; on a 4-Mhz Z80 processor, about twice as long on a 2-Mhz 8080.
- ; They have been changed here for a 9-Mhz SB180; the original settings
- ; are noted in the comments.
- ;
- org 0444h
- ;
- DXOFF: dw 4000 ; time-out for terminal (was 2000)
- DLONG: dw 2000 ; long delays (was 2000)
- DMED: dw 2000 ; medium delays (was 1000)
- DSHORT: dw 400 ; short delays (was 200)
- UPDLY: dw 400 ; update delay (was 200)
- DDISK: dw 500 ; disk access delay (no change)
- DFAST: dw 100 ; delay when fast typing (was 50)
- ;
- end