Factor Sector out into its own header. Sketch out Geometry.

This commit is contained in:
David Given
2018-12-29 01:59:09 +01:00
parent 490e649942
commit 9b610a9527
8 changed files with 55 additions and 26 deletions

34
lib/sector.h Normal file
View File

@@ -0,0 +1,34 @@
#ifndef SECTOR_H
#define SECTOR_H
/*
* Note that sectors here used zero-based numbering throughout (to make the
* maths easier); traditionally floppy disk use 0-based track numbering and
* 1-based sector numbering, which makes no sense.
*/
class Sector
{
public:
enum
{
OK,
BAD_CHECKSUM
};
Sector(int status, int track, int side, int sector, const std::vector<uint8_t>& data):
status(status),
track(track),
side(side),
sector(sector),
data(data)
{}
const int status;
const int track;
const int side;
const int sector;
const std::vector<uint8_t> data;
};
#endif