mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Add support for 528-byte sectors. Adjust the post-index gap to (try?) and fit
all the data in one revolution. I think my write clock is a bit slow.
This commit is contained in:
@@ -17,7 +17,7 @@ static DoubleFlag clockRateUs(
|
||||
static DoubleFlag postIndexGapMs(
|
||||
{ "--post-index-gap" },
|
||||
"Post-index gap before first sector header (milliseconds).",
|
||||
5.0);
|
||||
0.5);
|
||||
|
||||
static int charToInt(char c)
|
||||
{
|
||||
@@ -64,6 +64,9 @@ static void write_interleaved_bytes(std::vector<bool>& bits, unsigned& cursor, u
|
||||
|
||||
static void write_sector(std::vector<bool>& bits, unsigned& cursor, const Sector* sector)
|
||||
{
|
||||
if ((sector->data.size() != 512) && (sector->data.size() != 528))
|
||||
Error() << "unsupported sector size --- you must pick 512 or 528";
|
||||
|
||||
write_bits(bits, cursor, AMIGA_SECTOR_RECORD, 6*8);
|
||||
|
||||
std::vector<bool> headerBits(20*16);
|
||||
@@ -78,6 +81,8 @@ static void write_sector(std::vector<bool>& bits, unsigned& cursor, const Sector
|
||||
};
|
||||
write_interleaved_bytes(headerBits, headerCursor, header);
|
||||
Bytes recoveryInfo(16);
|
||||
if (sector->data.size() == 528)
|
||||
recoveryInfo = sector->data.slice(512, 16);
|
||||
write_interleaved_bytes(headerBits, headerCursor, recoveryInfo);
|
||||
|
||||
std::vector<bool> dataBits(512*16);
|
||||
|
||||
Reference in New Issue
Block a user