emu.frameadvance() Executes a frame advance. Occurs by yielding the coroutine, then re-running when we break out.
| 496 | // Executes a frame advance. Occurs by yielding the coroutine, then re-running |
| 497 | // when we break out. |
| 498 | static 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() |
| 514 | static int emu_paused(lua_State *L) |
nothing calls this directly
no test coverage detected