remove rewind code completely (it wasnt hooked up to the UI and it was worthless anyway)

This commit is contained in:
zeromus 2017-01-06 16:53:46 -06:00
parent 207a3b2e9e
commit ce044f3700
6 changed files with 0 additions and 100 deletions

View File

@ -384,12 +384,6 @@ void HK_PlayMovie(int, bool justPressed)
Replay_LoadMovie();
}
bool rewinding = false;
void HK_RewindKeyDown(int, bool justPressed) {rewinding = true;}
void HK_RewindKeyUp(int){rewinding = false;}
void HK_RecordMovie(int, bool justPressed)
{
if (romloaded)
@ -817,14 +811,6 @@ void InitCustomKeys (SCustomKeys *keys)
keys->TurboStart.page = HOTKEY_PAGE_TURBO;
keys->TurboStart.key = NULL;
// Movie/Tools page -----------------------------------------
keys->Rewind.handleKeyDown = HK_RewindKeyDown;
keys->Rewind.handleKeyUp = HK_RewindKeyUp;
keys->Rewind.code = "Rewind";
keys->Rewind.name = STRW(ID_LABEL_HK25);
keys->Rewind.page = HOTKEY_PAGE_MOVIE;
keys->Rewind.key = NULL;
keys->NewLuaScript.handleKeyDown = HK_NewLuaScriptDown;
keys->NewLuaScript.code = "NewLuaScript";
keys->NewLuaScript.name = STRW(ID_LABEL_HK26);

View File

@ -92,8 +92,6 @@ struct SCustomKeys
SCustomKey RecordWAV, RecordAVI;
SCustomKey Rewind;
SCustomKey NewLuaScript, CloseLuaScripts, MostRecentLuaScript;
SCustomKey ToggleFrameCounter;

View File

@ -513,7 +513,6 @@ int lastskiprate=0;
int emu_paused = 0;
bool frameAdvance = false;
bool continuousframeAdvancing = false;
bool staterewindingenabled = false;
unsigned short windowSize = 0;
@ -2187,16 +2186,6 @@ static void StepRunLoop_Core()
inFrameBoundary = true;
DRV_AviVideoUpdate();
extern bool rewinding;
if (staterewindingenabled) {
if(rewinding)
dorewind();
else
rewindsave();
}
CallRegisteredLuaFunctions(LUACALL_AFTEREMULATION);
ServiceDisplayThreadInvocations();
}
@ -4579,8 +4568,6 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
MainWindow->checkMenu(IDM_RENDER_4XBRZ, video.currentfilter == video._4XBRZ );
MainWindow->checkMenu(IDM_RENDER_5XBRZ, video.currentfilter == video._5XBRZ );
MainWindow->checkMenu(IDC_STATEREWINDING, staterewindingenabled == 1 );
MainWindow->checkMenu(ID_DISPLAYMETHOD_VSYNC, (GetStyle()&DWS_VSYNC)!=0);
MainWindow->checkMenu(ID_DISPLAYMETHOD_DIRECTDRAWHW, (GetStyle()&DWS_DDRAW_HW)!=0);
MainWindow->checkMenu(ID_DISPLAYMETHOD_DIRECTDRAWSW, (GetStyle()&DWS_DDRAW_SW)!=0);
@ -5301,10 +5288,6 @@ DOKEYDOWN:
WavRecordTo(WAVMODE_USER);
break;
#endif
case IDC_STATEREWINDING:
if(staterewindingenabled) staterewindingenabled = false;
else staterewindingenabled = true;
break;
case IDM_RENDER_NORMAL:
{
Lock lock (win_backbuffer_sync);

View File

@ -152,7 +152,6 @@
#define IDC_BROWSELUA 365
#define IDD_PATHSETTINGS 366
#define IDC_ASSOCIATE 367
#define IDC_STATEREWINDING 367
#define IDC_CLOSE_LUA_SCRIPTS 368
#define IDC_DES_BOX 402
#define IDC_R0 403

View File

@ -1301,66 +1301,3 @@ bool savestate_load(const char *file_name)
return savestate_load(&f);
}
static std::stack<EMUFILE_MEMORY*> rewindFreeList;
static std::vector<EMUFILE_MEMORY*> rewindbuffer;
int rewindstates = 16;
int rewindinterval = 4;
void rewindsave () {
if(currFrameCounter % rewindinterval)
return;
//printf("rewindsave"); printf("%d%s", currFrameCounter, "\n");
EMUFILE_MEMORY *ms;
if(!rewindFreeList.empty()) {
ms = rewindFreeList.top();
rewindFreeList.pop();
} else {
ms = new EMUFILE_MEMORY(1024*1024*12);
}
if(!savestate_save(ms, Z_NO_COMPRESSION))
return;
rewindbuffer.push_back(ms);
if((int)rewindbuffer.size() > rewindstates) {
delete *rewindbuffer.begin();
rewindbuffer.erase(rewindbuffer.begin());
}
}
void dorewind()
{
if(currFrameCounter % rewindinterval)
return;
//printf("rewind\n");
int size = rewindbuffer.size();
if(size < 1) {
printf("rewind buffer empty\n");
return;
}
printf("%d", size);
EMUFILE_MEMORY* loadms = rewindbuffer[size-1];
loadms->fseek(32, SEEK_SET);
ReadStateChunks(loadms,loadms->size()-32);
loadstate();
if(rewindbuffer.size()>1)
{
rewindFreeList.push(loadms);
rewindbuffer.pop_back();
}
}

View File

@ -66,7 +66,4 @@ void loadstate_slot(int num);
bool savestate_load(class EMUFILE* is);
bool savestate_save(class EMUFILE* outstream, int compressionLevel);
void dorewind();
void rewindsave();
#endif