Major overhaul to input recording, including fixing major desyncs during playback and a small bug in the .DTM file format. Like netplay, some emulator options (specifically dual core and idle skipping) can cause desyncs, and the more your plugin options are similar to the ones used during recording, the more likely playback will sync.

Also, input movies are now linked to savestates instead of just selecting a file to save to and running a game and are exported at a later time. This allows you to easily continue a recording across sessions and makes rerecording possible.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6154 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
baby.lueshi 2010-08-30 07:05:47 +00:00
parent 6a695eff49
commit c1cac331a0
8 changed files with 191 additions and 113 deletions

View file

@ -131,8 +131,9 @@ void CFrame::CreateMenu()
emulationMenu->AppendSeparator();
emulationMenu->Append(IDM_TOGGLE_FULLSCREEN, GetMenuLabel(HK_FULLSCREEN));
emulationMenu->AppendSeparator();
emulationMenu->Append(IDM_RECORD, _T("Start Re&cording..."));
emulationMenu->Append(IDM_RECORD, _T("Start Re&cording"));
emulationMenu->Append(IDM_PLAYRECORD, _T("P&lay Recording..."));
emulationMenu->Append(IDM_RECORDEXPORT, _T("Export Recording..."));
emulationMenu->AppendSeparator();
emulationMenu->Append(IDM_CHANGEDISC, _T("Change &Disc"));
@ -627,23 +628,8 @@ void CFrame::OnChangeDisc(wxCommandEvent& WXUNUSED (event))
void CFrame::OnRecord(wxCommandEvent& WXUNUSED (event))
{
wxString path = wxFileSelector(
_T("Select The Recording File"),
wxEmptyString, wxEmptyString, wxEmptyString,
wxString::Format
(
_T("Dolphin TAS Movies (*.dtm)|*.dtm|All files (%s)|%s"),
wxFileSelectorDefaultWildcardStr,
wxFileSelectorDefaultWildcardStr
),
wxFD_SAVE | wxFD_PREVIEW,
this);
if(path.IsEmpty())
return;
// TODO: Take controller settings from Gamecube Configuration menu
if(Frame::BeginRecordingInput(path.mb_str(), 1))
if(Frame::BeginRecordingInput(1))
BootGame(std::string(""));
}
@ -668,6 +654,11 @@ void CFrame::OnPlayRecording(wxCommandEvent& WXUNUSED (event))
BootGame(std::string(""));
}
void CFrame::OnRecordExport(wxCommandEvent& WXUNUSED (event))
{
DoRecordingSave();
}
void CFrame::OnPlay(wxCommandEvent& WXUNUSED (event))
{
if (Core::GetState() != Core::CORE_UNINITIALIZED)
@ -901,8 +892,8 @@ void CFrame::DoStop()
// TODO: Show the author/description dialog here
if(Frame::IsRecordingInput())
Frame::EndRecordingInput();
if(Frame::IsPlayingInput())
DoRecordingSave();
if(Frame::IsPlayingInput() || Frame::IsRecordingInput())
Frame::EndPlayInput();
// These windows cause segmentation faults if they are open when the emulator
@ -946,6 +937,34 @@ void CFrame::DoStop()
}
}
void CFrame::DoRecordingSave()
{
bool paused = (Core::GetState() == Core::CORE_PAUSE);
if (!paused)
DoPause();
wxString path = wxFileSelector(
_T("Select The Recording File"),
wxEmptyString, wxEmptyString, wxEmptyString,
wxString::Format
(
_T("Dolphin TAS Movies (*.dtm)|*.dtm|All files (%s)|%s"),
wxFileSelectorDefaultWildcardStr,
wxFileSelectorDefaultWildcardStr
),
wxFD_SAVE | wxFD_PREVIEW,
this);
if(path.IsEmpty())
return;
Frame::SaveRecording(path.mb_str());
if (!paused)
DoPause();
}
void CFrame::OnStop(wxCommandEvent& WXUNUSED (event))
{
m_bGameLoading = false;
@ -1281,6 +1300,7 @@ void CFrame::UpdateGUI()
GetMenuBar()->FindItem(IDM_RESET)->Enable(Running || Paused);
GetMenuBar()->FindItem(IDM_RECORD)->Enable(!Initialized);
GetMenuBar()->FindItem(IDM_PLAYRECORD)->Enable(!Initialized);
GetMenuBar()->FindItem(IDM_RECORDEXPORT)->Enable(Frame::IsRecordingInput());
GetMenuBar()->FindItem(IDM_FRAMESTEP)->Enable(Running || Paused);
GetMenuBar()->FindItem(IDM_SCREENSHOT)->Enable(Running || Paused);
GetMenuBar()->FindItem(IDM_TOGGLE_FULLSCREEN)->Enable(Running || Paused);