Skip to content

Commit

Permalink
img: Fix outp_hden for high-density images.
Browse files Browse the repository at this point in the history
write_bc_ticks has not been initialised early enough since v2.2a
Refs #290
Refs #301
  • Loading branch information
keirf committed Dec 27, 2019
1 parent c94a4ab commit a3aebcd
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions src/image/img.c
Original file line number Diff line number Diff line change
Expand Up @@ -1478,15 +1478,6 @@ const struct image_handler xdf_image_handler = {
* Generic Handlers
*/

static bool_t raw_open(struct image *im)
{
im->img.rpm = im->img.rpm ?: 300;
im->stk_per_rev = (stk_ms(200) * 300) / im->img.rpm;
volume_cache_init(im->bufs.write_data.p + 1024,
im->img.heap_bottom);
return TRUE;
}

static FSIZE_t raw_extend(struct image *im)
{
unsigned int i, j, sz = im->img.base_off;
Expand Down Expand Up @@ -1676,6 +1667,20 @@ static void raw_setup_track(
}
}

static bool_t raw_open(struct image *im)
{
im->img.rpm = im->img.rpm ?: 300;
im->stk_per_rev = (stk_ms(200) * 300) / im->img.rpm;

volume_cache_init(im->bufs.write_data.p + 1024,
im->img.heap_bottom);

/* Initialise write_bc_ticks (used by floppy_insert to set outp_hden). */
raw_seek_track(im, 0, 0, 0);

return TRUE;
}

void process_data(struct image *im, void *p, unsigned int len)
{
/* Pointer and size should be 4-byte aligned. */
Expand Down

0 comments on commit a3aebcd

Please sign in to comment.