Tasedit - enable nav and truncate buttons (with fixes)
This commit is contained in:
parent
f576691091
commit
2aab99feb6
|
@ -223,21 +223,21 @@ BEGIN
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "&Close\tAlt+F4", ID_TASEDIT_FILE_CLOSE
|
MENUITEM "&Close\tAlt+F4", ID_TASEDIT_FILE_CLOSE
|
||||||
END
|
END
|
||||||
POPUP "&Edit", INACTIVE
|
POPUP "&Edit"
|
||||||
BEGIN
|
BEGIN
|
||||||
MENUITEM "&Select All", ID_EDIT_SELECTALL
|
MENUITEM "&Select All", ID_EDIT_SELECTALL, INACTIVE
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Cu&t\tCtrl+X", ID_TASEDIT_CUT
|
MENUITEM "Cu&t\tCtrl+X", ID_TASEDIT_CUT, INACTIVE
|
||||||
MENUITEM "&Copy\tCtrl+C", ID_TASEDIT_COPY
|
MENUITEM "&Copy\tCtrl+C", ID_TASEDIT_COPY, INACTIVE
|
||||||
MENUITEM "&Paste\tCtrl+V", ID_TASEDIT_PASTE
|
MENUITEM "&Paste\tCtrl+V", ID_TASEDIT_PASTE, INACTIVE
|
||||||
MENUITEM "Paste to &New\tCtrl+Shift+V", ID_TASEDIT_PASTETONEW
|
MENUITEM "Paste to &New\tCtrl+Shift+V", ID_TASEDIT_PASTETONEW, INACTIVE
|
||||||
MENUITEM "&Delete\tCtrl+Delete", ID_TASEDIT_DELETE
|
MENUITEM "&Delete\tCtrl+Delete", ID_TASEDIT_DELETE, INACTIVE
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "&Add Marker", ID_EDIT_ADDMARKER
|
MENUITEM "&Add Marker", ID_EDIT_ADDMARKER, INACTIVE
|
||||||
MENUITEM "&Remove Marker", ID_EDIT_REMOVEMARKER
|
MENUITEM "&Remove Marker", ID_EDIT_REMOVEMARKER, INACTIVE
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "&Truncate\tCtrl+T", ID_EDIT_TRUNCATE
|
MENUITEM "&Truncate\tCtrl+T", ID_EDIT_TRUNCATE
|
||||||
MENUITEM "&Branch\tCtrl+B", ID_EDIT_BRANCH
|
MENUITEM "&Branch\tCtrl+B", ID_EDIT_BRANCH, INACTIVE
|
||||||
END
|
END
|
||||||
MENUITEM "&View", ID_VIEW, INACTIVE
|
MENUITEM "&View", ID_VIEW, INACTIVE
|
||||||
POPUP "&Help"
|
POPUP "&Help"
|
||||||
|
@ -1283,13 +1283,13 @@ 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,364
|
CONTROL "",IDC_LIST1,"SysListView32",LVS_REPORT | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_OWNERDATA | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,7,11,324,364
|
||||||
PUSHBUTTON "Truncate",IDC_HACKY1,338,46,51,16,WS_DISABLED
|
PUSHBUTTON "Truncate",IDC_HACKY1,338,46,51,16
|
||||||
//PUSHBUTTON "Commit",IDC_HACKY2,404,46,51,16,WS_DISABLED
|
//PUSHBUTTON "Commit",IDC_HACKY2,404,46,51,16,WS_DISABLED
|
||||||
LTEXT "Any number of these icon buttons are pressed",IDC_STATIC,395,84,47,34
|
LTEXT "Any number of these icon buttons are pressed",IDC_STATIC,395,84,47,34
|
||||||
PUSHBUTTON "<",TASEDIT_REWIND,367,25,26,14,WS_DISABLED
|
PUSHBUTTON "<",TASEDIT_REWIND,367,25,26,14
|
||||||
PUSHBUTTON ">",TASEDIT_FOWARD,391,25,26,14,WS_DISABLED
|
PUSHBUTTON ">",TASEDIT_FOWARD,391,25,26,14
|
||||||
PUSHBUTTON "<<",TASEDIT_REWIND_FULL,341,25,26,14,WS_DISABLED
|
PUSHBUTTON "<<",TASEDIT_REWIND_FULL,341,25,26,14
|
||||||
PUSHBUTTON ">>",TASEDIT_FOWARD_FULL,417,25,26,14,WS_DISABLED
|
PUSHBUTTON ">>",TASEDIT_FOWARD_FULL,417,25,26,14
|
||||||
GROUPBOX "Static",IDC_STATIC,335,11,120,176
|
GROUPBOX "Static",IDC_STATIC,335,11,120,176
|
||||||
GROUPBOX "Project Input Logs",IDC_STATIC,335,200,120,175
|
GROUPBOX "Project Input Logs",IDC_STATIC,335,200,120,175
|
||||||
PUSHBUTTON "Record P1",IDC_BUTTON5,340,95,50,14,WS_DISABLED
|
PUSHBUTTON "Record P1",IDC_BUTTON5,340,95,50,14,WS_DISABLED
|
||||||
|
|
|
@ -237,13 +237,16 @@ void InvalidateGreenZone(int after)
|
||||||
*/
|
*/
|
||||||
bool JumpToFrame(int index)
|
bool JumpToFrame(int index)
|
||||||
{
|
{
|
||||||
|
if (index<0) return false;
|
||||||
|
|
||||||
/* Work only within the greenzone. */
|
/* Work only within the greenzone. */
|
||||||
if (index>currMovieData.greenZoneCount)
|
if (index>currMovieData.greenZoneCount)
|
||||||
{
|
{
|
||||||
return JumpToFrame(currMovieData.greenZoneCount);
|
return JumpToFrame(currMovieData.greenZoneCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!currMovieData.records[index].savestate.empty() &&
|
if (index<currMovieData.records.size() &&
|
||||||
|
!currMovieData.records[index].savestate.empty() &&
|
||||||
MovieData::loadSavestateFrom(&currMovieData.records[index].savestate))
|
MovieData::loadSavestateFrom(&currMovieData.records[index].savestate))
|
||||||
{
|
{
|
||||||
currFrameCounter = index;
|
currFrameCounter = index;
|
||||||
|
@ -255,15 +258,19 @@ bool JumpToFrame(int index)
|
||||||
if (FCEUI_EmulationPaused())
|
if (FCEUI_EmulationPaused())
|
||||||
FCEUI_ToggleEmulationPause();
|
FCEUI_ToggleEmulationPause();
|
||||||
|
|
||||||
|
int i = index-1;
|
||||||
|
if (i>=currMovieData.records.size())
|
||||||
|
i=currMovieData.records.size()-1;
|
||||||
|
|
||||||
/* Search for an earlier frame, and try warping to the current. */
|
/* Search for an earlier frame, and try warping to the current. */
|
||||||
for (int i=index-1; i>0; --i)
|
for (; i>0; --i)
|
||||||
{
|
{
|
||||||
if (!currMovieData.records[index].savestate.empty() &&
|
if (!currMovieData.records[i].savestate.empty() &&
|
||||||
MovieData::loadSavestateFrom(&currMovieData.records[index].savestate))
|
MovieData::loadSavestateFrom(&currMovieData.records[i].savestate))
|
||||||
{
|
{
|
||||||
currFrameCounter=i;
|
currFrameCounter=i;
|
||||||
turbo=i+256<index; // turbo unless close
|
turbo=i+60<index; // turbo unless close
|
||||||
pauseframe=index;
|
pauseframe=index+1;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -273,8 +280,8 @@ bool JumpToFrame(int index)
|
||||||
PowerNES();
|
PowerNES();
|
||||||
disableBatteryLoading = 0;
|
disableBatteryLoading = 0;
|
||||||
currFrameCounter=0;
|
currFrameCounter=0;
|
||||||
turbo = index>256;
|
turbo = index>60;
|
||||||
pauseframe=index;
|
pauseframe=index+1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Simply do a reset.
|
// Simply do a reset.
|
||||||
|
@ -932,17 +939,21 @@ BOOL CALLBACK WndprocTasEdit(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
|
||||||
|
|
||||||
case TASEDIT_FOWARD:
|
case TASEDIT_FOWARD:
|
||||||
//advance 1 frame
|
//advance 1 frame
|
||||||
|
JumpToFrame(currFrameCounter+1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TASEDIT_REWIND:
|
case TASEDIT_REWIND:
|
||||||
//rewinds 1 frame
|
//rewinds 1 frame
|
||||||
|
JumpToFrame(currFrameCounter-1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TASEDIT_REWIND_FULL:
|
case TASEDIT_REWIND_FULL:
|
||||||
//rewinds to beginning of movie
|
//rewinds to beginning of movie
|
||||||
|
JumpToFrame(0);
|
||||||
break;
|
break;
|
||||||
case TASEDIT_FOWARD_FULL:
|
case TASEDIT_FOWARD_FULL:
|
||||||
//moves to the end of the move (or green zone?)
|
//moves to the end of the move (or green zone?)
|
||||||
|
JumpToFrame(currMovieData.records.size()-1 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue