diff --git a/Authors.txt b/Authors.txt index 252040b9..8e24c2ec 100644 --- a/Authors.txt +++ b/Authors.txt @@ -64,6 +64,9 @@ Driver maintenance and refactoring DWEdit Debugger additions +AnS - ansstuff at yandex dot ru (sf:ansstuff) +TASEdit enhancements + ---------linux devvers--------- >= 2.0 - These guys concentrated on keeping fceux the premiere linux-portable nes emu diff --git a/changelog.txt b/changelog.txt index 8e3cc4ea..1a1ff51c 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,6 +1,25 @@ --r**** - FCEUX 2.1.5 release -30-Jul-2001 - mart0258 - Ram Search updates list when emulator is paused (on Power, or when resetting search) -4-Jul-2011 - FatRatKnight - Lua console now gets the proper file path when selecting a file from the recent menu. + +17-sept-2011 - AnS - Tasedit: forced read-only behaviour when seeking or holding turbo; "Auto-restore last position" checkbox in playback controls; also fixed item drawing method, no more flicker and slowdowns +12-sept-2011 - prg318 - sdl: rename InputType to CurInputType due to variable of same name in src/movie.h +12-sept-2011 - AnS - Tasedit: rewrote project save/load functions; various bugfixes; Added string "Tweak Count" to Replay loading dialog +6-sept-2011 - AnS - Tasedit: red lines for lag frames; different method of accounting tweakCount +6-sept-2011 - AnS - fixed bug when trying to open Replay dialog without having ROM loaded +3-sept-2011 - AnS - Tasedit: tweaks and bugfixes +3-sept-2011 - CaH4e3 - fixed bus conflict emulation, no kage no densetsu bug anymore +31-Aug-2011 - AnS - Tasedit: Added 4 pads support; also now current frame is shown by blue line; minor cleanups. +30-Aug-2011 - mart0258 - Ram Search updates list when emulator is paused (on Power, or when resetting search) +25-Aug-2011 - zeromus - win32: fix context menus to use rightclicks in context menus correctly +19-Aug-2011 - CaH4e3 - PAL/NTSC noise fixed +18-Jul-2011 - zeromus - slightly improve hud text rendering wrapping +16-Jul-2011 - adelikat - Add Button Count lua script written by Brandon Evans +15-Jul-2011 - prg318 - sdl: patch to resolve 'XKeysymToString' complication errors on debian sid and osx (thanks antonio ospite!) +6-Jul-2011 - plombo - sdl: fixed --nogui option and removed SDL.NoGUI from fceux.cfg +5-Jul-2011 - FatRatKnight - Lua console now gets the proper file path when selecting a file from the recent menu. + +---r2206 - FCEUX 2.1.5 Released--- +---June 21 2011--- + +16-Jun-2011 - zeromus - win32: poll hotkeys while no rom is loaded 1-jun-2011 - prg318 - sdl - print usage when --help is passed even if SDL fails plombo - added stock icons to menu items plombo - added new gamepad configuration dialog @@ -34,8 +53,9 @@ plombo - added new gamepad configuration dialog 06-june-2010 - FatRatKnight - Added a return value to gui.text: The X position where the function would paint the next character. 02-june-2010 - adelikat - Win32 - Movie Options Dialog - Fix so Full Savestate Load checkbox is updated on load ----r1984 - FCEUX 2.1.4a Release--- +---r1984 - FCEUX 2.1.4a Released--- ---June 1 2010--- + 01-june-2010 - zeromus - fix crash bug in fcm convert 01-june-2010 - adelikat - fix logic error in read-only loadstate of movies, should not improperly report savestate after movie errors diff --git a/src/config.cpp b/src/config.cpp index 34a60734..86adff03 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -23,7 +23,7 @@ Current Contributors:\n\ punkrockguy318 (Lukas Sabota)\n\ Plombo (Bryan Cain)\n\ qeed, QFox, Shinydoofy, ugetab\n\ -CaH4e3, gocha, Acmlm, DWEdit\n\ +CaH4e3, gocha, Acmlm, DWEdit, AnS\n\ \n\ FCEUX 2.0:\n\ mz, nitsujrehtona, Lukas Sabota,\n\ diff --git a/src/drivers/win/config.cpp b/src/drivers/win/config.cpp index 82d3d67d..22f6f3d7 100644 --- a/src/drivers/win/config.cpp +++ b/src/drivers/win/config.cpp @@ -70,6 +70,7 @@ extern int frameSkipAmt; extern bool TASEdit_follow_playback; extern bool TASEdit_show_lag_frames; extern bool TASEdit_show_tweak_count; +extern bool TASEdit_restore_position; //window positions and sizes: extern int ChtPosX,ChtPosY; @@ -288,6 +289,7 @@ static CFGSTRUCT fceuconfig[] = { AC(TASEdit_follow_playback), AC(TASEdit_show_lag_frames), AC(TASEdit_show_tweak_count), + AC(TASEdit_restore_position), AC(lagCounterDisplay), AC(oldInputDisplay), AC(movieSubtitles), diff --git a/src/drivers/win/res.rc b/src/drivers/win/res.rc index f538a873..471f90b3 100644 --- a/src/drivers/win/res.rc +++ b/src/drivers/win/res.rc @@ -245,7 +245,7 @@ BEGIN POPUP "&View" BEGIN MENUITEM "Highlight &lag frames", ID_VIEW_SHOW_LAG_FRAMES - MENUITEM "Show T&weak count", ID_VIEW_SHOW_TWEAK_COUNT + MENUITEM "Show T&weak count", ID_VIEW_SHOW_TWEAK_COUNT MENUITEM SEPARATOR MENUITEM "&Follow playback", ID_VIEW_FOLLOW_PLAYBACK END @@ -329,13 +329,14 @@ TASEDITCONTEXTMENUS MENU BEGIN POPUP "Stray" BEGIN - MENUITEM "Insert Frames", MENU_CONTEXT_STRAY_INSERTFRAMES + MENUITEM "Insert number of Frames", MENU_CONTEXT_STRAY_INSERTFRAMES MENUITEM SEPARATOR MENUITEM "Truncate", ID_CONTEXT_STRAY_TRUNCATE END POPUP "Selected" BEGIN MENUITEM "Insert Frame(s)", ID_CONTEXT_SELECTED_INSERTFRAMES + MENUITEM "Insert number of Frames", ID_CONTEXT_SELECTED_INSERTFRAMES2 MENUITEM "Delete Frame(s)", ID_CONTEXT_SELECTED_DELETEFRAMES MENUITEM SEPARATOR MENUITEM "Paste to New", ID_CONTEXT_SELECTED_PASTETONEW, INACTIVE @@ -1334,31 +1335,27 @@ BEGIN EDITTEXT IDC_LABEL_TWEAKCOUNT,76,100,59,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP END -TASEDIT DIALOGEX 0, 0, 474, 383 +TASEDIT DIALOGEX 0, 0, 462, 382 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "TAS Editor" MENU TASEDITMENU FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - 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,348,46,51,16 - LTEXT "Any number of these icon buttons are pressed",IDC_STATIC,402,84,47,34 - PUSHBUTTON "<<",TASEDIT_REWIND_FULL,348,22,22,14 - PUSHBUTTON "<",TASEDIT_REWIND,370,22,22,14 - PUSHBUTTON "||",TASEDIT_PLAYSTOP,392,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 "Project Input Logs",IDC_STATIC,344,201,120,175 - PUSHBUTTON "Record P1",IDC_BUTTON5,348,95,50,14,WS_DISABLED - PUSHBUTTON "Record P2",IDC_BUTTON7,348,79,50,14,WS_DISABLED - LTEXT "After current frame",IDC_STATIC,348,62,67,11 - PUSHBUTTON "Union Mode",IDC_BUTTON8,348,111,50,14,WS_DISABLED - EDITTEXT IDC_EDIT1,348,149,40,14,ES_AUTOHSCROLL - PUSHBUTTON "Send",IDC_BUTTON9,392,148,31,14,WS_DISABLED - LTEXT "Sends to Notes column",IDC_STATIC,348,137,74,8 - CONTROL "",IDC_LIST2,"SysListView32",LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,348,216,114,156 - LTEXT "Tweak Count",IDC_TWEAKCOUNT,348,175,71,8 + CONTROL "",IDC_LIST1,"SysListView32",LVS_REPORT | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_OWNERDATA | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,7,5,324,370 + PUSHBUTTON "<<",TASEDIT_REWIND_FULL,341,14,22,14 + PUSHBUTTON "<",TASEDIT_REWIND,363,14,22,14 + PUSHBUTTON "||",TASEDIT_PLAYSTOP,385,14,22,14 + PUSHBUTTON ">",TASEDIT_FOWARD,407,14,22,14 + PUSHBUTTON ">>",TASEDIT_FOWARD_FULL,429,14,22,14 + GROUPBOX "Playback control",IDC_STATIC,337,5,118,41,BS_CENTER,WS_EX_RIGHT + GROUPBOX "Project Input Logs",IDC_STATIC,337,246,118,129,BS_CENTER,WS_EX_RIGHT + CONTROL "",IDC_LIST2,"SysListView32",LVS_LIST | LVS_ALIGNLEFT | LVS_OWNERDATA | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,342,257,109,114 + LTEXT "Tweak Count",IDC_TWEAKCOUNT,344,113,84,8 + GROUPBOX "Recording input",IDC_STATIC,337,47,118,62,BS_CENTER,WS_EX_RIGHT + CONTROL " Auto-restore last position",CHECK_AUTORESTORE_PLAYBACK, + "Button",BS_AUTOCHECKBOX,343,32,105,12 + GROUPBOX "Bookmarks",IDC_STATIC,337,145,118,101,BS_CENTER,WS_EX_RIGHT + CONTROL "",IDC_LIST3,"SysListView32",LVS_LIST | LVS_ALIGNLEFT | LVS_OWNERDATA | LVS_NOSCROLL | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,342,156,109,86 END ASSEMBLER DIALOGEX 0, 0, 202, 135 @@ -1770,6 +1767,10 @@ BEGIN BOTTOMMARGIN, 108 END + "QUIZKINGDIALOG", DIALOG + BEGIN + END + "SOUNDCONFIG", DIALOG BEGIN LEFTMARGIN, 10 @@ -1816,6 +1817,10 @@ BEGIN BOTTOMMARGIN, 121 END + "ROMPATCHER", DIALOG + BEGIN + END + "GGCONV", DIALOG BEGIN END @@ -1849,9 +1854,9 @@ BEGIN "TASEDIT", DIALOG BEGIN LEFTMARGIN, 7 - RIGHTMARGIN, 464 - TOPMARGIN, 11 - BOTTOMMARGIN, 376 + RIGHTMARGIN, 454 + TOPMARGIN, 5 + BOTTOMMARGIN, 375 END "ASSEMBLER", DIALOG diff --git a/src/drivers/win/resource.h b/src/drivers/win/resource.h index 6879fff4..88ccf63f 100644 --- a/src/drivers/win/resource.h +++ b/src/drivers/win/resource.h @@ -393,6 +393,7 @@ #define IDC_EDIT1 1147 #define IDC_BUTTON9 1148 #define IDC_LIST2 1149 +#define IDC_LIST3 1150 #define CHECK_SOUND_MUTETURBO 1179 #define IDC_EDIT_AUTHOR 1180 #define MEMW_STATIC 1181 @@ -489,6 +490,7 @@ #define IDC_MOVIE_CLOSEAFTERPLAYBACK 1258 #define IDC_C_WATCH_SEPARATE 1259 #define IDC_TWEAKCOUNT 1260 +#define CHECK_AUTORESTORE_PLAYBACK 1261 #define MENU_NETWORK 40040 #define MENU_PALETTE 40041 #define MENU_SOUND 40042 @@ -811,6 +813,10 @@ #define ID_VIEW_FOLLOW_PLAYBACK 40419 #define ID_VIEW_SHOW_LAG_FRAMES 40420 #define ID_VIEW_SHOW_TWEAK_COUNT 40421 +#define ID_SELECTED_INSERTFRAMES 40422 +#define ID_CONTEXT_SELECTED_INSERTFRAME 40423 +#define ID_SELECTED_INSERTFRAMES40424 40424 +#define ID_CONTEXT_SELECTED_INSERTFRAMES2 40425 #define IDC_DEBUGGER_ICONTRAY 55535 #define MW_ValueLabel2 65423 #define MW_ValueLabel1 65426 @@ -820,8 +826,8 @@ #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 160 -#define _APS_NEXT_COMMAND_VALUE 40422 -#define _APS_NEXT_CONTROL_VALUE 1261 +#define _APS_NEXT_COMMAND_VALUE 40426 +#define _APS_NEXT_CONTROL_VALUE 1262 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/src/drivers/win/tasedit.cpp b/src/drivers/win/tasedit.cpp index 6bc339d0..089879e7 100644 --- a/src/drivers/win/tasedit.cpp +++ b/src/drivers/win/tasedit.cpp @@ -21,10 +21,14 @@ using namespace std; //to change header font //http://forums.devx.com/archive/index.php/t-37234.html +int old_movie_readonly = -1; + +// vars saved in cfg file int TasEdit_wndx, TasEdit_wndy; bool TASEdit_follow_playback = true; bool TASEdit_show_lag_frames = true; bool TASEdit_show_tweak_count = false; +bool TASEdit_restore_position = false; string tasedithelp = "{16CDE0C4-02B0-4A60-A88D-076319909A4D}"; //Name of TASEdit Help page char buttonNames[NUM_JOYPAD_BUTTONS][2] = {"A", "B", "S", "T", "U", "D", "L", "R"}; @@ -34,6 +38,7 @@ HWND hwndTasEdit = 0; static HMENU hmenu, hrmenu; static int lastCursor; static HWND hwndList, hwndHeader, hwndTweakCount; +static RECT rectTweakCount; static WNDPROC hwndHeader_oldWndproc, hwndList_oldWndProc; typedef std::set TSelectionFrames; @@ -171,27 +176,6 @@ static LONG CustomDraw(NMLVCUSTOMDRAW* msg) } } -void EnterTasEdit() -{ - if (movieMode == MOVIEMODE_INACTIVE) - { - FCEUI_StopMovie(); - CreateCleanMovie(); - //reset the rom - poweron(true); - currFrameCounter = 0; - } - else - { - //use current movie to create a new project - FCEUI_StopMovie(); - } - // pause the emulator and enter tasedit mode - FCEUI_SetEmulationPaused(1); - movieMode = MOVIEMODE_TASEDIT; - currMovieData.TryDumpIncremental(); - FCEU_DispMessage("Tasedit engaged",0); -} void ExitTasEdit() { movieMode = MOVIEMODE_INACTIVE; @@ -211,8 +195,6 @@ void UpdateTasEdit() FCEUI_ToggleEmulationPause(); turbo = false; } - else if (turbo && (currFrameCounter &0xf)) - return; } //update the number of items @@ -225,15 +207,15 @@ void UpdateTasEdit() //update the cursor if(currFrameCounter != lastCursor) { - //update the old and new rows - ListView_Update(hwndList,lastCursor); - ListView_Update(hwndList,currFrameCounter); - lastCursor = currFrameCounter; FollowPlayback(); + //update the old and new rows + ListView_RedrawItems(hwndList,lastCursor,lastCursor); + ListView_RedrawItems(hwndList,currFrameCounter,currFrameCounter); + UpdateWindow(hwndList); + lastCursor = currFrameCounter; } - - static int old_movie_readonly=-1; - if ((!old_movie_readonly) == movie_readonly) //Originally (old_movie_readonly = movie_readonly) + // update window caption + if ((!old_movie_readonly) == movie_readonly) { old_movie_readonly = movie_readonly; if (movie_readonly) @@ -254,6 +236,10 @@ void RedrawTasedit() { InvalidateRect(hwndTasEdit,0,FALSE); } +void RedrawTweakCount() +{ + InvalidateRect(hwndTasEdit,&rectTweakCount,FALSE); +} enum ECONTEXTMENU { @@ -310,10 +296,22 @@ void InvalidateGreenZone(int after) currMovieData.greenZoneCount = after+1; // increase tweakCount currMovieData.tweakCount++; - RedrawTasedit(); + RedrawTweakCount(); + // either set playback cursor to the end of greenzone or run seeking to restore playback position if (currFrameCounter >= currMovieData.greenZoneCount) - JumpToFrame(currMovieData.greenZoneCount-1); + { + if (TASEdit_restore_position) + { + JumpToFrame(currFrameCounter); + turbo = true; + } else + { + JumpToFrame(currMovieData.greenZoneCount-1); + } + } } + // redraw list even if greenzone didn't change + RedrawList(); } /* A function that tries jumping to a given frame. If unsuccessful, it than tries to jump to @@ -331,12 +329,9 @@ bool JumpToFrame(int index) if (JumpToFrame(currMovieData.greenZoneCount-1)) { // continue from the end of greenzone - if (FCEUI_EmulationPaused()) - FCEUI_ToggleEmulationPause(); - + if (FCEUI_EmulationPaused()) FCEUI_ToggleEmulationPause(); turbo = (currMovieData.greenZoneCount-1+FRAMES_TOO_FAR < index); - pauseframe=index+1; - + pauseframe = index+1; return true; } return false; @@ -403,13 +398,9 @@ void DoubleClick(LPNMITEMACTIVATE info) { //update one row currMovieData.records[index].toggleBit(joy,bit); - - ListView_Update(hwndList,index); + //ListView_RedrawItems(hwndList,index,index); } - InvalidateGreenZone(index); - //redraw everything to show the reduced green zone - RedrawList(); } } @@ -440,8 +431,6 @@ static void InsertFrames() currMovieData.insertEmpty(*it,1); } - if (currFrameCounter>=*selectionFrames.begin()) - JumpToFrame(*selectionFrames.begin()); InvalidateGreenZone(*selectionFrames.begin()); UpdateTasEdit(); RedrawList(); @@ -468,15 +457,9 @@ static void DeleteFrames() int index = *selectionFrames.begin(); if (index>0) --index; - InvalidateGreenZone(index); - - //in the particular case of deletion, we need to make sure we reset currFrameCounter to something reasonable - //why not the current green zone max? - if (currFrameCounter>=index) - JumpToFrame(index); ClearSelection(); + InvalidateGreenZone(index); UpdateTasEdit(); - RedrawList(); } //the column set operation, for setting a button for a span of selected values @@ -518,17 +501,8 @@ static void ColumnSet(int column) for(TSelectionFrames::iterator it(selectionFrames.begin()); it != selectionFrames.end(); it++) { currMovieData.records[*it].setBitValue(joy,button,newValue); - //we would do this if we wanted to update the affected record. but that results in big operations - //redrawing once per item set, which causes it to flicker and take forever. - //so now we rely on the update at the end. - //ListView_Update(hwndList,*it); } - - //reduce the green zone InvalidateGreenZone(*selectionFrames.begin()); - - //redraw everything to show the reduced green zone - RedrawList(); } //Highlights all frames in current input log @@ -696,11 +670,8 @@ static bool Paste() pGlobal = strchr(pGlobal, '\n'); } - - // Invalidate and redraw. InvalidateGreenZone(*selectionFrames.begin()); - RedrawList(); - result=true; + result = true; } GlobalUnlock(hGlobal); @@ -809,9 +780,9 @@ static void InitDialog() //setup columns LVCOLUMN lvc; int colidx=0; - // arrow column - it's kinda obsolete now + // arrow column lvc.mask = LVCF_WIDTH; - lvc.cx = 12; + lvc.cx = 14; ListView_InsertColumn(hwndList, colidx++, &lvc); // frame number column lvc.mask = LVCF_WIDTH | LVCF_TEXT; @@ -819,7 +790,7 @@ static void InitDialog() lvc.pszText = "Frame#"; ListView_InsertColumn(hwndList, colidx++, &lvc); // pads columns - lvc.cx = 20; + lvc.cx = 21; // add pads 1 and 2 for (int joy = 0; joy < 2; ++joy) { @@ -839,7 +810,7 @@ void AddFourscoreColumns() { LVCOLUMN lvc; lvc.mask = LVCF_WIDTH | LVCF_TEXT; - lvc.cx = 20; + lvc.cx = 21; int colidx = COLUMN_JOYPAD3_A; for (int joy = 0; joy < 2; ++joy) { @@ -1052,9 +1023,7 @@ static void Truncate() currMovieData.truncateAt(frame+1); InvalidateGreenZone(frame); - //currMovieData.TryDumpIncremental(); UpdateTasEdit(); - } //likewise, handles a changed item range from the listview @@ -1111,7 +1080,6 @@ BOOL CALLBACK WndprocTasEdit(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar else sprintf(temp,""); SetWindowText(hwndTweakCount,temp); - RedrawTasedit(); } break; case WM_INITDIALOG: @@ -1121,22 +1089,23 @@ BOOL CALLBACK WndprocTasEdit(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar hwndList = GetDlgItem(hwndDlg,IDC_LIST1); hwndTweakCount = GetDlgItem(hwndDlg,IDC_TWEAKCOUNT); + GetClientRect(hwndTweakCount, &rectTweakCount); InitDialog(); break; - case WM_MOVE: { - if (!IsIconic(hwndDlg)) { - RECT wrect; - GetWindowRect(hwndDlg,&wrect); - TasEdit_wndx = wrect.left; - TasEdit_wndy = wrect.top; + case WM_MOVE: + { + if (!IsIconic(hwndDlg)) + { + RECT wrect; + GetWindowRect(hwndDlg,&wrect); + TasEdit_wndx = wrect.left; + TasEdit_wndy = wrect.top; - #ifdef WIN32 - WindowBoundsCheckNoResize(TasEdit_wndx,TasEdit_wndy,wrect.right); - #endif + WindowBoundsCheckNoResize(TasEdit_wndx,TasEdit_wndy,wrect.right); } break; - } + } case WM_NOTIFY: @@ -1254,16 +1223,8 @@ BOOL CALLBACK WndprocTasEdit(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar case ID_EDIT_TRUNCATE: case ID_CONTEXT_SELECTED_TRUNCATE: case ID_CONTEXT_STRAY_TRUNCATE: - case IDC_HACKY1: Truncate(); break; - - case IDC_HACKY2: - //hacky2: delete earlier savestates (conserve memory) - //LockGreenZone(currFrameCounter); - //UpdateTasEdit(); - break; - case ACCEL_CTRL_B: case ID_EDIT_BRANCH: case ID_CONTEXT_SELECTED_BRANCH: @@ -1276,13 +1237,23 @@ BOOL CALLBACK WndprocTasEdit(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar break; case MENU_CONTEXT_STRAY_INSERTFRAMES: + case ID_CONTEXT_SELECTED_INSERTFRAMES2: { int frames; if(CWin32InputBox::GetInteger("Insert Frames", "How many frames?", frames, hwndDlg) == IDOK) { - currMovieData.insertEmpty(currFrameCounter,frames); - InvalidateGreenZone(currFrameCounter); - RedrawList(); + if (selectionFrames.size()) + { + // insert at selection + int index = *selectionFrames.begin(); + currMovieData.insertEmpty(index,frames); + InvalidateGreenZone(index); + } else + { + // insert at playback cursor + currMovieData.insertEmpty(currFrameCounter,frames); + InvalidateGreenZone(currFrameCounter); + } } } break; @@ -1341,8 +1312,11 @@ BOOL CALLBACK WndprocTasEdit(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar //switch "Show Tweak count" flag TASEdit_show_tweak_count ^= 1; CheckMenuItem(hmenu, ID_VIEW_SHOW_TWEAK_COUNT, TASEdit_show_tweak_count?MF_CHECKED : MF_UNCHECKED); - - //RedrawList(); + RedrawTweakCount(); + break; + case CHECK_AUTORESTORE_PLAYBACK: + TASEdit_restore_position ^= 1; + CheckDlgButton(hwndTasEdit,CHECK_AUTORESTORE_PLAYBACK,TASEdit_restore_position?BST_CHECKED:BST_UNCHECKED); break; } @@ -1365,13 +1339,32 @@ void FollowPlayback() if (TASEdit_follow_playback) ListView_EnsureVisible(hwndList,currFrameCounter,FALSE); } -void DoTasEdit() +void EnterTasEdit() { if(!FCEU_IsValidUI(FCEUI_TASEDIT)) return; lastCursor = -1; - EnterTasEdit(); + // either start new project or use current movie + if (movieMode == MOVIEMODE_INACTIVE) + { + FCEUI_StopMovie(); + CreateCleanMovie(); + //reset the rom + poweron(true); + currFrameCounter = 0; + } + else + { + //use current movie to create a new project + FCEUI_StopMovie(); + } + // pause the emulator and enter tasedit mode + FCEUI_SetEmulationPaused(1); + FCEU_DispMessage("Tasedit engaged",0); + movieMode = MOVIEMODE_TASEDIT; + currMovieData.TryDumpIncremental(); + // window stuff if(!hwndTasEdit) hwndTasEdit = CreateDialog(fceu_hInstance,"TASEDIT",hAppWnd,WndprocTasEdit); if(hwndTasEdit) { @@ -1383,6 +1376,7 @@ void DoTasEdit() CheckMenuItem(hmenu, ID_VIEW_FOLLOW_PLAYBACK, TASEdit_follow_playback?MF_CHECKED : MF_UNCHECKED); CheckMenuItem(hmenu, ID_VIEW_SHOW_LAG_FRAMES, TASEdit_show_lag_frames?MF_CHECKED : MF_UNCHECKED); CheckMenuItem(hmenu, ID_VIEW_SHOW_TWEAK_COUNT, TASEdit_show_tweak_count?MF_CHECKED : MF_UNCHECKED); + CheckDlgButton(hwndTasEdit,CHECK_AUTORESTORE_PLAYBACK,TASEdit_restore_position?BST_CHECKED:BST_UNCHECKED); SetWindowPos(hwndTasEdit,HWND_TOP,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE|SWP_NOOWNERZORDER); } diff --git a/src/drivers/win/tasedit.h b/src/drivers/win/tasedit.h index 2b79c1a9..067407ca 100644 --- a/src/drivers/win/tasedit.h +++ b/src/drivers/win/tasedit.h @@ -55,7 +55,8 @@ #define LAG_INPUT_COLOR2 0xB8B3E2 // ----------------------------- -void DoTasEdit(); +void EnterTasEdit(); +void ExitTasEdit(); void UpdateTasEdit(); void InvalidateGreenZone(int after); bool JumpToFrame(int index); @@ -63,5 +64,6 @@ int FindBeginningOfGreenZone(int starting_index); void FollowPlayback(); void AddFourscoreColumns(); void RemoveFourscoreColumns(); -void EnterTasEdit(); -void ExitTasEdit(); +void RedrawList(); +void RedrawTasedit(); +void RedrawTweakCount(); \ No newline at end of file diff --git a/src/drivers/win/window.cpp b/src/drivers/win/window.cpp index 7f970cc1..a35509aa 100644 --- a/src/drivers/win/window.cpp +++ b/src/drivers/win/window.cpp @@ -1904,7 +1904,7 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam) // Removing this tool since it is redundant to both case ACCEL_CTRL_E: case MENU_TASEDIT: - DoTasEdit(); + EnterTasEdit(); break; case MENU_CONVERT_MOVIE: ConvertFCM(hWnd); diff --git a/src/movie.cpp b/src/movie.cpp index eeb0240a..b5d86023 100644 --- a/src/movie.cpp +++ b/src/movie.cpp @@ -1094,23 +1094,23 @@ void FCEUMOV_AddInputState() if(movieMode == MOVIEMODE_TASEDIT) { MovieRecord* mr = &currMovieData.records[currFrameCounter]; - if(movie_readonly) + if(movie_readonly || turbo || pauseframe > currFrameCounter) { + // do not record buttons //reset if necessary - if(mr->command_reset()) - ResetNES(); - + if(mr->command_reset()) ResetNES(); joyports[0].load(mr); joyports[1].load(mr); } else { + // record buttons if (currMovieData.greenZoneCount>currFrameCounter+1) { - InvalidateGreenZone(currFrameCounter); - } + // TODO: multitracking + joyports[0].log(mr); joyports[1].log(mr); mr->commands = 0; diff --git a/src/movie.h b/src/movie.h index e664fc69..cde623b0 100644 --- a/src/movie.h +++ b/src/movie.h @@ -13,8 +13,6 @@ #include "utils/guid.h" #include "utils/md5.h" -extern int InputType[3]; - struct FCEUFILE; enum EMOVIE_FLAG diff --git a/src/version.h b/src/version.h index 58c3323c..661da90d 100644 --- a/src/version.h +++ b/src/version.h @@ -58,8 +58,8 @@ #define FCEU_COMPILER_DETAIL "" #endif -#define FCEU_VERSION_NUMERIC 21040 -#define FCEU_VERSION_STRING "2.1.5" FCEU_SUBVERSION_STRING FCEU_FEATURE_STRING FCEU_COMPILER +#define FCEU_VERSION_NUMERIC 21060 +#define FCEU_VERSION_STRING "2.1.6" FCEU_SUBVERSION_STRING FCEU_FEATURE_STRING FCEU_COMPILER #define FCEU_NAME_AND_VERSION FCEU_NAME " " FCEU_VERSION_STRING #endif