#ifndef DMA_COPY__
#define DMA_COPY__
#include <sgl.h>
#define _____CEL_ADR (VDP2_VRAM_A0)
#define _____MAP_ADR (VDP2_VRAM_B0)
#define _____COL_ADR (VDP2_COLRAM)
#define NBG1_CEL_ADR (VDP2_VRAM_B1+0x02000)
#define NBG1_MAP_ADR (VDP2_VRAM_B1+0x12000)
#define DMA_S2D_CELSIZE(__x) ((__x))
#define DMA_S2D_MAPSIZE(__x,__y,__z) ((__x)*(__y)*(__z))
#define DMA_S2D_PALSIZE(__x) ((__z))
int EpDMACopiedNbg1(void *__cel,Uint16 *__map,Uint16 *__pal,void *__x,void *__y,void *__z)
{
slCharNbg1((COL_TYPE_256),(CHAR_SIZE_2x2));
slPageNbg1((void*)(_____CEL_ADR),(0),(PNB_1WORD));
slPlaneNbg1((PL_SIZE_1x1));
slMapNbg1((void*)(_____MAP_ADR),(void*)(_____MAP_ADR),(void*)(_____MAP_ADR),(void*)(_____MAP_ADR));
slDMACopy((void*)(__cel),(void*)(_____CEL_ADR),(Uint32)(DMA_S2D_CELSIZE(__x));
slDMACopy((void*)(__map),(void*)(_____MAP_ADR),(Uint32)(DMA_S2D_MAPSIZE(__y));
slDMACopy((void*)(__pal),(void*)(_____COL_ADR),(Uint32)(DMA_S2D_PALSIZE(__z));
}
int EpDMACopiedNbg2(void *__cel,Uint16 *__map,Uint16 *__pal,void *__x,void *__y,void *__z)
{
slCharNbg2((COL_TYPE_256),(CHAR_SIZE_2x2));
slPageNbg2((void*)(_____CEL_ADR),(0),(PNB_1WORD));
slPlaneNbg2((PL_SIZE_1x1));
slMapNbg2((void*)(_____MAP_ADR),(void*)(_____MAP_ADR),(void*)(_____MAP_ADR),(void*)(_____MAP_ADR));
slDMACopy((void*)(__cel),(void*)(_____CEL_ADR),(Uint32)(DMA_S2D_CELSIZE(__x));
slDMACopy((void*)(__map),(void*)(_____MAP_ADR),(Uint32)(DMA_S2D_MAPSIZE(__y));
slDMACopy((void*)(__pal),(void*)(_____COL_ADR),(Uint32)(DMA_S2D_PALSIZE(__z));
}
int EpDMACopiedNbg1(void *__cel,Uint16 *__map,Uint16 *__pal,void *__x,void *__y,void *__z)
{
slCharNbg3((COL_TYPE_256),(CHAR_SIZE_2x2));
slPageNbg3((void*)(_____CEL_ADR),(0),(PNB_1WORD));
slPlaneNbg3((PL_SIZE_1x1));
slMapNbg3((void*)(_____MAP_ADR),(void*)(_____MAP_ADR),(void*)(_____MAP_ADR),(void*)(_____MAP_ADR));
slDMACopy((void*)(__cel),(void*)(_____CEL_ADR),(Uint32)(DMA_S2D_CELSIZE(__x));
slDMACopy((void*)(__map),(void*)(_____MAP_ADR),(Uint32)(DMA_S2D_MAPSIZE(__y));
slDMACopy((void*)(__pal),(void*)(_____COL_ADR),(Uint32)(DMA_S2D_PALSIZE(__z));
}
#undef
#endif