include libmacro.inc

beglib

item	'readvesa','*'
 	mov	di, ax
	xor	al, al
	mov	ah, 4Fh
	int	10h
	pop	ax

item	'readsvga','*'
	xchg	cx, ax
	mov	ah, 4Fh
	mov	al, 01
	pop	di
	int	10h
	pop	ax

item	'initsvga','*'
	mov	bx, ax
	mov	ah, 4Fh
	mov	al, 02h
	int	10h
	pop	ax

item	'getsvgamode','*'
	push	ax
	mov	ah, 4Fh
	mov	al, 03h
	int	10h
	mov	ax, bx

item	'closesvga','*'
	push	ax
	mov	ax, 03h
	int	10h
	pop	ax

item	'getsvgabuffer','*'
	push	ax
	mov	ax, 4F04h
	xor	dx, dx
	mov	cx, 1101b
	int	10h
	shl	bx, 1
	shl	bx, 1
	shl	bx, 1
	shl	bx, 1
	shl	bx, 1
	mov	ax, bx

item	'savesvga','*'
	mov	bx, ax
	mov	ax, 4F04h
	mov	dx, 0001h
	mov	cx,1101b
	int	10h
	pop	ax

item	'restoresvga','*'
	mov	bx, ax
	mov	ax, 4F04h
	mov	dx, 0002h
	mov	cx, 1101b
	int	10h
	pop	ax

item	'setwindow','*'
	mov	dx, ax
	mov	ax, 4F05h
	pop	bx
	xor	bh, bh
	int	10h
	pop	ax

item	'getwindow','*'
	mov	bx, ax
	mov	ax, 4F05h
	mov	bh, 01
	int	10h
	mov	ax, dx

item	'setscanline','*'
	xchg	ax, cx
	push	ax
	mov	ax, 4F06h
	xor	bl, bl
	int	10h
	mov	ax, cx
	pop	cx

item	'getscanline','*'
	push	ax cx
	mov	ax, 4F06h
	mov	bl, 01h
	int	10h
	mov	ax, cx
	pop	cx

item	'setdisplaystart','*'
	mov	dx, ax
	mov	ax, 4F07h
	xor	bx, bx
	pop	cx
	int	10h
	pop	ax

item	'getdisplaystart','*'
	push	ax
	mov	ax, 4F07h
	mov	bx, 0001h
	int	10h
	push	cx
	mov	ax, dx

endlib

;{**************** END OF SVGA ************}
