#include <iocslib.h>
#include "defines.h"
#include "aiggraph.h"

void bg_to_graph(int page,int size,int pos)
{
unsint *bg,cch[16*16];
unint i,j;
static unsint ofst[4]={0,32,64*32,64*32+32};
	/* BG address */
	bg=(unsint *)(page==0? BG0RAM:BG1RAM)+ofst[pos];
	/* ＢＧ取り込み（６４＊６４中の３２＊３２のみ）*/
	for (i=0;i<32;i++) {
	    for (j=0;j<32;j++) {
		remake_pat(cch,size,B_WPEEK((unsint *)(bg+i*64+j)));
		gr64k(cch,j*size,i*size,size,size);
	    }
	}
}
