abc80x: Fix sector dump floppy image loading. [Curt Coder]

This commit is contained in:
Curt Coder 2023-03-26 09:57:21 +03:00
parent 50ac51c146
commit eb7a055bfa
2 changed files with 21 additions and 1 deletions

View File

@ -26,7 +26,7 @@ const char *abc800_format::description() const
const char *abc800_format::extensions() const
{
return "dsk";
return "dsk,img";
}
const abc800_format::format abc800_format::formats[] = {
@ -163,3 +163,22 @@ void abc800_format::build_sector_description(const format &f, uint8_t *sectdata,
}
}
}
int abc800_format::get_image_offset(const format &f, int head, int track) const
{
int offset = 0;
if(head) {
for(int trk=0; trk < f.track_count; trk++) {
const format &tf = get_track_format(f, 0, trk);
offset += compute_track_size(tf);
}
}
for(int trk=0; trk < track; trk++) {
const format &tf = get_track_format(f, head, trk);
offset += compute_track_size(tf);
}
return offset;
}

View File

@ -25,6 +25,7 @@ public:
protected:
virtual void build_sector_description(const format &d, uint8_t *sectdata, desc_s *sectors, int track, int head) const override;
virtual int get_image_offset(const format &f, int head, int track) const override;
private:
static const format formats[];