;/*
sc KillDMA.c DATA=FAR NMINC STRMERGE NOSTKCHK IGNORE=73 STRUCTUREEQUIVALENCE NOSTDIO
slink from LIB:c.o KillDMA.o to //Clients/KillDMA LIB LIB:sc.lib LIB:amiga.lib /lib/client.lib SC SD STRIPDEBUG NOICONS
delete KillDMA.o
quit

 KillDMA 1.2  (Client for BServer)

 Copyright © 1994 Stefano Reksten of 3AM - The Three Amigos!!!
 All rights reserved.
*/

#include <exec/types.h>
#include <exec/memory.h>
#include <graphics/gfxmacros.h>
#include <hardware/dmabits.h>
#include <hardware/intbits.h>

#include <clib/exec_protos.h>
#include <clib/intuition_protos.h>
#include <clib/graphics_protos.h>

#include "/include/client.h"
#include "/include/client_pragmas.h"

struct IntuitionBase *IntuitionBase;
struct GfxBase *GfxBase;
struct DisplayIDInformation *dinfo;

extern far struct Custom custom;

void Blank( void )
{
struct Screen *scr;

if ( scr = OpenScreenTags( NULL,
	SA_Depth, 0,
	SA_DisplayID, DISPLAYID( dinfo ),
	TAG_END ) )
	{
	register struct ViewPort *vp = &(scr->ViewPort);

	SetRGB4( vp, 0, 0, 0, 0 );
	WaitTOF();
	custom.dmacon = BITCLR|DMAF_AUDIO|DMAF_SPRITE|DMAF_COPPER|DMAF_RASTER;
	WaitServerCommand();
	custom.dmacon = BITSET|DMAF_AUDIO|DMAF_SPRITE|DMAF_COPPER|DMAF_RASTER;
	CloseScreen( scr );
	}
else
	SendClientMsg( ACTION_FAILED );
}


void __main( char *line )
{
if ( IntuitionBase = (struct IntuitionBase *)OpenLibrary( "intuition.library", 37L ) )
	{
	if ( GfxBase = (struct GfxBase *)OpenLibrary( "graphics.library", 37L ) )
		{
		if ( dinfo = OpenCommunication() )
			{
			Blank();
			CloseCommunication( dinfo );
			}
		CloseLibrary( (struct Library *)GfxBase );
		}
	CloseLibrary( (struct Library *)IntuitionBase );
	}
}
