w32 - Tasedit - Allow requests to fast forward to frame past greenzone, and skip non-essential updates to improve speed.

This commit is contained in:
mart0258 2009-12-27 20:44:39 +00:00
parent eb504adb19
commit 4e3f25c906
2 changed files with 20 additions and 8 deletions

View File

@ -129,6 +129,9 @@ void UpdateTasEdit()
turbo = false; turbo = false;
} }
if (turbo && (currFrameCounter &0xf))
return;
//update the number of items //update the number of items
int currLVItemCount = ListView_GetItemCount(hwndList); int currLVItemCount = ListView_GetItemCount(hwndList);
if(currMovieData.getNumRecords() != currLVItemCount) if(currMovieData.getNumRecords() != currLVItemCount)
@ -248,10 +251,20 @@ bool JumpToFrame(int index)
{ {
if (index<0) return false; if (index<0) return false;
/* Work only within the greenzone. */ /* Handle jumps outside greenzone. */
if (index>currMovieData.greenZoneCount) if (index>currMovieData.greenZoneCount)
{ {
return JumpToFrame(currMovieData.greenZoneCount); if (JumpToFrame(currMovieData.greenZoneCount))
{
if (FCEUI_EmulationPaused())
FCEUI_ToggleEmulationPause();
turbo=currMovieData.greenZoneCount+60<index; // turbo unless close
pauseframe=index+1;
return true;
}
return false;
} }
if (index<currMovieData.records.size() && if (index<currMovieData.records.size() &&
@ -267,7 +280,7 @@ bool JumpToFrame(int index)
if (FCEUI_EmulationPaused()) if (FCEUI_EmulationPaused())
FCEUI_ToggleEmulationPause(); FCEUI_ToggleEmulationPause();
int i = index-1; int i = index>0? index-1:0;
if (i>=currMovieData.records.size()) if (i>=currMovieData.records.size())
i=currMovieData.records.size()-1; i=currMovieData.records.size()-1;
@ -286,6 +299,7 @@ bool JumpToFrame(int index)
poweron(true); poweron(true);
currFrameCounter=0; currFrameCounter=0;
MovieData::dumpSavestateTo(&currMovieData.records[0].savestate,0);
turbo = index>60; turbo = index>60;
pauseframe=index+1; pauseframe=index+1;
} }
@ -313,11 +327,7 @@ void DoubleClick(LPNMITEMACTIVATE info)
//if the icon or frame columns were double clicked: //if the icon or frame columns were double clicked:
if(info->iSubItem == 0 || info->iSubItem == 1) if(info->iSubItem == 0 || info->iSubItem == 1)
{ {
//if the row is in the green zone, then move to it JumpToFrame(index);
if(index < currMovieData.greenZoneCount)
{
JumpToFrame(index);
}
} }
else //if an input column was clicked: else //if an input column was clicked:
{ {

View File

@ -135,6 +135,8 @@ void MovieData::TryDumpIncremental()
currMovieData.greenZoneCount++; currMovieData.greenZoneCount++;
} else if (currFrameCounter < currMovieData.greenZoneCount || !movie_readonly) } else if (currFrameCounter < currMovieData.greenZoneCount || !movie_readonly)
{ {
if (turbo && pauseframe-256>currFrameCounter && ((currFrameCounter-pauseframe)&0xff))
return;
MovieData::dumpSavestateTo(&currMovieData.records[currFrameCounter].savestate,Z_DEFAULT_COMPRESSION); MovieData::dumpSavestateTo(&currMovieData.records[currFrameCounter].savestate,Z_DEFAULT_COMPRESSION);
} }
} }