1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-23 03:32:32 +00:00

Unifies constants.

This commit is contained in:
Thomas Harte 2018-04-27 21:38:08 -04:00
parent 992a99d792
commit 5c74044e62

View File

@ -11,8 +11,9 @@
#include "Utility/ImplicitSectors.hpp" #include "Utility/ImplicitSectors.hpp"
namespace { namespace {
static const int sectors_per_track = 9; const int sectors_per_track = 9;
static const int sector_size = 2; const int sector_size = 2;
const off_t track_size = (128 << sector_size)*sectors_per_track;
} }
using namespace Storage::Disk; using namespace Storage::Disk;
@ -22,7 +23,6 @@ MSXDSK::MSXDSK(const std::string &file_name) :
// The only sanity check here is whether a sensible // The only sanity check here is whether a sensible
// geometry can be guessed. // geometry can be guessed.
off_t file_size = file_.stats().st_size; off_t file_size = file_.stats().st_size;
const off_t track_size = 512*9;
// Throw if there would seemingly be an incomplete track. // Throw if there would seemingly be an incomplete track.
if(file_size % track_size) throw ErrorNotMSXDSK; if(file_size % track_size) throw ErrorNotMSXDSK;