lua: add debuggerloopstep

This commit is contained in:
zeromus 2017-05-15 17:21:58 +00:00
parent 6021ba627d
commit fca1c78925
2 changed files with 30 additions and 13 deletions

View File

@ -903,15 +903,14 @@ void _updateWindow()
//UpdateTasEditor(); //AnS: moved to FCEUD_Update
}
void win_debuggerLoop()
void win_debuggerLoopStep()
{
//delay until something causes us to unpause.
//either a hotkey or a debugger command
while(FCEUI_EmulationPaused() && !FCEUI_EmulationFrameStepped())
{
Sleep(50);
FCEUD_UpdateInput();
_updateWindow();
//question:
//should this go here, or in the loop?
// HACK: break when Frame Advance is pressed
extern bool frameAdvanceRequested;
extern int frameAdvance_Delay_count, frameAdvance_Delay;
@ -923,7 +922,16 @@ void win_debuggerLoop()
frameAdvance_Delay_count++;
}
}
int zzz=9;
void win_debuggerLoop()
{
//delay until something causes us to unpause.
//either a hotkey or a debugger command
while(FCEUI_EmulationPaused() && !FCEUI_EmulationFrameStepped())
{
Sleep(50);
win_debuggerLoopStep();
}
}
// Update the game and gamewindow with a new frame

View File

@ -407,6 +407,14 @@ static int emu_debuggerloop(lua_State *L) {
return 0;
}
static int emu_debuggerloopstep(lua_State *L) {
#ifdef WIN32
extern void win_debuggerLoopStep();
win_debuggerLoopStep();
#endif
return 0;
}
// emu.softreset()
//
// Executes a power cycle
@ -5547,6 +5555,7 @@ static const struct luaL_reg emulib [] = {
{"poweron", emu_poweron},
{"debuggerloop", emu_debuggerloop},
{"debuggerloopstep", emu_debuggerloopstep},
{"softreset", emu_softreset},
{"speedmode", emu_speedmode},
{"frameadvance", emu_frameadvance},