made frame advance act normal (so it advances 1 frame each time instead of waiting for further unpause commands), and did some minor improvements to the read-only command (making the UI behavior a little nicer, no actual changes to what read-only does at this point)

This commit is contained in:
nitsuja
2011-12-11 21:08:26 -08:00
parent b0ffa72e37
commit 2c2ef9a961
3 changed files with 32 additions and 7 deletions

View File

@ -77,7 +77,10 @@ void FrameUpdate()
g_lagCounter++;
if (g_bFrameStep)
{
Core::SetState(Core::CORE_PAUSE);
g_bFrameStep = false;
}
// ("framestop") the only purpose of this is to cause interpreter/jit Run() to return temporarily.
// after that we set it back to CPU_RUNNING and continue as normal.
@ -113,9 +116,19 @@ void SetPolledDevice()
g_bPolled = true;
}
void SetFrameStepping(bool bEnabled)
void DoFrameStep()
{
g_bFrameStep = bEnabled;
if(Core::GetState() == Core::CORE_PAUSE)
{
// if already paused, frame advance for 1 frame
Core::SetState(Core::CORE_RUN);
g_bFrameStep = true;
}
else
{
// if not paused yet, pause immediately instead
Core::SetState(Core::CORE_PAUSE);
}
}
void SetFrameStopping(bool bEnabled)
@ -125,6 +138,9 @@ void SetFrameStopping(bool bEnabled)
void SetReadOnly(bool bEnabled)
{
if (g_bReadOnly != bEnabled)
Core::DisplayMessage(bEnabled ? "Read-only mode." : "Read+Write mode.", 1000);
g_bReadOnly = bEnabled;
}

View File

@ -111,7 +111,7 @@ bool IsUsingWiimote(int wiimote);
void ChangePads(bool instantly = false);
void ChangeWiiPads(bool instantly = false);
void SetFrameStepping(bool bEnabled);
void DoFrameStep();
void SetFrameStopping(bool bEnabled);
void SetReadOnly(bool bEnabled);