From 4e3f25c906e4f1eddd4687068fc569dc5f3964b0 Mon Sep 17 00:00:00 2001 From: mart0258 Date: Sun, 27 Dec 2009 20:44:39 +0000 Subject: [PATCH] w32 - Tasedit - Allow requests to fast forward to frame past greenzone, and skip non-essential updates to improve speed. --- src/drivers/win/tasedit.cpp | 26 ++++++++++++++++++-------- src/movie.cpp | 2 ++ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/drivers/win/tasedit.cpp b/src/drivers/win/tasedit.cpp index 32b9d10b..bc1cefc3 100644 --- a/src/drivers/win/tasedit.cpp +++ b/src/drivers/win/tasedit.cpp @@ -129,6 +129,9 @@ void UpdateTasEdit() turbo = false; } + if (turbo && (currFrameCounter &0xf)) + return; + //update the number of items int currLVItemCount = ListView_GetItemCount(hwndList); if(currMovieData.getNumRecords() != currLVItemCount) @@ -248,10 +251,20 @@ bool JumpToFrame(int index) { if (index<0) return false; - /* Work only within the greenzone. */ + /* Handle jumps outside greenzone. */ if (index>currMovieData.greenZoneCount) { - return JumpToFrame(currMovieData.greenZoneCount); + if (JumpToFrame(currMovieData.greenZoneCount)) + { + if (FCEUI_EmulationPaused()) + FCEUI_ToggleEmulationPause(); + + turbo=currMovieData.greenZoneCount+600? index-1:0; if (i>=currMovieData.records.size()) i=currMovieData.records.size()-1; @@ -286,6 +299,7 @@ bool JumpToFrame(int index) poweron(true); currFrameCounter=0; + MovieData::dumpSavestateTo(&currMovieData.records[0].savestate,0); turbo = index>60; pauseframe=index+1; } @@ -313,11 +327,7 @@ void DoubleClick(LPNMITEMACTIVATE info) //if the icon or frame columns were double clicked: if(info->iSubItem == 0 || info->iSubItem == 1) { - //if the row is in the green zone, then move to it - if(index < currMovieData.greenZoneCount) - { - JumpToFrame(index); - } + JumpToFrame(index); } else //if an input column was clicked: { diff --git a/src/movie.cpp b/src/movie.cpp index 7fa1e21f..0f34abd3 100644 --- a/src/movie.cpp +++ b/src/movie.cpp @@ -135,6 +135,8 @@ void MovieData::TryDumpIncremental() currMovieData.greenZoneCount++; } 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); } }