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:
Jonathan Li 2018-01-23 19:07:25 +00:00
parent 79d57e2949
commit eeca9f61bf
3 changed files with 26 additions and 3 deletions

View File

@ -439,7 +439,16 @@ s32 DoCDVDreadSector(u8* buffer, u32 lsn, int mode)
if (ret == 0 && blockDumpFile.IsOpened())
{
blockDumpFile.WriteSector(buffer, lsn);
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);
}
}
return ret;
@ -478,7 +487,16 @@ s32 DoCDVDgetBuffer(u8* buffer)
if (ret == 0 && blockDumpFile.IsOpened())
{
blockDumpFile.WriteSector(buffer, lastLSN);
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);
}
}
return ret;

View File

@ -123,7 +123,7 @@ public:
virtual ~OutputIsoFile();
bool IsOpened() const;
u32 GetBlockSize() const;
const wxString& GetFilename() const
{

View File

@ -133,3 +133,8 @@ bool OutputIsoFile::IsOpened() const
{
return m_outstream && m_outstream->IsOk();
}
u32 OutputIsoFile::GetBlockSize() const
{
return m_blocksize;
}