;*DDK*************************************************************************/
;
; COPYRIGHT    Copyright (C) 1995 IBM Corporation
;
;    The following IBM OS/2 WARP source code is provided to you solely for
;    the purpose of assisting you in your development of OS/2 WARP device
;    drivers. You may use this code in accordance with the IBM License
;    Agreement provided in the IBM Device Driver Source Kit for OS/2. This
;    Copyright statement may not be removed.;
;*****************************************************************************/
;/*****************************************************************************
;*
;* SOURCE FILE NAME = seamless.inc
;*
;* DESCRIPTIVE NAME = defines for seamless
;*
;*
;* VERSION      V2.0
;*
;* DATE         
;*
;* DESCRIPTION  defines for seamless 
;*
;* FUNCTIONS    NONE
;*              
;*
;* NOTES        NONE
;*
;* STRUCTURES   NONE
;*
;* EXTERNAL REFERENCES
;*
;*              NONE
;*
;* EXTERNAL FUNCTIONS
;*
;*              NONE
;*
;* CHANGE ACTIVITY =
;*   DATE      FLAG        APAR   CHANGE DESCRIPTION
;*   --------  ----------  -----  --------------------------------------
;*   mm/dd/yy  @Vr.mpppxx  xxxxx  xxxxxxx
;*   09/09/89                     Michael Kerekes [mikeke] Made it work.
;*   06/28/88                     Lee A. Newberg  [leen] Put the string 
;*                                in the FIRESEG.
;*****************************************************************************/

IFDEF   VGA132
UNDEF   SEAMLESS
ELSE

;/*
;**  This structure is copied from VMD.INC because I could not include VMD.INC
;**  because of redefinitions and with less than 2 weeks before GA, in's too
;**  risky to change the driver's include significantly
;*/

VMSSIZE         struc   ;vmss
        vmss_nb             dd 36  ;size of structure, in bytes (36)
        vmss_lMode          dd ?   ;video mode (eg, 00h-13h, or -1)
        vmss_ulWidth        dd ?   ;width of screen, in pixels
        vmss_ulHeight       dd ?   ;height of screen, in pixels
        vmss_ulCellWidth    dd ?   ;width of screen cells, in pixels
        vmss_ulCellHeight   dd ?   ;height of screen cells, in pixels
        vmss_ulPtrWidth     dd ?   ;width of pointer drawing size, in pixels
        vmss_ulPtrHeight    dd ?   ;height of pointer drawing size, in pixels
        vmss_ulPtrUnitWidth dd ?   ;width of pointer drawing unit, in pixels
VMSSIZE         ends

SEAMLESS_TIMEOUT        equ 10000 ;Timeout value for the semaphore when we
                                  ;are running seamless

VWIN_INIT               equ 0c0h  ; Send the semDriver address to VWIN
VWIN_SIGHEARTBEAT       equ 0c1h  ; Send VWIN notification that we timed out
VWIN_SIGVDMDIRTY        equ 0c2h  ; Start/stop VDM drawing
VWIN_SETSIZE            equ 0c4h  ; Set the mode size info for VMOUSE
VDM_SUSPEND_DRAW        equ 4001h ;to stop drawing
VDM_RESUME_DRAW         equ 4002h ;to continue drawing
SEAMLESS_ACTIVE         equ 00000001b   ;Bit set if seamless is setup

SM_RING0                EQU     0
SM_RING1                EQU     1
SM_RING2                EQU     2
SM_RING3                EQU     3

SM_DATA_ADDRESS         EQU     0
SM_CODE_ADDRESS         EQU     00000100B

SM_ADDRESS_16BIT        EQU     0
SM_ADDRESS_32BIT        EQU     00001000B

SM_MAPPING              EQU     0
SM_PASSTHRU             EQU     00010000B

_SM_PMDISP_ADDRESSES    struc   ;spa
flOptions       dd      ?       ; BIT1, BIT0 = xx ring level if BIT3=1
                                ; BIT2=0 for DATA,    BIT2=1 for CODE
                                ; BIT3=0 for 16:16,   BIT3=1 for 0:32
                                ; BIT4=0 for mapping, BIT4=1 for passthru
                                ;             (only one passthru allowed)
                                ; BIT5 - BIT31 reserved (must be 0)
ulLength        dd      ?       ; Length of the data in bytes
pStartOff       dw      ?       ; Pointer to the beginning address
pStartSel       dw      ?       ; (Restricted to SEL:0 for now!)
_SM_PMDISP_ADDRESSES    ends

_SM_WINDRV      struc
    signature             db  "VG01" ; string to synchronize interface to VDM
    exclude               dd  ?      ; pointer to cursor far_exclude() function
    unexclude             dd  ?      ; pointer to cursor far_unexclude() function
    init_hw_regs_addr     dd  ?      ; pointer to init_hw_regs() function
    hwsemOff              dw  ?      ; offset of hardware semaphore structure
    wHeartbeatOff         dw  ?      ; offset of VDM heartbeat
    PtrDataSeg            dw  ?      ; segment of PtrData segment
    fbControllerOwnedOff  dw  ?      ; offset of fControllerOwned byte flag
    fbControllerNotifyOff dw  ?      ; offset of fControllerNotify byte flag
    fbShadowFlagsOff      dw  ?      ; offset of fbShadowFlags byte flag
    fbControllerMineOff   dw  ?      ; offset of fVDMControllerMine
    fbShadowedGrafModeOff dw  ?      ; offset of shadowed_graf_mode
_SM_WINDRV      ends


BLACK   =       0
RED     =       1
GREEN   =       2
YELLOW  =       3
BLUE    =       4
MAGENTA =       5
CYAN    =       6
WHITE   =       7

;/***************************************************************************
;*
;* FUNCTION NAME = color_puts
;*
;* DESCRIPTION   = If FIREWALLS is nonzero, outputs a string to the        
;*                 debugging output screen using the two colors specified.
;*
;*                 Registers Preserved:
;*                       all
;*                 Registers Destroyed:
;*                       none
;*
;* INPUT         = Foreground = foreground color 
;*                 Background = background color
;*                 String   = string to output
;*
;*                 Example:
;*                     puts  BLUE,BLACK,<*** StretchBlt: creating shadow bitmap>
;* OUTPUT        = NONE
;*
;* RETURN-NORMAL = NONE
;* RETURN-ERROR  = NONE
;*
;**************************************************************************/


color_puts    macro   foreground,background,string
        local   message

ifdef FIREWALLS
ifndef DebugOutput
        externFP    DebugOutput
endif

_FIRESEG        segment WORD PUBLIC 'code'
message db      27,"[3",foreground+48,";4",background+48,";1m","&string",27,"[0m",13,10,0

_FIRESEG        ends

        push    ax
        push    bx
        push    cx
        push    dx
        farPtr  lpMsg,_FIRESEG,<OFFSET message>
        cCall   DebugOutput,<lpMsg>
        pop     dx
        pop     cx
        pop     bx
        pop     ax
endif   ;FIREWALLS
        endm

ENDIF   ;VGA132
