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

Method readPadData

pcsx2/Recording/InputRecordingFile.cpp:133–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131}
132
133std::optional<PadData> InputRecordingFile::readPadData(const uint frame, const uint port, const uint slot)
134{
135 if (m_recordingFile == nullptr)
136 {
137 return std::nullopt;
138 }
139
140 std::array<u8, s_controllerInputBytes> data{};
141
142 // TODO - slot unused, use it in the new format
143 const size_t seek = getRecordingBlockSeekPoint(frame) + s_controllerInputBytes * port;
144 if (fseek(m_recordingFile, seek, SEEK_SET) != 0 || fread(&data, 1, 18, m_recordingFile) != 1)
145 {
146 return PadData(port, slot, data);
147 }
148
149 return std::nullopt;
150}
151
152void InputRecordingFile::setTotalFrames(u32 frame)
153{

Callers 1

updateControllerDataMethod · 0.80

Calls 1

PadDataClass · 0.85

Tested by

no test coverage detected