This section highlights the most significant differences between the XGA and the 8514/A 32-bit presentation drivers, especially those that relate to the S3 driver. (The S3 chip is a streamlined 8514/A design with a VGA chip core.)

The 8514/A driver's register set is different from the XGA driver's register set. In the original XGA driver, it was difficult to determine what to change when adapting the driver to another chip because so much of the code was identical for hard-draw and soft-draw modes. For example, if you went into a file such as EDDHBBLT.ASM, and started replacing memregwrite's macro with a particular video chip that was needed, you had to be careful not to break the bit-map drawing code. The EDDHBBLT.ASM file is assembled twice, once for drawing to the display, and once for drawing to bit maps. The bit map drawing code for the 8514/A driver emulates an XGA, while the display code works with the 8514/A hardware. As a result, files such as EDDHBBLT.ASM tend to have the following structure:

IFDEF HARD_DRAW
DoSomething   equ    _eddh_DoSomething  ;do something to the display

ELSE    ;SOFT_DRAW
DoSomething   equ    _eddf_DoSomething  ;do something to a memory bit map

ENDIF

DoSomething     proc near
;       do some generic setup common to both
        memregwrite
        memregread
        memregwrite
;       etc., etc.

IFDEF HARD_DRAW
IFDEF _8514
;       8514/A specific setup
        .
        .
        .
ENDIF   ;_8514
ENDIF   ;HARD_DRAW

;       more setup common to both
        memregwrite
        memregwrite
        memregwrite
        memregwrite
        .
        .
        .
        memregwrite     pixel_op, ...

IFDEF   HARD_DRAW
IFDEF   _8514
        outwq   X1, ax
        outwq   X2, bx
        .
        .
        .
        outwq   CMD_FLAGS, ...  ;do the 8514/A command
ENDIF   ;_8514
ELSE    ;SOFT_DRAW
        saveregs
        call    _eddf_MESS
        restoreregs
ENDIF   ;SOFT_DRAW

        ret
DoSomething     endp


[Back: The 8514/A Driver]
[Next: Shadow8514Regs Structure]