Rev 5130 | Rev 5350 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5130 | Rev 5154 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; |
2 | ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. |
3 | ;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. |
4 | ;; PROGRAMMING: |
4 | ;; PROGRAMMING: |
5 | ;; Ivan Poddubny |
5 | ;; Ivan Poddubny |
6 | ;; Marat Zakiyanov (Mario79) |
6 | ;; Marat Zakiyanov (Mario79) |
7 | ;; VaStaNi |
7 | ;; VaStaNi |
8 | ;; Trans |
8 | ;; Trans |
Line 69... | Line 69... | ||
69 | format binary as "mnt" |
69 | format binary as "mnt" |
Line 70... | Line 70... | ||
70 | 70 | ||
71 | include 'macros.inc' |
71 | include 'macros.inc' |
Line 72... | Line 72... | ||
72 | include 'struct.inc' |
72 | include 'struct.inc' |
Line 73... | Line 73... | ||
73 | 73 | ||
74 | $Revision: 5130 $ |
74 | $Revision: 5154 $ |
Line 432... | Line 432... | ||
432 | mov [apm_vf], eax |
432 | mov [apm_vf], eax |
433 | ; ----------------------------------------- |
433 | ; ----------------------------------------- |
434 | mov al, [BOOT_VARS+BOOT_DMA] ; DMA access |
434 | mov al, [BOOT_VARS+BOOT_DMA] ; DMA access |
435 | mov [allow_dma_access], al |
435 | mov [allow_dma_access], al |
436 | movzx eax, byte [BOOT_VARS+BOOT_BPP] ; bpp |
436 | movzx eax, byte [BOOT_VARS+BOOT_BPP] ; bpp |
437 | mov [_display.bpp], eax |
437 | mov [_display.bits_per_pixel], eax |
438 | mov [_display.vrefresh], 60 |
438 | mov [_display.vrefresh], 60 |
439 | mov al, [BOOT_VARS+BOOT_DEBUG_PRINT] ; If nonzero, duplicates debug output to the screen |
439 | mov al, [BOOT_VARS+BOOT_DEBUG_PRINT] ; If nonzero, duplicates debug output to the screen |
440 | mov [debug_direct_print], al |
440 | mov [debug_direct_print], al |
441 | mov al, [BOOT_VARS+BOOT_LAUNCHER_START] ; Start the first app (LAUNCHER) after kernel is loaded? |
441 | mov al, [BOOT_VARS+BOOT_LAUNCHER_START] ; Start the first app (LAUNCHER) after kernel is loaded? |
442 | mov [launcher_start], al |
442 | mov [launcher_start], al |
Line 478... | Line 478... | ||
478 | movzx ecx, byte [esi-1] |
478 | movzx ecx, byte [esi-1] |
479 | mov [NumBiosDisks], ecx |
479 | mov [NumBiosDisks], ecx |
480 | mov edi, BiosDisksData |
480 | mov edi, BiosDisksData |
481 | rep movsd |
481 | rep movsd |
Line 482... | Line 482... | ||
482 | 482 | ||
Line 483... | Line 483... | ||
483 | ; GRAPHICS ADDRESSES |
483 | setvideomode: |
484 | 484 | ||
Line 485... | Line 485... | ||
485 | mov eax, [BOOT_VARS+BOOT_LFB] |
485 | mov eax, [BOOT_VARS+BOOT_LFB] |
486 | mov [LFBAddress], eax |
486 | mov [LFBAddress], eax |
487 | 487 | ||
- | 488 | cmp word [SCR_MODE], 0x0012 ; VGA (640x480 16 colors) |
|
- | 489 | je .vga |
|
- | 490 | cmp word [SCR_MODE], 0x0013 ; MCGA (320*200 256 colors) |
|
- | 491 | je .32bpp |
|
488 | cmp [SCR_MODE], word 0100000000000000b |
492 | cmp byte [_display.bits_per_pixel], 32 |
- | 493 | je .32bpp |
|
- | 494 | cmp byte [_display.bits_per_pixel], 24 |
|
- | 495 | je .24bpp |
|
- | 496 | cmp byte [_display.bits_per_pixel], 16 |
|
- | 497 | je .16bpp |
|
- | 498 | ; cmp byte [_display.bits_per_pixel], 15 |
|
- | 499 | ; je .15bpp |
|
- | 500 | ||
- | 501 | .vga: |
|
489 | jge setvesa20 |
502 | mov [PUTPIXEL], VGA_putpixel |
490 | cmp [SCR_MODE], word 0x13 ; EGA 320*200 256 colors |
503 | mov [GETPIXEL], Vesa20_getpixel32 ; Conversion buffer is 32 bpp |
491 | je v20ga32 |
504 | mov [_display.bytes_per_pixel], 4 ; Conversion buffer is 32 bpp |
492 | jmp v20ga24 |
505 | jmp .finish |
493 | 506 | ||
494 | setvesa20: |
507 | ; .15bpp: |
495 | mov [PUTPIXEL], dword Vesa20_putpixel24 ; Vesa 2.0 |
508 | ; mov [PUTPIXEL], Vesa20_putpixel15 |
- | 509 | ; mov [GETPIXEL], Vesa20_getpixel15 |
|
496 | mov [GETPIXEL], dword Vesa20_getpixel24 |
510 | ; mov [_display.bytes_per_pixel], 2 |
497 | cmp byte [_display.bpp], 24 |
511 | ; jmp .finish |
498 | jz v20ga24 |
512 | |
- | 513 | .16bpp: |
|
499 | v20ga32: |
514 | mov [PUTPIXEL], Vesa20_putpixel16 |
- | 515 | mov [GETPIXEL], Vesa20_getpixel16 |
|
500 | mov [PUTPIXEL], dword Vesa20_putpixel32 |
516 | mov [_display.bytes_per_pixel], 2 |
- | 517 | jmp .finish |
|
501 | mov [GETPIXEL], dword Vesa20_getpixel32 |
518 | |
- | 519 | .24bpp: |
|
502 | jmp no_mode_0x12 |
520 | mov [PUTPIXEL], Vesa20_putpixel24 |
- | 521 | mov [GETPIXEL], Vesa20_getpixel24 |
|
- | 522 | mov [_display.bytes_per_pixel], 3 |
|
503 | v20ga24: |
523 | jmp .finish |
504 | cmp [SCR_MODE], word 0x12 ; 16 C VGA 640x480 |
524 | |
- | 525 | .32bpp: |
|
505 | jne no_mode_0x12 |
526 | mov [PUTPIXEL], Vesa20_putpixel32 |
Line -... | Line 527... | ||
- | 527 | mov [GETPIXEL], Vesa20_getpixel32 |
|
506 | mov [PUTPIXEL], dword VGA_putpixel |
528 | mov [_display.bytes_per_pixel], 4 |
507 | mov [GETPIXEL], dword Vesa20_getpixel32 |
529 | ; jmp .finish |
508 | no_mode_0x12: |
530 | |
Line 509... | Line 531... | ||
509 | 531 | .finish: |
|
510 | mov [MOUSE_PICTURE], dword mousepointer |
532 | mov [MOUSE_PICTURE], mousepointer |
Line 4995... | Line 5017... | ||
4995 | mov ax, word [Screen_Max_Y] |
5017 | mov ax, word [Screen_Max_Y] |
4996 | add eax, 0x00010001 |
5018 | add eax, 0x00010001 |
4997 | mov [esp+32], eax |
5019 | mov [esp+32], eax |
4998 | ret |
5020 | ret |
4999 | .2: ; bits per pixel |
5021 | .2: ; bits per pixel |
5000 | mov eax, [_display.bpp] |
5022 | mov eax, [_display.bits_per_pixel] |
5001 | mov [esp+32], eax |
5023 | mov [esp+32], eax |
5002 | ret |
5024 | ret |
5003 | .3: ; bytes per scanline |
5025 | .3: ; bytes per scanline |
5004 | mov eax, [_display.pitch] |
5026 | mov eax, [_display.pitch] |
5005 | mov [esp+32], eax |
5027 | mov [esp+32], eax |