1 ;-----------------------------------------------------------------------
\r
3 ; XLIB - Include file
\r
5 ; Global equates and variables
\r
8 ; ****** XLIB - Mode X graphics library ****************
\r
9 ; ****** ****************
\r
10 ; ****** Written By Themie Gouthas ****************
\r
12 ; egg@dstos3.dsto.gov.au
\r
13 ; teg@bart.dsto.gov.au
\r
16 ; 26-9-92 : Pel panning code added
\r
17 ; 23-10-92: Added clip rectangle code
\r
18 ;-----------------------------------------------------------------------
\r
25 ; First lets find out what memory model to use
\r
30 AC_INDEX equ 03c0h ;Attribute controller index register
\r
31 MISC_OUTPUT equ 03c2h ;Miscellaneous Output register
\r
32 SC_INDEX equ 03c4h ;Sequence Controller Index
\r
33 GC_INDEX equ 03ceh ; Graphics controller Index
\r
34 CRTC_INDEX equ 03d4h ;CRT Controller Index
\r
35 DAC_READ_INDEX equ 03c7h ;
\r
36 DAC_WRITE_INDEX equ 03c8h ;
\r
37 DAC_DATA equ 03c9h ;
\r
38 INPUT_STATUS_0 equ 03dah ;Input status 0 register
\r
41 SCREEN_SEG equ 0a000h ;segment of display memory in mode X
\r
43 MAP_MASK equ 02h ;index in SC of Map Mask register
\r
44 READ_MAP equ 04h ;index in GC of the Read Map register
\r
45 BIT_MASK equ 08h ;index in GC of Bit Mask register
\r
47 OVERFLOW equ 07h ; CRTC overflow register index
\r
48 MAX_SCAN_LINE equ 09h ; CRTC maximum scan line register index
\r
49 ADDR_HIGH equ 0ch ;Index of Start Address High reg in CRTC
\r
50 ADDR_LOW equ 0dh ; Low
\r
51 CRTC_OFFSET equ 13h ; CRTC offset register index
\r
52 UNDERLINE equ 14h ; CRTC underline location register index
\r
53 MODE_CONTROL equ 17h ; CRTC mode control register index
\r
54 LINE_COMPARE equ 18h ; CRTC line compare reg. index (bits 0-7 of
\r
55 ; split screen scan line
\r
57 AC_MODE_CONTROL equ 10h ; Index of Mode COntrol register in AC
\r
58 PEL_PANNING equ 13h ; Pel panning register index in AC
\r
60 PATTERN_BUFFER equ 0fffch ;offset in screen memory of pattern buffer
\r
70 ;-----------------------------------------------------------------------
\r
71 ; Macro to wait for the vertical retrace leading edge
\r
73 WaitVsyncStart macro
\r
74 LOCAL WaitNotVsync,WaitVsync
\r
75 mov dx,INPUT_STATUS_0
\r
86 ;-----------------------------------------------------------------------
\r
87 ; Macro to wait for the vertical retrace trailing edge
\r
90 LOCAL WaitNotVsync,WaitVsync
\r
91 mov dx,INPUT_STATUS_0
\r
102 ;--- Word out macro ------------------------------------------
\r
117 ;------------------------------------------------------------------------
\r
118 ; Global variables - XMAIN exports
\r
120 global _InGraphics :byte
\r
121 global _CurrXMode :word
\r
122 global _ScrnPhysicalByteWidth :word
\r
123 global _ScrnPhysicalPixelWidth :word
\r
124 global _ScrnPhysicalHeight :word
\r
125 global _ErrorValue :byte
\r
127 global _SplitScrnOffs :word
\r
128 global _SplitScrnScanLine :word
\r
129 global _SplitScrnVisibleHeight :word
\r
130 global _Page0_Offs :word
\r
131 global _Page1_Offs :word
\r
132 global _Page2_Offs :word
\r
133 global _ScrnLogicalByteWidth :word
\r
134 global _ScrnLogicalPixelWidth :word
\r
135 global _ScrnLogicalHeight :word
\r
137 global _MaxScrollX :word
\r
138 global _MaxScrollY :word
\r
139 global _DoubleBufferActive :word
\r
140 global _TrippleBufferActive :word
\r
141 global _VisiblePageIdx :word
\r
142 global _VisiblePageOffs :word
\r
143 global _HiddenPageOffs :word
\r
144 global _WaitingPageOffs :word
\r
145 global _NonVisual_Offs :word
\r
146 global _TopClip :word
\r
147 global _BottomClip :word
\r
148 global _LeftClip :word
\r
149 global _RightClip :word
\r
151 global _PhysicalStartByteX :word
\r
152 global _PhysicalStartPixelX :word
\r
153 global _PhysicalStartY :word
\r
155 global _VsyncHandlerActive :word
\r
156 global _MouseRefreshFlag :word
\r
157 global _MouseVsyncHandler :dword
\r
158 global _StartAddressFlag :word
\r
159 global _WaitingStartLow :word
\r
160 global _WaitingStartHigh :word
\r
161 global _WaitingPelPan :word
\r
162 global _VsyncPaletteStart :word
\r
163 global _VsyncPaletteCount :word
\r
164 global _VsyncPaletteBuffer :byte
\r