From 7613755f94385c31f585e3e11b54af6bf04ffa2b Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sat, 26 Nov 2016 10:13:12 +0800 Subject: [PATCH] Fixed addressing: types are 1 and 2, not 0 and 1. --- Storage/Disk/Formats/OricMFMDSK.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Storage/Disk/Formats/OricMFMDSK.cpp b/Storage/Disk/Formats/OricMFMDSK.cpp index 0a849fa6d..aa002fcc4 100644 --- a/Storage/Disk/Formats/OricMFMDSK.cpp +++ b/Storage/Disk/Formats/OricMFMDSK.cpp @@ -21,7 +21,7 @@ OricMFMDSK::OricMFMDSK(const char *file_name) : track_count_ = fgetc32le(); geometry_type_ = fgetc32le(); - if(geometry_type_ > 1) + if(geometry_type_ < 1 || geometry_type_ > 2) throw ErrorNotOricMFMDSK; } @@ -40,10 +40,10 @@ std::shared_ptr OricMFMDSK::get_track_at_position(unsigned int head, unsi long offset = 0; switch(geometry_type_) { - case 0: + case 1: offset = (head * track_count_) + position; break; - case 1: + case 2: offset = (position * track_count_ * head_count_) + head; break; }