(c)  騭, ᪢

ZXNet : 500:95/462.53
E-mail: bestview@mtu-net.ru
WWW   : http://www.ivr.da.ru

         ⪫祭 "" ᪨ ०  DOS
         

(".  " 12/2002)
 ᫥ ।஢: 22.01.2003.

    ⨬,  SVGA- ন ᪨
०  訬 ࠧ襭, 祬 ᯮᮡ ⮡ࠧ 
 (ਬ,  "" 1024x768,   -
⮫쪮 640x480).    ,  
ணࠬ, 㦨 㯭 ०  ᮪ ࠧ襭,
   . ਬ,   SEA 
㬮砭 ᪠  ० 800x600.   ᠬ  
஦   뢠  ⮬,  , ⠭
 - ணࠬ ०  ᮪ ࠧ襭.
     祬   ਢ?  襬 砥 
ଠ쭮 ࠦ  ࠭  "".  
ࠦ,       ணࠬ, ਤ
१㦠,  ᠬ  ᥡ 筮 ⭮.  襬
砥 -      . ⮬ 祭
⠪ ᪨ ०, 筮,   .
      ⥫묨 ᪨ ० ந室 
ᯮ짮 㭪権, । ⠭⮬ VESA. 
襭 ⠢    㦭 ⮫쪮  㭪樨.
       ᯨ᮪ ஢
⥫ ०,   㣮 -   
० ଠ   (㯥  , ࠧ襭 
ਧ⠫  ⨪...),      㭪樨 -
 ०  㪠 ஬.
    襬 १ ணࠬ,  㤥 墠뢠
饭  㭪樨 祭 ଠ樨  ⭮ ०.
(   뢠  ணࠬ १⮬,   ணࠬ,
ன   祭 । ᪨
०,   뢠  ணࠬ.)  ணࠬ
  㭪樨 祭 ଠ樨  ⭮ ०,
ࠢ 㤥 । १,  맮
ਣ ࠡ稪 㭪樨,  ⥬ ஢ 祭
ଠ  ०:     ० "", ..
 ࠧ襭  㪠? ᫨ ,  १
⠭  頥   ਧ "०
㯥".  ࠧ, ணࠬ ⠥  ०
㯭   㤥   .
     ᫨ 㤥?  ᫨ ணࠬ    -
஢ப । 祭 ०? , 筮, ࠢ쭮, 
 ᪫ ⠪ 樨 . ⮬ ।ᬮਬ 
१ 墠   㭪樨 - 祭 ०,  ᫨
砥 ० ⭮  "",    祭
㤥  ਧ 訡,  ᫨  ணࠬ ⠫
 騩 ०.
    ⮡ १  ।,   砥 ०
"" (   ⮣  㭪樨 祭 ଠ樨
 ०:   㦥 256- ,   ⥫ 
室   ),    ᪥ 
ଠ   ন ०   
ᯥ樠쭮 ᯨ᪥  "" ०.   쭥襬
 㤥  ஢,    ⮬ ᯨ᪥  .
     ਢ ଠ  ᯮ㥬 㭪 VESA -
⮫쪮 ,  室    ࠡ
뢠 १⭮ ணࠬ. ᫨   
ଠ,    [1]   www.vesa.org.
    饭  㭪 VESA ந   뢠
INT 10h.  ⮬  AH   ᫮ 4Fh,   AL - 
㭪樨. ᫥ 饭  㭪樨  AL   4Fh, 
⠭ VESA  ন.
    㭪 0 - 祭 ଠ樨  ᨨ VESA,
ந⥫,  ᯨ᪥ ०  ..  室  ES:DI 
㪠  256-⭮ , 㤠 㤥 饭
ଠ,   室  ⮬   ᬥ饭 16 
ᯮ   - 㪠⥫  ᯨ᮪ ஢
⥭樠쭮 ন ० (㯭 
०  ஢ ⤥쭮,   㭪樨 1).  ⮬
ᯨ᪥    뤥 ᫮ ( ), 祭
FFFFh 㦨 ਧ  ᯨ᪠. ᪨  ०
 訥 9 ⮢ ᫮, 祬 訩   ⮢
㪠뢠, ਭ   ० ⠭ VESA (᫨ ,
 ࠢ 1).   VESA-० 筮 ।
訬 ⮬ ᫮.
    㭪 1 - 祭 ଠ樨  ०   .
 室  CX   ० ( ᠬ ᫮  ᯨ᪠),
  ES:DI 㪠뢠  256-⭮ , 㤠  㤥
饭 ଠ  ०.  室  ⮬  
ᬥ饭 18 㤥 ᫮,  ࠭ ࠧ襭  ਧ⠫,
  ᬥ饭 20 - ࠧ襭  ⨪. 訩  ࢮ
᫮  । 㯭 ० (0 - 㯥).
    㭪 2 - 祭 ०.  室   9 
ॣ BX 㪠뢠  ०,    ࠧ鸞 -
 䫠,    ᬠਢ  . ᫨
訢 ० ,  室  AX 㤥 1.
     ਢ 室 ⥪ १⭮ ணࠬ 
஡묨 ﬨ. ணࠬ ।祭  樨
 com-䠩 -  , ਬ, "save_mon.com". ।
樥  ⠢  ⥪ ணࠬ 室
祭 ᨬ쭮 ࠧ襭  ਧ⠫  ⨪
(⠭ Max_X_Res  Max_Y_Res).  㬮砭  ࠢ
ᮮ⢥⢥ 640  480.

Max_X_Res  equ     640  ;ᨬ쭮 ࠧ襭  ਧ⠫.
Max_Y_Res  equ     480  ;ᨬ쭮 ࠧ襭  ⨪.

codesg     segment
           assume  cs:codesg
           assume  ds:codesg
           assume  es:codesg

           org     100h

begin:     jmp     init ;室  樠樨.

; ࠡ稪 뢠 10h.

new_10h:   cmp     ax,4f01h   ;஢ઠ  맢 㭪樨.
           jz      new_4f01

           cmp     ax,4f02h
           jz      new_4f02

;맢  墠뢠 㭪 - । ࠢ
;  ࠡ稪:

goto_old:  db      0eah       ; ᥣ⭮ JMP.
old_10h    dd      ?          ; ண ࠡ稪.

;ࠡ⪠ 㭪樨 1 (祭 ᢥ  ०):

new_4f01:  push    ds

           push    cs         ;뢠
           pop     ds         ;
           pushf              ;ࠡ稪.
           call    old_10h

;  ES:DI ନ஢    ଠ樥  ०.
;, ᫨ ਧ⠫쭮 (ES:DI+18)  ⨪쭮 (ES:DI+20)
;ࠧ襭 ०  ᨬ쭮, 뢠 訩  ࢮ
;᫮  , ⥬ ᠬ  ० 㯭.

           push    es
           pop     ds
           cmp     word ptr [di+18],Max_X_Res
           ja      main_2
           cmp     word ptr [di+20],Max_Y_Res
           jbe     main_3
main_2:    and     byte ptr [di],0feh

main_3:    pop     ds
           iret

;ࠡ⪠ 㭪樨 2 (⠭ ०):

new_4f02:  and     bh,1      ;஢ઠ:  VESA-०?
           jz      goto_old  ;᫨  - 室   ࠡ稪.

;஢ઠ:  ० (BL) ᮤন  ᯨ᪥ "" ०?

           push    ds
           push    di
           push    cx

           push    cs
           pop     ds

           mov     di,offset buf_1
           mov     cx,modes

main_8:    cmp     bl,[di]
           je      main_9
           inc     di
           loop    main_8

;    ᯨ᪥ "" (..  ).
;室   ࠡ稪:

           pop     cx
           pop     di
           pop     ds
           jmp     short goto_old

; "" ० -  砥, 室  AX=014Fh (ਧ 訡):

main_9:    pop     cx
           pop     di
           pop     ds
           mov     ax,014fh
           iret

;।     ᠭ   㪠
;浪 -  ᯮ  । ࠧ १⭮ .

modes      dw      ?               ;⢮ "" ०.
buf_1      db      256 dup (?)     ;᮪ "" ०.
buf_2      db      256 dup (?)     ;ᯮ⥫ .

;樠.

init:      mov     ax,4f00h        ;砥 ଠ  ন
           mov     di,offset buf_2 ;० (    稨 VESA).
           int     10h

           cmp     al,4fh
           je      vesa_ok

;VESA  ( AL  4Fh) - 室   ᮮ饭  訡:

           mov     dx,offset err_text_1
           jmp     err_exit

; 祭 ᯨ᪠ ० (ᥣ  ᬥ饭 ண 室
;ᮮ⢥⢥  ᠬ buf_2+16  buf_2+14) 㥬  buf_1 
;०, ⭮  VESA (  8-  ࠢ 1):

vesa_ok:   mov     ax,word ptr buf_2+16
           push    ax
           pop     es
           mov     bx,word ptr buf_2+14

;ES:BX 㪠뢠  ᯨ᮪ ०. 㥬,   ⨬ FFFFh -
;ਧ  ᯨ᪠:

           mov     di,offset buf_1
           xor     cx,cx    ;⢮ VESA-०.

init_3:    mov     ax,es:[bx]
           cmp     ax,0ffffh
           je      init_1

           and     ah,1     ; ⭮  VESA?
           jz      init_2

           mov     [di],al
           inc     di
           inc     cx
           cmp     cx,100h  ; 直 砩, ⮡ buf_1  ९.
           je      init_1

init_2:    add     bx,2
           jmp     short init_3

;᫨ VESA-०  㦥 (CX=0) - 室  
;ᮮ饭  訡:

init_1:    and     cx,cx
           mov     dx,offset err_text_2
           jz      err_exit

           push    cs
           pop     es

;⠢塞  buf_1 ⮫쪮  "" ० -  
;ࠧ襭  㪠:

           mov     di,offset buf_1
           push    di
           pop     si
           xor     bx,bx  ;⢮ "" ०.

init_5:    push    di
           push    si
           push    cx
           push    bx

           mov     ax,4f01h            ;訢
           mov     ch,al     ;ch:=1    ;ଠ
           mov     cl,[di]             ; ०.
           mov     di,offset buf_2
           int     10h

           pop     bx
           pop     cx
           pop     si
           pop     di

           cmp     word ptr [buf_2+18],Max_X_Res
           ja      init_4
           cmp     word ptr [buf_2+20],Max_Y_Res
           jbe     init_6

init_4:    mov     al,[di]
           mov     [si],al
           inc     si
           inc     bx

init_6:    inc     di
           loop    init_5

;᫨  "" ० (BX=0) - 室   ᮮ饭
; 訡:

           and     bx,bx
           mov     dx,offset err_text_3
           jz      err_exit

           mov     modes,bx  ;࠭塞 ⢮ "" ०.

           mov     ax,3510h               ;砥  
           int     21h                    ; ண
           mov     word ptr old_10h,bx    ;ࠡ稪 INT 10h.
           mov     word ptr old_10h+2,es

           mov     dx,offset new_10h      ;⠭
           mov     ax,2510h               ; 
           int     21h                    ;ࠡ稪 INT 10h.

; 室 ⠢塞  १⭮  ஢ ⮫쪮 ⮢
; buf_1, ᪮쪮 ᯮ:

           mov     dx,offset buf_1        ;  
           add     dx,modes               ;१⮬.
           int     27h

; ᮮ饭  訡 (    DX)  室:

err_exit:  mov     ah,9
           int     21h
           ret

err_text_1 db      'VESA BIOS not found!',13,10,'$'
err_text_2 db      'VESA modes not found!',13,10,'$'
err_text_3 db      'Hi-res modes not found!',13,10,'$'

codesg     ends
           end     begin

     १⭮  ணࠬ   ⢠
㦥 "" ०:  ⠪ ० 㢥稢
   .   ணࠬ    352
.
    ᫨  ᯮ ࠩ UniVBE  , 
᪠ ணࠬ ᫥ ᫥ .





1. .ਠ. "VESA: ⠭ , ஡ ".
   " " 7/1998. ( ⠪ 㯭  ᠩ ୠ
     "http://www.osp.ru/pcworld/1998/07/62.htm".)




    㣨    १ ணࠬ  DOS:

1. "ࠢ ࠭  ࠢ쭮 ० ⥪
     १⭮ ணࠬ". ".  "
   1/2003.
