From 2598967d56fd1d8abbcd335ba7684b684d9dc389 Mon Sep 17 00:00:00 2001 From: pjgat09 Date: Tue, 30 Apr 2013 01:14:07 +0000 Subject: [PATCH] m64p: Start the emulator paused N64: Wait for the emulator to start up before returning from the constructor. --- .../Consoles/Nintendo/N64/N64.cs | 13 +++++++++++++ .../output/dll/mupen64plus.dll | Bin 423424 -> 423424 bytes .../mupen64plus-core/src/r4300/r4300.c | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/BizHawk.Emulation/Consoles/Nintendo/N64/N64.cs b/BizHawk.Emulation/Consoles/Nintendo/N64/N64.cs index 73d50efcb4..6bd2dfdd11 100644 --- a/BizHawk.Emulation/Consoles/Nintendo/N64/N64.cs +++ b/BizHawk.Emulation/Consoles/Nintendo/N64/N64.cs @@ -161,6 +161,13 @@ namespace BizHawk.Emulation.Consoles.Nintendo.N64 M64CMD_ADVANCE_FRAME }; + enum m64p_emu_state + { + M64EMU_STOPPED = 1, + M64EMU_RUNNING, + M64EMU_PAUSED + }; + //[DllImport(@"..\..\libmupen64plus\mupen64plus-ui-console\projects\msvc11\Release\mupen64plus.dll", CallingConvention = CallingConvention.Cdecl)] //static extern m64p_error CoreStartup(int APIVersion, string ConfigPath, string DataPath, string context, DebugCallback DebugCallback, string context2, IntPtr bar); @@ -267,6 +274,12 @@ namespace BizHawk.Emulation.Consoles.Nintendo.N64 m64pEmulator = new Thread(ExecuteEmulator); m64pEmulator.Start(); + + int state = -1; + do + { + m64pCoreDoCommandRefInt(m64p_command.M64CMD_CORE_STATE_QUERY, 1, ref state); + } while (state != (int)m64p_emu_state.M64EMU_PAUSED); } public void ExecuteEmulator() diff --git a/BizHawk.MultiClient/output/dll/mupen64plus.dll b/BizHawk.MultiClient/output/dll/mupen64plus.dll index 8dd04b00623b2eba196b4c2579466059ada3bf57..8436fb01ff2a7d0ac5c8d2d0a021e88e924e8d72 100644 GIT binary patch delta 358 zcmZp8BiZmqa)SUPbC5*+WMM{MrY#?vlNj5R7(tk6dlDlvvzGjRMg|6kPSXo5odTVv zSHR?xc22=g(~ho4!A{%h_1esm*7^qj{x3WLl(arpDxa}s4vRn*^9!q+fBrWg;pj94 zNxYa-{Qv*Uvp}<&e=rsKWjuhW5xY5EQHNQ4la~flkvaVDd>j zr(maPM^_|}Z0U~_JkGkLJ5tbrfnmvU)&)RTdM78t3loEX{}&zrs<%E?Dxa}s4vRn* z^9%c%fBrWg;pj94NxWEC{Qv*UOAHJQ%|Dom{4yRu)JOx>WH2xYFc=@mV%!O0?4Pcn z#LQ`SoE4;t38?<_>KA*s7#T7c%$WsVXcPhsI3m%=+5mJ=3sClTRR+&ouyto|{P{m! zP>ET>6{43BqBjqyxA}<3an=by9S%TeznJvt|Nn(6fKInGC<*B11)0