fsGUI_new.c
上传用户:poi891205
上传日期:2013-07-15
资源大小:9745k
文件大小:29k
源码类别:

DVD

开发平台:

C/C++

  1. /**************************************************************
  2. ** FILE
  3. ** fsGUI_new.c
  4. **
  5. ** DESCRIPTION
  6. ** On the base of fsGUI1.c, build a new GUI for MP3/JPEG/GAME.
  7. **
  8. **
  9. **   Creator:   zhaoyanhua
  10. **   Date:     3-7-10 13:24
  11. ****************************************************************/
  12. #include "global.h"
  13. #include "func.h"
  14. #include "memmap.h"
  15. #include "util.h"
  16. #include "graph.h"
  17. #include "memcfg.h"
  18. #include "framebuf.h"
  19. #include "macro.h"
  20. #include "stc.h"
  21. #include "cfont.h"
  22. #include "vfdfunc.h"
  23. #include "osd.h"
  24. #include "image.h"
  25. #include "nesinit.h"
  26. #include "fs96602.h"
  27. #include "fsNAV.h"
  28. #include "fsGUI.h"
  29. #include "fsGUI1.h"
  30. //#include "user_if.h"
  31. //zhaoyanhua add 3-7-25 15:08
  32. #include "fsGUI1.h"
  33. //#include "fsGUI_new.h"
  34. #ifdef JPG_EFFECT
  35. #include "jpegeffect.h"
  36. #endif
  37. #include "fsGUIX.h"
  38. //extern const UINT8 pic_cd_str[17];//terry,2004/1/8 06:25PM
  39. #ifdef FAT_FILE_MODE//liweihua 2004-10-25 20:15
  40. extern FSJPEGDATA  *pFsJpegbuf;
  41. extern UINT32 iso9660buf;
  42. #endif
  43. #ifdef IDE_CF_SW
  44. extern UINT8 max_part;
  45. #endif//#ifdef IDE_CF_SW
  46. #ifdef CARD_SETUP_TYPE_5
  47.   extern UINT8 PMP_CF_Card_Insert;
  48. #endif
  49. #ifdef FILE_MODE_WRITE
  50. extern BYTE  *mediaStr[];
  51. extern BYTE  srceType_flag;
  52. extern FSJPEGDATA  *pFsJpeg_des_buf; 
  53. extern UINT32 iso9660buf_src;
  54. extern UINT32 iso9660buf_des;
  55. void Draw_File_Mode_Button(void);
  56. #endif
  57. /*
  58.  * FUNC: draw slot.
  59.  */
  60. void DrawScroll(void)
  61. {
  62.     int  x, y, xSize, ySize;
  63.     x = fsArea[FS_AREA_SLOT].xStart;
  64.     y = fsArea[FS_AREA_SLOT].yStart;
  65.     xSize = fsArea[FS_AREA_SLOT].xSize;
  66.     ySize = fsArea[FS_AREA_SLOT].ySize;
  67.     FSGUI_FillFrameBuf(x, y+ARROW_SIZE, xSize, ySize-2*ARROW_SIZE, WHITE_Y-0x05, WHITE_CRCB);//terry,2004/1/30 06:54PM
  68.     /*
  69.     FSGUI_FillFrameBuf(x, y, xSize, 1, BLACK_Y, BLACK_CRCB);//top
  70.     FSGUI_FillFrameBuf(x, y, 1, ySize, WHITE_Y, WHITE_CRCB);//left
  71.     FSGUI_FillFrameBuf(x + xSize - 1, y + 1, 1, ySize - 1, WHITE_Y, WHITE_CRCB);//right
  72.     FSGUI_FillFrameBuf(x + 1, y + ySize - 1, xSize - 1, 1 ,WHITE_Y, WHITE_CRCB);//bottom
  73.     */
  74. }
  75. void MoveScroll(UINT16 locate)
  76. {
  77. int y;
  78. DrawScroll();
  79. //draw up and down arrow.
  80. DrawArrow(fsArea[FS_AREA_MOVEBAR].xStart,fsArea[FS_AREA_MOVEBAR].yStart-ARROW_SIZE,2);
  81. DrawArrow(fsArea[FS_AREA_MOVEBAR].xStart,fsArea[FS_AREA_MOVEBAR].yStart +fsArea[FS_AREA_MOVEBAR].ySize,1);
  82. if ((fsArea[FS_AREA_MOVEBAR].ySize - pFsJpeg->scroll_len) >= (pFsJpeg->file_specify_in_dir - 1))
  83. y = fsArea[FS_AREA_MOVEBAR].yStart + locate * pFsJpeg->scroll_step;
  84. else
  85. y = fsArea[FS_AREA_MOVEBAR].yStart + locate * pFsJpeg->scroll_step / 10;
  86. DrawRect(fsArea[FS_AREA_MOVEBAR].xStart, y, fsArea[FS_AREA_MOVEBAR].xSize, pFsJpeg->scroll_len, 0,
  87. YELLOW_Y, YELLOW_CRCB);
  88. //return;//tw 20040201
  89. }
  90. void SelectHL()
  91. {
  92.     int iFiles;
  93. #ifdef MP3_DIRECT_SELECT
  94.     iFiles = pFsJpeg->count_file[pFsJpeg->gifsFuncBtn - FS_FUNC_MP3];
  95. #else
  96.     iFiles = pFsJpeg->file_specify_in_dir;
  97. #endif
  98. // 2004/04/20 yltseng, to make HL wider for Chinse Font and Joliet
  99. #if defined (SUPPORT_CHINESE_FONT) || defined (SUPPORT_JOLIET_FORMAT)
  100.     HL_Width = 116;
  101. #else
  102.     if (iFiles>999)
  103.         HL_Width = 116;
  104.     else if (iFiles>99)
  105.         HL_Width = 108;
  106.     else
  107.         HL_Width = 100;
  108. #endif
  109. //ShowHL();//move to the last of SelectHL() zhaoyanhua  2004-2-2 17:13
  110. #ifdef MP3_TXT_DISPLAY //zhaoyanhua add 2003-9-2 9:40
  111. if ( ( (JPEG_Preview_drawed == DIR_LIST_IN_DIR_AREA)
  112.      &&(pFsJpeg->gifsFuncBtn != FS_FUNC_MP3) )
  113.   || ( (MP3_Lyrics_Drawed == DIR_LIST_IN_DIR_AREA)
  114.      &&(pFsJpeg->gifsFuncBtn == FS_FUNC_MP3)))//zhaoyanhua modify 2003-8-28 13:29
  115. #else
  116.     //to avoid the bug : when play JPEG, BUTTON->FILE  (RIGHT) or(UP) ,not draw DIR playing again.
  117.     //zhaoyanhua modify 2003-12-27 11:10
  118.     if ( ((JPEG_Preview_drawed == DIR_LIST_IN_DIR_AREA) &&(!(pFsJpeg->gifsbPreview))
  119.        &&(pFsJpeg->gifsFuncBtn == FS_FUNC_JPEG))//for JPEG 
  120.       ||((JPEG_Preview_drawed == DIR_LIST_IN_DIR_AREA) && (pFsJpeg->gifsFuncBtn != FS_FUNC_JPEG))//for MP3/OTHER 
  121.        )
  122. #endif
  123. ShowCurrentDirPlaying();
  124. ShowCurrentFilePlaying();
  125. ShowHL();//zhaoyanhua move here 2004-2-2 17:13
  126. }
  127. void ShowHL(void)
  128. {
  129. #ifdef AUDIO_SHOW_SAVER
  130.     if (bDisableGUI) return;
  131.     #endif
  132.     #if defined(FAT_FILE_MODE)||defined(FILE_MODE_WRITE)
  133.     UINT32 addr1,addr2;
  134.     BYTE j;
  135.     #endif
  136. // clear last HL
  137. switch (old_ControlArea)
  138. {
  139. case  CNT_AREA_FILE:
  140. //zhaoyanhua add 2004-2-2 16:54
  141. //make some changes for the GUI not blink .
  142. if(HL_show == fsnav_file_HL)
  143. ShowCurrentFilePlaying();
  144. else
  145. {
  146. ClearRectArea(Rect[FILE_RECT], FILE_STEP, FILE_AREA_BKGROUND_CRCB,FS_AREA_FILEITEM, HL_show);
  147. FSShowFileItem(HL_show, iso9660_file[pFsJpeg->file_array[HL_show]].name);//resume the last HL
  148. }
  149. break;
  150. case  CNT_AREA_DIR:
  151. //zhaoyanhua add 2004-2-2 16:54
  152. //make some changes for the GUI not blink .
  153. if(HL_show == fsnav_dir_HL)
  154. ShowCurrentDirPlaying();
  155. else
  156. {
  157. ClearRectArea(Rect[DIR_RECT], DIR_STEP, DIR_AREA_BKGROUND_CRCB, FS_AREA_DIRITEM, HL_show);
  158. ShowDirItem(HL_show,iso9660_dir[pFsJpeg->dir_array[HL_show]].name);//resume the last HL
  159. }
  160. break;
  161. case  CNT_AREA_MP3BUTTON:
  162. {
  163. DrawRect(fsArea[FS_AREA_BUTTON].xStart, fsArea[FS_AREA_BUTTON].yStart,
  164. 25, 25,
  165.                         pFsJpeg->gifsFuncBtn == FS_FUNC_MP3 ? 1 : 0, BK_GROUNDY, BK_GROUNDCRCB);
  166. DrawFileIcon(fsArea[FS_AREA_BUTTON].xStart + 6, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_MP3BUTTON - 2);
  167. }
  168. break;
  169. case  CNT_AREA_JPEGBUTTON:
  170. {
  171.                     //FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart + 3+ 27-1, fsArea[FS_AREA_BUTTON].yStart + 3, 24,24, BK_GROUNDY,BK_GROUNDCRCB);
  172. DrawRect(fsArea[FS_AREA_BUTTON].xStart+27, fsArea[FS_AREA_BUTTON].yStart,
  173. 25, 25,
  174.                         pFsJpeg->gifsFuncBtn == FS_FUNC_JPEG ? 1 : 0, BK_GROUNDY, BK_GROUNDCRCB);
  175. DrawFileIcon(fsArea[FS_AREA_BUTTON].xStart + 33, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_JPEGBUTTON - 2);
  176. }
  177. break;
  178. #ifdef SUPPORT_NESGAME
  179. case  CNT_AREA_GAMEBUTTON:
  180. {
  181. DrawRect(fsArea[FS_AREA_BUTTON].xStart+54, fsArea[FS_AREA_BUTTON].yStart,
  182. 25, 25,
  183.                         pFsJpeg->gifsFuncBtn == FS_FUNC_GAME ? 1 : 0, BK_GROUNDY, BK_GROUNDCRCB);
  184. DrawFileIcon(fsArea[FS_AREA_BUTTON].xStart + 60, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_GAMEBUTTON - 2);
  185. }
  186. break;
  187. #endif
  188. #ifdef SUPPORT_FILE_SYSTEM_MODE
  189. case  CNT_AREA_OTHERBUTTON:
  190.   {
  191. #ifdef SUPPORT_NESGAME
  192.                     //FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart + 3+81, fsArea[FS_AREA_BUTTON].yStart + 3, 19,19, BK_GROUNDY,BK_GROUNDCRCB);
  193. DrawRect(fsArea[FS_AREA_BUTTON].xStart+81, fsArea[FS_AREA_BUTTON].yStart,
  194. 25, 25,
  195.                         pFsJpeg->gifsFuncBtn == FS_FUNC_GAME ? 1 : 0, BK_GROUNDY, BK_GROUNDCRCB);
  196. DrawFileIcon(fsArea[FS_AREA_BUTTON].xStart + 87, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_OTHERBUTTON - 2);
  197. #else
  198. DrawRect(fsArea[FS_AREA_BUTTON].xStart+54, fsArea[FS_AREA_BUTTON].yStart,
  199. 25, 25,
  200.                         pFsJpeg->gifsFuncBtn == FS_FUNC_OTHER ? 1 : 0, BK_GROUNDY, BK_GROUNDCRCB);
  201. DrawFileIcon(fsArea[FS_AREA_BUTTON].xStart + 60, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_OTHERBUTTON - 2);
  202. #endif
  203.  }
  204. break;
  205. #endif
  206. #ifdef SUPPORT_MIDI
  207. case  CNT_AREA_MIDIBUTTON:
  208. {
  209. #ifdef SUPPORT_FILE_SYSTEM_MODE
  210. #ifdef SUPPORT_NESGAME
  211.             DrawRect(fsArea[FS_AREA_BUTTON].xStart+108, fsArea[FS_AREA_BUTTON].yStart,
  212. 25, 25,
  213.                         pFsJpeg->gifsFuncBtn == FS_FUNC_MIDI ? 1 : 0, BK_GROUNDY, BK_GROUNDCRCB);
  214.             //FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart + 3+108, fsArea[FS_AREA_BUTTON].yStart + 3, 19,19, BK_GROUNDY,BK_GROUNDCRCB);
  215. DrawFileIcon(fsArea[FS_AREA_BUTTON].xStart + 114, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_MIDIBUTTON - 2);
  216. #else //SUPPORT_NESGAME
  217.             DrawRect(fsArea[FS_AREA_BUTTON].xStart+81, fsArea[FS_AREA_BUTTON].yStart,
  218. 25, 25,
  219.                         pFsJpeg->gifsFuncBtn == FS_FUNC_MIDI ? 1 : 0, BK_GROUNDY, BK_GROUNDCRCB);
  220. DrawFileIcon(fsArea[FS_AREA_BUTTON].xStart + 87, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_MIDIBUTTON - 2);
  221. #endif //SUPPORT_NESGAME
  222. #else //SUPPORT_FILE_SYSTEM_MODE
  223. #ifdef SUPPORT_NESGAME
  224.            DrawRect(fsArea[FS_AREA_BUTTON].xStart+81, fsArea[FS_AREA_BUTTON].yStart,
  225. 25, 25,
  226.                         pFsJpeg->gifsFuncBtn == FS_FUNC_MIDI ? 1 : 0, BK_GROUNDY, BK_GROUNDCRCB);
  227. DrawFileIcon(fsArea[FS_AREA_BUTTON].xStart + 87, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_MIDIBUTTON - 2);
  228. #else //SUPPORT_NESGAME
  229.             DrawRect(fsArea[FS_AREA_BUTTON].xStart+54, fsArea[FS_AREA_BUTTON].yStart,
  230. 25, 25,
  231.                         pFsJpeg->gifsFuncBtn == FS_FUNC_MIDI ? 1 : 0, BK_GROUNDY, BK_GROUNDCRCB);
  232. DrawFileIcon(fsArea[FS_AREA_BUTTON].xStart + 60, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_MIDIBUTTON - 2);
  233. #endif //SUPPORT_NESGAME
  234. #endif //SUPPORT_FILE_SYSTEM_MODE
  235. }
  236. break;
  237. #endif
  238. #ifdef SUPPORT_MULTI_PARTITION
  239.         case CNT_AREA_MULTI_PART:
  240.             if(pFsJpeg->gifsState == FS_STATE_HDD)
  241.             {
  242.                 if(HL_show == pFsJpeg->part_will)
  243.                 {
  244.                     ShowCurrentMultiPart();
  245.                 }
  246.                 else
  247.                 {
  248.                     ClearRectArea(Rect[6], DIR_STEP, DIR_AREA_BKGROUND_CRCB, FS_AREA_DIRITEM, HL_show);
  249.                     if((HL_show == max_part)&&PMP_CF_Card_IsPlugIn())//liweihua mod 2004-11-30
  250.                        ShowHDDItem(fsArea[FS_AREA_DIRITEM].xStart,HL_show, "CF CARD",0);
  251.                     else
  252.                        ShowHDDItem(fsArea[FS_AREA_DIRITEM].xStart,HL_show, "LOCAL DISK",0);
  253.                 }        
  254.             } 
  255.             #ifdef PMP_UI //liweihua 2004-12-30 9:55      
  256.             else if(pFsJpeg->gifsState == FS_STATE_INIT)
  257.             {
  258.                 ClearRectArea(Rect[6], DIR_STEP, DIR_AREA_BKGROUND_CRCB, FS_AREA_DIRITEM, HL_show);
  259.                 ShowItemHL(HL_show);
  260.             }
  261.             #endif
  262.             break;
  263.     #ifdef FAT_FILE_MODE//liweihua 2004-10-10 22:10
  264.         case CNT_AREA_DISK:
  265.                 {
  266.                     addr1 = pFsJpeg;
  267.                     addr2 = _fs9660_buf;
  268.                     pFsJpeg = &(share_data.JPEG);
  269.                     _fs9660_buf = SDRAM_BASE + HD_FS_STRUCTURE_YA * 1024;
  270.                     ClearRectArea(Rect[FS_AREA_DIRITEM], DIR_STEP, DIR_AREA_BKGROUND_CRCB, FS_AREA_DIRITEM, HL_show);
  271.                     //draw the selected rec,liweihua add 2004-11-17
  272.                     if(((HL_show == pFsJpeg->part_current-1)&&(pFsJpeg->gifsState == FS_STATE_HDD))
  273.                         ||((HL_show == pFsJpeg->file_current_in_page)&&(pFsJpeg->gifsState != FS_STATE_HDD))
  274.                         )
  275.                         ShowPlayFrame(fsArea[FS_AREA_DIRITEM].xStart-2,fsArea[FS_AREA_DIRITEM].yStart + 16*HL_show,78,14);
  276.                     if(pFsJpeg->gifsState == FS_STATE_HDD)
  277.                         ShowHDDItem(fsArea[FS_AREA_DIRITEM].xStart,HL_show, "DISK",0);
  278.                     else
  279.                         ShowItem(HL_show);
  280.                     pFsJpeg = addr1;
  281.                     _fs9660_buf = addr2;
  282.                 }
  283.              break;
  284.         case CNT_AREA_CARD:
  285.                 {
  286.                     BYTE width;
  287.                     addr1 = pFsJpeg;
  288.                     addr2 = _fs9660_buf;
  289.                     pFsJpeg = pFsJpegbuf;
  290.                     _fs9660_buf = iso9660buf;
  291.                     if(pFsJpeg->gifsState == FS_STATE_HDD)//liweihua mod 2004-11-30
  292.                      width = 94;
  293.                     else
  294.                      width = 78;
  295.                     ClearRectArea(Rect[FILE_RECT], FILE_STEP, FILE_AREA_BKGROUND_CRCB,FS_AREA_FILEITEM, HL_show);
  296.                     //draw the selected rec,liweihua add 2004-11-17
  297.                     if(((HL_show == pFsJpeg->part_current)&&(pFsJpeg->gifsState == FS_STATE_HDD))
  298.                         ||((HL_show == pFsJpeg->file_current_in_page)&&(pFsJpeg->gifsState != FS_STATE_HDD))
  299.                         )
  300.                         ShowPlayFrame(fsArea[FS_AREA_FILEITEM].xStart-2,fsArea[FS_AREA_FILEITEM].yStart + 16*HL_show,width,14);
  301.                     if(pFsJpeg->gifsState == FS_STATE_HDD)
  302.                         ShowCardItem(HL_show,"CF CARD",0);
  303.                     else
  304.                         ShowItem(HL_show);
  305.                     pFsJpeg = addr1;
  306.                     _fs9660_buf = addr2;                    
  307.                 }
  308.              break;
  309.         case CNT_AREA_WARNING:
  310.                 {
  311.                     ClearRectArea(Rect[FS_AREA_DIRITEM], DIR_STEP, DIR_AREA_BKGROUND_CRCB, FS_AREA_DIRITEM, HL_show);
  312.                     ShowWarning("TESTTEST");
  313.                 }
  314.              break;
  315.     
  316.     #endif//#ifdef FAT_FILE_MODE
  317. #endif
  318. #ifdef FILE_MODE_WRITE     //sunzhh 2005-01-06
  319.         case CNT_AREA_SRCE:
  320.                 {
  321.                     int j;
  322.                     addr1 = pFsJpeg;
  323.                     addr2 = _fs9660_buf;
  324.                     pFsJpeg = &(share_data.JPEG);                    
  325.                     _fs9660_buf = SDRAM_BASE + FS9660YA * 1024;
  326.                     if(pFsJpeg->gifsState == FS_STATE_MEDIA)
  327.                         j = 1;
  328.                     else
  329.                         j = 0;
  330.                     ClearRectArea(Rect[FS_AREA_DIRITEM], DIR_STEP, DIR_AREA_BKGROUND_CRCB, FS_AREA_DIRITEM, HL_show-j);                            
  331.                     if(((HL_show == pFsJpeg->media_current)&&(pFsJpeg->gifsState == FS_STATE_MEDIA))
  332.                     ||((HL_show == pFsJpeg->file_current_in_page)&&(pFsJpeg->gifsState != FS_STATE_MEDIA))
  333.                     )
  334.                         ShowPlayFrame(fsArea[FS_AREA_DIRITEM].xStart-2,fsArea[FS_AREA_DIRITEM].yStart + 16*(HL_show-j),94,14);                                                                         
  335.                     if(pFsJpeg->gifsState == FS_STATE_MEDIA)
  336.                             FSGUI_ShowString( FS_DIRLIST_XSTART,(FS_DIRLIST_YSTART+ FS_FILELIST_YSTEP * (HL_show-1) ), mediaStr[HL_show], FS_FONTCOLOR_FILE_Y, FS_FONTCOLOR_FILE_CrCb);        
  337.                     else 
  338.                         ShowFileItem(FS_DIRLIST_XSTART, HL_show);  
  339. //                    FSShowFatIcon(fsArea[FS_AREA_DIRICON].xStart,HL_show-1); 
  340.                 }
  341.                 pFsJpeg = addr1;
  342.                 _fs9660_buf = addr2;                
  343.              break;
  344.         case CNT_AREA_DEST:
  345.                 {
  346.                     addr1 = pFsJpeg;
  347.                     addr2 = _fs9660_buf;
  348.                     pFsJpeg = pFsJpeg_des_buf;
  349.                     _fs9660_buf = iso9660buf_des;
  350.                     if((!srceType_flag)&&(pFsJpeg->gifsState == FS_STATE_MEDIA))
  351.                         j = 1;
  352.                     else if((srceType_flag == 1)&&(pFsJpeg->gifsState == FS_STATE_MEDIA))
  353.                         j = 2;                        
  354.                     else
  355.                         j = 0;          
  356.                     ClearRectArea(Rect[FILE_RECT], FILE_STEP, FILE_AREA_BKGROUND_CRCB,FS_AREA_FILEITEM, HL_show-j);
  357.                     if(((HL_show == pFsJpeg->media_current)&&(pFsJpeg->gifsState == FS_STATE_MEDIA))
  358.                     ||((HL_show == pFsJpeg->file_current_in_page)&&(pFsJpeg->gifsState != FS_STATE_MEDIA))
  359.                     )
  360.                         ShowPlayFrame(fsArea[FS_AREA_FILEITEM].xStart+2,fsArea[FS_AREA_FILEITEM].yStart + 16*(HL_show-j),94,14);                                                
  361.                     if(pFsJpeg->gifsState == FS_STATE_MEDIA)
  362.                         FSGUI_ShowString( fsArea[FS_AREA_FILEITEM].xStart+4,(FS_DIRLIST_YSTART+ FS_FILELIST_YSTEP * (HL_show-j) ), mediaStr[HL_show], FS_FONTCOLOR_FILE_Y, FS_FONTCOLOR_FILE_CrCb);        
  363. //                        FSShowFatIcon(FS_AREA_FILEICON,HL_show-j); 
  364.                     else 
  365.                         ShowFileItem( fsArea[FS_AREA_FILEITEM].xStart+4, HL_show);  
  366.                     pFsJpeg = addr1;
  367.                     _fs9660_buf = addr2;                    
  368.                 }
  369.              break;
  370. case  CNT_AREA_COPYBUTTON:
  371. case  CNT_AREA_DELETEBUTTON:
  372. case  CNT_AREA_NEWBUTTON:
  373. case  CNT_AREA_RENAMEBUTTON:
  374. case  CNT_AREA_FORMATBUTTON:              
  375. case  CNT_AREA_CAPACITYBUTTON:
  376.             Draw_File_Mode_Button();
  377. break;
  378.              
  379. #endif
  380. default: break;
  381.    }
  382. // draw current HL
  383. switch (pFsJpeg->ControlArea)
  384. {
  385. case  CNT_AREA_FILE:
  386. {
  387. HL_show = pFsJpeg->file_will;
  388. old_ControlArea = CNT_AREA_FILE;
  389. FSGUI_FillFrameBuf(fsArea[FS_AREA_FILEITEM].xStart - 2, FS_DIRLIST_YSTART  + HL_show * FS_FILELIST_YSTEP, HL_Width, HL_Heighth, HL_Y, HL_CRCB);
  390. FSShowFileItem(HL_show , iso9660_file[pFsJpeg->file_array[HL_show]].name);//resume the last HL
  391.     /// NOTE:
  392.     // These code are put here ,for they will used by FSGUI_Refresh()/FSGUI_CmdLeft/FSGUI_CmdRight()
  393.     // if MP3_Lyrics_Drawed is 1,then show lyrics.
  394.     //zhaoyanhua add 2003-9-1 17:49
  395.     #ifdef MP3_TXT_DISPLAY
  396.                     ShowLyricsWhileHL();
  397.                     #endif   
  398. }
  399. break;
  400. case  CNT_AREA_DIR:
  401. {
  402. HL_show = pFsJpeg->dir_current;
  403. old_ControlArea = CNT_AREA_DIR;
  404. FSGUI_FillFrameBuf(fsArea[FS_AREA_DIRITEM].xStart - 2, FS_DIRLIST_YSTART  + HL_show * FS_FILELIST_YSTEP, HL_Width, HL_Heighth, HL_Y, HL_CRCB);
  405. ShowDirItem(HL_show,iso9660_dir[pFsJpeg->dir_array[HL_show]].name);//resume the last HL
  406. }
  407. break;
  408. case  CNT_AREA_MP3BUTTON:
  409. {
  410. old_ControlArea = CNT_AREA_MP3BUTTON;
  411. FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart , fsArea[FS_AREA_BUTTON].yStart , 25,25,HL_Y,HL_CRCB);
  412. DrawFileIcon(fsArea[FS_AREA_BUTTON].xStart + 6, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_MP3BUTTON - 2);
  413. }
  414. break;
  415. case  CNT_AREA_JPEGBUTTON:
  416. {
  417. old_ControlArea = CNT_AREA_JPEGBUTTON;
  418. FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart+27 , fsArea[FS_AREA_BUTTON].yStart , 25,25, HL_Y,HL_CRCB);
  419. DrawFileIcon(fsArea[FS_AREA_BUTTON].xStart + 33, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_JPEGBUTTON - 2);
  420. }
  421. break;
  422. #ifdef SUPPORT_NESGAME
  423. case  CNT_AREA_GAMEBUTTON:
  424. {
  425. old_ControlArea = CNT_AREA_GAMEBUTTON;
  426. FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart +54, fsArea[FS_AREA_BUTTON].yStart , 25,25,HL_Y,HL_CRCB);
  427. DrawFileIcon(fsArea[FS_AREA_BUTTON].xStart + 60, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_GAMEBUTTON - 2);
  428. }
  429. break;
  430. #endif
  431. #ifdef SUPPORT_FILE_SYSTEM_MODE
  432. case  CNT_AREA_OTHERBUTTON:
  433.   {
  434. old_ControlArea = CNT_AREA_OTHERBUTTON;
  435. #ifdef SUPPORT_NESGAME
  436. FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart +81, fsArea[FS_AREA_BUTTON].yStart , 25,25, HL_Y,HL_CRCB);
  437. DrawFileIcon(fsArea[FS_AREA_BUTTON].xStart + 87, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_OTHERBUTTON - 2);
  438. #else
  439. FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart +54, fsArea[FS_AREA_BUTTON].yStart , 25,25, HL_Y,HL_CRCB);
  440. DrawFileIcon(fsArea[FS_AREA_BUTTON].xStart + 60, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_OTHERBUTTON - 2);
  441. #endif
  442.  }
  443. break;
  444. #endif
  445. #ifdef SUPPORT_MIDI
  446. case  CNT_AREA_MIDIBUTTON:
  447. {
  448. old_ControlArea = CNT_AREA_MIDIBUTTON;
  449. #ifdef SUPPORT_FILE_SYSTEM_MODE
  450. #ifdef SUPPORT_NESGAME
  451.             FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart +108, fsArea[FS_AREA_BUTTON].yStart , 25,25, HL_Y,HL_CRCB);
  452. DrawFileIcon(fsArea[FS_AREA_BUTTON].xStart + 114, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_MIDIBUTTON - 2);
  453. #else //SUPPORT_NESGAME
  454.             FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart +81, fsArea[FS_AREA_BUTTON].yStart , 25,25, HL_Y,HL_CRCB);
  455. DrawFileIcon(fsArea[FS_AREA_BUTTON].xStart + 87, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_MIDIBUTTON - 2);
  456. #endif //SUPPORT_NESGAME
  457. #else //SUPPORT_FILE_SYSTEM_MODE
  458. #ifdef SUPPORT_NESGAME
  459.             FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart +81, fsArea[FS_AREA_BUTTON].yStart , 25,25, HL_Y,HL_CRCB);
  460. DrawFileIcon(fsArea[FS_AREA_BUTTON].xStart + 87, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_MIDIBUTTON - 2);
  461. #else //SUPPORT_NESGAME
  462.             FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart +54, fsArea[FS_AREA_BUTTON].yStart , 25,25, HL_Y,HL_CRCB);
  463. DrawFileIcon(fsArea[FS_AREA_BUTTON].xStart + 60, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_MIDIBUTTON - 2);
  464. #endif //SUPPORT_NESGAME
  465. #endif //SUPPORT_FILE_SYSTEM_MODE
  466. }
  467. break;
  468. #endif
  469. #ifdef SUPPORT_MULTI_PARTITION
  470.         case CNT_AREA_MULTI_PART:
  471.                 if(pFsJpeg->gifsState == FS_STATE_HDD)
  472.                 {
  473.                     HL_show = pFsJpeg->part_will;//liweihua mod 2004-11-30
  474.                     old_ControlArea = CNT_AREA_MULTI_PART;
  475.                     FSGUI_FillFrameBuf((fsArea[FS_AREA_DIRITEM].xStart - 2), (FS_DIRLIST_YSTART  + HL_show * FS_FILELIST_YSTEP), 118, 14, 0x9a, 0xbb2f);
  476.                     if((HL_show == max_part)&&PMP_CF_Card_IsPlugIn())//liweihua mod 2004-11-30
  477.                         ShowHDDItem(fsArea[FS_AREA_DIRITEM].xStart,HL_show, "CF CARD",0);
  478.                     else
  479.                         ShowHDDItem(fsArea[FS_AREA_DIRITEM].xStart,HL_show, "LOCAL DISK",0);
  480.                 }
  481.                 #ifdef PMP_UI//liweihua 2004-12-30 9:56
  482.                 else
  483.                 {
  484.                     HL_show = pFsJpeg->file_current_in_page;
  485.                     FSGUI_FillFrameBuf((fsArea[FS_AREA_DIRITEM].xStart - 2), (FS_DIRLIST_YSTART  + HL_show * FS_FILELIST_YSTEP), 98, 14, 0x9a,0xbb2f);//0xa1, 0xb266);
  486.                     ShowItemHL(HL_show);
  487.                 }
  488.                 #endif
  489.             break;
  490.     #ifdef FAT_FILE_MODE
  491.         case CNT_AREA_DISK:
  492.                 {
  493.                     addr1 = pFsJpeg;
  494.                     addr2 = _fs9660_buf;
  495.                     pFsJpeg = &(share_data.JPEG);
  496.                     _fs9660_buf = SDRAM_BASE + HD_FS_STRUCTURE_YA * 1024;
  497.                     if(pFsJpeg->gifsState == FS_STATE_HDD)
  498.                         HL_show = pFsJpeg->part_will;//liweihua mod 2004-11-30
  499.                     else
  500.                         HL_show = pFsJpeg->file_current_in_page;
  501.                     old_ControlArea = CNT_AREA_DISK;
  502.                     FSGUI_FillFrameBuf((fsArea[FS_AREA_DIRITEM].xStart - 2), (FS_DIRLIST_YSTART  + HL_show * FS_FILELIST_YSTEP), 78, 14, 0xa1, 0xb266);
  503.                     if(pFsJpeg->gifsState == FS_STATE_HDD)
  504.                         ShowHDDItem(fsArea[FS_AREA_DIRITEM].xStart,HL_show, "DISK",0);
  505.                     else
  506.                         ShowItem(HL_show);
  507.                     pFsJpeg = addr1;
  508.                     _fs9660_buf = addr2;
  509.                 }
  510.              break;
  511.         case CNT_AREA_CARD:
  512.                 {
  513.                     BYTE width;//liweihua 2004-11-30
  514.                     addr1 = pFsJpeg;
  515.                     addr2 = _fs9660_buf;
  516.                     pFsJpeg = pFsJpegbuf;
  517.                     _fs9660_buf = iso9660buf;
  518.                     if(pFsJpeg->gifsState == FS_STATE_HDD)
  519.                     {
  520.                     HL_show = pFsJpeg->part_current;
  521.                         width = 94;
  522.                     }
  523.                     else
  524.                     {
  525.                         HL_show = pFsJpeg->file_current_in_page;
  526.                         width = 78;
  527.                     }
  528.                     old_ControlArea = CNT_AREA_CARD;
  529.                     FSGUI_FillFrameBuf((fsArea[FS_AREA_FILEITEM].xStart - 2), (FS_DIRLIST_YSTART  + HL_show * FS_FILELIST_YSTEP), width, 14, 0xa1, 0xb266);
  530.                     if(pFsJpeg->gifsState == FS_STATE_HDD)
  531.                         ShowCardItem(HL_show,"CF CARD",0);
  532.                     else
  533.                         ShowItem(HL_show);
  534.                     pFsJpeg = addr1;
  535.                     _fs9660_buf = addr2; 
  536.                 }
  537.             break;
  538.         case CNT_AREA_WARNING:
  539.                 {
  540.                     HL_show = pFsJpeg->part_current;
  541.                     old_ControlArea = CNT_AREA_MULTI_PART;
  542.                     FSGUI_FillFrameBuf((fsArea[FS_AREA_DIRITEM].xStart - 2), (FS_DIRLIST_YSTART  + HL_show * FS_FILELIST_YSTEP), 118, 14, 0xa1, 0xb266);
  543.                 }
  544.              break;
  545.     
  546.     #endif//#ifdef FAT_FILE_MODE
  547. #endif//#ifdef SUPPORT_MULTI_PARTITION
  548. #ifdef FILE_MODE_WRITE                          //sunzhh 2005-01-06
  549.         case CNT_AREA_SRCE:
  550.                 {
  551.                     int j;
  552.                     addr1 = pFsJpeg;
  553.                     addr2 = _fs9660_buf;
  554.                     pFsJpeg = &(share_data.JPEG);                    
  555.                     _fs9660_buf = SDRAM_BASE + FS9660YA * 1024;
  556.                     if(pFsJpeg->gifsState == FS_STATE_MEDIA)
  557.                     {
  558.                         HL_show = pFsJpeg->media_will;
  559.                         j = 1;
  560.                     }
  561.                     else
  562.                     {
  563.                         HL_show = pFsJpeg->file_current_in_page;
  564.                         j = 0;
  565.                     }
  566.                     FSGUI_FillFrameBuf((fsArea[FS_AREA_DIRITEM].xStart - 2), (FS_DIRLIST_YSTART  + (HL_show-j) * FS_FILELIST_YSTEP), 94, 14, HL_Y,HL_CRCB);                        
  567.                     if(pFsJpeg->gifsState == FS_STATE_MEDIA)
  568.                         FSGUI_ShowString( FS_DIRLIST_XSTART,(FS_DIRLIST_YSTART+ FS_FILELIST_YSTEP * (HL_show-1) ), mediaStr[HL_show], FS_FONTCOLOR_FILE_Y, FS_FONTCOLOR_FILE_CrCb);        
  569.                     else
  570.                         ShowFileItem(FS_DIRLIST_XSTART, HL_show);
  571.                     old_ControlArea = CNT_AREA_SRCE;                                                
  572.                     pFsJpeg = addr1;
  573.                     _fs9660_buf = addr2;                     
  574.                     }
  575.              break;
  576.         case CNT_AREA_DEST:
  577.                 {
  578.                     addr1 = pFsJpeg;
  579.                     addr2 = _fs9660_buf;
  580.                     pFsJpeg = pFsJpeg_des_buf;
  581.                     _fs9660_buf = iso9660buf_des;
  582.                     if((!srceType_flag)&&(pFsJpeg->gifsState == FS_STATE_MEDIA))
  583.                         j = 1;
  584.                     else if((srceType_flag == 1)&&(pFsJpeg->gifsState == FS_STATE_MEDIA))
  585.                         j = 2;                       
  586.                     else
  587.                         j = 0;          
  588.                     if(pFsJpeg->gifsState == FS_STATE_MEDIA)
  589.                         HL_show = pFsJpeg->media_will;
  590.                     else
  591.                         HL_show = pFsJpeg->file_current_in_page;                        
  592.                         old_ControlArea = CNT_AREA_DEST;
  593.                         FSGUI_FillFrameBuf((fsArea[FS_AREA_FILEITEM].xStart + 2), (FS_DIRLIST_YSTART  + (HL_show-j) * FS_FILELIST_YSTEP), 94, 14, HL_Y,HL_CRCB);
  594.                     if(pFsJpeg->gifsState == FS_STATE_MEDIA)
  595.                     {
  596.                         FSGUI_ShowString( fsArea[FS_AREA_FILEITEM].xStart + 4,(FS_DIRLIST_YSTART+ FS_FILELIST_YSTEP * (HL_show-j) ), mediaStr[HL_show], FS_FONTCOLOR_FILE_Y, FS_FONTCOLOR_FILE_CrCb);        
  597. //                        FSShowFatIcon(fsArea[FS_AREA_FILEICON].xStart,HL_show-j); 
  598.                     }
  599.                     else
  600.                         ShowFileItem(fsArea[FS_AREA_FILEITEM].xStart + 4, HL_show);                
  601.                     pFsJpeg = addr1;
  602.                     _fs9660_buf = addr2;                     
  603.                 }
  604.              break;
  605. case  CNT_AREA_COPYBUTTON:
  606. {
  607. old_ControlArea = CNT_AREA_COPYBUTTON;
  608. FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart, fsArea[FS_AREA_BUTTON].yStart, 25,25,HL_Y,HL_CRCB);
  609.                     DrawFileIconX(fsArea[FS_AREA_BUTTON].xStart+6, fsArea[FS_AREA_BUTTON].yStart + 6, 2,0);     
  610. }
  611. break;
  612. case  CNT_AREA_DELETEBUTTON:
  613. {
  614. old_ControlArea = CNT_AREA_DELETEBUTTON;
  615. FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart+30, fsArea[FS_AREA_BUTTON].yStart, 25,25,HL_Y,HL_CRCB);
  616.                     DrawFileIconX(fsArea[FS_AREA_BUTTON].xStart + 30 +6, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_MP3BUTTON - 2,0);     
  617. }
  618. break;
  619. case  CNT_AREA_NEWBUTTON:
  620. {
  621. old_ControlArea = CNT_AREA_NEWBUTTON;
  622. FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart+60, fsArea[FS_AREA_BUTTON].yStart, 25,25,HL_Y,HL_CRCB);
  623.                     DrawFileIconX(fsArea[FS_AREA_BUTTON].xStart + 60 +6, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_MP3BUTTON - 2,0);     
  624. }
  625. break;
  626. case  CNT_AREA_RENAMEBUTTON:
  627. {
  628. old_ControlArea = CNT_AREA_RENAMEBUTTON;
  629. FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart+90, fsArea[FS_AREA_BUTTON].yStart, 25,25,HL_Y,HL_CRCB);
  630.                     DrawFileIconX(fsArea[FS_AREA_BUTTON].xStart + 90 +6, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_MP3BUTTON - 2,0);     
  631. }
  632. break;
  633. case  CNT_AREA_FORMATBUTTON:
  634. {
  635. old_ControlArea = CNT_AREA_FORMATBUTTON;
  636. FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart+120, fsArea[FS_AREA_BUTTON].yStart, 25,25,HL_Y,HL_CRCB);
  637.                     DrawFileIconX(fsArea[FS_AREA_BUTTON].xStart + 120 +6, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_MP3BUTTON - 2,0);     
  638. }
  639. break;              
  640. case  CNT_AREA_CAPACITYBUTTON:
  641. {
  642. old_ControlArea = CNT_AREA_CAPACITYBUTTON;
  643. FSGUI_FillFrameBuf(fsArea[FS_AREA_BUTTON].xStart+150, fsArea[FS_AREA_BUTTON].yStart, 25,25,HL_Y,HL_CRCB);
  644.                     DrawFileIconX(fsArea[FS_AREA_BUTTON].xStart + 150 +6, fsArea[FS_AREA_BUTTON].yStart + 6, CNT_AREA_MP3BUTTON - 2,0);     
  645. }
  646. break;
  647. #endif//#ifdef FILE_MODE_WRITE 
  648. default: break;
  649. }
  650. }