#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winb.h>
#include <te.h>
#include <fntb.h>
#include <gui.h>
#include <egb.h>
#include <guidbg.h>

//#include <eintm.h>
#include <wgb.h>
#include <mos.h>

#include <block.h>

extern char *guiEgbPtr ;
extern char *buffer ;
extern unsigned int dx,dy,xs,ys;
extern FRAME pf;

EGB_BLOCK block ;
EGB_BLOCK2 block2 ;

void userIdleTask(void)
{
	int btn,mx,my ;

	MOS_rdpos( &btn, &mx, &my );

//	if(pf.lupx<mx+32 && mx<pf.rdwx && pf.lupy<my+32 && my<pf.rdwy) return ;

	mx -= dx ;
	my -= dy ;
	block.x1 = mx ;
	block.y1 = my ;
	block.x2 = mx+xs ;
	block.y2 = my+ys ;
	EGB_writeMode( guiEgbPtr , 0 );	// 0 = PSET

//	MG_mosDisp(2);
	EGB_getBlock(guiEgbPtr,(char *)&block);
	WGB_putBlockZoom(guiEgbPtr,3,(char *)&block2);
//	MG_mosDisp(3);

	return ;
}
