home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / lambda / soundpot / p / wspatch.lbr / WSFAST.AZM / WSFAST.ASM
Encoding:
Assembly Source File  |  1993-10-25  |  5.5 KB  |  185 lines

  1. ;
  2. ;    WSFAST.ASM
  3. ;
  4. ;==================================================|
  5. ;                           |
  6. ; Published by The Portable Companion, 1982.       |
  7. ; Routines by Thom Hogan, OCC               |
  8. ; Modified by Dave Radke, Osborne User             |
  9. ;__________________________________________________|
  10. ;  
  11. ;    DEFINITIONS
  12. ;
  13. TRUE    EQU    1
  14. FALSE    EQU    NOT TRUE    
  15. ;                    
  16. SMOOTH    EQU    TRUE    ;if TRUE, smooth scrolling implemented
  17. HILITE    EQU    TRUE     ;if TRUE, underlined video selected for hilite
  18. WIDE    EQU    TRUE    ;if TRUE, 128 character width set, else 80
  19. ;
  20. CURSOR    EQU    0EF5Ah    ;location of cursor position in BMRAM
  21. IOUT    EQU    0106h    ;location of output routine in WordStar 2.26
  22. SCREEN    EQU    0F000h    ;this was left out of Thom Hogan's listing
  23. ESCAPE  EQU     27    ;ASCII CODE OF <ESC>   (This must be an EQU, not a DB)
  24. ;    
  25. ;    Change Logo
  26. ;
  27.     IF    SMOOTH
  28.     ORG    190h
  29.     DB    'Smooth Scrolling Osborne I       ';Limit LOGO to 33 characters
  30.     ENDIF
  31. ;
  32. ;    TERMINAL PATCH AREA
  33. ;
  34.     ORG    248h    ;origin of WordStar terminal patch area
  35. HITE    DB    24    ;24 lines on screen
  36.  
  37.     IF     WIDE
  38. WID    DB     128    ;128 columns on screen
  39.     ENDIF
  40.     IF     NOT WIDE
  41. WID    DB    80    ;80 columns on screen
  42.     ENDIF
  43.  
  44. CLEAD1    DB    2,ESCAPE,'='    ;Cursor positioning routine
  45.     DB    0,0,0,0,0,0    ;Room for expansion
  46. CLEAD2    DB    0,0,0,0,0    ;Function not used by Osborne 1
  47. CTAIL    DB    0,0,0,0,0    ;Function not used by Osborne 1
  48. CB4FLG    DB    0        ;Function not used by Osborne 1
  49. LINOFF    DB    32        ;Line offset amount
  50. COLOFF    DB    32        ;Column offset amount
  51. ASCUR    DB    0,0,0,0        ;Function not used by Osborne 1
  52.  
  53.     IF SMOOTH
  54. UCRPOS    JMP    WCUR        ;Get cursor position
  55.     ENDIF
  56.     IF NOT SMOOTH
  57. UCRPOS    DB    0,0,0C9h    ;Not used if terminal emulated
  58.     ENDIF
  59.  
  60.     DW    IOUT        ;Wordstar output routine
  61.     DB    0,0,0,0        ;Reserved bytes
  62. ERAEOL    DB    2,ESCAPE,54h    ;Erase to end of line sequence
  63.     DB    0,0,0,0        ;Room for expansion
  64. LINDEL    DB    2,ESCAPE,52h    ;Delete line sequence
  65.     DB    0,0,0,0        ;Room for expansion
  66. LININS    DB    2,ESCAPE,45h    ;Insert line sequence
  67.     DB    0,0,0,0,0,0    ;Room for expansion
  68. IVON    DB    2,ESCAPE,29h    ;Highlighting ON sequence
  69.     DB    0,0,0,0        ;Room for expansion
  70. IVOFF    DB    2,ESCAPE,28h    ;Highlighting OFF sequence
  71.     DB    0,0,0,0        ;Room for expansion
  72. TRMINI    DB    8,'O C C -1'
  73. TRMUNI    DB    8,'O C C -1'
  74. INISUB    DB     0,0,0C9h    ;put JMP ITERM here if you like
  75. UNISUB    JMP    XTERM        ;  screen cleared before entering Wordstar
  76. USELST    DB    1        ;Enable character in last position to show
  77.     DB    0,0,0        ;Reserved bytes for expansion
  78. DELCUS    DB    5        ;Delay after cursor set
  79. DELMIS    DB    3        ;Delay after other functions
  80. ;
  81. ; The following section contains the primary code which implements
  82. ; smooth scrolling on the Osborne 1.  Be careful when modifying this
  83. ; section.
  84. ;
  85.     IF    SMOOTH
  86. MEMAPV    DB    1        ;Use memory-mapped video
  87. MEMADR    DW    SCREEN        ;Screen location
  88.     ENDIF
  89.     IF     NOT SMOOTH
  90. MEMAPV    DB    0        ;Use terminal driver
  91. MEMADR    DB    0,0        ;No memory address needed
  92.     ENDIF
  93.  
  94.     IF    HILITE
  95. HIBIV    DB    80h        ;Use underline for highlight
  96.     ENDIF
  97.     IF    NOT HILITE    
  98. HIBIV    DB    00h        ;No highlighting
  99.     ENDIF
  100. HIBCUR    DB    80h        ;cursor set on self
  101. CRBLIV    DB    0FFh        ;blink cursor on self
  102. ZAFCIN    DW    0        ;Not needed for Osborne 1
  103. RUBFXF    DB    0        ;Not needed for Osborne 1
  104. RFIXER    DB    0        ;Not needed for Osborne 1
  105.  
  106.     IF     SMOOTH
  107. UCNSTA    JMP    0E506h        ;get console status from BIOS
  108. UCONI    DB     0,0,0C9h    ;if you put JMP INCON here, arrow keys are bypassed
  109. UCONO    JMP    OUTCON        ;send console output
  110.     ENDIF
  111.     IF    NOT SMOOTH
  112. UCNSTA    DB    0,0,0C9h    ;no special console status from BIOS
  113. UCONI    DB    0,0,0C9h    ;no special console input
  114. UCONO    DB    0,0,0C9h    ;no special console output
  115.     ENDIF
  116. SWIN    DB    0C9h,0,0,0,0,0    ;no special before video routine
  117. SWOUT    DB    0C9h,0,0,0,0,0    ;no special after video routine
  118. DEL1    DB    3        ;short delay
  119. DEL2    DB    9        ;medium-short delay
  120. DEL3    DB    35        ;medium-long delay (25 is standard)
  121. DEL4    DB    64        ;long delay 
  122. ;
  123. ;    SPECIAL ROUTINES FOR OSBORNE 1
  124. ;    Not part of Micro Pro patch items
  125. ;
  126.     ORG    02D6h
  127. ;    Initialization of terminal routine  
  128. ;      (Use of this routine cleans up display before starting Wordstar)
  129. ;
  130. ITERM    MVI    A,26        ;clear screen code in A
  131.     CALL    UCONO        ;send it
  132.     RET            ;done
  133. ;
  134. ;    Finalization of terminal routine
  135. ;
  136. XTERM    RET            ;just get out
  137. ;
  138. ;    Input from console routine
  139. ;
  140. ;    NOTE: if used, this routine will bypass special function keys 
  141. ;          and arrow keys.
  142. ;
  143. INCON    CALL    0E509h        ;get a character
  144.     MOV    A,C        ;put it in A where Wordstar can use it
  145.     RET            ;done
  146. ;
  147. ;    Output from console routine
  148. ;
  149. OUTCON    MOV    C,A        ;get it in C where CP/M can use it
  150.     JMP    0E50Ch        ;send it and return directly
  151. ;
  152. ;    Position the cursor by brute force in BMRAM
  153. ;
  154. WCUR    LXI    H,SCREEN    ;put screen start in HL register
  155.     DAD    D        ;add position of cursor in DE to HL
  156.     SHLD    CURSOR        ;save new cursor position
  157.     RET
  158. ;
  159. ;    Special automatic scrolling routines coded in Z80 assembly language
  160. ;
  161. X1BB4    DB    0D9h,000h,000h,0AFh,018h,011h    ;if used, resets screen to column 0.
  162. ;
  163. X30D2    DB    0D9h,000h,000h,03Ah,01Eh,037h    ;Sets screen to Wordstar's column #.
  164.     DB    0D6h                 ;Begins auto horizontal scroll 
  165.                         ;                       at column 40
  166.     DB     040            ;(This location sets auto scroll column #)
  167.     DB    030h,001h,0AFh,0FEh        ;
  168.     DB    04Ch,038h,002h,03Eh,04Ch,0C6h    ;       
  169.     DB    020h,032h,019h,003h,021h,016h    ;if used, turn auto horizonital 
  170.     DB    003h,0CDh,01Bh,003h,0D9h,000h    ;     scroll feature off using SETUP.
  171.     DB    000h,0C3h,0BBh,01Bh,01Bh,053h
  172.     DB    020h,020h,000h,07Eh,0B7h,0C8h
  173.     DB    023h,0E5h,0CDh,0E2h,002h,0E1h
  174.     DB    018h,0F5h,000h,000h
  175.     IF    SMOOTH
  176.     ORG    1BB4h            ;input prompt/command response in Wordstar
  177.     CALL    X30D2            ;   (use auto horizontal scroll routine)
  178.  
  179.     ORG    30D2h            ;input data character
  180.     JMP    X30D2            ; go directly to auto horizontal scroll routine
  181.     ENDIF
  182.     
  183.     END
  184.