You can now decode Brother disks to images. No CRC checking, though.

This commit is contained in:
David Given
2018-10-21 19:10:33 +02:00
parent 3d8f06ea89
commit d7b2505720
9 changed files with 353 additions and 11 deletions

View File

@@ -3,12 +3,12 @@
/* IBM format (i.e. ordinary PC floppies). */
#define IBM_IAM 0xFC /* start-of-track record */
#define IBM_IAM 0xFC /* start-of-track record */
#define IBM_IAM_LEN 4
#define IBM_IDAM 0xFE /* sector header */
#define IBM_IDAM 0xFE /* sector header */
#define IBM_IDAM_LEN 10
#define IBM_DAM1 0xF8 /* sector data (type 1) */
#define IBM_DAM2 0xFB /* sector data (type 2) */
#define IBM_DAM1 0xF8 /* sector data (type 1) */
#define IBM_DAM2 0xFB /* sector data (type 2) */
#define IBM_DAM_LEN 6 /* plus user data */
/* Length of a DAM record is determined by the previous sector header. */
@@ -23,13 +23,21 @@ struct IbmIdam
uint16_t crcBE;
};
/* Brother word processor format (or at least, one of them) */
#define BROTHER_SECTOR_RECORD 0xFFFFFD57
#define BROTHER_DATA_RECORD 0xFFFFFDDB
#define BROTHER_DATA_RECORD_PAYLOAD 256
class Sector;
class Fluxmap;
extern std::vector<bool> decodeFluxmapToBits(const Fluxmap& fluxmap, nanoseconds_t clock_period);
extern std::vector<std::vector<uint8_t>> decodeBitsToRecordsMfm(const std::vector<bool>& bitmap);
extern std::vector<std::vector<uint8_t>> decodeBitsToRecordsBrother(const std::vector<bool>& bitmap);
extern std::vector<std::unique_ptr<Sector>> decodeIbmRecordsToSectors(const std::vector<std::vector<uint8_t>>& records);
extern std::vector<std::unique_ptr<Sector>> parseRecordsToSectorsIbm(const std::vector<std::vector<uint8_t>>& records);
extern std::vector<std::unique_ptr<Sector>> parseRecordsToSectorsBrother(const std::vector<std::vector<uint8_t>>& records);
#endif