mirror of
https://github.com/akuker/RASCSI.git
synced 2025-01-15 04:30:24 +00:00
Removed duplicate code
This commit is contained in:
parent
12cafe7ff5
commit
99807a9dbe
@ -20,6 +20,7 @@
|
|||||||
#include "os.h"
|
#include "os.h"
|
||||||
#include "xm6.h"
|
#include "xm6.h"
|
||||||
#include "controllers/sasidev_ctrl.h"
|
#include "controllers/sasidev_ctrl.h"
|
||||||
|
#include "device_factory.h"
|
||||||
#include "exceptions.h"
|
#include "exceptions.h"
|
||||||
#include "disk.h"
|
#include "disk.h"
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
@ -1753,7 +1754,8 @@ int Disk::GetSectorSizeInBytes() const
|
|||||||
|
|
||||||
void Disk::SetSectorSizeInBytes(int size, bool sasi)
|
void Disk::SetSectorSizeInBytes(int size, bool sasi)
|
||||||
{
|
{
|
||||||
if (sasi && size != 256 && size != 1024) {
|
vector<int> sector_sizes = sasi ? DeviceFactory::instance().GetSasiSectorSizes() : DeviceFactory::instance().GetScsiSectorSizes();
|
||||||
|
if (find(sector_sizes.begin(), sector_sizes.end(), size) == sector_sizes.end()) {
|
||||||
stringstream error;
|
stringstream error;
|
||||||
error << "Invalid sector size of " << size << " bytes";
|
error << "Invalid sector size of " << size << " bytes";
|
||||||
throw io_exception(error.str());
|
throw io_exception(error.str());
|
||||||
@ -1781,9 +1783,8 @@ void Disk::SetSectorSizeInBytes(int size, bool sasi)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
stringstream error;
|
assert(false);
|
||||||
error << "Invalid sector size of " << size << " bytes";
|
disk.size = 9;
|
||||||
throw io_exception(error.str());
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user