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