2 //#include "FileMenu.h"
\r
4 char LoopQuit=0,LoopWait=0,LoopWaiting=0;
\r
5 static FILE *DebugFile=NULL;
\r
7 static void UpdateSound(int len);
\r
14 // enable_ym2612&dac, enable_sn76496, enable_z80, stereo_sound;
\r
15 // alt_renderer, 6button_gamepad, accurate_timing, accurate_sprites
\r
20 ret=DirectInit(); if (ret) { error("DirectX video init failed"); return 1; }
\r
23 // Init DirectSound:
\r
26 ret=EmuInit(); if (ret) return 1;
\r
29 PicoWriteSound = UpdateSound;
\r
30 PicoAutoRgnOrder = 0x184;
\r
35 extern "C" char *debugString();
\r
39 dprintf(debugString());
\r
45 if (DebugFile) fclose(DebugFile);
\r
49 // ----------------------------------------------------------------
\r
51 static void UpdateSound(int len)
\r
53 while (DSoundUpdate() > 0) { Sleep(1); }
\r
54 //while (DSoundUpdate()== 0) { }
\r
57 static void PostProcess()
\r
59 static int lock_to_1_1_prev = 0, is_40_prev = -1;
\r
61 PicoGetInternal(PI_IS40_CELL, (pint_ret_t *)&is_40);
\r
64 if (is_40 != is_40_prev || !lock_to_1_1_prev)
\r
65 PostMessage(FrameWnd, WM_COMMAND, 0x20000 | (is_40 ? 1100 : 1101), 0);
\r
67 if (is_40 != is_40_prev)
\r
69 EmuScreenRect.left = is_40 ? 0 : 32;
\r
70 EmuScreenRect.right = is_40 ? 320 : 256+32;
\r
72 lock_to_1_1_prev = lock_to_1_1;
\r
85 while (!LoopQuit && LoopWait) { LoopWaiting=1; Sleep(100); }
\r
86 if (LoopQuit) break;
\r
103 // -------------------------------------------------------------------------------------
\r
106 extern "C" int dprintf(char *format, ...)
\r
112 name="d:\\zout.txt";
\r
117 if (DebugFile==NULL) DebugFile=fopen(name,"wt");
\r
118 if (DebugFile==NULL) return 1;
\r
120 fprintf(DebugFile, "%05i: ", emu_frame);
\r
121 va_start(val,format);
\r
122 vfprintf(DebugFile,format,val);
\r
123 fprintf(DebugFile, "\n");
\r
131 extern "C" int lprintf(char *format, ...)
\r
136 va_start(val,format);
\r
137 vsprintf(str,format,val);
\r
139 OutputDebugString(str);
\r