From 4cbe5068a9e3fc01941a10499700fd37357c4a1f Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 23 Apr 2018 20:01:12 -0700 Subject: [PATCH] Works further towards NIB, but still isn't close. --- Storage/Disk/DiskImage/Formats/NIB.cpp | 19 ++++++++++--------- Storage/Disk/DiskImage/Formats/NIB.hpp | 2 -- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Storage/Disk/DiskImage/Formats/NIB.cpp b/Storage/Disk/DiskImage/Formats/NIB.cpp index 015816cfb..075a5bf12 100644 --- a/Storage/Disk/DiskImage/Formats/NIB.cpp +++ b/Storage/Disk/DiskImage/Formats/NIB.cpp @@ -28,17 +28,18 @@ NIB::NIB(const std::string &file_name) : } int NIB::get_head_position_count() { - return 35; -} - -int NIB::get_head_count() { - return 1; -} - -bool NIB::get_is_read_only() { - return true; + return number_of_tracks * 4; } std::shared_ptr<::Storage::Disk::Track> NIB::get_track_at_position(::Storage::Disk::Track::Address address) { + // NIBs contain data for even-numbered tracks underneath a single head only. + if(address.head || (address.position&1)) return nullptr; + +// const int file_track = address.position >> 1; +// file_.seek(static_cast(file_track * track_length), SEEK_SET); +// std::vector track_data = file_.read(track_length); + + // TODO: determine which FFs are syncs, and produce track. + return nullptr; } diff --git a/Storage/Disk/DiskImage/Formats/NIB.hpp b/Storage/Disk/DiskImage/Formats/NIB.hpp index b1113f7e0..fff52ca95 100644 --- a/Storage/Disk/DiskImage/Formats/NIB.hpp +++ b/Storage/Disk/DiskImage/Formats/NIB.hpp @@ -29,8 +29,6 @@ class NIB: public DiskImage { }; int get_head_position_count() override; - int get_head_count() override; - bool get_is_read_only() override; std::shared_ptr<::Storage::Disk::Track> get_track_at_position(::Storage::Disk::Track::Address address) override;