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

Function cdvdReadNVM

pcsx2/CDVD/CDVD.cpp:241–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239}
240
241static void cdvdReadNVM(u8* dst, int offset, int bytes)
242{
243 int to_read = bytes;
244 if (static_cast<size_t>(offset + bytes) > sizeof(s_nvram)) [[unlikely]]
245 {
246 WARNING_LOG("CDVD: Out of bounds NVRAM read: offset={}, bytes={}", offset, bytes);
247 to_read = std::max(static_cast<int>(sizeof(s_nvram)) - offset, 0);
248 pxAssert((bytes - to_read) > 0);
249 std::memset(dst + to_read, 0, bytes - to_read);
250 }
251
252 if (to_read > 0) [[likely]]
253 std::memcpy(dst, &s_nvram[offset], to_read);
254}
255
256static void cdvdWriteNVM(const u8* src, int offset, int bytes)
257{

Callers 8

cdvdReadConsoleIDFunction · 0.85
cdvdReadILinkIDFunction · 0.85
cdvdReadModelNumberFunction · 0.85
cdvdReadRegionParamsFunction · 0.85
cdvdReadMACFunction · 0.85
cdvdReadLanguageParamsFunction · 0.85
cdvdReadConfigFunction · 0.85
cdvdWrite16Function · 0.85

Calls 1

maxFunction · 0.50

Tested by

no test coverage detected