MCPcopy Create free account
hub / github.com/TASEmulators/fceux / emu_frameadvance

Function emu_frameadvance

src/lua-engine.cpp:498–511  ·  view source on GitHub ↗

emu.frameadvance() Executes a frame advance. Occurs by yielding the coroutine, then re-running when we break out.

Source from the content-addressed store, hash-verified

496// Executes a frame advance. Occurs by yielding the coroutine, then re-running
497// when we break out.
498static int emu_frameadvance(lua_State *L) {
499 // We're going to sleep for a frame-advance. Take notes.
500
501 if (frameAdvanceWaiting)
502 return luaL_error(L, "can't call emu.frameadvance() from here");
503
504 frameAdvanceWaiting = TRUE;
505
506 // Now we can yield to the main
507 return lua_yield(L, 0);
508
509
510 // It's actually rather disappointing...
511}
512
513// bool emu.paused()
514static int emu_paused(lua_State *L)

Callers

nothing calls this directly

Calls 2

luaL_errorFunction · 0.85
lua_yieldFunction · 0.85

Tested by

no test coverage detected