Tasedit - prevent crash when truncating while turbo, disable auto-savestate during turbo, allow redrawing Tasedit window while turbo and paused, and window cleanup

This commit is contained in:
mart0258 2010-07-10 00:58:20 +00:00
parent f2f0ac5f55
commit b8c6ed272e
5 changed files with 24 additions and 19 deletions

View File

@ -1,3 +1,4 @@
09-july-2010 - mart0258 - TasEdit - cleanup; prevent crash when truncating while turbo
13-june-2010 - adelikat - Win32 - avi capture commandline argument and related parameters 13-june-2010 - adelikat - Win32 - avi capture commandline argument and related parameters
12-june-2010 - adelikat - Save Turbo frame skip amount to config so that it can be customized by user 12-june-2010 - adelikat - Save Turbo frame skip amount to config so that it can be customized by user
12-june-2010 - adelikat - Lua - fix speed.mode() so that normal turns off turbo 12-june-2010 - adelikat - Lua - fix speed.mode() so that normal turns off turbo

View File

@ -1325,23 +1325,23 @@ MENU TASEDITMENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1 FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN BEGIN
CONTROL "",IDC_LIST1,"SysListView32",LVS_REPORT | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_OWNERDATA | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,7,11,324,365 CONTROL "",IDC_LIST1,"SysListView32",LVS_REPORT | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_OWNERDATA | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,7,11,324,365
PUSHBUTTON "Truncate",IDC_HACKY1,345,46,51,16 PUSHBUTTON "Truncate",IDC_HACKY1,348,46,51,16
LTEXT "Any number of these icon buttons are pressed",IDC_STATIC,402,84,47,34 LTEXT "Any number of these icon buttons are pressed",IDC_STATIC,402,84,47,34
PUSHBUTTON "<",TASEDIT_REWIND,367,22,22,14 PUSHBUTTON "<<",TASEDIT_REWIND_FULL,348,22,22,14
PUSHBUTTON ">",TASEDIT_FOWARD,410,22,22,14 PUSHBUTTON "<",TASEDIT_REWIND,370,22,22,14
PUSHBUTTON "<<",TASEDIT_REWIND_FULL,345,22,22,14 PUSHBUTTON "||",TASEDIT_PLAYSTOP,392,22,22,14
PUSHBUTTON ">>",TASEDIT_FOWARD_FULL,431,22,22,14 PUSHBUTTON ">",TASEDIT_FOWARD,414,22,22,14
PUSHBUTTON ">>",TASEDIT_FOWARD_FULL,436,22,22,14
GROUPBOX "Frames",IDC_STATIC,344,11,120,176 GROUPBOX "Frames",IDC_STATIC,344,11,120,176
GROUPBOX "Project Input Logs",IDC_STATIC,344,201,120,175 GROUPBOX "Project Input Logs",IDC_STATIC,344,201,120,175
PUSHBUTTON "Record P1",IDC_BUTTON5,347,95,50,14,WS_DISABLED PUSHBUTTON "Record P1",IDC_BUTTON5,348,95,50,14,WS_DISABLED
PUSHBUTTON "Record P2",IDC_BUTTON7,347,79,50,14,WS_DISABLED PUSHBUTTON "Record P2",IDC_BUTTON7,348,79,50,14,WS_DISABLED
LTEXT "After current frame",IDC_STATIC,347,62,67,11 LTEXT "After current frame",IDC_STATIC,348,62,67,11
PUSHBUTTON "Union Mode",IDC_BUTTON8,347,111,50,14,WS_DISABLED PUSHBUTTON "Union Mode",IDC_BUTTON8,348,111,50,14,WS_DISABLED
EDITTEXT IDC_EDIT1,348,149,40,14,ES_AUTOHSCROLL EDITTEXT IDC_EDIT1,348,149,40,14,ES_AUTOHSCROLL
PUSHBUTTON "Send",IDC_BUTTON9,392,148,31,14,WS_DISABLED PUSHBUTTON "Send",IDC_BUTTON9,392,148,31,14,WS_DISABLED
LTEXT "Sends to Notes column",IDC_STATIC,348,137,74,8 LTEXT "Sends to Notes column",IDC_STATIC,348,137,74,8
CONTROL "",IDC_LIST2,"SysListView32",LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,349,216,115,160 CONTROL "",IDC_LIST2,"SysListView32",LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,348,216,114,156
PUSHBUTTON "||",TASEDIT_PLAYSTOP,389,22,22,14
END END
ASSEMBLER DIALOGEX 0, 0, 202, 135 ASSEMBLER DIALOGEX 0, 0, 202, 135

View File

@ -128,14 +128,17 @@ void UpdateTasEdit()
{ {
if(!hwndTasEdit) return; if(!hwndTasEdit) return;
if(FCEUMOV_ShouldPause() && FCEUI_EmulationPaused()==0) if(FCEUI_EmulationPaused()==0)
{ {
FCEUI_ToggleEmulationPause(); if (FCEUMOV_ShouldPause())
turbo = false; {
FCEUI_ToggleEmulationPause();
turbo = false;
}
else if (turbo && (currFrameCounter &0xf))
return;
} }
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);
@ -1154,8 +1157,9 @@ BOOL CALLBACK WndprocTasEdit(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
case ID_CONTEXT_STRAY_TRUNCATE: case ID_CONTEXT_STRAY_TRUNCATE:
case IDC_HACKY1: case IDC_HACKY1:
//hacky1: delete all items after the current selection //hacky1: delete all items after the current selection
currMovieData.records.resize(currFrameCounter+1); currMovieData.truncateAt(currFrameCounter+1);
InvalidateGreenZone(currFrameCounter); InvalidateGreenZone(currFrameCounter);
currMovieData.TryDumpIncremental();
UpdateTasEdit(); UpdateTasEdit();
break; break;

View File

@ -992,7 +992,7 @@ void UpdateAutosave(void)
void FCEUI_Autosave(void) void FCEUI_Autosave(void)
{ {
if(!EnableAutosave || !AutoSS) if(!EnableAutosave || !AutoSS || FCEUMOV_Mode(MOVIEMODE_TASEDIT))
return; return;
if(AutosaveStatus[AutosaveIndex] == 1) if(AutosaveStatus[AutosaveIndex] == 1)

View File

@ -139,7 +139,7 @@ void MovieData::TryDumpIncremental()
} }
currMovieData.storeTasSavestate(currFrameCounter, Z_DEFAULT_COMPRESSION); currMovieData.storeTasSavestate(currFrameCounter, Z_DEFAULT_COMPRESSION);
currMovieData.greenZoneCount++; currMovieData.greenZoneCount=currFrameCounter+1;
} else if (currFrameCounter < currMovieData.greenZoneCount || !movie_readonly) } else if (currFrameCounter < currMovieData.greenZoneCount || !movie_readonly)
{ {
currMovieData.storeTasSavestate(currFrameCounter, Z_DEFAULT_COMPRESSION); currMovieData.storeTasSavestate(currFrameCounter, Z_DEFAULT_COMPRESSION);