	name	wdc00

	.386p

INCLUDE	..\common\vgadrvr.inc

_CODE	SEGMENT DWORD PUBLIC 'CODE'

ASSUME	cs:_CODE

	org	0

smo	EQU	offset set_mode
mspo	EQU	offset set_page
cco	EQU	offset CCOPY

head	vga_header	<,11h,58h,5dh,,5fh,0,0,,smo,sml,mspo,mspl,mspo,mspl,cco,ccl>

NUMPAGES	equ	1

setpage	MACRO	page		; page to be set is in ah
	IFDIFI	<page>,<ah>
	mov	ah,page
	ENDIF
	shl	ah,4
	mov	al,09h		; register 09h
	push	dx
	mov	dx,03ceh
	out	dx,ax		; set the page
	pop	dx
		ENDM

set_mode	PROC NEAR
	push	ebx
	xor	ah,ah		; function 0 = set mode
	push	eax
	int	10h
	; read the mode back from BIOS to make sure we actually changed
	; it
	mov	ah,0fh
	int	10h		; get current mode
	pop	ebx
	cmp	al,bl
	jnz	local_bad
	push	edx
	cli
	mov	dx,3ceh		; i/o address
	mov	ax,050fh	; enable extended register access
	out	dx,ax
	mov	al,0bh		; index 0B
	out	dx,al		; point to index 0B
	inc	edx
	in	al,dx		; get current value
	and	al,0f7h		; clear bit 3
	out	dx,al		; one page map
	sti
	pop	edx
	xor	eax,eax		; return OK
	pop	ebx
	ret
local_bad:
	mov	eax,1		; non-supported mode
	pop	ebx
	ret
sml	EQU	$ - offset set_mode
set_mode	ENDP

include ccopy1.asm

copyright db	10, 13, 'WD90C10/Paradise PVGA1A driver '
include version.asm
include date.asm
	db	10, 13
	db	'Copyright (c) 1992 Starnet Communications '
	db	'Corporation. All rights reserved.',10,13,'$'

set_page	PROC NEAR
	push	edx
	mov	ah,al
	shl	ah,4
	mov	al,09h		; register 09h
	mov	dx,03ceh
	out	dx,ax		; set the page
	pop	edx
	ret
mspl	EQU	$ - offset set_page
set_page	ENDP

_CODE	ENDS
	END
