CDVD: Get rid of negative data offsets

It doesn't make sense. Code was written in 2009 with no explaination.
This commit is contained in:
Stenzek 2023-11-30 18:18:24 +10:00 committed by Connor McLaughlin
parent 776cdd60fa
commit 97cedb311a
2 changed files with 8 additions and 15 deletions

View File

@ -299,16 +299,16 @@ bool InputIsoFile::IsOpened() const
return m_reader != NULL;
}
bool InputIsoFile::tryIsoType(u32 _size, s32 _offset, s32 _blockofs)
bool InputIsoFile::tryIsoType(u32 size, u32 offset, u32 blockofs)
{
static u8 buf[2456];
u8 buf[2456];
m_blocksize = _size;
m_offset = _offset;
m_blockofs = _blockofs;
m_blocksize = size;
m_offset = offset;
m_blockofs = blockofs;
m_reader->SetDataOffset(_offset);
m_reader->SetBlockSize(_size);
m_reader->SetDataOffset(offset);
m_reader->SetBlockSize(size);
if (ReadSync(buf, 16) < 0)
return false;
@ -359,13 +359,6 @@ bool InputIsoFile::Detect(bool readType)
if (tryIsoType(2448, 150 * 2048, 0))
return true; // NERO RAWQ 2448
if (tryIsoType(2048, -8, 24))
return true; // ISO 2048
if (tryIsoType(2352, -8, 0))
return true; // RAW 2352
if (tryIsoType(2448, -8, 0))
return true; // RAWQ 2448
m_offset = 0;
m_blocksize = CD_FRAMESIZE_RAW;
m_blockofs = 0;

View File

@ -95,7 +95,7 @@ public:
protected:
void _init();
bool tryIsoType(u32 _size, s32 _offset, s32 _blockofs);
bool tryIsoType(u32 size, u32 offset, u32 blockofs);
void FindParts();
};