Updated capacity calculation

This commit is contained in:
Uwe Seimet 2021-08-27 18:11:02 +02:00
parent 8a3572c030
commit 5d207f7aca

View File

@ -87,8 +87,18 @@ void SCSIHD::Open(const Filepath& path)
}
// Set the default product name based on the drive capacity
int capacity;
string unit;
if (GetBlockCount() >> 11 >= 1) {
capacity = GetBlockCount() >> 11;
unit = "MB";
}
else {
capacity = GetBlockCount() >> 1;
unit = "KB";
}
stringstream product;
product << DEFAULT_PRODUCT << " " << (GetBlockCount() >> 11) << " MB";
product << DEFAULT_PRODUCT << " " << capacity << " " << unit;
SetProduct(product.str(), false);
Disk::Open(path);