int vCount = 0;


extern unsigned char supressCursor;
//Advance MAME 2X
//Create the pointer
//void (*pAdvMAME2x) () = NULL;
//Define the calling convention
void __cdecl AdvMAME2x();
//define the method



void AdvMAME2x() {
   TexScreen->LockRect( 0, &lockScreen, 0, 0L );
   SurfBuf = (BYTE*)lockScreen.pBits;
   pitch = lockScreen.Pitch;
   Mode7HiRes16b = 0;
   En2xSaI = 0;
   scanlines = 0;
   antienab = 0;
   hqFilter = 0;
   ScreenPtr=vidbuffer;
   ScreenPtr+=608;
   pitch = 1280; 
   En2xSaI = 0;
   SurfaceX = 320;
   SurfaceY = 240;
   SurfBufD=(DWORD) &EmuScreen[0];
   DrawWin320x240x16();
   AdvMame2x((unsigned char*)&EmuScreen[640], 1280,SurfBuf, lockScreen.Pitch, 320, 239);
   TexScreen->UnlockRect(0);
   Device->Clear( 0, NULL, D3DCLEAR_TARGET,0, 1.0f, 0L );
   //////dprintf("Draw Primitive\n");
   Device->DrawPrimitive(D3DPT_TRIANGLESTRIP,0,2);
  // ////dprintf("Present\n");
   //if(showAvailMemory) showMemory();
   Device->Present(NULL,NULL,NULL,NULL);  
   //////dprintf("Return from render\n");
   return;
}

extern int mX;
extern int mY;

//Define the calling convention
void __cdecl SuperScale();
//define the method
void SuperScale() {
	
   TexScreen->LockRect( 0, &lockScreen, 0, 0L );
   SurfBuf = (BYTE*)lockScreen.pBits;
   pitch = lockScreen.Pitch;
   Mode7HiRes16b = 0;
   En2xSaI = 0;
   scanlines = 0;
   antienab = 0;
   hqFilter = 0;
   ScreenPtr=vidbuffer;
   ScreenPtr+=608;
   pitch = 1280; 
   En2xSaI = 0;
   SurfaceX = 320;
   SurfaceY = 240;
   SurfBufD=(DWORD) &EmuScreen[0];
   DrawWin320x240x16();
   SuperScale(&EmuScreen[640], 640, (unsigned short*)SurfBuf, lockScreen.Pitch, 320, 239);
   TexScreen->UnlockRect(0);
   Device->Clear( 0, NULL, D3DCLEAR_ZBUFFER|D3DCLEAR_STENCIL, 0x00000000, 1.0f, 0L );
   Device->DrawPrimitive(D3DPT_TRIANGLESTRIP,0,2);
 //  if(showAvailMemory) showMemory();
   Device->Present(NULL,NULL,NULL,NULL);  
   return;
}

//Define the calling convention
void __cdecl SuperScale75();
//define the method
void SuperScale75() {
   TexScreen->LockRect( 0, &lockScreen, 0, 0L );
   SurfBuf = (BYTE*)lockScreen.pBits;
   pitch = lockScreen.Pitch;
   Mode7HiRes16b = 0;
   En2xSaI = 0;
   scanlines = 0;
   antienab = 0;
   hqFilter = 0;
   ScreenPtr=vidbuffer;
   ScreenPtr+=608;
   pitch = 1280; 
   En2xSaI = 0;
   SurfaceX = 320;
   SurfaceY = 240;
   SurfBufD=(DWORD) &EmuScreen[0];
   DrawWin320x240x16();
   SuperScale75(&EmuScreen[640], 640, (unsigned short*)SurfBuf, lockScreen.Pitch,  320, 239);
   //////dprintf("Unlock\n");
   TexScreen->UnlockRect(0);
   Device->Clear( 0, NULL, D3DCLEAR_TARGET,0, 1.0f, 0L );
   //////dprintf("Draw Primitive\n");
   Device->DrawPrimitive(D3DPT_TRIANGLESTRIP,0,2);
  // ////dprintf("Present\n");
 //  if(showAvailMemory) showMemory();
   Device->Present(NULL,NULL,NULL,NULL);  
   //////dprintf("Return from render\n");
   return;
}

//Define the calling convention
void __cdecl SuperScaleHQM7();
//define the method
void SuperScaleHQM7() {
   TexScreen->LockRect( 0, &lockScreen, 0, 0L );
   SurfBuf = (BYTE*)lockScreen.pBits;
   pitch = lockScreen.Pitch;
   Mode7HiRes16b = 1;
   En2xSaI = 0;
   scanlines = 0;
   antienab = 0;
   hqFilter = 0;
   ScreenPtr=vidbuffer;
   ScreenPtr+=608;
   pitch = 1280; 
   En2xSaI = 0;
   SurfaceX = 320;
   SurfaceY = 240;
   SurfBufD=(DWORD) &EmuScreen[0];
   DrawWin320x240x16();
   SuperScale(&EmuScreen[640], 640, (unsigned short*)SurfBuf, lockScreen.Pitch, 320, 239);
   TexScreen->UnlockRect(0);
   Device->Clear( 0, NULL, D3DCLEAR_TARGET,0, 1.0f, 0L );
   //////dprintf("Draw Primitive\n");
   Device->DrawPrimitive(D3DPT_TRIANGLESTRIP,0,2);
  // ////dprintf("Present\n");
  // if(showAvailMemory) showMemory();
   Device->Present(NULL,NULL,NULL,NULL);  
   //////dprintf("Return from render\n");
   return;
}

//Define the calling convention
void __cdecl SuperScale75HQM7();
//define the method
void SuperScale75HQM7() {
   TexScreen->LockRect( 0, &lockScreen, 0, 0L );
   SurfBuf = (BYTE*)lockScreen.pBits;
   pitch = lockScreen.Pitch;
   Mode7HiRes16b = 1;
   En2xSaI = 0;
   scanlines = 0;
   antienab = 0;
   hqFilter = 0;
   ScreenPtr=vidbuffer;
   ScreenPtr+=608;
   pitch = 1280; 
   En2xSaI = 0;
   SurfaceX = 320;
   SurfaceY = 240;
   SurfBufD=(DWORD) &EmuScreen[0];
   DrawWin320x240x16();
  SuperScale75(&EmuScreen[640], 640, (unsigned short*)SurfBuf, lockScreen.Pitch, 320, 239);
   //////dprintf("Unlock\n");
   TexScreen->UnlockRect(0);
   Device->Clear( 0, NULL, D3DCLEAR_TARGET,0, 1.0f, 0L );
   //////dprintf("Draw Primitive\n");
   Device->DrawPrimitive(D3DPT_TRIANGLESTRIP,0,2);
  // ////dprintf("Present\n");
  // if(showAvailMemory) showMemory();
   Device->Present(NULL,NULL,NULL,NULL);  
   //////dprintf("Return from render\n");
   return;
}

//Simple 2X
//Create the pointer
//void (*pSimple2x) () = NULL;
//Define the calling convention
void __cdecl Simple2x();
//define the method
void Simple2x() {
            TexScreen->LockRect( 0, &lockScreen, 0, 0L );
			SurfBuf = (BYTE*)lockScreen.pBits;
			pitch = lockScreen.Pitch;
			Mode7HiRes16b = 0;
			En2xSaI = 0;
			scanlines = 0;
			hqFilter = 0;
			antienab = 0;
			ScreenPtr=vidbuffer;
			ScreenPtr+=608;
			pitch = 1280; 
			En2xSaI = 0;
			SurfaceX = 320;
			SurfaceY = 240;
			SurfBufD=(DWORD) &EmuScreen[0];
			DrawWin320x240x16();
			nSimple2x((unsigned char*)&EmuScreen[0], 1280, 0,
				SurfBuf, lockScreen.Pitch, 320, 240);	
			TexScreen->UnlockRect(0);
			Device->Clear( 0, NULL, D3DCLEAR_TARGET,0, 1.0f, 0L );
			Device->DrawPrimitive(D3DPT_TRIANGLESTRIP,0,2);
			//if(showAvailMemory) showMemory();
			Device->Present(NULL,NULL,NULL,NULL);  
			return;
}

void __cdecl Super2xSai();
//define the method
void Super2xSai() {
            TexScreen->LockRect( 0, &lockScreen, 0, 0L );
			SurfBuf = (BYTE*)lockScreen.pBits;
			pitch = lockScreen.Pitch;
			Mode7HiRes16b = 0;
			En2xSaI = 3;
			scanlines = 0;
			hqFilter = 0;
			antienab = 0;
			AddEndBytes=pitch-1024;
			NumBytesPerLine=pitch;
			WinVidMemStart= &SurfBuf[(240-resolutn)*pitch+64*2];
			asm_call(copy640x480x16bwin);
			TexScreen->UnlockRect(0);
			Device->Clear( 0, NULL, D3DCLEAR_TARGET,0, 1.0f, 0L );
			Device->DrawPrimitive(D3DPT_TRIANGLESTRIP,0,2);
			//if(showAvailMemory) showMemory();
			Device->Present(NULL,NULL,NULL,NULL);  
			return;
}

void __cdecl NoFilter();
//define the method
void NoFilter() {
            TexScreen->LockRect( 0, &lockScreen, 0, 0L );
			SurfBuf = (BYTE*)lockScreen.pBits;
			pitch = lockScreen.Pitch;
			Mode7HiRes16b = 0;
			En2xSaI = 0;
			scanlines = 0;
			hqFilter = 0;
			antienab = 0;
			AddEndBytes=pitch-1024;
			NumBytesPerLine=pitch;
			WinVidMemStart= &SurfBuf[(240-resolutn)*pitch+64*2];
			asm_call(copy640x480x16bwin);
			TexScreen->UnlockRect(0);
			Device->Clear( 0, NULL, D3DCLEAR_TARGET,0, 1.0f, 0L );
			Device->DrawPrimitive(D3DPT_TRIANGLESTRIP,0,2);
			//if(showAvailMemory) showMemory();
			Device->Present(NULL,NULL,NULL,NULL);  
			return;
}
//assign the pointer
//pNoFilter = &NoFilter;


//No filter 25 Scanlines
//Create the pointer
void (*pNoFilter25) () = NULL;
//Define the calling convention
//void __cdecl NoFilter25();
//define the method
void NoFilter25() {
            TexScreen->LockRect( 0, &lockScreen, 0, 0L );
			SurfBuf = (BYTE*)lockScreen.pBits;
			pitch = lockScreen.Pitch;
			Mode7HiRes16b = 0;
			En2xSaI = 0;
			scanlines = 2;
			hqFilter = 0;
			antienab = 0;
			AddEndBytes=pitch-1024;
			NumBytesPerLine=pitch;
			WinVidMemStart= &SurfBuf[(240-resolutn)*pitch+64*2];
			asm_call(copy640x480x16bwin);
			TexScreen->UnlockRect(0);
			Device->Clear( 0, NULL, D3DCLEAR_TARGET,0, 1.0f, 0L );
			Device->DrawPrimitive(D3DPT_TRIANGLESTRIP,0,2);
			//if(showAvailMemory) showMemory();
			Device->Present(NULL,NULL,NULL,NULL);  
			return;
}
//assign the pointer
//pNoFilter25 = &NoFilter25;


//No filter 50 Scanlines
//Create the pointer
//void (*pNoFilter50) () = NULL;
//Define the calling convention
void __cdecl NoFilter50();
//define the method
void NoFilter50() {
            TexScreen->LockRect( 0, &lockScreen, 0, 0L );
			SurfBuf = (BYTE*)lockScreen.pBits;
			pitch = lockScreen.Pitch;
			Mode7HiRes16b = 0;
			En2xSaI = 0;
			scanlines = 3;
			hqFilter = 0;
			antienab = 0;
			AddEndBytes=pitch-1024;
			NumBytesPerLine=pitch;
			WinVidMemStart= &SurfBuf[(240-resolutn)*pitch+64*2];
			asm_call(copy640x480x16bwin);
			TexScreen->UnlockRect(0);
			Device->Clear( 0, NULL, D3DCLEAR_TARGET,0, 1.0f, 0L );
			Device->DrawPrimitive(D3DPT_TRIANGLESTRIP,0,2);
			//if(showAvailMemory) showMemory();
			Device->Present(NULL,NULL,NULL,NULL);  
			return;
}
//assign the pointer
//pNoFilter50 = &NoFilter50;

//No filter 50 Scanlines
//Create the pointer
//void (*pNoFilter100) () = NULL;
//Define the calling convention
void __cdecl NoFilter100();
//define the method
void NoFilter100() {
            TexScreen->LockRect( 0, &lockScreen, 0, 0L );
			SurfBuf = (BYTE*)lockScreen.pBits;
			pitch = lockScreen.Pitch;
			Mode7HiRes16b = 0;
			En2xSaI = 0;
			scanlines = 1;
			hqFilter = 0;
			antienab = 0;
			AddEndBytes=pitch-1024;
			NumBytesPerLine=pitch;
			WinVidMemStart= &SurfBuf[(240-resolutn)*pitch+64*2];
			asm_call(copy640x480x16bwin);
			TexScreen->UnlockRect(0);
			Device->Clear( 0, NULL, D3DCLEAR_TARGET,0, 1.0f, 0L );
			Device->DrawPrimitive(D3DPT_TRIANGLESTRIP,0,2);
			//if(showAvailMemory) showMemory();
			Device->Present(NULL,NULL,NULL,NULL);  
			return;
}
//assign the pointer
//pNoFilter100 = &NoFilter100;


//Interpolation
//Create the pointer
//void (*pInterpolation) () = NULL;
//Define the calling convention
void __cdecl Intepolation();
//define the method
void Interpolation() {
            TexScreen->LockRect( 0, &lockScreen, 0, 0L );
			SurfBuf = (BYTE*)lockScreen.pBits;
			pitch = lockScreen.Pitch;
			Mode7HiRes16b = 0;
			En2xSaI = 0;
			scanlines = 0;
			hqFilter = 0;
			antienab = 1;
			AddEndBytes=pitch-1024;
			NumBytesPerLine=pitch;
			WinVidMemStart= &SurfBuf[(240-resolutn)*pitch+64*2];
			asm_call(copy640x480x16bwin);
			TexScreen->UnlockRect(0);
			Device->Clear( 0, NULL, D3DCLEAR_TARGET,0, 1.0f, 0L );
			Device->DrawPrimitive(D3DPT_TRIANGLESTRIP,0,2);
			//if(showAvailMemory) showMemory();
			Device->Present(NULL,NULL,NULL,NULL);  
			return;
}
//assign the pointer
//pInterpolation = &Interpolation;


//Interpolation 25 scanlines
//Create the pointer
//void (*pInterpolation25) () = NULL;
//Define the calling convention
void __cdecl Intepolation25();
//define the method
void Interpolation25() {
            TexScreen->LockRect( 0, &lockScreen, 0, 0L );
			SurfBuf = (BYTE*)lockScreen.pBits;
			pitch = lockScreen.Pitch;
			Mode7HiRes16b = 0;
			En2xSaI = 0;
			scanlines = 2;
			hqFilter = 0;
			antienab = 1;
			AddEndBytes=pitch-1024;
			NumBytesPerLine=pitch;
			WinVidMemStart= &SurfBuf[(240-resolutn)*pitch+64*2];
			asm_call(copy640x480x16bwin);
			TexScreen->UnlockRect(0);
			Device->Clear( 0, NULL, D3DCLEAR_TARGET,0, 1.0f, 0L );
			Device->DrawPrimitive(D3DPT_TRIANGLESTRIP,0,2);
			//if(showAvailMemory) showMemory();
			Device->Present(NULL,NULL,NULL,NULL);  
			return;
}
//assign the pointer
//pInterpolation25 = &Interpolation25;

//Interpolation 50 scanlines
//Create the pointer
//void (*pInterpolation50) () = NULL;
//Define the calling convention
void __cdecl Intepolation50();
//define the method
void Interpolation50() {
            TexScreen->LockRect( 0, &lockScreen, 0, 0L );
			SurfBuf = (BYTE*)lockScreen.pBits;
			pitch = lockScreen.Pitch;
			Mode7HiRes16b = 0;
			En2xSaI = 0;
			scanlines = 3;
			hqFilter = 0;
			antienab = 1;
			AddEndBytes=pitch-1024;
			NumBytesPerLine=pitch;
			WinVidMemStart= &SurfBuf[(240-resolutn)*pitch+64*2];
			asm_call(copy640x480x16bwin);
			TexScreen->UnlockRect(0);
			Device->Clear( 0, NULL, D3DCLEAR_TARGET,0, 1.0f, 0L );
			Device->DrawPrimitive(D3DPT_TRIANGLESTRIP,0,2);
			//if(showAvailMemory) showMemory();
			Device->Present(NULL,NULL,NULL,NULL);  
			return;
}
//assign the pointer
//pInterpolation50 = &Interpolation50;


//Interpolation 100 scanlines
//Create the pointer
//void (*pInterpolation100) () = NULL;
//Define the calling convention
void __cdecl Intepolation100();
//define the method
void Interpolation100() {
            TexScreen->LockRect( 0, &lockScreen, 0, 0L );
			SurfBuf = (BYTE*)lockScreen.pBits;
			pitch = lockScreen.Pitch;
			En2xSaI = 0;
			scanlines = 1;
			hqFilter = 0;
			antienab = 1;
			AddEndBytes=pitch-1024;
			NumBytesPerLine=pitch;
			WinVidMemStart= &SurfBuf[(240-resolutn)*pitch+64*2];
			asm_call(copy640x480x16bwin);
			TexScreen->UnlockRect(0);
			Device->Clear( 0, NULL, D3DCLEAR_TARGET,0, 1.0f, 0L );
			Device->DrawPrimitive(D3DPT_TRIANGLESTRIP,0,2);
			//if(showAvailMemory) showMemory();
			Device->Present(NULL,NULL,NULL,NULL);  
			return;
}
//assign the pointer
//pInterpolation100 = &Interpolation100;

//2X Sai
//Create the pointer
//void (*pxSai) () = NULL;
//Define the calling convention
void __cdecl xSai();
//define the method
void xSai() {
            TexScreen->LockRect( 0, &lockScreen, 0, 0L );
			SurfBuf = (BYTE*)lockScreen.pBits;
			pitch = lockScreen.Pitch;
			Mode7HiRes16b = 0;
			En2xSaI = 2;
			scanlines = 0;
			hqFilter = 0;
			antienab = 0;
			AddEndBytes=pitch-1024;
			NumBytesPerLine=pitch;
			WinVidMemStart= &SurfBuf[(240-resolutn)*pitch+64*2];
			asm_call(copy640x480x16bwin);
			TexScreen->UnlockRect(0);
			Device->Clear( 0, NULL, D3DCLEAR_TARGET,0, 1.0f, 0L );
			Device->DrawPrimitive(D3DPT_TRIANGLESTRIP,0,2);
			//if(showAvailMemory) showMemory();
			Device->Present(NULL,NULL,NULL,NULL);  
			return;
}
//assign the pointer
//pxSai = &xSai;


//Super Eagle
//Create the pointer
//void (*pSuperEagle) () = NULL;
//Define the calling convention
void __cdecl SuperEagle();
//define the method
void SuperEagle() {
            TexScreen->LockRect( 0, &lockScreen, 0, 0L );
			SurfBuf = (BYTE*)lockScreen.pBits;
			pitch = lockScreen.Pitch;
			Mode7HiRes16b = 0;
			En2xSaI = 1;
			scanlines = 0;
			hqFilter = 0;
			antienab = 0;
			AddEndBytes=pitch-1024;
			NumBytesPerLine=pitch;
			WinVidMemStart= &SurfBuf[(240-resolutn)*pitch+64*2];
			asm_call(copy640x480x16bwin);
			TexScreen->UnlockRect(0);
			Device->Clear( 0, NULL, D3DCLEAR_TARGET,0, 1.0f, 0L );
			Device->DrawPrimitive(D3DPT_TRIANGLESTRIP,0,2);
			//if(showAvailMemory) showMemory();
			Device->Present(NULL,NULL,NULL,NULL);  
			return;
}
//assign the pointer
//pSuperEagle = &SuerEagle;

//No filter
//Create the pointer
//void (*pHQM7) () = NULL;
//Define the calling convention
void __cdecl HQM7();
//define the method
void HQM7() {
            TexScreen->LockRect( 0, &lockScreen, 0, 0L );
			SurfBuf = (BYTE*)lockScreen.pBits;
			pitch = lockScreen.Pitch;
			Mode7HiRes16b = 1;
			En2xSaI = 0;
			scanlines = 0;
			hqFilter = 0;
			antienab = 0;
			AddEndBytes=pitch-1024;
			NumBytesPerLine=pitch;
			WinVidMemStart= &SurfBuf[(240-resolutn)*pitch+64*2];
			asm_call(copy640x480x16bwin);
			TexScreen->UnlockRect(0);
			Device->Clear( 0, NULL, D3DCLEAR_TARGET,0, 1.0f, 0L );
			Device->DrawPrimitive(D3DPT_TRIANGLESTRIP,0,2);
			//if(showAvailMemory) showMemory();
			Device->Present(NULL,NULL,NULL,NULL);  
			return;
}
//assign the pointer
//pHQM7 = &HQM7;

//Advance MAME 2X + HQM7
//Create the pointer
//void (*pAdvMAME2XHQM7) () = NULL;
//Define the calling convention
void __cdecl AdvMAME2XHQM7();
//define the method

void AdvMAME2XHQM7() {
           
				
	
	       TexScreen->LockRect( 0, &lockScreen, 0, 0L );
			SurfBuf = (BYTE*)lockScreen.pBits;
			pitch = lockScreen.Pitch;
			Mode7HiRes16b = 1;
			En2xSaI = 0;
			scanlines = 0;
			antienab = 0;
			hqFilter = 0;
			ScreenPtr=vidbuffer;
			ScreenPtr+=608;//(16*2)+(32*2)+(256*2); 32 + 64 + 512
			pitch = 1280; 
			En2xSaI = 0;
			SurfaceX = 320;
			SurfaceY = 240;
			SurfBufD=(DWORD) &EmuScreen[0];
			DrawWin320x240x16();
			AdvMame2x((unsigned char*)&EmuScreen[640], 1280,
				SurfBuf, lockScreen.Pitch, 320, 239);
			TexScreen->UnlockRect(0);
			Device->Clear( 0, NULL, D3DCLEAR_TARGET,0, 1.0f, 0L );
			Device->DrawPrimitive(D3DPT_TRIANGLESTRIP,0,2);
			//if(showAvailMemory) showMemory();
			Device->Present(NULL,NULL,NULL,NULL);  
			
			

			return;
}
//assign the pointer
//pAdvMAME2XHQM7 = &AdvMAME2XHQM7;


//Simple 2X + HQM7
//Create the pointer
//void (*pSimple2XHQM7) () = NULL;
//Define the calling convention
void __cdecl Simple2XHQM7();
//define the method
void Simple2XHQM7() {
            TexScreen->LockRect( 0, &lockScreen, 0, 0L );
			SurfBuf = (BYTE*)lockScreen.pBits;
			pitch = lockScreen.Pitch;
			Mode7HiRes16b = 1;
			En2xSaI = 0;
			scanlines = 0;
			hqFilter = 0;
			antienab = 0;
			ScreenPtr=vidbuffer;
			ScreenPtr+=16*2+32*2+256*2;
			pitch = 1280; 
			En2xSaI = 0;
			SurfaceX = 320;
			SurfaceY = 240;
			SurfBufD=(DWORD) &EmuScreen[0];
			DrawWin320x240x16();
			nSimple2x((unsigned char*)&EmuScreen[0], 1280, 0,
				SurfBuf, lockScreen.Pitch, 320, 240);	
			TexScreen->UnlockRect(0);
			Device->Clear( 0, NULL, D3DCLEAR_TARGET,0, 1.0f, 0L );
			Device->DrawPrimitive(D3DPT_TRIANGLESTRIP,0,2);
			//if(showAvailMemory) showMemory();
			Device->Present(NULL,NULL,NULL,NULL);  
			return;
}
//assign the pointer
//pSimple2XHQM7 = &Simple2XHQM7;


//HQ2X
//Create the pointer
//void (*pHQ2X) () = NULL;
//Define the calling convention
void __cdecl HQ2X();
//define the method
void HQ2X() {
			Mode7HiRes16b = 0;
			En2xSaI = 0;
			scanlines = 0;
			antienab = 0;
			hqFilter = 1;
			SurfaceX = 512;
			SurfaceY = 448;
			BitDepth = 16;
            TexScreen->LockRect( 0, &lockScreen, 0, 0L );
			SurfBuf = (BYTE*)lockScreen.pBits;
			pitch = lockScreen.Pitch;
			NumBytesPerLine = pitch;
			AddEndBytes = pitch - 1024;
			WinVidMemStart=&SurfBuf[(240-resolutn)*pitch+128];
			hq2x_16b();
			TexScreen->UnlockRect(0);
			Device->Clear( 0, NULL, D3DCLEAR_TARGET,0, 1.0f, 0L );
			Device->DrawPrimitive(D3DPT_TRIANGLESTRIP,0,2);
			//if(showAvailMemory) showMemory();
			Device->Present(NULL,NULL,NULL,NULL);  
			return;			
}

void (*renderMethod[21])() = {NULL};

void setRender() {
	renderMethod[11] = &AdvMAME2x;// - 11
	renderMethod[12] = &Simple2x;// - 12
	renderMethod[10] = &Super2xSai;// - 10
	renderMethod[0] = &NoFilter;// - 0
	renderMethod[1] = &NoFilter25;// - 1
	renderMethod[2] = &NoFilter50;// - 2
	renderMethod[3] = &NoFilter100;// - 3
	renderMethod[4] = &Interpolation;// - 4
	renderMethod[5] = &Interpolation25;// - 5
	renderMethod[6] = &Interpolation50;// - 6
	renderMethod[7] = &Interpolation100;// - 7
	renderMethod[9] = &xSai;// - 9
	renderMethod[8] = &SuperEagle;// - 8
	renderMethod[13] = &HQM7;// - 13
	renderMethod[15] = &AdvMAME2XHQM7;// - 15
	renderMethod[14] = &Simple2XHQM7;// - 14
	renderMethod[16] = &HQ2X;// - 16
	renderMethod[17] = &SuperScale;// - 16
	renderMethod[18] = &SuperScale75;// - 16
	renderMethod[19] = &SuperScaleHQM7;// - 16
	renderMethod[20] = &SuperScale75HQM7;// - 16
}


