ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/cwcbm/writecbm.c
(Generate patch)

Comparing cwcbm/writecbm.c (file contents):
Revision 1.2 by cebix, 2004-01-07T16:53:58Z vs.
Revision 1.3 by cebix, 2004-01-10T14:05:59Z

# Line 155 | Line 155 | static void encode_sectors(int track)
155          int sector;
156  
157          // Encode each sector
158 <        for (sector = 0; sector < num_sectors[track]; sector++) {
158 >        for (sector = 0; sector < format->num_sectors[track]; sector++) {
159                  encode_header(track, sector, 0x41, 0x41);
160                  encode_data(track, track_buf + SECTOR_SIZE * sector);
161          }
# Line 172 | Line 172 | static int write_track(int drive, int tr
172  
173          // Write empty track
174          inb(c.iobase + 1);
175 <        for (i = 0; i < bps[std_speed[track]] * 60 / drive_rpm; i++)
175 >        for (i = 0; i < format->bps[format->std_speed[track]] * 60 / drive_rpm; i++)
176                  PUT(2);
177          outb(0xff, c.io_mem);
178 <        if (!catweasel_write(c.drives + drive, 0, 1, 1100 * 60 / drive_rpm)) {
178 >        if (!catweasel_write(c.drives + drive, track > format->tracks_per_side ? 1 : 0, 1, 1100 * 60 / drive_rpm)) {
179                  fprintf(stderr, "Error writing track %d\n", track);
180                  return 0;
181          }
# Line 225 | Line 225 | int main(int argc, char **argv)
225          if (!catweasel_write_protected(c.drives + drive_num)) {
226  
227                  // No, write all tracks
228 <                for (track = 1; track <= NUM_TRACKS; track++) {
228 >                for (track = 1; track <= format->sides * format->tracks_per_side; track++) {
229                          printf("Track %d...\n", track);
230 <                        if (fread(track_buf, 256, num_sectors[track], f) != num_sectors[track]) {
230 >                        if (fread(track_buf, 256, format->num_sectors[track], f) != format->num_sectors[track]) {
231                                  fprintf(stderr, "Error reading input file\n");
232                                  break;
233                          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines