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

Method tryIsoType

pcsx2/CDVD/InputIsoFile.cpp:245–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243}
244
245bool InputIsoFile::tryIsoType(u32 size, u32 offset, u32 blockofs)
246{
247 u8 buf[2456];
248
249 m_blocksize = size;
250 m_offset = offset;
251 m_blockofs = blockofs;
252
253 m_reader->SetDataOffset(offset);
254 m_reader->SetBlockSize(size);
255
256 if (ReadSync(buf, 16) < 0)
257 return false;
258
259 if (strncmp((char*)(buf + 25), "CD001", 5)) // Not ISO 9660 compliant
260 return false;
261
262 m_type = (*(u16*)(buf + 190) == 2048) ? ISOTYPE_CD : ISOTYPE_DVD;
263
264 return true; // We can deal with this.
265}
266
267// based on florin's CDVDbin detection code :)
268// Parameter:

Callers

nothing calls this directly

Calls 2

SetDataOffsetMethod · 0.80
SetBlockSizeMethod · 0.80

Tested by

no test coverage detected