home *** CD-ROM | disk | FTP | other *** search
/ CD-X 1 / cdx_01.iso / demodisc / tyrant / docs / vgadocs / svga.asm < prev    next >
Encoding:
Assembly Source File  |  1993-09-25  |  25.0 KB  |  790 lines

  1.  
  2. Egy kis magyarázat az SVGA.ASM-hoz.
  3. -----------------------------------
  4.  
  5. Ez egy kis segítség azoknak, akik valami SVGA-sat szeretnének írni,
  6. a 13h-tól felfele (értitek ugye). Neked nincs is más dolgod, mint
  7. felhasználni a már kész dolgokat. A használat:
  8.  
  9. .
  10. .
  11. .
  12. CALL ASKVGA             ; detektálja a VGA tipusát, vagy a CHIPkészletet,
  13. .                       ; majd megkérdezi ugyanezt (biztos ami biztos)
  14. .
  15. .
  16. .
  17. CALL SETMODE            ; Ez bevált a 640x400x256-os módba, ha van ilyen
  18. .                       ; de ha nincs, akkor 640x480x256-ba
  19. .
  20. .
  21. MOV AX,hanyadiklapra    ; AX-ben várja a 64K-s lap számát (0-15)
  22. CALL LAPOZ              ; Meghívja a lapváltást
  23. .
  24. .
  25. .
  26.  
  27. Ennyi az egész.  Nem kommenteztem hülyére a forrást, mert nem ide szántam
  28. Eredetileg. Ha valaki tudja használni az ilyesmiket, annak már amúgy sem
  29. kell magyarázkodni, ugye ?
  30. Még valami: szivesen fogadok minden segítséget a témában.
  31. Ez a forrás még igen kezdetleges. De sokkal jobb lesz. Csak ehhez kell
  32. még egy kis idô (és információ !)
  33.  
  34. - TSC -cp_rite db      'TSC''S SVGA DISPLAY DRIVER V 1.4'
  35.  
  36. ; SVGA detecting, SVGA setting, SVGA paging  == CODED BY TSC/TSi == '93 03
  37. ; Thanx to Kyto for the TSENG ET 3000/4000 detect routine !
  38.  
  39. ; First, U have to call the ASKVGA, which determines the VGA card U have.
  40. ; Then U have to call the SETMODE, which sets the desired video mode
  41. ; (currently 640x400x256) for the actual VGA card.
  42. ; Then, when needed U have to call LAPOZ, which selects the desired
  43. ; page for the actual VGA card. Note: U have to put the desired
  44. ; page number into the AX !
  45. ; Have a nice time with it. But remember, if ya use it in your demo,
  46. ; that's OK, but send me a greet please....
  47.  
  48. ; Here are 16 different bank switching....
  49. ; 0. PARADISE
  50. ; 1. VESA
  51. ; 2. TRIDENT
  52. ; 3. TSENG ET-4000  + A LOTS OF COMPATIBLES
  53. ; 4. VIDEO 7
  54. ; 5. ATI VGA WONDER
  55. ; 6. AHEAD A
  56. ; 7. AHEAD B
  57. ; 8. DIAMOND SPEEDSTAR 24 - ET-4000 COMPATIBLE !
  58. ; 9. STB
  59. ; 10. NCR
  60. ; 11. TSENG ET-3000
  61. ; 12. EVEREX
  62. ; 13. OAK
  63. ; 14. CHIPS & TECH
  64. ; 15. REALTEK RTVGA  -  MAY NOT WORK !   REALTEK IS THE SHITTEST SVGA I EVER
  65. ; FUCKED.
  66. ; 16. S3 WINDOWS ACCELERATOR
  67. ; 17. CIRRUS GD-5422 (alias AVGA-2, AVGA-3)
  68. ; 18. MACRONIX MX-68010
  69. ; 19. PRIMUS P-2000 ACCELERATOR
  70. ; 20. AVANCE LOGIC GRAPHICS ACCELERATOR
  71.  
  72. ; AX:BANK
  73.  
  74.  
  75. setmode:        push    bx
  76.                 push    ax
  77.                 cmp     cs:vgacard,12
  78.                 je      set_everex   ;special EVEREX setting, by INT 10h 0070h
  79.                 cmp     cs:vgacard,16
  80.                 je      set_s3
  81.                 mov     ax,cs:mode400
  82.                 mov     bx,100h          ;this is just for the VESA only
  83.                 int     10h
  84.                 jmp     end_of_setmode
  85. set_everex:     mov     ax,0070h
  86.                 mov     bl,14h           ;640x400x256 on EVEREX
  87.                 int     10h
  88. end_of_setmode: pop     ax
  89.                 pop     bx
  90.                 ret
  91. set_s3:         mov     bx,101h          ;same as VESA, but the Bank switching
  92.                 mov     ax,4f02h         ;is different
  93.                 int     10h
  94.                 pop     ax
  95.                 pop     bx
  96.                 ret
  97. lapoz:
  98. paradise:       cmp     cs:vgacard,0
  99.                 ja      vesa
  100.                 push    dx
  101.                 push    ax
  102.                 push    ax
  103.                 mov     dx,3ceh
  104.                 mov     al,9
  105.                 out     dx,al
  106.                 inc     dx
  107.                 pop     ax
  108.                 shl     ax,4
  109.                 out     dx,al
  110.                 pop     ax
  111.                 pop     dx
  112.                 ret
  113.  
  114. vesa:           cmp     cs:vgacard,1
  115.                 ja      trident
  116.                 push    bx
  117.                 push    ax
  118.                 push    dx
  119.                 mov     bx,0
  120.                 shl     ax,4
  121.                 mov     dx,ax
  122.                 mov     ax,4f05h
  123.                 int     10h
  124.                 pop     dx
  125.                 pop     ax
  126.                 pop     bx
  127.  
  128. trident:        cmp     cs:vgacard,2
  129.                 ja      tseng4000
  130.                 push    ax
  131.                 push    dx
  132.                 push    ax
  133.                 mov     dx,3ceh         ;set page size to 64k
  134.                 mov     al,6
  135.                 out     dx,al
  136.                 inc     dl
  137.                 in      al,dx
  138.                 dec     dl
  139.                 or      al,4
  140.                 mov     ah,al
  141.                 mov     al,6
  142.                 out     dx,ax
  143.                 mov     dl,0c4h         ;switch to BPS mode
  144.                 mov     al,0bh
  145.                 out     dx,al
  146.                 inc     dl
  147.                 in      al,dx
  148.                 dec     dl
  149.                 pop     ax
  150.                 mov     ah,al
  151.                 xor     ah,2
  152.                 mov     dx,3c4h
  153.                 mov     al,0eh
  154.                 out     dx,ax
  155.                 pop     dx
  156.                 pop     ax
  157.                 ret
  158. tseng4000:      cmp     cs:vgacard,3
  159.                 ja      video7
  160.                 push    ax
  161.                 push    dx
  162.                 mov     ah,al
  163.                 mov     dx,3bfh        ;Enable access to extended registers
  164.                 mov     al,3
  165.                 out     dx,al
  166.                 mov     dl,0d8h
  167.                 mov     al,0a0h
  168.                 out     dx,al
  169.                 and     ah,15
  170.                 mov     al,ah
  171.                 shl     al,1
  172.                 shl     al,1
  173.                 shl     al,1
  174.                 shl     al,1
  175.                 or      al,ah
  176.                 mov     dl,0cdh
  177.                 out     dx,al
  178.                 pop     dx
  179.                 pop     ax
  180.                 ret
  181.  
  182. video7:         cmp     cs:vgacard,4
  183.                 ja      ativga
  184.                 push    ax
  185.                 push    dx
  186.                 push    cx
  187.                 and     ax,15
  188.                 mov     ch,al
  189.                 mov     dx,3c4h
  190.                 mov     ax,0ea06h
  191.                 out     dx,ax
  192.                 mov     ah,ch
  193.                 and     ah,1
  194.                 mov     al,0f9h
  195.                 out     dx,ax
  196.                 mov     al,ch
  197.                 and     al,1100b
  198.                 mov     ah,al
  199.                 shr     ah,1
  200.                 shr     ah,1
  201.                 or      ah,al
  202.                 mov     al,0f6h
  203.                 out     dx,al
  204.                 inc     dx
  205.                 in      al,dx
  206.                 dec     dx
  207.                 and     al,not 1111b
  208.                 or      ah,al
  209.                 mov     al,0f6h
  210.                 out     dx,ax
  211.                 mov     ah,ch
  212.                 mov     cl,4
  213.                 shl     ah,cl
  214.                 and     ah,100000b
  215.                 mov     dl,0cch
  216.                 in      al,dx
  217.                 mov     dl,0c2h
  218.                 and     al,not 100000b
  219.                 or      al,ah
  220.                 out     dx,al
  221.                 pop     cx
  222.                 pop     dx
  223.                 pop     ax
  224.                 ret
  225.  
  226. ativga:         cmp     cs:vgacard,5
  227.                 ja      aheada
  228.                 push    ax
  229.                 push    dx
  230.                 mov     ah,al
  231.                 mov     dx,1ceh
  232.                 mov     al,0b2h
  233.                 out     dx,al
  234.                 inc     dl
  235.                 in      al,dx
  236.                 shl     ah,1
  237.                 and     al,0e1h
  238.                 or      ah,al
  239.                 mov     al,0b2h
  240.                 dec     dl
  241.                 out     dx,ax
  242.                 pop     dx
  243.                 pop     ax
  244.                 ret
  245.  
  246. aheada:         cmp     cs:vgacard,6
  247.                 ja      aheadb
  248.                 push    ax
  249.                 push    dx
  250.                 push    cx
  251.                 mov     ch,al
  252.                 mov     dx,3ceh         ;Enable extended registers
  253.                 mov     ax,200fh
  254.                 out     dx,ax
  255.                 mov     dl,0cch         ;bit 0
  256.                 in      al,dx
  257.                 mov     dl,0c2h
  258.                 and     al,11011111b
  259.                 shr     ch,1
  260.                 jnc     skpa
  261.                 or      al,00100000b
  262. skpa:           out     dx,al
  263.                 mov     dl,0cfh         ;bits 1,2,3
  264.                 mov     al,0
  265.                 out     dx,al
  266.                 inc     dx
  267.                 in      al,dx
  268.                 dec     dx
  269.                 and     al,11111000b
  270.                 or      al,ch
  271.                 mov     ah,al
  272.                 mov     al,0
  273.                 out     dx,ax
  274.                 pop     cx
  275.                 pop     dx
  276.                 pop     ax
  277.                 ret
  278.  
  279. aheadb:         cmp     cs:vgacard,7
  280.                 ja      diamond
  281.                 push    ax
  282.                 push    dx
  283.                 push    cx
  284.                 mov     ch,al
  285.                 mov     dx,3ceh         ;Enable extended registers
  286.                 mov     ax,200fh
  287.                 out     dx,ax
  288.                 mov     ah,ch
  289.                 mov     cl,4
  290.                 shl     ah,cl
  291.                 or      ah,ch
  292.                 mov     al,0dh
  293.                 out     dx,ax
  294.                 pop     cx
  295.                 pop     dx
  296.                 pop     ax
  297.                 ret
  298. diamond:        cmp     cs:vgacard,8
  299.                 ja      stbvga
  300.                 push    ax
  301.                 push    dx
  302.                 mov     ah,al
  303.                 mov     dx,3bfh        ;Enable access to extended registers
  304.                 mov     al,3
  305.                 out     dx,al
  306.                 mov     dl,0d8h
  307.                 mov     al,0a0h
  308.                 out     dx,al
  309.                 and     ah,15
  310.                 mov     al,ah
  311.                 shl     al,1
  312.                 shl     al,1
  313.                 shl     al,1
  314.                 shl     al,1
  315.                 or      al,ah
  316.                 mov     dl,0cdh
  317.                 out     dx,al
  318.                 pop     dx
  319.                 pop     ax
  320.                 ret
  321. stbvga:         cmp     cs:vgacard,9
  322.                 ja      ncrvga
  323.                 push    ax
  324.                 push    dx
  325.                 mov     ah,al
  326.                 mov     dx,3bfh        ;Enable access to extended registers
  327.                 mov     al,3
  328.                 out     dx,al
  329.                 mov     dl,0d8h
  330.                 mov     al,0a0h
  331.                 out     dx,al
  332.                 and     ah,15
  333.                 mov     al,ah
  334.                 shl     al,1
  335.                 shl     al,1
  336.                 shl     al,1
  337.                 shl     al,1
  338.                 or      al,ah
  339.                 mov     dl,0cdh
  340.                 out     dx,al
  341.                 pop     dx
  342.                 pop     ax
  343.                 ret
  344. ncrvga:         cmp     cs:vgacard,10
  345.                 ja      tsenget3000
  346.                 mov     bx,ax
  347.                 mov     al,18h
  348.                 mov     dx,3c4h
  349.                 out     dx,al
  350.                 inc     dx
  351.                 shl     bx,2
  352.                 mov     ax,bx
  353.                 out     dx,al
  354.                 ret
  355.  
  356. tsenget3000:    cmp     cs:vgacard,11
  357.                 ja      everex_                        ;Tseng et 3000
  358.                 push    ax
  359.                 push    dx
  360.                 and     al,7
  361.                 mov     ah,al
  362.                 shl     al,1
  363.                 shl     al,1
  364.                 shl     al,1
  365.                 or      al,ah
  366.                 or      al,01000000b
  367.                 mov     dx,3cdh
  368.                 out     dx,al
  369.                 pop     dx
  370.                 pop     ax
  371.                 ret
  372.  
  373. everex_:        cmp     cs:vgacard,12               ;Everex
  374.                 ja      oak_
  375.                 push    ax
  376.                 push    dx
  377.                 push    cx
  378.                 mov     cl,al
  379.                 mov     dx,3c4h
  380.                 mov     al,8
  381.                 out     dx,al
  382.                 inc     dl
  383.                 in      al,dx
  384.                 dec     dl
  385.                 shl     al,1
  386.                 shr     cl,1
  387.                 rcr     al,1
  388.                 mov     ah,al
  389.                 mov     al,8
  390.                 out     dx,ax
  391.                 mov     dl,0cch
  392.                 in      al,dx
  393.                 mov     dl,0c2h
  394.                 and     al,0dfh
  395.                 shr     cl,1
  396.                 jc      ever_ez
  397.                 or      al,20h
  398. ever_ez:        out     dx,al
  399.                 pop     cx
  400.                 pop     dx
  401.                 pop     ax
  402.                 ret
  403.  
  404. oak_:           cmp     cs:vgacard,13 ;Oak Technology Inc OTI-067
  405.                 ja      chipstech
  406.                 push    ax
  407.                 push    dx
  408.                 and     al,15
  409.                 mov     ah,al
  410.                 shl     al,1
  411.                 shl     al,1
  412.                 shl     al,1
  413.                 shl     al,1
  414.                 or      al,ah
  415.                 mov     dx,3dfh
  416.                 out     dx,al
  417.                 pop     dx
  418.                 pop     ax
  419.                 ret
  420.  
  421. chipstech:      cmp     cs:vgacard,14                ;Chips & Tech
  422.                 ja      realteklapoz
  423.                 push    ax
  424.                 push    dx
  425.                 push    bx
  426.                 mov     bl,al
  427.                 mov     dx,46e8h        ;place chip in setup mode
  428.                 mov     ax,1eh
  429.                 out     dx,ax
  430.                 mov     dx,103h         ;enable extended registers
  431.                 mov     ax,0080h
  432.                 out     dx,ax
  433.                 mov     dx,46e8h        ;bring chip out of setup mode
  434.                 mov     ax,0eh
  435.                 out     dx,ax
  436.                 mov     ah,bl
  437.                 shl     ah,1    ;change 64k bank number into 16k bank number
  438.                 shl     ah,1
  439.                 mov     al,10h
  440.                 mov     dx,3d6h
  441.                 out     dx,ax
  442.                 pop     bx
  443.                 pop     dx
  444.                 pop     ax
  445.                 ret
  446. realteklapoz:   cmp     cs:vgacard,15
  447.                 ja      s3lapoz
  448.                 push    dx
  449.                 mov     dx,3d7h
  450.                 out     dx,al               ; Easy eh ????
  451.                 pop     dx
  452.                 ret
  453.  
  454. s3lapoz:        cmp     cs:vgacard,16
  455.                 ja      cirruslapoz
  456.                 push    dx
  457.                 push    ax
  458.                 mov     al,35h
  459.                 mov     dx,3d4h
  460.                 out     dx,al
  461.                 inc     dx
  462.                 pop     ax
  463.                 out     dx,al
  464.                 pop     dx
  465.                 ret
  466. cirruslapoz:    cmp     cs:vgacard,17
  467.                 ja      mxlapoz
  468.                 push    dx
  469.                 push    ax
  470.                 mov     al,9
  471.                 mov     dx,3ceh
  472.                 out     dx,al
  473.                 inc     dx
  474.                 pop     ax
  475.                 out     dx,al
  476.                 pop     dx
  477.                 ret
  478. mxlapoz:        cmp     cs:vgacard,18
  479.                 ja      primuslapoz
  480.                 push    dx
  481.                 push    ax
  482.                 mov     al,0c5h
  483.                 mov     dx,3c4h
  484.                 out     dx,al
  485.                 inc     dx
  486.                 pop     ax
  487.                 out     dx,al
  488.                 pop     dx
  489.                 ret
  490. primuslapoz:    cmp     cs:vgacard,19
  491.                 ja      avancelapoz
  492.                 push    dx
  493.                 mov     dx,3d6h
  494.                 out     dx,al
  495.                 pop     dx
  496.                 ret
  497. avancelapoz:    cmp     cs:vgacard,20
  498.                 ja      valamimas
  499.                 push    dx
  500.                 mov     dx,3d7h
  501.                 out     dx,al
  502.                 pop     dx
  503.                 ret
  504. valamimas:      ret
  505.  
  506.  
  507. detections:     mov     ax,cs
  508.                 mov     es,ax
  509.                 mov     ah,3
  510.                 int     10h
  511.                 mov     bl,3
  512.                 mov     bh,0
  513.                 mov     bp,offset cs:infoline
  514.                 mov     al,1
  515.                 mov     ah,13h
  516.                 mov     cx,21
  517.                 int     10h
  518.  
  519. tridect:        push    cs
  520.                 pop     ds
  521.                 mov     dx,03c4h
  522.                 mov     ax,14
  523.                 out     dx,ax
  524.                 inc     dx
  525.                 in      ax,dx
  526.                 mov     cs:oldvalue,ax
  527.                 mov     ax,0
  528.                 out     dx,ax
  529.                 in      ax,dx
  530.                 and     ax,15
  531.                 mov     cs:value,ax
  532.                 mov     ax,cs:oldvalue
  533.                 out     dx,ax
  534.                 cmp     cs:value,2
  535.                 jne     paradisedet
  536.                 mov     ah,9
  537.                 mov     dx,offset cs:tridetected
  538.                 int     21h
  539.                 jmp     vesadetect
  540.  
  541. paradisedet:    mov     ax,0c000h
  542.                 mov     ds,ax
  543.                 mov     si,7dh
  544.                 lodsw
  545.                 cmp     ax,'GV'
  546.                 jne     aheaddetect
  547.                 lodsw
  548.                 cmp     ax,'=A'
  549.                 jne     aheaddetect
  550.                 mov     ax,cs
  551.                 mov     ds,ax
  552.                 mov     ah,9
  553.                 mov     dx,offset cs:paradetected
  554.                 int     21h
  555.                 jmp     vesadetect
  556.  
  557. aheaddetect:    mov     ax,0c000h
  558.                 mov     ds,ax
  559.                 mov     si,25h
  560.                 lodsw
  561.                 cmp     ax,'HA'
  562.                 jne     tsengdetect
  563.                 lodsw
  564.                 cmp     ax,'AE'
  565.                 jne     tsengdetect
  566.                 mov     ax,cs
  567.                 mov     ds,ax
  568.                 mov     ah,9
  569.                 mov     dx,offset cs:aheaddetected
  570.                 int     21h
  571.                 jmp     vesadetect
  572. tsengdetect:
  573. ;
  574. ;      3CDh (R/W): Segment Select
  575. ;      bit 0-2  (ET3000) 64k Write bank nr
  576. ;          3-5  (ET3000) 64k Read bank nr
  577. ;          6-7  (ET3000) Segment Configuration.
  578. ;                          0  128K segments
  579. ;                          1   64K segments
  580. ;                          2  1M linear memory
  581. ;          0-3  (ET4000) 64k Write bank nr (0..15)
  582. ;          4-7  (ET4000) 64k Read bank nr (0..15)
  583.  
  584. DetectTseng:
  585.            mov   dx,3CDh
  586.            in    al,dx
  587.            mov   ah,al
  588.            mov   al,55h
  589.            out   dx,al
  590.            in    al,dx
  591.            xchg  ah,al
  592.            out   dx,al
  593.            cmp   ah,55h
  594.            jne   vesadetect
  595.            dec   dx
  596.            in    al,dx
  597.            mov   dl,0D4h
  598.            and   al,1
  599.            jne   ET01
  600.            mov   dl,0B4h
  601. ET01:      mov   al,33h
  602.            out   dx,al
  603.            inc   dx
  604.            in    al,dx
  605.            mov   cl,al
  606.            xor   al,0Fh
  607.            mov   ah,al
  608.            out   dx,al
  609.            in    al,dx
  610.            xchg  al,cl
  611.            out   dx,al
  612.            cmp   ah,cl
  613.            jne   ET3000
  614. ET4000:         mov     ax,cs
  615.                 mov     ds,ax
  616.                 mov     ah,9
  617.                 mov     dx,offset cs:et4000det
  618.                 int     21h
  619.                 jmp     vesadetect
  620. ET3000:         mov     ax,cs
  621.                 mov     ds,ax
  622.                 mov     ah,9
  623.                 mov     dx,offset cs:et3000det
  624.                 int     21h
  625.                 jmp     vesadetect
  626.  
  627. vesadetect:     mov     ax,4f03h
  628.                 int     10h
  629.                 cmp     al,4fh
  630.                 jne     undetect
  631.                 mov     ax,cs
  632.                 mov     ds,ax
  633.                 mov     dx,offset cs:vesadetected
  634.                 mov     ah,9
  635.                 int     21h
  636.                 mov     ax,cs
  637.                 mov     es,ax
  638.                 mov     di,offset cs:vesatable
  639.                 mov     cx,100h
  640.                 mov     ax,4f01h
  641.                 int     10h
  642.                 mov     ax,cs:[di+2]
  643.                 cmp     al,7
  644.                 je      writablevesa
  645.                 mov     ah,3
  646.                 int     10h
  647.                 mov     bl,4
  648.                 mov     bh,0
  649.                 mov     bp,offset cs:vesawarning
  650.                 mov     al,1
  651.                 mov     ah,13h
  652.                 mov     cx,128
  653.                 int     10h
  654. writablevesa:   ret
  655.  
  656. undetect:       mov     ax,cs
  657.                 mov     ds,ax
  658.                 mov     ah,9
  659.                 mov     dx,offset cs:undetected
  660.                 int     21h
  661.                 ret
  662. askvga:         mov     ax,12h
  663.                 int     10h
  664.                 mov     ax,cs
  665.                 mov     ds,ax
  666.                 call    detections
  667.                 mov     ax,cs
  668.                 mov     es,ax
  669.                 mov     ah,3
  670.                 int     10h
  671.                 mov     bl,3
  672.                 mov     bh,0
  673.                 mov     bp,offset cs:whatvga
  674.                 mov     al,1
  675.                 mov     ah,13h
  676.                 mov     cx,22
  677.                 int     10h
  678.                 mov     ax,cs
  679.                 mov     ds,ax
  680.                 mov     ah,9
  681.                 mov     dx,offset cs:whatvga2
  682.                 int     21h
  683. ujraask:        mov     ah,8
  684.                 int     21h
  685.                 cmp     al,27
  686.                 jne     nemakarkilepni
  687.                 mov     ax,3
  688.                 int     10h
  689.                 mov     ax,4c00h
  690.                 int     21h
  691. nemakarkilepni: cmp     al,30h
  692.                 jb      nemszam_
  693.                 cmp     al,39h
  694.                 ja      nemszam_
  695.                 sub     al,30h
  696.                 mov     cs:vgacard,al
  697.                 mov     ah,0
  698.                 shl     ax,1
  699.                 mov     dx,cs
  700.                 mov     ds,dx
  701.                 mov     si,offset cs:vgamodes
  702.                 add     si,ax
  703.                 lodsw
  704.                 mov     cs:mode400,ax
  705.                 ret
  706. nemszam_:       cmp     al,'A'
  707.                 jb      nemnagybetu
  708.                 cmp     al,'K'
  709.                 ja      nemnagybetu
  710.                 sub     al,55
  711.                 mov     cs:vgacard,al
  712.                 mov     ah,0
  713.                 shl     ax,1
  714.                 mov     dx,cs
  715.                 mov     ds,dx
  716.                 mov     si,offset cs:vgamodes
  717.                 add     si,ax
  718.                 lodsw
  719.                 mov     cs:mode400,ax
  720.                 ret
  721. newask:         jmp     ujraask
  722. nemnagybetu:    cmp     al,'a'
  723.                 jb      newask
  724.                 cmp     al,'k'
  725.                 ja      newask
  726.                 sub     al,87
  727.                 mov     cs:vgacard,al
  728.                 mov     ah,0
  729.                 shl     ax,1
  730.                 mov     dx,cs
  731.                 mov     ds,dx
  732.                 mov     si,offset cs:vgamodes
  733.                 add     si,ax
  734.                 lodsw
  735.                 mov     cs:mode400,ax
  736.                 ret
  737.  
  738. vgacard         db      0
  739. whatvga         db      10,13,10,13
  740.                 db      'Choose a VGA card:'
  741. whatvga2  db ' 0. PARADISE P1024                A. NCR',10,13
  742. db '                   0. PARADISE VGA PRO              B. TSENG ET-3000',10,13
  743. db '                   0. PARADISE WD90C1x              B. GENOA 5x00',10,13
  744. db '                   0. PARADISE WD90C3x              C. EVEREX',10,13
  745. db '                   1. VESA STANDARD                 D. OAK',10,13
  746. db '                   2. TRIDENT 8900                  E. CHIPS & TECH',10,13
  747. db '                   3. TSENG ET-4000                 F. REALTEK',10,13
  748. db '                   3. DEFINICON                     G. S3',10,13
  749. db '                   3. ORCHID PRO DESIGNER II        G. STEALTH VRAM',10,13
  750. db '                   3. GENOA 7900                    H. CIRRUS GD-5422',10,13
  751. db '                   4. VIDEO 7                       H. AVGA-2, AVGA-3',10,13
  752. db '                   5. ATI VGA WONDER XL             I. MX-68010',10,13
  753. db '                   5. ATI VGA WONDER +              J. PRIMUS P-2000',10,13
  754. db '                   5. ATI VGA ULTRA                 K. AVANCE AL-2101',10,13
  755. db '                   5. ATI GRAPHICS VANTAGE',10,13
  756. db '                   6. AHEAD A',10,13
  757. db '                   7. AHEAD B',10,13
  758. db '                   8. DIAMOND SPEEDSTAR',10,13
  759. db '                   9. STB                           ESC. QUIT NOW',10,13
  760. db '$'
  761.  
  762. infoline        db      10,13
  763.                 db      'Detected:          '
  764. tridetected     db      'Trident SVGA$'
  765. paradetected    db      'Paradise SVGA$'
  766. aheaddetected   db      'Ahead SVGA$'
  767. undetected      db      'Unknown SVGA$'
  768. et3000det       db      'Tseng Et-3000 SVGA$'
  769. et4000det       db      'Tseng Et-4000 SVGA$'
  770. vesadetected    db      10,13
  771.                 db      '                   VESA compatible SVGA',10,13,'$'
  772. oldvalue        dw      0
  773. value           dw      0
  774. mode400         dw      0
  775.  
  776. ; These modes are 640x400x256, but some cards still doesn't support this mode.
  777. ; In these cases I put the 640x480x256 mode.
  778.  
  779. vgamodes        dw      5eh,4f02h,5ch,2fh,66h,61h,60h,60h,2fh,78h,5eh,2eh,0,53h
  780.                 dw      78h,25h,101h,5fh,58h,2dh,29h
  781. vesatable       db      256/4   dup ('VESA')
  782. vesawarning     db      10,13,'Don''t select VESA now, because unable to'
  783.                 db      ' read from the WINDOW A.',10,13
  784.                 db      'Please load a better VESA driver,'
  785.                 db      ' if you wanna select VESA !'
  786.  
  787.  
  788. * Terror Style
  789.  
  790.