private void WaitForBreakpoint() { //WiiStatus status; BPHit = false; try { while (!cancelled && !BPHit) { Thread.Sleep(100); // Why 100 ms? //status = gecko.status(); if (gecko.BreakpointHit()) { BPSet = false; BPHit = true; //status = gecko.status(); } } gecko.CancelBreakpoint(); //gecko.status(); if (BPHit) { MemoryStream regStream = new MemoryStream(); gecko.GetRegisters(regStream, contextAddress); if (!conditions.Check(regStream, bpType, bpAddress, gecko)) { PSkipCount++; InvokeSkip(); regStream.Close(); regStream.Dispose(); SetActualBP(); WaitForBreakpoint(); // WARNING: RECURSION return; } cancelled = true; InvokeGetRegisters(regStream); } if (PBPStop != null) { InvokePBPStop(); } } catch (ETCPGeckoException e) { if (PBPStop != null) { InvokePBPStop(); } exceptionHandling.HandleException(e); } }