* Taseditor: fixed bug in project saving
* Taseditor: fixed bug in laglog truncating when no Input changes are made by inserting/deleting frames
This commit is contained in:
parent
7922866f96
commit
dc7805cfc5
|
@ -21,6 +21,7 @@ Main - Main gate between emulator and Taseditor
|
|||
#include "utils/xstring.h"
|
||||
#include "main.h" // for GetRomName
|
||||
#include "taseditor.h"
|
||||
#include "window.h"
|
||||
#include "../../input.h"
|
||||
#include "../keyboard.h"
|
||||
#include "../joystick.h"
|
||||
|
@ -63,7 +64,6 @@ extern int EnableAutosave;
|
|||
int saved_frame_display;
|
||||
// FCEUX
|
||||
extern EMOVIEMODE movieMode; // maybe we need normal setter for movieMode, to encapsulate it
|
||||
extern void UpdateCheckedMenuItems();
|
||||
// lua engine
|
||||
extern void TaseditorAutoFunction();
|
||||
extern void TaseditorManualFunction();
|
||||
|
@ -801,6 +801,9 @@ void ApplyMovieInputConfig()
|
|||
PushCurrentVideoSettings();
|
||||
// update PPU type
|
||||
newppu = currMovieData.PPUflag;
|
||||
SetMainWindowText();
|
||||
// return focus to TAS Editor window
|
||||
SetFocus(taseditor_window.hwndTasEditor);
|
||||
}
|
||||
|
||||
// this getter contains formula to decide whether to record or replay movie
|
||||
|
|
|
@ -667,10 +667,10 @@ LONG BOOKMARKS::CustomDraw(NMLVCUSTOMDRAW* msg)
|
|||
msg->clrTextBk = LAG_FRAMENUM_COLOR;
|
||||
else
|
||||
msg->clrTextBk = GREENZONE_FRAMENUM_COLOR;
|
||||
} else if ((!greenzone.SavestateIsEmpty(frame & EVERY16TH) && !greenzone.SavestateIsEmpty((frame & EVERY16TH) + 16))
|
||||
|| (!greenzone.SavestateIsEmpty(frame & EVERY8TH) && !greenzone.SavestateIsEmpty((frame & EVERY8TH) + 8))
|
||||
|| (!greenzone.SavestateIsEmpty(frame & EVERY4TH) && !greenzone.SavestateIsEmpty((frame & EVERY4TH) + 4))
|
||||
|| (!greenzone.SavestateIsEmpty(frame & EVERY2ND) && !greenzone.SavestateIsEmpty((frame & EVERY2ND) + 2)))
|
||||
} else if (!greenzone.SavestateIsEmpty(cell_y & EVERY16TH)
|
||||
|| !greenzone.SavestateIsEmpty(cell_y & EVERY8TH)
|
||||
|| !greenzone.SavestateIsEmpty(cell_y & EVERY4TH)
|
||||
|| !greenzone.SavestateIsEmpty(cell_y & EVERY2ND))
|
||||
{
|
||||
if (greenzone.laglog.GetLagInfoAtFrame(frame) == LAGGED_YES)
|
||||
msg->clrTextBk = PALE_LAG_FRAMENUM_COLOR;
|
||||
|
@ -698,10 +698,10 @@ LONG BOOKMARKS::CustomDraw(NMLVCUSTOMDRAW* msg)
|
|||
msg->clrTextBk = LAG_INPUT_COLOR1;
|
||||
else
|
||||
msg->clrTextBk = GREENZONE_INPUT_COLOR1;
|
||||
} else if ((!greenzone.SavestateIsEmpty(frame & EVERY16TH) && !greenzone.SavestateIsEmpty((frame & EVERY16TH) + 16))
|
||||
|| (!greenzone.SavestateIsEmpty(frame & EVERY8TH) && !greenzone.SavestateIsEmpty((frame & EVERY8TH) + 8))
|
||||
|| (!greenzone.SavestateIsEmpty(frame & EVERY4TH) && !greenzone.SavestateIsEmpty((frame & EVERY4TH) + 4))
|
||||
|| (!greenzone.SavestateIsEmpty(frame & EVERY2ND) && !greenzone.SavestateIsEmpty((frame & EVERY2ND) + 2)))
|
||||
} else if (!greenzone.SavestateIsEmpty(cell_y & EVERY16TH)
|
||||
|| !greenzone.SavestateIsEmpty(cell_y & EVERY8TH)
|
||||
|| !greenzone.SavestateIsEmpty(cell_y & EVERY4TH)
|
||||
|| !greenzone.SavestateIsEmpty(cell_y & EVERY2ND))
|
||||
{
|
||||
if (greenzone.laglog.GetLagInfoAtFrame(frame) == LAGGED_YES)
|
||||
msg->clrTextBk = PALE_LAG_INPUT_COLOR1;
|
||||
|
|
|
@ -475,14 +475,14 @@ void GREENZONE::AdjustDown()
|
|||
markers_changed = true;
|
||||
}
|
||||
// register changes
|
||||
int first_input_chanes = history.RegisterAdjustLag(at, +1);
|
||||
int first_input_changes = history.RegisterAdjustLag(at, +1);
|
||||
// If Input in the frame above currFrameCounter has changed then invalidate Greenzone (rewind 1 frame back)
|
||||
// This should never actually happen, because we clone the frame, so the Input doesn't change
|
||||
// But the check should remain, in case we decide to insert blank frame instead of cloning
|
||||
if (first_input_chanes >= 0 && first_input_chanes < currFrameCounter)
|
||||
if (first_input_changes >= 0 && first_input_changes < currFrameCounter)
|
||||
{
|
||||
// custom invalidation procedure, not retriggering LostPosition/PauseFrame
|
||||
Invalidate(first_input_chanes);
|
||||
Invalidate(first_input_changes);
|
||||
bool emu_was_paused = (FCEUI_EmulationPaused() != 0);
|
||||
int saved_pause_frame = playback.GetPauseFrame();
|
||||
playback.EnsurePlaybackIsInsideGreenzone();
|
||||
|
|
|
@ -414,7 +414,7 @@ int HISTORY::JumpInTime(int new_pos)
|
|||
piano_roll.RedrawList(); // even though the Greenzone invalidation most likely will also sent the command to redraw
|
||||
|
||||
// Greenzone should be invalidated after the frame of Lag changes if this frame is less than the frame of Input changes
|
||||
if (first_lag_changes >= 0 && first_changes > first_lag_changes)
|
||||
if (first_lag_changes >= 0 && (first_changes > first_lag_changes || first_changes < 0))
|
||||
first_changes = first_lag_changes;
|
||||
return first_changes;
|
||||
}
|
||||
|
@ -635,7 +635,7 @@ int HISTORY::RegisterChanges(int mod_type, int start, int end, int size, const c
|
|||
branches.ChangesMadeSinceBranch();
|
||||
project.SetProjectChanged();
|
||||
}
|
||||
if (first_lag_changes >= 0 && first_changes > first_lag_changes)
|
||||
if (first_lag_changes >= 0 && (first_changes > first_lag_changes || first_changes < 0))
|
||||
first_changes = first_lag_changes;
|
||||
return first_changes;
|
||||
}
|
||||
|
@ -793,7 +793,7 @@ int HISTORY::RegisterBranching(int slot, bool markers_changed)
|
|||
snap.laglog = greenzone.laglog;
|
||||
}
|
||||
// Greenzone should be invalidated after the frame of Lag changes if this frame is less than the frame of Input changes
|
||||
if (first_lag_changes >= 0 && first_changes > first_lag_changes)
|
||||
if (first_lag_changes >= 0 && (first_changes > first_lag_changes || first_changes < 0))
|
||||
first_changes = first_lag_changes;
|
||||
return first_changes;
|
||||
}
|
||||
|
@ -978,7 +978,7 @@ int HISTORY::RegisterLuaChanges(const char* name, int start, bool InsertionDelet
|
|||
branches.ChangesMadeSinceBranch();
|
||||
project.SetProjectChanged();
|
||||
}
|
||||
if (first_lag_changes >= 0 && first_changes > first_lag_changes)
|
||||
if (first_lag_changes >= 0 && (first_changes > first_lag_changes || first_changes < 0))
|
||||
first_changes = first_lag_changes;
|
||||
return first_changes;
|
||||
}
|
||||
|
|
|
@ -1362,10 +1362,10 @@ LONG PIANO_ROLL::CustomDraw(NMLVCUSTOMDRAW* msg)
|
|||
msg->clrTextBk = LAG_FRAMENUM_COLOR;
|
||||
else
|
||||
msg->clrTextBk = GREENZONE_FRAMENUM_COLOR;
|
||||
} else if ((!greenzone.SavestateIsEmpty(cell_y & EVERY16TH) && !greenzone.SavestateIsEmpty((cell_y & EVERY16TH) + 16))
|
||||
|| (!greenzone.SavestateIsEmpty(cell_y & EVERY8TH) && !greenzone.SavestateIsEmpty((cell_y & EVERY8TH) + 8))
|
||||
|| (!greenzone.SavestateIsEmpty(cell_y & EVERY4TH) && !greenzone.SavestateIsEmpty((cell_y & EVERY4TH) + 4))
|
||||
|| (!greenzone.SavestateIsEmpty(cell_y & EVERY2ND) && !greenzone.SavestateIsEmpty((cell_y & EVERY2ND) + 2)))
|
||||
} else if (!greenzone.SavestateIsEmpty(cell_y & EVERY16TH)
|
||||
|| !greenzone.SavestateIsEmpty(cell_y & EVERY8TH)
|
||||
|| !greenzone.SavestateIsEmpty(cell_y & EVERY4TH)
|
||||
|| !greenzone.SavestateIsEmpty(cell_y & EVERY2ND))
|
||||
{
|
||||
// the frame is in a gap (in Greenzone tail)
|
||||
if (frame_lag == LAGGED_YES)
|
||||
|
@ -1421,10 +1421,10 @@ LONG PIANO_ROLL::CustomDraw(NMLVCUSTOMDRAW* msg)
|
|||
msg->clrTextBk = LAG_INPUT_COLOR1;
|
||||
else
|
||||
msg->clrTextBk = GREENZONE_INPUT_COLOR1;
|
||||
} else if ((!greenzone.SavestateIsEmpty(cell_y & EVERY16TH) && !greenzone.SavestateIsEmpty((cell_y & EVERY16TH) + 16))
|
||||
|| (!greenzone.SavestateIsEmpty(cell_y & EVERY8TH) && !greenzone.SavestateIsEmpty((cell_y & EVERY8TH) + 8))
|
||||
|| (!greenzone.SavestateIsEmpty(cell_y & EVERY4TH) && !greenzone.SavestateIsEmpty((cell_y & EVERY4TH) + 4))
|
||||
|| (!greenzone.SavestateIsEmpty(cell_y & EVERY2ND) && !greenzone.SavestateIsEmpty((cell_y & EVERY2ND) + 2)))
|
||||
} else if (!greenzone.SavestateIsEmpty(cell_y & EVERY16TH)
|
||||
|| !greenzone.SavestateIsEmpty(cell_y & EVERY8TH)
|
||||
|| !greenzone.SavestateIsEmpty(cell_y & EVERY4TH)
|
||||
|| !greenzone.SavestateIsEmpty(cell_y & EVERY2ND))
|
||||
{
|
||||
// the frame is in a gap (in Greenzone tail)
|
||||
if (frame_lag == LAGGED_YES)
|
||||
|
@ -1480,10 +1480,10 @@ LONG PIANO_ROLL::CustomDraw(NMLVCUSTOMDRAW* msg)
|
|||
msg->clrTextBk = LAG_INPUT_COLOR2;
|
||||
else
|
||||
msg->clrTextBk = GREENZONE_INPUT_COLOR2;
|
||||
} else if ((!greenzone.SavestateIsEmpty(cell_y & EVERY16TH) && !greenzone.SavestateIsEmpty((cell_y & EVERY16TH) + 16))
|
||||
|| (!greenzone.SavestateIsEmpty(cell_y & EVERY8TH) && !greenzone.SavestateIsEmpty((cell_y & EVERY8TH) + 8))
|
||||
|| (!greenzone.SavestateIsEmpty(cell_y & EVERY4TH) && !greenzone.SavestateIsEmpty((cell_y & EVERY4TH) + 4))
|
||||
|| (!greenzone.SavestateIsEmpty(cell_y & EVERY2ND) && !greenzone.SavestateIsEmpty((cell_y & EVERY2ND) + 2)))
|
||||
} else if (!greenzone.SavestateIsEmpty(cell_y & EVERY16TH)
|
||||
|| !greenzone.SavestateIsEmpty(cell_y & EVERY8TH)
|
||||
|| !greenzone.SavestateIsEmpty(cell_y & EVERY4TH)
|
||||
|| !greenzone.SavestateIsEmpty(cell_y & EVERY2ND))
|
||||
{
|
||||
// the frame is in a gap (in Greenzone tail)
|
||||
if (frame_lag == LAGGED_YES)
|
||||
|
|
|
@ -140,7 +140,7 @@ bool TASEDITOR_PROJECT::save(const char* different_name, bool save_binary, bool
|
|||
if (save_selection) saved_stuff_map |= SELECTION_SAVED;
|
||||
write32le(saved_stuff_map, ofs);
|
||||
unsigned int number_of_pointers = DEFAULT_NUMBER_OF_POINTERS;
|
||||
write32le(saved_stuff_map, ofs);
|
||||
write32le(number_of_pointers, ofs);
|
||||
// write dummy zeros to the file, where the offsets will be
|
||||
for (unsigned int i = 0; i < number_of_pointers; ++i)
|
||||
write32le(0, ofs);
|
||||
|
|
Loading…
Reference in New Issue