* Changed some checkboxes to radiobuttons in menu

* Taseditor: "Marker Rename" shows Note text in History; added "Marker Move" modtype
* Taseditor: "Frame#" lights when Alt key is being held, not entering menu by Alt
* Taseditor: PATTERNS menu, loading data from "tools\taseditor_patterns.txt"
* Taseditor: ColumnSet (Input and Markers) with Alt key = set pattern
* Taseditor: "Use pattern" checkbox in Recorder; Config->ColumnSet Pattern skips Lag
This commit is contained in:
ansstuff 2012-02-18 16:43:40 +00:00
parent 3743f42ba8
commit e267095bd1
40 changed files with 865 additions and 354 deletions

View File

@ -1,4 +1,13 @@
18-feb-2012 - AnS - PATTERNS menu, loading data from "tools\taseditor_patterns.txt"
18-feb-2012 - AnS - "Use pattern" checkbox in Recorder; Config->ColumnSet Pattern skips Lag
18-feb-2012 - AnS - Taseditor: "Frame#" lights when Alt key is being held, not entering menu by Alt
18-feb-2012 - AnS - Changed some checkboxes to radiobuttons in FCEUX menu
13-feb-2012 - AnS - Taseditor: when clicking text fields, Piano Roll scrolls to corresponding Marker, not to cursor
13-feb-2012 - AnS - Replay dialog speedup, now movie is not loaded into memory when checking md5
06-feb-2012 - AnS - new Lua scripts: SoundDisplay.lua, TrackNoise.lua
06-feb-2012 - AnS - refined Recording, now can safely record commands (Power, Reset, Insert, Switch)
02-feb-2012 - AnS - updated fceux.chm and online documentation, uploaded HelpNDoc3 project file
02-feb-2012 - AnS - added Lua scripts demonstrating some TAS Editor library functions
02-feb-2012 - AnS - new Lua function in TAS Editor library: getsuperimpose()

1
output/.gitignore vendored
View File

@ -10,4 +10,3 @@
/movies
/sav
/snaps
/tools

View File

@ -1,5 +1,6 @@
---------------------------------------------------------------------------
-- Display Sound Channels data
-- by AnS, 2012
---------------------------------------------------------------------------
-- Showcases following functions:
-- * sound.get()

View File

@ -1,5 +1,6 @@
---------------------------------------------------------------------------
-- Display Input at Selection cursor
-- by AnS, 2012
---------------------------------------------------------------------------
-- Showcases following functions:
-- * taseditor.getselection()

View File

@ -1,5 +1,6 @@
---------------------------------------------------------------------------
-- Invert Selection
-- by AnS, 2012
---------------------------------------------------------------------------
-- Showcases following functions:
-- * taseditor.getselection()

View File

@ -1,7 +1,9 @@
---------------------------------------------------------------------------
-- Recording Input while Rewinding Playback frame-by-frame
-- by AnS, 2012
---------------------------------------------------------------------------
-- Showcases following functions:
-- * joypad.getimmediate()
-- * taseditor.getrecordermode()
-- * taseditor.getsuperimpose()
-- * taseditor.getinput()
@ -14,7 +16,7 @@
-- Now you can hold some joypad buttons and press "Rewind Frame" hotkey
-- to Record those buttons into PREVIOUS frame.
-- Try using this crazy method alongside with Frame Advance Recording.
-- This script supports multitracking and superimpose.
-- This script supports multitracking and superimpose. Doesn't support Patterns.
---------------------------------------------------------------------------
-- This function reads joypad input table and converts it to single byte

View File

@ -1,5 +1,6 @@
---------------------------------------------------------------------------
-- Showing Markers' Notes on screen
-- by AnS, 2012
---------------------------------------------------------------------------
-- Showcases following functions:
-- * taseditor.getmarker()

View File

@ -1,5 +1,6 @@
---------------------------------------------------------------------------
-- Swap 1P and 2P buttons at Selected frames
-- by AnS, 2012
---------------------------------------------------------------------------
-- Showcases following functions:
-- * taseditor.getselection()

View File

@ -1,5 +1,6 @@
---------------------------------------------------------------------------
-- Tracking Noise channel volume peaks
-- by AnS, 2012
---------------------------------------------------------------------------
-- Showcases following functions:
-- * sound.get()

View File

@ -0,0 +1,18 @@
Alternating (1010...)
10
Alternating at 30FPS (11001100...)
1100
One Quarter (10001000...)
+---
Tap'n'Hold (101111111...)
AaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
One-Two (1011010110...)
!0!!o
FORMAT OF THIS FILE: 2 lines per every Pattern - first line is the name, second line is looped sequence of chars: first char is considered to be the flag of "button pressed", any other char in the sequence will mean "button released". Thus, every Pattern starts from button press.

View File

@ -303,6 +303,11 @@ static CFGSTRUCT fceuconfig[] = {
AC(taseditor_config.wndy),
AC(taseditor_config.wndwidth),
AC(taseditor_config.wndheight),
AC(taseditor_config.saved_wndx),
AC(taseditor_config.saved_wndy),
AC(taseditor_config.saved_wndwidth),
AC(taseditor_config.saved_wndheight),
AC(taseditor_config.wndmaximized),
AC(taseditor_config.findnote_wndx),
AC(taseditor_config.findnote_wndy),
AC(taseditor_config.follow_playback),
@ -344,6 +349,9 @@ static CFGSTRUCT fceuconfig[] = {
AC(taseditor_config.findnote_search_up),
AC(taseditor_config.silent_autosave),
AC(taseditor_config.tooltips),
AC(taseditor_config.current_pattern),
AC(taseditor_config.pattern_skips_lag),
AC(taseditor_config.pattern_recording),
ACS(taseditor_config_last_author),
AC(lagCounterDisplay),
AC(oldInputDisplay),

View File

@ -217,87 +217,92 @@ BEGIN
END
END
TASEDITORMENU MENU
TASEDITORMENU MENUEX
BEGIN
POPUP "&File"
POPUP "File", 65535,MFT_STRING,MFS_ENABLED
BEGIN
MENUITEM "&New", ID_FILE_NEW
MENUITEM "&Open", ID_FILE_OPENPROJECT
MENUITEM "&Save\tCtrl+S", ID_FILE_SAVEPROJECT
MENUITEM "S&ave As", ID_FILE_SAVEPROJECTAS
MENUITEM "Save &Compact", ID_FILE_SAVECOMPACT
MENUITEM "&Recent", ID_FILE_RECENT
MENUITEM SEPARATOR
MENUITEM "&Import", ID_FILE_IMPORT
MENUITEM "&Export to FM2", ID_FILE_EXPORTFM2
MENUITEM SEPARATOR
MENUITEM "&Close\tAlt+F4", ID_FILE_CLOSE
MENUITEM "New", ID_FILE_NEW,MFT_STRING,MFS_ENABLED
MENUITEM "Open", ID_FILE_OPENPROJECT,MFT_STRING,MFS_ENABLED
MENUITEM "Save\tCtrl+S", ID_FILE_SAVEPROJECT,MFT_STRING,MFS_ENABLED
MENUITEM "Save As", ID_FILE_SAVEPROJECTAS,MFT_STRING,MFS_ENABLED
MENUITEM "Save Compact", ID_FILE_SAVECOMPACT,MFT_STRING,MFS_ENABLED
MENUITEM "Recent", ID_FILE_RECENT,MFT_STRING,MFS_ENABLED
MENUITEM MFT_SEPARATOR
MENUITEM "Import", ID_FILE_IMPORT,MFT_STRING,MFS_ENABLED
MENUITEM "Export to FM2", ID_FILE_EXPORTFM2,MFT_STRING,MFS_ENABLED
MENUITEM MFT_SEPARATOR
MENUITEM "Close\tAlt+F4", ID_FILE_CLOSE,MFT_STRING,MFS_ENABLED
END
POPUP "&Edit"
POPUP "Edit", 65535,MFT_STRING,MFS_ENABLED
BEGIN
MENUITEM "&Undo\tCtrl+Z", ID_EDIT_UNDO
MENUITEM "&Redo\tCtrl+Y", ID_EDIT_REDO
MENUITEM "Selection Undo\tCtrl+Q", ID_EDIT_SELECTIONUNDO
MENUITEM "Selection Redo\tCtrl+W", ID_EDIT_SELECTIONREDO
MENUITEM SEPARATOR
MENUITEM "Select &All", ID_EDIT_SELECTALL
MENUITEM "Select between &Markers\tCtrl+A", ID_EDIT_SELECTMIDMARKERS
MENUITEM "Reselect Clipboard\tCtrl+B", ID_EDIT_RESELECTCLIPBOARD
MENUITEM SEPARATOR
MENUITEM "&Copy\tCtrl+C", ID_EDIT_COPY
MENUITEM "&Paste\tCtrl+V", ID_EDIT_PASTE
MENUITEM "PasteInsert\tShift+V", ID_EDIT_PASTEINSERT
MENUITEM "Cu&t\tCtrl+X", ID_EDIT_CUT
MENUITEM SEPARATOR
MENUITEM "C&lear\tDel", ID_EDIT_CLEAR
MENUITEM "&Delete\tCtrl+Del", ID_EDIT_DELETE
MENUITEM "Cl&one\tCtrl+Ins", ID_EDIT_CLONEFRAMES
MENUITEM "&Insert\tShift+Ins", ID_EDIT_INSERTFRAMES
MENUITEM "Insert # of Frames\tIns", ID_EDIT_INSERT
MENUITEM SEPARATOR
MENUITEM "Truncate movie", ID_EDIT_TRUNCATE
MENUITEM "Undo\tCtrl+Z", ID_EDIT_UNDO,MFT_STRING,MFS_ENABLED
MENUITEM "Redo\tCtrl+Y", ID_EDIT_REDO,MFT_STRING,MFS_ENABLED
MENUITEM "Selection Undo\tCtrl+Q", ID_EDIT_SELECTIONUNDO,MFT_STRING,MFS_ENABLED
MENUITEM "Selection Redo\tCtrl+W", ID_EDIT_SELECTIONREDO,MFT_STRING,MFS_ENABLED
MENUITEM MFT_SEPARATOR
MENUITEM "Select All", ID_EDIT_SELECTALL,MFT_STRING,MFS_ENABLED
MENUITEM "Select between Markers\tCtrl+A", ID_EDIT_SELECTMIDMARKERS,MFT_STRING,MFS_ENABLED
MENUITEM "Reselect Clipboard\tCtrl+B", ID_EDIT_RESELECTCLIPBOARD,MFT_STRING,MFS_ENABLED
MENUITEM MFT_SEPARATOR
MENUITEM "Copy\tCtrl+C", ID_EDIT_COPY,MFT_STRING,MFS_ENABLED
MENUITEM "Paste\tCtrl+V", ID_EDIT_PASTE,MFT_STRING,MFS_ENABLED
MENUITEM "PasteInsert\tShift+V", ID_EDIT_PASTEINSERT,MFT_STRING,MFS_ENABLED
MENUITEM "Cut\tCtrl+X", ID_EDIT_CUT,MFT_STRING,MFS_ENABLED
MENUITEM MFT_SEPARATOR
MENUITEM "Clear\tDel", ID_EDIT_CLEAR,MFT_STRING,MFS_ENABLED
MENUITEM "Delete\tCtrl+Del", ID_EDIT_DELETE,MFT_STRING,MFS_ENABLED
MENUITEM "Clone\tCtrl+Ins", ID_EDIT_CLONEFRAMES,MFT_STRING,MFS_ENABLED
MENUITEM "Insert\tShift+Ins", ID_EDIT_INSERTFRAMES,MFT_STRING,MFS_ENABLED
MENUITEM "Insert # of Frames\tIns", ID_EDIT_INSERT,MFT_STRING,MFS_ENABLED
MENUITEM MFT_SEPARATOR
MENUITEM "Truncate movie", ID_EDIT_TRUNCATE,MFT_STRING,MFS_ENABLED
END
POPUP "&View"
POPUP "View", 65535,MFT_STRING,MFS_ENABLED
BEGIN
MENUITEM "&Find Note window\tCtrl+F", ID_VIEW_FINDNOTE
MENUITEM SEPARATOR
MENUITEM "Show &Lag Frames", ID_VIEW_SHOW_LAG_FRAMES
MENUITEM "Highlight &Markers", ID_VIEW_SHOW_MARKERS
MENUITEM "Display Branch &Screenshots", ID_VIEW_SHOWBRANCHSCREENSHOTS
MENUITEM "Display Branch &Descriptions", ID_VIEW_SHOWBRANCHTOOLTIPS
MENUITEM "Enable Hot &Changes", ID_VIEW_ENABLEHOTCHANGES
MENUITEM SEPARATOR
MENUITEM "Follow &undo context", ID_VIEW_JUMPWHENMAKINGUNDO
MENUITEM "Follow Marker &Note context", ID_VIEW_FOLLOWMARKERNOTECONTEXT
MENUITEM "Find Note window\tCtrl+F", ID_VIEW_FINDNOTE,MFT_STRING,MFS_ENABLED
MENUITEM MFT_SEPARATOR
MENUITEM "Show Lag Frames", ID_VIEW_SHOW_LAG_FRAMES,MFT_STRING,MFS_ENABLED
MENUITEM "Highlight Markers", ID_VIEW_SHOW_MARKERS,MFT_STRING,MFS_ENABLED
MENUITEM "Display Branch Screenshots", ID_VIEW_SHOWBRANCHSCREENSHOTS,MFT_STRING,MFS_ENABLED
MENUITEM "Display Branch Descriptions", ID_VIEW_SHOWBRANCHTOOLTIPS,MFT_STRING,MFS_ENABLED
MENUITEM "Enable Hot Changes", ID_VIEW_ENABLEHOTCHANGES,MFT_STRING,MFS_ENABLED
MENUITEM MFT_SEPARATOR
MENUITEM "Follow Undo context", ID_VIEW_JUMPWHENMAKINGUNDO,MFT_STRING,MFS_ENABLED
MENUITEM "Follow Marker Note context", ID_VIEW_FOLLOWMARKERNOTECONTEXT,MFT_STRING,MFS_ENABLED
END
POPUP "&Config"
POPUP "Config", 65535,MFT_STRING,MFS_ENABLED
BEGIN
MENUITEM "Set &Greenzone capacity", ID_CONFIG_SETGREENZONECAPACITY
MENUITEM "Set max &undo levels", ID_CONFIG_SETMAXUNDOLEVELS
MENUITEM "Set &Autosave period", ID_CONFIG_SETAUTOSAVEPERIOD
MENUITEM SEPARATOR
MENUITEM "Branches restore entire &Movie", ID_CONFIG_BRANCHESRESTOREFULLMOVIE
MENUITEM "Branches work only when &Recording", ID_CONFIG_BRANCHESWORKONLYWHENRECORDING
MENUITEM "&HUD in Branch screenshots", ID_CONFIG_HUDINBRANCHSCREENSHOTS
MENUITEM SEPARATOR
MENUITEM "&Bind Markers to Input", ID_CONFIG_BINDMARKERSTOINPUT
MENUITEM "&Empty new Marker Notes", ID_CONFIG_EMPTYNEWMARKERNOTES
MENUITEM SEPARATOR
MENUITEM "&Combine consecutive Recordings", ID_CONFIG_COMBINECONSECUTIVERECORDINGS
MENUITEM "Use 1&P keys for all single Recordings", ID_CONFIG_USE1PFORRECORDING
MENUITEM "Use &Input keys for Column Set", ID_CONFIG_USEINPUTKEYSFORCOLUMNSET
MENUITEM "Allow &keyboard controls in Piano Roll", ID_CONFIG_KEYBOARDCONTROLSINLISTVIEW
MENUITEM "&Superimpose affects copy/paste", ID_CONFIG_SUPERIMPOSE_AFFECTS_PASTE
MENUITEM SEPARATOR
MENUITEM "Silent Autosave", ID_CONFIG_SILENTAUTOSAVE
MENUITEM "Mute &Turbo", ID_CONFIG_MUTETURBO
MENUITEM "Set Greenzone capacity", ID_CONFIG_SETGREENZONECAPACITY,MFT_STRING,MFS_ENABLED
MENUITEM "Set max Undo levels", ID_CONFIG_SETMAXUNDOLEVELS,MFT_STRING,MFS_ENABLED
MENUITEM "Set Autosave period", ID_CONFIG_SETAUTOSAVEPERIOD,MFT_STRING,MFS_ENABLED
MENUITEM MFT_SEPARATOR
MENUITEM "Branches restore entire Movie", ID_CONFIG_BRANCHESRESTOREFULLMOVIE,MFT_STRING,MFS_ENABLED
MENUITEM "Branches work only when Recording", ID_CONFIG_BRANCHESWORKONLYWHENRECORDING,MFT_STRING,MFS_ENABLED
MENUITEM "HUD in Branch screenshots", ID_CONFIG_HUDINBRANCHSCREENSHOTS,MFT_STRING,MFS_ENABLED
MENUITEM MFT_SEPARATOR
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 "Combine consecutive Recordings", ID_CONFIG_COMBINECONSECUTIVERECORDINGS,MFT_STRING,MFS_ENABLED
MENUITEM "Use 1P keys for all single Recordings", ID_CONFIG_USE1PFORRECORDING,MFT_STRING,MFS_ENABLED
MENUITEM "Use Input keys for Column Set", ID_CONFIG_USEINPUTKEYSFORCOLUMNSET,MFT_STRING,MFS_ENABLED
MENUITEM "Allow keyboard controls in Piano Roll", ID_CONFIG_KEYBOARDCONTROLSINLISTVIEW,MFT_STRING,MFS_ENABLED
MENUITEM "Superimpose affects copy/paste", ID_CONFIG_SUPERIMPOSE_AFFECTS_PASTE,MFT_STRING,MFS_ENABLED
MENUITEM "ColumnSet Pattern skips Lag", ID_CONFIG_COLUMNSETPATTERNSKIPSLAG,MFT_STRING,MFS_ENABLED
MENUITEM MFT_SEPARATOR
MENUITEM "Silent Autosave", ID_CONFIG_SILENTAUTOSAVE,MFT_STRING,MFS_ENABLED
MENUITEM "Mute Turbo", ID_CONFIG_MUTETURBO,MFT_STRING,MFS_ENABLED
END
POPUP "&Help"
POPUP "Help", 65535,MFT_STRING,MFS_ENABLED
BEGIN
MENUITEM "TAS Editor &Help", ID_HELP_TASEDITORHELP
MENUITEM "Enable &Tooltips", ID_HELP_TOOLTIPS
MENUITEM SEPARATOR
MENUITEM "&About", ID_HELP_ABOUT
MENUITEM "TAS Editor Help", 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
END
POPUP "Pattern", 65535,MFT_STRING | MFT_RIGHTJUSTIFY,MFS_ENABLED
BEGIN
MENUITEM "Dummy", ID_PATTERN_TEST,MFT_STRING,MFS_ENABLED
END
END
@ -384,13 +389,13 @@ BEGIN
BEGIN
MENUITEM "Set Marker", ID_SELECTED_SETMARKER
MENUITEM "Remove Marker", ID_SELECTED_REMOVEMARKER
MENUITEM "Select between &Markers", ID_SELECTED_SELECTMIDMARKERS
MENUITEM "Select between Markers", ID_SELECTED_SELECTMIDMARKERS
MENUITEM SEPARATOR
MENUITEM "C&lear", ID_CONTEXT_SELECTED_CLEARFRAMES
MENUITEM "&Delete", ID_CONTEXT_SELECTED_DELETEFRAMES
MENUITEM "&Insert", ID_CONTEXT_SELECTED_INSERTFRAMES
MENUITEM "Clear", ID_CONTEXT_SELECTED_CLEARFRAMES
MENUITEM "Delete", ID_CONTEXT_SELECTED_DELETEFRAMES
MENUITEM "Insert", ID_CONTEXT_SELECTED_INSERTFRAMES
MENUITEM "Insert # of Frames", ID_CONTEXT_SELECTED_INSERTFRAMES2
MENUITEM "Cl&one", ID_SELECTED_CLONE
MENUITEM "Clone", ID_SELECTED_CLONE
MENUITEM SEPARATOR
MENUITEM "Truncate movie", ID_CONTEXT_SELECTED_TRUNCATE
END
@ -1407,12 +1412,12 @@ BEGIN
"Button",BS_AUTOCHECKBOX,202,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,201,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,201,282,113,42
CONTROL " All",IDC_RADIO_ALL,"Button",BS_AUTORADIOBUTTON,202,84,27,10
CONTROL " 1P",IDC_RADIO_1P,"Button",BS_AUTORADIOBUTTON,258,84,25,10
CONTROL " 2P",IDC_RADIO_2P,"Button",BS_AUTORADIOBUTTON,288,84,24,10
CONTROL " 3P",IDC_RADIO_3P,"Button",BS_AUTORADIOBUTTON,258,96,25,10
CONTROL " 4P",IDC_RADIO_4P,"Button",BS_AUTORADIOBUTTON,288,96,24,10
CONTROL " Superimpose",IDC_SUPERIMPOSE,"Button",BS_AUTO3STATE,258,72,55,10
CONTROL " All",IDC_RADIO_ALL,"Button",BS_AUTORADIOBUTTON,289,71,24,10
CONTROL " 1P",IDC_RADIO_1P,"Button",BS_AUTORADIOBUTTON,202,83,25,10
CONTROL " 2P",IDC_RADIO_2P,"Button",BS_AUTORADIOBUTTON,231,83,24,10
CONTROL " 3P",IDC_RADIO_3P,"Button",BS_AUTORADIOBUTTON,260,83,25,10
CONTROL " 4P",IDC_RADIO_4P,"Button",BS_AUTORADIOBUTTON,289,83,24,10
CONTROL " Superimpose",IDC_SUPERIMPOSE,"Button",BS_AUTO3STATE,202,96,54,10
PUSHBUTTON "<<",TASEDITOR_PREV_MARKER,201,332,23,14,NOT WS_TABSTOP
PUSHBUTTON "Similar",TASEDITOR_FIND_BEST_SIMILAR_MARKER,224,332,34,14,NOT WS_TABSTOP
PUSHBUTTON "More",TASEDITOR_FIND_NEXT_SIMILAR_MARKER,258,332,34,14,NOT WS_TABSTOP
@ -1427,9 +1432,10 @@ BEGIN
CONTROL " Turbo seek",CHECK_TURBO_SEEK,"Button",BS_AUTOCHECKBOX,202,25,50,12
LTEXT "Selection: 0 rows, 16 columns",IDC_TEXT_SELECTION,203,118,112,10
LTEXT "Clipboard: 0 rows, 16 columns",IDC_TEXT_CLIPBOARD,202,128,114,10
CONTROL " Recording",IDC_RECORDING,"Button",BS_AUTO3STATE,202,72,49,10
CONTROL " Recording",IDC_RECORDING,"Button",BS_AUTO3STATE,202,71,64,10
PUSHBUTTON "Run function",TASEDITOR_RUN_MANUAL,201,150,54,14,WS_DISABLED | NOT WS_TABSTOP
CONTROL "Auto function",IDC_RUN_AUTO,"Button",BS_AUTO3STATE,260,152,55,10
CONTROL "Auto function",IDC_RUN_AUTO,"Button",BS_AUTOCHECKBOX,260,152,55,10
CONTROL " Use pattern",IDC_USEPATTERN,"Button",BS_AUTOCHECKBOX,260,96,54,10
END
IDD_TASEDITOR_ABOUT DIALOGEX 0, 0, 208, 70

View File

@ -499,6 +499,7 @@
#define IDC_C_SEARCH 1206
#define IDC_CHECK5 1206
#define IDC_CHECK_GREENZONE 1206
#define IDC_USEPATTERN 1206
#define IDC_C_ADDCHEAT 1207
#define IDC_CHECK6 1207
#define IDC_CHECK_HISTORY 1207
@ -574,6 +575,7 @@
#define IDC_TEXT_SELECTION 1267
#define IDC_TEXT_CLIPBOARD 1268
#define IDC_RADIO_1PLAYER 1269
#define IDC_TEXT_SELECTION2 1269
#define IDC_RADIO_2PLAYERS 1270
#define IDC_PLAYBACK_MARKER 1270
#define IDC_RADIO_FOURSCORE 1271
@ -984,6 +986,11 @@
#define ID_STRAY_UNPAUSEEMULATOR 40528
#define ID_STRAY_UNPAUSE 40529
#define ID_STRAY_TRUNCATE40530 40530
#define ID_PATTERN 40531
#define ID_PATTERN_TESTPATTERN 40532
#define ID_PATTERN40533 40533
#define ID_PATTERN_TEST 40534
#define ID_CONFIG_COLUMNSETPATTERNSKIPSLAG 40535
#define IDC_DEBUGGER_ICONTRAY 55535
#define MW_ValueLabel2 65423
#define MW_ValueLabel1 65426
@ -993,7 +1000,7 @@
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 206
#define _APS_NEXT_COMMAND_VALUE 40531
#define _APS_NEXT_COMMAND_VALUE 40536
#define _APS_NEXT_CONTROL_VALUE 1280
#define _APS_NEXT_SYMED_VALUE 101
#endif

View File

@ -1,8 +1,6 @@
#include <fstream>
#include "taseditor/taseditor_project.h"
#include "utils/xstring.h"
#include "keyboard.h"
#include "joystick.h"
#include "main.h" // for GetRomName
#include "taseditor.h"
#include "version.h"
@ -12,6 +10,8 @@ using namespace std;
// TAS Editor data
bool Taseditor_rewind_now = false;
bool must_call_manual_lua_function = false;
std::vector<std::string> autofire_patterns_names;
std::vector<std::vector<uint8>> autofire_patterns;
// all Taseditor functional modules
TASEDITOR_CONFIG taseditor_config;
@ -30,6 +30,7 @@ TASEDITOR_SELECTION selection;
SPLICER splicer;
extern int joysticks_per_frame[NUM_SUPPORTED_INPUT_TYPES];
extern bool turbo;
// temporarily saved FCEUX config
int saved_eoptions;
int saved_EnableAutosave;
@ -41,6 +42,9 @@ extern void UpdateCheckedMenuItems();
extern void TaseditorAutoFunction();
extern void TaseditorManualFunction();
// resources
char patternsFilename[] = "\\taseditor_patterns.txt";
// enterframe function
void UpdateTasEditor()
{
@ -563,16 +567,110 @@ void Export()
}
}
// returns false if couldn't real a string containing at least one char
bool ReadString(EMUFILE *is, std::string& dest)
{
dest.resize(0);
int c;
while (true)
{
c = is->fgetc();
if (c < 0) break;
if (c == 10 || c == 13) // end of line
{
if (dest.size())
break; // already collected at least one char
else
continue; // skip the char and continue searching
} else
{
dest.push_back(c);
}
}
return dest.size() != 0;
}
bool EnterTasEditor()
{
if(!FCEU_IsValidUI(FCEUI_TASEDITOR)) return false;
if(!taseditor_window.hwndTasEditor)
{
// start TAS Editor
// init/load autofire_patterns
int total_patterns = 0;
autofire_patterns.resize(total_patterns);
autofire_patterns_names.resize(total_patterns);
char nameo[2048];
strncpy(nameo, FCEU_GetPath(FCEUMKF_TASEDITOR).c_str(), 2047);
strncat(nameo, patternsFilename, 2047 - strlen(nameo));
EMUFILE_FILE ifs(nameo, "rb");
if(!ifs.fail())
{
std::string tempstr1, tempstr2;
while (ReadString(&ifs, tempstr1))
{
if (ReadString(&ifs, tempstr2))
{
total_patterns++;
// save the name
autofire_patterns_names.push_back(tempstr1);
// parse 2nd string to sequence of 1s and 0s
char flagpress = tempstr2[0];
autofire_patterns.resize(total_patterns);
autofire_patterns[total_patterns - 1].resize(tempstr2.size());
for (int i = tempstr2.size() - 1; i >= 0; i--)
{
if (tempstr2[i] == flagpress)
autofire_patterns[total_patterns - 1][i] = 1;
else
autofire_patterns[total_patterns - 1][i] = 0;
}
}
}
} else
{
FCEU_printf("Could not load tools\\taseditor_patterns.txt!\n");
}
if (autofire_patterns.size() == 0)
{
FCEU_printf("Will be using default set of patterns...\n");
autofire_patterns.resize(4);
autofire_patterns_names.resize(4);
// Default Pattern 0: Alternating (1010...)
autofire_patterns_names[0] = "Alternating (1010...)";
autofire_patterns[0].resize(2);
autofire_patterns[0][0] = 1;
autofire_patterns[0][1] = 0;
// Default Pattern 1: Alternating at 30FPS (11001100...)
autofire_patterns_names[1] = "Alternating at 30FPS (11001100...)";
autofire_patterns[1].resize(4);
autofire_patterns[1][0] = 1;
autofire_patterns[1][1] = 1;
autofire_patterns[1][2] = 0;
autofire_patterns[1][3] = 0;
// Default Pattern 2: One Quarter (10001000...)
autofire_patterns_names[2] = "One Quarter (10001000...)";
autofire_patterns[2].resize(4);
autofire_patterns[2][0] = 1;
autofire_patterns[2][1] = 0;
autofire_patterns[2][2] = 0;
autofire_patterns[2][3] = 0;
// Default Pattern 3: Tap'n'Hold (1011111111111111111111111111111111111...)
autofire_patterns_names[3] = "Tap'n'Hold (101111111...)";
autofire_patterns[3].resize(1000);
autofire_patterns[3][0] = 1;
autofire_patterns[3][1] = 0;
for (int i = 2; i < 1000; ++i)
autofire_patterns[3][i] = 1;
}
// reset current_pattern if it's outside the range
if (taseditor_config.current_pattern < 0 || taseditor_config.current_pattern >= (int)autofire_patterns.size())
taseditor_config.current_pattern = 0;
// create window
taseditor_window.init();
if(taseditor_window.hwndTasEditor)
{
SetTaseditorInput();
// save "eoptions"
saved_eoptions = eoptions;
// set "Run in background"
@ -586,7 +684,7 @@ bool EnterTasEditor()
saved_EnableAutosave = EnableAutosave;
EnableAutosave = 0;
UpdateCheckedMenuItems();
// init modules
list.init();
selection.init();
@ -646,6 +744,10 @@ bool ExitTasEditor()
{
if (!AskSaveProject()) return false;
// free autofire_patterns
autofire_patterns.resize(0);
autofire_patterns_names.resize(0);
// destroy window
taseditor_window.exit();
// release memory
@ -658,7 +760,6 @@ bool ExitTasEditor()
playback.SeekingStop();
selection.free();
ClearTaseditorInput();
// restore "eoptions"
eoptions = saved_eoptions;
// restore autosaves
@ -709,19 +810,6 @@ void SetInputType(MovieData& md, int new_input_type)
}
}
void SetTaseditorInput()
{
// set "Background TAS Editor input"
KeyboardSetBackgroundAccessBit(KEYBACKACCESS_TASEDITOR);
JoystickSetBackgroundAccessBit(JOYBACKACCESS_TASEDITOR);
}
void ClearTaseditorInput()
{
// clear "Background TAS Editor input"
KeyboardClearBackgroundAccessBit(KEYBACKACCESS_TASEDITOR);
JoystickClearBackgroundAccessBit(JOYBACKACCESS_TASEDITOR);
}
// this getter contains formula to decide whether to record or replay movie
bool TaseditorIsRecording()
{

View File

@ -26,7 +26,6 @@ void Export();
int GetInputType(MovieData& md);
void SetInputType(MovieData& md, int new_input_type);
void SetTaseditorInput();
void ClearTaseditorInput();
bool TaseditorIsRecording();
bool ReadString(EMUFILE *is, std::string& dest);

View File

@ -1410,12 +1410,6 @@ LRESULT APIENTRY BookmarksListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM
bookmarks.MouseMove(-1, -1);
break;
}
case WM_SYSKEYDOWN:
{
if (wParam == VK_F10)
return 0;
break;
}
}
return CallWindowProc(hwndBookmarksList_oldWndProc, hWnd, msg, wParam, lParam);
}
@ -1441,12 +1435,6 @@ LRESULT APIENTRY BranchesBitmapWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARA
bookmarks.MouseMove(-1, -1);
break;
}
case WM_SYSKEYDOWN:
{
if (wParam == VK_F10)
return 0;
break;
}
case WM_PAINT:
{
PAINTSTRUCT ps;

View File

@ -417,6 +417,14 @@ int GREENZONE::FindBeginningOfGreenZone(int starting_index)
return starting_index;
}
// getter
bool GREENZONE::GetLagHistoryAtFrame(int frame)
{
if (frame < greenZoneCount && frame < (int)lag_history.size())
return lag_history[frame] != 0;
else
return false;
}

View File

@ -34,6 +34,8 @@ public:
int FindBeginningOfGreenZone(int starting_index = 0);
bool GetLagHistoryAtFrame(int frame);
// data
int greenZoneCount;
std::vector<std::vector<uint8>> savestates;

View File

@ -20,10 +20,11 @@ extern int GetInputType(MovieData& md);
char history_save_id[HISTORY_ID_LEN] = "HISTORY";
char history_skipsave_id[HISTORY_ID_LEN] = "HISTORX";
char modCaptions[41][20] = {" Init",
char modCaptions[MODTYPES_TOTAL][20] = {" Init",
" Change",
" Set",
" Unset",
" Pattern",
" Insert",
" Delete",
" Truncate",
@ -56,7 +57,9 @@ char modCaptions[41][20] = {" Init",
" Marker Branch9 to ",
" Marker Set",
" Marker Unset",
" Marker Pattern",
" Marker Rename",
" Marker Move",
" LUA Marker Set",
" LUA Marker Unset",
" LUA Marker Rename",
@ -211,7 +214,7 @@ void HISTORY::AddSnapshotToHistory(SNAPSHOT &inp)
}
// returns frame of first actual change
int HISTORY::RegisterChanges(int mod_type, int start, int end)
int HISTORY::RegisterChanges(int mod_type, int start, int end, const char* comment)
{
// create new shanshot
SNAPSHOT inp;
@ -241,6 +244,7 @@ int HISTORY::RegisterChanges(int mod_type, int start, int end)
case MODTYPE_DELETE:
case MODTYPE_PASTE:
case MODTYPE_CLONE:
case MODTYPE_PATTERN:
{
// for these changes user prefers to see frame of attempted change (selection beginning), not frame of actual differences
inp.jump_frame = start;
@ -258,6 +262,12 @@ int HISTORY::RegisterChanges(int mod_type, int start, int end)
strcat(inp.description, "-");
strcat(inp.description, framenum);
}
// add comment if there is one specified
if (comment)
{
strcat(inp.description, " ");
strncat(inp.description, comment, SNAPSHOT_DESC_MAX_LENGTH - strlen(inp.description) - 1);
}
// set hotchanges
if (taseditor_config.enable_hot_changes)
{
@ -277,6 +287,7 @@ int HISTORY::RegisterChanges(int mod_type, int start, int end)
case MODTYPE_CLEAR:
case MODTYPE_CUT:
case MODTYPE_PASTE:
case MODTYPE_PATTERN:
inp.inheritHotChanges(&snapshots[real_pos]);
inp.fillHotChanges(snapshots[real_pos], first_changes, end);
break;
@ -320,7 +331,7 @@ int HISTORY::RegisterPasteInsert(int start, SelectionFrames& inserted_set)
}
return first_changes;
}
void HISTORY::RegisterMarkersChange(int mod_type, int start, int end)
void HISTORY::RegisterMarkersChange(int mod_type, int start, int end, const char* comment)
{
// create new shanshot
SNAPSHOT inp;
@ -340,6 +351,13 @@ void HISTORY::RegisterMarkersChange(int mod_type, int start, int end)
strcat(inp.description, "-");
strcat(inp.description, framenum);
}
// add comment if there is one specified
if (comment)
{
strcat(inp.description, " ");
strncat(inp.description, comment, SNAPSHOT_DESC_MAX_LENGTH - strlen(inp.description) - 1);
}
// input hotchanges aren't changed
if (taseditor_config.enable_hot_changes)
inp.copyHotChanges(&GetCurrentSnapshot());
AddSnapshotToHistory(inp);
@ -726,12 +744,6 @@ LRESULT APIENTRY HistoryListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l
case WM_KEYUP:
case WM_KILLFOCUS:
return 0;
case WM_SYSKEYDOWN:
{
if (wParam == VK_F10)
return 0;
break;
}
}
return CallWindowProc(hwndHistoryList_oldWndProc, hWnd, msg, wParam, lParam);
}

View File

@ -3,47 +3,52 @@
enum
{
MODTYPE_INIT = 0,
MODTYPE_CHANGE = 1, // deprecated
MODTYPE_SET = 2,
MODTYPE_UNSET = 3,
MODTYPE_INSERT = 4,
MODTYPE_DELETE = 5,
MODTYPE_TRUNCATE = 6,
MODTYPE_CLEAR = 7,
MODTYPE_CUT = 8,
MODTYPE_PASTE = 9,
MODTYPE_PASTEINSERT = 10,
MODTYPE_CLONE = 11,
MODTYPE_RECORD = 12,
MODTYPE_IMPORT = 13,
MODTYPE_BRANCH_0 = 14,
MODTYPE_BRANCH_1 = 15,
MODTYPE_BRANCH_2 = 16,
MODTYPE_BRANCH_3 = 17,
MODTYPE_BRANCH_4 = 18,
MODTYPE_BRANCH_5 = 19,
MODTYPE_BRANCH_6 = 20,
MODTYPE_BRANCH_7 = 21,
MODTYPE_BRANCH_8 = 22,
MODTYPE_BRANCH_9 = 23,
MODTYPE_BRANCH_MARKERS_0 = 24,
MODTYPE_BRANCH_MARKERS_1 = 25,
MODTYPE_BRANCH_MARKERS_2 = 26,
MODTYPE_BRANCH_MARKERS_3 = 27,
MODTYPE_BRANCH_MARKERS_4 = 28,
MODTYPE_BRANCH_MARKERS_5 = 29,
MODTYPE_BRANCH_MARKERS_6 = 30,
MODTYPE_BRANCH_MARKERS_7 = 31,
MODTYPE_BRANCH_MARKERS_8 = 32,
MODTYPE_BRANCH_MARKERS_9 = 33,
MODTYPE_MARKER_SET = 34,
MODTYPE_MARKER_UNSET = 35,
MODTYPE_MARKER_RENAME = 36,
MODTYPE_LUA_MARKER_SET = 37,
MODTYPE_LUA_MARKER_UNSET = 38,
MODTYPE_LUA_MARKER_RENAME = 39,
MODTYPE_LUA_CHANGE = 40,
MODTYPE_INIT,
MODTYPE_CHANGE, // deprecated
MODTYPE_SET,
MODTYPE_UNSET,
MODTYPE_PATTERN,
MODTYPE_INSERT,
MODTYPE_DELETE,
MODTYPE_TRUNCATE,
MODTYPE_CLEAR,
MODTYPE_CUT,
MODTYPE_PASTE,
MODTYPE_PASTEINSERT,
MODTYPE_CLONE,
MODTYPE_RECORD,
MODTYPE_IMPORT,
MODTYPE_BRANCH_0,
MODTYPE_BRANCH_1,
MODTYPE_BRANCH_2,
MODTYPE_BRANCH_3,
MODTYPE_BRANCH_4,
MODTYPE_BRANCH_5,
MODTYPE_BRANCH_6,
MODTYPE_BRANCH_7,
MODTYPE_BRANCH_8,
MODTYPE_BRANCH_9,
MODTYPE_BRANCH_MARKERS_0,
MODTYPE_BRANCH_MARKERS_1,
MODTYPE_BRANCH_MARKERS_2,
MODTYPE_BRANCH_MARKERS_3,
MODTYPE_BRANCH_MARKERS_4,
MODTYPE_BRANCH_MARKERS_5,
MODTYPE_BRANCH_MARKERS_6,
MODTYPE_BRANCH_MARKERS_7,
MODTYPE_BRANCH_MARKERS_8,
MODTYPE_BRANCH_MARKERS_9,
MODTYPE_MARKER_SET,
MODTYPE_MARKER_UNSET,
MODTYPE_MARKER_PATTERN,
MODTYPE_MARKER_RENAME,
MODTYPE_MARKER_MOVE,
MODTYPE_LUA_MARKER_SET,
MODTYPE_LUA_MARKER_UNSET,
MODTYPE_LUA_MARKER_RENAME,
MODTYPE_LUA_CHANGE,
MODTYPES_TOTAL
};
#define HISTORY_NORMAL_COLOR 0x000000
@ -65,9 +70,9 @@ public:
int redo();
int jump(int new_pos);
int RegisterChanges(int mod_type, int start = 0, int end =-1);
int RegisterChanges(int mod_type, int start = 0, int end =-1, const char* comment = 0);
int RegisterPasteInsert(int start, SelectionFrames& inserted_set);
void RegisterMarkersChange(int mod_type, int start = 0, int end =-1);
void RegisterMarkersChange(int mod_type, int start = 0, int end =-1, const char* comment = 0);
void RegisterBranching(int mod_type, int first_change, int slot);
void RegisterRecording(int frame_of_change);
void RegisterImport(MovieData& md, char* filename);

View File

@ -84,13 +84,20 @@ int MARKERS_MANAGER::GetMarkersSize()
{
return markers.markers_array.size();
}
void MARKERS_MANAGER::SetMarkersSize(int new_size)
bool MARKERS_MANAGER::SetMarkersSize(int new_size)
{
// if we are truncating, clear markers that are gonna be erased (so that obsolete notes will be erased too)
bool markers_changed = false;
for (int i = markers.markers_array.size() - 1; i >= new_size; i--)
{
if (markers.markers_array[i])
{
ClearMarker(i);
markers_changed = true;
}
}
markers.markers_array.resize(new_size);
return markers_changed;
}
int MARKERS_MANAGER::GetMarker(int frame)
@ -176,24 +183,55 @@ void MARKERS_MANAGER::ToggleMarker(int frame)
}
}
void MARKERS_MANAGER::EraseMarker(int frame)
bool MARKERS_MANAGER::EraseMarker(int frame)
{
bool markers_changed = false;
if (frame < (int)markers.markers_array.size())
{
// if there's a marker, first clear it
if (markers.markers_array[frame])
{
ClearMarker(frame);
markers_changed = true;
}
// erase 1 frame
markers.markers_array.erase(markers.markers_array.begin() + frame);
if (!markers_changed)
{
// check if there were some Markers after this frame
for (int i = markers.markers_array.size() - 1; i >= frame; i--)
{
if (markers.markers_array[i])
{
markers_changed = true; // Markers moved
break;
}
}
}
}
return markers_changed;
}
void MARKERS_MANAGER::insertEmpty(int at, int frames)
bool MARKERS_MANAGER::insertEmpty(int at, int frames)
{
if(at == -1)
{
// append blank frames
markers.markers_array.resize(markers.markers_array.size() + frames);
return false;
} else
{
bool markers_changed = false;
// first check if there are Markers after the frame
for (int i = markers.markers_array.size() - 1; i >= at; i--)
{
if (markers.markers_array[i])
{
markers_changed = true; // Markers moved
break;
}
}
markers.markers_array.insert(markers.markers_array.begin() + at, frames, 0);
return markers_changed;
}
}
@ -555,10 +593,10 @@ void MARKERS_MANAGER::UpdateMarkerNote()
{
SetNote(playback.shown_marker, new_text);
if (playback.shown_marker)
history.RegisterMarkersChange(MODTYPE_MARKER_RENAME, GetMarkerFrame(playback.shown_marker));
history.RegisterMarkersChange(MODTYPE_MARKER_RENAME, GetMarkerFrame(playback.shown_marker), -1, new_text);
else
// zeroth marker - just assume it's set on frame 0
history.RegisterMarkersChange(MODTYPE_MARKER_RENAME, 0);
history.RegisterMarkersChange(MODTYPE_MARKER_RENAME, 0, -1, new_text);
// notify selection to change text in lower marker (in case both are showing same marker)
selection.must_find_current_marker = true;
}
@ -571,10 +609,10 @@ void MARKERS_MANAGER::UpdateMarkerNote()
{
SetNote(selection.shown_marker, new_text);
if (selection.shown_marker)
history.RegisterMarkersChange(MODTYPE_MARKER_RENAME, GetMarkerFrame(selection.shown_marker));
history.RegisterMarkersChange(MODTYPE_MARKER_RENAME, GetMarkerFrame(selection.shown_marker), -1, new_text);
else
// zeroth marker - just assume it's set on frame 0
history.RegisterMarkersChange(MODTYPE_MARKER_RENAME, 0);
history.RegisterMarkersChange(MODTYPE_MARKER_RENAME, 0, -1, new_text);
// notify playback to change text in upper marker (in case both are showing same marker)
playback.must_find_current_marker = true;
}

View File

@ -34,7 +34,7 @@ public:
bool load(EMUFILE *is);
int GetMarkersSize();
void SetMarkersSize(int new_size);
bool SetMarkersSize(int new_size);
int GetMarker(int frame);
int GetMarkerUp(int start_frame);
@ -45,8 +45,8 @@ public:
void ClearMarker(int frame);
void ToggleMarker(int frame);
void EraseMarker(int frame);
void insertEmpty(int at, int frames);
bool EraseMarker(int frame);
bool insertEmpty(int at, int frames);
int GetNotesSize();
std::string GetNote(int index);

View File

@ -6,6 +6,9 @@ extern int joysticks_per_frame[NUM_SUPPORTED_INPUT_TYPES];
extern uint32 GetGamepadPressedImmediate();
extern int GetInputType(MovieData& md);
extern std::vector<std::vector<uint8>> autofire_patterns;
extern char lagFlag;
extern TASEDITOR_CONFIG taseditor_config;
extern TASEDITOR_WINDOW taseditor_window;
extern BOOKMARKS bookmarks;
@ -14,6 +17,9 @@ extern GREENZONE greenzone;
extern TASEDITOR_LIST list;
// resources
const char recordingCheckbox[10] = "Recording";
const char recordingCheckboxBlankPattern[16] = "Recording blank";
const char recordingModes[5][4] = { "All",
"1P",
"2P",
@ -37,6 +43,8 @@ void RECORDER::init()
hwndRB_Rec3P = GetDlgItem(taseditor_window.hwndTasEditor, IDC_RADIO_3P);
hwndRB_Rec4P = GetDlgItem(taseditor_window.hwndTasEditor, IDC_RADIO_4P);
old_multitrack_recording_joypad = multitrack_recording_joypad;
old_pattern_offset = 0;
must_increase_pattern_offset = false;
old_movie_readonly = movie_readonly;
old_joy.resize(MAX_NUM_JOYPADS);
new_joy.resize(MAX_NUM_JOYPADS);
@ -46,6 +54,8 @@ void RECORDER::reset()
{
movie_readonly = true;
multitrack_recording_joypad = MULTITRACK_RECORDING_ALL;
pattern_offset = 0;
must_increase_pattern_offset = false;
UncheckRecordingRadioButtons();
RecheckRecordingRadioButtons();
switch (GetInputType(currMovieData))
@ -89,8 +99,36 @@ void RECORDER::update()
// update Bookmarks/Branches groupbox caption if needed
if (taseditor_config.branch_only_when_rec && old_movie_readonly != movie_readonly)
bookmarks.RedrawBookmarksCaption();
// update recording radio buttons if user used hotkey to switch R/W
if (old_movie_readonly != movie_readonly || old_multitrack_recording_joypad != multitrack_recording_joypad)
// update "Recording" checkbox state
if (old_movie_readonly != movie_readonly)
{
Button_SetCheck(hwndRecCheckbox, movie_readonly?BST_UNCHECKED : BST_CHECKED);
old_movie_readonly = movie_readonly;
}
// increase pattern_offset if needed
if (must_increase_pattern_offset)
{
must_increase_pattern_offset = false;
if (!taseditor_config.pattern_skips_lag || lagFlag == 0)
{
pattern_offset++;
if (pattern_offset >= (int)autofire_patterns[taseditor_config.current_pattern].size())
pattern_offset -= autofire_patterns[taseditor_config.current_pattern].size();
}
}
// update "Recording" checkbox text
if (old_pattern_offset != pattern_offset)
{
if (!taseditor_config.pattern_recording || autofire_patterns[taseditor_config.current_pattern][pattern_offset])
// either not using Patterns or current pattern has 1 in current offset
SetWindowText(hwndRecCheckbox, recordingCheckbox);
else
// current pattern has 0 in current offset, this means next recorded frame will be blank
SetWindowText(hwndRecCheckbox, recordingCheckboxBlankPattern);
old_pattern_offset = pattern_offset;
}
// update recording radio buttons if user changed multitrack_recording_joypad
if (old_multitrack_recording_joypad != multitrack_recording_joypad)
{
UncheckRecordingRadioButtons();
RecheckRecordingRadioButtons();
@ -123,13 +161,14 @@ void RECORDER::update()
// call ColumnSet if needed
if (taseditor_config.columnset_by_keys && movie_readonly && taseditor_window.TASEditor_focus)
{
bool alt_pressed = ((GetAsyncKeyState(VK_MENU) & 0x8000) != 0);
for (int joy = 0; joy < num_joys; ++joy)
{
for (int button = 0; button < NUM_JOYPAD_BUTTONS; ++button)
{
// if the button was pressed right now
if ((current_joy[joy] & (1 << button)) && !(old_joy[joy] & (1 << button)))
list.ColumnSet(COLUMN_JOYPAD1_A + joy * NUM_JOYPAD_BUTTONS + button);
list.ColumnSet(COLUMN_JOYPAD1_A + joy * NUM_JOYPAD_BUTTONS + button, alt_pressed);
}
}
}
@ -145,9 +184,7 @@ void RECORDER::UncheckRecordingRadioButtons()
}
void RECORDER::RecheckRecordingRadioButtons()
{
old_movie_readonly = movie_readonly;
old_multitrack_recording_joypad = multitrack_recording_joypad;
Button_SetCheck(hwndRecCheckbox, movie_readonly?BST_UNCHECKED : BST_CHECKED);
switch(multitrack_recording_joypad)
{
case MULTITRACK_RECORDING_ALL:
@ -176,8 +213,14 @@ void RECORDER::InputChanged()
for (int i = 0; i < num_joys; ++i)
{
old_joy[i] = history.GetCurrentSnapshot().GetJoystickInfo(currFrameCounter, i);
new_joy[i] = currMovieData.records[currFrameCounter].joysticks[i];
if (!taseditor_config.pattern_recording || autofire_patterns[taseditor_config.current_pattern][pattern_offset])
new_joy[i] = currMovieData.records[currFrameCounter].joysticks[i];
else
new_joy[i] = 0; // blank
}
if (taseditor_config.pattern_recording)
// postpone incrementing pattern_offset to the end of the frame (when lagFlag will be known)
must_increase_pattern_offset = true;
// combine old and new data (superimpose) and filter out joystics that should not be recorded
if (multitrack_recording_joypad == MULTITRACK_RECORDING_ALL)
{

View File

@ -32,10 +32,13 @@ public:
const char* GetRecordingCaption();
int multitrack_recording_joypad;
int pattern_offset;
std::vector<uint8> current_joy;
private:
int old_multitrack_recording_joypad;
int old_pattern_offset;
bool must_increase_pattern_offset;
bool old_movie_readonly;
HWND hwndRecCheckbox, hwndRB_RecAll, hwndRB_Rec1P, hwndRB_Rec2P, hwndRB_Rec3P, hwndRB_Rec4P;

View File

@ -91,8 +91,9 @@ void SPLICER::CloneFrames()
int frames = current_selection->size();
if (!frames) return;
bool markers_changed = false;
currMovieData.records.reserve(currMovieData.getNumRecords() + frames);
//insert frames before each selection, but consecutive selection lines are accounted as single region
// insert frames before each selection, but consecutive selection lines are accounted as single region
frames = 1;
SelectionFrames::reverse_iterator next_it;
SelectionFrames::reverse_iterator current_selection_rend = current_selection->rend();
@ -105,16 +106,25 @@ void SPLICER::CloneFrames()
// end of current region
currMovieData.cloneRegion(*it, frames);
if (taseditor_config.bind_markers)
markers_manager.insertEmpty(*it, frames);
{
// markers are not cloned
if (markers_manager.insertEmpty(*it,frames))
markers_changed = true;
}
frames = 1;
} else frames++;
}
if (taseditor_config.bind_markers)
int first_changes = history.RegisterChanges(MODTYPE_CLONE, *current_selection->begin());
if (first_changes >= 0)
{
markers_manager.update();
selection.must_find_current_marker = playback.must_find_current_marker = true;
greenzone.InvalidateAndCheck(first_changes);
} else if (markers_changed)
{
history.RegisterMarkersChange(MODTYPE_MARKER_MOVE, *current_selection->begin());
list.RedrawList();
}
greenzone.InvalidateAndCheck(history.RegisterChanges(MODTYPE_CLONE, *current_selection->begin()));
if (markers_changed)
selection.must_find_current_marker = playback.must_find_current_marker = true;
}
void SPLICER::InsertFrames()
@ -123,10 +133,9 @@ void SPLICER::InsertFrames()
int frames = current_selection->size();
if (!frames) return;
//to keep this from being even slower than it would otherwise be, go ahead and reserve records
bool markers_changed = false;
currMovieData.records.reserve(currMovieData.getNumRecords() + frames);
//insert frames before each selection, but consecutive selection lines are accounted as single region
// insert frames before each selection, but consecutive selection lines are accounted as single region
frames = 1;
SelectionFrames::reverse_iterator next_it;
SelectionFrames::reverse_iterator current_selection_rend = current_selection->rend();
@ -139,16 +148,24 @@ void SPLICER::InsertFrames()
// end of current region
currMovieData.insertEmpty(*it,frames);
if (taseditor_config.bind_markers)
markers_manager.insertEmpty(*it,frames);
{
if (markers_manager.insertEmpty(*it,frames))
markers_changed = true;
}
frames = 1;
} else frames++;
}
if (taseditor_config.bind_markers)
int first_changes = history.RegisterChanges(MODTYPE_INSERT, *current_selection->begin());
if (first_changes >= 0)
{
markers_manager.update();
selection.must_find_current_marker = playback.must_find_current_marker = true;
greenzone.InvalidateAndCheck(first_changes);
} else if (markers_changed)
{
history.RegisterMarkersChange(MODTYPE_MARKER_MOVE, *current_selection->begin());
list.RedrawList();
}
greenzone.InvalidateAndCheck(history.RegisterChanges(MODTYPE_INSERT, *current_selection->begin()));
if (markers_changed)
selection.must_find_current_marker = playback.must_find_current_marker = true;
}
void SPLICER::InsertNumFrames()
@ -159,6 +176,7 @@ void SPLICER::InsertNumFrames()
{
if (frames > 0)
{
bool markers_changed = false;
int index;
if (current_selection->size())
{
@ -173,13 +191,23 @@ void SPLICER::InsertNumFrames()
currMovieData.insertEmpty(index, frames);
if (taseditor_config.bind_markers)
{
markers_manager.insertEmpty(index, frames);
selection.must_find_current_marker = playback.must_find_current_marker = true;
if (markers_manager.insertEmpty(index, frames))
markers_changed = true;
}
// select inserted rows
list.update();
selection.SetRegionSelection(index, index + frames - 1);
greenzone.InvalidateAndCheck(history.RegisterChanges(MODTYPE_INSERT, index));
int first_changes = history.RegisterChanges(MODTYPE_INSERT, index);
if (first_changes >= 0)
{
greenzone.InvalidateAndCheck(first_changes);
} else if (markers_changed)
{
history.RegisterMarkersChange(MODTYPE_MARKER_MOVE, index);
list.RedrawList();
}
if (markers_changed)
selection.must_find_current_marker = playback.must_find_current_marker = true;
}
}
}
@ -189,17 +217,21 @@ void SPLICER::DeleteFrames()
SelectionFrames* current_selection = selection.MakeStrobe();
if (current_selection->size() == 0) return;
bool markers_changed = false;
int start_index = *current_selection->begin();
int end_index = *current_selection->rbegin();
SelectionFrames::reverse_iterator current_selection_rend = current_selection->rend();
//delete frames on each selection, going backwards
// delete frames on each selection, going backwards
for(SelectionFrames::reverse_iterator it(current_selection->rbegin()); it != current_selection_rend; it++)
{
currMovieData.records.erase(currMovieData.records.begin() + *it);
if (taseditor_config.bind_markers)
markers_manager.EraseMarker(*it);
{
if (markers_manager.EraseMarker(*it))
markers_changed = true;
}
}
if (taseditor_config.bind_markers)
if (markers_changed)
selection.must_find_current_marker = playback.must_find_current_marker = true;
// check if user deleted all frames
if (!currMovieData.getNumRecords())
@ -211,10 +243,16 @@ void SPLICER::DeleteFrames()
if (result >= 0)
{
greenzone.InvalidateAndCheck(result);
} else if (greenzone.greenZoneCount >= currMovieData.getNumRecords())
} else
{
greenzone.InvalidateAndCheck(currMovieData.getNumRecords()-1);
} else list.RedrawList();
// check special case: user deleted a bunch of empty frames the end of the movie
if (greenzone.greenZoneCount >= currMovieData.getNumRecords())
greenzone.InvalidateAndCheck(currMovieData.getNumRecords()-1);
else
list.RedrawList();
if (markers_changed)
history.RegisterMarkersChange(MODTYPE_MARKER_MOVE, start_index);
}
}
void SPLICER::ClearFrames(SelectionFrames* current_selection)
@ -246,21 +284,32 @@ void SPLICER::Truncate()
if (currMovieData.getNumRecords() > frame+1)
{
int last_frame_was = currMovieData.getNumRecords() - 1;
currMovieData.truncateAt(frame+1);
bool markers_changed = false;
if (taseditor_config.bind_markers)
{
markers_manager.SetMarkersSize(frame+1);
selection.must_find_current_marker = playback.must_find_current_marker = true;
if (markers_manager.SetMarkersSize(frame+1))
{
markers_changed = true;
selection.must_find_current_marker = playback.must_find_current_marker = true;
}
}
list.update();
int result = history.RegisterChanges(MODTYPE_TRUNCATE, frame+1);
if (result >= 0)
{
greenzone.InvalidateAndCheck(result);
} else if (greenzone.greenZoneCount >= currMovieData.getNumRecords())
} else
{
greenzone.InvalidateAndCheck(currMovieData.getNumRecords()-1);
} else list.RedrawList();
// check special case: user truncated empty frames of the movie
if (greenzone.greenZoneCount >= currMovieData.getNumRecords())
greenzone.InvalidateAndCheck(currMovieData.getNumRecords()-1);
else
list.RedrawList();
if (markers_changed)
history.RegisterMarkersChange(MODTYPE_MARKER_UNSET, frame+1, last_frame_was);
}
}
}
@ -478,6 +527,7 @@ bool SPLICER::PasteInsert()
SelectionFrames::iterator current_selection_begin(current_selection->begin());
int num_joypads = joysticks_per_frame[GetInputType(currMovieData)];
bool result = false;
bool markers_changed = false;
int pos = *current_selection_begin;
HANDLE hGlobal = GetClipboardData(CF_TEXT);
if (hGlobal)
@ -523,7 +573,11 @@ bool SPLICER::PasteInsert()
// insert new frame
currMovieData.insertEmpty(pos, 1);
if (taseditor_config.bind_markers) markers_manager.insertEmpty(pos, 1);
if (taseditor_config.bind_markers)
{
if (markers_manager.insertEmpty(pos, 1))
markers_changed = true;
}
inserted_set.insert(pos);
// read this frame input
@ -553,9 +607,17 @@ bool SPLICER::PasteInsert()
pGlobal = strchr(pGlobal, '\n');
}
markers_manager.update();
if (taseditor_config.bind_markers)
int first_changes = history.RegisterPasteInsert(*current_selection_begin, inserted_set);
if (first_changes >= 0)
{
greenzone.InvalidateAndCheck(first_changes);
} else if (markers_changed)
{
history.RegisterMarkersChange(MODTYPE_MARKER_MOVE, *current_selection->begin());
list.RedrawList();
}
if (markers_changed)
selection.must_find_current_marker = playback.must_find_current_marker = true;
greenzone.InvalidateAndCheck(history.RegisterPasteInsert(*current_selection_begin, inserted_set));
// flash list header columns that were changed during paste
for (int joy = 0; joy < num_joypads; ++joy)
{

View File

@ -9,6 +9,11 @@ TASEDITOR_CONFIG::TASEDITOR_CONFIG()
wndy = 0;
wndwidth = 0;
wndheight = 0;
saved_wndx = 0;
saved_wndy = 0;
saved_wndwidth = 0;
saved_wndheight = 0;
wndmaximized = false;
findnote_wndx = 0;
findnote_wndy = 0;
follow_playback = false;
@ -50,8 +55,10 @@ TASEDITOR_CONFIG::TASEDITOR_CONFIG()
enable_auto_function = true;
silent_autosave = true;
tooltips = true;
// empty name
last_author[0] = 0;
current_pattern = 0;
pattern_skips_lag = false;
pattern_recording = false;
last_author[0] = 0; // empty name
}

View File

@ -25,6 +25,11 @@ public:
int wndy;
int wndwidth;
int wndheight;
int saved_wndx;
int saved_wndy;
int saved_wndwidth;
int saved_wndheight;
bool wndmaximized;
int findnote_wndx;
int findnote_wndy;
bool follow_playback;
@ -66,6 +71,9 @@ public:
bool enable_auto_function;
bool silent_autosave;
bool tooltips;
int current_pattern;
bool pattern_skips_lag;
bool pattern_recording;
char last_author[AUTHOR_MAX_LEN];
private:

View File

@ -8,6 +8,9 @@
extern int joysticks_per_frame[NUM_SUPPORTED_INPUT_TYPES];
extern char buttonNames[NUM_JOYPAD_BUTTONS][2];
extern std::vector<std::string> autofire_patterns_names;
extern std::vector<std::vector<uint8>> autofire_patterns;
extern TASEDITOR_CONFIG taseditor_config;
extern TASEDITOR_WINDOW taseditor_window;
extern BOOKMARKS bookmarks;
@ -236,12 +239,31 @@ void TASEDITOR_LIST::update()
next_header_update_time = clock() + HEADER_LIGHT_UPDATE_TICK;
bool changes_made = false;
// 1 - update Frame# columns' heads
if (header_colors[COLUMN_FRAMENUM])
if (header_colors[COLUMN_FRAMENUM] > HEADER_LIGHT_HOLD)
{
header_colors[COLUMN_FRAMENUM]--;
header_colors[COLUMN_FRAMENUM2] = header_colors[COLUMN_FRAMENUM];
changes_made = true;
} else
{
if ((GetAsyncKeyState(VK_MENU) & 0x8000))
{
// Alt key is held
if (header_colors[COLUMN_FRAMENUM] < HEADER_LIGHT_HOLD)
{
header_colors[COLUMN_FRAMENUM]++;
changes_made = true;
}
} else
{
// Alt key is released
if (header_colors[COLUMN_FRAMENUM])
{
header_colors[COLUMN_FRAMENUM]--;
changes_made = true;
}
}
}
header_colors[COLUMN_FRAMENUM2] = header_colors[COLUMN_FRAMENUM];
// update input columns' heads
int i = num_columns-1;
if (i == COLUMN_FRAMENUM2) i--;
@ -754,17 +776,86 @@ void TASEDITOR_LIST::ToggleJoypadBit(int column_index, int row_index, UINT KeyFl
}
void TASEDITOR_LIST::ColumnSet(int column)
void TASEDITOR_LIST::ColumnSet(int column, bool alt_pressed)
{
if (column == COLUMN_FRAMENUM || column == COLUMN_FRAMENUM2)
FrameColumnSet();
else
InputColumnSet(column);
{
// user clicked on "Frame#" - apply ColumnSet to Markers
if (alt_pressed)
{
if (FrameColumnSetPattern())
SetHeaderColumnLight(COLUMN_FRAMENUM, HEADER_LIGHT_MAX);
} else
{
if (FrameColumnSet())
SetHeaderColumnLight(COLUMN_FRAMENUM, HEADER_LIGHT_MAX);
}
} else
{
// user clicked on Input column - apply ColumnSet to Input
int joy = (column - COLUMN_JOYPAD1_A) / NUM_JOYPAD_BUTTONS;
int button = (column - COLUMN_JOYPAD1_A) % NUM_JOYPAD_BUTTONS;
if (alt_pressed)
{
if (InputColumnSetPattern(joy, button))
SetHeaderColumnLight(column, HEADER_LIGHT_MAX);
} else
{
if (InputColumnSet(joy, button))
SetHeaderColumnLight(column, HEADER_LIGHT_MAX);
}
}
}
void TASEDITOR_LIST::FrameColumnSet()
bool TASEDITOR_LIST::FrameColumnSetPattern()
{
SelectionFrames* current_selection = selection.MakeStrobe();
if (current_selection->size() == 0) return;
if (current_selection->size() == 0) return false;
SelectionFrames::iterator current_selection_begin(current_selection->begin());
SelectionFrames::iterator current_selection_end(current_selection->end());
int pattern_offset = 0, current_pattern = taseditor_config.current_pattern;
bool changes_made = false;
for(SelectionFrames::iterator it(current_selection_begin); it != current_selection_end; it++)
{
// skip lag frames
if (taseditor_config.pattern_skips_lag && greenzone.GetLagHistoryAtFrame(*it))
continue;
if (autofire_patterns[current_pattern][pattern_offset])
{
if(!markers_manager.GetMarker(*it))
{
if (markers_manager.SetMarker(*it))
{
changes_made = true;
RedrawRow(*it);
}
}
} else
{
if(markers_manager.GetMarker(*it))
{
markers_manager.ClearMarker(*it);
changes_made = true;
RedrawRow(*it);
}
}
pattern_offset++;
if (pattern_offset >= (int)autofire_patterns[current_pattern].size())
pattern_offset -= autofire_patterns[current_pattern].size();
}
if (changes_made)
{
history.RegisterMarkersChange(MODTYPE_MARKER_PATTERN, *current_selection_begin, *current_selection->rbegin(), autofire_patterns_names[current_pattern].c_str());
selection.must_find_current_marker = playback.must_find_current_marker = true;
return true;
} else
return false;
}
bool TASEDITOR_LIST::FrameColumnSet()
{
SelectionFrames* current_selection = selection.MakeStrobe();
if (current_selection->size() == 0) return false;
SelectionFrames::iterator current_selection_begin(current_selection->begin());
SelectionFrames::iterator current_selection_end(current_selection->end());
@ -810,19 +901,43 @@ void TASEDITOR_LIST::FrameColumnSet()
history.RegisterMarkersChange(MODTYPE_MARKER_UNSET, *current_selection_begin, *current_selection->rbegin());
}
if (changes_made)
{
selection.must_find_current_marker = playback.must_find_current_marker = true;
SetHeaderColumnLight(COLUMN_FRAMENUM, HEADER_LIGHT_MAX);
}
return changes_made;
}
void TASEDITOR_LIST::InputColumnSet(int column)
bool TASEDITOR_LIST::InputColumnSetPattern(int joy, int button)
{
int joy = (column - COLUMN_JOYPAD1_A) / NUM_JOYPAD_BUTTONS;
if (joy < 0 || joy >= joysticks_per_frame[GetInputType(currMovieData)]) return;
int button = (column - COLUMN_JOYPAD1_A) % NUM_JOYPAD_BUTTONS;
if (joy < 0 || joy >= joysticks_per_frame[GetInputType(currMovieData)]) return false;
SelectionFrames* current_selection = selection.MakeStrobe();
if (current_selection->size() == 0) return;
if (current_selection->size() == 0) return false;
SelectionFrames::iterator current_selection_begin(current_selection->begin());
SelectionFrames::iterator current_selection_end(current_selection->end());
int pattern_offset = 0, current_pattern = taseditor_config.current_pattern;
for(SelectionFrames::iterator it(current_selection_begin); it != current_selection_end; it++)
{
// skip lag frames
if (taseditor_config.pattern_skips_lag && greenzone.GetLagHistoryAtFrame(*it))
continue;
currMovieData.records[*it].setBitValue(joy, button, autofire_patterns[current_pattern][pattern_offset] != 0);
pattern_offset++;
if (pattern_offset >= (int)autofire_patterns[current_pattern].size())
pattern_offset -= autofire_patterns[current_pattern].size();
}
int first_changes = history.RegisterChanges(MODTYPE_PATTERN, *current_selection_begin, *current_selection->rbegin(), autofire_patterns_names[current_pattern].c_str());
if (first_changes >= 0)
{
greenzone.InvalidateAndCheck(first_changes);
return true;
} else
return false;
}
bool TASEDITOR_LIST::InputColumnSet(int joy, int button)
{
if (joy < 0 || joy >= joysticks_per_frame[GetInputType(currMovieData)]) return false;
SelectionFrames* current_selection = selection.MakeStrobe();
if (current_selection->size() == 0) return false;
SelectionFrames::iterator current_selection_begin(current_selection->begin());
SelectionFrames::iterator current_selection_end(current_selection->end());
@ -839,14 +954,21 @@ void TASEDITOR_LIST::InputColumnSet(int column)
// apply newValue
for(SelectionFrames::iterator it(current_selection_begin); it != current_selection_end; it++)
currMovieData.records[*it].setBitValue(joy,button,newValue);
int first_changes;
if (newValue)
{
greenzone.InvalidateAndCheck(history.RegisterChanges(MODTYPE_SET, *current_selection_begin, *current_selection->rbegin()));
first_changes = history.RegisterChanges(MODTYPE_SET, *current_selection_begin, *current_selection->rbegin());
} else
{
greenzone.InvalidateAndCheck(history.RegisterChanges(MODTYPE_UNSET, *current_selection_begin, *current_selection->rbegin()));
first_changes = history.RegisterChanges(MODTYPE_UNSET, *current_selection_begin, *current_selection->rbegin());
}
SetHeaderColumnLight(column, HEADER_LIGHT_MAX);
if (first_changes >= 0)
{
greenzone.InvalidateAndCheck(first_changes);
return true;
} else
return false;
}
// -------------------------------------------------------------------------
LRESULT APIENTRY HeaderWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
@ -867,7 +989,7 @@ LRESULT APIENTRY HeaderWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam
info.pt.y = GET_Y_LPARAM(lParam);
SendMessage(hWnd,HDM_HITTEST,0,(LPARAM)&info);
if(info.iItem >= COLUMN_FRAMENUM && info.iItem <= COLUMN_FRAMENUM2)
list.ColumnSet(info.iItem);
list.ColumnSet(info.iItem, (GetKeyState(VK_MENU) < 0));
}
}
return true;
@ -906,12 +1028,6 @@ LRESULT APIENTRY ListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
return 0;
break;
}
case WM_SYSKEYDOWN:
{
if (wParam == VK_F10)
return 0;
break;
}
}
return CallWindowProc(hwndList_oldWndProc, hWnd, msg, wParam, lParam);
}

View File

@ -141,10 +141,7 @@ public:
void DoubleClick(LPNMITEMACTIVATE info);
void ToggleJoypadBit(int column_index, int row_index, UINT KeyFlags);
void ColumnSet(int column);
void InputColumnSet(int column);
void FrameColumnSet();
void ColumnSet(int column, bool alt_pressed);
HWND hwndList, hwndHeader;
@ -156,6 +153,11 @@ public:
private:
void CenterListAt(int frame);
bool FrameColumnSetPattern();
bool FrameColumnSet();
bool InputColumnSetPattern(int joy, int button);
bool InputColumnSet(int joy, int button);
std::vector<uint8> header_colors;
int num_columns;
int next_header_update_time;

View File

@ -164,7 +164,7 @@ void TASEDITOR_LUA::setnote(int index, const char* newtext)
{
// text differs from old note - rename
markers_manager.SetNote(index, text);
history.RegisterMarkersChange(MODTYPE_LUA_MARKER_RENAME, markers_manager.GetMarkerFrame(index));
history.RegisterMarkersChange(MODTYPE_LUA_MARKER_RENAME, markers_manager.GetMarkerFrame(index), -1, text);
selection.must_find_current_marker = playback.must_find_current_marker = true;
}
}

View File

@ -57,7 +57,7 @@ bool TASEDITOR_PROJECT::save()
std::string PFN = GetProjectFile();
if (PFN.empty()) return false;
const char* filename = PFN.c_str();
EMUFILE_FILE* ofs = FCEUD_UTF8_fstream(filename,"wb");
EMUFILE_FILE* ofs = FCEUD_UTF8_fstream(filename, "wb");
currMovieData.loadFrameCount = currMovieData.records.size();
currMovieData.dump(ofs, true);
@ -80,7 +80,7 @@ bool TASEDITOR_PROJECT::save()
}
bool TASEDITOR_PROJECT::save_compact(char* filename, bool save_binary, bool save_markers, bool save_bookmarks, bool save_greenzone, bool save_history, bool save_list, bool save_selection)
{
EMUFILE_FILE* ofs = FCEUD_UTF8_fstream(filename,"wb");
EMUFILE_FILE* ofs = FCEUD_UTF8_fstream(filename, "wb");
currMovieData.loadFrameCount = currMovieData.records.size();
currMovieData.dump(ofs, save_binary);

View File

@ -5,6 +5,8 @@
#include "../taseditor.h"
#include <htmlhelp.h>
#include "../../input.h" // for EMUCMD
#include "../keyboard.h"
#include "../joystick.h"
extern TASEDITOR_CONFIG taseditor_config;
extern PLAYBACK playback;
@ -22,6 +24,8 @@ extern POPUP_DISPLAY popup_display;
extern bool turbo;
extern bool muteTurbo;
extern bool must_call_manual_lua_function;
extern std::vector<std::string> autofire_patterns_names;
extern std::vector<std::vector<uint8>> autofire_patterns;
extern char* GetKeyComboName(int c);
@ -35,9 +39,12 @@ HMENU recent_projects_menu;
char* recent_projects[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
const unsigned int MENU_FIRST_RECENT_PROJECT = 55000;
const unsigned int MAX_NUMBER_OF_RECENT_PROJECTS = sizeof(recent_projects)/sizeof(*recent_projects);
// Patterns Menu
const unsigned int MENU_FIRST_PATTERN = MENU_FIRST_RECENT_PROJECT + MAX_NUMBER_OF_RECENT_PROJECTS;
// resources
char windowCaptioBase[] = "TAS Editor";
char patterns_menu_prefix[] = "Pattern: ";
char taseditor_help_filename[] = "\\taseditor.chm";
// all items of the window (used for resising) and their default x,y,w,h
// actual x,y,w,h are calculated at the beginning from screen
@ -79,6 +86,7 @@ static struct
IDC_RADIO_3P, -1, 0, 0, 0, "", "", false, 0, 0,
IDC_RADIO_4P, -1, 0, 0, 0, "", "", false, 0, 0,
IDC_SUPERIMPOSE, -1, 0, 0, 0, "Allows to superimpose old input with new buttons, instead of overwriting", "", false, 0, 0,
IDC_USEPATTERN, -1, 0, 0, 0, "Applies current Autofire Pattern to input recording", "", false, 0, 0,
TASEDITOR_PREV_MARKER, -1, -1, 0, -1, "Send Selection to previous Marker (hotkey: Ctrl+PageUp)", "", false, 0, 0,
TASEDITOR_FIND_BEST_SIMILAR_MARKER, -1, -1, 0, -1, "Auto-search for Marker Note", "", false, 0, 0,
TASEDITOR_FIND_NEXT_SIMILAR_MARKER, -1, -1, 0, -1, "Continue Auto-search", "", false, 0, 0,
@ -113,15 +121,19 @@ TASEDITOR_WINDOW::TASEDITOR_WINDOW()
void TASEDITOR_WINDOW::init()
{
ready_for_resizing = false;
bool wndmaximized = taseditor_config.wndmaximized;
hTaseditorIcon = (HICON)LoadImage(fceu_hInstance, MAKEINTRESOURCE(IDI_ICON3), IMAGE_ICON, 16, 16, LR_DEFAULTSIZE);
hwndTasEditor = CreateDialog(fceu_hInstance, "TASEDITOR", hAppWnd, WndprocTasEditor);
SendMessage(hwndTasEditor, WM_SETICON, ICON_SMALL, (LPARAM)hTaseditorIcon);
CalculateItems();
// restore position and size from config, also bring the window on top
SetWindowPos(hwndTasEditor, HWND_TOP, taseditor_config.wndx, taseditor_config.wndy, taseditor_config.wndwidth, taseditor_config.wndheight, SWP_NOOWNERZORDER);
SetWindowPos(hwndTasEditor, HWND_TOP, taseditor_config.saved_wndx, taseditor_config.saved_wndy, taseditor_config.saved_wndwidth, taseditor_config.saved_wndheight, SWP_NOOWNERZORDER);
if (wndmaximized)
ShowWindow(hwndTasEditor, SW_SHOWMAXIMIZED);
// menus and checked items
hmenu = GetMenu(hwndTasEditor);
hrmenu = LoadMenu(fceu_hInstance,"TASEDITORCONTEXTMENUS");
patterns_menu = GetSubMenu(hmenu, PATTERNS_MENU_POS);
UpdateCheckedItems();
// tooltips
int x = 0;
@ -181,10 +193,13 @@ void TASEDITOR_WINDOW::init()
}
}
UpdateTooltips();
// recent projects submenu
// create "Recent" submenu
recent_projects_menu = CreateMenu();
UpdateRecentProjectsMenu();
// create "Patterns" menu
UpdatePatternsMenu();
SetTaseditorInput();
reset();
}
void TASEDITOR_WINDOW::exit()
@ -213,6 +228,7 @@ void TASEDITOR_WINDOW::exit()
DestroyIcon(hTaseditorIcon);
hTaseditorIcon = 0;
}
ClearTaseditorInput();
}
void TASEDITOR_WINDOW::reset()
{
@ -238,6 +254,10 @@ void TASEDITOR_WINDOW::CalculateItems()
taseditor_config.wndwidth = min_width;
if (taseditor_config.wndheight < min_height)
taseditor_config.wndheight = min_height;
if (taseditor_config.saved_wndwidth < min_width)
taseditor_config.saved_wndwidth = min_width;
if (taseditor_config.saved_wndheight < min_height)
taseditor_config.saved_wndheight = min_height;
// find current client area of Taseditor window
int main_width = main_r.right - main_r.left;
int main_height = main_r.bottom - main_r.top;
@ -326,6 +346,18 @@ void TASEDITOR_WINDOW::WindowMovedOrResized()
taseditor_config.wndheight = wrect.bottom - wrect.top;
if (taseditor_config.wndheight < min_height)
taseditor_config.wndheight = min_height;
if (IsZoomed(hwndTasEditor))
{
taseditor_config.wndmaximized = true;
} else
{
taseditor_config.wndmaximized = false;
taseditor_config.saved_wndx = taseditor_config.wndx;
taseditor_config.saved_wndy = taseditor_config.wndy;
taseditor_config.saved_wndwidth = taseditor_config.wndwidth;
taseditor_config.saved_wndheight = taseditor_config.wndheight;
}
}
void TASEDITOR_WINDOW::UpdateTooltips()
@ -423,7 +455,7 @@ void TASEDITOR_WINDOW::RightClickMenu(LPNMITEMACTIVATE info)
void TASEDITOR_WINDOW::UpdateCheckedItems()
{
// check option ticks
CheckDlgButton(hwndTasEditor, CHECK_FOLLOW_CURSOR, taseditor_config.follow_playback?MF_CHECKED : MF_UNCHECKED);
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);
if (taseditor_config.superimpose == SUPERIMPOSE_UNCHECKED)
CheckDlgButton(hwndTasEditor, IDC_SUPERIMPOSE, BST_UNCHECKED);
@ -431,8 +463,9 @@ void TASEDITOR_WINDOW::UpdateCheckedItems()
CheckDlgButton(hwndTasEditor, IDC_SUPERIMPOSE, BST_CHECKED);
else
CheckDlgButton(hwndTasEditor, IDC_SUPERIMPOSE, BST_INDETERMINATE);
CheckDlgButton(hwndTasEditor, IDC_RUN_AUTO, taseditor_config.enable_auto_function);
CheckDlgButton(hwndTasEditor, CHECK_TURBO_SEEK, taseditor_config.turbo_seek?MF_CHECKED : MF_UNCHECKED);
CheckDlgButton(hwndTasEditor, IDC_USEPATTERN, taseditor_config.pattern_recording?BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndTasEditor, IDC_RUN_AUTO, taseditor_config.enable_auto_function?BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndTasEditor, CHECK_TURBO_SEEK, taseditor_config.turbo_seek?BST_CHECKED : BST_UNCHECKED);
CheckMenuItem(hmenu, ID_VIEW_SHOW_LAG_FRAMES, taseditor_config.show_lag_frames?MF_CHECKED : MF_UNCHECKED);
CheckMenuItem(hmenu, ID_VIEW_SHOW_MARKERS, taseditor_config.show_markers?MF_CHECKED : MF_UNCHECKED);
CheckMenuItem(hmenu, ID_VIEW_SHOWBRANCHSCREENSHOTS, taseditor_config.show_branch_screenshots?MF_CHECKED : MF_UNCHECKED);
@ -450,13 +483,25 @@ void TASEDITOR_WINDOW::UpdateCheckedItems()
CheckMenuItem(hmenu, ID_CONFIG_USEINPUTKEYSFORCOLUMNSET, taseditor_config.columnset_by_keys?MF_CHECKED : MF_UNCHECKED);
CheckMenuItem(hmenu, ID_CONFIG_KEYBOARDCONTROLSINLISTVIEW, taseditor_config.keyboard_for_listview?MF_CHECKED : MF_UNCHECKED);
CheckMenuItem(hmenu, ID_CONFIG_SUPERIMPOSE_AFFECTS_PASTE, taseditor_config.superimpose_affects_paste?MF_CHECKED : MF_UNCHECKED);
CheckMenuItem(hmenu, ID_CONFIG_MUTETURBO, muteTurbo?MF_CHECKED : MF_UNCHECKED);
CheckMenuItem(hmenu, ID_CONFIG_COLUMNSETPATTERNSKIPSLAG, taseditor_config.pattern_skips_lag?MF_CHECKED : MF_UNCHECKED);
CheckMenuItem(hmenu, ID_CONFIG_SILENTAUTOSAVE, taseditor_config.silent_autosave?MF_CHECKED : MF_UNCHECKED);
CheckMenuItem(hmenu, ID_CONFIG_MUTETURBO, muteTurbo?MF_CHECKED : MF_UNCHECKED);
CheckMenuItem(hmenu, ID_HELP_TOOLTIPS, taseditor_config.tooltips?MF_CHECKED : MF_UNCHECKED);
}
void TASEDITOR_WINDOW::SetTaseditorInput()
{
// set "Background TAS Editor input"
KeyboardSetBackgroundAccessBit(KEYBACKACCESS_TASEDITOR);
JoystickSetBackgroundAccessBit(JOYBACKACCESS_TASEDITOR);
}
void TASEDITOR_WINDOW::ClearTaseditorInput()
{
// clear "Background TAS Editor input"
KeyboardClearBackgroundAccessBit(KEYBACKACCESS_TASEDITOR);
JoystickClearBackgroundAccessBit(JOYBACKACCESS_TASEDITOR);
}
// --------------------------------------------------------------------------------------------
void TASEDITOR_WINDOW::UpdateRecentProjectsMenu()
@ -481,19 +526,16 @@ void TASEDITOR_WINDOW::UpdateRecentProjectsMenu()
// Skip empty strings
if(!recent_projects[x]) continue;
moo.fMask = MIIM_DATA | MIIM_ID | MIIM_TYPE;
moo.fType = 0;
moo.wID = MENU_FIRST_RECENT_PROJECT + x;
std::string tmp = recent_projects[x];
// clamp this string to 128 chars
if(tmp.size() > 128)
tmp = tmp.substr(0, 128);
moo.cbSize = sizeof(moo);
moo.fMask = MIIM_DATA | MIIM_ID | MIIM_TYPE;
// Insert the menu item
moo.cch = tmp.size();
moo.fType = 0;
moo.wID = MENU_FIRST_RECENT_PROJECT + x;
moo.dwTypeData = (LPSTR)tmp.c_str();
InsertMenuItem(recent_projects_menu, 0, 1, &moo);
InsertMenuItem(recent_projects_menu, 0, true, &moo);
}
// if recent_projects is empty, "Recent" manu should be grayed
@ -574,6 +616,54 @@ void TASEDITOR_WINDOW::LoadRecentProject(int slot)
}
}
void TASEDITOR_WINDOW::UpdatePatternsMenu()
{
MENUITEMINFO moo;
int x;
moo.cbSize = sizeof(moo);
// Remove old items from the menu
for(x = GetMenuItemCount(patterns_menu); x > 0 ; x--)
RemoveMenu(patterns_menu, 0, MF_BYPOSITION);
// Fill the menu
for(x = autofire_patterns.size() - 1; x >= 0; x--)
{
moo.fMask = MIIM_DATA | MIIM_ID | MIIM_TYPE;
moo.fType = 0;
moo.wID = MENU_FIRST_PATTERN + x;
std::string tmp = autofire_patterns_names[x];
// clamp this string to 50 chars
if(tmp.size() > PATTERNS_MAX_VISIBLE_NAME)
tmp = tmp.substr(0, PATTERNS_MAX_VISIBLE_NAME);
moo.dwTypeData = (LPSTR)tmp.c_str();
moo.cch = tmp.size();
InsertMenuItem(patterns_menu, 0, true, &moo);
}
RecheckPatternsMenu();
}
void TASEDITOR_WINDOW::RecheckPatternsMenu()
{
CheckMenuRadioItem(patterns_menu, MENU_FIRST_PATTERN, MENU_FIRST_PATTERN + GetMenuItemCount(patterns_menu) - 1, MENU_FIRST_PATTERN + taseditor_config.current_pattern, MF_BYCOMMAND);
// change menu title ("Patterns")
MENUITEMINFO moo;
memset(&moo, 0, sizeof(moo));
moo.cbSize = sizeof(moo);
moo.fMask = MIIM_TYPE;
moo.fType = MFT_STRING;
moo.cch = PATTERNMENU_MAX_VISIBLE_NAME;
int x;
x = GetMenuItemInfo(hmenu, PATTERNS_MENU_POS, true, &moo);
std::string tmp = patterns_menu_prefix;
tmp += autofire_patterns_names[taseditor_config.current_pattern];
// clamp this string
if(tmp.size() > PATTERNMENU_MAX_VISIBLE_NAME)
tmp = tmp.substr(0, PATTERNMENU_MAX_VISIBLE_NAME);
moo.dwTypeData = (LPSTR)tmp.c_str();
moo.cch = tmp.size();
x = SetMenuItemInfo(hmenu, PATTERNS_MENU_POS, true, &moo);
DrawMenuBar(hwndTasEditor);
}
// ====================================================================================================
BOOL CALLBACK WndprocTasEditor(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
@ -713,11 +803,11 @@ BOOL CALLBACK WndprocTasEditor(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
if(LOWORD(wParam))
{
taseditor_window.TASEditor_focus = true;
SetTaseditorInput();
taseditor_window.SetTaseditorInput();
} else
{
taseditor_window.TASEditor_focus = false;
ClearTaseditorInput();
taseditor_window.ClearTaseditorInput();
}
break;
case WM_CTLCOLORSTATIC:
@ -743,6 +833,14 @@ BOOL CALLBACK WndprocTasEditor(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
taseditor_window.LoadRecentProject(loword_wparam - MENU_FIRST_RECENT_PROJECT);
break;
}
// then check clicking Patterns menu item
if (loword_wparam >= MENU_FIRST_PATTERN && loword_wparam < MENU_FIRST_PATTERN + autofire_patterns.size())
{
taseditor_config.current_pattern = loword_wparam - MENU_FIRST_PATTERN;
recorder.pattern_offset = 0;
taseditor_window.RecheckPatternsMenu();
break;
}
// finally check all other commands
switch(loword_wparam)
{
@ -756,7 +854,7 @@ BOOL CALLBACK WndprocTasEditor(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
// enable editing
SendMessage(playback.hwndPlaybackMarkerEdit, EM_SETREADONLY, false, 0);
// disable FCEUX keyboard
ClearTaseditorInput();
taseditor_window.ClearTaseditorInput();
if (taseditor_config.follow_note_context)
list.FollowMarker(playback.shown_marker);
break;
@ -772,7 +870,7 @@ BOOL CALLBACK WndprocTasEditor(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
SendMessage(playback.hwndPlaybackMarkerEdit, EM_SETREADONLY, true, 0);
// enable FCEUX keyboard
if (taseditor_window.TASEditor_focus)
SetTaseditorInput();
taseditor_window.SetTaseditorInput();
break;
}
}
@ -788,7 +886,7 @@ BOOL CALLBACK WndprocTasEditor(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
// enable editing
SendMessage(selection.hwndSelectionMarkerEdit, EM_SETREADONLY, false, 0);
// disable FCEUX keyboard
ClearTaseditorInput();
taseditor_window.ClearTaseditorInput();
if (taseditor_config.follow_note_context)
list.FollowMarker(selection.shown_marker);
break;
@ -804,7 +902,7 @@ BOOL CALLBACK WndprocTasEditor(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
SendMessage(selection.hwndSelectionMarkerEdit, EM_SETREADONLY, true, 0);
// enable FCEUX keyboard
if (taseditor_window.TASEditor_focus)
SetTaseditorInput();
taseditor_window.SetTaseditorInput();
break;
}
}
@ -1096,14 +1194,18 @@ BOOL CALLBACK WndprocTasEditor(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
taseditor_config.superimpose_affects_paste ^= 1;
taseditor_window.UpdateCheckedItems();
break;
case ID_CONFIG_MUTETURBO:
muteTurbo ^= 1;
case ID_CONFIG_COLUMNSETPATTERNSKIPSLAG:
taseditor_config.pattern_skips_lag ^= 1;
taseditor_window.UpdateCheckedItems();
break;
case ID_CONFIG_SILENTAUTOSAVE:
taseditor_config.silent_autosave ^= 1;
taseditor_window.UpdateCheckedItems();
break;
case ID_CONFIG_MUTETURBO:
muteTurbo ^= 1;
taseditor_window.UpdateCheckedItems();
break;
case IDC_PROGRESS_BUTTON:
playback.ClickOnProgressbar();
break;
@ -1141,6 +1243,11 @@ BOOL CALLBACK WndprocTasEditor(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
else taseditor_config.superimpose = SUPERIMPOSE_UNCHECKED;
taseditor_window.UpdateCheckedItems();
break;
case IDC_USEPATTERN:
taseditor_config.pattern_recording ^= 1;
recorder.pattern_offset = 0;
taseditor_window.UpdateCheckedItems();
break;
case ACCEL_CTRL_A:
if (markers_manager.marker_note_edit == MARKER_NOTE_EDIT_UPPER)
SendMessage(playback.hwndPlaybackMarkerEdit, EM_SETSEL, 0, -1);
@ -1334,12 +1441,17 @@ BOOL CALLBACK WndprocTasEditor(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
}
break;
}
case WM_SYSKEYDOWN:
case WM_SYSCOMMAND:
{
if (wParam == VK_F10)
return 0;
break;
switch (wParam)
{
// Disable entering menu by Alt or F10
case SC_KEYMENU:
return true;
}
break;
}
default:
break;
}

View File

@ -1,8 +1,12 @@
//Specification file for TASEDITOR_WINDOW class
#define TASEDITOR_WINDOW_TOTAL_ITEMS 42
#define TASEDITOR_WINDOW_TOTAL_ITEMS 43
#define TOOLTIP_TEXT_MAX_LEN 80
#define TOOLTIPS_AUTOPOP_TIMEOUT 30000
#define PATTERNS_MENU_POS 5
#define PATTERNS_MAX_VISIBLE_NAME 50
#define PATTERNMENU_MAX_VISIBLE_NAME PATTERNS_MAX_VISIBLE_NAME + 6 // + "Pattern: "
enum ECONTEXTMENU
{
CONTEXTMENU_STRAY = 0,
@ -37,6 +41,12 @@ public:
void RemoveRecentProject(unsigned int which);
void LoadRecentProject(int slot);
void UpdatePatternsMenu();
void RecheckPatternsMenu();
void SetTaseditorInput();
void ClearTaseditorInput();
HWND hwndTasEditor, hwndFindNote;
bool TASEditor_focus;
bool ready_for_resizing;
@ -46,8 +56,9 @@ public:
private:
void CalculateItems();
HWND hToolTipWnd;
HMENU hmenu, hrmenu;
HMENU hmenu, hrmenu, patterns_menu;
HICON hTaseditorIcon;
};

View File

@ -403,7 +403,6 @@ void UpdateCheckedMenuItems()
CheckMenuItem(fceumenu, ID_NES_TURBO, turbo ? MF_CHECKED : MF_UNCHECKED);
//Config Menu
// CheckMenuItem(fceumenu, MENU_PAUSEAFTERPLAYBACK, pauseAfterPlayback ? MF_CHECKED : MF_UNCHECKED); // no more
CheckMenuItem(fceumenu, MENU_RUN_IN_BACKGROUND, eoptions & EO_BGRUN ? MF_CHECKED : MF_UNCHECKED);
CheckMenuItem(fceumenu, MENU_BACKGROUND_INPUT, EnableBackgroundInput ? MF_CHECKED : MF_UNCHECKED);
CheckMenuItem(fceumenu, MENU_ENABLE_AUTOSAVE, EnableAutosave ? MF_CHECKED : MF_UNCHECKED);
@ -421,79 +420,28 @@ void UpdateCheckedMenuItems()
CheckMenuItem(fceumenu, MENU_DISPLAY_OBJ, spr?MF_CHECKED:MF_UNCHECKED);
CheckMenuItem(fceumenu, ID_INPUTDISPLAY_OLDSTYLEDISP, oldInputDisplay?MF_CHECKED:MF_UNCHECKED);
//Config - Movie Options, no longer in menu
//CheckMenuItem(fceumenu, ID_DISPLAY_MOVIESUBTITLES, movieSubtitles?MF_CHECKED:MF_UNCHECKED);
//CheckMenuItem(fceumenu, ID_DISPLAY_MOVIESUBTITLES_AVI, subtitlesOnAVI?MF_CHECKED:MF_UNCHECKED);
//Tools Menu
// Tools Menu
CheckMenuItem(fceumenu, MENU_ALTERNATE_AB, GetAutoFireDesynch() ? MF_CHECKED : MF_UNCHECKED);
//AutoFire Patterns
int AutoFirePatternIDs[] = {
MENU_AUTOFIRE_PATTERN_1,
MENU_AUTOFIRE_PATTERN_2,
MENU_AUTOFIRE_PATTERN_3,
MENU_AUTOFIRE_PATTERN_4,
MENU_AUTOFIRE_PATTERN_5,
MENU_AUTOFIRE_PATTERN_6,
MENU_AUTOFIRE_PATTERN_7,
MENU_AUTOFIRE_PATTERN_8,
MENU_AUTOFIRE_PATTERN_9,
MENU_AUTOFIRE_PATTERN_10,
MENU_AUTOFIRE_PATTERN_11,
MENU_AUTOFIRE_PATTERN_12,
MENU_AUTOFIRE_PATTERN_13,
MENU_AUTOFIRE_PATTERN_14,
MENU_AUTOFIRE_PATTERN_15,
0};
int AutoFireOffsetIDs[] = {
MENU_AUTOFIRE_OFFSET_1,
MENU_AUTOFIRE_OFFSET_2,
MENU_AUTOFIRE_OFFSET_3,
MENU_AUTOFIRE_OFFSET_4,
MENU_AUTOFIRE_OFFSET_5,
MENU_AUTOFIRE_OFFSET_6,
0};
x = 0;
CheckedAutoFirePattern = GetCheckedAutoFirePattern();
CheckedAutoFireOffset = GetCheckedAutoFireOffset();
while(AutoFirePatternIDs[x])
{
CheckMenuItem(fceumenu, AutoFirePatternIDs[x],
AutoFirePatternIDs[x] == CheckedAutoFirePattern ? MF_CHECKED : MF_UNCHECKED);
x++;
}
CheckMenuRadioItem(fceumenu, MENU_AUTOFIRE_PATTERN_1, MENU_AUTOFIRE_PATTERN_15, CheckedAutoFirePattern, MF_BYCOMMAND);
CheckedAutoFireOffset = GetCheckedAutoFireOffset();
CheckMenuRadioItem(fceumenu, MENU_AUTOFIRE_OFFSET_1, MENU_AUTOFIRE_OFFSET_6, CheckedAutoFireOffset, MF_BYCOMMAND);
x = 0;
while(AutoFireOffsetIDs[x])
{
CheckMenuItem(fceumenu, AutoFireOffsetIDs[x],
AutoFireOffsetIDs[x] == CheckedAutoFireOffset ? MF_CHECKED : MF_UNCHECKED);
x++;
}
//Check input display
CheckMenuItem(fceumenu, MENU_INPUTDISPLAY_0, MF_UNCHECKED);
CheckMenuItem(fceumenu, MENU_INPUTDISPLAY_1, MF_UNCHECKED);
CheckMenuItem(fceumenu, MENU_INPUTDISPLAY_2, MF_UNCHECKED);
CheckMenuItem(fceumenu, MENU_INPUTDISPLAY_4, MF_UNCHECKED);
// Check input display
switch (input_display)
{
case 0: //Off
CheckMenuItem(fceumenu, MENU_INPUTDISPLAY_0, MF_CHECKED);
case 0: // Off
CheckMenuRadioItem(fceumenu, MENU_INPUTDISPLAY_0, MENU_INPUTDISPLAY_4, MENU_INPUTDISPLAY_0, MF_BYCOMMAND);
break;
case 1: //1 player
CheckMenuItem(fceumenu, MENU_INPUTDISPLAY_1, MF_CHECKED);
case 1: // 1 player
CheckMenuRadioItem(fceumenu, MENU_INPUTDISPLAY_0, MENU_INPUTDISPLAY_4, MENU_INPUTDISPLAY_1, MF_BYCOMMAND);
break;
case 2: //2 player
CheckMenuItem(fceumenu, MENU_INPUTDISPLAY_2, MF_CHECKED);
case 2: // 2 player
CheckMenuRadioItem(fceumenu, MENU_INPUTDISPLAY_0, MENU_INPUTDISPLAY_4, MENU_INPUTDISPLAY_2, MF_BYCOMMAND);
break;
//note: input display can actually have a 3 player display option but is skipped in the hotkey toggle so it is skipped here as well
case 4: //4 player
CheckMenuItem(fceumenu, MENU_INPUTDISPLAY_4, MF_CHECKED);
// note: input display can actually have a 3 player display option but is skipped in the hotkey toggle so it is skipped here as well
case 4: // 4 player
CheckMenuRadioItem(fceumenu, MENU_INPUTDISPLAY_0, MENU_INPUTDISPLAY_4, MENU_INPUTDISPLAY_4, MF_BYCOMMAND);
break;
default:
break;
@ -2302,8 +2250,7 @@ adelikat: Outsourced this to a remappable hotkey
EnableMenuItem(fceumenu, ID_NEWPPU, false);
EnableMenuItem(fceumenu, ID_OLDPPU, false);
}
CheckMenuItem(fceumenu, ID_NEWPPU, newppu ? MF_CHECKED : MF_UNCHECKED);
CheckMenuItem(fceumenu, ID_OLDPPU, !newppu ? MF_CHECKED : MF_UNCHECKED);
CheckMenuRadioItem(fceumenu, ID_NEWPPU, ID_OLDPPU, newppu ? ID_NEWPPU : ID_OLDPPU, MF_BYCOMMAND);
default:
proco:

View File

@ -531,6 +531,9 @@ std::string FCEU_GetPath(int type)
return ""; //adelikat - 03/02/09 - if no override, should return null and allow the last directory to be used intead
//return BaseDirectory + PSS + "tools";
break;
case FCEUMKF_TASEDITOR:
return BaseDirectory + PSS + "tools";
}
return ret;

View File

@ -162,4 +162,5 @@ void FCEU_SplitArchiveFilename(std::string src, std::string& archive, std::strin
#define FCEUMKF_INPUT 19
#define FCEUMKF_LUA 20
#define FCEUMKF_AVI 21
#define FCEUMKF_TASEDITOR 22
#endif

View File

@ -629,10 +629,10 @@ bool LoadFM2(MovieData& movieData, EMUFILE* fp, int size, bool stopAfterHeader)
NEWLINE, KEY, SEPARATOR, VALUE, RECORD, COMMENT, SUBTITLE
} state = NEWLINE;
bool bail = false;
bool iswhitespace, isrecchar, isnewline;
int c;
for(;;)
{
bool iswhitespace, isrecchar, isnewline;
int c;
if(size--<=0) goto bail;
c = fp->fgetc();
if(c == -1)

Binary file not shown.

View File

@ -1 +1,2 @@
This .hnd file is used to create the fceux.chm file (Windows FCEUX help file). It is made with HelpNDoc v2.2 Freeware Version.
This .hnd file is used to create the fceux.chm file (Windows FCEUX help file).
It is made with HelpNDoc v3.0 Freeware Version.

View File

@ -3,7 +3,7 @@ copy ..\output\fceux.exe .
upx ..\output\fceux.exe
IF ERRORLEVEL 1 IF NOT ERRORLEVEL 2 GOTO UPXFailed
cd ..\output
..\vc\zip -X -9 -r ..\vc\fceux.zip fceux.exe fceux.chm 7z.dll *.dll palettes luaScripts
..\vc\zip -X -9 -r ..\vc\fceux.zip fceux.exe fceux.chm 7z.dll *.dll palettes luaScripts tools
move /y ..\vc\fceux.exe .
..\vc\zip -X -9 -r ..\vc\fceux.zip auxlib.lua
cd ..