*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
DBG("current sector offset %d size %d\n",
file->offset, file->dirent->size);
DBG("current sector offset %d size %d\n",
file->offset, file->dirent->size);
printf ("file offset %d larger than size %d\n",
file->offset, file->dirent->size);
return 0xffffffff;
printf ("file offset %d larger than size %d\n",
file->offset, file->dirent->size);
return 0xffffffff;
DBG ("\tfirst cluster %08x have %d need %d\n", first_cluster, have_clusters, need_clusters);
if (have_clusters != need_clusters) {
DBG ("\tfirst cluster %08x have %d need %d\n", first_cluster, have_clusters, need_clusters);
if (have_clusters != need_clusters) {
cluster_t offset_clusters = (file->cluster_offset + bytes_per_cluster) / bytes_per_cluster;
cluster_t extra_clusters = need_clusters - offset_clusters;
cluster_t next_cluster;
cluster_t offset_clusters = (file->cluster_offset + bytes_per_cluster) / bytes_per_cluster;
cluster_t extra_clusters = need_clusters - offset_clusters;
cluster_t next_cluster;
putchar (dirent.attr & ao_fat_attr[i].bit ? ao_fat_attr[i].label : ' ');
printf (" @%08x %d\n", dirent.cluster, dirent.size);
}
putchar (dirent.attr & ao_fat_attr[i].bit ? ao_fat_attr[i].label : ' ');
printf (" @%08x %d\n", dirent.cluster, dirent.size);
}
fd = ao_fat_open(name, AO_FAT_OPEN_READ);
if (fd < 0) {
printf ("Open failed: %d\n", fd);
fd = ao_fat_open(name, AO_FAT_OPEN_READ);
if (fd < 0) {
printf ("Open failed: %d\n", fd);