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

Method ReadData

pcsx2/SIO/Memcard/MemoryCardProtocol.cpp:237–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235}
236
237void MemoryCardProtocol::ReadData()
238{
239 MC_LOG.WriteLn("%s", __FUNCTION__);
240 PS1_FAIL();
241 const u8 readLength = g_Sio2FifoIn.front();
242 g_Sio2FifoIn.pop_front();
243 g_Sio2FifoOut.push_back(0x00);
244 g_Sio2FifoOut.push_back(0x2b);
245 std::vector<u8> buf;
246 buf.resize(readLength);
247 mcd->Read(buf.data(), buf.size());
248 u8 checksum = 0x00;
249
250 for (const u8 readByte : buf)
251 {
252 checksum ^= readByte;
253 g_Sio2FifoOut.push_back(readByte);
254 }
255
256 g_Sio2FifoOut.push_back(checksum);
257 g_Sio2FifoOut.push_back(mcd->term);
258
259 ReadWriteIncrement(readLength);
260}
261
262u8 MemoryCardProtocol::PS1Read(u8 data)
263{

Callers 1

MemcardMethod · 0.80

Calls 8

WriteLnMethod · 0.45
frontMethod · 0.45
pop_frontMethod · 0.45
push_backMethod · 0.45
resizeMethod · 0.45
ReadMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected