diff options
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 |
commit | 25c64006b7ca4bbb0d575b46c6c5c4f214dac7ed (patch) | |
tree | 6f0399117a96c25ad14dcd80990b0262a6953592 /src/lib/formats | |
parent | 6c247d5a92b46292ee54554b41df32f7a56372f3 (diff) |
srcclean in preparation for 0.243
Diffstat (limited to 'src/lib/formats')
-rw-r--r-- | src/lib/formats/ap2_dsk.cpp | 2 | ||||
-rw-r--r-- | src/lib/formats/fs_coco_os9.cpp | 70 | ||||
-rw-r--r-- | src/lib/formats/fsmeta.cpp | 8 |
3 files changed, 40 insertions, 40 deletions
diff --git a/src/lib/formats/ap2_dsk.cpp b/src/lib/formats/ap2_dsk.cpp index 9e37476b6e4..46e193750cc 100644 --- a/src/lib/formats/ap2_dsk.cpp +++ b/src/lib/formats/ap2_dsk.cpp @@ -607,7 +607,7 @@ int a2_16sect_format::identify(util::random_read &io, uint32_t form_factor, cons static const unsigned char a3a2emul_block1[6] = { 0x8d, 0xd0, 0x03, 0x4c, 0xc7, 0xa4 }; static const unsigned char cpm22_block1[8] = { 0xa2, 0x55, 0xa9, 0x00, 0x9d, 0x00, 0x0d, 0xca }; static const unsigned char subnod_block1[8] = { 0x63, 0xaa, 0xf0, 0x76, 0x8d, 0x63, 0xaa, 0x8e }; - + size_t actual; io.read_at(0, sector_data, 256*2, actual); 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; diff --git a/src/lib/formats/fsmeta.cpp b/src/lib/formats/fsmeta.cpp index 681d644f18e..41ac767cd11 100644 --- a/src/lib/formats/fsmeta.cpp +++ b/src/lib/formats/fsmeta.cpp @@ -42,10 +42,10 @@ meta_type meta_value::type() const std::optional<meta_type> result; std::visit(overloaded { - [&result](const std::string &) { result = meta_type::string; }, - [&result](std::uint64_t) { result = meta_type::number; }, - [&result](bool) { result = meta_type::flag; }, - [&result](const util::arbitrary_datetime &) { result = meta_type::date; } + [&result](const std::string &) { result = meta_type::string; }, + [&result](std::uint64_t) { result = meta_type::number; }, + [&result](bool) { result = meta_type::flag; }, + [&result](const util::arbitrary_datetime &) { result = meta_type::date; } }, value); return *result; } |