home *** CD-ROM | disk | FTP | other *** search
- page 58,132
-
- ; vsets.asm
- ; contains: _vmode(),vpage(),vstate()
- ;
- include model.h
- include prologue.h
- include equ.h
- name vsets
- pseg vsets
-
- ;==>-- unsigned _vmode(mode)
- ;
- ;; ARGUMENTS:
- ; (int) mode - video mode to set 0..7
- ; if parameter is -1 (0xffff)
- ; then don't set video mode, just
- ; read it.
- ;; DESCRIPTION:
- ; set rom-bios video mode
- ;
- ;; SIDE EFFECTS:
- ; video mode is changed
- ;
- ;; RETURNS:
- ; Number of columns in high order 8 bits, number of rows in
- ; low order 8 bits.
- ;
- ;; AUTHOR:
- ; Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
- ;
- ;; MODIFICATIONS:
- ;
- ;;;
- cproc _vmode
- cmp word ptr parm1_,0ffffh
- jz skset
- mov al,parm1_ ;get mode from stack to AL
- xor ah,ah ;code to do mode set to INT 10
- int 10h
- skset: mov word ptr parm1_,25 ;assume 25 rows on screen
- mov ah,12h
- mov bl,10h
- mov cx,0ffffh ;cx will be != to -1 if ega present
- int 10h
- inc cx ;is ega bios in control?
- jz noega
- mov ax,1130h ;get extended ega information
- push bp
- push es
- int 10h
- pop es
- pop bp
- inc dl
- mov parm1_,dl ;update number of rows
- noega: mov ah,15
- int 10h ;get number of columns to ah
- mov al,parm1_ ;number of rows to al
- cproce
-
- ;==>-- void vpage(page)
- ;
- ;; ARGUMENTS:
- ; (int) page - visual page to set (0-7)
- ;
- ;; DESCRIPTION:
- ; set default video page
- ;
- ;; SIDE EFFECTS:
- ; default video page may change
- ;
- ;; AUTHOR:
- ; Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
- ;;;
- cproc vpage
- mov al,parm1_ ;get page number
- mov ah,5 ;function 5 to AH
- int 10h
- cproce
-
- ;==>-- unsigned vstate(&out)
- ;
- ;; ARGUMENTS:
- ; (struct GFREGS *) out - points to structure
- ;
- ;; DESCRIPTION:
- ; Get current video state, set registers structure with values
- ; returned.
- ;
- ;; RETURNS:
- ; current video mode.
- ;
- ;; AUTHOR:
- ; Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
- ;
- ;; MODIFICATIONS:
- ;
- ;;;
- cproc vstate
- push bp
- mov ah,15
- int 10h ;do the interrupt, getting info
- pop bp
- if _LDATA
- push ds
- lds si,parm1_
- else
- mov si,parm1_
- endif
- xor ch,ch
- mov cl,ah ;cx=number of columns
- mov [si+gfbx],cx ;save in structure
- mov cl,bh ;cx=current video page
- mov [si+gfcx],cx ;save in structure
- xor ah,ah ;ax=current video mode
- mov [si+gfax],ax
- mov [si+gfdx],25 ;assume 25 rows
- push ax
- mov ah,12h
- mov bl,10h
- mov cx,0ffffh ;cx will be != to -1 if ega present
- int 10h
- inc cx ;is ega bios in control?
- jz xnoega
- mov ax,1130h ;get extended ega information
- push bp
- push es
- push si
- int 10h
- pop si
- pop es
- pop bp
- xor dh,dh
- inc dl
- mov [si+gfdx],dx ;save number of rows in variable
- xnoega: pop ax
- if _LDATA
- pop ds
- endif
- cproce
- endps
- end
-