openMSX
Classes | Functions | Variables
openmsx::DiskImageUtils Namespace Reference

Classes

struct  CHS
 
struct  SetBootSectorResult
 

Functions

bool hasPartitionTable (SectorAccessibleDisk &disk)
 Check whether the given disk is partitioned. More...
 
void checkValidPartition (SectorAccessibleDisk &disk, unsigned partition)
 Checks whether the disk is partitioned the specified partition exists throws a CommandException if one of these conditions is false. More...
 
void checkFAT12Partition (SectorAccessibleDisk &disk, unsigned partition)
 Like above, but also check whether partition is of type FAT12. More...
 
void format (SectorAccessibleDisk &disk, bool dos1=false)
 Format the given disk (= a single partition). More...
 
void partition (SectorAccessibleDisk &disk, const std::vector< unsigned > &sizes)
 Write a partition table to the given disk and format each partition. More...
 

Variables

constexpr char PARTAB_HEADER [11]
 

Function Documentation

◆ checkFAT12Partition()

void openmsx::DiskImageUtils::checkFAT12Partition ( SectorAccessibleDisk disk,
unsigned  partition 
)

Like above, but also check whether partition is of type FAT12.

Definition at line 58 of file DiskImageUtils.cc.

References partition(), and openmsx::Partition::sys_ind.

◆ checkValidPartition()

void openmsx::DiskImageUtils::checkValidPartition ( SectorAccessibleDisk disk,
unsigned  partition 
)

Checks whether the disk is partitioned the specified partition exists throws a CommandException if one of these conditions is false.

Parameters
diskThe disk to check.
partitionPartition number, in range [1..31].

Definition at line 52 of file DiskImageUtils.cc.

References partition().

Referenced by openmsx::DiskPartition::DiskPartition().

◆ format()

void openmsx::DiskImageUtils::format ( SectorAccessibleDisk disk,
bool  dos1 = false 
)

◆ hasPartitionTable()

bool openmsx::DiskImageUtils::hasPartitionTable ( SectorAccessibleDisk disk)

Check whether the given disk is partitioned.

Definition at line 22 of file DiskImageUtils.cc.

References openmsx::SectorBuffer::pt, and openmsx::SectorAccessibleDisk::readSector().

◆ partition()

void openmsx::DiskImageUtils::partition ( SectorAccessibleDisk disk,
const std::vector< unsigned > &  sizes 
)

Write a partition table to the given disk and format each partition.

Parameters
diskThe disk to partition.
sizesThe number of sectors for each partition.

Definition at line 235 of file DiskImageUtils.cc.

References openmsx::PartitionTable::end, format(), openmsx::PartitionTable::header, openmsx::PartitionTable::part, PARTAB_HEADER, openmsx::SectorBuffer::pt, openmsx::SectorAccessibleDisk::writeSector(), and xrange().

Referenced by checkFAT12Partition(), checkValidPartition(), and openmsx::DiskPartition::DiskPartition().

Variable Documentation

◆ PARTAB_HEADER

constexpr char openmsx::DiskImageUtils::PARTAB_HEADER[11]
constexpr
Initial value:
= {
'\353', '\376', '\220', 'M', 'S', 'X', '_', 'I', 'D', 'E', ' '
}

Definition at line 14 of file DiskImageUtils.cc.

Referenced by partition().