2 // This file is part of the PicoDrive Megadrive Emulator
\r
4 // Copyright (c) 2011 FinalDave (emudave (at) gmail.com)
\r
6 // This code is licensed under the GNU General Public License version 2.0 and the MAME License.
\r
7 // You can choose the license that has the most advantages for you.
\r
9 // SVN repository can be found at http://code.google.com/p/cyclone68000/
\r
14 static FILE *DebugFile=NULL;
\r
16 int WINAPI WinMain(HINSTANCE,HINSTANCE,LPTSTR,int)
\r
21 memset(&msg,0,sizeof(msg));
\r
22 memset(device,0,sizeof(device));
\r
24 // Check if this program is running already:
\r
25 FrameWnd=FindWindow(APP_TITLE,NULL);
\r
26 if (FrameWnd!=NULL) { SetForegroundWindow(FrameWnd); return 0; }
\r
28 DeleteFile(L"zout.txt");
\r
30 SystemParametersInfo(SPI_GETOEMINFO,sizeof(device)>>1,device,0);
\r
31 if (_wcsicmp(device,L"compaq ipaq h3800")==0) Main3800=1;
\r
38 WaveRate=44100; WaveLen=735;
\r
43 ret=PeekMessage(&msg,NULL,0,0,PM_REMOVE);
\r
46 if (msg.message==WM_QUIT) break;
\r
47 TranslateMessage(&msg);
\r
48 DispatchMessage(&msg);
\r
63 DestroyWindow(FrameWnd);
\r
65 if (DebugFile) fclose(DebugFile);
\r
70 extern "C" int dprintf(char *Format, ...)
\r
72 va_list VaList=NULL;
\r
73 va_start(VaList,Format);
\r
75 if (DebugFile==NULL) DebugFile=fopen("zout.txt","wt");
\r
76 if (DebugFile) vfprintf(DebugFile,Format,VaList);
\r