Rev 387 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 387 | Rev 444 | ||
---|---|---|---|
- | 1 | $Revision: 431 $ |
|
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
- | 3 | ;; ;; |
|
- | 4 | ;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; |
|
- | 5 | ;; Distributed under terms of the GNU General Public License ;; |
|
2 | ;; ;; |
6 | ;; ;; |
3 | ;; VESA12.INC ;; |
7 | ;; VESA12.INC ;; |
4 | ;; ;; |
8 | ;; ;; |
5 | ;; Vesa 1.2 functions for MenuetOS ;; |
9 | ;; Vesa 1.2 functions for MenuetOS ;; |
6 | ;; ;; |
10 | ;; ;; |
7 | ;; Copyright 2002 Ville Turjanmaa ;; |
11 | ;; Copyright 2002 Ville Turjanmaa ;; |
8 | ;; ;; |
12 | ;; ;; |
9 | ;; quickcode@mail.ru - bankswitch for S3 cards ;; |
13 | ;; quickcode@mail.ru - bankswitch for S3 cards ;; |
10 | ;; ;; |
14 | ;; ;; |
11 | ;; See file COPYING for details ;; |
15 | ;; See file COPYING for details ;; |
12 | ;; ;; |
16 | ;; ;; |
13 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
17 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
14 | 18 | ||
15 | 19 | ||
16 | ; A complete video driver should include the following types of function |
20 | ; A complete video driver should include the following types of function |
17 | ; |
21 | ; |
18 | ; Putpixel |
22 | ; Putpixel |
19 | ; Getpixel |
23 | ; Getpixel |
20 | ; |
24 | ; |
21 | ; Drawimage |
25 | ; Drawimage |
22 | ; Drawbar |
26 | ; Drawbar |
23 | ; |
27 | ; |
24 | ; Drawbackground |
28 | ; Drawbackground |
25 | ; |
29 | ; |
26 | ; |
30 | ; |
27 | ; Modifying the set_bank -function is mostly enough |
31 | ; Modifying the set_bank -function is mostly enough |
28 | ; for different Vesa 1.2 setups. |
32 | ; for different Vesa 1.2 setups. |
29 | 33 | ||
30 | ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
34 | ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
31 | ; set_bank for Trident videocards, work on Trident 9440 |
35 | ; set_bank for Trident videocards, work on Trident 9440 |
32 | ; modified by Mario79 |
36 | ; modified by Mario79 |
33 | ;set_bank: |
37 | ;set_bank: |
34 | ;cli |
38 | ;cli |
35 | ;cmp al,[BANK_RW] |
39 | ;cmp al,[BANK_RW] |
36 | ;je retsb |
40 | ;je retsb |
37 | ;mov [BANK_RW],al |
41 | ;mov [BANK_RW],al |
38 | ;push dx |
42 | ;push dx |
39 | ;mov dx,3D8h |
43 | ;mov dx,3D8h |
40 | ;out dx,al |
44 | ;out dx,al |
41 | ;pop dx |
45 | ;pop dx |
42 | ;retsb: |
46 | ;retsb: |
43 | ;sti |
47 | ;sti |
44 | ;ret |
48 | ;ret |
45 | 49 | ||
46 | 50 | ||
47 | ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
51 | ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
48 | ; set_bank for S3 videocards, work on S3 ViRGE PCI (325) |
52 | ; set_bank for S3 videocards, work on S3 ViRGE PCI (325) |
49 | ; modified by kmeaw |
53 | ; modified by kmeaw |
50 | set_bank: |
54 | set_bank: |
51 | pushfd |
55 | pushfd |
52 | cli |
56 | cli |
53 | cmp al,[BANK_RW] |
57 | cmp al,[BANK_RW] |
54 | je retsb |
58 | je retsb |
55 | mov [BANK_RW],al |
59 | mov [BANK_RW],al |
56 | push ax |
60 | push ax |
57 | push dx |
61 | push dx |
58 | push cx |
62 | push cx |
59 | mov cl, al |
63 | mov cl, al |
60 | mov dx, 0x3D4 |
64 | mov dx, 0x3D4 |
61 | mov al, 0x38 |
65 | mov al, 0x38 |
62 | out dx, al ;CR38 Register Lock 1 ;Note: Traditionally 48h is used to |
66 | out dx, al ;CR38 Register Lock 1 ;Note: Traditionally 48h is used to |
63 | ;unlock and 00h to lock |
67 | ;unlock and 00h to lock |
64 | inc dx |
68 | inc dx |
65 | mov al, 0x48 |
69 | mov al, 0x48 |
66 | out dx, al ;3d5 -? |
70 | out dx, al ;3d5 -? |
67 | dec dx |
71 | dec dx |
68 | mov al, 0x31 |
72 | mov al, 0x31 |
69 | out dx, al ;CR31 Memory Configuration Register |
73 | out dx, al ;CR31 Memory Configuration Register |
70 | ;0 Enable Base Address Offset (CPUA BASE). Enables bank operation if set, ;disables if clear. |
74 | ;0 Enable Base Address Offset (CPUA BASE). Enables bank operation if set, ;disables if clear. |
71 | ;4-5 Bit 16-17 of the Display Start Address. For the 801/5,928 see index 51h, |
75 | ;4-5 Bit 16-17 of the Display Start Address. For the 801/5,928 see index 51h, |
72 | ;for the 864/964 see index 69h. |
76 | ;for the 864/964 see index 69h. |
73 | 77 | ||
74 | inc dx |
78 | inc dx |
75 | in al, dx |
79 | in al, dx |
76 | dec dx |
80 | dec dx |
77 | mov ah, al |
81 | mov ah, al |
78 | mov al, 0x31 |
82 | mov al, 0x31 |
79 | out dx, ax |
83 | out dx, ax |
80 | mov al, ah |
84 | mov al, ah |
81 | or al, 9 |
85 | or al, 9 |
82 | inc dx |
86 | inc dx |
83 | out dx, al |
87 | out dx, al |
84 | dec dx |
88 | dec dx |
85 | mov al, 0x35 |
89 | mov al, 0x35 |
86 | out dx, al ;CR35 CRT Register Lock |
90 | out dx, al ;CR35 CRT Register Lock |
87 | inc dx |
91 | inc dx |
88 | in al, dx |
92 | in al, dx |
89 | dec dx |
93 | dec dx |
90 | and al, 0xF0 |
94 | and al, 0xF0 |
91 | mov ch, cl |
95 | mov ch, cl |
92 | and ch, 0x0F |
96 | and ch, 0x0F |
93 | or ch, al |
97 | or ch, al |
94 | mov al, 0x35 |
98 | mov al, 0x35 |
95 | out dx, al |
99 | out dx, al |
96 | inc dx |
100 | inc dx |
97 | mov al, ch |
101 | mov al, ch |
98 | out dx, ax |
102 | out dx, ax |
99 | dec dx |
103 | dec dx |
100 | mov al, 0x51 ;Extended System Control 2 Register |
104 | mov al, 0x51 ;Extended System Control 2 Register |
101 | out dx, al |
105 | out dx, al |
102 | inc dx |
106 | inc dx |
103 | in al, dx |
107 | in al, dx |
104 | dec dx |
108 | dec dx |
105 | and al, 0xF3 |
109 | and al, 0xF3 |
106 | shr cl, 2 |
110 | shr cl, 2 |
107 | and cl, 0x0C |
111 | and cl, 0x0C |
108 | or cl, al |
112 | or cl, al |
109 | mov al, 0x51 |
113 | mov al, 0x51 |
110 | out dx, al |
114 | out dx, al |
111 | inc dx |
115 | inc dx |
112 | mov al, cl |
116 | mov al, cl |
113 | out dx, al |
117 | out dx, al |
114 | dec dx |
118 | dec dx |
115 | mov al, 0x38 |
119 | mov al, 0x38 |
116 | out dx, al |
120 | out dx, al |
117 | inc dx |
121 | inc dx |
118 | xor al, al |
122 | xor al, al |
119 | out dx, al |
123 | out dx, al |
120 | dec dx |
124 | dec dx |
121 | pop cx |
125 | pop cx |
122 | pop dx |
126 | pop dx |
123 | pop ax |
127 | pop ax |
124 | retsb: |
128 | retsb: |
125 | popfd |
129 | popfd |
126 | ret |
130 | ret |
127 | 131 | ||
128 | ;Set bank function for Intel 810/815 chipsets |
132 | ;Set bank function for Intel 810/815 chipsets |
129 | ; *****Modified by Protopopius, Russia.***** |
133 | ; *****Modified by Protopopius, Russia.***** |
130 | ; ********* http://menuetos.hut.ru ************** |
134 | ; ********* http://menuetos.hut.ru ************** |
131 | ; ************************************************ |
135 | ; ************************************************ |
132 | ; |
136 | ; |
133 | ;set_bank: |
137 | ;set_bank: |
134 | ;cli |
138 | ;cli |
135 | ;cmp al,[BANK_RW] |
139 | ;cmp al,[BANK_RW] |
136 | ;je retsb |
140 | ;je retsb |
137 | ;mov [BANK_RW],al |
141 | ;mov [BANK_RW],al |
138 | ;push ax |
142 | ;push ax |
139 | ;push dx |
143 | ;push dx |
140 | ;mov dx,3CEh |
144 | ;mov dx,3CEh |
141 | ;mov ah,al ; Save value for later use |
145 | ;mov ah,al ; Save value for later use |
142 | ;mov al,10h ; Index GR10 (Address Mapping) |
146 | ;mov al,10h ; Index GR10 (Address Mapping) |
143 | ;out dx,al ; Select GR10 |
147 | ;out dx,al ; Select GR10 |
144 | ;inc dl |
148 | ;inc dl |
145 | ;mov al,3 ; Set bits 0 and 1 (Enable linear page mapping) |
149 | ;mov al,3 ; Set bits 0 and 1 (Enable linear page mapping) |
146 | ;out dx,al ; Write value |
150 | ;out dx,al ; Write value |
147 | ;dec dl |
151 | ;dec dl |
148 | ;mov al,11h ; Index GR11 (Page Selector) |
152 | ;mov al,11h ; Index GR11 (Page Selector) |
149 | ;out dx,al ; Select GR11 |
153 | ;out dx,al ; Select GR11 |
150 | ;inc dl |
154 | ;inc dl |
151 | ;mov al,ah ; Write address |
155 | ;mov al,ah ; Write address |
152 | ;out dx,al ; Write the value |
156 | ;out dx,al ; Write the value |
153 | ;pop dx |
157 | ;pop dx |
154 | ;pop ax |
158 | ;pop ax |
155 | ;retsb: |
159 | ;retsb: |
156 | ;sti |
160 | ;sti |
157 | ;ret |
161 | ;ret |
158 | 162 | ||
159 | ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!} |
163 | ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!} |
160 | 164 | ||
161 | ;set_bank: |
165 | ;set_bank: |
162 | ; cli |
166 | ; cli |
163 | ; cmp al,[BANK_RW] |
167 | ; cmp al,[BANK_RW] |
164 | ; je retsb |
168 | ; je retsb |
165 | ; mov [BANK_RW],al |
169 | ; mov [BANK_RW],al |
166 | ; push ax |
170 | ; push ax |
167 | ; push dx |
171 | ; push dx |
168 | ; mov ah,al |
172 | ; mov ah,al |
169 | ; mov dx,0x03D4 |
173 | ; mov dx,0x03D4 |
170 | ; mov al,0x39 |
174 | ; mov al,0x39 |
171 | ; out dx,al |
175 | ; out dx,al |
172 | ; inc dl |
176 | ; inc dl |
173 | ; mov al,0xA5 |
177 | ; mov al,0xA5 |
174 | ; out dx,al |
178 | ; out dx,al |
175 | ; dec dl |
179 | ; dec dl |
176 | ; mov al,6Ah |
180 | ; mov al,6Ah |
177 | ; out dx,al |
181 | ; out dx,al |
178 | ; inc dl |
182 | ; inc dl |
179 | ; mov al,ah |
183 | ; mov al,ah |
180 | ; out dx,al |
184 | ; out dx,al |
181 | ; dec dl |
185 | ; dec dl |
182 | ; mov al,0x39 |
186 | ; mov al,0x39 |
183 | ; out dx,al |
187 | ; out dx,al |
184 | ; inc dl |
188 | ; inc dl |
185 | ; mov al,0x5A |
189 | ; mov al,0x5A |
186 | ; out dx,al |
190 | ; out dx,al |
187 | ; dec dl |
191 | ; dec dl |
188 | ; pop dx |
192 | ; pop dx |
189 | ; pop ax |
193 | ; pop ax |
190 | ; |
194 | ; |
191 | ; retsb: |
195 | ; retsb: |
192 | ; ret |
196 | ; ret |
193 | 197 | ||
194 | 198 | ||
195 | vesa12_drawbackground: |
199 | vesa12_drawbackground: |
196 | 200 | ||
197 | call [disable_mouse] |
201 | call [disable_mouse] |
198 | 202 | ||
199 | push eax |
203 | push eax |
200 | push ebx |
204 | push ebx |
201 | push ecx |
205 | push ecx |
202 | push edx |
206 | push edx |
203 | 207 | ||
204 | xor edx,edx |
208 | xor edx,edx |
205 | mov eax,dword[WinMapAddress-8] |
209 | mov eax,dword[WinMapAddress-8] |
206 | mov ebx,dword[WinMapAddress-4] |
210 | mov ebx,dword[WinMapAddress-4] |
207 | mul ebx |
211 | mul ebx |
208 | mov ebx,3 |
212 | mov ebx,3 |
209 | mul ebx |
213 | mul ebx |
210 | mov [imax],eax |
214 | mov [imax],eax |
211 | mov eax,[draw_data+32+RECT.left] |
215 | mov eax,[draw_data+32+RECT.left] |
212 | mov ebx,[draw_data+32+RECT.top] |
216 | mov ebx,[draw_data+32+RECT.top] |
213 | mov edi,0 ;no force |
217 | mov edi,0 ;no force |
214 | 218 | ||
215 | v12dp3: |
219 | v12dp3: |
216 | 220 | ||
217 | push eax |
221 | push eax |
218 | push ebx |
222 | push ebx |
219 | mov esi,IMG_BACKGROUND |
223 | mov esi,IMG_BACKGROUND |
220 | 224 | ||
221 | cmp [WinMapAddress-12],dword 1 ; tiled background |
225 | cmp [WinMapAddress-12],dword 1 ; tiled background |
222 | jne no_vesa12_tiled_bgr |
226 | jne no_vesa12_tiled_bgr |
223 | 227 | ||
224 | push edx |
228 | push edx |
225 | 229 | ||
226 | xor edx,edx |
230 | xor edx,edx |
227 | mov ecx,[WinMapAddress-8] |
231 | mov ecx,[WinMapAddress-8] |
228 | div ecx |
232 | div ecx |
229 | mov eax,edx |
233 | mov eax,edx |
230 | 234 | ||
231 | push eax |
235 | push eax |
232 | mov eax,ebx |
236 | mov eax,ebx |
233 | xor edx,edx |
237 | xor edx,edx |
234 | mov ecx,[WinMapAddress-4] |
238 | mov ecx,[WinMapAddress-4] |
235 | div ecx |
239 | div ecx |
236 | mov ebx,edx |
240 | mov ebx,edx |
237 | pop eax |
241 | pop eax |
238 | 242 | ||
239 | pop edx |
243 | pop edx |
240 | 244 | ||
241 | no_vesa12_tiled_bgr: |
245 | no_vesa12_tiled_bgr: |
242 | 246 | ||
243 | cmp [WinMapAddress-12],dword 2 ; stretched background |
247 | cmp [WinMapAddress-12],dword 2 ; stretched background |
244 | jne no_vesa12_stretched_bgr |
248 | jne no_vesa12_stretched_bgr |
245 | 249 | ||
246 | push edx |
250 | push edx |
247 | 251 | ||
248 | imul eax,dword [WinMapAddress-8] |
252 | imul eax,dword [WinMapAddress-8] |
249 | xor edx,edx |
253 | xor edx,edx |
250 | mov ecx,[ScreenWidth] |
254 | mov ecx,[ScreenWidth] |
251 | inc ecx |
255 | inc ecx |
252 | div ecx |
256 | div ecx |
253 | 257 | ||
254 | push eax |
258 | push eax |
255 | mov eax,ebx |
259 | mov eax,ebx |
256 | imul eax,dword [WinMapAddress-4] |
260 | imul eax,dword [WinMapAddress-4] |
257 | xor edx,edx |
261 | xor edx,edx |
258 | mov ecx,[ScreenHeight] |
262 | mov ecx,[ScreenHeight] |
259 | inc ecx |
263 | inc ecx |
260 | div ecx |
264 | div ecx |
261 | mov ebx,eax |
265 | mov ebx,eax |
262 | pop eax |
266 | pop eax |
263 | 267 | ||
264 | pop edx |
268 | pop edx |
265 | 269 | ||
266 | no_vesa12_stretched_bgr: |
270 | no_vesa12_stretched_bgr: |
267 | 271 | ||
268 | 272 | ||
269 | push eax |
273 | push eax |
270 | mov eax,ebx |
274 | mov eax,ebx |
271 | xor edx,edx |
275 | xor edx,edx |
272 | mov ebx,[WinMapAddress-8] |
276 | mov ebx,[WinMapAddress-8] |
273 | add ebx,[WinMapAddress-8] |
277 | add ebx,[WinMapAddress-8] |
274 | add ebx,[WinMapAddress-8] |
278 | add ebx,[WinMapAddress-8] |
275 | mul ebx |
279 | mul ebx |
276 | mov esi,eax |
280 | mov esi,eax |
277 | pop eax |
281 | pop eax |
278 | add esi,eax |
282 | add esi,eax |
279 | add esi,eax |
283 | add esi,eax |
280 | add esi,eax |
284 | add esi,eax |
281 | add esi,IMG_BACKGROUND |
285 | add esi,IMG_BACKGROUND |
282 | pop ebx |
286 | pop ebx |
283 | pop eax |
287 | pop eax |
284 | 288 | ||
285 | v12di4: |
289 | v12di4: |
286 | 290 | ||
287 | mov ecx,[esi] |
291 | mov ecx,[esi] |
288 | pusha |
292 | pusha |
289 | mov esi,eax |
293 | mov esi,eax |
290 | mov edi,ebx |
294 | mov edi,ebx |
291 | mov eax,[ScreenWidth] |
295 | mov eax,[ScreenWidth] |
292 | add eax,1 |
296 | add eax,1 |
293 | mul ebx |
297 | mul ebx |
294 | add eax,esi |
298 | add eax,esi |
295 | add eax,WinMapAddress |
299 | add eax,WinMapAddress |
296 | cmp [eax],byte 1 |
300 | cmp [eax],byte 1 |
297 | jnz v12nbgp |
301 | jnz v12nbgp |
298 | mov eax,[BytesPerScanLine] |
302 | mov eax,[BytesPerScanLine] |
299 | mov ebx,edi |
303 | mov ebx,edi |
300 | mul ebx |
304 | mul ebx |
301 | add eax,esi |
305 | add eax,esi |
302 | add eax,esi |
306 | add eax,esi |
303 | add eax,esi |
307 | add eax,esi |
304 | cmp [ScreenBPP],byte 24 |
308 | cmp [ScreenBPP],byte 24 |
305 | jz v12bgl3 |
309 | jz v12bgl3 |
306 | add eax,esi |
310 | add eax,esi |
307 | 311 | ||
308 | v12bgl3: |
312 | v12bgl3: |
309 | 313 | ||
310 | push ebx |
314 | push ebx |
311 | push eax |
315 | push eax |
312 | 316 | ||
313 | sub eax,[LFBAddress] |
317 | sub eax,[LFBAddress] |
314 | 318 | ||
315 | shr eax,16 |
319 | shr eax,16 |
316 | call set_bank |
320 | call set_bank |
317 | pop eax |
321 | pop eax |
318 | and eax,65535 |
322 | and eax,65535 |
319 | add eax,VGABasePtr |
323 | add eax,VGABasePtr |
320 | pop ebx |
324 | pop ebx |
321 | 325 | ||
322 | mov [eax],cx |
326 | mov [eax],cx |
323 | add eax,2 |
327 | add eax,2 |
324 | shr ecx,16 |
328 | shr ecx,16 |
325 | mov [eax],cl |
329 | mov [eax],cl |
326 | sti |
330 | sti |
327 | 331 | ||
328 | v12nbgp: |
332 | v12nbgp: |
329 | 333 | ||
330 | popa |
334 | popa |
331 | add esi,3 |
335 | add esi,3 |
332 | inc eax |
336 | inc eax |
333 | cmp eax,[draw_data+32+RECT.right] |
337 | cmp eax,[draw_data+32+RECT.right] |
334 | jg v12nodp31 |
338 | jg v12nodp31 |
335 | jmp v12dp3 |
339 | jmp v12dp3 |
336 | 340 | ||
337 | v12nodp31: |
341 | v12nodp31: |
338 | 342 | ||
339 | mov eax,[draw_data+32+RECT.left] |
343 | mov eax,[draw_data+32+RECT.left] |
340 | inc ebx |
344 | inc ebx |
341 | cmp ebx,[draw_data+32+RECT.bottom] |
345 | cmp ebx,[draw_data+32+RECT.bottom] |
342 | jg v12dp4 |
346 | jg v12dp4 |
343 | jmp v12dp3 |
347 | jmp v12dp3 |
344 | 348 | ||
345 | v12dp4: |
349 | v12dp4: |
346 | 350 | ||
347 | pop edx |
351 | pop edx |
348 | pop ecx |
352 | pop ecx |
349 | pop ebx |
353 | pop ebx |
350 | pop eax |
354 | pop eax |
351 | ret |
355 | ret |
352 | 356 | ||
353 | 357 | ||
354 | vesa12_drawbar: |
358 | vesa12_drawbar: |
355 | 359 | ||
356 | call [disable_mouse] |
360 | call [disable_mouse] |
357 | 361 | ||
358 | ;; mov [novesachecksum],dword 0 |
362 | ;; mov [novesachecksum],dword 0 |
359 | sub edx,ebx |
363 | sub edx,ebx |
360 | sub ecx,eax |
364 | sub ecx,eax |
361 | push esi |
365 | push esi |
362 | push edi |
366 | push edi |
363 | push eax |
367 | push eax |
364 | push ebx |
368 | push ebx |
365 | push ecx |
369 | push ecx |
366 | push edx |
370 | push edx |
367 | mov ecx,[TASK_BASE] |
371 | mov ecx,[TASK_BASE] |
368 | add eax,[ecx-twdw+WDATA.box.left] |
372 | add eax,[ecx-twdw+WDATA.box.left] |
369 | add ebx,[ecx-twdw+WDATA.box.top] |
373 | add ebx,[ecx-twdw+WDATA.box.top] |
370 | push eax |
374 | push eax |
371 | mov eax,ebx ; y |
375 | mov eax,ebx ; y |
372 | mov ebx,[BytesPerScanLine] |
376 | mov ebx,[BytesPerScanLine] |
373 | mul ebx |
377 | mul ebx |
374 | pop ecx |
378 | pop ecx |
375 | add eax,ecx ; x |
379 | add eax,ecx ; x |
376 | add eax,ecx |
380 | add eax,ecx |
377 | add eax,ecx |
381 | add eax,ecx |
378 | cmp [ScreenBPP],byte 24 ; 24 or 32 bpp ? - x start |
382 | cmp [ScreenBPP],byte 24 ; 24 or 32 bpp ? - x start |
379 | jz dbpi2412 |
383 | jz dbpi2412 |
380 | add eax,ecx |
384 | add eax,ecx |
381 | 385 | ||
382 | dbpi2412: |
386 | dbpi2412: |
383 | 387 | ||
384 | add eax,[LFBAddress] |
388 | add eax,[LFBAddress] |
385 | mov edi,eax |
389 | mov edi,eax |
386 | 390 | ||
387 | ; x size |
391 | ; x size |
388 | 392 | ||
389 | mov eax,[esp+4] ; [esp+6] |
393 | mov eax,[esp+4] ; [esp+6] |
390 | mov ecx,eax |
394 | mov ecx,eax |
391 | add ecx,eax |
395 | add ecx,eax |
392 | add ecx,eax |
396 | add ecx,eax |
393 | cmp [ScreenBPP],byte 24 ; 24 or 32 bpp ? - x size |
397 | cmp [ScreenBPP],byte 24 ; 24 or 32 bpp ? - x size |
394 | jz dbpi24312 |
398 | jz dbpi24312 |
395 | add ecx,eax |
399 | add ecx,eax |
396 | 400 | ||
397 | dbpi24312: |
401 | dbpi24312: |
398 | 402 | ||
399 | mov ebx,[esp+0] |
403 | mov ebx,[esp+0] |
400 | 404 | ||
401 | ; check limits ? |
405 | ; check limits ? |
402 | 406 | ||
403 | push eax |
407 | push eax |
404 | push ecx |
408 | push ecx |
405 | mov eax,[TASK_BASE] |
409 | mov eax,[TASK_BASE] |
406 | mov ecx,[eax+draw_data-CURRENT_TASK+RECT.left] |
410 | mov ecx,[eax+draw_data-CURRENT_TASK+RECT.left] |
407 | cmp ecx,0 |
411 | cmp ecx,0 |
408 | jnz dbcblimitlset12 |
412 | jnz dbcblimitlset12 |
409 | mov ecx,[eax+draw_data-CURRENT_TASK+RECT.top] |
413 | mov ecx,[eax+draw_data-CURRENT_TASK+RECT.top] |
410 | cmp ecx,0 |
414 | cmp ecx,0 |
411 | jnz dbcblimitlset12 |
415 | jnz dbcblimitlset12 |
412 | mov ecx,[eax+draw_data-CURRENT_TASK+RECT.right] |
416 | mov ecx,[eax+draw_data-CURRENT_TASK+RECT.right] |
413 | cmp ecx,[ScreenWidth] |
417 | cmp ecx,[ScreenWidth] |
414 | jnz dbcblimitlset12 |
418 | jnz dbcblimitlset12 |
415 | mov ecx,[eax+draw_data-CURRENT_TASK+RECT.bottom] |
419 | mov ecx,[eax+draw_data-CURRENT_TASK+RECT.bottom] |
416 | cmp ecx,[ScreenHeight] |
420 | cmp ecx,[ScreenHeight] |
417 | jnz dbcblimitlset12 |
421 | jnz dbcblimitlset12 |
418 | pop ecx |
422 | pop ecx |
419 | pop eax |
423 | pop eax |
420 | push dword 0 |
424 | push dword 0 |
421 | jmp dbcblimitlno12 |
425 | jmp dbcblimitlno12 |
422 | 426 | ||
423 | dbcblimitlset12: |
427 | dbcblimitlset12: |
424 | 428 | ||
425 | pop ecx |
429 | pop ecx |
426 | pop eax |
430 | pop eax |
427 | push dword 1 |
431 | push dword 1 |
428 | 432 | ||
429 | dbcblimitlno12: |
433 | dbcblimitlno12: |
430 | 434 | ||
431 | cmp [ScreenBPP],byte 24 ; 24 or 32 bpp ? |
435 | cmp [ScreenBPP],byte 24 ; 24 or 32 bpp ? |
432 | jz dbpi24bit12 |
436 | jz dbpi24bit12 |
433 | jmp dbpi32bit12 |
437 | jmp dbpi32bit12 |
434 | 438 | ||
435 | 439 | ||
436 | ; DRAWBAR 24 BBP |
440 | ; DRAWBAR 24 BBP |
437 | 441 | ||
438 | 442 | ||
439 | dbpi24bit12: |
443 | dbpi24bit12: |
440 | 444 | ||
441 | push eax |
445 | push eax |
442 | push ebx |
446 | push ebx |
443 | push edx |
447 | push edx |
444 | mov eax,ecx |
448 | mov eax,ecx |
445 | mov ebx,3 |
449 | mov ebx,3 |
446 | div ebx |
450 | div ebx |
447 | mov ecx,eax |
451 | mov ecx,eax |
448 | pop edx |
452 | pop edx |
449 | pop ebx |
453 | pop ebx |
450 | pop eax |
454 | pop eax |
451 | cld |
455 | cld |
452 | 456 | ||
453 | dbnewpi12: |
457 | dbnewpi12: |
454 | 458 | ||
455 | push ebx |
459 | push ebx |
456 | push edi |
460 | push edi |
457 | push ecx |
461 | push ecx |
458 | 462 | ||
459 | xor edx,edx |
463 | xor edx,edx |
460 | mov eax,edi |
464 | mov eax,edi |
461 | sub eax,[LFBAddress] |
465 | sub eax,[LFBAddress] |
462 | mov ebx,3 |
466 | mov ebx,3 |
463 | div ebx |
467 | div ebx |
464 | add eax,WinMapAddress |
468 | add eax,WinMapAddress |
465 | mov ebx,[CURRENT_TASK] |
469 | mov ebx,[CURRENT_TASK] |
466 | cld |
470 | cld |
467 | 471 | ||
468 | dbnp2412: |
472 | dbnp2412: |
469 | 473 | ||
470 | mov dl,[eax] |
474 | mov dl,[eax] |
471 | push eax |
475 | push eax |
472 | push ecx |
476 | push ecx |
473 | cmp dl,bl |
477 | cmp dl,bl |
474 | jnz dbimp24no12 |
478 | jnz dbimp24no12 |
475 | cmp [esp+5*4],dword 0 |
479 | cmp [esp+5*4],dword 0 |
476 | jz dbimp24yes12 |
480 | jz dbimp24yes12 |
477 | ; call dbcplimit |
481 | ; call dbcplimit |
478 | ; jnz dbimp24no12 |
482 | ; jnz dbimp24no12 |
479 | 483 | ||
480 | dbimp24yes12: |
484 | dbimp24yes12: |
481 | 485 | ||
482 | push edi |
486 | push edi |
483 | mov eax,edi |
487 | mov eax,edi |
484 | sub eax,[LFBAddress] |
488 | sub eax,[LFBAddress] |
485 | shr eax,16 |
489 | shr eax,16 |
486 | call set_bank |
490 | call set_bank |
487 | and edi,0xffff |
491 | and edi,0xffff |
488 | add edi,VGABasePtr |
492 | add edi,VGABasePtr |
489 | mov eax,[esp+8+3*4+16+4+4] |
493 | mov eax,[esp+8+3*4+16+4+4] |
490 | stosw |
494 | stosw |
491 | shr eax,16 |
495 | shr eax,16 |
492 | stosb |
496 | stosb |
493 | sti |
497 | sti |
494 | pop edi |
498 | pop edi |
495 | add edi,3 |
499 | add edi,3 |
496 | pop ecx |
500 | pop ecx |
497 | pop eax |
501 | pop eax |
498 | inc eax |
502 | inc eax |
499 | loop dbnp2412 |
503 | loop dbnp2412 |
500 | jmp dbnp24d12 |
504 | jmp dbnp24d12 |
501 | 505 | ||
502 | dbimp24no12: |
506 | dbimp24no12: |
503 | 507 | ||
504 | pop ecx |
508 | pop ecx |
505 | pop eax |
509 | pop eax |
506 | cld |
510 | cld |
507 | add edi,3 |
511 | add edi,3 |
508 | inc eax |
512 | inc eax |
509 | loop dbnp2412 |
513 | loop dbnp2412 |
510 | 514 | ||
511 | dbnp24d12: |
515 | dbnp24d12: |
512 | 516 | ||
513 | mov eax,[esp+3*4+16+4] |
517 | mov eax,[esp+3*4+16+4] |
514 | test eax,0x80000000 |
518 | test eax,0x80000000 |
515 | jz nodbgl2412 |
519 | jz nodbgl2412 |
516 | cmp al,0 |
520 | cmp al,0 |
517 | jz nodbgl2412 |
521 | jz nodbgl2412 |
518 | dec eax |
522 | dec eax |
519 | mov [esp+3*4+16+4],eax |
523 | mov [esp+3*4+16+4],eax |
520 | 524 | ||
521 | nodbgl2412: |
525 | nodbgl2412: |
522 | 526 | ||
523 | pop ecx |
527 | pop ecx |
524 | pop edi |
528 | pop edi |
525 | pop ebx |
529 | pop ebx |
526 | add edi,[BytesPerScanLine] |
530 | add edi,[BytesPerScanLine] |
527 | dec ebx |
531 | dec ebx |
528 | jz dbnonewpi12 |
532 | jz dbnonewpi12 |
529 | jmp dbnewpi12 |
533 | jmp dbnewpi12 |
530 | 534 | ||
531 | dbnonewpi12: |
535 | dbnonewpi12: |
532 | 536 | ||
533 | add esp,7*4 |
537 | add esp,7*4 |
534 | 538 | ||
535 | ret |
539 | ret |
536 | 540 | ||
537 | 541 | ||
538 | ; DRAWBAR 32 BBP |
542 | ; DRAWBAR 32 BBP |
539 | 543 | ||
540 | 544 | ||
541 | dbpi32bit12: |
545 | dbpi32bit12: |
542 | 546 | ||
543 | cld |
547 | cld |
544 | shr ecx,2 |
548 | shr ecx,2 |
545 | 549 | ||
546 | dbnewpi3212: |
550 | dbnewpi3212: |
547 | 551 | ||
548 | push ebx |
552 | push ebx |
549 | push edi |
553 | push edi |
550 | push ecx |
554 | push ecx |
551 | 555 | ||
552 | mov eax,edi |
556 | mov eax,edi |
553 | sub eax,[LFBAddress] |
557 | sub eax,[LFBAddress] |
554 | shr eax,2 |
558 | shr eax,2 |
555 | add eax,WinMapAddress |
559 | add eax,WinMapAddress |
556 | mov ebx,[CURRENT_TASK] |
560 | mov ebx,[CURRENT_TASK] |
557 | cld |
561 | cld |
558 | 562 | ||
559 | dbnp3212: |
563 | dbnp3212: |
560 | 564 | ||
561 | mov dl,[eax] |
565 | mov dl,[eax] |
562 | push eax |
566 | push eax |
563 | push ecx |
567 | push ecx |
564 | cmp dl,bl |
568 | cmp dl,bl |
565 | jnz dbimp32no12 |
569 | jnz dbimp32no12 |
566 | cmp [esp+5*4],dword 0 |
570 | cmp [esp+5*4],dword 0 |
567 | jz dbimp32yes12 |
571 | jz dbimp32yes12 |
568 | ; call dbcplimit |
572 | ; call dbcplimit |
569 | ; jnz dbimp32no12 |
573 | ; jnz dbimp32no12 |
570 | 574 | ||
571 | dbimp32yes12: |
575 | dbimp32yes12: |
572 | 576 | ||
573 | push edi |
577 | push edi |
574 | mov eax,edi |
578 | mov eax,edi |
575 | sub eax,[LFBAddress] |
579 | sub eax,[LFBAddress] |
576 | shr eax,16 |
580 | shr eax,16 |
577 | call set_bank |
581 | call set_bank |
578 | and edi,0xffff |
582 | and edi,0xffff |
579 | add edi,VGABasePtr |
583 | add edi,VGABasePtr |
580 | mov eax,[esp+8+3*4+16+4+4] |
584 | mov eax,[esp+8+3*4+16+4+4] |
581 | stosw |
585 | stosw |
582 | shr eax,16 |
586 | shr eax,16 |
583 | stosb |
587 | stosb |
584 | sti |
588 | sti |
585 | pop edi |
589 | pop edi |
586 | add edi,4 |
590 | add edi,4 |
587 | inc ebp |
591 | inc ebp |
588 | pop ecx |
592 | pop ecx |
589 | pop eax |
593 | pop eax |
590 | inc eax |
594 | inc eax |
591 | loop dbnp3212 |
595 | loop dbnp3212 |
592 | jmp dbnp32d12 |
596 | jmp dbnp32d12 |
593 | 597 | ||
594 | dbimp32no12: |
598 | dbimp32no12: |
595 | 599 | ||
596 | pop ecx |
600 | pop ecx |
597 | pop eax |
601 | pop eax |
598 | inc eax |
602 | inc eax |
599 | add edi,4 |
603 | add edi,4 |
600 | inc ebp |
604 | inc ebp |
601 | loop dbnp3212 |
605 | loop dbnp3212 |
602 | 606 | ||
603 | dbnp32d12: |
607 | dbnp32d12: |
604 | 608 | ||
605 | mov eax,[esp+12+16+4] |
609 | mov eax,[esp+12+16+4] |
606 | test eax,0x80000000 |
610 | test eax,0x80000000 |
607 | jz nodbgl3212 |
611 | jz nodbgl3212 |
608 | cmp al,0 |
612 | cmp al,0 |
609 | jz nodbgl3212 |
613 | jz nodbgl3212 |
610 | dec eax |
614 | dec eax |
611 | mov [esp+12+16+4],eax |
615 | mov [esp+12+16+4],eax |
612 | 616 | ||
613 | nodbgl3212: |
617 | nodbgl3212: |
614 | 618 | ||
615 | pop ecx |
619 | pop ecx |
616 | pop edi |
620 | pop edi |
617 | pop ebx |
621 | pop ebx |
618 | add edi,[BytesPerScanLine] |
622 | add edi,[BytesPerScanLine] |
619 | dec ebx |
623 | dec ebx |
620 | jz nodbnewpi3212 |
624 | jz nodbnewpi3212 |
621 | jmp dbnewpi3212 |
625 | jmp dbnewpi3212 |
622 | 626 | ||
623 | nodbnewpi3212: |
627 | nodbnewpi3212: |
624 | 628 | ||
625 | add esp,7*4 |
629 | add esp,7*4 |
626 | ret |
630 | ret |
627 | 631 | ||
628 | 632 | ||
629 | Vesa12_putpixel24: |
633 | Vesa12_putpixel24: |
630 | 634 | ||
631 | mov edi,eax ; x |
635 | mov edi,eax ; x |
632 | mov eax,ebx ; y |
636 | mov eax,ebx ; y |
633 | lea edi,[edi+edi*2] |
637 | lea edi,[edi+edi*2] |
634 | mov ebx,[BytesPerScanLine] |
638 | mov ebx,[BytesPerScanLine] |
635 | mul ebx |
639 | mul ebx |
636 | add edi,eax |
640 | add edi,eax |
637 | mov eax,edi |
641 | mov eax,edi |
638 | shr eax,16 |
642 | shr eax,16 |
639 | call set_bank |
643 | call set_bank |
640 | and edi,65535 |
644 | and edi,65535 |
641 | add edi,VGABasePtr |
645 | add edi,VGABasePtr |
642 | mov eax,[esp+28] |
646 | mov eax,[esp+28] |
643 | stosw |
647 | stosw |
644 | shr eax,16 |
648 | shr eax,16 |
645 | mov [edi],al |
649 | mov [edi],al |
646 | sti |
650 | sti |
647 | ret |
651 | ret |
648 | 652 | ||
649 | 653 | ||
650 | 654 | ||
651 | Vesa12_putpixel32: |
655 | Vesa12_putpixel32: |
652 | 656 | ||
653 | mov edi,eax ; x |
657 | mov edi,eax ; x |
654 | mov eax,ebx ; y |
658 | mov eax,ebx ; y |
655 | shl edi,2 |
659 | shl edi,2 |
656 | mov ebx,[BytesPerScanLine] |
660 | mov ebx,[BytesPerScanLine] |
657 | mul ebx |
661 | mul ebx |
658 | add edi,eax |
662 | add edi,eax |
659 | mov eax,edi |
663 | mov eax,edi |
660 | shr eax,16 |
664 | shr eax,16 |
661 | call set_bank |
665 | call set_bank |
662 | and edi,65535 |
666 | and edi,65535 |
663 | add edi,VGABasePtr |
667 | add edi,VGABasePtr |
664 | mov ecx,[esp+28] |
668 | mov ecx,[esp+28] |
665 | mov [edi],ecx |
669 | mov [edi],ecx |
666 | sti |
670 | sti |
667 | ret |
671 | ret |
668 | 672 | ||
669 | 673 | ||
670 | Vesa12_getpixel24: |
674 | Vesa12_getpixel24: |
671 | 675 | ||
672 | mov edi,eax ; x |
676 | mov edi,eax ; x |
673 | mov eax,ebx ; y |
677 | mov eax,ebx ; y |
674 | lea edi,[edi+edi*2] |
678 | lea edi,[edi+edi*2] |
675 | mov ebx,[BytesPerScanLine] |
679 | mov ebx,[BytesPerScanLine] |
676 | mul ebx |
680 | mul ebx |
677 | add edi,eax |
681 | add edi,eax |
678 | mov eax,edi |
682 | mov eax,edi |
679 | shr eax,16 |
683 | shr eax,16 |
680 | call set_bank |
684 | call set_bank |
681 | and edi,65535 |
685 | and edi,65535 |
682 | add edi,VGABasePtr |
686 | add edi,VGABasePtr |
683 | mov ecx,[edi] |
687 | mov ecx,[edi] |
684 | and ecx,255*256*256+255*256+255 |
688 | and ecx,255*256*256+255*256+255 |
685 | sti |
689 | sti |
686 | ret |
690 | ret |
687 | 691 | ||
688 | 692 | ||
689 | Vesa12_getpixel32: |
693 | Vesa12_getpixel32: |
690 | 694 | ||
691 | mov edi,eax ; x |
695 | mov edi,eax ; x |
692 | mov eax,ebx ; y |
696 | mov eax,ebx ; y |
693 | shl edi,2 |
697 | shl edi,2 |
694 | mov ebx,[BytesPerScanLine] |
698 | mov ebx,[BytesPerScanLine] |
695 | xor edx,edx |
699 | xor edx,edx |
696 | mul ebx |
700 | mul ebx |
697 | add edi,eax |
701 | add edi,eax |
698 | mov eax,edi |
702 | mov eax,edi |
699 | shr eax,16 |
703 | shr eax,16 |
700 | call set_bank |
704 | call set_bank |
701 | and edi,65535 |
705 | and edi,65535 |
702 | add edi,VGABasePtr |
706 | add edi,VGABasePtr |
703 | mov ecx,[edi] |
707 | mov ecx,[edi] |
704 | and ecx,255*256*256+255*256+255 |
708 | and ecx,255*256*256+255*256+255 |
705 | sti |
709 | sti |
706 | 710 | ||
707 | ret |
711 | ret |
708 | 712 | ||
709 | 713 | ||
710 | 714 | ||
711 | vesa12_putimage: |
715 | vesa12_putimage: |
712 | ; ebx = pointer to image |
716 | ; ebx = pointer to image |
713 | ; ecx = size [x|y] |
717 | ; ecx = size [x|y] |
714 | ; edx = coordinates [x|y] |
718 | ; edx = coordinates [x|y] |
715 | ; ebp = pointer to 'get' function |
719 | ; ebp = pointer to 'get' function |
716 | ; esi = pointer to 'init' function |
720 | ; esi = pointer to 'init' function |
717 | ; edi = parameter for 'get' function |
721 | ; edi = parameter for 'get' function |
718 | 722 | ||
719 | ; mov ebx,image |
723 | ; mov ebx,image |
720 | ; mov ecx,320*65536+240 |
724 | ; mov ecx,320*65536+240 |
721 | ; mov edx,20*65536+20 |
725 | ; mov edx,20*65536+20 |
722 | 726 | ||
723 | call [disable_mouse] |
727 | call [disable_mouse] |
724 | 728 | ||
725 | mov [novesachecksum],dword 0 |
729 | mov [novesachecksum],dword 0 |
726 | push esi |
730 | push esi |
727 | push edi |
731 | push edi |
728 | push eax |
732 | push eax |
729 | push ebx |
733 | push ebx |
730 | push ecx |
734 | push ecx |
731 | push edx |
735 | push edx |
732 | movzx eax,word [esp+2] |
736 | movzx eax,word [esp+2] |
733 | movzx ebx,word [esp+0] |
737 | movzx ebx,word [esp+0] |
734 | mov ecx,[TASK_BASE] |
738 | mov ecx,[TASK_BASE] |
735 | add eax,[ecx-twdw+WDATA.box.left] |
739 | add eax,[ecx-twdw+WDATA.box.left] |
736 | add ebx,[ecx-twdw+WDATA.box.top] |
740 | add ebx,[ecx-twdw+WDATA.box.top] |
737 | push eax |
741 | push eax |
738 | mov eax,ebx ; y |
742 | mov eax,ebx ; y |
739 | mul dword [BytesPerScanLine] |
743 | mul dword [BytesPerScanLine] |
740 | pop ecx |
744 | pop ecx |
741 | add eax,ecx ; x |
745 | add eax,ecx ; x |
742 | add eax,ecx |
746 | add eax,ecx |
743 | add eax,ecx |
747 | add eax,ecx |
744 | cmp [ScreenBPP],byte 24 ; 24 or 32 bpp ? - x start |
748 | cmp [ScreenBPP],byte 24 ; 24 or 32 bpp ? - x start |
745 | jz pi2412 |
749 | jz pi2412 |
746 | add eax,ecx |
750 | add eax,ecx |
747 | 751 | ||
748 | pi2412: |
752 | pi2412: |
749 | 753 | ||
750 | add eax,[LFBAddress] |
754 | add eax,[LFBAddress] |
751 | mov edi,eax |
755 | mov edi,eax |
752 | 756 | ||
753 | ; x size |
757 | ; x size |
754 | 758 | ||
755 | movzx ecx,word [esp+6] |
759 | movzx ecx,word [esp+6] |
756 | 760 | ||
757 | mov esi,[esp+8] |
761 | mov esi,[esp+8] |
758 | movzx ebx,word [esp+4] |
762 | movzx ebx,word [esp+4] |
759 | 763 | ||
760 | ; check limits while draw ? |
764 | ; check limits while draw ? |
761 | 765 | ||
762 | push ecx |
766 | push ecx |
763 | mov eax,[TASK_BASE] |
767 | mov eax,[TASK_BASE] |
764 | cmp dword [eax+draw_data-CURRENT_TASK+RECT.left], 0 |
768 | cmp dword [eax+draw_data-CURRENT_TASK+RECT.left], 0 |
765 | jnz dbcblimitlset212 |
769 | jnz dbcblimitlset212 |
766 | cmp dword [eax+draw_data-CURRENT_TASK+RECT.top], 0 |
770 | cmp dword [eax+draw_data-CURRENT_TASK+RECT.top], 0 |
767 | jnz dbcblimitlset212 |
771 | jnz dbcblimitlset212 |
768 | mov ecx,[eax+draw_data-CURRENT_TASK+RECT.right] |
772 | mov ecx,[eax+draw_data-CURRENT_TASK+RECT.right] |
769 | cmp ecx,[ScreenWidth] |
773 | cmp ecx,[ScreenWidth] |
770 | jnz dbcblimitlset212 |
774 | jnz dbcblimitlset212 |
771 | mov ecx,[eax+draw_data-CURRENT_TASK+RECT.bottom] |
775 | mov ecx,[eax+draw_data-CURRENT_TASK+RECT.bottom] |
772 | cmp ecx,[ScreenHeight] |
776 | cmp ecx,[ScreenHeight] |
773 | jnz dbcblimitlset212 |
777 | jnz dbcblimitlset212 |
774 | pop ecx |
778 | pop ecx |
775 | push 0 |
779 | push 0 |
776 | jmp dbcblimitlno212 |
780 | jmp dbcblimitlno212 |
777 | 781 | ||
778 | dbcblimitlset212: |
782 | dbcblimitlset212: |
779 | 783 | ||
780 | pop ecx |
784 | pop ecx |
781 | push 1 |
785 | push 1 |
782 | 786 | ||
783 | dbcblimitlno212: |
787 | dbcblimitlno212: |
784 | 788 | ||
785 | cmp [ScreenBPP],byte 24 ; 24 or 32 bpp ? |
789 | cmp [ScreenBPP],byte 24 ; 24 or 32 bpp ? |
786 | jnz pi32bit12 |
790 | jnz pi32bit12 |
787 | 791 | ||
788 | pi24bit12: |
792 | pi24bit12: |
789 | 793 | ||
790 | newpi12: |
794 | newpi12: |
791 | 795 | ||
792 | push edi |
796 | push edi |
793 | push ecx |
797 | push ecx |
794 | push ebx |
798 | push ebx |
795 | 799 | ||
796 | mov edx,edi |
800 | mov edx,edi |
797 | sub edx,[LFBAddress] |
801 | sub edx,[LFBAddress] |
798 | mov ebx,3 |
802 | mov ebx,3 |
799 | div ebx |
803 | div ebx |
800 | add edx,WinMapAddress |
804 | add edx,WinMapAddress |
801 | mov ebx,[CURRENT_TASK] |
805 | mov ebx,[CURRENT_TASK] |
802 | mov bh,[esp+4*3] |
806 | mov bh,[esp+4*3] |
803 | 807 | ||
804 | np2412: |
808 | np2412: |
805 | 809 | ||
806 | cmp bl,[edx] |
810 | cmp bl,[edx] |
807 | jnz imp24no12 |
811 | jnz imp24no12 |
808 | ; mov eax,[esi] |
812 | ; mov eax,[esi] |
809 | push dword [esp+4*3+20] |
813 | push dword [esp+4*3+20] |
810 | call ebp |
814 | call ebp |
811 | ; cmp bh,0 |
815 | ; cmp bh,0 |
812 | ; jz imp24yes12 |
816 | ; jz imp24yes12 |
813 | ; call dbcplimit |
817 | ; call dbcplimit |
814 | ; jnz imp24no12 |
818 | ; jnz imp24no12 |
815 | 819 | ||
816 | imp24yes12: |
820 | imp24yes12: |
817 | 821 | ||
818 | push edi |
822 | push edi |
819 | push eax |
823 | push eax |
820 | mov eax,edi |
824 | mov eax,edi |
821 | sub eax,[LFBAddress] |
825 | sub eax,[LFBAddress] |
822 | shr eax,16 |
826 | shr eax,16 |
823 | call set_bank |
827 | call set_bank |
824 | pop eax |
828 | pop eax |
825 | and edi,0xffff |
829 | and edi,0xffff |
826 | add edi,VGABasePtr |
830 | add edi,VGABasePtr |
827 | mov [edi],ax |
831 | mov [edi],ax |
828 | shr eax,16 |
832 | shr eax,16 |
829 | mov [edi+2],al |
833 | mov [edi+2],al |
830 | pop edi |
834 | pop edi |
831 | 835 | ||
832 | imp24no12: |
836 | imp24no12: |
833 | 837 | ||
834 | inc edx |
838 | inc edx |
835 | ; add esi,3 |
839 | ; add esi,3 |
836 | add edi,3 |
840 | add edi,3 |
837 | dec ecx |
841 | dec ecx |
838 | jnz np2412 |
842 | jnz np2412 |
839 | 843 | ||
840 | np24d12: |
844 | np24d12: |
841 | 845 | ||
842 | pop ebx |
846 | pop ebx |
843 | pop ecx |
847 | pop ecx |
844 | pop edi |
848 | pop edi |
845 | 849 | ||
846 | add edi,[BytesPerScanLine] |
850 | add edi,[BytesPerScanLine] |
847 | add esi,[esp+32] |
851 | add esi,[esp+32] |
848 | dec ebx |
852 | dec ebx |
849 | jnz newpi12 |
853 | jnz newpi12 |
850 | 854 | ||
851 | nonewpi12: |
855 | nonewpi12: |
852 | 856 | ||
853 | pop eax edx ecx ebx eax edi esi |
857 | pop eax edx ecx ebx eax edi esi |
854 | xor eax, eax |
858 | xor eax, eax |
855 | ret |
859 | ret |
856 | 860 | ||
857 | 861 | ||
858 | pi32bit12: |
862 | pi32bit12: |
859 | 863 | ||
860 | newpi3212: |
864 | newpi3212: |
861 | 865 | ||
862 | push edi |
866 | push edi |
863 | push ecx |
867 | push ecx |
864 | push ebx |
868 | push ebx |
865 | 869 | ||
866 | mov edx,edi |
870 | mov edx,edi |
867 | sub edx,[LFBAddress] |
871 | sub edx,[LFBAddress] |
868 | shr edx,2 |
872 | shr edx,2 |
869 | add edx,WinMapAddress |
873 | add edx,WinMapAddress |
870 | mov ebx,[CURRENT_TASK] |
874 | mov ebx,[CURRENT_TASK] |
871 | mov bh,[esp+4*3] |
875 | mov bh,[esp+4*3] |
872 | 876 | ||
873 | np3212: |
877 | np3212: |
874 | 878 | ||
875 | cmp bl,[edx] |
879 | cmp bl,[edx] |
876 | jnz imp32no12 |
880 | jnz imp32no12 |
877 | ; mov eax,[esi] |
881 | ; mov eax,[esi] |
878 | push dword [esp+4*3+20] |
882 | push dword [esp+4*3+20] |
879 | call ebp |
883 | call ebp |
880 | ; cmp bh,0 |
884 | ; cmp bh,0 |
881 | ; jz imp32yes12 |
885 | ; jz imp32yes12 |
882 | ; call dbcplimit |
886 | ; call dbcplimit |
883 | ; jnz imp32no12 |
887 | ; jnz imp32no12 |
884 | 888 | ||
885 | imp32yes12: |
889 | imp32yes12: |
886 | 890 | ||
887 | push edi |
891 | push edi |
888 | push eax |
892 | push eax |
889 | mov eax,edi |
893 | mov eax,edi |
890 | sub eax,[LFBAddress] |
894 | sub eax,[LFBAddress] |
891 | shr eax,16 |
895 | shr eax,16 |
892 | call set_bank |
896 | call set_bank |
893 | pop eax |
897 | pop eax |
894 | and edi,0xffff |
898 | and edi,0xffff |
895 | mov [edi+VGABasePtr],eax |
899 | mov [edi+VGABasePtr],eax |
896 | pop edi |
900 | pop edi |
897 | 901 | ||
898 | imp32no12: |
902 | imp32no12: |
899 | 903 | ||
900 | inc edx |
904 | inc edx |
901 | ; add esi,3 |
905 | ; add esi,3 |
902 | add edi,4 |
906 | add edi,4 |
903 | dec ecx |
907 | dec ecx |
904 | jnz np3212 |
908 | jnz np3212 |
905 | 909 | ||
906 | np32d12: |
910 | np32d12: |
907 | 911 | ||
908 | pop ebx |
912 | pop ebx |
909 | pop ecx |
913 | pop ecx |
910 | pop edi |
914 | pop edi |
911 | 915 | ||
912 | add edi,[BytesPerScanLine] |
916 | add edi,[BytesPerScanLine] |
913 | dec ebx |
917 | dec ebx |
914 | jnz newpi3212 |
918 | jnz newpi3212 |
915 | 919 | ||
916 | nonewpi3212: |
920 | nonewpi3212: |
917 | 921 | ||
918 | pop eax edx ecx ebx eax edi esi |
922 | pop eax edx ecx ebx eax edi esi |
919 | xor eax, eax |
923 | xor eax, eax |
920 | ret |
924 | ret |
921 | 925 | ||
922 | 926 | ||
923 | vesa12_read_screen_pixel: |
927 | vesa12_read_screen_pixel: |
924 | 928 | ||
925 | and eax,0x3FFFFF |
929 | and eax,0x3FFFFF |
926 | cmp [ScreenBPP],byte 24 ; 24 or 32 bpp ? |
930 | cmp [ScreenBPP],byte 24 ; 24 or 32 bpp ? |
927 | jz v12rsp24 |
931 | jz v12rsp24 |
928 | mov edi,eax |
932 | mov edi,eax |
929 | shl edi,2 |
933 | shl edi,2 |
930 | mov eax,edi |
934 | mov eax,edi |
931 | shr eax,16 |
935 | shr eax,16 |
932 | call set_bank |
936 | call set_bank |
933 | and edi,65535 |
937 | and edi,65535 |
934 | add edi,VGABasePtr |
938 | add edi,VGABasePtr |
935 | mov eax,[edi] |
939 | mov eax,[edi] |
936 | and eax,0x00ffffff |
940 | and eax,0x00ffffff |
937 | ret |
941 | ret |
938 | v12rsp24: |
942 | v12rsp24: |
939 | 943 | ||
940 | imul eax,3 |
944 | imul eax,3 |
941 | mov edi,eax |
945 | mov edi,eax |
942 | shr eax,16 |
946 | shr eax,16 |
943 | call set_bank |
947 | call set_bank |
944 | and edi,65535 |
948 | and edi,65535 |
945 | add edi,VGABasePtr |
949 | add edi,VGABasePtr |
946 | mov eax,[edi] |
950 | mov eax,[edi] |
947 | and eax,0x00ffffff |
951 | and eax,0x00ffffff |
948 | ret |
952 | ret |