mirror of https://github.com/PCSX2/pcsx2.git
cdvd: Fix writing of CD blockdumps
Write the full CD sector (not including subchannels) to a blockdump instead of just a partial CD sector that isn't offset correctly.
This commit is contained in:
parent
79d57e2949
commit
eeca9f61bf
|
@ -438,9 +438,18 @@ s32 DoCDVDreadSector(u8* buffer, u32 lsn, int mode)
|
||||||
int ret = CDVD->readSector(buffer,lsn,mode);
|
int ret = CDVD->readSector(buffer,lsn,mode);
|
||||||
|
|
||||||
if (ret == 0 && blockDumpFile.IsOpened())
|
if (ret == 0 && blockDumpFile.IsOpened())
|
||||||
|
{
|
||||||
|
if (blockDumpFile.GetBlockSize() == CD_FRAMESIZE_RAW && mode != CDVD_MODE_2352)
|
||||||
|
{
|
||||||
|
u8 blockDumpBuffer[CD_FRAMESIZE_RAW];
|
||||||
|
if (CDVD->readSector(blockDumpBuffer, lsn, CDVD_MODE_2352) == 0)
|
||||||
|
blockDumpFile.WriteSector(blockDumpBuffer, lsn);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
blockDumpFile.WriteSector(buffer, lsn);
|
blockDumpFile.WriteSector(buffer, lsn);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -477,9 +486,18 @@ s32 DoCDVDgetBuffer(u8* buffer)
|
||||||
int ret = CDVD->getBuffer2(buffer);
|
int ret = CDVD->getBuffer2(buffer);
|
||||||
|
|
||||||
if (ret == 0 && blockDumpFile.IsOpened())
|
if (ret == 0 && blockDumpFile.IsOpened())
|
||||||
|
{
|
||||||
|
if (blockDumpFile.GetBlockSize() == CD_FRAMESIZE_RAW && lastReadSize != 2352)
|
||||||
|
{
|
||||||
|
u8 blockDumpBuffer[CD_FRAMESIZE_RAW];
|
||||||
|
if (CDVD->readSector(blockDumpBuffer, lastLSN, CDVD_MODE_2352) == 0)
|
||||||
|
blockDumpFile.WriteSector(blockDumpBuffer, lastLSN);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
blockDumpFile.WriteSector(buffer, lastLSN);
|
blockDumpFile.WriteSector(buffer, lastLSN);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,7 +123,7 @@ public:
|
||||||
virtual ~OutputIsoFile();
|
virtual ~OutputIsoFile();
|
||||||
|
|
||||||
bool IsOpened() const;
|
bool IsOpened() const;
|
||||||
|
u32 GetBlockSize() const;
|
||||||
|
|
||||||
const wxString& GetFilename() const
|
const wxString& GetFilename() const
|
||||||
{
|
{
|
||||||
|
|
|
@ -133,3 +133,8 @@ bool OutputIsoFile::IsOpened() const
|
||||||
{
|
{
|
||||||
return m_outstream && m_outstream->IsOk();
|
return m_outstream && m_outstream->IsOk();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
u32 OutputIsoFile::GetBlockSize() const
|
||||||
|
{
|
||||||
|
return m_blocksize;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue