* updated docs

* new hotkey "Run Manual Lua function" (not mapped by default)
* Taseditor: general cleanup of codebase

[[Split portion of a mixed commit.]]
This commit is contained in:
ansstuff 2012-07-01 14:11:24 +00:00
parent 8e0ea62307
commit 23daa27c16
35 changed files with 313 additions and 294 deletions

View File

@ -1,5 +1,19 @@
24-Jun-2012 - zeromus - add ability for CNROM games to choose whether they have bus conflicts (fixes Colorful Dragon (Unl) (Sachen), since it flakes out if bus conflicts are emulated)
23-Jun-2012 - zeromus - add m116 from fceu-mm; fix mapper 178 big PRG support
20-Jun-2012 - zeromus - fix savestate engine to throw errors when a buggy SFORMAT is passed to AddExState, and fix those errors in m015 and m253
19-Jun-2012 - AnS - added TASEDITOR type of hotkeys
19-Jun-2012 - AnS - Taseditor: 2 new hotkeys: "Switch Auto-restoring" (Ctrl+Spacebar), "Switch current Multitracking mode" (W)
16-Jun-2012 - AnS - Taseditor: drawing patterns with Alt held; no more row_last_clicked
15-Jun-2012 - AnS - Taseditor: added "rewatch from Selection to Playback" feature for Ctrl+middle click action
14-Jun-2012 - AnS - Taseditor: combining consecutive AdjustLag operations
13-Jun-2012 - AnS - Taseditor: truncated Greenzone is drawn by pale colors, not just white
12-Jun-2012 - AnS - Taseditor: "Auto-adjust Input due to lag" checkbox
11-Jun-2012 - AnS - Taseditor: green arrow doesn't disappear when Playback cursor goes through it
11-Jun-2012 - AnS - Taseditor: changed icons column in Piano Roll, now can show both Bookmark and arrow
09-Jun-2012 - zeromus - win32-support funny languages for opening roms, through drag&drop, at least
06-Jun-2012 - AnS - Taseditor: small fix for Branches Tree - among bookmarks with equal jump_frame the cursor must be pointing at current branch
06-Jun-2012 - zeromus - support mapper 176. mapper 176 no longer maps to BMCFK23C. BMCFK23C is still accessible through crc or unif? test case would be welcome. it is unclear to me why mapper 176 control was removed from 176.cpp and given to BMCFK23C
06-Jun-2012 - AnS - Taseditor: autosave works only when project has a filename

Binary file not shown.

View File

@ -294,7 +294,7 @@ BEGIN
END
POPUP "Help", 65535,MFT_STRING,MFS_ENABLED
BEGIN
MENUITEM "Open TAS Editor Manual", ID_HELP_TASEDITORHELP,MFT_STRING,MFS_ENABLED
MENUITEM "Open TAS Editor Manual", ID_HELP_OPEN_MANUAL,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
@ -1887,7 +1887,6 @@ BEGIN
"MAPINPUT", DIALOG
BEGIN
BOTTOMMARGIN, 293
END
"MESSAGELOG", DIALOG

View File

@ -1095,6 +1095,7 @@
#define ID_SELECTED_REMOVEMARKERS 40561
#define ACCEL_CTRL_SPACEBAR 40563
#define ACCEL_CTRL_SPACE 40563
#define ID_HELP_OPEN_MANUAL 40564
#define IDC_DEBUGGER_ICONTRAY 55535
#define MW_ValueLabel2 65423
#define MW_ValueLabel1 65426
@ -1104,7 +1105,7 @@
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 289
#define _APS_NEXT_COMMAND_VALUE 40564
#define _APS_NEXT_COMMAND_VALUE 40565
#define _APS_NEXT_CONTROL_VALUE 1281
#define _APS_NEXT_SYMED_VALUE 101
#endif

View File

@ -17,12 +17,13 @@ Main - Main gate between emulator and Taseditor
* handles some FCEUX hotkeys
------------------------------------------------------------------------------------ */
#include <fstream>
#include "taseditor/taseditor_project.h"
#include "utils/xstring.h"
#include "main.h" // for GetRomName
#include "taseditor.h"
#include "../../input.h"
#include "../keyboard.h"
#include "../joystick.h"
using namespace std;
@ -76,6 +77,7 @@ bool EnterTasEditor()
taseditor_window.init();
if (taseditor_window.hwndTasEditor)
{
SetTaseditorInput();
// save "eoptions"
saved_eoptions = eoptions;
// set "Run in background"
@ -119,7 +121,7 @@ bool EnterTasEditor()
if (currMovieData.savestate.size() != 0)
{
FCEUD_PrintError("This version of TAS Editor doesn't work with movies starting from savestate.");
// delete savestate, but preserve input anyway
// delete savestate, but preserve Input anyway
currMovieData.savestate.clear();
}
FCEUI_StopMovie();
@ -137,7 +139,7 @@ bool EnterTasEditor()
// reset Taseditor variables
must_call_manual_lua_function = false;
SetFocus(history.hwndHistoryList); // set focus only once, to show selection cursor
SetFocus(history.hwndHistoryList); // set focus only once, to show blue selection cursor
SetFocus(piano_roll.hwndList);
FCEU_DispMessage("TAS Editor engaged", 0);
taseditor_window.RedrawTaseditor();
@ -152,6 +154,7 @@ bool ExitTasEditor()
// destroy window
taseditor_window.exit();
ClearTaseditorInput();
// release memory
editor.free();
piano_roll.free();
@ -170,7 +173,7 @@ bool ExitTasEditor()
EnableAutosave = saved_EnableAutosave;
DoPriority();
UpdateCheckedMenuItems();
// switch off taseditor mode
// switch off TAS Editor mode
movieMode = MOVIEMODE_INACTIVE;
FCEU_DispMessage("TAS Editor disengaged", 0);
FCEUMOV_CreateCleanMovie();
@ -192,31 +195,31 @@ void UpdateTasEditor()
LoadProject(fullname);
emulator_must_run_taseditor = false;
}
return;
}
// update all modules that need to be updated every frame
taseditor_window.update();
greenzone.update();
recorder.update();
piano_roll.update();
markers_manager.update();
playback.update();
bookmarks.update();
branches.update();
popup_display.update();
selection.update();
splicer.update();
history.update();
project.update();
// run Lua functions if needed
if (taseditor_config.enable_auto_function)
TaseditorAutoFunction();
if (must_call_manual_lua_function)
} else
{
TaseditorManualFunction();
must_call_manual_lua_function = false;
// update all modules that need to be updated every frame
taseditor_window.update();
greenzone.update();
recorder.update();
piano_roll.update();
markers_manager.update();
playback.update();
bookmarks.update();
branches.update();
popup_display.update();
selection.update();
splicer.update();
history.update();
project.update();
// run Lua functions if needed
if (taseditor_config.enable_auto_function)
TaseditorAutoFunction();
if (must_call_manual_lua_function)
{
TaseditorManualFunction();
must_call_manual_lua_function = false;
}
}
}
@ -315,7 +318,7 @@ void NewProject()
SetInputType(currMovieData, params.input_type);
ApplyMovieInputConfig();
if (params.copy_current_input)
// copy input from current snapshot (from history)
// copy Input from current snapshot (from history)
history.GetCurrentSnapshot().toMovie(currMovieData);
if (!params.copy_current_markers)
markers_manager.reset();
@ -595,11 +598,11 @@ void Import()
if (GetOpenFileName(&ofn))
{
EMUFILE_FILE ifs(nameo, "rb");
// Load input to temporary moviedata
// Load Input to temporary moviedata
MovieData md;
if (LoadFM2(md, &ifs, ifs.size(), false))
{
// loaded successfully, now register input changes
// loaded successfully, now register Input changes
char drv[512], dir[512], name[1024], ext[512];
splitpath(nameo, drv, dir, name, ext);
strcat(name, ext);
@ -607,7 +610,7 @@ void Import()
if (result >= 0)
greenzone.InvalidateAndCheck(result);
else
MessageBox(taseditor_window.hwndTasEditor, "Imported movie has the same input.\nNo changes were made.", "TAS Editor", MB_OK);
MessageBox(taseditor_window.hwndTasEditor, "Imported movie has the same Input.\nNo changes were made.", "TAS Editor", MB_OK);
} else
{
FCEUD_PrintError("Error loading movie data!");
@ -778,12 +781,16 @@ void ApplyMovieInputConfig()
// this getter contains formula to decide whether to record or replay movie
bool TaseditorIsRecording()
{
if (movie_readonly || playback.pause_frame > currFrameCounter)
if (movie_readonly || playback.GetPauseFrame() > currFrameCounter)
return false; // replay
return true; // record
}
void Taseditor_RecordInput()
{
recorder.InputChanged();
}
// this gate handles FCEUX hotkeys (EMUCMD)
// this gate handles some FCEUX hotkeys (EMUCMD)
void Taseditor_EMUCMD(int command)
{
switch (command)
@ -849,6 +856,10 @@ void Taseditor_EMUCMD(int command)
case EMUCMD_LOAD_STATE_SLOT_9:
bookmarks.command(COMMAND_DEPLOY, command - EMUCMD_LOAD_STATE_SLOT_0);
break;
case EMUCMD_MOVIE_PLAY_FROM_BEGINNING:
movie_readonly = true;
playback.jump(0);
break;
case EMUCMD_RELOAD:
taseditor_window.LoadRecentProject(0);
break;
@ -867,8 +878,23 @@ void Taseditor_EMUCMD(int command)
if (recorder.multitrack_recording_joypad > joysticks_per_frame[GetInputType(currMovieData)])
recorder.multitrack_recording_joypad = 0;
break;
case EMUCMD_TASEDITOR_RUN_MANUAL_LUA:
// the function will be called in next window update
must_call_manual_lua_function = true;
break;
}
}
// these functions allow/disallow some FCEUX hotkeys
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);
}

View File

@ -29,6 +29,9 @@ void SetInputType(MovieData& md, int new_input_type);
void ApplyMovieInputConfig();
bool TaseditorIsRecording();
void Taseditor_RecordInput();
void Taseditor_EMUCMD(int command);
void SetTaseditorInput();
void ClearTaseditorInput();

View File

@ -65,7 +65,7 @@ bool BOOKMARK::checkDiffFromCurrent()
void BOOKMARK::set()
{
// copy input and hotchanges
// copy Input and Hotchanges
snapshot.init(currMovieData, taseditor_config.enable_hot_changes);
snapshot.jump_frame = currFrameCounter;
if (taseditor_config.enable_hot_changes)

View File

@ -265,8 +265,8 @@ void BOOKMARKS::reset_vars()
void BOOKMARKS::update()
{
// execute all commands if needed
for (int i = 0; (i + 1) < (int)commands.size(); )
// execute all commands accumulated during last frame
for (int i = 0; (i + 1) < (int)commands.size(); ) // FIFO
{
int command_id = commands[i++];
int slot = commands[i++];
@ -391,7 +391,7 @@ void BOOKMARKS::jump(int slot)
{
int frame = bookmarks_array[slot].snapshot.jump_frame;
playback.jump(frame);
if (playback.pause_frame)
if (playback.GetPauseFrame())
piano_roll.FollowPauseframe();
bookmarks_array[slot].jumped();
}
@ -674,7 +674,7 @@ LONG BOOKMARKS::CustomDraw(NMLVCUSTOMDRAW* msg)
msg->clrTextBk = PALE_GREENZONE_FRAMENUM_COLOR;
} else msg->clrTextBk = NORMAL_FRAMENUM_COLOR;
} else msg->clrTextBk = NORMAL_FRAMENUM_COLOR;
} else msg->clrTextBk = 0xFFFFFF; // empty bookmark
} else msg->clrTextBk = NORMAL_BACKGROUND_COLOR; // empty bookmark
} else if (cell_x == BOOKMARKS_COLUMN_TIME)
{
if (bookmarks_array[cell_y].not_empty)
@ -705,7 +705,7 @@ LONG BOOKMARKS::CustomDraw(NMLVCUSTOMDRAW* msg)
msg->clrTextBk = PALE_GREENZONE_INPUT_COLOR1;
} else msg->clrTextBk = NORMAL_INPUT_COLOR1;
} else msg->clrTextBk = NORMAL_INPUT_COLOR1;
} else msg->clrTextBk = 0xFFFFFF; // empty bookmark
} else msg->clrTextBk = NORMAL_BACKGROUND_COLOR; // empty bookmark
}
default:
return CDRF_DODEFAULT;

View File

@ -39,7 +39,6 @@ extern GREENZONE greenzone;
extern TASEDITOR_PROJECT project;
extern HISTORY history;
extern PIANO_ROLL piano_roll;
extern MARKERS_MANAGER markers_manager;
extern BOOKMARKS bookmarks;
extern COLORREF bookmark_flash_colors[TOTAL_COMMANDS][FLASH_PHASE_MAX+1];
@ -302,7 +301,7 @@ void BRANCHES::update()
// just update sprites
InvalidateRect(bookmarks.hwndBranchesBitmap, 0, FALSE);
}
// calculate playback position
// calculate Playback cursor position
int branch, branch_x, branch_y, parent, parent_x, parent_y, upper_frame, lower_frame;
double distance;
if (current_branch != ITEM_UNDER_MOUSE_CLOUD)
@ -378,7 +377,7 @@ void BRANCHES::update()
playback_y = BRANCHES_CLOUD_Y;
}
}
// move cursor to playback position
// move corners cursor to Playback cursor position
double dx = playback_x - cursor_x;
double dy = playback_y - cursor_y;
distance = sqrt(dx*dx + dy*dy);
@ -905,7 +904,7 @@ void BRANCHES::RecalculateParents()
temp_parent = parents[temp_parent];
if (temp_parent == ITEM_UNDER_MOUSE_CLOUD)
{
// all ok, this is a good candidate for being the parent of the Branch
// all ok, this is good candidate for being the parent of the Branch
candidates.push_back(t);
if (max_jump_frame < temp_jump_frame)
max_jump_frame = temp_jump_frame;
@ -1252,7 +1251,7 @@ LRESULT APIENTRY BranchesBitmapWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARA
}
case WM_LBUTTONDOWN:
{
// single click on Branches Tree = send playback to the Bookmark
// single click on Branches Tree = send Playback to the Bookmark
int branch_under_mouse = bookmarks.item_under_mouse;
if (branch_under_mouse == ITEM_UNDER_MOUSE_CLOUD)
{

View File

@ -146,7 +146,7 @@ private:
char cloud_time[TIME_DESC_LENGTH];
char current_pos_time[TIME_DESC_LENGTH];
std::vector<std::vector<int>> cached_first_difference;
std::vector<int8> cached_timelines; // stores id of the last branch on the timeline of every Branch. Sometimes it's the id of the Branch itself, but sometimes it's an id of its child/frandchild that shares the same input
std::vector<int8> cached_timelines; // stores id of the last branch on the timeline of every Branch. Sometimes it's the id of the Branch itself, but sometimes it's an id of its child/grandchild that shares the same Input
// not saved vars
int transition_phase;

View File

@ -10,7 +10,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
Editor - Interface for editing Input and Markers
[Singleton]
* implements operations of changing Input: toggle input in region, set input by pattern, toggle selected region, apply pattern to input selection
* implements operations of changing Input: toggle Input in region, set Input by pattern, toggle selected region, apply pattern to Input selection
* implements operations of changing Markers: toggle Markers in selection, apply patern to Markers in selection, mark/unmark all selected frames
* stores Autofire Patterns data and their loading/generating code
* stores resources: patterns filename, id of buttonpresses in patterns
@ -128,7 +128,7 @@ void EDITOR::update()
}
// ----------------------------------------------------------------------------------------------
// returns false if couldn't real a string containing at least one char
// returns false if couldn't read a string containing at least one char
bool EDITOR::ReadString(EMUFILE *is, std::string& dest)
{
dest.resize(0);

View File

@ -16,7 +16,7 @@ Greenzone - Access zone
* regularly checks if there's a savestate of current emulation state, if there's no such savestate in array then creates one and updates lag info for previous frame
* implements the working of "Auto-adjust Input due to lag"
* regularly runs gradual cleaning of the savestates array (for memory saving), deleting oldest savestates
* on demand: (when movie input was changed) truncates the size of Greenzone, deleting savestates that became irrelevant because of new input. After truncating it may also move Playback cursor (which must always reside within Greenzone) and may launch Playback seeking
* on demand: (when movie Input was changed) truncates the size of Greenzone, deleting savestates that became irrelevant because of new Input. After truncating it may also move Playback cursor (which must always reside within Greenzone) and may launch Playback seeking
* stores resources: save id, properties of gradual cleaning, timing of cleaning
------------------------------------------------------------------------------------ */
@ -73,7 +73,7 @@ void GREENZONE::update()
void GREENZONE::CollectCurrentState()
{
// update greenzone upper limit if needed
// update Greenzone upper limit if needed
if (greenZoneCount <= currFrameCounter)
greenZoneCount = currFrameCounter + 1;
@ -94,21 +94,21 @@ void GREENZONE::CollectCurrentState()
{
if (old_lagFlag && !lagFlag)
{
// there's no more lag on previous frame - shift input up
// there's no more lag on previous frame - shift Input up
lag_history.erase(lag_history.begin() + (currFrameCounter - 1));
editor.AdjustUp(currFrameCounter - 1);
// since AdjustUp didn't restore Playback cursor, we must rewind here
int pause_frame = playback.pause_frame;
int pause_frame = playback.GetPauseFrame();
playback.jump(currFrameCounter - 1); // rewind
if (pause_frame)
playback.SeekingStart(pause_frame);
} else if (!old_lagFlag && lagFlag)
{
// there's new lag on previous frame - shift input down
// there's new lag on previous frame - shift Input down
lag_history.insert(lag_history.begin() + (currFrameCounter - 1), 1);
editor.AdjustDown(currFrameCounter - 1);
// since AdjustDown didn't restore Playback cursor, we must rewind here
int pause_frame = playback.pause_frame;
int pause_frame = playback.GetPauseFrame();
playback.jump(currFrameCounter - 1); // rewind
if (pause_frame)
playback.SeekingStart(pause_frame);
@ -228,7 +228,7 @@ void GREENZONE::WriteSavestate(int frame, std::vector<uint8>& savestate)
savestates.resize(frame + 1);
if (greenZoneCount <= frame)
{
// clear old savestates: from current end of greenzone to new end of greenzone
// clear old savestates: from current end of Greenzone to new end of Greenzone
for (int i = greenZoneCount; i <= frame; ++i)
ClearSavestate(i);
greenZoneCount = frame + 1;
@ -254,7 +254,7 @@ void GREENZONE::save(EMUFILE *os, bool really_save)
compress(&cbuf[0], &comprlen, &lag_history[0], len);
write32le(comprlen, os);
os->fwrite(&cbuf[0], comprlen);
// write playback position
// write Playback cursor position
write32le(currFrameCounter, os);
// write savestates
int frame, size;
@ -281,7 +281,7 @@ void GREENZONE::save(EMUFILE *os, bool really_save)
{
// write "GREENZONX" string
os->fwrite(greenzone_skipsave_id, GREENZONE_ID_LEN);
// write playback position
// write Playback cursor position
write32le(currFrameCounter, os);
if (currFrameCounter > 0)
{
@ -299,7 +299,7 @@ bool GREENZONE::load(EMUFILE *is, bool really_load)
if (!really_load)
{
reset();
playback.StartFromZero(); // reset playback to frame 0
playback.StartFromZero(); // reset Playback cursor to frame 0
return false;
}
int frame = 0, prev_frame = -1, size = 0;
@ -310,7 +310,7 @@ bool GREENZONE::load(EMUFILE *is, bool really_load)
if (!strcmp(greenzone_skipsave_id, save_id))
{
// string says to skip loading Greenzone
// read playback position
// read Playback cursor position
if (read32le(&frame, is))
{
currFrameCounter = frame;
@ -326,17 +326,17 @@ bool GREENZONE::load(EMUFILE *is, bool really_load)
{
if (loadTasSavestate(currFrameCounter))
{
FCEU_printf("No greenzone in the file\n");
FCEU_printf("No Greenzone in the file\n");
return false;
}
}
}
} else
{
// literally no greenzone in the file, but this is still not a error
// literally no Greenzone in the file, but this is still not a error
reset();
playback.StartFromZero(); // reset playback to frame 0
FCEU_printf("No greenzone in the file, playback at frame 0\n");
playback.StartFromZero(); // reset Playback cursor to frame 0
FCEU_printf("No Greenzone in the file, Playback at frame 0\n");
return false;
}
}
@ -358,7 +358,7 @@ bool GREENZONE::load(EMUFILE *is, bool really_load)
if (is->fread(&cbuf[0], comprlen) != comprlen) goto error;
int e = uncompress(&lag_history[0], &destlen, &cbuf[0], comprlen);
if (e != Z_OK && e != Z_BUF_ERROR) goto error;
// read playback position
// read Playback cursor position
if (read32le(&frame, is))
{
currFrameCounter = frame;
@ -394,7 +394,7 @@ bool GREENZONE::load(EMUFILE *is, bool really_load)
// load this savestate
savestates[frame].resize(size);
if ((int)is->fread(&savestates[frame][0], size) < size) break;
prev_frame = frame; // successfully read one greenzone frame info
prev_frame = frame; // successfully read one Greenzone frame info
}
}
if (prev_frame+1 == greenZoneCount)
@ -418,16 +418,16 @@ bool GREENZONE::load(EMUFILE *is, bool really_load)
{
currFrameCounter = prev_frame;
greenZoneCount = prev_frame+1; // cut greenZoneCount to this good frame
FCEU_printf("Greenzone loaded partially, playback moved to the end of greenzone\n");
FCEU_printf("Greenzone loaded partially, Playback moved to the end of greenzone\n");
return false;
}
}
}
}
error:
FCEU_printf("Error loading greenzone\n");
FCEU_printf("Error loading Greenzone\n");
reset();
playback.StartFromZero(); // reset playback to frame 0
playback.StartFromZero(); // reset Playback cursor to frame 0
return true;
}
// -------------------------------------------------------------------------------------------------
@ -440,12 +440,12 @@ 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 cursor position
if (currFrameCounter >= greenZoneCount)
{
if (playback.pause_frame && playback.pause_frame_must_be_fixed)
if (playback.GetFixedPauseFrame())
{
playback.jump(playback.pause_frame - 1);
playback.jump(playback.GetPauseFrame() - 1);
} else
{
playback.SetLostPosition(currFrameCounter);
@ -457,7 +457,7 @@ void GREENZONE::InvalidateAndCheck(int after)
}
}
}
// redraw Piano Roll even if greenzone didn't change
// redraw Piano Roll even if Greenzone didn't change
piano_roll.RedrawList();
bookmarks.RedrawBookmarksList();
}
@ -472,7 +472,7 @@ void GREENZONE::Invalidate(int after)
currMovieData.rerecordCount++;
}
}
// redraw Piano Roll even if greenzone didn't change
// redraw Piano Roll even if Greenzone didn't change
piano_roll.RedrawList();
bookmarks.RedrawBookmarksList();
}

View File

@ -3,7 +3,7 @@
#define GREENZONE_ID_LEN 10
#define TIME_BETWEEN_CLEANINGS 10000 // in milliseconds
// greenzone cleaning masks
// Greenzone cleaning masks
#define EVERY16TH 0xFFFFFFF0
#define EVERY8TH 0xFFFFFFF8
#define EVERY4TH 0xFFFFFFFC

View File

@ -243,7 +243,7 @@ void HISTORY::HistorySizeChanged()
RedrawHistoryList();
}
// returns frame of first input change (for Greenzone invalidation)
// returns frame of first Input change (for Greenzone invalidation)
int HISTORY::JumpInTime(int new_pos)
{
if (new_pos < 0)
@ -383,7 +383,7 @@ int HISTORY::JumpInTime(int new_pos)
{
snapshots[real_pos].toMovie(currMovieData, first_change);
selection.must_find_current_marker = playback.must_find_current_marker = true;
// Piano Roll Redraw and ProjectChanged will be called by greenzone invalidation
// Piano Roll Redraw and ProjectChanged will be called by Greenzone invalidation
} else if (markers_changed)
{
markers_manager.update();
@ -459,6 +459,8 @@ void HISTORY::AddItemToHistory(SNAPSHOT &snap, int cur_branch, BOOKMARK &bookm)
backup_current_branch[real_pos] = cur_branch;
RedrawHistoryList();
}
// --------------------------------------------------------------------
// Here goes the set of functions that register project changes and log them into History log
// returns frame of first actual change
int HISTORY::RegisterChanges(int mod_type, int start, int end, const char* comment, int consecutive_tag)
@ -466,7 +468,7 @@ int HISTORY::RegisterChanges(int mod_type, int start, int end, const char* comme
// create new shanshot
SNAPSHOT snap;
snap.init(currMovieData, taseditor_config.enable_hot_changes);
// check if there are input differences from latest snapshot
// check if there are Input differences from latest snapshot
int real_pos = (history_start_pos + history_cursor_pos) % history_size;
int first_changes = snap.findFirstChange(snapshots[real_pos], start, end);
if (first_changes >= 0)
@ -495,7 +497,7 @@ int HISTORY::RegisterChanges(int mod_type, int start, int end, const char* comme
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
// for these changes user prefers to see frame of attempted change (Selection cursor position), not frame of actual differences
snap.jump_frame = start;
break;
}
@ -669,7 +671,7 @@ int HISTORY::RegisterInsertNum(int start, int frames)
// create new shanshot
SNAPSHOT snap;
snap.init(currMovieData, taseditor_config.enable_hot_changes);
// check if there are input differences from latest snapshot
// check if there are Input differences from latest snapshot
int real_pos = (history_start_pos + history_cursor_pos) % history_size;
int first_changes = snap.findFirstChange(snapshots[real_pos], start);
if (first_changes >= 0)
@ -703,7 +705,7 @@ int HISTORY::RegisterPasteInsert(int start, SelectionFrames& inserted_set)
// create new shanshot
SNAPSHOT snap;
snap.init(currMovieData, taseditor_config.enable_hot_changes);
// check if there are input differences from latest snapshot
// check if there are Input differences from latest snapshot
int real_pos = (history_start_pos + history_cursor_pos) % history_size;
int first_changes = snap.findFirstChange(snapshots[real_pos], start);
if (first_changes >= 0)
@ -712,7 +714,7 @@ int HISTORY::RegisterPasteInsert(int start, SelectionFrames& inserted_set)
// fill description:
snap.mod_type = MODTYPE_PASTEINSERT;
strcat(snap.description, modCaptions[snap.mod_type]);
// for PasteInsert user prefers to see frame of attempted change (selection beginning), not frame of actual differences
// for PasteInsert user prefers to see frame of attempted change (Selection cursor position), not frame of actual differences
snap.jump_frame = start;
snap.start_frame = start;
snap.end_frame = -1;
@ -763,7 +765,7 @@ void HISTORY::RegisterMarkersChange(int mod_type, int start, int end, const char
strcat(snap.description, " ");
strncat(snap.description, comment, SNAPSHOT_DESC_MAX_LENGTH - strlen(snap.description) - 1);
}
// input hotchanges aren't changed
// Hotchanges aren't changed
if (taseditor_config.enable_hot_changes)
snap.copyHotChanges(&GetCurrentSnapshot());
AddItemToHistory(snap);
@ -793,7 +795,7 @@ int HISTORY::RegisterBranching(int slot, bool markers_changed)
// create new snapshot
SNAPSHOT snap;
snap.init(currMovieData, taseditor_config.enable_hot_changes);
// check if there are input differences from latest snapshot
// check if there are Input differences from latest snapshot
int real_pos = (history_start_pos + history_cursor_pos) % history_size;
int first_changes = snap.findFirstChange(snapshots[real_pos]);
if (first_changes >= 0)
@ -820,7 +822,7 @@ int HISTORY::RegisterBranching(int slot, bool markers_changed)
snap.jump_frame = bookmarks.bookmarks_array[slot].snapshot.jump_frame;
snap.start_frame = 0;
snap.end_frame = -1;
// input was not changed, only Markers were changed
// Input was not changed, only Markers were changed
if (taseditor_config.enable_hot_changes)
snap.copyHotChanges(&GetCurrentSnapshot());
AddItemToHistory(snap, branches.GetCurrentBranch());
@ -909,7 +911,7 @@ int HISTORY::RegisterImport(MovieData& md, char* filename)
// create new snapshot
SNAPSHOT snap;
snap.init(md, taseditor_config.enable_hot_changes, GetInputType(currMovieData));
// check if there are input differences from latest snapshot
// check if there are Input differences from latest snapshot
int real_pos = (history_start_pos + history_cursor_pos) % history_size;
int first_changes = snap.findFirstChange(snapshots[real_pos]);
if (first_changes >= 0)
@ -926,7 +928,7 @@ int HISTORY::RegisterImport(MovieData& md, char* filename)
strncat(snap.description, filename, SNAPSHOT_DESC_MAX_LENGTH - strlen(snap.description) - 1);
if (taseditor_config.enable_hot_changes)
{
// do not inherit old hotchanges, because imported input (most likely) doesn't have direct connection with recent edits, so old hotchanges are irrelevant and should not be copied
// do not inherit old hotchanges, because imported Input (most likely) doesn't have direct connection with recent edits, so old hotchanges are irrelevant and should not be copied
snap.fillHotChanges(snapshots[real_pos], first_changes);
}
AddItemToHistory(snap);
@ -942,7 +944,7 @@ int HISTORY::RegisterLuaChanges(const char* name, int start, bool InsertionDelet
// create new shanshot
SNAPSHOT snap;
snap.init(currMovieData, taseditor_config.enable_hot_changes);
// check if there are input differences from latest snapshot
// check if there are Input differences from latest snapshot
int real_pos = (history_start_pos + history_cursor_pos) % history_size;
int first_changes = snap.findFirstChange(snapshots[real_pos], start);
if (first_changes >= 0)

View File

@ -18,7 +18,7 @@ public:
// saved data
std::vector<std::string> notes; // Format: 0th - note for intro (Marker 0), 1st - note for Marker1, 2nd - note for Marker2, ...
// not saved data
std::vector<int> markers_array; // Format: 0th = marker num (id) for frame 0, 1st = marker num for frame 1, ...
std::vector<int> markers_array; // Format: 0th = Marker num (id) for frame 0, 1st = Marker num for frame 1, ...
private:
// also saved data

View File

@ -12,7 +12,7 @@ Markers_manager - Manager of Markers
* stores one snapshot of Markers, representing current state of Markers in the project
* saves and loads the data from a project file. On error: clears the data
* regularly ensures that the size of current Markers array is not less than the number of frames in current input
* regularly ensures that the size of current Markers array is not less than the number of frames in current Input
* implements all operations with Markers: setting Marker to a frame, removing Marker, inserting/deleting frames between Markers, truncating Markers array, changing Notes, finding frame for any given Marker, access to the data of Snapshot of Markers state
* implements full/partial copying of data between two Snapshots of Markers state, and searching for first difference between two Snapshots of Markers state
* also here's the code of searching for "similar" Notes
@ -62,6 +62,7 @@ void MARKERS_MANAGER::reset()
}
void MARKERS_MANAGER::update()
{
// the size of current markers_array must be no less then the size of Input
if ((int)markers.markers_array.size() < currMovieData.getNumRecords())
markers.markers_array.resize(currMovieData.getNumRecords());
}
@ -72,11 +73,11 @@ void MARKERS_MANAGER::save(EMUFILE *os, bool really_save)
{
// write "MARKERS" string
os->fwrite(markers_save_id, MARKERS_ID_LEN);
markers.Set_already_compressed(false); // must recompress data, because it has changed, probably
markers.Set_already_compressed(false); // must recompress data, because most likely it has changed since last compression
markers.save(os);
} else
{
// write "MARKERX" string, meaning that markers are not saved
// write "MARKERX" string, meaning that Markers are not saved
os->fwrite(markers_skipsave_id, MARKERS_ID_LEN);
}
}
@ -94,7 +95,7 @@ bool MARKERS_MANAGER::load(EMUFILE *is, bool really_load)
if (!strcmp(markers_skipsave_id, save_id))
{
// string says to skip loading Markers
FCEU_printf("No markers in the file\n");
FCEU_printf("No Markers in the file\n");
reset();
return false;
}
@ -103,7 +104,7 @@ bool MARKERS_MANAGER::load(EMUFILE *is, bool really_load)
// all ok
return false;
error:
FCEU_printf("Error loading markers\n");
FCEU_printf("Error loading Markers\n");
reset();
return true;
}
@ -114,7 +115,7 @@ int MARKERS_MANAGER::GetMarkersSize()
}
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)
// 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--)
{
@ -161,7 +162,7 @@ int MARKERS_MANAGER::GetMarkerFrame(int marker_id)
// didn't find
return -1;
}
// returns number of new marker
// returns number of new Marker
int MARKERS_MANAGER::SetMarker(int frame)
{
if (frame < 0)
@ -176,9 +177,9 @@ int MARKERS_MANAGER::SetMarker(int frame)
if (taseditor_config.empty_marker_notes)
markers.notes.insert(markers.notes.begin() + marker_num, 1, "");
else
// copy previous marker note
// copy previous Marker note
markers.notes.insert(markers.notes.begin() + marker_num, 1, markers.notes[marker_num - 1]);
// increase following markers' ids
// increase following Markers' ids
int size = markers.markers_array.size();
for (frame++; frame < size; ++frame)
if (markers.markers_array[frame])
@ -191,9 +192,9 @@ void MARKERS_MANAGER::ClearMarker(int frame)
{
// erase corresponding note
markers.notes.erase(markers.notes.begin() + markers.markers_array[frame]);
// clear marker
// clear Marker
markers.markers_array[frame] = 0;
// decrease following markers' ids
// decrease following Markers' ids
int size = markers.markers_array.size();
for (frame++; frame < size; ++frame)
if (markers.markers_array[frame])
@ -216,7 +217,7 @@ 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 there's a Marker, first clear it
if (markers.markers_array[frame])
{
ClearMarker(frame);
@ -298,27 +299,27 @@ void MARKERS_MANAGER::RestoreFromCopy(MARKERS& source, int until_frame)
{
if (until_frame >= 0)
{
// restore markers up to and not including the frame
// restore Markers up to and not including the frame
if ((int)markers.markers_array.size() <= until_frame)
{
// only copy head of source
markers.markers_array = source.markers_array;
markers.markers_array.resize(until_frame);
markers.notes = source.notes;
// find last marker
// find last Marker
int last_marker = GetMarkerUp(until_frame-1);
// delete all notes following the note of the last marker
// delete all notes following the note of the last Marker
markers.notes.resize(last_marker+1);
} else
{
// combine head of source and tail of destination (old markers)
// 1 - head = part of source markers
// combine head of source and tail of destination (old Markers)
// 1 - head = part of source Markers
std::vector<int> temp_markers_array;
std::vector<std::string> temp_notes;
temp_markers_array = source.markers_array;
temp_markers_array.resize(until_frame);
temp_notes = source.notes;
// find last marker in temp_markers_array
// find last Marker in temp_markers_array
int last_marker, frame;
for (frame = until_frame-1; frame >= 0; frame--)
if (temp_markers_array[frame]) break;
@ -326,22 +327,22 @@ void MARKERS_MANAGER::RestoreFromCopy(MARKERS& source, int until_frame)
last_marker = temp_markers_array[frame];
else
last_marker = 0;
// delete all temp_notes foolowing the note of the last marker
// delete all temp_notes foolowing the note of the last Marker
temp_notes.resize(last_marker+1);
// 2 - tail = part of old (current) markers
// delete all markers (and their notes) up to and not including until_frame
// 2 - tail = part of old (current) Markers
// delete all Markers (and their notes) up to and not including until_frame
//for (int i = until_frame-1; i >= 0; i--) // actually no need for that
// ClearMarker(i);
// 3 - combine head and tail (if there are actually markers left in the tail)
// 3 - combine head and tail (if there are actually Markers left in the tail)
int size = markers.markers_array.size();
temp_markers_array.resize(size);
for (int i = until_frame; i < size; ++i)
{
if (markers.markers_array[i])
{
last_marker++; // make new id for old marker
last_marker++; // make new id for old Marker
temp_markers_array[i] = last_marker;
temp_notes.push_back(markers.notes[markers.markers_array[i]]); // take note from old markers and add it to the end of the head
temp_notes.push_back(markers.notes[markers.markers_array[i]]); // take note from old Markers and add it to the end of the head
}
}
// 4 - save result
@ -390,7 +391,7 @@ bool MARKERS_MANAGER::checkMarkersDiff(MARKERS& their_markers, int end)
return false;
}
// ------------------------------------------------------------------------------------
// ordering function, used by std::sort
// custom ordering function, used by std::sort
bool ordering(const std::pair<int, double>& d1, const std::pair<int, double>& d2)
{
return d1.second < d2.second;
@ -478,7 +479,7 @@ void MARKERS_MANAGER::FindNextSimilar()
for (t = totalSourceKeywords - 1; t >= 0; t--)
if (maxFound < keywordFound[t])
maxFound = keywordFound[t];
// and then calculate weight of each keyword: the more often it appears in markers, the less weight it has
// and then calculate weight of each keyword: the more often it appears in Markers, the less weight it has
std::vector<double> keywordWeight(totalSourceKeywords);
for (t = totalSourceKeywords - 1; t >= 0; t--)
keywordWeight[t] = KEYWORD_WEIGHT_BASE + KEYWORD_WEIGHT_FACTOR * (keywordFound[t] / (double)maxFound);
@ -589,7 +590,7 @@ void MARKERS_MANAGER::FindNextSimilar()
}
*/
// Send selection to the marker found
// Send Selection to the Marker found
int index = notePriority.size()-1 - search_similar_marker;
if (index >= 0 && notePriority[index].second >= MIN_PRIORITY_TRESHOLD)
{
@ -624,9 +625,9 @@ void MARKERS_MANAGER::UpdateMarkerNote()
if (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
// zeroth Marker - just assume it's set on frame 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)
// notify Selection to change text in the lower Marker (in case both are showing same Marker)
selection.must_find_current_marker = true;
}
} else if (marker_note_edit == MARKER_NOTE_EDIT_LOWER)
@ -640,9 +641,9 @@ void MARKERS_MANAGER::UpdateMarkerNote()
if (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
// zeroth Marker - just assume it's set on frame 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)
// notify Playback to change text in upper Marker (in case both are showing same Marker)
playback.must_find_current_marker = true;
}
}
@ -715,7 +716,7 @@ BOOL CALLBACK FindNoteProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lPa
{
int len = SendMessage(GetDlgItem(hwndDlg, IDC_NOTE_TO_FIND), WM_GETTEXT, MAX_NOTE_LEN, (LPARAM)markers_manager.findnote_string);
markers_manager.findnote_string[len] = 0;
// scan frames from current selection to the border
// scan frames from current Selection to the border
int cur_marker = 0;
bool result;
int movie_size = currMovieData.getNumRecords();

View File

@ -11,13 +11,13 @@ Piano Roll - Piano Roll interface
[Singleton]
* implements the working of Piano Roll List: creating, redrawing, scrolling, mouseover, clicks, drag
* regularly updates the size of the List according to current movie input
* regularly updates the size of the List according to current movie Input
* on demand: scrolls visible area of the List to any given item: to Playback Cursor, to Selection Cursor, to "undo pointer", to a Marker
* saves and loads current position of vertical scrolling from a project file. On error: scrolls the List to the beginning
* implements the working of Piano Roll List Header: creating, redrawing, animating, mouseover, clicks
* regularly updates lights in the Header according to button presses data from Recorder and Alt key state
* on demand: launches flashes in the Header
* implements the working of mouse wheel: List scrolling, Playback cursor movement, Selection cursor movement, scrolling across gaps in Input/markers
* implements the working of mouse wheel: List scrolling, Playback cursor movement, Selection cursor movement, scrolling across gaps in Input/Markers
* implements context menu on Right-click
* stores resources: save id, ids of columns, widths of columns, tables of colors, gradient of Hot Changes, gradient of Header flashings, timings of flashes, all fonts used in TAS Editor, images
------------------------------------------------------------------------------------ */
@ -540,7 +540,7 @@ void PIANO_ROLL::update()
{
case DRAG_MODE_PLAYBACK:
{
if (!playback.pause_frame || can_drag_when_seeking)
if (!playback.GetPauseFrame() || can_drag_when_seeking)
{
DragPlaybackCursor();
// after first seeking is finished (if there was any seeking), it now becomes possible to drag when seeking
@ -683,7 +683,7 @@ void PIANO_ROLL::update()
new_drag_selection_ending_frame = currMovieData.getNumRecords() - 1;
if (new_drag_selection_ending_frame >= 0 && new_drag_selection_ending_frame != drag_selection_ending_frame)
{
// change selection shape
// change Selection shape
if (new_drag_selection_ending_frame >= drag_selection_starting_frame)
{
// selecting from upper to lower
@ -788,7 +788,7 @@ void PIANO_ROLL::update()
changes_made = true;
}
header_colors[COLUMN_FRAMENUM2] = header_colors[COLUMN_FRAMENUM];
// 2 - update input columns' heads
// 2 - update Input columns' heads
int i = num_columns-1;
if (i == COLUMN_FRAMENUM2) i--;
for (; i >= COLUMN_JOYPAD1_A; i--)
@ -963,8 +963,8 @@ void PIANO_ROLL::FollowSelection()
}
void PIANO_ROLL::FollowPauseframe()
{
if (playback.pause_frame > 0)
CenterListAt(playback.pause_frame - 1);
if (playback.GetPauseFrame() > 0)
CenterListAt(playback.GetPauseFrame() - 1);
}
void PIANO_ROLL::FollowMarker(int marker_id)
{
@ -1344,7 +1344,7 @@ LONG PIANO_ROLL::CustomDraw(NMLVCUSTOMDRAW* msg)
} else if ((cell_x - COLUMN_JOYPAD1_A) / NUM_JOYPAD_BUTTONS == 0 || (cell_x - COLUMN_JOYPAD1_A) / NUM_JOYPAD_BUTTONS == 2)
{
// pad 1 or 3
// font: empty cells have "SelectFont", non-empty have normal font
// font: empty cells have "SelectFont" (so that "-" is wide), non-empty have normal font
int joy = (cell_x - COLUMN_JOYPAD1_A) / NUM_JOYPAD_BUTTONS;
int bit = (cell_x - COLUMN_JOYPAD1_A) % NUM_JOYPAD_BUTTONS;
if ((int)currMovieData.records.size() <= cell_y ||
@ -1488,7 +1488,7 @@ void PIANO_ROLL::RightClick(LVHITTESTINFO& info)
SelectionFrames* current_selection = selection.MakeStrobe();
HMENU sub = GetSubMenu(hrmenu, 0);
SetMenuDefaultItem(sub, ID_SELECTED_SETMARKERS, false);
// inspect current selection and disable inappropriate menu items
// inspect current Selection and disable inappropriate menu items
SelectionFrames::iterator current_selection_begin(current_selection->begin());
SelectionFrames::iterator current_selection_end(current_selection->end());
bool set_found = false, unset_found = false;
@ -1756,7 +1756,7 @@ LRESULT APIENTRY ListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
}
} else if (alt_pressed)
{
// make selection by Pattern
// make Selection by Pattern
int selection_beginning = selection.GetCurrentSelectionBeginning();
if (selection_beginning >= 0)
{
@ -1791,7 +1791,7 @@ LRESULT APIENTRY ListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
selection.ClearSelection();
selection.SetRowSelection(row_index);
}
// toggle input
// toggle Input
piano_roll.drawing_start_time = clock();
int joy = (column_index - COLUMN_JOYPAD1_A) / NUM_JOYPAD_BUTTONS;
int button = (column_index - COLUMN_JOYPAD1_A) % NUM_JOYPAD_BUTTONS;
@ -1868,7 +1868,7 @@ LRESULT APIENTRY ListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
return SendMessage(history.hwndHistoryList, WM_MOUSEWHEEL_RESENT, wParam, lParam);
} else if (alt_pressed)
{
// cross gaps in input/Markers
// cross gaps in Input/Markers
piano_roll.CrossGaps(zDelta);
} else
{

View File

@ -99,6 +99,7 @@ enum DRAG_MODES
// listview colors
#define NORMAL_TEXT_COLOR 0x0
#define NORMAL_BACKGROUND_COLOR 0xFFFFFF
#define NORMAL_FRAMENUM_COLOR 0xFFFFFF
#define NORMAL_INPUT_COLOR1 0xEDEDED

View File

@ -21,6 +21,7 @@ Playback - Player of emulation states
------------------------------------------------------------------------------------ */
#include "taseditor_project.h"
#include "../taseditor.h"
#ifdef _S9XLUA_H
extern void ForceExecuteLuaFrameFunctions();
@ -194,7 +195,7 @@ void PLAYBACK::update()
}
}
// update the playback cursor
// update the Playback cursor
if (currFrameCounter != lastCursor)
{
// update gfx of the old and new rows
@ -226,6 +227,7 @@ void PLAYBACK::update()
must_find_current_marker = false;
}
// This logic is very important for adequate "green arrow" and "Restore position"
if (emu_paused)
// when paused, pause_frame becomes unfixed
pause_frame_must_be_fixed = false;
@ -260,12 +262,10 @@ void PLAYBACK::ToggleEmulationPause()
void PLAYBACK::PauseEmulation()
{
FCEUI_SetEmulationPaused(1);
// make some additional stuff
}
void PLAYBACK::UnpauseEmulation()
{
FCEUI_SetEmulationPaused(0);
// make some additional stuff
}
void PLAYBACK::RestorePosition()
{
@ -364,7 +364,7 @@ void PLAYBACK::ForwardFrame()
void PLAYBACK::RewindFull(int speed)
{
int index = currFrameCounter - 1;
// jump trough "speed" amount of previous markers
// jump trough "speed" amount of previous Markers
while (speed > 0)
{
for (; index >= 0; index--)
@ -387,7 +387,7 @@ void PLAYBACK::ForwardFull(int speed)
{
int last_frame = markers_manager.GetMarkersSize() - 1; // the end of movie Markers
int index = currFrameCounter + 1;
// jump trough "speed" amount of next markers
// jump trough "speed" amount of next Markers
while (speed > 0)
{
for (; index <= last_frame; ++index)
@ -409,7 +409,7 @@ void PLAYBACK::ForwardFull(int speed)
void PLAYBACK::RedrawMarker()
{
// redraw marker num
// redraw Marker num
char new_text[MAX_NOTE_LEN] = {0};
if (shown_marker <= 9999) // if there's too many digits in the number then don't show the word "Marker" before the number
strcpy(new_text, upperMarkerText);
@ -418,10 +418,10 @@ void PLAYBACK::RedrawMarker()
strcat(new_text, num);
strcat(new_text, " ");
SetWindowText(hwndPlaybackMarker, new_text);
// change marker note
// change Marker Note
strcpy(new_text, markers_manager.GetNote(shown_marker).c_str());
SetWindowText(hwndPlaybackMarkerEdit, new_text);
// reset search_similar_marker, because source marker changed
// reset search_similar_marker, because source Marker changed
markers_manager.search_similar_marker = 0;
}
@ -447,13 +447,13 @@ void PLAYBACK::jump(int frame, bool execute_lua, bool follow_cursor)
piano_roll.FollowPlaybackIfNeeded();
}
}
// returns true if a jump to the frame is made, false if started seeking outside greenzone or if nothing's done
// internal interface
// returns true if a jump to the frame is made, false if started seeking outside Greenzone or if nothing's done
bool PLAYBACK::JumpToFrame(int index)
{
if (index >= greenzone.GetSize())
{
// make jump outside greenzone
// make jump outside Greenzone
if (currFrameCounter == greenzone.GetSize() - 1 || JumpToFrame(greenzone.GetSize() - 1))
// seek there from the end of greenzone
SeekingStart(index+1);
@ -463,7 +463,7 @@ bool PLAYBACK::JumpToFrame(int index)
if (greenzone.loadTasSavestate(index))
{
// successfully restored emulator state at this frame
// if playback was seeking, pause emulation right here
// if Playback was seeking, pause emulation right here
if (pause_frame)
SeekingStop();
return true;
@ -495,6 +495,10 @@ int PLAYBACK::GetLostPosition()
return lost_position_frame - 1;
}
int PLAYBACK::GetPauseFrame()
{
return pause_frame;
}
int PLAYBACK::GetFlashingPauseFrame()
{
if (show_pauseframe)
@ -502,6 +506,13 @@ int PLAYBACK::GetFlashingPauseFrame()
else
return 0;
}
int PLAYBACK::GetFixedPauseFrame()
{
if (pause_frame_must_be_fixed)
return pause_frame;
else
return 0;
}
void PLAYBACK::SetProgressbar(int a, int b)
{
@ -525,7 +536,7 @@ LRESULT APIENTRY UpperMarkerEditWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR
// enable editing
SendMessage(playback.hwndPlaybackMarkerEdit, EM_SETREADONLY, false, 0);
// disable FCEUX keyboard
taseditor_window.ClearTaseditorInput();
ClearTaseditorInput();
// scroll to the Marker
if (taseditor_config.follow_note_context)
piano_roll.FollowMarker(playback.shown_marker);
@ -543,7 +554,7 @@ LRESULT APIENTRY UpperMarkerEditWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR
SendMessage(playback.hwndPlaybackMarkerEdit, EM_SETREADONLY, true, 0);
// enable FCEUX keyboard
if (taseditor_window.TASEditor_focus)
taseditor_window.SetTaseditorInput();
SetTaseditorInput();
break;
}
case WM_CHAR:

View File

@ -42,12 +42,13 @@ public:
void SetLostPosition(int frame);
int GetLostPosition(); // actually returns lost_position_frame-1
int GetPauseFrame();
int GetFlashingPauseFrame();
int GetFixedPauseFrame();
void SetProgressbar(int a, int b);
void CancelSeeking();
int pause_frame;
bool pause_frame_must_be_fixed; // for "Auto-restore last position"
bool must_find_current_marker;
int shown_marker;
@ -57,13 +58,17 @@ public:
private:
bool JumpToFrame(int index);
int pause_frame;
bool pause_frame_must_be_fixed; // for "Auto-restore last position"
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 autopause_at_the_end;
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;

View File

@ -244,7 +244,7 @@ void POPUP_DISPLAY::RedrawScreenshotBitmap()
}
void POPUP_DISPLAY::ChangeDescrText()
{
// retrieve info from the pointed bookmark's markers
// retrieve info from the pointed bookmark's Markers
int frame = bookmarks.bookmarks_array[bookmarks.item_under_mouse].snapshot.jump_frame;
int marker_id = markers_manager.GetMarkerUp(bookmarks.bookmarks_array[bookmarks.item_under_mouse].snapshot.GetMarkers(), frame);
char new_text[MAX_NOTE_LEN];

View File

@ -7,12 +7,12 @@ 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.
------------------------------------------------------------------------------------
Recorder - Tool for input recording
Recorder - Tool for Input recording
[Singleton]
* at the moment of recording movie input (at the beginning of a frame) by emulator's call the Recorder intercepts input data and applies its filters (multitracking/etc), then reflects input changes into History and Greenzone
* at the moment of recording movie Input (at the beginning of a frame) by emulator's call the Recorder intercepts Input data and applies its filters (multitracking/etc), then reflects Input changes into History and Greenzone
* regularly tracks virtual joypad buttonpresses and provides data for Piano Roll List Header lights. Also reacts on external changes of Recording status, and updates GUI (Recorder panel and Bookmarks/Branches caption)
* implements input editing in Read-only mode (ColumnSet by pressing buttons on virtual joypad)
* implements Input editing in Read-only mode (ColumnSet by pressing buttons on virtual joypad)
* stores resources: ids and names of multitracking modes, suffixes for TAS Editor window caption
------------------------------------------------------------------------------------ */
@ -238,7 +238,7 @@ void RECORDER::InputChanged()
{
bool changes_made = false;
int num_joys = joysticks_per_frame[GetInputType(currMovieData)];
// take previous values from current snapshot, new input from current movie
// take previous values from current snapshot, new Input from current movie
for (int i = 0; i < num_joys; ++i)
{
old_joy[i] = history.GetCurrentSnapshot().GetJoystickInfo(currFrameCounter, i);

View File

@ -13,16 +13,17 @@ Selection - Manager of selections
* contains definition of the type "Set of selected frames"
* stores array of Sets of selected frames (History of selections)
* saves and loads the data from a project file. On error: clears the array and starts new history by making empty selection
* constantly tracks changes in selected rows of Piano Roll List, and makes a decision to create new point of selection rollback
* implements all selection restoring operations: undo, redo
* constantly tracks changes in selected rows of Piano Roll List, and makes a decision to create new point of Selection rollback
* implements all Selection restoring operations: undo, redo
* on demand: changes current selection: remove selection, jump to a frame with Selection cursor, select region, select all, select between Markers, reselect clipboard
* regularly ensures that selection doesn't go beyond curent Piano Roll limits, detects if selection moved to another Marker and updates Note in the lower text field
* regularly ensures that Selection doesn't go beyond curent Piano Roll limits, detects if Selection moved to another Marker and updates Note in the lower text field
* implements the working of lower buttons << and >> (jumping on Markers)
* also here's the code of lower text field (for editing Marker Notes)
* stores resource: save id, lower text field prefix
------------------------------------------------------------------------------------ */
#include "taseditor_project.h"
#include "../taseditor.h"
extern TASEDITOR_CONFIG taseditor_config;
extern TASEDITOR_WINDOW taseditor_window;
@ -120,7 +121,7 @@ void SELECTION::update()
}
}
// track changes of selection beginning
// track changes of Selection beginning (Selection cursor)
if (last_selection_beginning != GetCurrentSelectionBeginning())
{
last_selection_beginning = GetCurrentSelectionBeginning();
@ -140,7 +141,7 @@ void SELECTION::update()
void SELECTION::UpdateSelectionSize()
{
// keep selection within Piano Roll limits
// keep Selection within Piano Roll limits
if (CurrentSelection().size())
{
int delete_index;
@ -187,7 +188,7 @@ void SELECTION::HistorySizeChanged()
void SELECTION::RedrawMarker()
{
// redraw marker num
// redraw Marker num
char new_text[MAX_NOTE_LEN] = {0};
if (shown_marker <= 9999) // if there's too many digits in the number then don't show the word "Marker" before the number
strcpy(new_text, lowerMarkerText);
@ -196,7 +197,7 @@ void SELECTION::RedrawMarker()
strcat(new_text, num);
strcat(new_text, " ");
SetWindowText(hwndSelectionMarker, new_text);
// change marker note
// change Marker Note
strcpy(new_text, markers_manager.GetNote(shown_marker).c_str());
SetWindowText(hwndSelectionMarkerEdit, new_text);
}
@ -206,7 +207,7 @@ void SELECTION::JumpPrevMarker(int speed)
// if nothing is selected, consider Playback cursor as current selection
int index = GetCurrentSelectionBeginning();
if (index < 0) index = currFrameCounter;
// jump trough "speed" amount of previous markers
// jump trough "speed" amount of previous Markers
while (speed > 0)
{
for (index--; index >= 0; index--)
@ -224,7 +225,7 @@ void SELECTION::JumpNextMarker(int speed)
int index = GetCurrentSelectionBeginning();
if (index < 0) index = currFrameCounter;
int last_frame = currMovieData.getNumRecords() - 1; // the end of Piano Roll
// jump trough "speed" amount of previous markers
// jump trough "speed" amount of previous Markers
while (speed > 0)
{
for (++index; index <= last_frame; ++index)
@ -279,7 +280,7 @@ bool SELECTION::load(EMUFILE *is, bool really_load)
if (!strcmp(selection_skipsave_id, save_id))
{
// string says to skip loading Selection
FCEU_printf("No selection in the file\n");
FCEU_printf("No Selection in the file\n");
reset();
return false;
}
@ -327,7 +328,7 @@ bool SELECTION::load(EMUFILE *is, bool really_load)
reset_vars();
return false;
error:
FCEU_printf("Error loading selection\n");
FCEU_printf("Error loading Selection\n");
reset();
return true;
}
@ -388,7 +389,7 @@ void SELECTION::ItemChanged(NMLISTVIEW* info)
{
if (OFF)
{
// clear all (actually add new empty selection to history)
// clear all (actually add new empty Selection to history)
if (CurrentSelection().size() && track_selection_changes)
AddNewSelectionToHistory();
} else if (ON)
@ -439,7 +440,7 @@ void SELECTION::JumpInTime(int new_pos)
history_cursor_pos = new_pos;
// update Piano Roll items
EnforceSelectionToList();
// also keep selection within Piano Roll
// also keep Selection within Piano Roll
UpdateSelectionSize();
}
void SELECTION::undo()
@ -517,7 +518,7 @@ void SELECTION::SelectBetweenMarkers()
lower_border = *CurrentSelection().rbegin();
} else lower_border = upper_border = center = currFrameCounter;
// find markers
// find Markers
// searching up starting from center-0
for (upper_marker = center; upper_marker >= 0; upper_marker--)
if (markers_manager.GetMarker(upper_marker)) break;
@ -537,7 +538,7 @@ void SELECTION::SelectBetweenMarkers()
// selecting circle: 1-2-3-4-1-2-3-4...
if (upper_border > upper_marker+1 || lower_border < lower_marker-1 || lower_border > lower_marker)
{
// 1 - default: select all between markers, not including lower marker
// 1 - default: select all between Markers, not including lower Marker
if (upper_marker < 0) upper_marker = 0;
for (int i = upper_marker; i < lower_marker; ++i)
{
@ -545,14 +546,14 @@ void SELECTION::SelectBetweenMarkers()
}
} else if (upper_border == upper_marker && lower_border == lower_marker-1)
{
// 2 - selected all between markers and upper marker selected too: select all between markers, not including markers
// 2 - selected all between Markers and upper Marker selected too: select all between Markers, not including Markers
for (int i = upper_marker+1; i < lower_marker; ++i)
{
ListView_SetItemState(piano_roll.hwndList, i, LVIS_SELECTED, LVIS_SELECTED);
}
} else if (upper_border == upper_marker+1 && lower_border == lower_marker-1)
{
// 3 - selected all between markers, nut including markers: select all between markers, not including upper marker
// 3 - selected all between Markers, nut including Markers: select all between Markers, not including upper Marker
if (lower_marker >= movie_size) lower_marker = movie_size - 1;
for (int i = upper_marker+1; i <= lower_marker; ++i)
{
@ -560,7 +561,7 @@ void SELECTION::SelectBetweenMarkers()
}
} else if (upper_border == upper_marker+1 && lower_border == lower_marker)
{
// 4 - selected all between markers and lower marker selected too: select all bertween markers, including markers
// 4 - selected all between Markers and lower Marker selected too: select all bertween Markers, including Markers
if (upper_marker < 0) upper_marker = 0;
if (lower_marker >= movie_size) lower_marker = movie_size - 1;
for (int i = upper_marker; i <= lower_marker; ++i)
@ -585,7 +586,7 @@ void SELECTION::ReselectClipboard()
ClearSelection();
CurrentSelection() = clipboard_selection;
EnforceSelectionToList();
// also keep selection within Piano Roll
// also keep Selection within Piano Roll
UpdateSelectionSize();
}
@ -658,7 +659,7 @@ bool SELECTION::CheckFrameSelected(int frame)
}
SelectionFrames* SELECTION::MakeStrobe()
{
// copy current selection to temp_selection
// copy current Selection to temp_selection
temp_selection = selections_history[(history_start_pos + history_cursor_pos) % history_size];
return &temp_selection;
}
@ -685,7 +686,7 @@ LRESULT APIENTRY LowerMarkerEditWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR
// enable editing
SendMessage(selection.hwndSelectionMarkerEdit, EM_SETREADONLY, false, 0);
// disable FCEUX keyboard
taseditor_window.ClearTaseditorInput();
ClearTaseditorInput();
// scroll to the Marker
if (taseditor_config.follow_note_context)
piano_roll.FollowMarker(selection.shown_marker);
@ -702,7 +703,7 @@ LRESULT APIENTRY LowerMarkerEditWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR
SendMessage(selection.hwndSelectionMarkerEdit, EM_SETREADONLY, true, 0);
// enable FCEUX keyboard
if (taseditor_window.TASEditor_focus)
taseditor_window.SetTaseditorInput();
SetTaseditorInput();
break;
}
case WM_CHAR:

View File

@ -9,16 +9,16 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
------------------------------------------------------------------------------------
Snapshot - Snapshot of all edited data
* stores the data of specific snapshot of the movie: size, input data (commands and joysticks), Markers at the moment of creating the snapshot, keyframe, start and end frame of operation, type of operation and description of the snapshot (including the time of creation)
* also stores info about sequential recording/drawing of input
* stores the data of specific snapshot of the movie: size, Input data (commands and joysticks), Markers at the moment of creating the snapshot, keyframe, start and end frame of operation, type of operation and description of the snapshot (including the time of creation)
* also stores info about sequential recording/drawing of Input
* optionally can store map of Hot Changes
* implements snapshot creation: copying input, copying Hot Changes, copying Markers, setting time of creation
* implements full/partial restoring of data from snapshot: input, Hot Changes, Markers
* implements snapshot creation: copying Input, copying Hot Changes, copying Markers, setting time of creation
* implements full/partial restoring of data from snapshot: Input, Hot Changes, Markers
* implements compression and decompression of stored data
* saves and loads the data from a project file. On error: sends warning to caller
* implements searching of first mismatch comparing two snapshots ot comparing snapshot to a movie
* provides interface for reading certain data: reading input of any certain frame, reading value at any point of Hot Changes map
* implements all operations with Hot Changes maps: copying (full/partial), updating/fading, setting new hot places by comparing input of two snapshots
* provides interface for reading certain data: reading Input of any certain frame, reading value at any point of Hot Changes map
* implements all operations with Hot Changes maps: copying (full/partial), updating/fading, setting new hot places by comparing Input of two snapshots
------------------------------------------------------------------------------------ */
#include "taseditor_project.h"
@ -42,14 +42,14 @@ void SNAPSHOT::init(MovieData& md, bool hotchanges, int force_input_type)
input_type = GetInputType(md);
else
input_type = force_input_type;
// retrieve input data from movie data
// retrieve Input data from movie data
size = md.getNumRecords();
joysticks.resize(BYTES_PER_JOYSTICK * joysticks_per_frame[input_type] * size); // it's much faster to have this format than have [frame][joy] or other structures
commands.resize(size); // commands take 1 byte per frame
if (has_hot_changes)
hot_changes.resize(joysticks_per_frame[input_type] * size * HOTCHANGE_BYTES_PER_JOY);
// fill input vector
// fill Input vector
int pos = 0;
switch(input_type)
{
@ -115,7 +115,7 @@ MARKERS& SNAPSHOT::GetMarkers()
void SNAPSHOT::toMovie(MovieData& md, int start, int end)
{
if (end < 0 || end >= size) end = size - 1;
// write input data to movie data
// write Input data to movie data
md.records.resize(end + 1);
switch(input_type)
{
@ -221,7 +221,7 @@ void SNAPSHOT::save(EMUFILE *os)
write32le(hot_changes_compressed.size(), os);
os->fwrite(&hot_changes_compressed[0], hot_changes_compressed.size());
}
// save markers data
// save Markers data
my_markers.save(os);
}
// returns true if couldn't load
@ -282,7 +282,7 @@ bool SNAPSHOT::load(EMUFILE *is)
e = uncompress(&hot_changes[0], &destlen, &hot_changes_compressed[0], comprlen);
if (e != Z_OK && e != Z_BUF_ERROR) return true;
}
// load markers data
// load Markers data
if (my_markers.load(is)) return true;
return false;
}
@ -317,7 +317,7 @@ bool SNAPSHOT::skipLoad(EMUFILE *is)
if (!read32le(&tmp, is)) return true;
if (is->fseek(tmp, SEEK_CUR) != 0) return true;
}
// read markers data
// read Markers data
if (my_markers.skipLoad(is)) return true;
return false;
}
@ -676,7 +676,7 @@ void SNAPSHOT::inheritHotChanges_InsertSelection(SNAPSHOT* source_of_hotchanges)
region_len++;
// set filled line to the frame
memset(&hot_changes[pos], 0xFF, bytes);
// exit loop when all selection frames are handled
// exit loop when all frames in the Selection are handled
if (it == current_selection_end) break;
} else
{

View File

@ -63,7 +63,7 @@ public:
// saved data
int size; // in frames
int input_type; // theoretically TAS Editor can support any other input types
int input_type; // theoretically TAS Editor can support any other Input types
int jump_frame; // for jumping when making undo
int start_frame; // for consecutive Draws
int end_frame; // for consecutive Draws

View File

@ -10,9 +10,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
Splicer - Tool for montage
[Singleton]
* implements operations of mass-changing input: copy/paste, cloning, clearing region, insertion and deletion of frames, truncating
* stores data about the selection used in last "Copy to Clipboard" operation
* regularly checks the state of current selection and displays info on GUI, also displays info about input in Clipboard
* implements operations of mass-changing Input: copy/paste, cloning, clearing region, insertion and deletion of frames, truncating
* stores data about the Selection used in last "Copy to Clipboard" operation
* regularly checks the state of current Selection and displays info on GUI, also displays info about Input in Clipboard
* when launching TAS Editor, it checks Clipboard contents
* stores resources: mnemonics of buttons, texts for selection/clipboard info on GUI
------------------------------------------------------------------------------------ */
@ -64,7 +64,7 @@ void SPLICER::reset()
}
void SPLICER::update()
{
// redraw selection info text of needed
// redraw Selection info text of needed
if (must_redraw_selection_text)
{
int size = selection.GetCurrentSelectionSize();
@ -109,10 +109,10 @@ void SPLICER::CloneFrames()
int frames = current_selection->size();
if (!frames) return;
selection.ClearSelection(); // selection will be moved down, so that same frames are selected
selection.ClearSelection(); // Selection will be moved down, so that same frames are selected
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
SelectionFrames::reverse_iterator next_it;
SelectionFrames::reverse_iterator current_selection_rend = current_selection->rend();
int shift = frames;
@ -127,7 +127,7 @@ void SPLICER::CloneFrames()
currMovieData.cloneRegion(*it, frames);
if (taseditor_config.bind_markers)
{
// markers are not cloned
// Markers are not cloned
if (markers_manager.insertEmpty(*it,frames))
markers_changed = true;
}
@ -157,10 +157,10 @@ void SPLICER::InsertFrames()
int frames = current_selection->size();
if (!frames) return;
selection.ClearSelection(); // selection will be moved down, so that same frames are selected
selection.ClearSelection(); // Selection will be moved down, so that same frames are selected
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
SelectionFrames::reverse_iterator next_it;
SelectionFrames::reverse_iterator current_selection_rend = current_selection->rend();
int shift = frames;
@ -214,7 +214,7 @@ void SPLICER::InsertNumFrames()
index = *current_selection->begin();
} else
{
// insert at playback cursor
// insert at Playback cursor
index = currFrameCounter;
}
currMovieData.insertEmpty(index, frames);
@ -225,7 +225,7 @@ void SPLICER::InsertNumFrames()
}
if (current_selection->size())
{
// shift selection down, so that same frames are selected
// shift Selection down, so that same frames are selected
piano_roll.UpdateItemCount();
selection.ClearSelection();
SelectionFrames::iterator current_selection_end = current_selection->end();
@ -298,7 +298,7 @@ void SPLICER::ClearFrames(SelectionFrames* current_selection)
if (current_selection->size() == 0) return;
}
//clear input on each selected frame
// clear Input on each selected frame
SelectionFrames::iterator current_selection_end(current_selection->end());
for(SelectionFrames::iterator it(current_selection->begin()); it != current_selection_end; it++)
{
@ -411,7 +411,7 @@ bool SPLICER::Copy(SelectionFrames* current_selection)
return false;
}
// copied successfully
// memorize currently strobed selection data to clipboard_selection
// memorize currently strobed Selection data to clipboard_selection
clipboard_selection = *current_selection;
RedrawTextClipboard();
return true;
@ -482,7 +482,7 @@ bool SPLICER::Paste()
currMovieData.records[pos].joysticks[2] = 0;
currMovieData.records[pos].joysticks[3] = 0;
}
// read this frame input
// read this frame Input
joy = 0;
new_buttons = 0;
while (*frame && *frame != '\n' && *frame !='\r')
@ -570,9 +570,9 @@ bool SPLICER::PasteInsert()
// TAS recording info starts with "TAS "
if (pGlobal[0]=='T' && pGlobal[1]=='A' && pGlobal[2]=='S')
{
// make sure markers have the same size as movie
// make sure Markers have the same size as movie
markers_manager.update();
// create inserted_set (for input history hot changes)
// create inserted_set (for Input history hot changes)
SelectionFrames inserted_set;
// Extract number of frames
@ -613,7 +613,7 @@ bool SPLICER::PasteInsert()
}
inserted_set.insert(pos);
// read this frame input
// read this frame Input
int joy = 0;
while (*frame && *frame != '\n' && *frame !='\r')
{
@ -676,7 +676,7 @@ void SPLICER::CheckClipboard()
{
if (OpenClipboard(taseditor_window.hwndTasEditor))
{
// check if clipboard contains TAS Editor input data
// check if clipboard contains TAS Editor Input data
HANDLE hGlobal = GetClipboardData(CF_TEXT);
if (hGlobal)
{
@ -704,7 +704,7 @@ void SPLICER::CheckClipboard()
} else
current_pos++;
clipboard_selection.insert(current_pos);
// skip input
// skip Input
pGlobal = strchr(pGlobal, '\n');
}
}

View File

@ -11,9 +11,9 @@ Lua - Manager of Lua features
[Singleton]
* implements logic of all functions of "taseditor" Lua library
* stores the list of pending input changes
* stores the list of pending Input changes
* on demend: (from FCEUX Lua engine) updates GUI items on "Lua" panel of TAS Editor window
* stores resources: ids of joypads for input changes, max length of a name for applychanges()
* stores resources: ids of joypads for Input changes, max length of a name for applychanges()
------------------------------------------------------------------------------------ */
#include "taseditor_project.h"
@ -130,7 +130,7 @@ int TASEDITOR_LUA::setmarker(int frame)
marker_id = markers_manager.SetMarker(frame);
if (marker_id)
{
// new marker was created - register changes in TAS Editor
// new Marker was created - register changes in TAS Editor
history.RegisterMarkersChange(MODTYPE_LUA_MARKER_SET, frame);
selection.must_find_current_marker = playback.must_find_current_marker = true;
piano_roll.RedrawRow(frame);
@ -150,7 +150,7 @@ void TASEDITOR_LUA::removemarker(int frame)
if (markers_manager.GetMarker(frame))
{
markers_manager.ClearMarker(frame);
// marker was deleted - register changes in TAS Editor
// Marker was deleted - register changes in TAS Editor
history.RegisterMarkersChange(MODTYPE_LUA_MARKER_REMOVE, frame);
selection.must_find_current_marker = playback.must_find_current_marker = true;
piano_roll.RedrawRow(frame);
@ -227,7 +227,7 @@ int TASEDITOR_LUA::getlostplayback()
int TASEDITOR_LUA::getplaybacktarget()
{
if (FCEUMOV_Mode(MOVIEMODE_TASEDITOR))
return playback.pause_frame - 1;
return playback.GetPauseFrame() - 1;
else
return -1;
}

View File

@ -26,8 +26,6 @@ Window - User Interface
#include "../taseditor.h"
#include <htmlhelp.h>
#include "../../input.h" // for EMUCMD
#include "../keyboard.h"
#include "../joystick.h"
//compile for windows 2000 target
#if (_WIN32_WINNT < 0x501)
@ -149,7 +147,7 @@ Window_items_struct window_items[TASEDITOR_WINDOW_TOTAL_ITEMS] = {
TASEDITOR_FORWARD_FULL, -1, 0, 0, 0, "Send Playback to next Marker (mouse: Shift+Wheel down) (hotkey: Shift+PageDown)", "", false, 0, 0,
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", "", false, EMUCMD_TASEDITOR_SWITCH_AUTORESTORING, 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", "", false, EMUCMD_TASEDITOR_SWITCH_AUTORESTORING, 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,
@ -158,8 +156,8 @@ Window_items_struct window_items[TASEDITOR_WINDOW_TOTAL_ITEMS] = {
IDC_RADIO_2P, -1, 0, 0, 0, "Select Joypad 2 as current", "", false, EMUCMD_TASEDITOR_SWITCH_MULTITRACKING, 0,
IDC_RADIO_3P, -1, 0, 0, 0, "Select Joypad 3 as current", "", false, EMUCMD_TASEDITOR_SWITCH_MULTITRACKING, 0,
IDC_RADIO_4P, -1, 0, 0, 0, "Select Joypad 4 as current", "", false, EMUCMD_TASEDITOR_SWITCH_MULTITRACKING, 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,
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 (mouse: Ctrl+Wheel up) (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,
@ -173,7 +171,7 @@ Window_items_struct window_items[TASEDITOR_WINDOW_TOTAL_ITEMS] = {
IDC_TEXT_SELECTION, -1, 0, 0, 0, "Current size of Selection", "", false, 0, 0,
IDC_TEXT_CLIPBOARD, -1, 0, 0, 0, "Current size of Input in the Clipboard", "", false, 0, 0,
IDC_RECORDING, -1, 0, 0, 0, "Switch Input Recording on/off", "", false, EMUCMD_MOVIE_READONLY_TOGGLE, 0,
TASEDITOR_RUN_MANUAL, -1, 0, 0, 0, "Press the button to execute Lua Manual Function", "", false, 0, 0,
TASEDITOR_RUN_MANUAL, -1, 0, 0, 0, "Press the button to execute Lua Manual Function", "", false, EMUCMD_TASEDITOR_RUN_MANUAL_LUA, 0,
IDC_RUN_AUTO, -1, 0, 0, 0, "Enable Lua Auto Function (but first it must be registered by Lua script)", "", false, 0, 0,
};
@ -294,7 +292,6 @@ void TASEDITOR_WINDOW::init()
recent_projects_menu = CreateMenu();
UpdateRecentProjectsMenu();
SetTaseditorInput();
reset();
}
void TASEDITOR_WINDOW::exit()
@ -323,7 +320,6 @@ void TASEDITOR_WINDOW::exit()
DestroyIcon(hTaseditorIcon);
hTaseditorIcon = 0;
}
ClearTaseditorInput();
}
void TASEDITOR_WINDOW::reset()
{
@ -367,7 +363,7 @@ void TASEDITOR_WINDOW::update()
case DRAG_MODE_PLAYBACK:
{
// user is dragging Playback cursor - show either normal arrow or arrow+wait
if (playback.pause_frame)
if (playback.GetPauseFrame())
cursor_icon = IDC_APPSTARTING;
break;
}
@ -587,19 +583,6 @@ void TASEDITOR_WINDOW::UpdateCheckedItems()
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()
{
@ -864,11 +847,11 @@ BOOL CALLBACK WndprocTasEditor(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
if (LOWORD(wParam))
{
taseditor_window.TASEditor_focus = true;
taseditor_window.SetTaseditorInput();
SetTaseditorInput();
} else
{
taseditor_window.TASEditor_focus = false;
taseditor_window.ClearTaseditorInput();
ClearTaseditorInput();
}
break;
case WM_CTLCOLORSTATIC:
@ -1028,7 +1011,7 @@ BOOL CALLBACK WndprocTasEditor(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
taseditor_config.turbo_seek ^= 1;
taseditor_window.UpdateCheckedItems();
// if currently seeking, apply this option immediately
if (playback.pause_frame)
if (playback.GetPauseFrame())
turbo = taseditor_config.turbo_seek;
break;
case ID_VIEW_SHOWBRANCHSCREENSHOTS:
@ -1295,7 +1278,7 @@ BOOL CALLBACK WndprocTasEditor(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
taseditor_config.enable_auto_function ^= 1;
taseditor_window.UpdateCheckedItems();
break;
case ID_HELP_TASEDITHELP:
case ID_HELP_OPEN_MANUAL:
{
std::string helpFileName = BaseDirectory;
helpFileName.append(taseditor_help_filename);

View File

@ -51,9 +51,6 @@ public:
void UpdatePatternsMenu();
void RecheckPatternsMenu();
void SetTaseditorInput();
void ClearTaseditorInput();
HWND hwndTasEditor, hwndFindNote;
bool TASEditor_focus;
bool ready_for_resizing;

View File

@ -1240,7 +1240,7 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
case WM_MBUTTONDOWN:
{
if (taseditor_window.hwndTasEditor)
if (FCEUMOV_Mode(MOVIEMODE_TASEDITOR))
playback.MiddleButtonClick();
return 0;
}
@ -2265,11 +2265,17 @@ adelikat: Outsourced this to a remappable hotkey
EnableMenuItem(fceumenu, MENU_PAL, MF_GRAYED);
EnableMenuItem(fceumenu, ID_NEWPPU, MF_GRAYED);
EnableMenuItem(fceumenu, ID_OLDPPU, MF_GRAYED);
EnableMenuItem(fceumenu, MENU_ENABLE_AUTOSAVE, MF_GRAYED);
EnableMenuItem(fceumenu, ID_ENABLE_BACKUPSAVESTATES, MF_GRAYED);
EnableMenuItem(fceumenu, ID_ENABLE_COMPRESSSAVESTATES, MF_GRAYED);
} else
{
EnableMenuItem(fceumenu, MENU_PAL, MF_ENABLED);
EnableMenuItem(fceumenu, ID_NEWPPU, MF_ENABLED);
EnableMenuItem(fceumenu, ID_OLDPPU, MF_ENABLED);
EnableMenuItem(fceumenu, MENU_ENABLE_AUTOSAVE, MF_ENABLED);
EnableMenuItem(fceumenu, ID_ENABLE_BACKUPSAVESTATES, MF_ENABLED);
EnableMenuItem(fceumenu, ID_ENABLE_COMPRESSSAVESTATES, MF_ENABLED);
}
CheckMenuRadioItem(fceumenu, ID_NEWPPU, ID_OLDPPU, newppu ? ID_NEWPPU : ID_OLDPPU, MF_BYCOMMAND);

View File

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

View File

@ -661,10 +661,7 @@ static void FCEUI_DoExit(void);
static void ToggleFullscreen(void);
static void TaseditorRewindOn(void);
static void TaseditorRewindOff(void);
static void TaseditorRestorePlayback(void);
static void TaseditorCancelSeeking(void);
static void TaseditorSwitchAutoRestoring(void);
static void TaseditorSwitchMultitracking(void);
static void TaseditorCommand(void);
struct EMUCMDTABLE FCEUI_CommandTable[]=
{
@ -790,10 +787,11 @@ struct EMUCMDTABLE FCEUI_CommandTable[]=
{ EMUCMD_TOOL_RAMSEARCHNE, EMUCMDTYPE_TOOL, RamSearchOpNE, 0, 0, "Ram Search - Not Equal", 0},
{ EMUCMD_RERECORD_DISPLAY_TOGGLE, EMUCMDTYPE_MISC, FCEUI_MovieToggleRerecordDisplay, 0, 0, "Toggle Rerecord Display", EMUCMDFLAG_TASEDITOR },
{ EMUCMD_TASEDITOR_REWIND, EMUCMDTYPE_TASEDITOR, TaseditorRewindOn, TaseditorRewindOff, 0, "Frame Rewind", EMUCMDFLAG_TASEDITOR },
{ EMUCMD_TASEDITOR_RESTORE_PLAYBACK, EMUCMDTYPE_TASEDITOR, TaseditorRestorePlayback, 0, 0, "Restore Playback", EMUCMDFLAG_TASEDITOR },
{ EMUCMD_TASEDITOR_CANCEL_SEEKING, EMUCMDTYPE_TASEDITOR, TaseditorCancelSeeking, 0, 0, "Cancel Seeking", EMUCMDFLAG_TASEDITOR },
{ EMUCMD_TASEDITOR_SWITCH_AUTORESTORING, EMUCMDTYPE_TASEDITOR, TaseditorSwitchAutoRestoring, 0, 0, "Switch Auto-restore last position", EMUCMDFLAG_TASEDITOR },
{ EMUCMD_TASEDITOR_SWITCH_MULTITRACKING, EMUCMDTYPE_TASEDITOR, TaseditorSwitchMultitracking, 0, 0, "Switch current Multitracking mode", EMUCMDFLAG_TASEDITOR },
{ EMUCMD_TASEDITOR_RESTORE_PLAYBACK, EMUCMDTYPE_TASEDITOR, TaseditorCommand, 0, 0, "Restore Playback", EMUCMDFLAG_TASEDITOR },
{ EMUCMD_TASEDITOR_CANCEL_SEEKING, EMUCMDTYPE_TASEDITOR, TaseditorCommand, 0, 0, "Cancel Seeking", EMUCMDFLAG_TASEDITOR },
{ EMUCMD_TASEDITOR_SWITCH_AUTORESTORING, EMUCMDTYPE_TASEDITOR, TaseditorCommand, 0, 0, "Switch Auto-restore last position", EMUCMDFLAG_TASEDITOR },
{ EMUCMD_TASEDITOR_SWITCH_MULTITRACKING, EMUCMDTYPE_TASEDITOR, TaseditorCommand, 0, 0, "Switch current Multitracking mode", EMUCMDFLAG_TASEDITOR },
{ EMUCMD_TASEDITOR_RUN_MANUAL_LUA, EMUCMDTYPE_TASEDITOR, TaseditorCommand, 0, 0, "Run Manual Lua function", EMUCMDFLAG_TASEDITOR },
};
#define NUM_EMU_CMDS (sizeof(FCEUI_CommandTable)/sizeof(FCEUI_CommandTable[0]))
@ -1190,33 +1188,10 @@ static void TaseditorRewindOff(void)
#endif
}
static void TaseditorRestorePlayback(void)
static void TaseditorCommand(void)
{
#ifdef WIN32
if (FCEUMOV_Mode(MOVIEMODE_TASEDITOR))
Taseditor_EMUCMD(execcmd);
#endif
}
static void TaseditorCancelSeeking(void)
{
#ifdef WIN32
if (FCEUMOV_Mode(MOVIEMODE_TASEDITOR))
Taseditor_EMUCMD(execcmd);
#endif
}
static void TaseditorSwitchAutoRestoring(void)
{
#ifdef WIN32
if (FCEUMOV_Mode(MOVIEMODE_TASEDITOR))
Taseditor_EMUCMD(execcmd);
#endif
}
static void TaseditorSwitchMultitracking(void)
{
#ifdef WIN32
if (FCEUMOV_Mode(MOVIEMODE_TASEDITOR))
Taseditor_EMUCMD(execcmd);
#endif
}

View File

@ -236,9 +236,10 @@ enum EMUCMD
EMUCMD_TASEDITOR_RESTORE_PLAYBACK,
EMUCMD_TASEDITOR_CANCEL_SEEKING,
EMUCMD_TASEDITOR_SWITCH_AUTORESTORING,
EMUCMD_TASEDITOR_SWITCH_MULTITRACKING,
//-----------------------------
//keep adding these in order of newness or else the hotkey binding configs will get messed up...
EMUCMD_TASEDITOR_SWITCH_MULTITRACKING,
EMUCMD_TASEDITOR_RUN_MANUAL_LUA,
EMUCMD_MAX
};

View File

@ -40,12 +40,8 @@
#include "./drivers/win/window.h"
extern void AddRecentMovieFile(const char *filename);
#include "./drivers/win/taseditor/playback.h"
#include "./drivers/win/taseditor/recorder.h"
extern PLAYBACK playback;
extern RECORDER recorder;
#include "./drivers/win/taseditor.h"
extern bool emulator_must_run_taseditor;
extern bool TaseditorIsRecording();
#endif
using namespace std;
@ -993,14 +989,13 @@ void FCEUMOV_AddInputState()
currMovieData.insertEmpty(-1, 2 + currFrameCounter - (int)currMovieData.records.size());
MovieRecord* mr = &currMovieData.records[currFrameCounter];
if(TaseditorIsRecording())
if (TaseditorIsRecording())
{
// record commands and buttons
mr->commands |= _currCommand;
joyports[0].log(mr);
joyports[1].log(mr);
recorder.InputChanged();
// replay buttons even when Recording - return data from movie to joyports in case Recorder changed it (for example, by applying Superimpose)
Taseditor_RecordInput();
}
// replay buttons
joyports[0].load(mr);
@ -1513,9 +1508,8 @@ void FCEUI_MoviePlayFromBeginning(void)
{
if (movieMode == MOVIEMODE_TASEDITOR)
{
movie_readonly = true;
#ifdef WIN32
playback.jump(0);
Taseditor_EMUCMD(EMUCMD_MOVIE_PLAY_FROM_BEGINNING);
#endif
} else if (movieMode != MOVIEMODE_INACTIVE)
{

Binary file not shown.