;                .MODEL  LARGE,C
include asmgloba.h                
                .CODE

                public gettype
;
; int gettype( int * );
; returns the adapter type (1=VGA, 0=other) and number of displayed rows
;

gettype         PROC    USES SI DI, rows:PTR

                mov     ax,40h
                mov     es,ax                   ; ES -> video BIOS data area
                mov     al,es:[84h]             ; ROWS
                xor     ah,ah
                inc     ax
                mov     bx,rows
                mov     [bx],ax                 ; number of displayed rows

; the following function is supported only by the VGA
                mov     ax,1200h
                mov     bl,36h
                int     10h                     ; enable screen refresh
                cmp     al,12h
                xor     ax,ax                   ; assume not VGA
                jne     return                  ; jump if not supported

                mov     ax,500h
                int     10h                     ; select display page 0

; Select the alternate print-screen routine that works properly if the number
; of displayed rows is not 25.
                mov     ah,12h
                mov     bl,20h
                int     10h                     ; select alternate print-screen

                mov     ax,1                    ; is VGA

return:         ret

gettype         ENDP

                END
