input-rec: remove excessive returns in ControllerInterrupt

This commit is contained in:
sonicfind 2022-09-22 12:29:00 -05:00 committed by refractionpcsx2
parent 1628237ba7
commit 5ea882dae3
2 changed files with 5 additions and 23 deletions

View File

@ -620,32 +620,12 @@ void InputRecording::ControllerInterrupt(u8 port, size_t fifoSize, u8 dataIn, u8
const u16 bufIndex = fifoSize - 3;
if (state == InputRecordingMode::Replaying)
{
if (!m_file.ReadKeyBuffer(bufVal, m_frame_counter, port, bufIndex))
if (!m_file.WriteKeyBuffer(m_frame_counter, port, bufIndex, bufVal))
{
InputRec::consoleLog(fmt::format("Failed to read input data at frame {}", m_frame_counter));
}
// Update controller data state for future VirtualPad / logging usage.
//pads[port].padData->UpdateControllerData(bufIndex, bufVal);
}
else
{
// Update controller data state for future VirtualPad / logging usage.
//pads[port].padData->UpdateControllerData(bufIndex, bufVal);
// Commit the byte to the movie file if we are recording
if (m_controls.isRecording())
{
if (!m_file.WriteKeyBuffer(m_frame_counter, port, bufIndex, bufVal))
{
InputRec::consoleLog(fmt::format("Failed to write input data at frame {}", m_frame_counter));
}
InputRec::consoleLog(fmt::format("Failed to write input data at frame {}", m_frame_counter));
}
}
}
if (bufCount > 20)
{
m_pad_data_available = false;
}
}
std::string InputRecording::resolveGameName()

View File

@ -166,7 +166,9 @@ public:
bool play(const std::string& path);
void stop();
void controllerInterrupt(u8& data, u8& port, u16& BufCount, u8 buf[]);
void queryFirstByte(const u8 data);
void querySecondByte(const u8 bufVal);
void controllerInterrupt(const u8 port, const u16 bufIndex, u8& bufVal);
void incFrameCounter();
u64 getFrameCounter() const;
bool isActive() const;