diff --git a/src/drivers/win/config.cpp b/src/drivers/win/config.cpp index 5d9015dd..dab1faba 100644 --- a/src/drivers/win/config.cpp +++ b/src/drivers/win/config.cpp @@ -320,10 +320,11 @@ static CFGSTRUCT fceuconfig[] = { AC(taseditor_config.use_1p_rec), AC(taseditor_config.columnset_by_keys), AC(taseditor_config.branch_full_movie), - AC(taseditor_config.branch_only_when_rec), + AC(taseditor_config.old_branching_controls), AC(taseditor_config.view_branches_tree), AC(taseditor_config.branch_scr_hud), AC(taseditor_config.restore_position), + AC(taseditor_config.adjust_input_due_to_lag), AC(taseditor_config.superimpose), AC(taseditor_config.enable_auto_function), AC(taseditor_config.enable_hot_changes), diff --git a/src/drivers/win/res.rc b/src/drivers/win/res.rc index 85753716..d7d0f689 100644 --- a/src/drivers/win/res.rc +++ b/src/drivers/win/res.rc @@ -286,7 +286,7 @@ BEGIN MENUITEM "Bind Markers to Input", ID_CONFIG_BINDMARKERSTOINPUT,MFT_STRING,MFS_ENABLED MENUITEM "Empty new Marker Notes", ID_CONFIG_EMPTYNEWMARKERNOTES,MFT_STRING,MFS_ENABLED MENUITEM MFT_SEPARATOR - MENUITEM "Branches work only when Recording", ID_CONFIG_BRANCHESWORKONLYWHENRECORDING,MFT_STRING,MFS_ENABLED + MENUITEM "Old control scheme for Branching", ID_CONFIG_OLDBRANCHINGCONTROLS,MFT_STRING,MFS_ENABLED MENUITEM "Branches restore entire Movie", ID_CONFIG_BRANCHESRESTOREFULLMOVIE,MFT_STRING,MFS_ENABLED MENUITEM "HUD in Branch screenshots", ID_CONFIG_HUDINBRANCHSCREENSHOTS,MFT_STRING,MFS_ENABLED MENUITEM MFT_SEPARATOR @@ -294,7 +294,7 @@ BEGIN END POPUP "Help", 65535,MFT_STRING,MFS_ENABLED BEGIN - MENUITEM "TAS Editor Help", ID_HELP_TASEDITORHELP,MFT_STRING,MFS_ENABLED + MENUITEM "Open TAS Editor Manual", ID_HELP_TASEDITORHELP,MFT_STRING,MFS_ENABLED MENUITEM "Enable Tooltips", ID_HELP_TOOLTIPS,MFT_STRING,MFS_ENABLED MENUITEM MFT_SEPARATOR MENUITEM "About", ID_HELP_ABOUT,MFT_STRING,MFS_ENABLED @@ -1380,21 +1380,21 @@ BEGIN EDITTEXT IDC_LABEL_NEWPPUUSED,76,166,155,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP END -TASEDITOR DIALOGEX 0, 0, 325, 353 +TASEDITOR DIALOGEX 0, 0, 326, 359 STYLE DS_SETFONT | DS_SETFOREGROUND | DS_FIXEDSYS | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME CAPTION "TAS Editor" MENU TASEDITORMENU FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN CONTROL "",IDC_PROGRESS_BUTTON,"Button",BS_OWNERDRAW,200,36,116,12 - CONTROL "",IDC_BRANCHES_BUTTON,"Button",BS_OWNERDRAW,207,167,104,11 - CONTROL "",IDC_LIST1,"SysListView32",LVS_REPORT | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_OWNERDATA | LVS_NOSORTHEADER | WS_BORDER,5,13,187,320 - GROUPBOX " Playback ",IDC_PLAYBACK_BOX,197,0,123,62,BS_CENTER,WS_EX_RIGHT - GROUPBOX " Recorder ",IDC_RECORDER_BOX,197,63,123,46,BS_CENTER,WS_EX_RIGHT - GROUPBOX " Splicer ",IDC_SPLICER_BOX,197,110,123,30,BS_CENTER,WS_EX_RIGHT - GROUPBOX " Lua ",IDC_LUA_BOX,197,141,123,26,BS_CENTER,WS_EX_RIGHT - GROUPBOX " Bookmarks ",IDC_BOOKMARKS_BOX,197,169,123,102,BS_CENTER,WS_EX_RIGHT - GROUPBOX " History ",IDC_HISTORY_BOX,197,272,123,56,BS_CENTER,WS_EX_RIGHT + CONTROL "",IDC_BRANCHES_BUTTON,"Button",BS_OWNERDRAW,207,179,104,10 + CONTROL "",IDC_LIST1,"SysListView32",LVS_REPORT | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_OWNERDATA | LVS_NOSORTHEADER | WS_BORDER,5,13,187,328 + GROUPBOX " Playback ",IDC_PLAYBACK_BOX,197,0,123,75,BS_CENTER,WS_EX_RIGHT + GROUPBOX " Recorder ",IDC_RECORDER_BOX,197,75,123,46,BS_CENTER,WS_EX_RIGHT + GROUPBOX " Splicer ",IDC_SPLICER_BOX,197,122,123,30,BS_CENTER,WS_EX_RIGHT + GROUPBOX " Lua ",IDC_LUA_BOX,197,153,123,26,BS_CENTER,WS_EX_RIGHT + GROUPBOX " Bookmarks ",IDC_BOOKMARKS_BOX,197,180,123,102,BS_CENTER,WS_EX_RIGHT + GROUPBOX " History ",IDC_HISTORY_BOX,197,283,123,52,BS_CENTER,WS_EX_RIGHT PUSHBUTTON "<<",TASEDITOR_REWIND_FULL,201,9,23,14,NOT WS_TABSTOP PUSHBUTTON "<",TASEDITOR_REWIND,224,9,23,14,NOT WS_TABSTOP PUSHBUTTON "||",TASEDITOR_PLAYSTOP,247,9,23,14,NOT WS_TABSTOP @@ -1403,31 +1403,33 @@ BEGIN CONTROL "",IDC_PROGRESS1,"msctls_progress32",PBS_SMOOTH | WS_BORDER,201,39,115,6 CONTROL " Follow cursor",CHECK_FOLLOW_CURSOR,"Button",BS_AUTOCHECKBOX,203,25,56,12 CONTROL " Auto-restore last position",CHECK_AUTORESTORE_PLAYBACK, - "Button",BS_AUTOCHECKBOX,203,48,105,12 - CONTROL "",IDC_BOOKMARKSLIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_ALIGNLEFT | LVS_OWNERDATA | LVS_NOSCROLL | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | NOT WS_VISIBLE | WS_BORDER,202,178,113,89 - CONTROL "",IDC_HISTORYLIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOLABELWRAP | LVS_ALIGNLEFT | LVS_OWNERDATA | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER,202,282,113,42 - CONTROL " All",IDC_RADIO_ALL,"Button",BS_AUTORADIOBUTTON,291,71,24,10 - CONTROL " 1P",IDC_RADIO_1P,"Button",BS_AUTORADIOBUTTON,203,83,25,10 - CONTROL " 2P",IDC_RADIO_2P,"Button",BS_AUTORADIOBUTTON,232,83,25,10 - CONTROL " 3P",IDC_RADIO_3P,"Button",BS_AUTORADIOBUTTON,262,83,24,10 - CONTROL " 4P",IDC_RADIO_4P,"Button",BS_AUTORADIOBUTTON,291,83,24,10 - CONTROL " Superimpose",IDC_SUPERIMPOSE,"Button",BS_AUTO3STATE,203,96,55,10 - PUSHBUTTON "<<",TASEDITOR_PREV_MARKER,202,332,23,14,NOT WS_TABSTOP - PUSHBUTTON "Similar",TASEDITOR_FIND_BEST_SIMILAR_MARKER,225,332,34,14,NOT WS_TABSTOP - PUSHBUTTON "More",TASEDITOR_FIND_NEXT_SIMILAR_MARKER,259,332,34,14,NOT WS_TABSTOP - PUSHBUTTON ">>",TASEDITOR_NEXT_MARKER,292,332,23,14,NOT WS_TABSTOP + "Button",BS_AUTOCHECKBOX,203,48,109,12 + CONTROL "",IDC_BOOKMARKSLIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_ALIGNLEFT | LVS_OWNERDATA | LVS_NOSCROLL | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | NOT WS_VISIBLE | WS_BORDER,202,189,113,89 + CONTROL "",IDC_HISTORYLIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOLABELWRAP | LVS_ALIGNLEFT | LVS_OWNERDATA | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER,202,292,113,39 + CONTROL " All",IDC_RADIO_ALL,"Button",BS_AUTORADIOBUTTON,291,83,24,10 + CONTROL " 1P",IDC_RADIO_1P,"Button",BS_AUTORADIOBUTTON,203,95,25,10 + CONTROL " 2P",IDC_RADIO_2P,"Button",BS_AUTORADIOBUTTON,232,95,25,10 + CONTROL " 3P",IDC_RADIO_3P,"Button",BS_AUTORADIOBUTTON,262,95,24,10 + CONTROL " 4P",IDC_RADIO_4P,"Button",BS_AUTORADIOBUTTON,291,95,24,10 + CONTROL " Superimpose",IDC_SUPERIMPOSE,"Button",BS_AUTO3STATE,203,108,55,10 + PUSHBUTTON "<<",TASEDITOR_PREV_MARKER,202,340,23,14,NOT WS_TABSTOP + PUSHBUTTON "Similar",TASEDITOR_FIND_BEST_SIMILAR_MARKER,225,340,34,14,NOT WS_TABSTOP + PUSHBUTTON "More",TASEDITOR_FIND_NEXT_SIMILAR_MARKER,259,340,34,14,NOT WS_TABSTOP + PUSHBUTTON ">>",TASEDITOR_NEXT_MARKER,292,340,23,14,NOT WS_TABSTOP EDITTEXT IDC_PLAYBACK_MARKER_EDIT,65,0,127,13,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP RTEXT "Marker 0",IDC_PLAYBACK_MARKER,4,2,60,10,SS_NOTIFY,WS_EX_RIGHT - EDITTEXT IDC_SELECTION_MARKER_EDIT,65,333,127,13,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP - RTEXT "Marker 99999",IDC_SELECTION_MARKER,4,335,60,10,SS_NOTIFY,WS_EX_RIGHT - CONTROL "",IDC_BRANCHES_BITMAP,"Static",SS_OWNERDRAW | SS_NOTIFY | SS_REALSIZEIMAGE | NOT WS_VISIBLE,202,178,113,89 + EDITTEXT IDC_SELECTION_MARKER_EDIT,65,341,127,13,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP + RTEXT "Marker 99999",IDC_SELECTION_MARKER,4,343,60,10,SS_NOTIFY,WS_EX_RIGHT + CONTROL "",IDC_BRANCHES_BITMAP,"Static",SS_OWNERDRAW | SS_NOTIFY | SS_REALSIZEIMAGE | NOT WS_VISIBLE,202,189,113,89 CONTROL " Turbo seek",CHECK_TURBO_SEEK,"Button",BS_AUTOCHECKBOX,263,25,50,12 - LTEXT "Selection: 0 rows, 16 columns",IDC_TEXT_SELECTION,204,118,112,10,SS_NOTIFY - LTEXT "Clipboard: 0 rows, 16 columns",IDC_TEXT_CLIPBOARD,203,128,114,10,SS_NOTIFY - CONTROL " Recording",IDC_RECORDING,"Button",BS_AUTO3STATE,203,71,64,10 - PUSHBUTTON "Run function",TASEDITOR_RUN_MANUAL,202,150,54,14,WS_DISABLED | NOT WS_TABSTOP - CONTROL "Auto function",IDC_RUN_AUTO,"Button",BS_AUTOCHECKBOX,261,152,55,10 - CONTROL " Use pattern",IDC_USEPATTERN,"Button",BS_AUTOCHECKBOX,262,96,53,10 + LTEXT "Selection: 0 rows, 16 columns",IDC_TEXT_SELECTION,204,130,112,10,SS_NOTIFY + LTEXT "Clipboard: 0 rows, 16 columns",IDC_TEXT_CLIPBOARD,203,140,114,10,SS_NOTIFY + CONTROL " Recording",IDC_RECORDING,"Button",BS_AUTO3STATE,203,83,64,10 + PUSHBUTTON "Run function",TASEDITOR_RUN_MANUAL,202,162,54,14,WS_DISABLED | NOT WS_TABSTOP + CONTROL "Auto function",IDC_RUN_AUTO,"Button",BS_AUTOCHECKBOX,261,164,55,10 + CONTROL " Use pattern",IDC_USEPATTERN,"Button",BS_AUTOCHECKBOX,262,108,53,10 + CONTROL " Auto-adjust Input due to lag",CHECK_AUTOADJUSTINPUTDUETOLAG, + "Button",BS_AUTOCHECKBOX,203,61,109,12 END IDD_TASEDITOR_ABOUT DIALOGEX 0, 0, 238, 78 @@ -1986,8 +1988,6 @@ BEGIN "TASEDITOR", DIALOG BEGIN - RIGHTMARGIN, 323 - BOTTOMMARGIN, 351 END IDD_TASEDITOR_ABOUT, DIALOG @@ -2080,6 +2080,7 @@ END #endif // Нейтральный resources ///////////////////////////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////////////////// // Английский (США) resources @@ -2255,46 +2256,66 @@ IDB_PIANO_16 BITMAP "res\\te_piano_16.bmp" IDB_PIANO_17 BITMAP "res\\te_piano_17.bmp" IDB_PIANO_18 BITMAP "res\\te_piano_18.bmp" IDB_PIANO_19 BITMAP "res\\te_piano_19.bmp" -IDB_PIANO_PLAYBACK_0 BITMAP "res\\te_piano_0_playback.bmp" -IDB_PIANO_PLAYBACK_1 BITMAP "res\\te_piano_1_playback.bmp" -IDB_PIANO_PLAYBACK_2 BITMAP "res\\te_piano_2_playback.bmp" -IDB_PIANO_PLAYBACK_3 BITMAP "res\\te_piano_3_playback.bmp" -IDB_PIANO_PLAYBACK_4 BITMAP "res\\te_piano_4_playback.bmp" -IDB_PIANO_PLAYBACK_5 BITMAP "res\\te_piano_5_playback.bmp" -IDB_PIANO_PLAYBACK_6 BITMAP "res\\te_piano_6_playback.bmp" -IDB_PIANO_PLAYBACK_7 BITMAP "res\\te_piano_7_playback.bmp" -IDB_PIANO_PLAYBACK_8 BITMAP "res\\te_piano_8_playback.bmp" -IDB_PIANO_PLAYBACK_9 BITMAP "res\\te_piano_9_playback.bmp" -IDB_PIANO_PLAYBACK_10 BITMAP "res\\te_piano_10_playback.bmp" -IDB_PIANO_PLAYBACK_11 BITMAP "res\\te_piano_11_playback.bmp" -IDB_PIANO_PLAYBACK_12 BITMAP "res\\te_piano_12_playback.bmp" -IDB_PIANO_PLAYBACK_13 BITMAP "res\\te_piano_13_playback.bmp" -IDB_PIANO_PLAYBACK_14 BITMAP "res\\te_piano_14_playback.bmp" -IDB_PIANO_PLAYBACK_15 BITMAP "res\\te_piano_15_playback.bmp" -IDB_PIANO_PLAYBACK_16 BITMAP "res\\te_piano_16_playback.bmp" -IDB_PIANO_PLAYBACK_17 BITMAP "res\\te_piano_17_playback.bmp" -IDB_PIANO_PLAYBACK_18 BITMAP "res\\te_piano_18_playback.bmp" -IDB_PIANO_PLAYBACK_19 BITMAP "res\\te_piano_19_playback.bmp" -IDB_PIANO_LOSTPOS_0 BITMAP "res\\te_piano_0_lostpos.bmp" -IDB_PIANO_LOSTPOS_1 BITMAP "res\\te_piano_1_lostpos.bmp" -IDB_PIANO_LOSTPOS_2 BITMAP "res\\te_piano_2_lostpos.bmp" -IDB_PIANO_LOSTPOS_3 BITMAP "res\\te_piano_3_lostpos.bmp" -IDB_PIANO_LOSTPOS_4 BITMAP "res\\te_piano_4_lostpos.bmp" -IDB_PIANO_LOSTPOS_5 BITMAP "res\\te_piano_5_lostpos.bmp" -IDB_PIANO_LOSTPOS_6 BITMAP "res\\te_piano_6_lostpos.bmp" -IDB_PIANO_LOSTPOS_7 BITMAP "res\\te_piano_7_lostpos.bmp" -IDB_PIANO_LOSTPOS_8 BITMAP "res\\te_piano_8_lostpos.bmp" -IDB_PIANO_LOSTPOS_9 BITMAP "res\\te_piano_9_lostpos.bmp" -IDB_PIANO_LOSTPOS_10 BITMAP "res\\te_piano_10_lostpos.bmp" -IDB_PIANO_LOSTPOS_11 BITMAP "res\\te_piano_11_lostpos.bmp" -IDB_PIANO_LOSTPOS_12 BITMAP "res\\te_piano_12_lostpos.bmp" -IDB_PIANO_LOSTPOS_13 BITMAP "res\\te_piano_13_lostpos.bmp" -IDB_PIANO_LOSTPOS_14 BITMAP "res\\te_piano_14_lostpos.bmp" -IDB_PIANO_LOSTPOS_15 BITMAP "res\\te_piano_15_lostpos.bmp" -IDB_PIANO_LOSTPOS_16 BITMAP "res\\te_piano_16_lostpos.bmp" -IDB_PIANO_LOSTPOS_17 BITMAP "res\\te_piano_17_lostpos.bmp" -IDB_PIANO_LOSTPOS_18 BITMAP "res\\te_piano_18_lostpos.bmp" -IDB_PIANO_LOSTPOS_19 BITMAP "res\\te_piano_19_lostpos.bmp" +IDB_PIANO_PLAYBACK_0 BITMAP "res\\te_piano_0_playback.bmp" +IDB_PIANO_PLAYBACK_1 BITMAP "res\\te_piano_1_playback.bmp" +IDB_PIANO_PLAYBACK_2 BITMAP "res\\te_piano_2_playback.bmp" +IDB_PIANO_PLAYBACK_3 BITMAP "res\\te_piano_3_playback.bmp" +IDB_PIANO_PLAYBACK_4 BITMAP "res\\te_piano_4_playback.bmp" +IDB_PIANO_PLAYBACK_5 BITMAP "res\\te_piano_5_playback.bmp" +IDB_PIANO_PLAYBACK_6 BITMAP "res\\te_piano_6_playback.bmp" +IDB_PIANO_PLAYBACK_7 BITMAP "res\\te_piano_7_playback.bmp" +IDB_PIANO_PLAYBACK_8 BITMAP "res\\te_piano_8_playback.bmp" +IDB_PIANO_PLAYBACK_9 BITMAP "res\\te_piano_9_playback.bmp" +IDB_PIANO_PLAYBACK_10 BITMAP "res\\te_piano_10_playback.bmp" +IDB_PIANO_PLAYBACK_11 BITMAP "res\\te_piano_11_playback.bmp" +IDB_PIANO_PLAYBACK_12 BITMAP "res\\te_piano_12_playback.bmp" +IDB_PIANO_PLAYBACK_13 BITMAP "res\\te_piano_13_playback.bmp" +IDB_PIANO_PLAYBACK_14 BITMAP "res\\te_piano_14_playback.bmp" +IDB_PIANO_PLAYBACK_15 BITMAP "res\\te_piano_15_playback.bmp" +IDB_PIANO_PLAYBACK_16 BITMAP "res\\te_piano_16_playback.bmp" +IDB_PIANO_PLAYBACK_17 BITMAP "res\\te_piano_17_playback.bmp" +IDB_PIANO_PLAYBACK_18 BITMAP "res\\te_piano_18_playback.bmp" +IDB_PIANO_PLAYBACK_19 BITMAP "res\\te_piano_19_playback.bmp" +IDB_PIANO_LOSTPOS_0 BITMAP "res\\te_piano_0_lostpos.bmp" +IDB_PIANO_LOSTPOS_1 BITMAP "res\\te_piano_1_lostpos.bmp" +IDB_PIANO_LOSTPOS_2 BITMAP "res\\te_piano_2_lostpos.bmp" +IDB_PIANO_LOSTPOS_3 BITMAP "res\\te_piano_3_lostpos.bmp" +IDB_PIANO_LOSTPOS_4 BITMAP "res\\te_piano_4_lostpos.bmp" +IDB_PIANO_LOSTPOS_5 BITMAP "res\\te_piano_5_lostpos.bmp" +IDB_PIANO_LOSTPOS_6 BITMAP "res\\te_piano_6_lostpos.bmp" +IDB_PIANO_LOSTPOS_7 BITMAP "res\\te_piano_7_lostpos.bmp" +IDB_PIANO_LOSTPOS_8 BITMAP "res\\te_piano_8_lostpos.bmp" +IDB_PIANO_LOSTPOS_9 BITMAP "res\\te_piano_9_lostpos.bmp" +IDB_PIANO_LOSTPOS_10 BITMAP "res\\te_piano_10_lostpos.bmp" +IDB_PIANO_LOSTPOS_11 BITMAP "res\\te_piano_11_lostpos.bmp" +IDB_PIANO_LOSTPOS_12 BITMAP "res\\te_piano_12_lostpos.bmp" +IDB_PIANO_LOSTPOS_13 BITMAP "res\\te_piano_13_lostpos.bmp" +IDB_PIANO_LOSTPOS_14 BITMAP "res\\te_piano_14_lostpos.bmp" +IDB_PIANO_LOSTPOS_15 BITMAP "res\\te_piano_15_lostpos.bmp" +IDB_PIANO_LOSTPOS_16 BITMAP "res\\te_piano_16_lostpos.bmp" +IDB_PIANO_LOSTPOS_17 BITMAP "res\\te_piano_17_lostpos.bmp" +IDB_PIANO_LOSTPOS_18 BITMAP "res\\te_piano_18_lostpos.bmp" +IDB_PIANO_LOSTPOS_19 BITMAP "res\\te_piano_19_lostpos.bmp" +IDB_BITMAP_SELECTED0 BITMAP "res\\te_0_selected.bmp" +IDB_BITMAP_SELECTED1 BITMAP "res\\te_1_selected.bmp" +IDB_BITMAP_SELECTED2 BITMAP "res\\te_2_selected.bmp" +IDB_BITMAP_SELECTED3 BITMAP "res\\te_3_selected.bmp" +IDB_BITMAP_SELECTED4 BITMAP "res\\te_4_selected.bmp" +IDB_BITMAP_SELECTED5 BITMAP "res\\te_5_selected.bmp" +IDB_BITMAP_SELECTED6 BITMAP "res\\te_6_selected.bmp" +IDB_BITMAP_SELECTED7 BITMAP "res\\te_7_selected.bmp" +IDB_BITMAP_SELECTED8 BITMAP "res\\te_8_selected.bmp" +IDB_BITMAP_SELECTED9 BITMAP "res\\te_9_selected.bmp" +IDB_BITMAP_SELECTED10 BITMAP "res\\te_10_selected.bmp" +IDB_BITMAP_SELECTED11 BITMAP "res\\te_11_selected.bmp" +IDB_BITMAP_SELECTED12 BITMAP "res\\te_12_selected.bmp" +IDB_BITMAP_SELECTED13 BITMAP "res\\te_13_selected.bmp" +IDB_BITMAP_SELECTED14 BITMAP "res\\te_14_selected.bmp" +IDB_BITMAP_SELECTED15 BITMAP "res\\te_15_selected.bmp" +IDB_BITMAP_SELECTED16 BITMAP "res\\te_16_selected.bmp" +IDB_BITMAP_SELECTED17 BITMAP "res\\te_17_selected.bmp" +IDB_BITMAP_SELECTED18 BITMAP "res\\te_18_selected.bmp" +IDB_BITMAP_SELECTED19 BITMAP "res\\te_19_selected.bmp" IDB_BRANCH_SPRITESHEET BITMAP "res\\branch_spritesheet.bmp" #endif // Английский (США) resources ///////////////////////////////////////////////////////////////////////////// diff --git a/src/drivers/win/res/te_0.bmp b/src/drivers/win/res/te_0.bmp index a918125c..b6dc1d34 100644 Binary files a/src/drivers/win/res/te_0.bmp and b/src/drivers/win/res/te_0.bmp differ diff --git a/src/drivers/win/res/te_0_selected.bmp b/src/drivers/win/res/te_0_selected.bmp new file mode 100644 index 00000000..15c14954 Binary files /dev/null and b/src/drivers/win/res/te_0_selected.bmp differ diff --git a/src/drivers/win/res/te_1.bmp b/src/drivers/win/res/te_1.bmp index a776cb85..3eeb99c1 100644 Binary files a/src/drivers/win/res/te_1.bmp and b/src/drivers/win/res/te_1.bmp differ diff --git a/src/drivers/win/res/te_10.bmp b/src/drivers/win/res/te_10.bmp index 2445c23a..168fac07 100644 Binary files a/src/drivers/win/res/te_10.bmp and b/src/drivers/win/res/te_10.bmp differ diff --git a/src/drivers/win/res/te_10_selected.bmp b/src/drivers/win/res/te_10_selected.bmp new file mode 100644 index 00000000..03e20342 Binary files /dev/null and b/src/drivers/win/res/te_10_selected.bmp differ diff --git a/src/drivers/win/res/te_11.bmp b/src/drivers/win/res/te_11.bmp index d4d19693..13056ff6 100644 Binary files a/src/drivers/win/res/te_11.bmp and b/src/drivers/win/res/te_11.bmp differ diff --git a/src/drivers/win/res/te_11_selected.bmp b/src/drivers/win/res/te_11_selected.bmp new file mode 100644 index 00000000..35fe1527 Binary files /dev/null and b/src/drivers/win/res/te_11_selected.bmp differ diff --git a/src/drivers/win/res/te_12.bmp b/src/drivers/win/res/te_12.bmp index f7e43c67..2178b1aa 100644 Binary files a/src/drivers/win/res/te_12.bmp and b/src/drivers/win/res/te_12.bmp differ diff --git a/src/drivers/win/res/te_12_selected.bmp b/src/drivers/win/res/te_12_selected.bmp new file mode 100644 index 00000000..b6c0fb5e Binary files /dev/null and b/src/drivers/win/res/te_12_selected.bmp differ diff --git a/src/drivers/win/res/te_13.bmp b/src/drivers/win/res/te_13.bmp index a8bdfc5a..5ac061e9 100644 Binary files a/src/drivers/win/res/te_13.bmp and b/src/drivers/win/res/te_13.bmp differ diff --git a/src/drivers/win/res/te_13_selected.bmp b/src/drivers/win/res/te_13_selected.bmp new file mode 100644 index 00000000..29bddaba Binary files /dev/null and b/src/drivers/win/res/te_13_selected.bmp differ diff --git a/src/drivers/win/res/te_14.bmp b/src/drivers/win/res/te_14.bmp index 8573ca3f..a8de040a 100644 Binary files a/src/drivers/win/res/te_14.bmp and b/src/drivers/win/res/te_14.bmp differ diff --git a/src/drivers/win/res/te_14_selected.bmp b/src/drivers/win/res/te_14_selected.bmp new file mode 100644 index 00000000..edc6480b Binary files /dev/null and b/src/drivers/win/res/te_14_selected.bmp differ diff --git a/src/drivers/win/res/te_15.bmp b/src/drivers/win/res/te_15.bmp index 44fa93bc..1c48d333 100644 Binary files a/src/drivers/win/res/te_15.bmp and b/src/drivers/win/res/te_15.bmp differ diff --git a/src/drivers/win/res/te_15_selected.bmp b/src/drivers/win/res/te_15_selected.bmp new file mode 100644 index 00000000..deb23aef Binary files /dev/null and b/src/drivers/win/res/te_15_selected.bmp differ diff --git a/src/drivers/win/res/te_16.bmp b/src/drivers/win/res/te_16.bmp index 62890997..e1863ef3 100644 Binary files a/src/drivers/win/res/te_16.bmp and b/src/drivers/win/res/te_16.bmp differ diff --git a/src/drivers/win/res/te_16_selected.bmp b/src/drivers/win/res/te_16_selected.bmp new file mode 100644 index 00000000..e2f56d03 Binary files /dev/null and b/src/drivers/win/res/te_16_selected.bmp differ diff --git a/src/drivers/win/res/te_17.bmp b/src/drivers/win/res/te_17.bmp index 805e6362..2b52cc5d 100644 Binary files a/src/drivers/win/res/te_17.bmp and b/src/drivers/win/res/te_17.bmp differ diff --git a/src/drivers/win/res/te_17_selected.bmp b/src/drivers/win/res/te_17_selected.bmp new file mode 100644 index 00000000..9c80b601 Binary files /dev/null and b/src/drivers/win/res/te_17_selected.bmp differ diff --git a/src/drivers/win/res/te_18.bmp b/src/drivers/win/res/te_18.bmp index e67a438b..0a73308f 100644 Binary files a/src/drivers/win/res/te_18.bmp and b/src/drivers/win/res/te_18.bmp differ diff --git a/src/drivers/win/res/te_18_selected.bmp b/src/drivers/win/res/te_18_selected.bmp new file mode 100644 index 00000000..b1b9c102 Binary files /dev/null and b/src/drivers/win/res/te_18_selected.bmp differ diff --git a/src/drivers/win/res/te_19.bmp b/src/drivers/win/res/te_19.bmp index 50940360..165830e0 100644 Binary files a/src/drivers/win/res/te_19.bmp and b/src/drivers/win/res/te_19.bmp differ diff --git a/src/drivers/win/res/te_19_selected.bmp b/src/drivers/win/res/te_19_selected.bmp new file mode 100644 index 00000000..39755a1e Binary files /dev/null and b/src/drivers/win/res/te_19_selected.bmp differ diff --git a/src/drivers/win/res/te_1_selected.bmp b/src/drivers/win/res/te_1_selected.bmp new file mode 100644 index 00000000..c7a33346 Binary files /dev/null and b/src/drivers/win/res/te_1_selected.bmp differ diff --git a/src/drivers/win/res/te_2.bmp b/src/drivers/win/res/te_2.bmp index 01cace95..0955dcc7 100644 Binary files a/src/drivers/win/res/te_2.bmp and b/src/drivers/win/res/te_2.bmp differ diff --git a/src/drivers/win/res/te_2_selected.bmp b/src/drivers/win/res/te_2_selected.bmp new file mode 100644 index 00000000..3f52bd2c Binary files /dev/null and b/src/drivers/win/res/te_2_selected.bmp differ diff --git a/src/drivers/win/res/te_3.bmp b/src/drivers/win/res/te_3.bmp index 5c46c0c7..f4eba8be 100644 Binary files a/src/drivers/win/res/te_3.bmp and b/src/drivers/win/res/te_3.bmp differ diff --git a/src/drivers/win/res/te_3_selected.bmp b/src/drivers/win/res/te_3_selected.bmp new file mode 100644 index 00000000..037f28b3 Binary files /dev/null and b/src/drivers/win/res/te_3_selected.bmp differ diff --git a/src/drivers/win/res/te_4.bmp b/src/drivers/win/res/te_4.bmp index 325f994d..1bbc2980 100644 Binary files a/src/drivers/win/res/te_4.bmp and b/src/drivers/win/res/te_4.bmp differ diff --git a/src/drivers/win/res/te_4_selected.bmp b/src/drivers/win/res/te_4_selected.bmp new file mode 100644 index 00000000..b1514c6e Binary files /dev/null and b/src/drivers/win/res/te_4_selected.bmp differ diff --git a/src/drivers/win/res/te_5.bmp b/src/drivers/win/res/te_5.bmp index dad6bae5..bda4e46d 100644 Binary files a/src/drivers/win/res/te_5.bmp and b/src/drivers/win/res/te_5.bmp differ diff --git a/src/drivers/win/res/te_5_selected.bmp b/src/drivers/win/res/te_5_selected.bmp new file mode 100644 index 00000000..a8fa43b1 Binary files /dev/null and b/src/drivers/win/res/te_5_selected.bmp differ diff --git a/src/drivers/win/res/te_6.bmp b/src/drivers/win/res/te_6.bmp index 9f55852e..53b52038 100644 Binary files a/src/drivers/win/res/te_6.bmp and b/src/drivers/win/res/te_6.bmp differ diff --git a/src/drivers/win/res/te_6_selected.bmp b/src/drivers/win/res/te_6_selected.bmp new file mode 100644 index 00000000..d1f6033e Binary files /dev/null and b/src/drivers/win/res/te_6_selected.bmp differ diff --git a/src/drivers/win/res/te_7.bmp b/src/drivers/win/res/te_7.bmp index 4ce42c35..7b49bb2f 100644 Binary files a/src/drivers/win/res/te_7.bmp and b/src/drivers/win/res/te_7.bmp differ diff --git a/src/drivers/win/res/te_7_selected.bmp b/src/drivers/win/res/te_7_selected.bmp new file mode 100644 index 00000000..b28d527e Binary files /dev/null and b/src/drivers/win/res/te_7_selected.bmp differ diff --git a/src/drivers/win/res/te_8.bmp b/src/drivers/win/res/te_8.bmp index c2e5c88d..8c3f13ae 100644 Binary files a/src/drivers/win/res/te_8.bmp and b/src/drivers/win/res/te_8.bmp differ diff --git a/src/drivers/win/res/te_8_selected.bmp b/src/drivers/win/res/te_8_selected.bmp new file mode 100644 index 00000000..5bd95189 Binary files /dev/null and b/src/drivers/win/res/te_8_selected.bmp differ diff --git a/src/drivers/win/res/te_9.bmp b/src/drivers/win/res/te_9.bmp index 6e864e59..e0661d34 100644 Binary files a/src/drivers/win/res/te_9.bmp and b/src/drivers/win/res/te_9.bmp differ diff --git a/src/drivers/win/res/te_9_selected.bmp b/src/drivers/win/res/te_9_selected.bmp new file mode 100644 index 00000000..03832b4d Binary files /dev/null and b/src/drivers/win/res/te_9_selected.bmp differ diff --git a/src/drivers/win/resource.h b/src/drivers/win/resource.h index 87adf848..2e77a721 100644 --- a/src/drivers/win/resource.h +++ b/src/drivers/win/resource.h @@ -242,26 +242,26 @@ #define IDC_DEBUGGER_FLAG_C 207 #define IDC_DEBUGGER_ENABLE_SYMBOLIC 208 #define IDB_TE_GREEN_BLUE_ARROW 208 -#define IDB_PIANO_0 209 -#define IDB_PIANO_1 210 -#define IDB_PIANO_2 211 -#define IDB_PIANO_3 212 -#define IDB_PIANO_4 213 -#define IDB_PIANO_5 214 -#define IDB_PIANO_6 215 -#define IDB_PIANO_7 216 -#define IDB_PIANO_8 217 -#define IDB_PIANO_9 218 -#define IDB_PIANO_10 219 -#define IDB_PIANO_11 220 -#define IDB_PIANO_12 221 -#define IDB_PIANO_13 222 -#define IDB_PIANO_14 223 -#define IDB_PIANO_15 224 -#define IDB_PIANO_16 225 -#define IDB_PIANO_17 226 -#define IDB_PIANO_18 227 -#define IDB_PIANO_19 228 +#define IDB_PIANO_0 209 +#define IDB_PIANO_1 210 +#define IDB_PIANO_2 211 +#define IDB_PIANO_3 212 +#define IDB_PIANO_4 213 +#define IDB_PIANO_5 214 +#define IDB_PIANO_6 215 +#define IDB_PIANO_7 216 +#define IDB_PIANO_8 217 +#define IDB_PIANO_9 218 +#define IDB_PIANO_10 219 +#define IDB_PIANO_11 220 +#define IDB_PIANO_12 221 +#define IDB_PIANO_13 222 +#define IDB_PIANO_14 223 +#define IDB_PIANO_15 224 +#define IDB_PIANO_16 225 +#define IDB_PIANO_17 226 +#define IDB_PIANO_18 227 +#define IDB_PIANO_19 228 #define IDB_PIANO_PLAYBACK_0 229 #define IDB_PIANO_PLAYBACK_1 230 #define IDB_PIANO_PLAYBACK_2 231 @@ -284,6 +284,7 @@ #define IDB_PIANO_PLAYBACK_19 248 #define IDB_PIANO_LOSTPOS_0 249 #define IDB_PIANO_LOSTPOS_1 250 +#define BTN_NETMOO_CONNECT 250 #define IDB_PIANO_LOSTPOS_2 251 #define IDB_PIANO_LOSTPOS_3 252 #define IDB_PIANO_LOSTPOS_4 253 @@ -302,7 +303,26 @@ #define IDB_PIANO_LOSTPOS_17 266 #define IDB_PIANO_LOSTPOS_18 267 #define IDB_PIANO_LOSTPOS_19 268 -#define BTN_NETMOO_CONNECT 250 +#define IDB_BITMAP_SELECTED0 269 +#define IDB_BITMAP_SELECTED1 270 +#define IDB_BITMAP_SELECTED2 271 +#define IDB_BITMAP_SELECTED3 272 +#define IDB_BITMAP_SELECTED4 273 +#define IDB_BITMAP_SELECTED5 274 +#define IDB_BITMAP_SELECTED6 275 +#define IDB_BITMAP_SELECTED7 276 +#define IDB_BITMAP_SELECTED8 277 +#define IDB_BITMAP_SELECTED9 278 +#define IDB_BITMAP_SELECTED10 279 +#define IDB_BITMAP_SELECTED11 280 +#define IDB_BITMAP_SELECTED12 281 +#define IDB_BITMAP_SELECTED13 282 +#define IDB_BITMAP_SELECTED14 283 +#define IDB_BITMAP_SELECTED15 284 +#define IDB_BITMAP_SELECTED16 285 +#define IDB_BITMAP_SELECTED17 286 +#define IDB_BITMAP_SELECTED18 287 +#define IDB_BITMAP_SELECTED19 288 #define MENU_HIDE_MENU 300 #define COMBO_FILTER 300 #define IDC_EDIT_AUTHORINFO 300 @@ -638,6 +658,8 @@ #define IDC_TEXT_CLIPBOARD 1268 #define IDC_RADIO_1PLAYER 1269 #define IDC_TEXT_SELECTION2 1269 +#define CHECK_AUTORESTORE_PLAYBACK2 1269 +#define CHECK_AUTOADJUSTINPUTDUETOLAG 1269 #define IDC_RADIO_2PLAYERS 1270 #define IDC_PLAYBACK_MARKER 1270 #define IDC_RADIO_FOURSCORE 1271 @@ -999,7 +1021,7 @@ #define ID_VIEW_X 40471 #define ID_VIEW_JUMPWHENMAKINGUNDO 40472 #define ID_CONFIG_BRANCHESRESTOREFULLMOVIE 40473 -#define ID_CONFIG_BRANCHESWORKONLYWHENRECORDING 40474 +#define ID_CONFIG_OLDBRANCHINGCONTROLS 40474 #define ID_CONFIG_HUDINBRANCHSCREENSHOTS 40475 #define ID_CONFIG_SETAUTOSAVEPERIOD 40476 #define ACCEL_CTRL_Q 40478 @@ -1082,7 +1104,7 @@ // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 269 +#define _APS_NEXT_RESOURCE_VALUE 289 #define _APS_NEXT_COMMAND_VALUE 40564 #define _APS_NEXT_CONTROL_VALUE 1281 #define _APS_NEXT_SYMED_VALUE 101 diff --git a/src/drivers/win/taseditor.cpp b/src/drivers/win/taseditor.cpp index 82b56d6e..192db6d6 100644 --- a/src/drivers/win/taseditor.cpp +++ b/src/drivers/win/taseditor.cpp @@ -7,13 +7,14 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------------ -Main - Logical center of the program +Main - Main gate between emulator and Taseditor [Singleton] * the point of launching TAS Editor from emulator * the point of quitting from TAS Editor * regularly (at the end of every frame) updates all modules that need regular update * implements operations of the "File" menu: creating New project, opening a file, saving, compact saving, import, export +* handles some FCEUX hotkeys ------------------------------------------------------------------------------------ */ #include @@ -21,6 +22,7 @@ Main - Logical center of the program #include "utils/xstring.h" #include "main.h" // for GetRomName #include "taseditor.h" +#include "../../input.h" using namespace std; @@ -774,3 +776,83 @@ bool TaseditorIsRecording() return true; // record } +// this gate handles FCEUX hotkeys (EMUCMD) +void Taseditor_EMUCMD(int command) +{ + switch (command) + { + case EMUCMD_SAVE_SLOT_0: + case EMUCMD_SAVE_SLOT_1: + case EMUCMD_SAVE_SLOT_2: + case EMUCMD_SAVE_SLOT_3: + case EMUCMD_SAVE_SLOT_4: + case EMUCMD_SAVE_SLOT_5: + case EMUCMD_SAVE_SLOT_6: + case EMUCMD_SAVE_SLOT_7: + case EMUCMD_SAVE_SLOT_8: + case EMUCMD_SAVE_SLOT_9: + { + if (taseditor_config.old_branching_controls) + bookmarks.command(COMMAND_SELECT, command - EMUCMD_SAVE_SLOT_0); + else + bookmarks.command(COMMAND_JUMP, command - EMUCMD_SAVE_SLOT_0); + break; + } + case EMUCMD_SAVE_SLOT_NEXT: + { + int slot = bookmarks.GetSelectedSlot() + 1; + if (slot >= TOTAL_BOOKMARKS) slot = 0; + bookmarks.command(COMMAND_SELECT, slot); + break; + } + case EMUCMD_SAVE_SLOT_PREV: + { + int slot = bookmarks.GetSelectedSlot() - 1; + if (slot < 0) slot = TOTAL_BOOKMARKS - 1; + bookmarks.command(COMMAND_SELECT, slot); + break; + } + case EMUCMD_SAVE_STATE: + bookmarks.command(COMMAND_SET); + break; + case EMUCMD_SAVE_STATE_SLOT_0: + case EMUCMD_SAVE_STATE_SLOT_1: + case EMUCMD_SAVE_STATE_SLOT_2: + case EMUCMD_SAVE_STATE_SLOT_3: + case EMUCMD_SAVE_STATE_SLOT_4: + case EMUCMD_SAVE_STATE_SLOT_5: + case EMUCMD_SAVE_STATE_SLOT_6: + case EMUCMD_SAVE_STATE_SLOT_7: + case EMUCMD_SAVE_STATE_SLOT_8: + case EMUCMD_SAVE_STATE_SLOT_9: + bookmarks.command(COMMAND_SET, command - EMUCMD_SAVE_STATE_SLOT_0); + break; + case EMUCMD_LOAD_STATE: + bookmarks.command(COMMAND_DEPLOY); + break; + case EMUCMD_LOAD_STATE_SLOT_0: + case EMUCMD_LOAD_STATE_SLOT_1: + case EMUCMD_LOAD_STATE_SLOT_2: + case EMUCMD_LOAD_STATE_SLOT_3: + case EMUCMD_LOAD_STATE_SLOT_4: + case EMUCMD_LOAD_STATE_SLOT_5: + case EMUCMD_LOAD_STATE_SLOT_6: + case EMUCMD_LOAD_STATE_SLOT_7: + case EMUCMD_LOAD_STATE_SLOT_8: + case EMUCMD_LOAD_STATE_SLOT_9: + bookmarks.command(COMMAND_DEPLOY, command - EMUCMD_LOAD_STATE_SLOT_0); + break; + case EMUCMD_RELOAD: + taseditor_window.LoadRecentProject(0); + break; + case EMUCMD_TASEDITOR_RESTORE_PLAYBACK: + playback.RestorePosition(); + break; + case EMUCMD_TASEDITOR_CANCEL_SEEKING: + playback.CancelSeeking(); + break; + + } +} + + diff --git a/src/drivers/win/taseditor.h b/src/drivers/win/taseditor.h index ff383091..3cd958c2 100644 --- a/src/drivers/win/taseditor.h +++ b/src/drivers/win/taseditor.h @@ -30,3 +30,5 @@ void ApplyMovieInputConfig(); bool TaseditorIsRecording(); +void Taseditor_EMUCMD(int command); + diff --git a/src/drivers/win/taseditor/bookmarks.cpp b/src/drivers/win/taseditor/bookmarks.cpp index 88312216..113acef1 100644 --- a/src/drivers/win/taseditor/bookmarks.cpp +++ b/src/drivers/win/taseditor/bookmarks.cpp @@ -77,7 +77,7 @@ void BOOKMARKS::init() // subclass the listview hwndBookmarksList_oldWndProc = (WNDPROC)SetWindowLong(hwndBookmarksList, GWL_WNDPROC, (LONG)BookmarksListWndProc); // setup images for the listview - himglist = ImageList_Create(9, 13, ILC_COLOR8 | ILC_MASK, 1, 1); + himglist = ImageList_Create(11, 13, ILC_COLOR8 | ILC_MASK, 1, 1); HBITMAP bmp = LoadBitmap(fceu_hInstance, MAKEINTRESOURCE(IDB_BITMAP0)); ImageList_AddMasked(himglist, bmp, 0xFFFFFF); DeleteObject(bmp); @@ -138,6 +138,66 @@ void BOOKMARKS::init() bmp = LoadBitmap(fceu_hInstance, MAKEINTRESOURCE(IDB_BITMAP19)); ImageList_AddMasked(himglist, bmp, 0xFFFFFF); DeleteObject(bmp); + bmp = LoadBitmap(fceu_hInstance, MAKEINTRESOURCE(IDB_BITMAP_SELECTED0)); + ImageList_AddMasked(himglist, bmp, 0xFFFFFF); + DeleteObject(bmp); + bmp = LoadBitmap(fceu_hInstance, MAKEINTRESOURCE(IDB_BITMAP_SELECTED1)); + ImageList_AddMasked(himglist, bmp, 0xFFFFFF); + DeleteObject(bmp); + bmp = LoadBitmap(fceu_hInstance, MAKEINTRESOURCE(IDB_BITMAP_SELECTED2)); + ImageList_AddMasked(himglist, bmp, 0xFFFFFF); + DeleteObject(bmp); + bmp = LoadBitmap(fceu_hInstance, MAKEINTRESOURCE(IDB_BITMAP_SELECTED3)); + ImageList_AddMasked(himglist, bmp, 0xFFFFFF); + DeleteObject(bmp); + bmp = LoadBitmap(fceu_hInstance, MAKEINTRESOURCE(IDB_BITMAP_SELECTED4)); + ImageList_AddMasked(himglist, bmp, 0xFFFFFF); + DeleteObject(bmp); + bmp = LoadBitmap(fceu_hInstance, MAKEINTRESOURCE(IDB_BITMAP_SELECTED5)); + ImageList_AddMasked(himglist, bmp, 0xFFFFFF); + DeleteObject(bmp); + bmp = LoadBitmap(fceu_hInstance, MAKEINTRESOURCE(IDB_BITMAP_SELECTED6)); + ImageList_AddMasked(himglist, bmp, 0xFFFFFF); + DeleteObject(bmp); + bmp = LoadBitmap(fceu_hInstance, MAKEINTRESOURCE(IDB_BITMAP_SELECTED7)); + ImageList_AddMasked(himglist, bmp, 0xFFFFFF); + DeleteObject(bmp); + bmp = LoadBitmap(fceu_hInstance, MAKEINTRESOURCE(IDB_BITMAP_SELECTED8)); + ImageList_AddMasked(himglist, bmp, 0xFFFFFF); + DeleteObject(bmp); + bmp = LoadBitmap(fceu_hInstance, MAKEINTRESOURCE(IDB_BITMAP_SELECTED9)); + ImageList_AddMasked(himglist, bmp, 0xFFFFFF); + DeleteObject(bmp); + bmp = LoadBitmap(fceu_hInstance, MAKEINTRESOURCE(IDB_BITMAP_SELECTED10)); + ImageList_AddMasked(himglist, bmp, 0xFFFFFF); + DeleteObject(bmp); + bmp = LoadBitmap(fceu_hInstance, MAKEINTRESOURCE(IDB_BITMAP_SELECTED11)); + ImageList_AddMasked(himglist, bmp, 0xFFFFFF); + DeleteObject(bmp); + bmp = LoadBitmap(fceu_hInstance, MAKEINTRESOURCE(IDB_BITMAP_SELECTED12)); + ImageList_AddMasked(himglist, bmp, 0xFFFFFF); + DeleteObject(bmp); + bmp = LoadBitmap(fceu_hInstance, MAKEINTRESOURCE(IDB_BITMAP_SELECTED13)); + ImageList_AddMasked(himglist, bmp, 0xFFFFFF); + DeleteObject(bmp); + bmp = LoadBitmap(fceu_hInstance, MAKEINTRESOURCE(IDB_BITMAP_SELECTED14)); + ImageList_AddMasked(himglist, bmp, 0xFFFFFF); + DeleteObject(bmp); + bmp = LoadBitmap(fceu_hInstance, MAKEINTRESOURCE(IDB_BITMAP_SELECTED15)); + ImageList_AddMasked(himglist, bmp, 0xFFFFFF); + DeleteObject(bmp); + bmp = LoadBitmap(fceu_hInstance, MAKEINTRESOURCE(IDB_BITMAP_SELECTED16)); + ImageList_AddMasked(himglist, bmp, 0xFFFFFF); + DeleteObject(bmp); + bmp = LoadBitmap(fceu_hInstance, MAKEINTRESOURCE(IDB_BITMAP_SELECTED17)); + ImageList_AddMasked(himglist, bmp, 0xFFFFFF); + DeleteObject(bmp); + bmp = LoadBitmap(fceu_hInstance, MAKEINTRESOURCE(IDB_BITMAP_SELECTED18)); + ImageList_AddMasked(himglist, bmp, 0xFFFFFF); + DeleteObject(bmp); + bmp = LoadBitmap(fceu_hInstance, MAKEINTRESOURCE(IDB_BITMAP_SELECTED19)); + ImageList_AddMasked(himglist, bmp, 0xFFFFFF); + DeleteObject(bmp); ListView_SetImageList(hwndBookmarksList, himglist, LVSIL_SMALL); // setup columns LVCOLUMN lvc; @@ -156,6 +216,7 @@ void BOOKMARKS::init() ListView_SetItemCountEx(hwndBookmarksList, TOTAL_BOOKMARKS, LVSICF_NOSCROLL | LVSICF_NOINVALIDATEALL); reset(); + selected_slot = DEFAULT_SLOT; // find rows top/height (for mouseover hittest calculations) RECT temp_rect; if (ListView_GetSubItemRect(hwndBookmarksList, 0, 2, LVIR_BOUNDS, &temp_rect) && temp_rect.bottom != temp_rect.top) @@ -220,6 +281,15 @@ void BOOKMARKS::update() case COMMAND_DEPLOY: deploy(slot); break; + case COMMAND_SELECT: + if (selected_slot != slot) + { + int old_selected_slot = selected_slot; + selected_slot = slot; + RedrawBookmark(old_selected_slot); + RedrawBookmark(selected_slot); + } + break; } } commands.resize(0); @@ -267,27 +337,11 @@ void BOOKMARKS::update() void BOOKMARKS::command(int command_id, int slot) { if (slot < 0) - slot = branches.GetCurrentBranch(); - switch (command_id) + slot = selected_slot; + if (slot >= 0 && slot < TOTAL_BOOKMARKS) { - case COMMAND_SET: - { - if (slot < 0 || slot >= TOTAL_BOOKMARKS) - slot = DEFAULT_BOOKMARK; - commands.push_back(command_id); - commands.push_back(slot); - break; - } - case COMMAND_JUMP: - case COMMAND_DEPLOY: - { - if (slot >= 0 && slot < TOTAL_BOOKMARKS) - { - commands.push_back(command_id); - commands.push_back(slot); - } - break; - } + commands.push_back(command_id); + commands.push_back(slot); } } @@ -345,7 +399,7 @@ void BOOKMARKS::jump(int slot) void BOOKMARKS::deploy(int slot) { - if (taseditor_config.branch_only_when_rec && movie_readonly) + if (taseditor_config.old_branching_controls && movie_readonly) { jump(slot); return; @@ -473,7 +527,7 @@ void BOOKMARKS::RedrawBookmarksCaption() edit_mode = EDIT_MODE_BRANCHES; ShowWindow(hwndBookmarksList, SW_HIDE); ShowWindow(hwndBranchesBitmap, SW_SHOW); - } else if (taseditor_config.branch_only_when_rec && movie_readonly) + } else if (taseditor_config.old_branching_controls && movie_readonly) { edit_mode = EDIT_MODE_BOOKMARKS; ShowWindow(hwndBranchesBitmap, SW_HIDE); @@ -531,6 +585,11 @@ int BOOKMARKS::FindItemUnderMouse() } return item; } + +int BOOKMARKS::GetSelectedSlot() +{ + return selected_slot; +} // ---------------------------------------------------------------------------------------- void BOOKMARKS::GetDispInfo(NMLVDISPINFO* nmlvDispInfo) { @@ -545,6 +604,11 @@ void BOOKMARKS::GetDispInfo(NMLVDISPINFO* nmlvDispInfo) item.iImage = ((item.iItem + 1) % TOTAL_BOOKMARKS) + TOTAL_BOOKMARKS; else item.iImage = (item.iItem + 1) % TOTAL_BOOKMARKS; + if (taseditor_config.old_branching_controls) + { + if ((item.iItem + 1) % TOTAL_BOOKMARKS == selected_slot) + item.iImage += BOOKMARKS_SELECTED; + } break; } case BOOKMARKS_COLUMN_FRAME: @@ -580,7 +644,7 @@ LONG BOOKMARKS::CustomDraw(NMLVCUSTOMDRAW* msg) if (bookmarks_array[cell_y].flash_phase) msg->clrText = bookmark_flash_colors[bookmarks_array[cell_y].flash_type][bookmarks_array[cell_y].flash_phase]; - if (cell_x == BOOKMARKS_COLUMN_FRAME || (taseditor_config.branch_only_when_rec && movie_readonly && cell_x == BOOKMARKS_COLUMN_TIME)) + if (cell_x == BOOKMARKS_COLUMN_FRAME || (taseditor_config.old_branching_controls && movie_readonly && cell_x == BOOKMARKS_COLUMN_TIME)) { if (bookmarks_array[cell_y].not_empty) { @@ -650,9 +714,9 @@ LONG BOOKMARKS::CustomDraw(NMLVCUSTOMDRAW* msg) void BOOKMARKS::LeftClick() { - if (column_clicked <= BOOKMARKS_COLUMN_FRAME || (taseditor_config.branch_only_when_rec && movie_readonly)) + if (column_clicked <= BOOKMARKS_COLUMN_FRAME || (taseditor_config.old_branching_controls && movie_readonly)) command(COMMAND_JUMP, bookmark_leftclicked); - else if (column_clicked == BOOKMARKS_COLUMN_TIME && (!taseditor_config.branch_only_when_rec || !movie_readonly)) + else if (column_clicked == BOOKMARKS_COLUMN_TIME && (!taseditor_config.old_branching_controls || !movie_readonly)) command(COMMAND_DEPLOY, bookmark_leftclicked); } void BOOKMARKS::RightClick() @@ -716,9 +780,9 @@ LRESULT APIENTRY BookmarksListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM { bookmarks.bookmark_leftclicked = (info.iItem + 1) % TOTAL_BOOKMARKS; bookmarks.column_clicked = info.iSubItem; - if (bookmarks.column_clicked <= BOOKMARKS_COLUMN_FRAME || (taseditor_config.branch_only_when_rec && movie_readonly)) + if (bookmarks.column_clicked <= BOOKMARKS_COLUMN_FRAME || (taseditor_config.old_branching_controls && movie_readonly)) bookmarks.bookmarks_array[bookmarks.bookmark_leftclicked].flash_type = FLASH_TYPE_JUMP; - else if (bookmarks.column_clicked == BOOKMARKS_COLUMN_TIME && (!taseditor_config.branch_only_when_rec || !movie_readonly)) + else if (bookmarks.column_clicked == BOOKMARKS_COLUMN_TIME && (!taseditor_config.old_branching_controls || !movie_readonly)) bookmarks.bookmarks_array[bookmarks.bookmark_leftclicked].flash_type = FLASH_TYPE_DEPLOY; SetCapture(hWnd); } diff --git a/src/drivers/win/taseditor/bookmarks.h b/src/drivers/win/taseditor/bookmarks.h index e7bd56c7..7f9f357a 100644 --- a/src/drivers/win/taseditor/bookmarks.h +++ b/src/drivers/win/taseditor/bookmarks.h @@ -16,14 +16,17 @@ enum COMMANDS COMMAND_SET = 0, COMMAND_JUMP = 1, COMMAND_DEPLOY = 2, - COMMAND_DELETE = 3, // not implemented, probably useless + COMMAND_SELECT = 3, + COMMAND_DELETE = 4, // not implemented, probably useless TOTAL_COMMANDS }; -#define BOOKMARKSLIST_COLUMN_ICONS_WIDTH 14 +#define BOOKMARKSLIST_COLUMN_ICONS_WIDTH 15 #define BOOKMARKSLIST_COLUMN_FRAMENUM_WIDTH 74 -#define BOOKMARKSLIST_COLUMN_TIME_WIDTH 82 +#define BOOKMARKSLIST_COLUMN_TIME_WIDTH 80 + +#define BOOKMARKS_SELECTED 20 #define ITEM_UNDER_MOUSE_NONE -2 #define ITEM_UNDER_MOUSE_CLOUD -1 @@ -41,7 +44,7 @@ enum #define BOOKMARKS_ID_LEN 10 #define TIME_DESC_LENGTH 9 // "HH:MM:SS" -#define DEFAULT_BOOKMARK 1 +#define DEFAULT_SLOT 1 class BOOKMARKS { @@ -74,7 +77,7 @@ public: void MouseMove(int new_x, int new_y); int FindItemUnderMouse(); - bool IsSafeToShowBookmarksData(); + int GetSelectedSlot(); // saved vars std::vector bookmarks_array; @@ -99,6 +102,7 @@ private: // not saved vars std::vector commands; + int selected_slot; int check_flash_shedule; int mouse_x, mouse_y; diff --git a/src/drivers/win/taseditor/editor.cpp b/src/drivers/win/taseditor/editor.cpp index b67f23eb..7a964347 100644 --- a/src/drivers/win/taseditor/editor.cpp +++ b/src/drivers/win/taseditor/editor.cpp @@ -212,6 +212,64 @@ void EDITOR::InputSetPattern(int start, int end, int joy, int button, int consec greenzone.InvalidateAndCheck(history.RegisterChanges(MODTYPE_PATTERN, start, end, autofire_patterns_names[current_pattern].c_str(), consecutive_tag)); } +void EDITOR::AdjustUp(int at) +{ + if (at < 0) + return; + bool markers_changed = false; + // delete one frame + currMovieData.records.erase(currMovieData.records.begin() + at); + if (taseditor_config.bind_markers) + { + if (markers_manager.EraseMarker(at)) + markers_changed = true; + } + // check if user deleted all frames + if (!currMovieData.getNumRecords()) + playback.StartFromZero(); + // reduce Piano Roll + piano_roll.UpdateItemCount(); + // check and register changes + int result = history.RegisterChanges(MODTYPE_ADJUST_UP, at); + if (result >= 0) + { + greenzone.InvalidateAndCheck(result); + } else + { + // check for special case: user deleted a bunch of empty frames the end of the movie + greenzone.InvalidateAndCheck(currMovieData.getNumRecords() - 1); + if (markers_changed) + history.RegisterMarkersChange(MODTYPE_MARKER_SHIFT, at); + } + if (markers_changed) + selection.must_find_current_marker = playback.must_find_current_marker = true; +} +void EDITOR::AdjustDown(int at) +{ + if (at < 0) + return; + bool markers_changed = false; + // insert blank frame + currMovieData.insertEmpty(at, 1); + if (taseditor_config.bind_markers) + { + if (markers_manager.insertEmpty(at, 1)) + markers_changed = true; + } + // check and register changes + int first_changes = history.RegisterChanges(MODTYPE_ADJUST_DOWN, at); + if (first_changes >= 0) + { + greenzone.InvalidateAndCheck(first_changes); + } else if (markers_changed) + { + history.RegisterMarkersChange(MODTYPE_MARKER_SHIFT, at); + piano_roll.RedrawList(); + } + if (markers_changed) + selection.must_find_current_marker = playback.must_find_current_marker = true; +} + // following functions use current Selection to determine range of frames bool EDITOR::FrameColumnSet() { diff --git a/src/drivers/win/taseditor/editor.h b/src/drivers/win/taseditor/editor.h index 822a99ee..1c5d70f8 100644 --- a/src/drivers/win/taseditor/editor.h +++ b/src/drivers/win/taseditor/editor.h @@ -12,6 +12,9 @@ public: void InputToggle(int start, int end, int joy, int button, int consecutive_tag = 0); void InputSetPattern(int start, int end, int joy, int button, int consecutive_tag = 0); + void AdjustUp(int at); + void AdjustDown(int at); + bool FrameColumnSet(); bool FrameColumnSetPattern(); bool InputColumnSet(int joy, int button); diff --git a/src/drivers/win/taseditor/greenzone.cpp b/src/drivers/win/taseditor/greenzone.cpp index a1f2c77f..f61f178d 100644 --- a/src/drivers/win/taseditor/greenzone.cpp +++ b/src/drivers/win/taseditor/greenzone.cpp @@ -28,6 +28,7 @@ extern TASEDITOR_PROJECT project; extern PLAYBACK playback; extern BOOKMARKS bookmarks; extern PIANO_ROLL piano_roll; +extern EDITOR editor; extern char lagFlag; @@ -74,7 +75,7 @@ void GREENZONE::CollectCurrentState() { // update greenzone upper limit if needed if (greenZoneCount <= currFrameCounter) - greenZoneCount = currFrameCounter+1; + greenZoneCount = currFrameCounter + 1; if ((int)savestates.size() < greenZoneCount) savestates.resize(greenZoneCount); @@ -87,10 +88,24 @@ void GREENZONE::CollectCurrentState() if (currFrameCounter > 0) { // lagFlag indicates that lag was in previous frame + int old_lagFlag = lag_history[currFrameCounter - 1]; if (lagFlag) - lag_history[currFrameCounter-1] = 1; + lag_history[currFrameCounter - 1] = 1; else - lag_history[currFrameCounter-1] = 0; + lag_history[currFrameCounter - 1] = 0; + // Auto-adjust Input due to lag + if (taseditor_config.adjust_input_due_to_lag) + { + if (old_lagFlag && !lagFlag) + { + // there's no more lag on previous frame - shift input up + editor.AdjustUp(currFrameCounter - 1); + } else if (!old_lagFlag && lagFlag) + { + // there's new lag on previous frame - shift input down + editor.AdjustDown(currFrameCounter - 1); + } + } } } @@ -410,27 +425,30 @@ void GREENZONE::InvalidateAndCheck(int after) { greenZoneCount = after+1; currMovieData.rerecordCount++; - // either set playback cursor to the end of greenzone or run seeking to restore playback position + // either set Playback cursor to the end of Greenzone or run seeking to restore playback position if (currFrameCounter >= greenZoneCount) { - // remember the lost position - if ((playback.lost_position_frame < currFrameCounter + 1) || (playback.lost_position_frame > currFrameCounter + 1 && !playback.lost_position_must_be_fixed)) - { - if (playback.lost_position_frame) - piano_roll.RedrawRow(playback.lost_position_frame - 1); - playback.lost_position_frame = currFrameCounter + 1; - playback.lost_position_must_be_fixed = true; - } // auto-restore position if needed if (taseditor_config.restore_position) { if (playback.pause_frame && playback.pause_frame_must_be_fixed) + { playback.jump(playback.pause_frame - 1); - else + } else + { + playback.SetLostPosition(currFrameCounter); playback.jump(currFrameCounter); + } } else { - playback.jump(greenZoneCount-1); + if (playback.pause_frame && playback.pause_frame_must_be_fixed) + { + playback.jump(playback.pause_frame - 1); + } else + { + playback.SetLostPosition(currFrameCounter); + playback.jump(greenZoneCount-1); + } } } } diff --git a/src/drivers/win/taseditor/history.cpp b/src/drivers/win/taseditor/history.cpp index 7f89a7af..178336fe 100644 --- a/src/drivers/win/taseditor/history.cpp +++ b/src/drivers/win/taseditor/history.cpp @@ -102,7 +102,9 @@ char modCaptions[MODTYPES_TOTAL][20] = {" Initialization", " LUA Marker Set", " LUA Marker Remove", " LUA Marker Rename", - " LUA Change" }; + " LUA Change", + " AdjustUp", + " AdjustDown" }; char LuaCaptionPrefix[6] = " LUA "; char joypadCaptions[4][5] = {"(1P)", "(2P)", "(3P)", "(4P)"}; @@ -489,6 +491,8 @@ int HISTORY::RegisterChanges(int mod_type, int start, int end, const char* comme case MODTYPE_PASTE: case MODTYPE_CLONE: case MODTYPE_PATTERN: + case MODTYPE_ADJUST_UP: + case MODTYPE_ADJUST_DOWN: { // for these changes user prefers to see frame of attempted change (selection beginning), not frame of actual differences snap.jump_frame = start; @@ -568,6 +572,12 @@ int HISTORY::RegisterChanges(int mod_type, int start, int end, const char* comme case MODTYPE_CLONE: snap.inheritHotChanges_InsertSelection(&snapshots[real_pos]); break; + case MODTYPE_ADJUST_UP: + snap.inheritHotChanges_DeleteNum(&snapshots[real_pos], start, 1); + break; + case MODTYPE_ADJUST_DOWN: + snap.inheritHotChanges_InsertNum(&snapshots[real_pos], start, 1); + break; case MODTYPE_SET: case MODTYPE_UNSET: case MODTYPE_CLEAR: diff --git a/src/drivers/win/taseditor/history.h b/src/drivers/win/taseditor/history.h index 6c63cb39..800d9f3d 100644 --- a/src/drivers/win/taseditor/history.h +++ b/src/drivers/win/taseditor/history.h @@ -66,6 +66,8 @@ enum MOD_TYPES MODTYPE_LUA_MARKER_REMOVE, MODTYPE_LUA_MARKER_RENAME, MODTYPE_LUA_CHANGE, + MODTYPE_ADJUST_UP, + MODTYPE_ADJUST_DOWN, MODTYPES_TOTAL }; diff --git a/src/drivers/win/taseditor/piano_roll.cpp b/src/drivers/win/taseditor/piano_roll.cpp index 93faf491..3fe62214 100644 --- a/src/drivers/win/taseditor/piano_roll.cpp +++ b/src/drivers/win/taseditor/piano_roll.cpp @@ -1188,7 +1188,7 @@ void PIANO_ROLL::GetDispInfo(NMLVDISPINFO* nmlvDispInfo) if (item.iImage < 0) { // no bookmark at this frame - if (item.iItem == playback.lost_position_frame - 1) + if (item.iItem == playback.GetLostPosition()) { if (item.iItem == currFrameCounter) item.iImage = GREEN_BLUE_ARROW_IMAGE_ID; @@ -1201,7 +1201,7 @@ void PIANO_ROLL::GetDispInfo(NMLVDISPINFO* nmlvDispInfo) } else { // bookmark at this frame - if (item.iItem == playback.lost_position_frame - 1) + if (item.iItem == playback.GetLostPosition()) item.iImage += BOOKMARKS_WITH_GREEN_ARROW; else if (item.iItem == currFrameCounter) item.iImage += BOOKMARKS_WITH_BLUE_ARROW; diff --git a/src/drivers/win/taseditor/playback.cpp b/src/drivers/win/taseditor/playback.cpp index dfb5e90f..80ada012 100644 --- a/src/drivers/win/taseditor/playback.cpp +++ b/src/drivers/win/taseditor/playback.cpp @@ -471,6 +471,21 @@ bool PLAYBACK::JumpToFrame(int index) return true; } +void PLAYBACK::SetLostPosition(int frame) +{ + if ((lost_position_frame < frame + 1) || (lost_position_frame > frame + 1 && !lost_position_must_be_fixed)) + { + if (lost_position_frame) + piano_roll.RedrawRow(lost_position_frame - 1); + lost_position_frame = frame + 1; + lost_position_must_be_fixed = true; + } +} +int PLAYBACK::GetLostPosition() +{ + return lost_position_frame - 1; +} + int PLAYBACK::GetFlashingPauseFrame() { if (show_pauseframe) diff --git a/src/drivers/win/taseditor/playback.h b/src/drivers/win/taseditor/playback.h index 5718756a..ad1e2178 100644 --- a/src/drivers/win/taseditor/playback.h +++ b/src/drivers/win/taseditor/playback.h @@ -39,13 +39,13 @@ public: void StartFromZero(); + void SetLostPosition(int frame); + int GetLostPosition(); // actually returns lost_position_frame-1 + int GetFlashingPauseFrame(); void SetProgressbar(int a, int b); void CancelSeeking(); - int lastCursor; // but for currentCursor we use external variable currFrameCounter - int lost_position_frame; - bool lost_position_must_be_fixed; // for when Greenzone invalidates several times, but the end of current segment must remain the same int pause_frame; bool pause_frame_must_be_fixed; // for "Auto-restore last position" bool must_find_current_marker; @@ -61,6 +61,9 @@ private: bool old_emu_paused, emu_paused; int old_pauseframe; bool old_show_pauseframe, show_pauseframe; + int lastCursor; // but for currentCursor we use external variable currFrameCounter + int lost_position_frame; + bool lost_position_must_be_fixed; // for when Greenzone invalidates several times, but the end of current segment must remain the same bool old_rewind_button_state, rewind_button_state; bool old_forward_button_state, forward_button_state; bool old_rewind_full_button_state, rewind_full_button_state; diff --git a/src/drivers/win/taseditor/recorder.cpp b/src/drivers/win/taseditor/recorder.cpp index 31ad46b9..017bf8e3 100644 --- a/src/drivers/win/taseditor/recorder.cpp +++ b/src/drivers/win/taseditor/recorder.cpp @@ -114,7 +114,7 @@ void RECORDER::update() if (old_movie_readonly != movie_readonly || old_multitrack_recording_joypad != multitrack_recording_joypad) taseditor_window.UpdateCaption(); // update Bookmarks/Branches groupbox caption if needed - if (taseditor_config.branch_only_when_rec && old_movie_readonly != movie_readonly) + if (taseditor_config.old_branching_controls && old_movie_readonly != movie_readonly) bookmarks.RedrawBookmarksCaption(); // update "Recording" checkbox state if (old_movie_readonly != movie_readonly) diff --git a/src/drivers/win/taseditor/snapshot.cpp b/src/drivers/win/taseditor/snapshot.cpp index a7c2e3c2..1960b24a 100644 --- a/src/drivers/win/taseditor/snapshot.cpp +++ b/src/drivers/win/taseditor/snapshot.cpp @@ -690,11 +690,32 @@ void SNAPSHOT::inheritHotChanges_InsertSelection(SNAPSHOT* source_of_hotchanges) } } } -void SNAPSHOT::inheritHotChanges_InsertNum(SNAPSHOT* source_of_hotchanges, int start, int frames) +void SNAPSHOT::inheritHotChanges_DeleteNum(SNAPSHOT* source_of_hotchanges, int start, int frames) { int bytes = joysticks_per_frame[input_type] * HOTCHANGE_BYTES_PER_JOY; // copy hot changes from source snapshot up to "start" and from "start+frames" to end if (source_of_hotchanges && source_of_hotchanges->has_hot_changes && source_of_hotchanges->input_type == input_type) + { + int this_size = hot_changes.size(), source_size = source_of_hotchanges->hot_changes.size(); + int bytes_to_copy = bytes * start; + int dest_pos = 0, source_pos = 0; + if (bytes_to_copy > source_size) + bytes_to_copy = source_size; + memcpy(&hot_changes[dest_pos], &source_of_hotchanges->hot_changes[source_pos], bytes_to_copy); + dest_pos += bytes_to_copy; + source_pos += bytes_to_copy + bytes * frames; + bytes_to_copy = this_size - dest_pos; + if (bytes_to_copy > source_size - source_pos) + bytes_to_copy = source_size - source_pos; + memcpy(&hot_changes[dest_pos], &source_of_hotchanges->hot_changes[source_pos], bytes_to_copy); + FadeHotChanges(); + } +} +void SNAPSHOT::inheritHotChanges_InsertNum(SNAPSHOT* source_of_hotchanges, int start, int frames) +{ + int bytes = joysticks_per_frame[input_type] * HOTCHANGE_BYTES_PER_JOY; + // copy hot changes from source snapshot up to "start", then make a gap, then copy from "start+frames" to end + if (source_of_hotchanges && source_of_hotchanges->has_hot_changes && source_of_hotchanges->input_type == input_type) { int this_size = hot_changes.size(), source_size = source_of_hotchanges->hot_changes.size(); int bytes_to_copy = bytes * start; @@ -710,7 +731,7 @@ void SNAPSHOT::inheritHotChanges_InsertNum(SNAPSHOT* source_of_hotchanges, int s memcpy(&hot_changes[dest_pos], &source_of_hotchanges->hot_changes[source_pos], bytes_to_copy); FadeHotChanges(); } - // now set filled lines on frames from start to start+frames + // fill the gap with max_hot lines on frames from "start" to "start+frames" memset(&hot_changes[bytes * start], 0xFF, bytes * frames); } void SNAPSHOT::inheritHotChanges_PasteInsert(SNAPSHOT* source_of_hotchanges, SelectionFrames& inserted_set) diff --git a/src/drivers/win/taseditor/snapshot.h b/src/drivers/win/taseditor/snapshot.h index ac80303a..e6548fb3 100644 --- a/src/drivers/win/taseditor/snapshot.h +++ b/src/drivers/win/taseditor/snapshot.h @@ -49,6 +49,7 @@ public: void inheritHotChanges(SNAPSHOT* source_of_hotchanges); void inheritHotChanges_DeleteSelection(SNAPSHOT* source_of_hotchanges); void inheritHotChanges_InsertSelection(SNAPSHOT* source_of_hotchanges); + void inheritHotChanges_DeleteNum(SNAPSHOT* source_of_hotchanges, int start, int frames); void inheritHotChanges_InsertNum(SNAPSHOT* source_of_hotchanges, int start, int frames); void inheritHotChanges_PasteInsert(SNAPSHOT* source_of_hotchanges, SelectionFrames& inserted_set); void fillHotChanges(SNAPSHOT& snap, int start = 0, int end = -1); diff --git a/src/drivers/win/taseditor/splicer.cpp b/src/drivers/win/taseditor/splicer.cpp index 1b480479..430291ea 100644 --- a/src/drivers/win/taseditor/splicer.cpp +++ b/src/drivers/win/taseditor/splicer.cpp @@ -267,8 +267,6 @@ void SPLICER::DeleteFrames() markers_changed = true; } } - if (markers_changed) - selection.must_find_current_marker = playback.must_find_current_marker = true; // check if user deleted all frames if (!currMovieData.getNumRecords()) playback.StartFromZero(); @@ -286,6 +284,8 @@ void SPLICER::DeleteFrames() if (markers_changed) history.RegisterMarkersChange(MODTYPE_MARKER_SHIFT, start_index); } + if (markers_changed) + selection.must_find_current_marker = playback.must_find_current_marker = true; } void SPLICER::ClearFrames(SelectionFrames* current_selection) diff --git a/src/drivers/win/taseditor/taseditor_config.cpp b/src/drivers/win/taseditor/taseditor_config.cpp index 3f25b924..0f698641 100644 --- a/src/drivers/win/taseditor/taseditor_config.cpp +++ b/src/drivers/win/taseditor/taseditor_config.cpp @@ -47,10 +47,11 @@ TASEDITOR_CONFIG::TASEDITOR_CONFIG() columnset_by_keys = false; superimpose = 0; // SUPERIMPOSE_UNCHECKED branch_full_movie = true; - branch_only_when_rec = false; + old_branching_controls = false; view_branches_tree = false; branch_scr_hud = true; restore_position = false; + adjust_input_due_to_lag = false; greenzone_capacity = GREENZONE_CAPACITY_DEFAULT; undo_levels = UNDO_LEVELS_DEFAULT; autosave_period = AUTOSAVE_PERIOD_DEFAULT; diff --git a/src/drivers/win/taseditor/taseditor_config.h b/src/drivers/win/taseditor/taseditor_config.h index 9afeaf62..2bbfa426 100644 --- a/src/drivers/win/taseditor/taseditor_config.h +++ b/src/drivers/win/taseditor/taseditor_config.h @@ -45,10 +45,11 @@ public: bool columnset_by_keys; int superimpose; bool branch_full_movie; - bool branch_only_when_rec; + bool old_branching_controls; bool view_branches_tree; bool branch_scr_hud; bool restore_position; + bool adjust_input_due_to_lag; int greenzone_capacity; int undo_levels; int autosave_period; diff --git a/src/drivers/win/taseditor/taseditor_lua.cpp b/src/drivers/win/taseditor/taseditor_lua.cpp index 7c7cc3aa..b4d321a0 100644 --- a/src/drivers/win/taseditor/taseditor_lua.cpp +++ b/src/drivers/win/taseditor/taseditor_lua.cpp @@ -218,7 +218,7 @@ int TASEDITOR_LUA::getsuperimpose() int TASEDITOR_LUA::getlostplayback() { if (FCEUMOV_Mode(MOVIEMODE_TASEDITOR)) - return playback.lost_position_frame - 1; + return playback.GetLostPosition(); else return -1; } diff --git a/src/drivers/win/taseditor/taseditor_window.cpp b/src/drivers/win/taseditor/taseditor_window.cpp index c5bddac7..39abe950 100644 --- a/src/drivers/win/taseditor/taseditor_window.cpp +++ b/src/drivers/win/taseditor/taseditor_window.cpp @@ -74,6 +74,7 @@ LRESULT APIENTRY TASEDITOR_FORWARD_WndProc(HWND hWnd, UINT msg, WPARAM wParam, L LRESULT APIENTRY TASEDITOR_FORWARD_FULL_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); LRESULT APIENTRY CHECK_FOLLOW_CURSOR_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); LRESULT APIENTRY CHECK_AUTORESTORE_PLAYBACK_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); +LRESULT APIENTRY CHECK_AUTOADJUSTINPUTDUETOLAG_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); LRESULT APIENTRY IDC_RADIO_ALL_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); LRESULT APIENTRY IDC_RADIO_1P_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); LRESULT APIENTRY IDC_RADIO_2P_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); @@ -100,6 +101,7 @@ WNDPROC TASEDITOR_FORWARD_FULL_oldWndProc = 0, CHECK_FOLLOW_CURSOR_oldWndProc = 0, CHECK_AUTORESTORE_PLAYBACK_oldWndProc = 0, + CHECK_AUTOADJUSTINPUTDUETOLAG_oldWndProc = 0, IDC_RADIO_ALL_oldWndProc = 0, IDC_RADIO_1P_oldWndProc = 0, IDC_RADIO_2P_oldWndProc = 0, @@ -148,6 +150,7 @@ Window_items_struct window_items[TASEDITOR_WINDOW_TOTAL_ITEMS] = { IDC_PROGRESS1, -1, 0, 0, 0, "", "", false, 0, 0, CHECK_FOLLOW_CURSOR, -1, 0, 0, 0, "The Piano Roll will follow Playback cursor movements", "", false, 0, 0, CHECK_AUTORESTORE_PLAYBACK, -1, 0, 0, 0, "Whenever you change input above Playback cursor, the cursor returns to where it was before the change (hotkey: Ctrl+Spacebar)", "", false, 0, 0, + CHECK_AUTOADJUSTINPUTDUETOLAG, -1, 0, 0, 0, "TAS Editor will adjust Input when new lag frames appear or old lag frames disappear while emulating", "", false, 0, 0, IDC_BOOKMARKSLIST, -1, 0, 0, 0, "Right click = set Bookmark, Left click = jump to Bookmark or load Branch", "", false, 0, 0, IDC_HISTORYLIST, -1, 0, 0, -1, "Click to revert the project back to that time", "", false, 0, 0, IDC_RADIO_ALL, -1, 0, 0, 0, "", "", false, 0, 0, @@ -271,6 +274,7 @@ void TASEDITOR_WINDOW::init() TASEDITOR_FORWARD_FULL_oldWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndTasEditor, TASEDITOR_FORWARD_FULL), GWL_WNDPROC, (LONG)TASEDITOR_FORWARD_FULL_WndProc); CHECK_FOLLOW_CURSOR_oldWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndTasEditor, CHECK_FOLLOW_CURSOR), GWL_WNDPROC, (LONG)CHECK_FOLLOW_CURSOR_WndProc); CHECK_AUTORESTORE_PLAYBACK_oldWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndTasEditor, CHECK_AUTORESTORE_PLAYBACK), GWL_WNDPROC, (LONG)CHECK_AUTORESTORE_PLAYBACK_WndProc); + CHECK_AUTOADJUSTINPUTDUETOLAG_oldWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndTasEditor, CHECK_AUTOADJUSTINPUTDUETOLAG), GWL_WNDPROC, (LONG)CHECK_AUTOADJUSTINPUTDUETOLAG_WndProc); IDC_RADIO_ALL_oldWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndTasEditor, IDC_RADIO_ALL), GWL_WNDPROC, (LONG)IDC_RADIO_ALL_WndProc); IDC_RADIO_1P_oldWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndTasEditor, IDC_RADIO_1P), GWL_WNDPROC, (LONG)IDC_RADIO_1P_WndProc); IDC_RADIO_2P_oldWndProc = (WNDPROC)SetWindowLong(GetDlgItem(hwndTasEditor, IDC_RADIO_2P), GWL_WNDPROC, (LONG)IDC_RADIO_2P_WndProc); @@ -552,7 +556,8 @@ void TASEDITOR_WINDOW::UpdateCheckedItems() { // check option ticks CheckDlgButton(hwndTasEditor, CHECK_FOLLOW_CURSOR, taseditor_config.follow_playback?BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndTasEditor,CHECK_AUTORESTORE_PLAYBACK,taseditor_config.restore_position?BST_CHECKED:BST_UNCHECKED); + CheckDlgButton(hwndTasEditor, CHECK_AUTORESTORE_PLAYBACK, taseditor_config.restore_position?BST_CHECKED:BST_UNCHECKED); + CheckDlgButton(hwndTasEditor, CHECK_AUTOADJUSTINPUTDUETOLAG, taseditor_config.adjust_input_due_to_lag?BST_CHECKED:BST_UNCHECKED); if (taseditor_config.superimpose == SUPERIMPOSE_UNCHECKED) CheckDlgButton(hwndTasEditor, IDC_SUPERIMPOSE, BST_UNCHECKED); else if (taseditor_config.superimpose == SUPERIMPOSE_CHECKED) @@ -568,7 +573,7 @@ void TASEDITOR_WINDOW::UpdateCheckedItems() CheckMenuItem(hmenu, ID_VIEW_FOLLOWMARKERNOTECONTEXT, taseditor_config.follow_note_context?MF_CHECKED : MF_UNCHECKED); CheckMenuItem(hmenu, ID_VIEW_ENABLEHOTCHANGES, taseditor_config.enable_hot_changes?MF_CHECKED : MF_UNCHECKED); CheckMenuItem(hmenu, ID_CONFIG_BRANCHESRESTOREFULLMOVIE, taseditor_config.branch_full_movie?MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hmenu, ID_CONFIG_BRANCHESWORKONLYWHENRECORDING, taseditor_config.branch_only_when_rec?MF_CHECKED : MF_UNCHECKED); + CheckMenuItem(hmenu, ID_CONFIG_OLDBRANCHINGCONTROLS, taseditor_config.old_branching_controls?MF_CHECKED : MF_UNCHECKED); CheckMenuItem(hmenu, ID_CONFIG_HUDINBRANCHSCREENSHOTS, taseditor_config.branch_scr_hud?MF_CHECKED : MF_UNCHECKED); CheckMenuItem(hmenu, ID_CONFIG_BINDMARKERSTOINPUT, taseditor_config.bind_markers?MF_CHECKED : MF_UNCHECKED); CheckMenuItem(hmenu, ID_CONFIG_EMPTYNEWMARKERNOTES, taseditor_config.empty_marker_notes?MF_CHECKED : MF_UNCHECKED); @@ -1052,6 +1057,10 @@ BOOL CALLBACK WndprocTasEditor(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara taseditor_config.restore_position ^= 1; taseditor_window.UpdateCheckedItems(); break; + case CHECK_AUTOADJUSTINPUTDUETOLAG: + taseditor_config.adjust_input_due_to_lag ^= 1; + taseditor_window.UpdateCheckedItems(); + break; case ID_CONFIG_SETGREENZONECAPACITY: { int new_capacity = taseditor_config.greenzone_capacity; @@ -1105,8 +1114,8 @@ BOOL CALLBACK WndprocTasEditor(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara taseditor_config.branch_full_movie ^= 1; taseditor_window.UpdateCheckedItems(); break; - case ID_CONFIG_BRANCHESWORKONLYWHENRECORDING: - taseditor_config.branch_only_when_rec ^= 1; + case ID_CONFIG_OLDBRANCHINGCONTROLS: + taseditor_config.old_branching_controls ^= 1; taseditor_window.UpdateCheckedItems(); bookmarks.RedrawBookmarksCaption(); break; @@ -1655,6 +1664,19 @@ LRESULT APIENTRY CHECK_AUTORESTORE_PLAYBACK_WndProc(HWND hWnd, UINT msg, WPARAM } return CallWindowProc(CHECK_AUTORESTORE_PLAYBACK_oldWndProc, hWnd, msg, wParam, lParam); } +LRESULT APIENTRY CHECK_AUTOADJUSTINPUTDUETOLAG_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch(msg) + { + case WM_MBUTTONDOWN: + case WM_MBUTTONDBLCLK: + playback.MiddleButtonClick(); + return 0; + case WM_KEYDOWN: + return 0; // disable Spacebar + } + return CallWindowProc(CHECK_AUTOADJUSTINPUTDUETOLAG_oldWndProc, hWnd, msg, wParam, lParam); +} LRESULT APIENTRY IDC_RADIO_ALL_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) diff --git a/src/input.cpp b/src/input.cpp index 8eec7d21..30b48c35 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -51,17 +51,8 @@ #include "drivers/win/memview.h" #include "drivers/win/window.h" #include "drivers/win/ntview.h" - -#include "./drivers/win/taseditor/taseditor_window.h" -#include "./drivers/win/taseditor/markers.h" -#include "./drivers/win/taseditor/selection.h" -#include "./drivers/win/taseditor/snapshot.h" -#include "./drivers/win/taseditor/bookmarks.h" -#include "./drivers/win/taseditor/playback.h" +#include "drivers/win/taseditor.h" extern bool Taseditor_rewind_now; -extern BOOKMARKS bookmarks; -extern TASEDITOR_WINDOW taseditor_window; -extern PLAYBACK playback; #endif // WIN32 //it is easier to declare these input drivers extern here than include a bunch of files @@ -699,8 +690,8 @@ struct EMUCMDTABLE FCEUI_CommandTable[]= { EMUCMD_SAVE_SLOT_7, EMUCMDTYPE_STATE, CommandSelectSaveSlot, 0, 0, "Savestate Slot 7", EMUCMDFLAG_TASEDITOR }, { EMUCMD_SAVE_SLOT_8, EMUCMDTYPE_STATE, CommandSelectSaveSlot, 0, 0, "Savestate Slot 8", EMUCMDFLAG_TASEDITOR }, { EMUCMD_SAVE_SLOT_9, EMUCMDTYPE_STATE, CommandSelectSaveSlot, 0, 0, "Savestate Slot 9", EMUCMDFLAG_TASEDITOR }, - { EMUCMD_SAVE_SLOT_NEXT, EMUCMDTYPE_STATE, CommandSelectSaveSlot, 0, 0, "Next Savestate Slot", 0 }, - { EMUCMD_SAVE_SLOT_PREV, EMUCMDTYPE_STATE, CommandSelectSaveSlot, 0, 0, "Previous Savestate Slot", 0 }, + { EMUCMD_SAVE_SLOT_NEXT, EMUCMDTYPE_STATE, CommandSelectSaveSlot, 0, 0, "Next Savestate Slot", EMUCMDFLAG_TASEDITOR }, + { EMUCMD_SAVE_SLOT_PREV, EMUCMDTYPE_STATE, CommandSelectSaveSlot, 0, 0, "Previous Savestate Slot", EMUCMDFLAG_TASEDITOR }, { EMUCMD_SAVE_STATE, EMUCMDTYPE_STATE, CommandStateSave, 0, 0, "Save State", EMUCMDFLAG_TASEDITOR }, { EMUCMD_SAVE_STATE_AS, EMUCMDTYPE_STATE, FCEUD_SaveStateAs, 0, 0, "Save State As...", 0 }, { EMUCMD_SAVE_STATE_SLOT_0, EMUCMDTYPE_STATE, CommandStateSave, 0, 0, "Save State to Slot 0", EMUCMDFLAG_TASEDITOR }, @@ -857,7 +848,7 @@ static void CommandSelectSaveSlot(void) if (FCEUMOV_Mode(MOVIEMODE_TASEDITOR)) { #ifdef WIN32 - bookmarks.command(COMMAND_JUMP, execcmd - EMUCMD_SAVE_SLOT_0); + Taseditor_EMUCMD(execcmd); #endif } else { @@ -875,10 +866,7 @@ static void CommandStateSave(void) if (FCEUMOV_Mode(MOVIEMODE_TASEDITOR)) { #ifdef WIN32 - if (execcmd == EMUCMD_SAVE_STATE) - bookmarks.command(COMMAND_SET); - else if(execcmd >= EMUCMD_SAVE_STATE_SLOT_0 && execcmd <= EMUCMD_SAVE_STATE_SLOT_9) - bookmarks.command(COMMAND_SET, execcmd - EMUCMD_SAVE_STATE_SLOT_0); + Taseditor_EMUCMD(execcmd); #endif } else { @@ -899,10 +887,7 @@ static void CommandStateLoad(void) if (FCEUMOV_Mode(MOVIEMODE_TASEDITOR)) { #ifdef WIN32 - if (execcmd == EMUCMD_LOAD_STATE) - bookmarks.command(COMMAND_DEPLOY); - else if(execcmd >= EMUCMD_LOAD_STATE_SLOT_0 && execcmd <= EMUCMD_LOAD_STATE_SLOT_9) - bookmarks.command(COMMAND_DEPLOY, execcmd - EMUCMD_LOAD_STATE_SLOT_0); + Taseditor_EMUCMD(execcmd); #endif } else { @@ -1141,7 +1126,7 @@ static void ReloadRom(void) if (FCEUMOV_Mode(MOVIEMODE_TASEDITOR)) { // load most recent project - taseditor_window.LoadRecentProject(0); + Taseditor_EMUCMD(execcmd); } else { // load most recent ROM @@ -1204,14 +1189,13 @@ static void TaseditorRestorePlayback(void) { #ifdef WIN32 if (FCEUMOV_Mode(MOVIEMODE_TASEDITOR)) - playback.RestorePosition(); + Taseditor_EMUCMD(execcmd); #endif } - static void TaseditorCancelSeeking(void) { #ifdef WIN32 if (FCEUMOV_Mode(MOVIEMODE_TASEDITOR)) - playback.CancelSeeking(); + Taseditor_EMUCMD(execcmd); #endif } diff --git a/vc/vc10_fceux.vcxproj b/vc/vc10_fceux.vcxproj index 9425bfa3..63629f9d 100644 --- a/vc/vc10_fceux.vcxproj +++ b/vc/vc10_fceux.vcxproj @@ -872,8 +872,6 @@ - - @@ -882,25 +880,45 @@ + + + + + + + + + + + + + + + + + + + + @@ -918,6 +936,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vc/vc10_fceux.vcxproj.filters b/vc/vc10_fceux.vcxproj.filters index 3585c102..9304f021 100644 --- a/vc/vc10_fceux.vcxproj.filters +++ b/vc/vc10_fceux.vcxproj.filters @@ -1544,9 +1544,87 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +