home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v2.zip / DDKX86 / DBCSDD / SRC_DBCS / VDHWNDW / XGAWRITE.ASM < prev   
Assembly Source File  |  1995-04-14  |  47KB  |  1,000 lines

  1. ;*DDK*************************************************************************/
  2. ;
  3. ; COPYRIGHT (C) Microsoft Corporation, 1989
  4. ; COPYRIGHT    Copyright (C) 1995 IBM Corporation
  5. ;
  6. ;    The following IBM OS/2 WARP source code is provided to you solely for
  7. ;    the purpose of assisting you in your development of OS/2 WARP device
  8. ;    drivers. You may use this code in accordance with the IBM License
  9. ;    Agreement provided in the IBM Device Driver Source Kit for OS/2. This
  10. ;    Copyright statement may not be removed.;
  11. ;*****************************************************************************/
  12.         PAGE    60,132
  13.         TITLE    XGAWRITE.ASM -- Common Buffer Write Routines for EGA, VGA, BGA
  14. ;/*****************************************************************************
  15. ;*
  16. ;* SOURCE FILE NAME = XGAWRITE.ASM
  17. ;*
  18. ;* DESCRIPTIVE NAME = Common Buffer Write Routines for EGA, VGA, BGA
  19. ;*
  20. ;*
  21. ;* VERSION      V2.0
  22. ;*
  23. ;* DATE
  24. ;*
  25. ;* DESCRIPTION  This module contains routines that run at ring 2:
  26. ;*              Common Buffer Write Routines for EGA, VGA, BGA
  27. ;*
  28. ;* FUNCTIONS    WriteCellStr, WriteCharStr, WriteCharStrAttr,
  29. ;*              WriteNChar, WriteNAttr, WriteNCell
  30. ;*
  31. ;* NOTES        NONE
  32. ;*
  33. ;* STRUCTURES   NONE
  34. ;*
  35. ;* EXTERNAL REFERENCES   LocateBuffAddr  (in XGAREAD.ASM)
  36. ;*
  37. ;* EXTERNAL FUNCTIONS
  38. ;*
  39. ;*              NONE
  40. ;*
  41. ;* CHANGE ACTIVIY =
  42. ;*   DATE      FLAG        APAR    CHANGE DESCRIPTION
  43. ;*   --------  ----------  -----   --------------------------------------
  44. ;*   mm/dd/yy  @Vr.mpppxx  xxxxx   xxxxxxx
  45. ;*   03/25/89  @P1         D132    TPL, DCR 132 changes
  46. ;*   01/29/91  MS00                TPL, Convert IFDEF to IF
  47. ;*   01/29/91  MS01                TPL, Rollover MS's runtime check
  48. ;*   01/29/91  MS01                for CGA speedup
  49. ;*   04/11/91              D1348   NAKADA, Enable DBCS support in Vio-Window
  50. ;****************************************************************************/
  51.  
  52.  
  53.         .286c                           ; 286 protect mode instructions
  54.  
  55.         .xlist
  56.         INCLUDE struc.inc               ; Structure macro
  57.         INCLUDE error2.inc              ; Subsystem error equates
  58. IFDEF D1348 ;needs viops_* for common format
  59.         INCLUDE pmwinx.inc
  60.         INCLUDE pmaviop.inc
  61. ENDIF ;D1348
  62.         INCLUDE vdhstruc.inc            ; Buffer update data structures
  63.         INCLUDE vdhctl.inc              ; Conditional Assembly Control  ;MS01
  64.         INCLUDE vdhequ.inc              ; Buffer update equates
  65.         INCLUDE xgamac.inc                                              ;@P1
  66.         .list
  67.  
  68.         EXTRN   SetBuffAddr:NEAR        ; Determine target/source buffer;@P1
  69.  
  70. IFDEF D1348 ;BufferUpdate with dbcs bits handling
  71.         extrn   WriteCellStrWrld:near
  72.         extrn   WriteCharStrWrld:near
  73.         extrn   WriteCharStrAttrWrld:near
  74.         extrn   WriteNCharWrld:near
  75.         extrn   WriteNAttrWrld:near
  76.         extrn   WriteNCellWrld:near
  77. ENDIF ;D1348
  78.  
  79. IF VDHCGA AND (1 - CGA_ALWAYS_FAST)     ; IF VDHCGA AND NOT CGA_ALWAYS_FAST ;MS00
  80.  
  81.  
  82. ;/*
  83. ;** If CGA video memory accesses may need to wait for retrace,
  84. ;** these routines are necessary. (See MAKEFILE)
  85. ;*/
  86.  
  87.         extrn   CGA_REP_MOVSW:far                                       ;@P1
  88.         extrn   CGA_REP_STOSW:far                                       ;@P1
  89.         extrn   CGA_REP_MOVSB_INCSI_LOOP:far                            ;@P1
  90.         extrn   CGA_REP_MOVSW_STOSW_LOOP:far                            ;@P1
  91.         extrn   CGA_REP_INCDI_STOSB_LOOP:far                            ;@P1
  92.         extrn   CGA_REP_STOSB_INCDI_LOOP:far                            ;@P1
  93.         extrn   CGA_REP_LODSB_STOSW_LOOP:far                            ;@P1
  94.         extrn   CGA_REP_MOVSB_INCDI_LOOP:far                            ;@P1
  95.         extrn   CGA_REP_MOVSW_ADDSI2_LOOP:far                           ;@P1
  96. ENDIF   ;VDHCGA                                                         ;MS00
  97.  
  98. R2CSEG  SEGMENT WORD    PUBLIC 'CODE'
  99.         ASSUME  CS:R2CSEG,DS:NOTHING,ES:NOTHING
  100.  
  101. ;/****************************************************************************
  102. ;*
  103. ;* SUBROUTINE NAME:     WriteCellStr
  104. ;*
  105. ;* DESCRIPTIVE NAME:    Video device handler write cells
  106. ;*
  107. ;* FUNCTION:    Process write cells sub-function.
  108. ;*              The cells are written to the LVB and/or PVB
  109. ;*              starting at the specified row, column location.
  110. ;*              Line wrap occurs if the end of a line is reached.
  111. ;*              Write function is terminated if the end of PVB or
  112. ;*              LVB is reached.  The number of the char/attr cells
  113. ;*              written is returned in the RepeatFactor field of
  114. ;*              the paramter block.
  115. ;*
  116. ;* ENTRY POINT: WriteCellStr
  117. ;*   LINKAGE:   Near Call from BUFFERUPDATE routine
  118. ;*
  119. ;* INPUT:
  120. ;*
  121. ;* SS:BP  --->  Stack frame                     (see VDHSTRUC.INC)
  122. ;* DS:SI  --->  Parameter block buffer          (see XGABUFUP.ASM)
  123. ;* ES:DI  --->  Mode data in environment buffer (see XGABUFUP.ASM)
  124. ;*
  125. ;* PARAMETER BLOCK FORMAT:
  126. ;*
  127. ;*   SIZE   DESCRIPTION
  128. ;*   ----   -----------
  129. ;*
  130. ;*   WORD   Parameter length
  131. ;*   WORD   Flags                     (target data buffer - LVB, PVB)
  132. ;*   DWORD  Application data address  (source data buffer)
  133. ;*   DWORD  Application data2 address (not used in this call)
  134. ;*   WORD   Index (7)
  135. ;*   WORD   Starting row              (target row)
  136. ;*   WORD   Starting column           (target column)
  137. ;*   WORD   Secondary row             (not used in this call)
  138. ;*   WORD   Secondary column          (not used in this call)
  139. ;*   WORD   RepeatFactor              (input and output length)
  140. ;*   WORD   LogicalBufSel
  141. ;*
  142. ;* OUTPUT:      LVB and/or PVB = new attributes
  143. ;*              RepeatFactor = sum of char/attr pairs written
  144. ;*
  145. ;* EXIT-NORMAL: AX = 0
  146. ;*
  147. ;* EXIT-ERROR:  AX = Error from LocateBuffAddr
  148. ;*
  149. ;* EFFECTS:     All
  150. ;*
  151. ;* INTERNAL REFERENCES: None
  152. ;*
  153. ;* EXTERNAL REFERENCES: LocateBuffAddr   (in VDHREAD.ASM)
  154. ;*
  155. ;****************************************************************************/
  156.  
  157.         PUBLIC  WriteCellStr
  158. WriteCellStr    PROC    NEAR
  159.  
  160.         mov     bx, 1                       ; Move by buffer byte count
  161.         call    SetBuffAddr                 ; On exit: BX = sel, AX = off;@P1
  162.         .if     <nc>    near                ; Continue?
  163.             lds     si, [si].AppDataAddr    ; Setup source address
  164.             .if     <nonzero bx>            ; write to LVB requested    ;@P1
  165.                 mov     di,ax                                           ;@P1
  166. IFDEF D1348 ;check if DBCS && common lvb.
  167. IFNDEF MSKK                                                             ;;MSKK  ;; added for J-FUNC
  168.                 .if    <bit <[bp].flgDBCS> and anyDBCS> and
  169.                 .if    <[bp].j_funcindx eq WorldFmtIndx>
  170. ELSE                                                                    ;;MSKK  ;; added for J-FUNC
  171.                 .if    <bit <[bp].flgDBCS> and anyDBCS>                 ;;MSKK  ;; added for J-FUNC
  172. ENDIF ; MSKK                                                            ;;MSKK  ;; added for J-FUNC
  173.                     mov     es, bx          ; Setup destination selector
  174.                     call    WriteCellStrWrld
  175.                 .else
  176. ENDIF ;D1348
  177.                     push    si                                          ;@P1
  178.                     push    cx                                          ;@P1
  179.                     shr     cx,1            ; convert bytes to words    ;@P1
  180.                     mov     es, bx          ; Setup destination selector;@P1
  181.                     rep     movsw           ; Fill destination buffer   ;@P1
  182.                     pop     cx                                          ;@P1
  183.                     pop     si                                          ;@P1
  184. IFDEF D1348
  185.                 .endif
  186. ENDIF ;D1348
  187.             .endif                                                      ;@P1
  188.             mov     bx, [bp].PVB_Sel        ; (bx) = PVB selector       ;@P1
  189.             .if     <nonzero bx>            ; write to PVB requested    ;@P1
  190.                 mov     es,bx               ; Setup destination selector;@P1
  191.                 mov     di,[bp].PVBOff      ; (di) = PVB offset from LVB off
  192.                 mov     bx,[bp].RowLength                               ;@P1
  193.                 mov     dx,cx                                           ;@P1
  194.                 mov     cx,[bp].FirstRow                                ;@P1
  195.  
  196.                 .if     <[bp].cellsize e WorldCellSize>                 ;@P1
  197.                     cmp     cx,dx                                       ;@P1
  198.                     jbe     wces20                                      ;@P1
  199.  
  200.                     mov     cx,dx                                       ;@P1
  201.                     jmp     short wces20                                ;@P1
  202.  
  203. wces10:             add     di,[bp].PVBSkip                             ;@P1
  204.                     mov     cx,dx                                       ;@P1
  205.                     cmp     cx,bx                                       ;@P1
  206.                     jbe     wces20                                      ;@P1
  207.  
  208.                     mov     cx,bx                                       ;@P1
  209. wces20:             sub     dx,cx                                       ;@P1
  210.                     shr     cx,2            ; bytes to cells (dword cells)
  211.                     REP_MOVSW_ADDSI2_LOOP   ; Use this macro so CGA can share
  212.                                             ; the same set of sources
  213.                                             ; BUGBUG this may need to deal
  214.                                             ; with the final attribute word
  215.                     or      dx,dx                                       ;@P1
  216.                     jnz     wces10                                      ;@P1
  217.                 .else                                                   ;@P1
  218.                     cmp     cx,dx                                       ;@P1
  219.                     jbe     wces40                                      ;@P1
  220.  
  221.                     mov     cx,dx                                       ;@P1
  222.                     jmp     short wces40                                ;@P1
  223.  
  224. wces30:             add     di,[bp].PVBSkip                             ;@P1
  225.                     mov     cx,dx                                       ;@P1
  226.                     cmp     cx,bx                                       ;@P1
  227.                     jbe     wces40                                      ;@P1
  228.  
  229.                     mov     cx,bx                                       ;@P1
  230. wces40:             sub     dx,cx                                       ;@P1
  231.                     shr     cx,1            ; bytes to cells (word cells)
  232.                     REP_MOVSW               ; Use this macro so CGA can share
  233.                                             ; the same set of sources
  234.                     or      dx,dx                                       ;@P1
  235.                     jnz     wces30                                      ;@P1
  236.                 .endif                                                  ;@P1
  237.             .endif                                                      ;@P1
  238.             sub     ax, ax                  ; Clear return code
  239.         .endif                              ; 
  240.         ret                                 ; 
  241.  
  242. WriteCellStr    ENDP
  243.  
  244. ;/****************************************************************************
  245. ;*
  246. ;* SUBROUTINE NAME:     WriteCharStr
  247. ;*
  248. ;* DESCRIPTIVE NAME:    Video device handler write characters
  249. ;*
  250. ;* FUNCTION:    Process write characters sub-function.
  251. ;*              The characters are read from a user supplied
  252. ;*              buffer which to be placed starting a the
  253. ;*              specified row, column location within the PVB
  254. ;*              and/or LVB.  Line wrap occurs if the end of a
  255. ;*              line is reached.  Write function is terminated
  256. ;*              if the end of PVB or LVB is reached.  The number
  257. ;*              of characters written is returned in the
  258. ;*              RepeatFacter field of the parameter block.
  259. ;*
  260. ;* ENTRY POINT: WriteCharStr
  261. ;*   LINKAGE:   Near Call from BUFFERUPDATE routine
  262. ;*
  263. ;* INPUT:
  264. ;*
  265. ;* SS:BP  --->  Stack frame                     (see VDHSTRUC.INC)
  266. ;* DS:SI  --->  Parameter block buffer          (see XGABUFUP.ASM)
  267. ;* ES:DI  --->  Mode data in environment buffer (see XGABUFUP.ASM)
  268. ;*
  269. ;* PARAMETER BLOCK FORMAT:
  270. ;*
  271. ;*   SIZE   DESCRIPTION
  272. ;*   ----   -----------
  273. ;*
  274. ;*   WORD   Parameter length
  275. ;*   WORD   Flags                     (target data buffer - LVB, PVB)
  276. ;*   DWORD  Application data address  (source data buffer)
  277. ;*   DWORD  Application data2 address (not used in this call)
  278. ;*   WORD   Index (8)
  279. ;*   WORD   Starting row              (target row)
  280. ;*   WORD   Starting column           (target column)
  281. ;*   WORD   Secondary row             (not used in this call)
  282. ;*   WORD   Secondary column          (not used in this call)
  283. ;*   WORD   RepeatFactor              (input and output length)
  284. ;*   WORD   LogicalBufSel
  285. ;*
  286. ;* OUTPUT:      PVB and/or LVB = new characters
  287. ;*              RepeatFactor = number of characters written
  288. ;*
  289. ;* EXIT-NORMAL: AX = 0
  290. ;*
  291. ;* EXIT-ERROR:  AX = Error from LocateBuffAddr
  292. ;*
  293. ;* EFFECTS:     AX, BX, DI, SI, DS, ES
  294. ;*
  295. ;* INTERNAL REFERENCES: None
  296. ;*
  297. ;* EXTERNAL REFERENCES: LocateBuffAddr  (in XGAREAD.ASM)
  298. ;*
  299. ;****************************************************************************/
  300.  
  301.         PUBLIC  WriteCharStr
  302. WriteCharStr    PROC    NEAR
  303.  
  304.         sub     bx, bx                      ; Move done in terms of cells
  305.         call    SetBuffAddr                 ; On exit: BX = sel, AX = off;@P1
  306.         .if     <nc>                        ; Continue?
  307.             lds     si, [si].AppDataAddr    ; Setup source address       ;@P1
  308.             .if     <nonzero bx>            ; Write through request?     ;@P1
  309.                 mov     di, ax              ; Setup destination offset   ;@P1
  310.                 mov     es, bx              ; Setup destination selector ;@P1
  311. IFDEF D1348 ;check if DBCS && common lvb.
  312. IFNDEF MSKK                                                             ;;MSKK  ;; added for J-FUNC
  313.                 .if    <bit <[bp].flgDBCS> and anyDBCS> and
  314.                 .if    <[bp].j_funcindx eq WorldFmtIndx>
  315. ELSE                                                                    ;;MSKK  ;; added for J-FUNC
  316.                 .if    <bit <[bp].flgDBCS> and anyDBCS>                 ;;MSKK  ;; added for J-FUNC
  317. ENDIF ; MSKK                                                            ;;MSKK  ;; added for J-FUNC
  318.                     call    WriteCharStrWrld
  319.                 .else
  320. ENDIF ;D1348
  321.                     mov     bx,[bp].cellsize                             ;@P1
  322.                     dec     bx                                           ;@P1
  323.                     push    cx              ; Save repeat factor, source ;@P1
  324.                     push    si              ;   and destination offset   ;@P1
  325.                     push    di              ;                            ;@P1
  326.                     .repeat                 ;                            ;@P1
  327.                         movsb               ; Fill destination buffer    ;@P1
  328.                         add     di,bx       ; Skip pass attribute        ;@P1
  329.                     .loop                   ;                            ;@P1
  330.                     pop     di              ; ES:DI -> LVB write start   ;@P1
  331.                     pop     si              ; DS:SI -> AppDataAddr       ;@P1
  332.                     pop     cx              ;                            ;@P1
  333. IFDEF D1348
  334.                 .endif
  335. ENDIF ;D1348
  336.             .endif                          ;                            ;@P1
  337.             mov     bx, [bp].PVB_Sel        ; (bx) = PVB selector        ;@P1
  338.             .if     <nonzero bx>            ; write to PVB requested     ;@P1
  339.                 mov     es, bx              ; Setup destination selector ;@P1
  340.                 mov     di, [bp].PVBOff     ; (di) = PVB offset from LVB off
  341.                 mov     bx, [bp].RowLength  ; (bx) = line width in cells ;@P1
  342.                 mov     dx,cx                                            ;@P1
  343.                 mov     cx,[bp].FirstRow                                 ;@P1
  344.                 mov     ax,[bp].PVBSkip                                  ;@P1
  345.                 cmp     cx,dx                                            ;@P1
  346.                 jbe     wchs20                                           ;@P1
  347.  
  348.                 mov     cx,dx                                            ;@P1
  349.                 jmp     short wchs20                                     ;@P1
  350.  
  351. wchs10:         add     di,ax                                            ;@P1
  352.                 mov     cx,dx                                            ;@P1
  353.                 cmp     cx,bx                                            ;@P1
  354.                 jbe     wchs20                                           ;@P1
  355.  
  356.                 mov     cx,bx                                            ;@P1
  357. wchs20:         sub     dx,cx                                            ;@P1
  358.                 REP_MOVSB_INCDI_LOOP        ; Use this macro so CGA can share
  359.                                             ; the same set of sources    ;@P1
  360.                                             ; BUGBUG this may need to deal
  361.                                             ; with the final attribute word
  362.                 or      dx,dx                                            ;@P1
  363.                 jnz     wchs10                                           ;@P1
  364.             .endif                                                       ;@P1
  365.             xor     ax, ax                  ; Clear return code
  366.         .endif                              ; 
  367.         ret                                 ; 
  368.  
  369. WriteCharStr    ENDP
  370.  
  371. ;/****************************************************************************
  372. ;*
  373. ;* SUBROUTINE NAME:     WriteCharStrAttr
  374. ;*
  375. ;* DESCRIPTIVE NAME:    Video device handler write characters
  376. ;*                      with a constant attribute
  377. ;*
  378. ;* FUNCTION:    Process write characters, attribute sub-function.
  379. ;*              The characters and attribute are read from user
  380. ;*              supplied buffers which will be placed starting
  381. ;*              at the specified row, column location within the
  382. ;*              PVB and/or LVB.  Line wrap occurs if the end of
  383. ;*              a line is reached.  Write function is terminated
  384. ;*              if the end of PVB or LVB is reached.  The number
  385. ;*              of char/attr pairs written is returned in the
  386. ;*              RepeatFacter field of the parameter block.
  387. ;*
  388. ;* ENTRY POINT: WriteCharStrAttr
  389. ;*   LINKAGE:   Near Call from BUFFERUPDATE routine
  390. ;*
  391. ;* INPUT:
  392. ;*
  393. ;* SS:BP  --->  Stack frame                     (see VDHSTRUC.INC)
  394. ;* DS:SI  --->  Parameter block buffer          (see XGABUFUP.ASM)
  395. ;* ES:DI  --->  Mode data in environment buffer (see XGABUFUP.ASM)
  396. ;*
  397. ;* PARAMETER BLOCK FORMAT:
  398. ;*
  399. ;*   SIZE   DESCRIPTION
  400. ;*   ----   -----------
  401. ;*
  402. ;*   WORD   Parameter length
  403. ;*   WORD   Flags                     (target data buffer - LVB, PVB)
  404. ;*   DWORD  Application data address  (source data buffer)
  405. ;*   DWORD  Application data2 address (source attribue buffer)
  406. ;*   WORD   Index (9)
  407. ;*   WORD   Starting row              (target row)
  408. ;*   WORD   Starting column           (target column)
  409. ;*   WORD   Secondary row             (not used in this call)
  410. ;*   WORD   Secondary column          (not used in this call)
  411. ;*   WORD   RepeatFactor              (input and output length)
  412. ;*   WORD   LogicalBufSel
  413. ;*
  414. ;* OUTPUT:      PVB and/or LVB = new characters
  415. ;*              RepeatFactor = sum of char/attr pairs written
  416. ;*
  417. ;* EXIT-NORMAL: AX = 0
  418. ;*
  419. ;* EXIT-ERROR:  AX = Error from LocateBuffAddr
  420. ;*
  421. ;* EFFECTS:     AX, BX, DI, SI, DS, ES
  422. ;*
  423. ;* INTERNAL REFERENCES: None
  424. ;*
  425. ;* EXTERNAL REFERENCES: LocateBuffAddr  (in XGAREAD.ASM)
  426. ;*
  427. ;****************************************************************************/
  428.  
  429.         PUBLIC  WriteCharStrAttr
  430. WriteCharStrAttr        PROC    NEAR
  431.  
  432.         sub     bx, bx                          ; Operation in terms of cells
  433.         call    SetBuffAddr                     ; On exit: BX = sel, AX = off
  434.         .if     <nc>    near                    ; Continue?
  435.             mov     di, ax                      ; Setup destination offset
  436.             lds     si, [si].AppCellAddr        ; Setup address to attribute
  437.             test    [bp].shadow_Flags,CGAAttr   ; The request is from TTY?  ;@A1;; added for J-FUNC
  438.             .if <nz>                                                    ;@A1    ;; added for J-FUNC
  439.                 lodsw                           ; Get attr#1 and attr#2 ;@A1    ;; added for J-FUNC
  440.                 mov     [bp].shadowAttribute,ax                         ;@A1    ;; added for J-FUNC
  441.                 dec     si                      ; adjust                ;@A1    ;; added for J-FUNC
  442.             .else                                                       ;@A1    ;; added for J-FUNC
  443.                 lodsb                           ; Get attribute
  444.             .endif                                                      ;@A1    ;; added for J-FUNC
  445.             xchg    al, ah                      ; AH = attribute
  446.             .if     <nonzero bx>                ; Write through request?
  447.                 mov     es, bx                  ; Setup destination selector
  448. IFDEF D1348 ;check if DBCS && common lvb.
  449. IFNDEF MSKK                                                             ;;MSKK  ;; added for J-FUNC
  450.                 .if    <bit <[bp].flgDBCS> and anyDBCS> and
  451.                 .if    <[bp].j_funcindx eq WorldFmtIndx>
  452. ELSE                                                                    ;;MSKK  ;; added for J-FUNC
  453.                 .if    <bit <[bp].flgDBCS> and anyDBCS>                 ;;MSKK  ;; added for J-FUNC
  454. ENDIF ; MSKK                                                            ;;MSKK  ;; added for J-FUNC
  455.                     xchg    ax,dx               ; dh = first attr byte
  456.                     .if    <[bp].j_funcindx eq WorldFmtIndx> or         ;@N1    ;; added for J-FUNC
  457.                     .if    <[bp].j_funcindx eq ExtPSFmtIndx>            ;@N1    ;; added for J-FUNC
  458.                         lodsw                   ; al = attr #2
  459.                                                 ; ah = attr #3(sys byte)
  460.                     .else                                               ;@N1    ;; added for J-FUNC
  461.                         xor     ax,ax                                   ;@N1    ;; added for J-FUNC
  462.                     .endif                                              ;@N1    ;; added for J-FUNC
  463.                     xchg    ax, dx              ; ah = attr #1
  464.                                                 ; dl = attr #2
  465.                                                 ; dh = attr #3(sys byte)
  466.                     lds     si,[bp].ParmBuf     ; Setup parameter buffer addr
  467.                     lds     si,[si].AppDataAddr ; Setup source address
  468.                     call    WriteCharStrAttrWrld
  469.                 .else
  470. ENDIF ;D1348
  471.                     push    cx                      ; Save repeat factor and
  472.                     .if     <[bp].cellsize e WorldCellSize>
  473.                         xchg    ax, bx              ; bh = first attr byte
  474.                         lodsw                       ; ax = last attr word
  475.                         xchg    ax, bx              ; ah = first attr byte
  476.                         lds     si, [bp].ParmBuf    ; Setup parameter buffer addr
  477.                         lds     si, [si].AppDataAddr; Setup source address
  478.                         .repeat                     ; 
  479.                             lodsb                   ; AL = character
  480.                             stosw                   ; Transfer first word of cell
  481.                             xchg    ax, bx          ; ax = last attr word
  482.                             stosw                   ; store the last attr word
  483.                             xchg    ax, bx          ; ah = first attr byte
  484.                         .loop                       ; 
  485.                     .else
  486.                         lds     si, [bp].ParmBuf    ; Setup parameter buffer addr
  487.                         lds     si, [si].AppDataAddr; Setup source address
  488.                         .repeat                     ; 
  489.                             lodsb                   ; AL = character
  490.                             stosw                   ; Transfer first word of cell
  491.                         .loop                       ; 
  492.                     .endif
  493.                     pop     cx                      ; 
  494. IFDEF D1348
  495.                 .endif
  496. ENDIF ;D1348
  497.             .endif                              ; 
  498.  
  499.             mov     bx, [bp].PVB_Sel            ; Get PVB selector from stack
  500.             .if     <nonzero bx>                ; write to PVB requested
  501.                 mov     es,bx                   ; Setup destination selector
  502.                 mov     di,[bp].PVBOff          ; (di) = PVB offset from LVB off
  503.                 lds     si,[bp].ParmBuf         ; Setup parameter buffer addr
  504.                 lds     si,[si].AppDataAddr     ; Setup source address
  505.                 mov     bx,[bp].RowLength
  506.                 mov     dx,cx
  507.                 mov     cx,[bp].FirstRow
  508.                 cmp     cx,dx
  509.                 jbe     wcsa20
  510.  
  511.                 mov     cx,dx
  512.                 jmp     short wcsa20
  513.  
  514. wcsa10:         add     di,[bp].PVBSkip
  515.                 mov     cx,dx
  516.                 cmp     cx,bx
  517.                 jbe     wcsa20
  518.  
  519.                 mov     cx,bx
  520. wcsa20:         sub     dx,cx
  521.                 REP_LODSB_STOSW_LOOP        ; Use this macro so CGA can share
  522.                                             ; the same set of sources
  523.                                             ; (al) = char , (ah) = attribute
  524.                                             ; write the cell
  525.                 or      dx,dx
  526.                 jnz     wcsa10
  527.             .endif
  528.             sub     ax, ax                      ; Clear return code
  529.         .endif                                  ; 
  530.         ret                                     ; 
  531.  
  532. WriteCharStrAttr    ENDP
  533.  
  534. ;/****************************************************************************
  535. ;*
  536. ;* SUBROUTINE NAME:     WriteNChar
  537. ;*
  538. ;* DESCRIPTIVE NAME:    Video device handler repeat characters
  539. ;*
  540. ;* FUNCTION:    Process write character sub-function.
  541. ;*              The characters are written to either PVB or LVB
  542. ;*              starting at the specified row, column location.
  543. ;*              Line wrap ocurrs if the end of a line is reached.
  544. ;*              Write function is terminated if the end of PVB or
  545. ;*              LVB is reached.  The number of characters written
  546. ;*              is returned in the RepeatFacter field of the
  547. ;*              parameter block.
  548. ;*
  549. ;* ENTRY POINT: WriteNChar
  550. ;*   LINKAGE:   Near Call from BUFFERUPDATE routine
  551. ;*
  552. ;* INPUT:
  553. ;*
  554. ;* SS:BP  --->  Stack frame                     (see VDHSTRUC.INC)
  555. ;* DS:SI  --->  Parameter block buffer          (see XGABUFUP.ASM)
  556. ;* ES:DI  --->  Mode data in environment buffer (see XGABUFUP.ASM)
  557. ;*
  558. ;* PARAMETER BLOCK FORMAT:
  559. ;*
  560. ;*   SIZE   DESCRIPTION
  561. ;*   ----   -----------
  562. ;*
  563. ;*   WORD   Parameter length
  564. ;*   WORD   Flags                     (target data buffer - LVB, PVB)
  565. ;*   DWORD  Application data address  (source character buffer)
  566. ;*   DWORD  Application data2 address (not used in this call)
  567. ;*   WORD   Index (10)
  568. ;*   WORD   Starting row              (target row)
  569. ;*   WORD   Starting column           (target column)
  570. ;*   WORD   Secondary row             (not used in this call)
  571. ;*   WORD   Secondary column          (not used in this call)
  572. ;*   WORD   RepeatFactor              (input and output length)
  573. ;*   WORD   LogicalBufSel
  574. ;*
  575. ;* OUTPUT:      PVB or LVB = new characters
  576. ;*              RepeatFactor = number of characters written
  577. ;*
  578. ;* EXIT-NORMAL: AX = 0
  579. ;*
  580. ;* EXIT-ERROR:  None
  581. ;*
  582. ;* EFFECTS:     AX, BX, DI, SI, DS, ES
  583. ;*
  584. ;* INTERNAL REFERENCES: None
  585. ;*
  586. ;* EXTERNAL REFERENCES: LocateBuffAddr  (in XGAREAD.ASM)
  587. ;*
  588. ;********************** END OF SPECIFICATIONS ***************************
  589.  
  590.         PUBLIC  WriteNChar
  591. WriteNChar      PROC    NEAR
  592.  
  593. IFDEF D1348 ;BufferUpdate with dbcs bits handling
  594.         push    ds                              ; save parameter block pointer
  595.         push    si
  596.         lds     si,[si].AppDataAddr             ; load character
  597.         lodsb
  598. IFNDEF MSKK                                                             ;;MSKK  ;; added for J-FUNC
  599.         .if    <bit <[bp].flgDBCS> and anyDBCS> and
  600.         .if    <[bp].j_funcindx eq WorldFmtIndx>
  601. ELSE                                                                    ;;MSKK  ;; added for J-FUNC
  602.         .if    <bit <[bp].flgDBCS> and anyDBCS>                         ;;MSKK  ;; added for J-FUNC
  603. ENDIF ; MSKK                                                            ;;MSKK  ;; added for J-FUNC
  604.             push    ds
  605.             push    si
  606.             push    ax
  607.             lds     si,[bp].lpNLSExt
  608.             xor     ah,ah                       ; ignore lcid
  609.             CheckLeadByte                       ; is it DBCS character ?
  610.             pop     ax
  611.             pop     si
  612.             pop     ds
  613.             .if     <c>                         ; if DBCS character
  614.                 xchg    al,ah                   ; save leading char
  615.                 lodsb                           ; load trailing char
  616.                 xchg    al,ah                   ; AL = lead, AH = trail char
  617.             .endif
  618.         .else
  619.             clc
  620.         .endif
  621.         pop     si                              ; rest parameter block pointer
  622.         pop     ds
  623.         .if     <c>                             ; if DBCS character
  624.             shl     ds:[si].RepeatFactor,1      ; cell number *= 2
  625.         .endif
  626.         push    ax                              ; save character
  627. ENDIF ;D1348
  628.  
  629.         sub     bx, bx                          ; Operation in terms of cells
  630.         call    SetBuffAddr                     ; On exit: BX = sel, AX = off
  631.  
  632. IFDEF D1348
  633.         pop     dx                              ; restore character
  634. ENDIF ;D1348
  635.         .if     <nc>                            ; Continue?
  636.             mov     di, ax                      ; Setup destination offset
  637. IFDEF D1348
  638.             mov     ax,dx                       ; set character to AX reg.
  639. ELSE  ;D1348
  640.             lds     si, [si].AppDataAddr        ; Setup source address
  641.             lodsb                               ; Get source character
  642. ENDIF ;D1348
  643.             mov     si, [bp].cellsize           ; 
  644.             dec     si                          ; (si) = # attribute bytes
  645.             .if     <nonzero bx>                ; Write through request?
  646.                 mov     es, bx                  ; Setup destination selector
  647.  
  648. IFDEF D1348 ;check if DBCS && common lvb.
  649. IFNDEF MSKK                                                             ;;MSKK  ;; added for J-FUNC
  650.                 .if    <bit <[bp].flgDBCS> and anyDBCS> and
  651.                 .if    <[bp].j_funcindx eq WorldFmtIndx>
  652. ELSE                                                                    ;;MSKK  ;; added for J-FUNC
  653.                 .if    <bit <[bp].flgDBCS> and anyDBCS>                 ;;MSKK  ;; added for J-FUNC
  654. ENDIF ; MSKK                                                            ;;MSKK  ;; added for J-FUNC
  655.                     call    WriteNCharWrld
  656.                 .else
  657. ENDIF ;D1348
  658.                     push    cx                  ; Save repeat factor and
  659.                     .repeat                     ; 
  660.                         stosb                   ; Fill destination buffer
  661.                         add     di,si           ; 
  662.                     .loop                       ; 
  663.                     pop     cx                  ; 
  664. IFDEF D1348
  665.                 .endif
  666. ENDIF ;D1348
  667.             .endif                              ; 
  668.  
  669.             mov     bx, [bp].PVB_Sel            ; Get PVB selector from stack
  670.             .if     <nonzero bx>                ; write to PVB requested
  671.                 mov     es,bx                   ; Setup destination selector
  672.                 mov     di,[bp].PVBOff          ; (di) = PVB offset from LVB off
  673.                 mov     dx,cx
  674.                 mov     bx,[bp].RowLength       ; (bx) = line width in cells
  675.                 mov     si,[bp].PVBSkip
  676.                 mov     dx,cx
  677.                 mov     cx,[bp].FirstRow
  678.                 cmp     cx,dx
  679.                 jbe     wnch20
  680.  
  681.                 mov     cx,dx
  682.                 jmp     short wnch20
  683.  
  684. wnch10:         add     di,si
  685.                 mov     cx,dx
  686.                 cmp     cx,bx
  687.                 jbe     wnch20
  688.  
  689.                 mov     cx,bx
  690. wnch20:         sub     dx,cx
  691.                 REP_STOSB_INCDI_LOOP        ; Use this macro so CGA can share
  692.                                             ; the same set of sources
  693.                 or      dx,dx
  694.                 jnz     wnch10
  695.             .endif
  696.             sub     ax, ax                      ; Clear return code
  697.         .endif                                  ; 
  698.         ret                                     ; 
  699.  
  700. WriteNChar      ENDP
  701.  
  702. ;/****************************************************************************
  703. ;*
  704. ;* SUBROUTINE NAME:     WriteNAttr
  705. ;*
  706. ;* DESCRIPTIVE NAME:    Video device handler repeat attributes
  707. ;*
  708. ;* FUNCTION:    Process repeat write attributes sub-function.
  709. ;*              The attributes are written to either PVB or LVB
  710. ;*              starting at the specified row, column location.
  711. ;*              Line wrap occurs if the end of a line is reached.
  712. ;*              Write function is terminated if the end of PVB or
  713. ;*              LVB is reached.  The number of the attributes
  714. ;*              written is returned in the RepeatFactor field
  715. ;*              of the paramter block.
  716. ;*
  717. ;* ENTRY POINT: WriteNAttr
  718. ;*   LINKAGE:   Near Call from BUFFERUPDATE routine
  719. ;*
  720. ;* INPUT:
  721. ;*
  722. ;* SS:BP  --->  Stack frame                     (see VDHSTRUC.INC)
  723. ;* DS:SI  --->  Parameter block buffer          (see XGABUFUP.ASM)
  724. ;* ES:DI  --->  Mode data in environment buffer (see XGABUFUP.ASM)
  725. ;*
  726. ;* PARAMETER BLOCK FORMAT:
  727. ;*
  728. ;*   SIZE   DESCRIPTION
  729. ;*   ----   -----------
  730. ;*
  731. ;*   WORD   Parameter length
  732. ;*   WORD   Flags                     (target data buffer - LVB, PVB)
  733. ;*   DWORD  Application data address  (source attribute buffer)
  734. ;*   DWORD  Application data2 address (not used in this call)
  735. ;*   WORD   Index (11)
  736. ;*   WORD   Starting row              (target row)
  737. ;*   WORD   Starting column           (target column)
  738. ;*   WORD   Secondary row             (not used in this call)
  739. ;*   WORD   Secondary column          (not used in this call)
  740. ;*   WORD   RepeatFactor              (input and output length)
  741. ;*   WORD   LogicalBufSel
  742. ;*
  743. ;* OUTPUT:      LVB and/or PVB = new attributes
  744. ;*              RepeatFactor = number of attributes written
  745. ;*
  746. ;* EXIT-NORMAL: AX = 0
  747. ;*
  748. ;* EXIT-ERROR:  AX = Error from LocateBuffAddr
  749. ;*
  750. ;* EFFECTS:     All
  751. ;*
  752. ;* INTERNAL REFERENCES: None
  753. ;*
  754. ;* EXTERNAL REFERENCES: LocateBuffAddr   (in XGAREAD.ASM)
  755. ;*
  756. ;********************** END OF SPECIFICATIONS ***************************
  757.  
  758.         PUBLIC  WriteNAttr
  759. WriteNAttr      PROC    NEAR
  760.  
  761.         sub     bx, bx                          ; Operation in terms of cells
  762.         call    SetBuffAddr                     ; On exit: BX = sel, AX = off
  763.         .if     <nc>                            ; Continue?
  764.             mov     di, ax                      ; Setup destination offset
  765.             lds     si, [si].AppDataAddr        ; Setup address to attribute
  766.             lodsb                               ; Get attribute
  767.             .if     <nonzero bx>                ; Write through request?
  768.                 mov     es, bx                  ; Setup destination selector
  769. IFDEF D1348 ;check if DBCS && common lvb.
  770. IFNDEF MSKK                                                             ;;MSKK  ;; added for J-FUNC
  771.                 .if    <bit <[bp].flgDBCS> and anyDBCS> and
  772.                 .if    <[bp].j_funcindx eq WorldFmtIndx>
  773. ELSE                                                                    ;;MSKK  ;; added for J-FUNC
  774.                 .if    <bit <[bp].flgDBCS> and anyDBCS>                 ;;MSKK  ;; added for J-FUNC
  775. ENDIF ; MSKK                                                            ;;MSKK  ;; added for J-FUNC
  776.                     call    WriteNAttrWrld
  777.                 .else
  778. ENDIF ;D1348
  779.                     push    cx                  ; Save repeat factor and
  780.                     .if     <[bp].cellsize e WorldCellSize>
  781.                         xchg    ax, bx          ; bh = first attr byte
  782.                         lodsw                   ; ax = last attr word
  783.                         xchg    ax, bx          ; al = first attr byte
  784.                         .repeat                 ; 
  785.                             inc     di          ; skip the character
  786.                             stosb               ; save the first attribute byte
  787.                             xchg    ax, bx      ; ax = last attr word
  788.                             stosw               ; store the last attr word
  789.                             xchg    ax, bx      ; al = first attr byte
  790.                         .loop                   ; 
  791.                     .else
  792.                         .repeat                 ; 
  793.                             inc     di          ; skip the character
  794.                             stosb               ; save the attribute byte
  795.                         .loop                   ; 
  796.                     .endif
  797.                     pop     cx                  ; 
  798. IFDEF D1348
  799.                 .endif
  800. ENDIF ;D1348
  801.             .endif                              ; 
  802.  
  803.             mov     bx, [bp].PVB_Sel            ; Get PVB selector from stack
  804.             .if     <nonzero bx>                ; write to PVB requested
  805.                 mov     es,bx                   ; Setup destination selector
  806.                 mov     di,[bp].PVBOff          ; (di) = PVB offset from LVB off
  807.                 mov     bx,[bp].RowLength
  808.                 mov     si,[bp].PVBSkip
  809.                 mov     dx,cx
  810.                 mov     cx,[bp].FirstRow
  811.                 cmp     cx,dx
  812.                 jbe     wnat20
  813.  
  814.                 mov     cx,dx
  815.                 jmp     short wnat20
  816.  
  817. wnat10:         add     di,si
  818.                 mov     cx,dx
  819.                 cmp     cx,bx
  820.                 jbe     wnat20
  821.  
  822.                 mov     cx,bx
  823. wnat20:         sub     dx,cx
  824.                 REP_INCDI_STOSB_LOOP        ; Use this macro so CGA can share
  825.                                             ; the same set of sources
  826.                                             ; skip the character
  827.                                             ; save the attribute
  828.                 or      dx,dx
  829.                 jnz     wnat10
  830.             .endif
  831.             sub     ax, ax                      ; Clear return code
  832.         .endif                                  ; 
  833.         ret                                     ; 
  834.  
  835. WriteNAttr      ENDP
  836.  
  837. ;/****************************************************************************
  838. ;*
  839. ;* SUBROUTINE NAME:     WriteNCell
  840. ;*
  841. ;* DESCRIPTIVE NAME:    Video device handler repeat cells
  842. ;*
  843. ;* FUNCTION:    Process write cells sub-function.
  844. ;*              The cells are written to either PVB or LVB
  845. ;*              starting at the specified row, column location.
  846. ;*              Line wrap ocurrs if the end of a line is reached.
  847. ;*              Write function is terminated if the end of PVB
  848. ;*              or LVB is reached.  The number of cells written
  849. ;*              is returned in the RepeatFacter field of the
  850. ;*              parameter block.
  851. ;*
  852. ;* ENTRY POINT: WriteNCell
  853. ;*   LINKAGE:   Near Call from BUFFERUPDATE routine
  854. ;*
  855. ;* INPUT:
  856. ;*
  857. ;* SS:BP  --->  Stack frame                     (see VDHSTRUC.INC)
  858. ;* DS:SI  --->  Parameter block buffer          (see XGABUFUP.ASM)
  859. ;* ES:DI  --->  Mode data in environment buffer (see XGABUFUP.ASM)
  860. ;*
  861. ;* PARAMETER BLOCK FORMAT:
  862. ;*
  863. ;*   SIZE   DESCRIPTION
  864. ;*   ----   -----------
  865. ;*
  866. ;*   WORD   Parameter length
  867. ;*   WORD   Flags                     (target data buffer - LVB, PVB)
  868. ;*   DWORD  Application data address  (source cell buffer)
  869. ;*   DWORD  Application data2 address (not used in this call)
  870. ;*   WORD   Index (12)
  871. ;*   WORD   Starting row              (target row)
  872. ;*   WORD   Starting column           (target column)
  873. ;*   WORD   Secondary row             (not used in this call)
  874. ;*   WORD   Secondary column          (not used in this call)
  875. ;*   WORD   RepeatFactor              (input and output length)
  876. ;*   WORD   LogicalBufSel
  877. ;*
  878. ;* OUTPUT:      PVB or LVB = new characters
  879. ;*              RepeatFactor = sum of char/attr pairs written
  880. ;*
  881. ;* EXIT-NORMAL: AX = 0
  882. ;*
  883. ;* EXIT-ERROR:  AX = Error from LocateBuffAddr
  884. ;*
  885. ;* EFFECTS:     AX, BX, DI, SI, DS, ES
  886. ;*
  887. ;* INTERNAL REFERENCES: None
  888. ;*
  889. ;* EXTERNAL REFERENCES: LocateBuffAddr  (in XGAREAD.ASM)
  890. ;*
  891. ;****************************************************************************/
  892.  
  893.         PUBLIC  WriteNCell
  894. WriteNCell      PROC    NEAR
  895.  
  896. IFDEF D1348 ;BufferUpdate with dbcs bits handling
  897. IFNDEF MSKK                                                             ;;MSKK  ;; added for J-FUNC
  898.         .if    <bit <[bp].flgDBCS> and anyDBCS> and
  899.         .if    <[bp].j_funcindx eq WorldFmtIndx>
  900. ELSE                                                                    ;;MSKK  ;; added for J-FUNC
  901.         .if    <bit <[bp].flgDBCS> and anyDBCS>                         ;;MSKK  ;; added for J-FUNC
  902. ENDIF ; MSKK                                                            ;;MSKK  ;; added for J-FUNC
  903.             push    ds                          ; save parameter block pointer
  904.             push    si
  905.             lds     si,[si].AppDataAddr         ; load character
  906.             lodsb
  907.             .if    <[bp].j_funcindx eq WorldFmtIndx> or                 ;@AN01  ;; added for J-FUNC
  908.             .if    <[bp].j_funcindx eq ExtPSFmtIndx>                    ;@AN01  ;; added for J-FUNC
  909.                 mov     ah,byte ptr ds:[si+1]   ; get attr#2
  910.             .else                                                       ;@AN01  ;; added for J-FUNC
  911.                 xor     ah,ah                                           ;@AN01  ;; added for J-FUNC
  912.             .endif                                                      ;@AN01  ;; added for J-FUNC
  913.             CheckLeadByte                       ; is it DBCS character ?
  914.             pop     si                          ; rest parameter block pointer
  915.             pop     ds
  916.             .if     <c>                         ; if DBCS character
  917.                 shl     ds:[si].RepeatFactor,1  ; cell number *= 2
  918.             .endif
  919.         .endif
  920. ENDIF ;D1348
  921.  
  922.         sub     bx, bx                          ; Operation in terms of cells
  923.         call    SetBuffAddr                     ; On exit: BX = sel, AX = off
  924.         .if     <nc>                            ; Continue?
  925.             mov     di, ax                      ; Setup destination offset
  926.             lds     si, [si].AppDataAddr        ; Setup address to attribute
  927.             lodsw                               ; Get attribute
  928.             .if     <nonzero bx>                ; Write through request?
  929.                 mov     es, bx                  ; Setup destination selector
  930.  
  931. IFDEF D1348 ;check if DBCS && common lvb.
  932. IFNDEF MSKK                                                             ;;MSKK  ;; added for J-FUNC
  933.                 .if    <bit <[bp].flgDBCS> and anyDBCS> and
  934.                 .if    <[bp].j_funcindx eq WorldFmtIndx>
  935. ELSE                                                                    ;;MSKK  ;; added for J-FUNC
  936.                 .if    <bit <[bp].flgDBCS> and anyDBCS>                 ;;MSKK  ;; added for J-FUNC
  937. ENDIF ; MSKK                                                            ;;MSKK  ;; added for J-FUNC
  938.                     call    WriteNCellWrld
  939.                 .else
  940. ENDIF ;D1348
  941.                     push    cx                  ; Save repeat factor and
  942.                     .if     <[bp].cellsize e WorldCellSize>
  943.                         xchg    ax, bx          ; bh = first cell word
  944.                         lodsw                   ; ax = last cell word
  945.                         xchg    ax, bx          ; ax = first cell word
  946.                         .repeat                 ; 
  947.                             stosw               ; save the first attribute byte
  948.                             xchg    ax, bx      ; ax = last attr word
  949.                             stosw               ; store the last attr word
  950.                             xchg    ax, bx      ; al = first attr byte
  951.                         .loop                   ; 
  952.                     .else
  953.                         rep stosw               ; 
  954.                     .endif
  955.                     pop     cx                  ; 
  956. IFDEF D1348
  957.                 .endif
  958. ENDIF ;D1348
  959.             .endif                              ; 
  960.  
  961.             mov     bx, [bp].PVB_Sel            ; Get PVB selector from stack
  962.             .if     <nonzero bx>                ; write to PVB requested
  963.                 mov     es, bx                  ; Setup destination selector
  964.                 mov     di, [bp].PVBOff         ; (di) = PVB offset from LVB off
  965.                 mov     dx, cx
  966.                 mov     bx, [bp].RowLength      ; this is in cells
  967.                 mov     dx,cx
  968.                 mov     cx,[bp].FirstRow
  969.                 cmp     cx,dx
  970.                 jbe     wnce20
  971.  
  972.                 mov     cx,dx
  973.                 jmp     short wnce20
  974.  
  975. wnce10:         add     di,[bp].PVBSkip
  976.                 mov     cx,dx
  977.                 cmp     cx,bx
  978.                 jbe     wnce20
  979.  
  980.                 mov     cx,bx
  981. wnce20:         sub     dx,cx
  982.                 REP_STOSW                   ; Use this macro so CGA can share
  983.                                             ; the same set of sources
  984.                 or      dx,dx
  985.                 jnz     wnce10
  986.             .endif
  987.             sub     ax, ax                      ; Clear return code
  988.         .endif                                  ; 
  989.         ret                                     ; 
  990.  
  991. WriteNCell      ENDP
  992.  
  993. R2CSEG  ENDS
  994.         END
  995.  
  996. ;@P1  = 03/25/89  PL, DCR 132 changes
  997. ;MS00 = 01/29/91 TPL, Convert IFDEF to IF
  998. ;MS01 = 01/29/91 TPL, Rollover MS's runtime check for CGA speedup
  999. ;D1348 = 04/11/91 NAKADA, Enable DBCS support in Vio-Window, DCR 1348
  1000.