mirror of
https://github.com/akuker/RASCSI.git
synced 2025-01-12 01:29:58 +00:00
Updated capacity calculation
This commit is contained in:
parent
8a3572c030
commit
5d207f7aca
@ -87,8 +87,18 @@ void SCSIHD::Open(const Filepath& path)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set the default product name based on the drive capacity
|
// 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;
|
stringstream product;
|
||||||
product << DEFAULT_PRODUCT << " " << (GetBlockCount() >> 11) << " MB";
|
product << DEFAULT_PRODUCT << " " << capacity << " " << unit;
|
||||||
SetProduct(product.str(), false);
|
SetProduct(product.str(), false);
|
||||||
|
|
||||||
Disk::Open(path);
|
Disk::Open(path);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user