mirror of
https://github.com/TomHarte/CLK.git
synced 2026-04-24 05:18:36 +00:00
Introduces flush_tracks to Drive, while switching its interface to using Track::Address and adjusting associated integer types.
This commit is contained in:
@@ -11,8 +11,8 @@
|
||||
#include "Utility/ImplicitSectors.hpp"
|
||||
|
||||
namespace {
|
||||
static const unsigned int sectors_per_track = 10;
|
||||
static const unsigned int sector_size = 1;
|
||||
static const int sectors_per_track = 10;
|
||||
static const int sector_size = 1;
|
||||
}
|
||||
|
||||
using namespace Storage::Disk;
|
||||
@@ -27,21 +27,21 @@ SSD::SSD(const char *file_name) : MFMSectorDump(file_name) {
|
||||
|
||||
// this has two heads if the suffix is .dsd, one if it's .ssd
|
||||
head_count_ = (tolower(file_name[strlen(file_name) - 3]) == 'd') ? 2 : 1;
|
||||
track_count_ = (unsigned int)(file_stats_.st_size / (256 * 10));
|
||||
track_count_ = static_cast<int>(file_stats_.st_size / (256 * 10));
|
||||
if(track_count_ < 40) track_count_ = 40;
|
||||
else if(track_count_ < 80) track_count_ = 80;
|
||||
|
||||
set_geometry(sectors_per_track, sector_size, false);
|
||||
}
|
||||
|
||||
unsigned int SSD::get_head_position_count() {
|
||||
int SSD::get_head_position_count() {
|
||||
return track_count_;
|
||||
}
|
||||
|
||||
unsigned int SSD::get_head_count() {
|
||||
int SSD::get_head_count() {
|
||||
return head_count_;
|
||||
}
|
||||
|
||||
long SSD::get_file_offset_for_position(unsigned int head, unsigned int position) {
|
||||
return (position * head_count_ + head) * 256 * 10;
|
||||
long SSD::get_file_offset_for_position(Track::Address address) {
|
||||
return (address.position * head_count_ + address.head) * 256 * 10;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user