| 243 | } |
| 244 | |
| 245 | bool 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: |
nothing calls this directly
no test coverage detected