* Debugger: deleting a breakpoint leaves selection in the Breakpoints list

* Debugger: changed "Load .DEB" checkbox caption to ".DEB files" to emphasize that it also affects saving .deb files, not just loading them
* updated docs
* Taseditor: fixed extremely rare LagLog bug in History.jump() and RegisterBranching
* Taseditor: fixed RegisterLuaChange to also consider LagLog changes

[[Split portion of a mixed commit.]]
This commit is contained in:
ansstuff 2012-09-11 15:32:11 +00:00
parent 4bb04e3639
commit 571d3cc550
16 changed files with 96 additions and 43 deletions

View File

@ -1,3 +1,6 @@
11-Aug-2012 - AnS - Debugger: deleting a breakpoint leaves selection in the Breakpoints list
06-Aug-2012 - AnS - added "Use Custom Palette" checkbox to Palette config
06-Aug-2012 - AnS - Debugger: special strings (NMI/IRQ/etc) can be also used in "Seek To" field and Bookmarks
01-Sep-2012 - AnS - fixed movie savestates logic, loading post-movie savestates is not allowed in read-only
31-Aug-2012 - zeromus - update mapper 156 from fceu-mm sources
30-Aug-2012 - AnS - fixed savestates filenaming bug when working with a movie

View File

@ -282,10 +282,14 @@ void OAKRA_Module_OutputDS::update() {
//that way, the voice's death callback won't occur within the driver lock
unlock();
//kill those voices
for(int i=0;i<(int)deaders.size();i++) {
deaders[i]->callbackDied();
freeVoice(deaders[i]);
// kill those voices
if (deaders.size())
{
for (int i = 0; i < (int)deaders.size(); i++)
{
deaders[i]->callbackDied();
freeVoice(deaders[i]);
}
}
}

View File

@ -855,8 +855,19 @@ void DeleteBreak(int sel)
myNumWPs--;
// ################################## End of SP CODE ###########################
SendDlgItemMessage(hDebug,IDC_DEBUGGER_BP_LIST,LB_DELETESTRING,sel,0);
EnableWindow(GetDlgItem(hDebug,IDC_DEBUGGER_BP_DEL),FALSE);
EnableWindow(GetDlgItem(hDebug,IDC_DEBUGGER_BP_EDIT),FALSE);
// select next item in the list
if (numWPs)
{
if (sel >= (numWPs - 1))
// select last item
SendDlgItemMessage(hDebug, IDC_DEBUGGER_BP_LIST, LB_SETCURSEL, numWPs - 1, 0);
else
SendDlgItemMessage(hDebug, IDC_DEBUGGER_BP_LIST, LB_SETCURSEL, sel, 0);
} else
{
EnableWindow(GetDlgItem(hDebug,IDC_DEBUGGER_BP_DEL),FALSE);
EnableWindow(GetDlgItem(hDebug,IDC_DEBUGGER_BP_EDIT),FALSE);
}
UpdateBreakpointsCaption();
}

Binary file not shown.

View File

@ -1114,13 +1114,13 @@ BEGIN
PUSHBUTTON "Seek PC",IDC_DEBUGGER_SEEK_PC,391,71,39,14
PUSHBUTTON "Seek To:",IDC_DEBUGGER_SEEK_TO,350,54,38,14
EDITTEXT IDC_DEBUGGER_VAL_PCSEEK,391,55,38,12,ES_UPPERCASE | ES_WANTRETURN
EDITTEXT IDC_DEBUGGER_VAL_SLINE,383,203,14,10,ES_UPPERCASE | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER,WS_EX_TRANSPARENT
EDITTEXT IDC_DEBUGGER_VAL_PPUPIXEL,372,216,14,10,ES_UPPERCASE | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_TRANSPARENT
EDITTEXT IDC_DEBUGGER_VAL_SLINE,383,203,14,12,ES_UPPERCASE | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER,WS_EX_TRANSPARENT
EDITTEXT IDC_DEBUGGER_VAL_PPUPIXEL,372,216,14,12,ES_UPPERCASE | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_TRANSPARENT
GROUPBOX "",IDC_DEBUGGER_VAL_S2,349,174,50,53,WS_TABSTOP
EDITTEXT IDC_DEBUGGER_VAL_CYCLES_COUNT,442,179,46,10,ES_NOHIDESEL | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_TRANSPARENT
EDITTEXT IDC_DEBUGGER_VAL_CYCLES_COUNT2,489,179,51,10,ES_READONLY | ES_WANTRETURN | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_TRANSPARENT
EDITTEXT IDC_DEBUGGER_VAL_INSTRUCTIONS_COUNT,441,204,46,10,ES_NOHIDESEL | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_TRANSPARENT
EDITTEXT IDC_DEBUGGER_VAL_INSTRUCTIONS_COUNT2,489,204,51,10,ES_READONLY | ES_WANTRETURN | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_TRANSPARENT
EDITTEXT IDC_DEBUGGER_VAL_CYCLES_COUNT,442,179,46,12,ES_NOHIDESEL | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_TRANSPARENT
EDITTEXT IDC_DEBUGGER_VAL_CYCLES_COUNT2,489,179,51,12,ES_READONLY | ES_WANTRETURN | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_TRANSPARENT
EDITTEXT IDC_DEBUGGER_VAL_INSTRUCTIONS_COUNT,441,204,46,12,ES_NOHIDESEL | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_TRANSPARENT
EDITTEXT IDC_DEBUGGER_VAL_INSTRUCTIONS_COUNT2,489,204,51,12,ES_READONLY | ES_WANTRETURN | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_TRANSPARENT
LTEXT "PPU:",65531,352,179,17,10
LTEXT "Sprite:",65530,352,191,20,10
EDITTEXT IDC_DEBUGGER_VAL_PPU,371,179,25,12,ES_UPPERCASE | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER,WS_EX_TRANSPARENT
@ -1142,8 +1142,8 @@ BEGIN
PUSHBUTTON "Run Line",IDC_DEBUGGER_RUN_LINE,350,37,38,14
PUSHBUTTON "128 Lines",IDC_DEBUGGER_RUN_FRAME2,391,37,39,14
LTEXT "Scanline:",IDC_STATIC,352,203,31,8
CONTROL "Load .DEB",DEBUGLOADDEB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,488,306,48,13
CONTROL "Auto-open",DEBUGAUTOLOAD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,438,306,46,13
CONTROL ".DEB files",DEBUGLOADDEB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,489,306,46,13
CONTROL "Auto-open",DEBUGAUTOLOAD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,438,306,47,13
LTEXT "CPU cycles:",IDC_STATIC,402,179,39,8
PUSHBUTTON "Reset counters",IDC_DEBUGGER_RESET_COUNTERS,471,229,64,14
CONTROL "Break when exceed",IDC_DEBUGGER_BREAK_ON_CYCLES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,403,191,77,10
@ -1976,7 +1976,6 @@ BEGIN
"DEBUGGER", DIALOG
BEGIN
BOTTOMMARGIN, 320
END
"TRACER", DIALOG

View File

@ -382,6 +382,17 @@ int HISTORY::JumpInTime(int new_pos)
if (first_change >= 0)
{
snapshots[real_pos].inputlog.toMovie(currMovieData, first_change);
// but Greenzone should be invalidated after the frame of Lag changes if this frame is less than the frame of Input changes
for (int i = 0; i < first_change; ++i)
{
// if old info != new info
if (greenzone.laglog.GetLagInfoAtFrame(i) != snapshots[real_pos].laglog.GetLagInfoAtFrame(i))
{
// Greenzone should be invalidated from the frame
first_change = i;
break;
}
}
greenzone.laglog = snapshots[real_pos].laglog;
selection.must_find_current_marker = playback.must_find_current_marker = true;
project.SetProjectChanged();
@ -597,9 +608,9 @@ int HISTORY::RegisterChanges(int mod_type, int start, int end, int size, const c
{
snap.end_frame = end;
}
// for lag-affecting operations only
if (first_changes > start && end == -1 && taseditor_config.adjust_input_due_to_lag)
int first_input_changes = first_changes;
// for lag-affecting operations only: Greenzone should be invalidated after the frame of Lag changes if this frame is less than the frame of Input changes
if (first_changes > start && end == -1)
{
// check if LagLogs of these snapshots differ before the "first_changes" frame
for (int i = start; i < first_changes; ++i)
@ -642,7 +653,7 @@ int HISTORY::RegisterChanges(int mod_type, int start, int end, int size, const c
if (taseditor_config.enable_hot_changes)
{
snap.inputlog.copyHotChanges(&snapshots[real_pos].inputlog);
snap.inputlog.fillHotChanges(snapshots[real_pos].inputlog, first_changes, end);
snap.inputlog.fillHotChanges(snapshots[real_pos].inputlog, first_input_changes, end);
}
// replace current snapshot with this cloned snapshot and truncate history here
snapshots[real_pos] = snap;
@ -675,11 +686,11 @@ int HISTORY::RegisterChanges(int mod_type, int start, int end, int size, const c
switch (mod_type)
{
case MODTYPE_DELETE:
snap.inputlog.inheritHotChanges_DeleteSelection(&snapshots[real_pos].inputlog);
snap.inputlog.inheritHotChanges_DeleteSelection(&snapshots[real_pos].inputlog, frameset);
break;
case MODTYPE_INSERT:
case MODTYPE_CLONE:
snap.inputlog.inheritHotChanges_InsertSelection(&snapshots[real_pos].inputlog);
snap.inputlog.inheritHotChanges_InsertSelection(&snapshots[real_pos].inputlog, frameset);
break;
case MODTYPE_INSERTNUM:
snap.inputlog.inheritHotChanges_InsertNum(&snapshots[real_pos].inputlog, start, size, true);
@ -691,7 +702,7 @@ int HISTORY::RegisterChanges(int mod_type, int start, int end, int size, const c
case MODTYPE_PASTE:
case MODTYPE_PATTERN:
snap.inputlog.inheritHotChanges(&snapshots[real_pos].inputlog);
snap.inputlog.fillHotChanges(snapshots[real_pos].inputlog, first_changes, end);
snap.inputlog.fillHotChanges(snapshots[real_pos].inputlog, first_input_changes, end);
break;
case MODTYPE_PASTEINSERT:
snap.inputlog.inheritHotChanges_PasteInsert(&snapshots[real_pos].inputlog, frameset);
@ -791,6 +802,17 @@ int HISTORY::RegisterBranching(int slot, bool markers_changed)
snap.inputlog.copyHotChanges(&bookmarks.bookmarks_array[slot].snapshot.inputlog);
AddItemToHistory(snap, branches.GetCurrentBranch());
project.SetProjectChanged();
// but Greenzone should be invalidated after the frame of Lag changes if this frame is less than the frame of Input changes
for (int i = 0; i < first_changes; ++i)
{
// if old info != new info
if (snapshots[real_pos].laglog.GetLagInfoAtFrame(i) != greenzone.laglog.GetLagInfoAtFrame(i))
{
// Greenzone should be invalidated from the frame
first_changes = i;
break;
}
}
} else if (markers_changed)
{
// fill description: modification type + time of the Branch
@ -979,6 +1001,20 @@ int HISTORY::RegisterLuaChanges(const char* name, int start, bool InsertionDelet
snap.inputlog.fillHotChanges(snapshots[real_pos].inputlog, first_changes);
}
}
// for lag-affecting operations only: Greenzone should be invalidated after the frame of Lag changes if this frame is less than the frame of Input changes
if (first_changes > start && InsertionDeletion_was_made)
{
// check if LagLogs of these snapshots differ before the "first_changes" frame
for (int i = start; i < first_changes; ++i)
{
if (snap.laglog.GetLagInfoAtFrame(i) != snapshots[real_pos].laglog.GetLagInfoAtFrame(i))
{
// Greenzone should be invalidated from the frame
first_changes = i;
break;
}
}
}
AddItemToHistory(snap);
branches.ChangesMadeSinceBranch();
project.SetProjectChanged();

View File

@ -526,7 +526,7 @@ void INPUTLOG::inheritHotChanges(INPUTLOG* source_of_hotchanges)
FadeHotChanges();
}
}
void INPUTLOG::inheritHotChanges_DeleteSelection(INPUTLOG* source_of_hotchanges)
void INPUTLOG::inheritHotChanges_DeleteSelection(INPUTLOG* source_of_hotchanges, SelectionFrames* frameset)
{
// copy hot changes from source InputLog, but omit deleted frames (which are represented by current selection)
if (source_of_hotchanges && source_of_hotchanges->has_hot_changes && source_of_hotchanges->input_type == input_type)
@ -534,10 +534,11 @@ void INPUTLOG::inheritHotChanges_DeleteSelection(INPUTLOG* source_of_hotchanges)
int bytes = joysticks_per_frame[input_type] * HOTCHANGE_BYTES_PER_JOY;
int frame = 0, pos = 0, source_pos = 0;
int this_size = hot_changes.size(), source_size = source_of_hotchanges->hot_changes.size();
SelectionFrames::iterator it(selection.GetStrobedSelection().begin());
SelectionFrames::iterator it(frameset->begin());
SelectionFrames::iterator current_selection_end(frameset->end());
while (pos < this_size && source_pos < source_size)
{
if (it != selection.GetStrobedSelection().end() && frame == *it)
if (it != current_selection_end && frame == *it)
{
// this frame is selected
it++;
@ -555,16 +556,16 @@ void INPUTLOG::inheritHotChanges_DeleteSelection(INPUTLOG* source_of_hotchanges)
FadeHotChanges();
}
}
void INPUTLOG::inheritHotChanges_InsertSelection(INPUTLOG* source_of_hotchanges)
void INPUTLOG::inheritHotChanges_InsertSelection(INPUTLOG* source_of_hotchanges, SelectionFrames* frameset)
{
// copy hot changes from source InputLog, but insert filled lines for inserted frames (which are represented by current selection)
SelectionFrames::iterator it(frameset->begin());
SelectionFrames::iterator current_selection_end(frameset->end());
if (source_of_hotchanges && source_of_hotchanges->has_hot_changes && source_of_hotchanges->input_type == input_type)
{
int bytes = joysticks_per_frame[input_type] * HOTCHANGE_BYTES_PER_JOY;
int frame = 0, region_len = 0, pos = 0, source_pos = 0;
int this_size = hot_changes.size(), source_size = source_of_hotchanges->hot_changes.size();
SelectionFrames::iterator it(selection.GetStrobedSelection().begin());
SelectionFrames::iterator current_selection_end(selection.GetStrobedSelection().end());
while (pos < this_size)
{
if (it != current_selection_end && frame == *it)
@ -593,8 +594,6 @@ void INPUTLOG::inheritHotChanges_InsertSelection(INPUTLOG* source_of_hotchanges)
int bytes = joysticks_per_frame[input_type] * HOTCHANGE_BYTES_PER_JOY;
int frame = 0, region_len = 0, pos = 0;
int this_size = hot_changes.size();
SelectionFrames::iterator it(selection.GetStrobedSelection().begin());
SelectionFrames::iterator current_selection_end(selection.GetStrobedSelection().end());
while (pos < this_size)
{
if (it != current_selection_end && frame == *it)

View File

@ -38,8 +38,8 @@ public:
void copyHotChanges(INPUTLOG* source_of_hotchanges, int limit_frame_of_source = -1);
void inheritHotChanges(INPUTLOG* source_of_hotchanges);
void inheritHotChanges_DeleteSelection(INPUTLOG* source_of_hotchanges);
void inheritHotChanges_InsertSelection(INPUTLOG* source_of_hotchanges);
void inheritHotChanges_DeleteSelection(INPUTLOG* source_of_hotchanges, SelectionFrames* frameset);
void inheritHotChanges_InsertSelection(INPUTLOG* source_of_hotchanges, SelectionFrames* frameset);
void inheritHotChanges_DeleteNum(INPUTLOG* source_of_hotchanges, int start, int frames, bool fade_old);
void inheritHotChanges_InsertNum(INPUTLOG* source_of_hotchanges, int start, int frames, bool fade_old);
void inheritHotChanges_PasteInsert(INPUTLOG* source_of_hotchanges, SelectionFrames* inserted_set);

View File

@ -132,7 +132,7 @@ void LAGLOG::EraseFrame(int frame)
}
void LAGLOG::InsertFrame(int frame, bool lagFlag, int frames)
{
if (frame < lag_log.size())
if (frame < (int)lag_log.size())
// insert
lag_log.insert(lag_log.begin() + frame, frames, (lagFlag) ? 1 : 0);
else

View File

@ -1864,8 +1864,11 @@ LRESULT APIENTRY ListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
selection.JumpPrevMarker(zDelta / WHEEL_DELTA);
} else if (fwKeys & MK_RBUTTON)
{
// Right button + wheel = rewind/forward
int destination_frame = currFrameCounter - (zDelta / WHEEL_DELTA);
// Right button + wheel = rewind/forward Playback
int delta = zDelta / WHEEL_DELTA;
if (delta < -1 || delta > 1)
delta *= PLAYBACK_WHEEL_BOOST;
int destination_frame = currFrameCounter - delta;
if (destination_frame < 0) destination_frame = 0;
int lastCursor = currFrameCounter;
playback.jump(destination_frame);

View File

@ -18,6 +18,7 @@
#define HEADER_DX_FIX 4
#define PIANO_ROLL_SCROLLING_BOOST 2
#define PLAYBACK_WHEEL_BOOST 2
#define MARKER_DRAG_BOX_ALPHA 180
#define MARKER_DRAG_COUNTDOWN_MAX 14

View File

@ -663,10 +663,6 @@ SelectionFrames* SELECTION::MakeStrobe()
temp_selection = selections_history[(history_start_pos + history_cursor_pos) % history_size];
return &temp_selection;
}
SelectionFrames& SELECTION::GetStrobedSelection()
{
return temp_selection;
}
// this getter is private
SelectionFrames& SELECTION::CurrentSelection()

View File

@ -61,7 +61,6 @@ public:
int GetCurrentSelectionEnd();
bool CheckFrameSelected(int frame);
SelectionFrames* MakeStrobe();
SelectionFrames& GetStrobedSelection();
bool must_find_current_marker;
int shown_marker;

View File

@ -139,7 +139,7 @@ void SPLICER::CloneFrames()
} else frames++;
}
// check and register changes
int first_changes = history.RegisterChanges(MODTYPE_CLONE, *current_selection->begin());
int first_changes = history.RegisterChanges(MODTYPE_CLONE, *current_selection->begin(), -1, 0, NULL, 0, current_selection);
if (first_changes >= 0)
{
greenzone.InvalidateAndCheck(first_changes);
@ -187,7 +187,7 @@ void SPLICER::InsertFrames()
} else frames++;
}
// check and register changes
int first_changes = history.RegisterChanges(MODTYPE_INSERT, *current_selection->begin());
int first_changes = history.RegisterChanges(MODTYPE_INSERT, *current_selection->begin(), -1, 0, NULL, 0, current_selection);
if (first_changes >= 0)
{
greenzone.InvalidateAndCheck(first_changes);
@ -277,7 +277,7 @@ void SPLICER::DeleteFrames()
// reduce Piano Roll
piano_roll.UpdateItemCount();
// check and register changes
int result = history.RegisterChanges(MODTYPE_DELETE, start_index);
int result = history.RegisterChanges(MODTYPE_DELETE, start_index, -1, 0, NULL, 0, current_selection);
if (result >= 0)
{
greenzone.InvalidateAndCheck(result);

View File

@ -412,6 +412,7 @@ int TASEDITOR_LUA::applyinputchanges(const char* name)
{
InsertionDeletion_was_made = true;
currMovieData.insertEmpty(pending_changes[i].frame, pending_changes[i].data);
greenzone.laglog.InsertFrame(pending_changes[i].frame, false, pending_changes[i].data);
if (taseditor_config.bind_markers)
markers_manager.insertEmpty(pending_changes[i].frame, pending_changes[i].data);
break;
@ -423,6 +424,7 @@ int TASEDITOR_LUA::applyinputchanges(const char* name)
{
if (pending_changes[i].frame < (int)currMovieData.getNumRecords())
currMovieData.records.erase(currMovieData.records.begin() + pending_changes[i].frame);
greenzone.laglog.EraseFrame(pending_changes[i].frame);
if (taseditor_config.bind_markers)
markers_manager.EraseMarker(pending_changes[i].frame);
}

Binary file not shown.