	name	tseng4

	.386p

INCLUDE	..\common\vgadrvr.inc

_CODE	SEGMENT DWORD PUBLIC 'CODE'

ASSUME	cs:_CODE

	org	0

mspo	EQU	offset set_page
cco	EQU	offset CCOPY

head	vga_header	<,,29h,37h,,2eh,30h,0,,,,mspo,mspl,mspo,mspl,cco,ccl>

NUMPAGES	equ	2

setpage	MACRO	srcpage,dstpage	; set a new page
	IFIDNI	<srcpage>,<al>	; src == al
	IFIDNI	<dstpage>,<al>	; src == al && dst == al
	mov	ah,al
	shl	al,3
	or	al,ah
	ELSE			; src == al && dst != al
	shl	al,3
	or	al,dstpage
	ENDIF
	ELSE			; src != al
	IFIDNI	<dstpage>,<al>	; src != al && dst == al
	IFDIFI	<srcpage>,<ah>	; src != al && dst == al && src != ah
	mov	ah,srcpage
	ENDIF
	shl	ah,3
	or	al,ah
	ELSE			; src != al && dst != al
	mov	al,srcpage
	shl	al,3
	or	al,dstpage
	ENDIF
	ENDIF

	or	al,40h
	push	dx
	mov	dx,03cdh
	out	dx,al		; set the page
	pop	dx
		ENDM

copyright db	10, 13, 'Tseng Labs ET3000 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		; page
	shl	al,3
	or	al,ah
	or	al,40h
	mov	dx,03cdh
	out	dx,al		; set the page
	pop	edx
	ret
mspl	EQU	$ - offset set_page
set_page ENDP

include	ccopy2.asm

_CODE	ENDS

	END
