1
0
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:
Thomas Harte
2017-10-06 21:45:12 -04:00
parent f623bff5c3
commit 97a2be71e3
29 changed files with 150 additions and 238 deletions
+7 -7
View File
@@ -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;
}