亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? fat.c

?? 8051實現的MP3播放程序,大家可以一起學習.
?? C
?? 第 1 頁 / 共 5 頁
字號:
    temp = (fat_is_fat16 == TRUE) ? cluster / 256 : cluster * 3 / 1024;
    if (temp != sector_number)
    {
      fat_update_fat_sector(sector_number);
      sector_number =  temp;
      fat_load_sector(fat_ptr_fats + sector_number);
    }
    if (fat_is_fat16 == TRUE)
    {
      i = (cluster * 2) & 0x1FF;
      ((Byte *)&cluster)[1] = fat_buf_sector[i];
      fat_buf_sector[i++] = 0;
      ((Byte *)&cluster)[0] = fat_buf_sector[i];
      fat_buf_sector[i] = 0;
      end = (cluster == 0xFFFF);
    }
    else
    {
      i = (cluster * 3 / 2) & 0x1FF;
      if ((cluster & 0x01) == 0)
      {
        ((Byte *)&cluster)[1] = fat_buf_sector[i];
        fat_buf_sector[i] = 0x00;
        i++;
        if (i == 512)
        {
          fat_update_fat_sector(sector_number);
          sector_number++;
          fat_load_sector(fat_ptr_fats + sector_number);
          i = 0;
        }
        ((Byte *)&cluster)[0] = fat_buf_sector[i] & 0x0F;
        fat_buf_sector[i] &= 0xF0;
      }
      else
      {
        cluster = (fat_buf_sector[i] & 0xF0) >> 4;
        fat_buf_sector[i] &=  0x0F;
        i++;
        if (i == 512)
        {
          fat_update_fat_sector(sector_number);
          sector_number++;
          fat_load_sector(fat_ptr_fats + sector_number);
          i = 0;
        }
        cluster += (fat_buf_sector[i] << 4);
        fat_buf_sector[i] = 0x00;
      }
      end = (cluster == 0xFFF);

    }

  }
  while (!end);
  fat_update_fat_sector(sector_number);
}
/*F**************************************************************************
* NAME: fat_refresh_dir_file_info
*----------------------------------------------------------------------------
* PARAMS:
*    
* return:
*   
*----------------------------------------------------------------------------
* PURPOSE:
*   Reconstruct the file directory list and seek to the file pointed by
*   fat_dir_list_index
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*   
*----------------------------------------------------------------------------
* REQUIREMENTS:
*   
*****************************************************************************/
void fat_refresh_dir_file_info (Byte id)
{
  /* update fat_dir_current_sect with directory starting value */
  if (dir_is_root)
  {
    fat_dir_current_sect = fat_ptr_rdir;                          
  }
  else
  {
    fat_dir_current_sect = (((Uint32)(dclusters[0].cluster)) * fat_cluster_size)
                           + fat_ptr_data;
  }

  fat_get_dir_file_list(id);                /* Refresh file list */
  fat_seek_entry_record();                  /* Re-fetch the entry <-> fat_dir_list_index */
  fat_get_dir_entry(&fat_cache.current);    /* update current file info */  
}
/*F**************************************************************************
* NAME: fat_fdelete
*----------------------------------------------------------------------------
* PARAMS:
*    
* return:
*   - DEL_RET_OK:           delete done & dir is not empty
*   - DEL_RET_NO_MORE_FILE: dir is empty after delete or not
*   - DEL_RET_ERROR_DIR:    dir can not be deleted
*----------------------------------------------------------------------------
* PURPOSE:
*   Delete a selected file, in the root directory or in a sub-dir
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*   fat_frefresh may be called after fdelete to rebuilt the dir content list
*----------------------------------------------------------------------------
* REQUIREMENTS:
*   File variables must be updated (fat_dclust_byte_count, entry record, ...)
*****************************************************************************/
Byte fat_fdelete (void)
{
Uint16 i;
Uint32 dir_sector; 

  if (((dir_is_root == TRUE) && (fat_dir_list_last == 0)) ||     
      ((dir_is_root == FALSE) && (fat_dir_list_last == 2)))      /* . and .. directory */
    return DEL_RET_NO_MORE_FILE;            /* directory already empty */

  if (fat_check_ext() != FILE_DIR)
  {
    fat_seek_entry_record();                /* Re-fetch the entry <-> fat_dir_list_index */
    Hard_read_close();

    dir_sector = fat_dir_current_sect;
    fat_root_entry = fat_dir_current_offs / 32; /* fat_dir_current_offs give the offset in byte starting */
    fat_file_size.l = fat_cache.current.size.l; /* at the beginning of directory */

    fat_load_sector(dir_sector);            /* Load directory sector  */
    i = (fat_root_entry % 16) * 32 ;        /* position of entry in the sector */
    while (fat_buf_sector[i + 11] == ATTR_LFN_ENTRY)
    {
      /* mark file as deleted */
      fat_buf_sector[i] = FILE_DELETED;
      i += 32;

      if (!dir_is_root)
        fat_dclust_byte_count += 32;

      if (i == SECTOR_SIZE)
      {
        Hard_write_open(dir_sector);
        for (i = 0; i < SECTOR_SIZE; i++)
          Hard_write_byte(fat_buf_sector[i]);
        Hard_write_close();

        if (!dir_is_root)                   /* sub-directory */
        {
          /* check if we are at the end of a cluster */
          if ((((Byte*)&fat_dclust_byte_count)[1] == 0x00) &&
            ((((Byte*)&fat_dclust_byte_count)[0] & fat_cluster_mask) == 0x00))
          {
            /* extract if necessary the next cluster from the allocation list */
            if (dclusters[fat_dchain_index].number == fat_dchain_nb_clust)
            { /* new fragment */
              fat_dchain_index++;
              fat_dchain_nb_clust = 1;
              dir_sector = (fat_ptr_data + ((Uint32)(dclusters[fat_dchain_index].cluster) * fat_cluster_size));
            }
            else
            {
              fat_dchain_nb_clust++;        /* one more cluster read */
              dir_sector++;                 /* Contiguous cluster    */
            }
          }
          else
          { /* Don't change the cluster */
            dir_sector++;
          }
        }
        else
        { /* Root directory is linear */
          dir_sector++;
        }
        fat_load_sector(dir_sector);
        i = 0;
      }
    }
    fat_buf_sector[i] = FILE_DELETED;
    Hard_write_open(dir_sector);
    for (i = 0; i < SECTOR_SIZE; i++)
      Hard_write_byte(fat_buf_sector[i]);
    Hard_write_close();

    /* FAT update */
    fat_fclust_byte_count = 0;              /* byte 0 of cluster */
    /* reset the allocation list variable */
    fat_fchain_index = 0;
    fat_fchain_nb_clust = 0;                /* start on first contiguous cl */
    /* get file allocation list */
    fat_get_clusters(&fclusters, MAX_FILE_FRAGMENT_NUMBER);
    /* Clear fat cluster */
    fat_clear_fat();
    /* NF correction */
    for (i = 0; i < 256; i++)
      gl_buffer[i] = 0x00;
    fat_dir_list_last--;                    /* one file deleted */

    if (((dir_is_root == TRUE) && (fat_dir_list_last == 0)) ||     
        ((dir_is_root == FALSE) && (fat_dir_list_last == 2)))      /* . and .. directory */
      return DEL_RET_NO_MORE_FILE;          /* directory now empty */

    if (fat_dir_list_index == fat_dir_list_last)
    {
      fat_dir_list_index--;                 /* in case of last file delete */
    }
    return DEL_RET_OK;
  }
  else
  {
    return DEL_RET_ERROR_DIR;
  }
}


/*F**************************************************************************
* NAME: fat_read_cluster12
*----------------------------------------------------------------------------
* PARAMS:
*   init : initialize the parity bit or not
* return:
*   FAT12 cluster value
*----------------------------------------------------------------------------
* PURPOSE:
*   Read in fat12 file system a cluster value   
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
Uint16 fat_read_cluster (bit init)
{
static bit fat12_parity;
static idata Uint16 cluster;

  if (fat_is_fat16)
  {
    ((Byte*)&cluster)[1] = Hard_read_byte();
    ((Byte*)&cluster)[0] = Hard_read_byte();
    return cluster;
  }

  if (init)
  {
    fat12_parity = 0;
    cluster = 0;
  }

  if (fat12_parity == 0)
  {
    ((Byte*)&cluster)[1] = Hard_read_byte();
    ((Byte*)&cluster)[0] = Hard_read_byte();
    fat12_parity = 1;
    return (cluster & 0x0FFF);
  }
  else
  {
    cluster = (cluster & 0xF000) >> 12;
    cluster += (Hard_read_byte() << 4);
    fat12_parity = 0;
    return (cluster);
  }
}



/*F**************************************************************************
* NAME: fat_set_clusters
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*   - OK: allocation done
*   - KO: allocation cannot be done : no free cluster
*----------------------------------------------------------------------------
* PURPOSE:
*   Prepare a list of the free clusters:
*     chain[n].cluster contains the starting cluster number of a fragment
*     chain[n].number contains the number of contiguous clusters in fragment
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*   Free cluster list is limited by the nb_frag parameter.
*   If memory is too much fragmented, created file may be limited in size.
*   Last list item always has single cluster
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
bit fat_set_clusters (void)
{
bit     cluster_free;
Uint16  cluster;

  cluster = 0;
  cluster_free = FALSE;
  fat_last_clust_index = 0;
  Hard_read_open(fat_ptr_fats);

  /* search the first free cluster in fat */
  fat_read_cluster(1);
  fat_read_cluster(0);
  do                                      /* search for first free cluster */
  {
    if (fat_read_cluster(0) == 0x0000)
      cluster_free = TRUE;
    else 
      cluster++;
  }
  while ((cluster != fat_count_of_clusters) && (!cluster_free));
   
  if (!cluster_free)
  {
    Hard_read_close();
    return KO;                                        /* no free cluster found */
  }

  fclusters[fat_last_clust_index].number = 1;  
  fclusters[fat_last_clust_index].cluster = cluster;                     /* store first cluster */
  cluster++;

  if (cluster != fat_count_of_clusters)
  {
    do                                                      /* construct the list */
    {
      cluster_free = FALSE;
      if (fat_read_cluster(0) == 0x0000)
        cluster_free = TRUE;
      else
        cluster++;

      if (cluster_free)                                     /* It's a contiguous cluster      */
      {                                                     /* add it to the list             */
        if (fclusters[fat_last_clust_index].number == MAX_CL_PER_FRAG) 
        {
          fat_last_clust_index++;
          if (fat_last_clust_index == MAX_FILE_FRAGMENT_NUMBER)
          {
            Hard_read_close();
            fat_last_clust_index--;
            return OK;
          }
          fclusters[fat_last_clust_index].number = 1;
          fclusters[fat_last_clust_index].cluster = cluster;
        }
        else
        {
          fclusters[fat_last_clust_index].number++;
        }
        cluster++;                                          /* process next cluster           */
      }
      else if (cluster != fat_count_of_clusters)
      {                                                     /* cluster is already used        */
        do                                                  /* search for next free fragment  */
        {
          if (fat_read_cluster(0) == 0x0000)
            cluster_free = TRUE;
          else
            cluster++;
        }
        while ((cluster != fat_count_of_clusters) && (!cluster_free));
    
        if (!cluster_free)                                  /* no more free cluster           */
        {
          Hard_read_close();
          return OK;                        /* end of partition reached */
        }
        
        fat_last_clust_index++;                              

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩精品乱码免费| 高清av一区二区| av动漫一区二区| 欧美成人a视频| 精品噜噜噜噜久久久久久久久试看| 亚洲欧洲精品一区二区三区不卡| 亚洲影院久久精品| 成人免费看的视频| 日韩免费视频线观看| 午夜视频在线观看一区二区| aaa国产一区| 欧美国产丝袜视频| 成人动漫中文字幕| 成人欧美一区二区三区视频网页| 精品一区二区三区在线播放 | 亚洲午夜免费电影| k8久久久一区二区三区| 中文字幕在线观看不卡| 91精品办公室少妇高潮对白| 亚洲欧美日韩系列| 91精品黄色片免费大全| 国产乱人伦偷精品视频不卡 | 亚洲乱码国产乱码精品精98午夜| 99久久综合国产精品| 亚洲国产另类精品专区| 精品久久国产97色综合| 国产乱理伦片在线观看夜一区| 成人欧美一区二区三区在线播放| 色综合 综合色| 玖玖九九国产精品| 亚洲欧美一区二区三区久本道91| 91麻豆精品国产91久久久更新时间| 久久超碰97中文字幕| 国产精品免费aⅴ片在线观看| 欧美日韩不卡一区| 成人一级片网址| 青青草国产精品97视觉盛宴| 美女脱光内衣内裤视频久久影院| 制服丝袜av成人在线看| 亚洲成av人影院在线观看网| 一区二区三区精品久久久| 成人免费电影视频| 久久99精品国产| 日韩成人一级大片| 亚洲不卡在线观看| 亚洲高清免费在线| 婷婷六月综合亚洲| 日本女优在线视频一区二区| 亚洲大尺度视频在线观看| 亚洲愉拍自拍另类高清精品| 一区二区三区日本| 亚洲国产综合人成综合网站| 亚洲v日本v欧美v久久精品| 五月天一区二区三区| 青青国产91久久久久久| 视频一区视频二区中文| 久久精品国产成人一区二区三区| 久久不见久久见中文字幕免费| 精品亚洲成a人在线观看| 风间由美中文字幕在线看视频国产欧美| 国产福利一区二区三区视频| av在线免费不卡| 91国内精品野花午夜精品| 欧美日本一区二区三区四区 | av成人免费在线观看| www.综合网.com| 色哟哟国产精品| 欧美一区二区三区四区视频| 精品国产91九色蝌蚪| 中文字幕在线观看一区二区| 香港成人在线视频| 久久av资源站| 99re热这里只有精品视频| 欧美日韩国产精品自在自线| 精品国产91洋老外米糕| 亚洲桃色在线一区| 日韩高清不卡一区| 高潮精品一区videoshd| 欧美色视频在线观看| 久久综合五月天婷婷伊人| 一区在线中文字幕| 免费观看在线综合| 国产成人免费视频一区| 欧美日韩第一区日日骚| 国产欧美综合在线观看第十页| 亚洲一区二区三区四区不卡| 国内成人精品2018免费看| 日本乱人伦一区| 精品成人佐山爱一区二区| 亚洲最色的网站| 国产乱人伦偷精品视频免下载| 日本高清不卡在线观看| 久久久精品综合| 亚洲福利视频导航| 国产+成+人+亚洲欧洲自线| 欧美三片在线视频观看| 国产夜色精品一区二区av| 亚洲mv在线观看| 成人av在线电影| 精品少妇一区二区三区在线播放| 亚洲视频每日更新| 韩国女主播一区二区三区| 欧美日韩午夜影院| 欧美国产一区在线| 免费xxxx性欧美18vr| 色婷婷国产精品久久包臀| 国产欧美久久久精品影院| 日韩av网站免费在线| 色婷婷av一区二区三区软件| 中文字幕免费不卡| 狠狠色伊人亚洲综合成人| 91麻豆精品国产自产在线观看一区| 成人免费在线观看入口| 国产成人精品网址| 2021久久国产精品不只是精品| 亚洲成a天堂v人片| 欧洲视频一区二区| 亚洲色图一区二区| zzijzzij亚洲日本少妇熟睡| 久久久久国产成人精品亚洲午夜| 蜜乳av一区二区| 欧美一区二区视频在线观看2020| 亚洲综合在线电影| 一本大道久久a久久精品综合 | 午夜精品一区二区三区三上悠亚 | 欧美va在线播放| 日韩黄色在线观看| 欧美精品三级在线观看| 亚洲综合图片区| 在线亚洲一区观看| 一区二区久久久久久| 91老师国产黑色丝袜在线| 国产精品传媒视频| 北岛玲一区二区三区四区| 国产精品视频免费| a美女胸又www黄视频久久| 中文字幕+乱码+中文字幕一区| 夫妻av一区二区| 1区2区3区精品视频| 色综合一区二区| 一区二区三区日韩精品视频| www国产成人免费观看视频 深夜成人网| 日韩不卡手机在线v区| 在线播放视频一区| 日韩国产精品久久久| 91精品国产综合久久久久久久久久 | 日韩视频在线永久播放| 久久伊人中文字幕| 亚洲国产精品一区二区www在线| 欧美日韩一区二区三区在线| 午夜精品久久久久久久99樱桃| 欧美美女视频在线观看| 五月激情丁香一区二区三区| 精品日韩成人av| 国产精品亚洲视频| 国产精品免费aⅴ片在线观看| 色天天综合色天天久久| 亚洲丰满少妇videoshd| 91精品国产欧美一区二区成人| 国内精品在线播放| 国产精品第五页| 欧美日韩国产高清一区二区| 日韩av二区在线播放| 久久精品一区蜜桃臀影院| 91影院在线观看| 天天影视涩香欲综合网| 久久综合999| 色婷婷精品久久二区二区蜜臂av | 91免费在线视频观看| 香蕉成人啪国产精品视频综合网 | 国产成人综合亚洲网站| 国产精品素人视频| 欧美午夜影院一区| 国内外成人在线视频| 亚洲女同ⅹxx女同tv| 欧美一区二区三区四区五区| 国产成人综合亚洲网站| 国产精品乱码久久久久久| 美女视频一区在线观看| 精品入口麻豆88视频| 成人性视频网站| 亚洲午夜久久久久久久久电影网 | 成人久久18免费网站麻豆| 亚洲成人在线免费| 26uuu欧美日本| 欧美三片在线视频观看| 国产高清在线观看免费不卡| 亚洲成人av一区| 国产精品久久久久桃色tv| 欧美一级高清片| 色婷婷综合在线| 懂色中文一区二区在线播放| 日韩av一区二区三区四区| 亚洲色图欧美偷拍| 久久女同精品一区二区| 欧美日本精品一区二区三区| av在线不卡免费看| 国产麻豆成人精品| 日韩va欧美va亚洲va久久| 亚洲精品大片www|