void EmuThread::run(void) { // NOTE: LibGens initialization is done elsewhere. // The emulation thread doesn't initialize anything; // it merely runs what's already been initialized. // Default to full frames. m_doFastFrame = false; // Run the emulation thread. m_mutex.lock(); while (!m_stop) { // Run a frame of emulation. if (!m_doFastFrame) gqt4_emuContext->execFrame(); else gqt4_emuContext->execFrameFast(); // Signal that the frame has been drawn. emit frameDone(m_doFastFrame); // Wait for a resume command. m_wait.wait(&m_mutex); } m_mutex.unlock(); }
bool BaseAppInput::runFrame(void) { //ideally, we would be using events. However, that tended to result in either segfaults or a hang when I tried it. *sigh* //so, we'll fake events on our own if (! handleKeyboard(NULL) || ! handleMouse()) { return false; } SDL_Event evt; while (SDL_PollEvent(&evt)) //need to make sure it's not null { if (!processEvent(&evt)) { return false; } } frameDone(); return true; }