summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/formats/fs_coco_os9.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2022-04-24 14:14:49 +1000
committer Vas Crabb <vas@vastheman.com>2022-04-24 14:14:49 +1000
commit25c64006b7ca4bbb0d575b46c6c5c4f214dac7ed (patch)
tree6f0399117a96c25ad14dcd80990b0262a6953592 /src/lib/formats/fs_coco_os9.cpp
parent6c247d5a92b46292ee54554b41df32f7a56372f3 (diff)
srcclean in preparation for 0.243
Diffstat (limited to 'src/lib/formats/fs_coco_os9.cpp')
-rw-r--r--src/lib/formats/fs_coco_os9.cpp70
1 files changed, 35 insertions, 35 deletions
diff --git a/src/lib/formats/fs_coco_os9.cpp b/src/lib/formats/fs_coco_os9.cpp
index 8d5f3ee0f4e..3813255482c 100644
--- a/src/lib/formats/fs_coco_os9.cpp
+++ b/src/lib/formats/fs_coco_os9.cpp
@@ -377,11 +377,11 @@ util::arbitrary_datetime from_os9_date(u32 os9_date, u16 os9_time)
{
util::arbitrary_datetime dt;
memset(&dt, 0, sizeof(dt));
- dt.year = ((os9_date >> 16) & 0xFF) + 1900;
- dt.month = (os9_date >> 8) & 0xFF;
- dt.day_of_month = (os9_date >> 0) & 0xFF;
- dt.hour = (os9_time >> 8) & 0xFF;
- dt.minute = (os9_time >> 0) & 0xFF;
+ dt.year = ((os9_date >> 16) & 0xFF) + 1900;
+ dt.month = (os9_date >> 8) & 0xFF;
+ dt.day_of_month = (os9_date >> 0) & 0xFF;
+ dt.hour = (os9_time >> 8) & 0xFF;
+ dt.minute = (os9_time >> 0) & 0xFF;
return dt;
}
@@ -561,15 +561,15 @@ void impl::format(const meta_data &meta)
m_blockdev.fill(0xE5);
// identify geometry info
- u8 sectors = 18; // TODO - we need a definitive technique to get the floppy geometry
- u8 heads = 1; // TODO - we need a definitive technique to get the floppy geometry
- u16 sector_bytes = 256; // TODO - we need a definitive technique to get the floppy geometry
- bool is_double_density = true; // TODO - we need a definitive technique to get the floppy geometry
+ u8 sectors = 18; // TODO - we need a definitive technique to get the floppy geometry
+ u8 heads = 1; // TODO - we need a definitive technique to get the floppy geometry
+ u16 sector_bytes = 256; // TODO - we need a definitive technique to get the floppy geometry
+ bool is_double_density = true; // TODO - we need a definitive technique to get the floppy geometry
u32 tracks = m_blockdev.block_count() / sectors / heads;
// get attributes from metadata
- std::string volume_title = meta.get_string(meta_name::name, "UNTITLED");
- util::arbitrary_datetime creation_datetime = meta.get_date(meta_name::creation_date);
+ std::string volume_title = meta.get_string(meta_name::name, "UNTITLED");
+ util::arbitrary_datetime creation_datetime = meta.get_date(meta_name::creation_date);
auto [creation_os9date, creation_os9time] = to_os9_date(creation_datetime);
u32 lsn_count = m_blockdev.block_count();
@@ -585,32 +585,32 @@ void impl::format(const meta_data &meta)
// volume header
auto volume_header = m_blockdev.get(0);
volume_header.fill(0x00);
- volume_header.w24b(0, lsn_count); // DD.TOT - total secctors
- volume_header.w8(3, sectors); // DD.TKS - track size in sectors
- volume_header.w16b(4, (allocation_bitmap_bits + 7) / 8); // DD.MAP - allocation bitmap in bytes
- volume_header.w16b(6, cluster_size); // DD.BIT - cluster size
- volume_header.w24b(8, 1 + allocation_bitmap_lsns); // DD.DIR - root directory LSN
- volume_header.w16b(11, owner_id); // DD.OWN - owner ID
- volume_header.w8(13, attributes); // DD.ATT - Dattributes
- volume_header.w16b(14, disk_id); // DD.DSK - disk ID
- volume_header.w8(16, format_flags); // DD.FMT - format flags
- volume_header.w16b(17, sectors); // DD.SPT - sectors per track
- volume_header.w24b(26, creation_os9date); // DD.DAT - date of creation
- volume_header.w16b(29, creation_os9time); // DD.DAT - time of creation
- volume_header.wstr(31, to_os9_string(volume_title, 32)); // DD.NAM - title
- volume_header.w16b(103, sector_bytes / 256); // sector bytes
+ volume_header.w24b(0, lsn_count); // DD.TOT - total secctors
+ volume_header.w8(3, sectors); // DD.TKS - track size in sectors
+ volume_header.w16b(4, (allocation_bitmap_bits + 7) / 8); // DD.MAP - allocation bitmap in bytes
+ volume_header.w16b(6, cluster_size); // DD.BIT - cluster size
+ volume_header.w24b(8, 1 + allocation_bitmap_lsns); // DD.DIR - root directory LSN
+ volume_header.w16b(11, owner_id); // DD.OWN - owner ID
+ volume_header.w8(13, attributes); // DD.ATT - Dattributes
+ volume_header.w16b(14, disk_id); // DD.DSK - disk ID
+ volume_header.w8(16, format_flags); // DD.FMT - format flags
+ volume_header.w16b(17, sectors); // DD.SPT - sectors per track
+ volume_header.w24b(26, creation_os9date); // DD.DAT - date of creation
+ volume_header.w16b(29, creation_os9time); // DD.DAT - time of creation
+ volume_header.wstr(31, to_os9_string(volume_title, 32)); // DD.NAM - title
+ volume_header.w16b(103, sector_bytes / 256); // sector bytes
// path descriptor options
- volume_header.w8(0x3f + 0x00, 1); // device class
- volume_header.w8(0x3f + 0x01, 1); // drive number
- volume_header.w8(0x3f + 0x03, 0x20); // device type
- volume_header.w8(0x3f + 0x04, 1); // density capability
- volume_header.w16b(0x3f + 0x05, tracks); // number of tracks
- volume_header.w8(0x3f + 0x07, heads); // number of sides
- volume_header.w16b(0x3f + 0x09, sectors); // sectors per track
- volume_header.w16b(0x3f + 0x0b, sectors); // sectors on track zero
- volume_header.w8(0x3f + 0x0d, 3); // sector interleave factor
- volume_header.w8(0x3f + 0x0e, 8); // default sectors per allocation
+ volume_header.w8(0x3f + 0x00, 1); // device class
+ volume_header.w8(0x3f + 0x01, 1); // drive number
+ volume_header.w8(0x3f + 0x03, 0x20); // device type
+ volume_header.w8(0x3f + 0x04, 1); // density capability
+ volume_header.w16b(0x3f + 0x05, tracks); // number of tracks
+ volume_header.w8(0x3f + 0x07, heads); // number of sides
+ volume_header.w16b(0x3f + 0x09, sectors); // sectors per track
+ volume_header.w16b(0x3f + 0x0b, sectors); // sectors on track zero
+ volume_header.w8(0x3f + 0x0d, 3); // sector interleave factor
+ volume_header.w8(0x3f + 0x0e, 8); // default sectors per allocation
// allocation bitmap
u32 total_allocated_sectors = 1 + allocation_bitmap_lsns + 1 + 8;