MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / handleControllerDataUpdate

Method handleControllerDataUpdate

pcsx2/Recording/InputRecording.cpp:166–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164}
165
166void InputRecording::handleControllerDataUpdate()
167{
168 // TODO - multi-tap support with new file format, for now just controller 0 and 1
169 for (int i = 0; i < 2; i++)
170 {
171 // Fetch the current frame's data
172 PadData frameData(i, 0);
173 if (m_is_active)
174 {
175 if (m_controls.isRecording())
176 {
177 saveControllerData(frameData, i, 0);
178 }
179 else if (m_controls.isReplaying())
180 {
181 const auto& modifiedFrameData = updateControllerData(i, 0);
182 if (modifiedFrameData)
183 {
184 frameData = modifiedFrameData.value();
185 }
186 }
187 }
188 // Log the data we have gathered, useful for debugging our use-case
189 frameData.LogPadData();
190 }
191}
192
193void InputRecording::saveControllerData(const PadData& data, const int port, const int slot)
194{

Callers 1

PollInputOnCPUThreadMethod · 0.80

Calls 4

isRecordingMethod · 0.80
isReplayingMethod · 0.80
LogPadDataMethod · 0.80
valueMethod · 0.45

Tested by

no test coverage detected