diff --git a/Core/LuaApi.cpp b/Core/LuaApi.cpp index 8c590199..f41a2cfb 100644 --- a/Core/LuaApi.cpp +++ b/Core/LuaApi.cpp @@ -87,6 +87,8 @@ int LuaApi::GetLibrary(lua_State *lua) { "reset", LuaApi::Reset }, { "stop", LuaApi::Stop }, { "breakExecution", LuaApi::Break }, + { "stepOver", LuaApi::StepOver }, + { "stepOut", LuaApi::StepOut }, { "resume", LuaApi::Resume }, { "execute", LuaApi::Execute }, { "rewind", LuaApi::Rewind }, @@ -585,6 +587,24 @@ int LuaApi::Execute(lua_State *lua) return l.ReturnCount(); } +int LuaApi::StepOut(lua_State* lua) +{ + LuaCallHelper l(lua); + checkparams(); + checkinitdone(); + _debugger->StepOut(); + return l.ReturnCount(); +} + +int LuaApi::StepOver(lua_State* lua) +{ + LuaCallHelper l(lua); + checkparams(); + checkinitdone(); + _debugger->StepOver(); + return l.ReturnCount(); +} + int LuaApi::Rewind(lua_State *lua) { LuaCallHelper l(lua); diff --git a/Core/LuaApi.h b/Core/LuaApi.h index f4c7e659..dee03815 100644 --- a/Core/LuaApi.h +++ b/Core/LuaApi.h @@ -49,6 +49,8 @@ public: static int Break(lua_State *lua); static int Resume(lua_State *lua); static int Execute(lua_State *lua); + static int StepOut(lua_State* lua); + static int StepOver(lua_State* lua); static int Rewind(lua_State *lua); static int TakeScreenshot(lua_State *lua); diff --git a/GUI.NET/Debugger/frmScript.cs b/GUI.NET/Debugger/frmScript.cs index ee5fd973..ace1019d 100644 --- a/GUI.NET/Debugger/frmScript.cs +++ b/GUI.NET/Debugger/frmScript.cs @@ -535,6 +535,8 @@ namespace Mesen.GUI.Debugger new List {"func","emu.breakExecution","emu.breakExecution()","","","Breaks the execution of the game and displays the debugger window."}, new List {"func","emu.stop","emu.stop()","","","Stops execution of the game."}, new List {"func","emu.execute","emu.execute(count, type)","count - *Integer* The number of cycles or instructions to run before breaking\ntype - *Enum* See executeCountType","","Runs the emulator for the specified number of cycles/instructions and then breaks the execution."}, + new List {"func","emu.stepOver", "emu.stepOver()", "","","Step over the next instruction."}, + new List {"func","emu.stepOut", "emu.stepOut()", "","","Step out of the subroutine."}, new List {"func","emu.reset","emu.reset()","","","Resets the current game."}, new List {"func","emu.resume","emu.resume()","","","Resumes execution after breaking."}, new List {"func","emu.rewind","emu.rewind(seconds)","seconds - *Integer* The number of seconds to rewind","","Instantly rewinds the emulation by the number of seconds specified.\n Note: this can only be called from within a 'StartFrame' event callback."},