Skip to content

Commit

Permalink
CDVD: Get rid of negative data offsets
Browse files Browse the repository at this point in the history
It doesn't make sense. Code was written in 2009 with no explaination.
  • Loading branch information
stenzek committed Nov 30, 2023
1 parent e951b9e commit 1ba9e59
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
21 changes: 7 additions & 14 deletions pcsx2/CDVD/InputIsoFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion pcsx2/CDVD/IsoFileFormats.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class InputIsoFile final
protected:
void _init();

bool tryIsoType(u32 _size, s32 _offset, s32 _blockofs);
bool tryIsoType(u32 size, u32 offset, u32 blockofs);
void FindParts();
};

Expand Down

0 comments on commit 1ba9e59

Please sign in to comment.