m64p: Start the emulator paused

N64: Wait for the emulator to start up before returning from the constructor.
This commit is contained in:
pjgat09 2013-04-30 01:14:07 +00:00
parent 0c23357d60
commit 2598967d56
3 changed files with 14 additions and 1 deletions

View File

@ -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()

View File

@ -985,7 +985,7 @@ void r4300_execute(void)
debug_count = 0;
delay_slot=0;
stop = 0;
rompause = 0;
rompause = 1;
/* clear instruction counters */
#if defined(COUNT_INSTR)