Skip to content

Commit

Permalink
Report error if HDD image file doesn't have the proper sector size.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpd002 committed Sep 23, 2024
1 parent 0621599 commit e70ee16
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Source/ui_shared/arcadedrivers/NamcoSys246Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ void CNamcoSys246Driver::PrepareEnvironment(CPS2VM* virtualMachine, const ARCADE
}

auto imageStream = std::make_unique<CChdImageStream>(std::make_unique<Framework::CStdStream>(hddPath.string().c_str(), "rb"));
assert(imageStream->GetUnitSize() == Hdd::g_sectorSize);
if(imageStream->GetUnitSize() != Hdd::g_sectorSize)
{
throw std::runtime_error(string_format("Sector size mismatch in HDD image file ('%s'). Make sure the CHD file was created with the 'createhd' option.", def.hddFileName.c_str()));
}

auto device = std::make_shared<Iop::Ioman::CHardDiskDumpDevice>(std::move(imageStream));

auto iopBios = dynamic_cast<CIopBios*>(virtualMachine->m_iop->m_bios.get());
Expand Down

0 comments on commit e70ee16

Please sign in to comment.