Skip to content

Commit

Permalink
img: Fix D81 image side ordering.
Browse files Browse the repository at this point in the history
Fixes #132
  • Loading branch information
keirf committed Jun 20, 2018
1 parent b2fd841 commit 5f1b52a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/image/img.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ static bool_t fm_write_track(struct image *im);
static bool_t pc_dos_open(struct image *im);
static bool_t ti99_open(struct image *im);

#define LAYOUT_interleaved 0
#define LAYOUT_sequential_reverse_side1 1
#define LAYOUT_interleaved 0
#define LAYOUT_interleaved_swap_sides 1
#define LAYOUT_sequential_reverse_side1 2

#define sec_sz(im) (128u << (im)->img.sec_no)

Expand Down Expand Up @@ -211,6 +212,7 @@ static bool_t img_open(struct image *im)

static bool_t d81_open(struct image *im)
{
im->img.layout = LAYOUT_interleaved_swap_sides;
return _img_open(im, TRUE, d81_type);
}

Expand Down Expand Up @@ -699,6 +701,9 @@ static void img_seek_track(
case LAYOUT_sequential_reverse_side1:
im->img.trk_off = (side ? im->nr_cyls - cyl : cyl) * trk_len;
break;
case LAYOUT_interleaved_swap_sides:
trk ^= im->nr_sides - 1;
/* fall through */
default:
im->img.trk_off = trk * trk_len;
break;
Expand Down

0 comments on commit 5f1b52a

Please sign in to comment.