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 = 0;
\r
60 int is_40 = PicoGetStat(PS_40_CELL);
\r
63 if (is_40 != is_40_prev || !lock_to_1_1_prev)
\r
64 PostMessage(FrameWnd, WM_COMMAND, 0x20000 | (is_40 ? 1100 : 1101), 0);
\r
66 if (is_40 != is_40_prev)
\r
68 EmuScreenRect.left = is_40 ? 0 : 32;
\r
69 EmuScreenRect.right = is_40 ? 320 : 256+32;
\r
71 lock_to_1_1_prev = lock_to_1_1;
\r
84 while (!LoopQuit && LoopWait) { LoopWaiting=1; Sleep(100); }
\r
85 if (LoopQuit) break;
\r
102 // -------------------------------------------------------------------------------------
\r
105 extern "C" int dprintf(char *format, ...)
\r
111 name="d:\\zout.txt";
\r
116 if (DebugFile==NULL) DebugFile=fopen(name,"wt");
\r
117 if (DebugFile==NULL) return 1;
\r
119 fprintf(DebugFile, "%05i: ", emu_frame);
\r
120 va_start(val,format);
\r
121 vfprintf(DebugFile,format,val);
\r
122 fprintf(DebugFile, "\n");
\r
130 extern "C" int dprintf2(char *format, ...)
\r
135 va_start(val,format);
\r
136 vsprintf(str,format,val);
\r
138 OutputDebugString(str);
\r