// ------------------------------------------------------------------------------------------------
// MyDma.c
//
// Example of DMA handler
//
// These DMA functions are necesary for the G2 bus countermeasures which require the suspension
// and resumption of all DMA transfers while data is moved across the G2 bus.
//
// COPYRIGHT (C) SEGA OF AMERICA, INC. 1998
// All rights reserved.
//
// Information and source code samples contained herein are 
// provided "as-is", without representations or warranties, and 
// are subject to change without notice.
//
// SEGA OF AMERICA, INC. cannot support modifications or 
// derivative works created from the sample source code provided. 
// Developers may use, reproduce, and modify portions or entire 
// sections of the sample source code for the purposes of creating
// Dreamcast applications.  
//
// Sample source code contained herein may not be appropriate 
// for use under all circumstances.  Please consult Developer 
// documentation provided along with your Dreamcast unit for
// additional information and suggestions.
//
//
// Author: Ralph "Cooksey" Thomas
//
// Tabs:	4
//
// Rev:		08/23/99	File Originated
//						
// ------------------------------------------------------------------------------------------------

#include <am.h>
#include <shinobi.h>
#include <sg_syg2.h>

KTBOOL MyDmaTransferProc(volatile KTU32 *target,volatile KTU32 *source,KTU32 size,AC_DMA_TRANSFER_OPERATION operation,AC_DMA_CALLBACK callback)
{
SYE_G2_ERR 	error		=	SYE_G2_ERR_NOTHING;
Bool		busyFlag	=	false;

switch(operation)
	{
	case AC_DMA_NOP:
		return KTFALSE;
	
	case AC_DMA_SUSPEND_ALL:
		error		=	syG2DmaSuspendAll();	
		break;
		
		
	case AC_DMA_RESUME_ALL:
		error		=	syG2DmaResumeAll();	
		break;

	default:
		break;
	}

if(error != SYE_G2_ERR_NOTHING)
	return KTFALSE;
else	
	return KTTRUE;
}

