?? fatreadfile.c
字號:
#ifndef _FAT32_DEFINE
#include "FAT32.c"
#endif
WORD FAT32ReadFile(BYTE fp);
WORD FAT32ReadFile(BYTE fp)
{
register WORD tmp;
if (FCB[fp].ByteCnt==FCB[fp].Size) return(0);
else
{
FCB[fp].ByteCnt+=IDE.BytesPerSec;
if (FCB[fp].ByteCnt<=FCB[fp].Size) tmp=IDE.BytesPerSec;
else
{
FCB[fp].ByteCnt-=IDE.BytesPerSec;
tmp=FCB[fp].Size-FCB[fp].ByteCnt;
FCB[fp].ByteCnt=FCB[fp].Size;
}
if (FCB[fp].ClusSecCnt==FAT32.SecPerClus) //讀下一簇
{
FCB[fp].LastCluster=FAT32NextCluster(FCB[fp].LastCluster);
if (FCB[fp].LastCluster==0x0fffffff) return(0);
IDEReadSector(ClusterToSector(FCB[fp].LastCluster));
FCB[fp].ClusSecCnt=1;
}
else if (FCB[fp].ClusSecCnt==0) //讀第一簇
{
IDEReadSector(ClusterToSector(FCB[fp].LastCluster));
FCB[fp].ClusSecCnt++;
}
else //讀當前簇下一扇區(qū)
{
IDEReadSector(ClusterToSector(FCB[fp].LastCluster)+FCB[fp].ClusSecCnt);
FCB[fp].ClusSecCnt++;
}
}
return(tmp);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -