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