mirror of
https://github.com/TomHarte/CLK.git
synced 2025-08-05 08:26:28 +00:00
Fix types, introduce Apple II mapper.
This commit is contained in:
38
Storage/MassStorage/Encodings/AppleIIVolume.hpp
Normal file
38
Storage/MassStorage/Encodings/AppleIIVolume.hpp
Normal file
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// AppleIIVolume.hpp
|
||||
// Clock Signal
|
||||
//
|
||||
// Created by Thomas Harte on 24/08/2022.
|
||||
// Copyright © 2022 Thomas Harte. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef AppleIIVolume_h
|
||||
#define AppleIIVolume_h
|
||||
|
||||
#include "ApplePartitionMap.hpp"
|
||||
|
||||
namespace Storage {
|
||||
namespace MassStorage {
|
||||
namespace Encodings {
|
||||
namespace AppleII {
|
||||
|
||||
struct VolumeProvider {
|
||||
static constexpr bool HasDriver = false;
|
||||
|
||||
const char *name() const {
|
||||
return "ProDOS";
|
||||
}
|
||||
|
||||
const char *type() const {
|
||||
return "Apple_PRODOS";
|
||||
}
|
||||
};
|
||||
|
||||
using Mapper = Storage::MassStorage::Encodings::Apple::PartitionMap<VolumeProvider>;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* AppleIIVolume_h */
|
@@ -46,7 +46,7 @@ template <typename VolumeProvider> class PartitionMap {
|
||||
size_t get_number_of_blocks() const {
|
||||
return
|
||||
number_of_blocks_ + // Size of the volume.
|
||||
non_volume_blocks(); // Size of everything else.
|
||||
size_t(non_volume_blocks()); // Size of everything else.
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -226,7 +226,7 @@ template <typename VolumeProvider> class PartitionMap {
|
||||
|
||||
VolumeProvider volume_provider_;
|
||||
|
||||
size_t predriver_blocks() const {
|
||||
ssize_t predriver_blocks() const {
|
||||
return
|
||||
0x40; // Holding:
|
||||
// (i) the driver descriptor;
|
||||
@@ -234,13 +234,13 @@ template <typename VolumeProvider> class PartitionMap {
|
||||
// (iii) the partition entries.
|
||||
}
|
||||
|
||||
size_t non_volume_blocks() const {
|
||||
ssize_t non_volume_blocks() const {
|
||||
return
|
||||
predriver_blocks() +
|
||||
driver_block_size(); // Size of device driver (if any).
|
||||
}
|
||||
|
||||
size_t driver_block_size() const {
|
||||
ssize_t driver_block_size() const {
|
||||
if constexpr (VolumeProvider::HasDriver) {
|
||||
return (volume_provider_.driver_size() + 511) >> 9;
|
||||
} else {
|
||||
|
@@ -12,7 +12,6 @@
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <sys/types.h>
|
||||
#include <vector>
|
||||
|
||||
#include "ApplePartitionMap.hpp"
|
||||
|
||||
|
Reference in New Issue
Block a user