Subversion Repositories Kolibri OS

Rev

Rev 2 | Rev 102 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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