summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/common/disk.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/firmware/common/disk.c b/firmware/common/disk.c
index 576eede143..bef04037ad 100644
--- a/firmware/common/disk.c
+++ b/firmware/common/disk.c
@@ -331,19 +331,18 @@ int disk_mount(int drive)
331 disk_sector_multiplier[IF_MD_DRV(drive)] = 1; 331 disk_sector_multiplier[IF_MD_DRV(drive)] = 1;
332#endif 332#endif
333 333
334 /* try "superfloppy" mode */ 334 /* try "superfloppy" mode */
335 DEBUGF("Trying to mount sector 0.\n"); 335 DEBUGF("Trying to mount sector 0.\n");
336 336
337 if (!fat_mount(IF_MV(volume,) IF_MD(drive,) 0)) 337 if (!fat_mount(IF_MV(volume,) IF_MD(drive,) 0))
338 { 338 {
339 #ifdef MAX_LOG_SECTOR_SIZE 339#ifdef MAX_LOG_SECTOR_SIZE
340 disk_sector_multiplier[drive] = 340 disk_sector_multiplier[drive] = fat_get_bytes_per_sector(IF_MV(volume)) / SECTOR_SIZE;
341 fat_get_bytes_per_sector(IF_MV(volume)) / SECTOR_SIZE; 341#endif
342 #endif 342 mounted = 1;
343 mounted = 1; 343 init_volume(&volumes[volume], drive, 0);
344 init_volume(&volumes[volume], drive, 0); 344 volume_onmount_internal(IF_MV(volume));
345 volume_onmount_internal(IF_MV(volume)); 345 }
346 }
347 346
348 if (mounted == 0 && volume != -1) /* not a "superfloppy"? */ 347 if (mounted == 0 && volume != -1) /* not a "superfloppy"? */
349 { 348 {
@@ -356,7 +355,7 @@ int disk_mount(int drive)
356 355
357 DEBUGF("Trying to mount partition %d.\n", i); 356 DEBUGF("Trying to mount partition %d.\n", i);
358 357
359 #ifdef MAX_LOG_SECTOR_SIZE 358#ifdef MAX_LOG_SECTOR_SIZE
360 for (int j = 1; j <= (MAX_LOG_SECTOR_SIZE/SECTOR_SIZE); j <<= 1) 359 for (int j = 1; j <= (MAX_LOG_SECTOR_SIZE/SECTOR_SIZE); j <<= 1)
361 { 360 {
362 if (!fat_mount(IF_MV(volume,) IF_MD(drive,) pinfo[i].start * j)) 361 if (!fat_mount(IF_MV(volume,) IF_MD(drive,) pinfo[i].start * j))
@@ -371,7 +370,7 @@ int disk_mount(int drive)
371 break; 370 break;
372 } 371 }
373 } 372 }
374 #else /* ndef MAX_LOG_SECTOR_SIZE */ 373#else /* ndef MAX_LOG_SECTOR_SIZE */
375 if (!fat_mount(IF_MV(volume,) IF_MD(drive,) pinfo[i].start)) 374 if (!fat_mount(IF_MV(volume,) IF_MD(drive,) pinfo[i].start))
376 { 375 {
377 mounted++; 376 mounted++;
@@ -379,7 +378,7 @@ int disk_mount(int drive)
379 volume_onmount_internal(IF_MV(volume)); 378 volume_onmount_internal(IF_MV(volume));
380 volume = get_free_volume(); /* prepare next entry */ 379 volume = get_free_volume(); /* prepare next entry */
381 } 380 }
382 #endif /* MAX_LOG_SECTOR_SIZE */ 381#endif /* MAX_LOG_SECTOR_SIZE */
383 } 382 }
384 } 383 }
385 384