
	uint32		 startTime, endTime, totalFrames;
	unsigned int nNormalLast=0;
	int			 nNormalFrac=0; 
	int			 nTime=0,nCount=0; int i=0;
	//int			surfacePitch;
	int			pre_rotated=app_rotated;

	// 15 bits RGB555
	//Format format(16,0x007c00,0x00003e0,0x0000001f);
	//Console console;
	//Surface *surface;
	//Area *src_area;
	//Area *dst_area;
	//Surface *segments;

	//src_area=new Area(0,0,144*video_scale,(224+INDICATOR_WIDTH)*video_scale);
	//dst_area=new Area(0,INDICATOR_WIDTH*video_scale,144*video_scale,(224+INDICATOR_WIDTH)*video_scale);
	//segments=new Surface(INDICATOR_WIDTH*video_scale,144*video_scale,format);
	//surface=new Surface(224*video_scale,144*video_scale,format);

	//int16 *backbuffer=(int16*)malloc(224*144*sizeof(int16));
	//memset(backbuffer,0x00,224*144*sizeof(int16));
	//surfacePitch=(surface->pitch()>>1);
	//console.option("DirectX");
	//if (app_fullscreen) 
		//console.option("fullscreen output"); 
	//else 
		//console.option("windowed output");
	//console.option("fixed window");
	//console.option("center window");
	totalFrames=0;
	startTime=clock();
	nNormalLast=0;// Last value of timeGetTime()
	nNormalFrac=0; // Extra fraction we did
	nNormalLast=timeGetTime();
	// filter change
	//if (gui_command==GUI_COMMAND_FILTER_CHANGE)
	//{
		//ws_loadState("oswan.wss");
		//unlink("oswan.wss");
	//}

	//console.open(app_window_title,(224+INDICATOR_WIDTH)*video_scale,144*video_scale,format);
	
	while (1)
	{
#if 0
		if(ws_ioRam[0x15]&6)
			app_rotated=(ws_ioRam[0x15]>>1)&1;
		else
			app_rotated=ws_rotated();
#endif
		if(app_rotated!=pre_rotated)
		{
			//delete surface;
			//console.close();
			pre_rotated=app_rotated;
			if(app_rotated)
			{
				//surface=new Surface(144*video_scale,224*video_scale,format);
				#include "filter_partB.h"
				//console.open(app_window_title,144*video_scale,(224+INDICATOR_WIDTH)*video_scale,format);
			}
			else
			{
				//surface=new Surface(224*video_scale,144*video_scale,format);
				#include "filter_partB.h"
				//console.open(app_window_title,(224+INDICATOR_WIDTH)*video_scale,144*video_scale,format);
			}
		}