Fixed a few TAS bugs. TASing should now work, provided that you DON'T change your frameskipping value...

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4030 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
XTra.KrazzY 2009-08-21 20:15:33 +00:00
parent 1612c6a2b8
commit f8e410e0e6
3 changed files with 15 additions and 7 deletions

View File

@ -64,13 +64,8 @@ void FrameUpdate() {
fread(g_padStates, sizeof(ControllerState), g_numPads, g_recordfd);
// End of recording
if(feof(g_recordfd)) {
fclose(g_recordfd);
g_recordfd = NULL;
g_numPads = 0;
delete[] g_padStates;
g_playMode = MODE_NONE;
}
if(feof(g_recordfd))
EndPlayInput();
}
}
@ -269,6 +264,8 @@ void RecordInput(SPADStatus *PadStatus, int controllerID)
g_padStates[controllerID].CStickX = PadStatus->substickX;
g_padStates[controllerID].CStickY = PadStatus->substickY;
PlayController(PadStatus, controllerID);
}
bool PlayInput(const char *filename)
@ -367,4 +364,12 @@ void PlayController(SPADStatus *PadStatus, int controllerID)
PadStatus->substickY = g_padStates[controllerID].CStickY;
}
void EndPlayInput() {
fclose(g_recordfd);
g_recordfd = NULL;
g_numPads = 0;
delete[] g_padStates;
g_playMode = MODE_NONE;
}
};

View File

@ -92,6 +92,7 @@ void EndRecordingInput();
bool PlayInput(const char *filename);
void PlayController(SPADStatus *PadStatus, int controllerID);
void EndPlayInput();
};

View File

@ -584,6 +584,8 @@ void CFrame::DoStop()
// TODO: Show the author/description dialog here
if(Frame::IsRecordingInput())
Frame::EndRecordingInput();
if(Frame::IsPlayingInput())
Frame::EndPlayInput();
Core::Stop();
UpdateGUI();