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

Method WriteData

pcsx2/SIO/Memcard/MemoryCardProtocol.cpp:208–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206}
207
208void MemoryCardProtocol::WriteData()
209{
210 MC_LOG.WriteLn("%s", __FUNCTION__);
211 PS1_FAIL();
212 g_Sio2FifoOut.push_back(0x00);
213 g_Sio2FifoOut.push_back(0x2b);
214 const u8 writeLength = g_Sio2FifoIn.front();
215 g_Sio2FifoIn.pop_front();
216 u8 checksum = 0x00;
217 std::vector<u8> buf;
218
219 for (size_t writeCounter = 0; writeCounter < writeLength; writeCounter++)
220 {
221 const u8 writeByte = g_Sio2FifoIn.front();
222 g_Sio2FifoIn.pop_front();
223 checksum ^= writeByte;
224 buf.push_back(writeByte);
225 g_Sio2FifoOut.push_back(0x00);
226 }
227
228 mcd->Write(buf.data(), buf.size());
229 g_Sio2FifoOut.push_back(checksum);
230 g_Sio2FifoOut.push_back(mcd->term);
231
232 ReadWriteIncrement(writeLength);
233
234 MemcardBusy::SetBusy();
235}
236
237void MemoryCardProtocol::ReadData()
238{

Callers 1

MemcardMethod · 0.80

Calls 8

SetBusyFunction · 0.85
WriteLnMethod · 0.45
push_backMethod · 0.45
frontMethod · 0.45
pop_frontMethod · 0.45
WriteMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected