forked from len0rd/rockbox
Autodetect sector size on superfloppy volumes based on the FAT32 BPB (kudos to Frank Gevaerts)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28946 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
886e97221b
commit
7fea136903
3 changed files with 17 additions and 0 deletions
|
|
@ -223,6 +223,9 @@ int disk_mount(int drive)
|
|||
DEBUGF("No partition found, trying to mount sector 0.\n");
|
||||
if (!fat_mount(IF_MV2(volume,) IF_MD2(drive,) 0))
|
||||
{
|
||||
#ifdef MAX_LOG_SECTOR_SIZE
|
||||
disk_sector_multiplier = fat_get_bytes_per_sector(IF_MV(volume))/SECTOR_SIZE;
|
||||
#endif
|
||||
mounted = 1;
|
||||
vol_drive[volume] = drive; /* remember the drive for this volume */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -448,6 +448,19 @@ static int fat_mount_internal(IF_MV2(int volume,) IF_MD2(int drive,) long starts
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef MAX_LOG_SECTOR_SIZE
|
||||
int fat_get_bytes_per_sector(IF_MV_NONVOID(int volume))
|
||||
{
|
||||
#ifdef HAVE_MULTIVOLUME
|
||||
if(!fat_bpbs[volume].mounted)
|
||||
return 0;
|
||||
return fat_bpbs[volume].bpb_bytspersec;
|
||||
#else
|
||||
return fat_bpbs[0].bpb_bytspersec;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
int fat_mount(IF_MV2(int volume,) IF_MD2(int drive,) long startsector)
|
||||
{
|
||||
#ifndef HAVE_MULTIVOLUME
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@ extern void fat_unlock(void);
|
|||
#endif
|
||||
|
||||
extern void fat_init(void);
|
||||
extern int fat_get_bytes_per_sector(IF_MV_NONVOID(int volume));
|
||||
extern int fat_mount(IF_MV2(int volume,) IF_MD2(int drive,) long startsector);
|
||||
extern int fat_unmount(int volume, bool flush);
|
||||
extern void fat_size(IF_MV2(int volume,) /* public for info */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue