~ubuntu-branches/ubuntu/maverick/vice/maverick

« back to all changes in this revision

Viewing changes to src/diskimage/fsimage-check.c

  • Committer: Bazaar Package Importer
  • Author(s): Zed Pobre
  • Date: 2005-02-01 11:30:26 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050201113026-3eyakzsmmheclvjg
Tags: 1.16-1
* New upstream version
* Fixes crash on 64-bit architectures (closes: #287640)
* x128 working again (closes: #286767)
* Works fine with /dev/dsp in use (not in the main changelog, but tested
  on my local machine as working).  Presumably, this also takes care of
  the issue with dsp being held.  I'm not sure if this is because I'm
  testing it on a 2.6 kernel now -- if you are still having problems
  with /dev/dsp, please reopen the bugs. (closes: #152952, #207942)
* Don't kill Makefile.in on clean

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
#include "fsimage-check.h"
32
32
 
33
33
 
34
 
int fsimage_check_sector(unsigned int format, unsigned int track,
 
34
int fsimage_check_sector(disk_image_t *image, unsigned int track,
35
35
                         unsigned int sector)
36
36
{
37
37
    unsigned int sectors = 0, i;
39
39
    if (track < 1)
40
40
        return -1;
41
41
 
42
 
    switch (format) {
 
42
    switch (image->type) {
43
43
      case DISK_IMAGE_TYPE_D64:
44
44
      case DISK_IMAGE_TYPE_X64:
45
45
        if (track > MAX_TRACKS_1541 || sector
96
96
            sectors += disk_image_sector_per_track(DISK_IMAGE_TYPE_D80, i);
97
97
        sectors += sector;
98
98
        break;
 
99
      case DISK_IMAGE_TYPE_G64:
 
100
        if (track > image->tracks || track > MAX_TRACKS_1541 || sector
 
101
            >= disk_image_sector_per_track(DISK_IMAGE_TYPE_D64, track))
 
102
            return -1;
 
103
        for (i = 1; i < track; i++)
 
104
            sectors += disk_image_sector_per_track(DISK_IMAGE_TYPE_D64, i);
 
105
        sectors += sector;
 
106
        break;
99
107
      default:
100
108
        return -1;
101
109
    }