;;*** VIDEO.ASM simple MCGA mode 13 support calls for PEND example program.
;;***
;;*** Written by John W. Ratcliff (c) 1994
;;***		 Compuserve: 70253,3237
;;***		 Genie: J.RATCLIFF3
;;***		 BBS: 1-314-939-0200
;;***		 Addresss:
;;***			   747 Napa Lane
;;***			   St. Charles, MO 63304
;;***


	IDEAL
	P386
	JUMPS
	MODEL FLAT,C

	public	VidOn
	public	VidOff
	public	DrawSound

	CODESEG

PROC	C VidOn near
	mov	ax,13h
	int	10h
	ret
	endp

PROC	C VidOff near
	mov	ax,03
	int	10h
	ret
	endp

PROC	C DrawSound near
	ARG	SOUND:DWORD,SWID:DWORD,COLOR:DWORD
	uses	ebx,ecx,edx,esi,edi

	mov	esi,[SOUND]
	mov	ebx,320
	xor	ecx,ecx 	  ; Xlocation.

@@GO:	xor	eax,eax
	mov	al,[esi]      ; Get sound value.
	shr	eax,1
	add	eax,36		 ; Adjust.
	mul	ebx
	add	eax,ecx 	  ; Plus current xlocation.
	mov	edi,eax
	mov	eax,[COLOR]
	mov	[0A0000h+edi],al
	inc	cx
	inc	si
	cmp	ecx,[SWID]
	jne	@@GO

	ret
	endp


	ends
	end
