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

Function cdvdWriteConfig

pcsx2/CDVD/CDVD.cpp:365–391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

363 return 0;
364}
365s32 cdvdWriteConfig(const u8* config)
366{
367 // make sure its in write mode && the block index is in bounds
368 if ((cdvd.CReadWrite != 1) || (cdvd.CBlockIndex >= cdvd.CNumBlocks))
369 return 1;
370 else if (
371 ((cdvd.COffset == 0) && (cdvd.CBlockIndex >= 4)) ||
372 ((cdvd.COffset == 1) && (cdvd.CBlockIndex >= 2)) ||
373 ((cdvd.COffset == 2) && (cdvd.CBlockIndex >= 7)))
374 return 0;
375
376 // get config data
377 const NVMLayout* nvmLayout = getNvmLayout();
378 switch (cdvd.COffset)
379 {
380 case 0:
381 cdvdWriteNVM(config, nvmLayout->config0 + ((cdvd.CBlockIndex++) * 16), 16);
382 break;
383 case 2:
384 cdvdWriteNVM(config, nvmLayout->config2 + ((cdvd.CBlockIndex++) * 16), 16);
385 break;
386 default:
387 cdvdWriteNVM(config, nvmLayout->config1 + ((cdvd.CBlockIndex++) * 16), 16);
388 break;
389 }
390 return 0;
391}
392
393static bool cdvdUncheckedLoadDiscElf(ElfObject* elfo, IsoReader& isor, const std::string_view elfpath, bool isPSXElf, Error* error)
394{

Callers 1

cdvdWrite16Function · 0.85

Calls 2

getNvmLayoutFunction · 0.85
cdvdWriteNVMFunction · 0.85

Tested by

no test coverage detected