Subversion Repositories Kolibri OS

Rev

Rev 3795 | Rev 5154 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2288 clevermous 1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                              ;;
2455 mario79 3
;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
2288 clevermous 4
;; Distributed under terms of the GNU General Public License    ;;
5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7
 
8
$Revision: 3999 $
9
 
10
struc VBE_VGAInfo {
11
  .VESASignature          dd ?    ; char
12
  .VESAVersion            dw ?    ; short
13
  .OemStringPtr           dd ?    ; char *
14
  .Capabilities           dd ?    ; ulong
15
  .VideoModePtr           dd ?    ; ulong
16
  .TotalMemory            dw ?    ; short
17
  ; VBE 2.0+
18
  .OemSoftwareRev         db ?    ; short
19
  .OemVendorNamePtr       dw ?    ; char *
20
  .OemProductNamePtr      dw ?    ; char *
21
  .OemProductRevPtr       dw ?    ; char *
22
  .reserved               rb 222  ; char
23
  .OemData                rb 256  ; char
24
}
25
 
26
struc VBE_ModeInfo {
27
  .ModeAttributes         dw ?    ; short
28
  .WinAAttributes         db ?    ; char
29
  .WinBAttributes         db ?    ; char
30
  .WinGranularity         dw ?    ; short
31
  .WinSize                dw ?    ; short
32
  .WinASegment            dw ?    ; ushort
33
  .WinBSegment            dw ?    ; ushort
34
  .WinFuncPtr             dd ?    ; void *
35
  .BytesPerScanLine       dw ?    ; short
36
  .XRes                   dw ?    ; short
37
  .YRes                   dw ?    ; short
38
  .XCharSize              db ?    ; char
39
  .YCharSize              db ?    ; char
40
  .NumberOfPlanes         db ?    ; char
41
  .BitsPerPixel           db ?    ; char
42
  .NumberOfBanks          db ?    ; char
43
  .MemoryModel            db ?    ; char
44
  .BankSize               db ?    ; char
45
  .NumberOfImagePages     db ?    ; char
46
  .res1                   db ?    ; char
47
  .RedMaskSize            db ?    ; char
48
  .RedFieldPosition       db ?    ; char
49
  .GreenMaskSize          db ?    ; char
50
  .GreenFieldPosition     db ?    ; char
51
  .BlueMaskSize           db ?    ; char
52
  .BlueFieldPosition      db ?    ; char
53
  .RsvedMaskSize          db ?    ; char
54
  .RsvedFieldPosition     db ?    ; char
55
  .DirectColorModeInfo    db ?    ; char ; MISSED IN THIS TUTORIAL!! SEE ABOVE
56
  ; VBE 2.0+
57
  .PhysBasePtr            dd ?    ; ulong
58
  .OffScreenMemOffset     dd ?    ; ulong
59
  .OffScreenMemSize       dw ?    ; short
60
  ; VBE 3.0+
61
  .LinbytesPerScanLine    dw ?    ; short
62
  .BankNumberOfImagePages db ?    ; char
63
  .LinNumberOfImagePages  db ?    ; char
64
  .LinRedMaskSize         db ?    ; char
65
  .LinRedFieldPosition    db ?    ; char
66
  .LingreenMaskSize       db ?    ; char
67
  .LinGreenFieldPosition  db ?    ; char
68
  .LinBlueMaskSize        db ?    ; char
69
  .LinBlueFieldPosition   db ?    ; char
70
  .LinRsvdMaskSize        db ?    ; char
71
  .LinRsvdFieldPosition   db ?    ; char
72
  .MaxPixelClock          dd ?    ; ulong
73
  .res2                   rb 190  ; char
74
}
75
 
76
virtual at $A000
77
  vi VBE_VGAInfo
78
  mi VBE_ModeInfo
79
modes_table:
80
end virtual
3539 clevermous 81
cursor_pos  dw 0         ;временное хранение курсора.
3999 mario79 82
cursor_pos_old  dw 0
2288 clevermous 83
home_cursor dw 0    ;current shows rows a table
84
end_cursor  dw 0     ;end of position current shows rows a table
85
scroll_start dw 0    ;start position of scroll bar
86
scroll_end  dw 0     ;end position of scroll bar
87
long_v_table equ 9   ;long of visible video table
88
size_of_step equ 10
89
scroll_area_size equ (long_v_table-2)
90
int2str:
91
        dec     bl
92
        jz      @f
93
        xor     edx, edx
94
        div     ecx
95
        push    edx
96
        call    int2str
97
        pop     eax
98
    @@:
99
        or      al, 0x30
100
        mov     [ds:di], al
101
        inc     di
102
        ret
103
 
104
int2strnz:
105
        cmp     eax, ecx
106
        jb      @f
107
        xor     edx, edx
108
        div     ecx
109
        push    edx
110
        call    int2strnz
111
        pop     eax
112
    @@:
113
        or      al, 0x30
114
        mov     [es:di], al
115
        inc     di
116
        ret
117
 
118
;-------------------------------------------------------
119
;Write message about incorrect v_mode and write message about jmp on swith v_mode
120
v_mode_error:
121
        _setcursor 19,2
122
        mov     si, fatalsel
123
        call    printplain
124
        _setcursor 20,2
125
        mov     si, pres_key
126
        call    printplain
127
        xor     eax, eax
128
        int     16h
129
        jmp     cfgmanager.d
130
;-------------------------------------------------------
131
;
132
 
133
 
134
 
135
;-------------------------------------------------------
136
print_vesa_info:
137
        _setcursor 5,2
138
 
139
        mov     [es:vi.VESASignature], 'VBE2'
140
        mov     ax, 0x4F00
141
        mov     di, vi     ;0xa000
142
        int     0x10
143
        or      ah, ah
144
        jz      @f
145
        mov     [es:vi.VESASignature], 'VESA'
146
        mov     ax, $4F00
147
        mov     di, vi
148
        int     0x10
149
        or      ah, ah
150
        jnz     .exit
151
  @@:
152
        cmp     [es:vi.VESASignature], 'VESA'
153
        jne     .exit
154
        cmp     [es:vi.VESAVersion], 0x0100
155
        jb      .exit
156
        jmp     .vesaok2
157
 
158
  .exit:
159
        mov     si, novesa
160
        call    printplain
161
        ret
162
 
163
  .vesaok2:
164
        mov     ax, [es:vi.VESAVersion]
165
        add     ax, '00'
166
 
167
        mov     [s_vesa.ver], ah
168
        mov     [s_vesa.ver+2], al
169
        mov     si, s_vesa
170
        call    printplain
171
 
172
        _setcursor 4,2
173
        mov     si, word[es:vi.OemStringPtr]
174
        mov     di, si
175
 
176
        push    ds
177
        mov     ds, word[es:vi.OemStringPtr+2]
178
        call    printplain
179
        pop     ds
180
 
181
        ret
182
;-----------------------------------------------------------------------------
183
 
184
calc_vmodes_table:
185
        pushad
186
 
187
;        push    0
188
;        pop     es
189
 
190
        lfs     si, [es:vi.VideoModePtr]
191
 
192
        mov     bx, modes_table
3539 clevermous 193
;save no vesa mode of work 320x200, EGA/CGA 256 梥⮢ and 640x480, VGA 16 梥⮢
2288 clevermous 194
        mov     word [es:bx], 640
195
        mov     word [es:bx+2], 480
196
        mov     word [es:bx+6], 0x13
197
 
198
        mov     word [es:bx+10], 640
199
        mov     word [es:bx+12], 480
200
        mov     word [es:bx+16], 0x12
201
        add     bx, 20
202
  .next_mode:
203
        mov     cx, word [fs:si]; mode number
204
        cmp     cx, -1
205
        je      .modes_ok.2
206
 
207
        mov     ax, 0x4F01
208
        mov     di, mi
209
        int     0x10
210
 
211
        or      ah, ah
212
        jnz     .modes_ok.2;vesa_info.exit
213
 
214
        test    [es:mi.ModeAttributes], 00000001b  ;videomode support ?
215
        jz      @f
216
        test    [es:mi.ModeAttributes], 00010000b  ;picture ?
217
        jz      @f
218
        test    [es:mi.ModeAttributes], 10000000b  ;LFB ?
219
        jz      @f
220
 
3591 Serge 221
        cmp     [es:mi.BitsPerPixel], 24   ;It show only videomodes to have support 24 and 32 bpp
2288 clevermous 222
        jb      @f
223
 
224
;        cmp     [es:mi.BitsPerPixel],16
225
;        jne     .l0
226
;        cmp     [es:mi.GreenMaskSize],5
227
;        jne     .l0
228
;        mov     [es:mi.BitsPerPixel],15
229
 
230
 
231
.l0:
232
        cmp     [es:mi.XRes], 640
233
        jb      @f
234
        cmp     [es:mi.YRes], 480
235
        jb      @f
236
;        cmp     [es:mi.BitsPerPixel],8
237
;        jb      @f
238
 
239
        mov     ax, [es:mi.XRes]
240
        mov     [es:bx+0], ax              ; +0[2] : resolution X
241
        mov     ax, [es:mi.YRes]
242
        mov     [es:bx+2], ax              ; +2[2] : resolution Y
243
        mov     ax, [es:mi.ModeAttributes]
244
        mov     [es:bx+4], ax              ; +4[2] : attributes
245
 
246
        cmp     [s_vesa.ver], '2'
2407 mario79 247
;        jb      .lp1
248
        jb      @f    ; We do not use Vesa 1.2 mode is now
2288 clevermous 249
 
250
        or      cx, 0x4000 ; use LFB
251
.lp1:
252
        mov     [es:bx+6], cx              ; +6 : mode number
253
        movzx   ax, byte [es:mi.BitsPerPixel]
254
        mov     word [es:bx+8], ax              ; +8 : bits per pixel
3591 Serge 255
        add     bx, size_of_step                ; size of record
2288 clevermous 256
 
257
    @@:
258
        add     si, 2
259
        jmp     .next_mode
260
 
261
  .modes_ok.2:
262
 
263
        mov     word[es:bx], -1 ;end video table
264
        mov     word[end_cursor], bx    ;save end cursor position
265
;;;;;;;;;;;;;;;;;;
266
;Sort array
267
;        mov     si,modes_table
268
;.new_mode:
269
;        mov     ax,word [es:si]
270
;        cmp     ax,-1
271
;        je      .exxit
272
;        add     ax,word [es:si+2]
273
;        add     ax,word [es:si+8]
274
;        mov     bp,si
275
;.again:
276
;        add     bp,12
277
;        mov     bx,word [es:bp]
278
;        cmp     bx,-1
279
;        je      .exit
280
;        add     bx,word [es:bp+2]
281
;        add     bx,word [es:bp+8]
3591 Serge 282
;
2288 clevermous 283
;        cmp     ax,bx
284
;        ja      .loops
285
;        jmp     .again
3591 Serge 286
;.loops:
2288 clevermous 287
;        push    dword [es:si]
288
;        push    dword [es:si+4]
289
;        push    dword [es:si+8]
290
;        push    dword [es:bp]
291
;        push    dword [es:bp+4]
292
;        push    dword [es:bp+8]
293
;
294
;        pop     dword [es:si+8]
295
;        pop     dword [es:si+4]
296
;        pop     dword [es:si]
297
;        pop     dword [es:bp+8]
298
;        pop     dword [es:bp+4]
299
;        pop     dword [es:bp]
300
;        jmp     .new_mode
301
;
302
;.exit:  add     si,12
303
;        jmp     .new_mode
304
;.exxit:
305
        popad
306
        ret
307
 
308
;-----------------------------------------------------------------------------
309
 
310
draw_current_vmode:
311
        push    0
312
        pop     es
313
 
314
        mov     si, word [cursor_pos]
315
 
316
        cmp     word [es:si+6], 0x12
317
        je      .no_vesa_0x12
318
 
319
        cmp     word [es:si+6], 0x13
320
        je      .no_vesa_0x13
321
 
322
if defined extended_primary_loader
323
        mov     di, config_file_variables
324
else
325
        mov     di, loader_block_error
326
end if
327
        movzx   eax, word[es:si+0]
328
        mov     ecx, 10
329
        call    int2strnz
330
        mov     byte[es:di], 'x'
331
        inc     di
332
        movzx   eax, word[es:si+2]
333
        call    int2strnz
334
        mov     byte[es:di], 'x'
335
        inc     di
336
        movzx   eax, word[es:si+8]
337
        call    int2strnz
338
        mov     dword[es:di], 0x00000d0a
339
if defined extended_primary_loader
340
        mov     si, config_file_variables
341
else
342
        mov     si, loader_block_error
343
end if
344
        push    ds
345
        push    es
346
        pop     ds
347
        call    printplain
348
        pop     ds
349
        ret
350
.no_vesa_0x13:
351
        mov     si, mode0
352
        jmp     .print
353
.no_vesa_0x12:
354
        mov     si, mode9
355
.print:
356
        call    printplain
357
        ret
358
;-----------------------------------------------------------------------------
359
check_first_parm:
360
if defined extended_primary_loader
361
        mov     cx, [number_vm]
362
        jcxz    .novbemode
363
        mov     si, modes_table
364
.findvbemode:
365
        cmp     [es:si+6], cx
366
        jnz     @f
367
        cmp     word [es:si+8], 32
368
        je      .ok_found_mode
369
        cmp     word [es:si+8], 24
370
        je      .ok_found_mode
371
@@:
372
        add     si, size_of_step
373
        cmp     word [es:si], -1
374
        jnz     .findvbemode
375
.novbemode:
376
        mov     ax, [x_save]
377
        test    ax, ax
378
        jz      .zerro
379
        mov     bx, [y_save]
380
        mov     si, modes_table
381
        call    .loops
382
        test    ax, ax
383
        jz      .ok_found_mode
384
else
385
        mov     si, word [preboot_graph]
386
        test    si, si
387
        jnz     .no_zero         ;if no zero
388
end if
389
.zerro:
390
;        mov     ax,modes_table
391
;        mov     word [cursor_pos],ax
392
;        mov     word [home_cursor],ax
393
;        mov     word [preboot_graph],ax
394
;SET default video of mode first probe will fined a move of work 1024x768@32
395
 
396
        mov     ax, 1024
397
        mov     bx, 768
398
        mov     si, modes_table
399
        call    .loops
400
        test    ax, ax
401
        jz      .ok_found_mode
402
        mov     ax, 800
403
        mov     bx, 600
404
        mov     si, modes_table
405
        call    .loops
406
        test    ax, ax
407
        jz      .ok_found_mode
408
        mov     ax, 640
409
        mov     bx, 480
410
        mov     si, modes_table
411
        call    .loops
412
        test    ax, ax
413
        jz      .ok_found_mode
414
 
415
        mov     si, modes_table
416
if ~ defined extended_primary_loader
417
        jmp     .ok_found_mode
418
 
419
 
420
 
421
.no_zero:
422
        mov     bp, word [number_vm]
423
        cmp     bp, word [es:si+6]
424
        jz      .ok_found_mode
425
        mov     ax, word [x_save]
426
        mov     bx, word [y_save]
427
        mov     si, modes_table
428
        call    .loops
429
        test    ax, ax
430
        jz      .ok_found_mode
431
 
432
        mov     si, modes_table
433
;        cmp     ax,modes_table
434
;        jb      .zerro           ;check on correct if bellow
435
;        cmp     ax,word [end_cursor]
436
;        ja      .zerro           ;check on correct if anymore
437
end if
438
 
439
.ok_found_mode:
440
        mov     word [home_cursor], si
441
;        mov     word [cursor_pos],si
442
        mov     word [preboot_graph], si
443
        mov     ax, si
444
 
445
        mov     ecx, long_v_table
446
 
447
.loop:
448
        add     ax, size_of_step
449
        cmp     ax, word [end_cursor]
450
        jae     .next_step
451
        loop    .loop
452
.next_step:
453
        sub     ax, size_of_step*long_v_table
454
        cmp     ax, modes_table
455
        jae     @f
456
        mov     ax, modes_table
457
@@:
458
 
459
        mov     word [home_cursor], ax
460
        mov     si, [preboot_graph]
461
        mov     word [cursor_pos], si
462
 
463
        push    word [es:si]
464
        pop     word [x_save]
465
        push    word [es:si+2]
466
        pop     word [y_save]
467
        push    word [es:si+6]
468
        pop     word [number_vm]
469
 
470
        ret
471
;;;;;;;;;;;;;;;;;;;;;;;;;;;
472
.loops:
473
        cmp     ax, word [es:si]
474
        jne     .next
475
        cmp     bx, word [es:si+2]
476
        jne     .next
477
        cmp     word [es:si+8], 32
478
        je      .ok
479
        cmp     word [es:si+8], 24
480
        je      .ok
481
.next:
482
        add     si, size_of_step
483
        cmp     word [es:si], -1
484
        je      .exit
485
        jmp     .loops
486
.ok:
487
        xor     ax, ax
488
        ret
489
.exit:
490
        or      ax, -1
491
        ret
492
 
493
 
494
;-----------------------------------------------------------------------------
495
 
496
;default_vmode:
3591 Serge 497
 
2288 clevermous 498
;-----------------------------------------------------------------------------
499
draw_vmodes_table:
500
        _setcursor 9, 2
501
        mov     si, gr_mode
502
        call    printplain
503
 
504
        mov     si, _st
505
        call    printplain
506
 
507
        push    word [cursor_pos]
508
        pop     ax
509
        push    word [home_cursor]
510
        pop     si
511
        mov     cx, si
512
 
513
        cmp     ax, si
514
        je      .ok
515
        jb      .low
516
 
517
 
518
        add     cx, size_of_step*long_v_table
3591 Serge 519
 
2288 clevermous 520
        cmp     ax, cx
521
        jb      .ok
3591 Serge 522
 
2288 clevermous 523
        sub     cx, size_of_step*long_v_table
524
        add     cx, size_of_step
525
        cmp     cx, word[end_cursor]
526
        jae     .ok
527
        add     si, size_of_step
528
        push    si
529
        pop     word [home_cursor]
530
        jmp     .ok
531
 
532
 
533
.low:
534
        sub     cx, size_of_step
535
        cmp     cx, modes_table
536
        jb      .ok
537
        push    cx
538
        push    cx
539
        pop     word [home_cursor]
540
        pop     si
541
 
542
 
543
.ok:
544
; calculate scroll position
545
        push    si
546
        mov     ax, [end_cursor]
547
        sub     ax, modes_table
548
        mov     bx, size_of_step
549
        cwd
550
        div     bx
551
        mov     si, ax          ; si = size of list
552
        mov     ax, [home_cursor]
553
        sub     ax, modes_table
554
        cwd
555
        div     bx
556
        mov     di, ax
557
        mov     ax, scroll_area_size*long_v_table
558
        cwd
559
        div     si
560
        test    ax, ax
561
        jnz     @f
562
        inc     ax
563
@@:
564
        cmp     al, scroll_area_size
565
        jb      @f
566
        mov     al, scroll_area_size
567
@@:
568
        mov     cx, ax
569
; cx = scroll height
570
; calculate scroll pos
571
        xor     bx, bx          ; initialize scroll pos
572
        sub     al, scroll_area_size+1
573
        neg     al
574
        sub     si, long_v_table-1
575
        jbe     @f
576
        mul     di
577
        div     si
578
        mov     bx, ax
579
@@:
580
        inc     bx
581
        imul    ax, bx, size_of_step
582
        add     ax, [home_cursor]
583
        mov     [scroll_start], ax
584
        imul    cx, size_of_step
585
        add     ax, cx
586
        mov     [scroll_end], ax
587
        pop     si
588
        mov     bp, long_v_table              ;show rows
589
.@@_next_bit:
590
;clear cursor
591
        mov     ax, '  '
592
        mov     word[ds:_r1+21], ax
593
        mov     word[ds:_r1+50], ax
594
 
595
        mov     word[ds:_r2+21], ax
596
        mov     word[ds:_r2+45], ax
597
 
598
        mov     word[ds:_rs+21], ax
599
        mov     word[ds:_rs+46], ax
600
; draw string
601
        cmp     word [es:si+6], 0x12
602
        je      .show_0x12
603
        cmp     word [es:si+6], 0x13
604
        je      .show_0x13
605
 
606
        movzx   eax, word[es:si]
607
        cmp     ax, -1
608
        je      .@@_end
609
        mov     di, _rs+23
610
        mov     ecx, 10
611
        mov     bl, 4
612
        call    int2str
613
        movzx   eax, word[es:si+2]
614
        inc     di
615
        mov     bl, 4
616
        call    int2str
617
 
618
        movzx   eax, word[es:si+8]
619
        inc     di
620
        mov     bl, 2
621
        call    int2str
622
 
623
        cmp     si, word [cursor_pos]
624
        jne     .next
625
;draw   cursor
626
        mov     word[ds:_rs+21], '>>'
627
        mov     word[ds:_rs+46], '<<'
628
 
629
 
3591 Serge 630
 
2288 clevermous 631
.next:
632
        push    si
633
        mov     si, _rs
634
.@@_sh:
635
; add to the string pseudographics for scrollbar
636
        pop     bx
637
        push    bx
638
        mov     byte [si+53], ' '
639
        cmp     bx, [scroll_start]
640
        jb      @f
641
        cmp     bx, [scroll_end]
642
        jae     @f
643
        mov     byte [si+53], 0xDB ; filled bar
644
@@:
645
        push    bx
646
        add     bx, size_of_step
647
        cmp     bx, [end_cursor]
648
        jnz     @f
649
        mov     byte [si+53], 31 ; 'down arrow' symbol
650
@@:
651
        sub     bx, [home_cursor]
652
        cmp     bx, size_of_step*long_v_table
653
        jnz     @f
654
        mov     byte [si+53], 31 ; 'down arrow' symbol
655
@@:
656
        pop     bx
657
        cmp     bx, [home_cursor]
658
        jnz     @f
659
        mov     byte [si+53], 30 ; 'up arrow' symbol
660
@@:
661
        call    printplain
662
        pop     si
663
        add     si, size_of_step
664
 
665
        dec     bp
666
        jnz     .@@_next_bit
667
 
668
.@@_end:
669
        mov     si, _bt
670
        call    printplain
671
        ret
672
.show_0x13:
673
        push    si
674
 
675
        cmp     si, word [cursor_pos]
676
        jne     @f
677
        mov     word[ds:_r1+21], '>>'
678
        mov     word[ds:_r1+50], '<<'
679
@@:
680
        mov     si, _r1
681
        jmp     .@@_sh
682
.show_0x12:
683
        push    si
684
        cmp     si, word [cursor_pos]
685
        jne     @f
686
 
687
        mov     word[ds:_r2+21], '>>'
688
        mov     word[ds:_r2+45], '<<'
689
@@:
690
        mov     si, _r2
691
        jmp     .@@_sh
692
 
693
;-----------------------------------------------------------------------------
694
;Clear arrea of current video page (0xb800)
695
clear_vmodes_table:
696
        pusha
697
       ; draw frames
698
        push    es
699
        push    0xb800
700
        pop     es
701
        mov     di, 1444
702
        xor     ax, ax
703
        mov     ah, 1*16+15
3795 mario79 704
        mov     cx, 77
2288 clevermous 705
        mov     bp, 12
706
.loop_start:
707
        rep stosw
3795 mario79 708
        mov     cx, 77
709
        add     di, 6
2288 clevermous 710
        dec     bp
711
        jns     .loop_start
712
        pop     es
713
        popa
714
        ret
715
 
716
;-----------------------------------------------------------------------------
717
 
718
set_vmode:
719
        push    0 ;0;x1000
720
        pop     es
721
 
722
        mov     si, word [preboot_graph]           ;[preboot_graph]
723
        mov     cx, word [es:si+6]           ; number of mode
724
 
725
 
726
        mov     ax, word [es:si+0]           ; resolution X
727
        mov     bx, word [es:si+2]           ; resolution Y
728
 
729
 
2466 Serge 730
        mov     word [es:BOOT_X_RES], ax             ; resolution X
731
        mov     word [es:BOOT_Y_RES], bx             ; resolution Y
732
        mov     word [es:BOOT_VESA_MODE], cx             ; number of mode
2288 clevermous 733
 
734
        cmp     cx, 0x12
735
        je      .mode0x12_0x13
736
        cmp     cx, 0x13
737
        je      .mode0x12_0x13
738
 
739
 
2407 mario79 740
;        cmp     byte [s_vesa.ver], '2'
741
;        jb      .vesa12
2288 clevermous 742
 
743
;  VESA 2 and Vesa 3
744
 
745
        mov     ax, 0x4f01
746
        and     cx, 0xfff
747
        mov     di, mi;0xa000
748
        int     0x10
749
        ; LFB
750
        mov     eax, [es:mi.PhysBasePtr];di+0x28]
2466 Serge 751
        mov     [es:BOOT_LFB], eax
2288 clevermous 752
        ; ---- vbe voodoo
753
        BytesPerLine equ 0x10
754
        mov     ax, [es:di+BytesPerLine]
2466 Serge 755
        mov     [es:BOOT_PITCH], ax
2288 clevermous 756
        ; BPP
757
        cmp     [es:mi.BitsPerPixel], 16
758
        jne     .l0
759
        cmp     [es:mi.GreenMaskSize], 5
760
        jne     .l0
761
        mov     [es:mi.BitsPerPixel], 15
762
.l0:
763
        mov     al, byte [es:di+0x19]
2466 Serge 764
        mov     [es:BOOT_BPP], al
2288 clevermous 765
        jmp     .exit
766
 
767
.mode0x12_0x13:
2466 Serge 768
        mov     byte [es:BOOT_BPP], 32
769
        or      dword [es:BOOT_LFB], 0xFFFFFFFF; 0x800000
2288 clevermous 770
 
771
 
772
;  VESA 1.2 PM BANK SWITCH ADDRESS
773
 
2407 mario79 774
;.vesa12:
775
;        mov     ax, 0x4f0A
776
;        xor     bx, bx
777
;        int     0x10
778
;        xor     eax, eax
779
;        xor     ebx, ebx
780
;        mov     ax, es
781
;        shl     eax, 4
782
;        mov     bx, di
783
;        add     eax, ebx
784
;        movzx   ebx, word[es:di]
785
;        add     eax, ebx
786
;        push    0x0000
787
;        pop     es
788
;        mov     [es:0x9014], eax
2288 clevermous 789
  .exit:
790
        ret
791
 
792
;=============================================================================
793
;=============================================================================
794
;=============================================================================
795