⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 res_show.lst

📁 智原mp3 SDK 开发包 与巨力 有mp3 wma ogg decoder
💻 LST
字号:
C51 COMPILER V7.50   RES_SHOW                                                              08/18/2008 13:43:40 PAGE 1   


C51 COMPILER V7.50, COMPILATION OF MODULE RES_SHOW
OBJECT MODULE PLACED IN ..\output\output_bin\output_mp3\res_show.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE ..\..\code\common\res_show.c LARGE OPTIMIZE(9,SIZE) BROWSE INCDIR(..\..\..\
                    -bsp\include;..\..\code\ap_mp3\src\include;..\..\code\global;..\..\code\include) DEFINE(CONFIG_ASIC,dynamic_load) DEBUG O
                    -BJECTEXTEND PRINT(..\output\output_bin\output_mp3\res_show.lst) OBJECT(..\output\output_bin\output_mp3\res_show.obj)

line level    source

   1          #include <string.h>
   2          #include "api.h"
   3          #include "lcd.h"
   4          #include "key.h"
   5          #include "common.h"
   6          #include "res_show.h"
   7          #include "prefer.h"
   8          
   9          
  10          #define IMAGE_OFFSET 268224L
  11          
  12          RES_ENTRY_T res_entry; 
  13          extern UINT16 pixel_buf[];
  14          extern void delay(UINT16 n);
  15          INT8U res_buf[50];
  16          
  17          BOOLEAN  bResShowPic(INT16U id,INT8U x,INT8U y)
  18          {
  19   1              INT16U width,high,length;
  20   1              INT16U count;
  21   1              UINT16 pitch;   
  22   1              INT8U buf1[32];         
  23   1              
  24   1              api_bSectionFileOpen(SYS_IMAGE_FILEID);
  25   1              api_bSectionFileSeek(id * sizeof(RES_ENTRY_T)+IMAGE_OFFSET, SEEK_SET);           
  26   1              api_u16SectionFileRead(buf1, sizeof(RES_ENTRY_T));
  27   1              res_entry.u32Offset = (INT32U)buf1[0] | ((INT32U)buf1[1]<<8) | ((INT32U)buf1[2]<<16) | ((INT32U)buf1[3]<<
             -24); 
  28   1              api_bSectionFileSeek(res_entry.u32Offset+IMAGE_OFFSET, SEEK_SET);               
  29   1              api_u16SectionFileRead(buf1,4);         
  30   1              width = buf1[0] | (buf1[1]<<8);
  31   1              high = buf1[2] | (buf1[3]<<8);  
  32   1                      
  33   1              lcd_set_disply_mode(0x00,0x22);
  34   1              
  35   1              lcd_set_rw_area(x,y,(INT8U)width,(INT8U)high);
  36   1              pitch = (UINT16)width*4;
  37   1              
  38   1              length = width * high*2;
  39   1              
  40   1              if(length<512)
  41   1              {
  42   2                      api_u16SectionFileRead(pixel_buf,length);
  43   2                      lcd_put_data((UINT16)pixel_buf,length);
  44   2              }
  45   1              else
  46   1              {
  47   2                      count = length/512;
  48   2                      while(count--)
  49   2                      {
  50   3                              api_u16SectionFileRead(pixel_buf,512);
  51   3                              lcd_put_data((UINT16)pixel_buf,512);
  52   3                      }
C51 COMPILER V7.50   RES_SHOW                                                              08/18/2008 13:43:40 PAGE 2   

  53   2                      pitch = length%512;
  54   2                      api_u16SectionFileRead(pixel_buf,pitch);
  55   2                      lcd_put_data((UINT16)pixel_buf,pitch);                  
  56   2              }
  57   1              return TRUE;    
  58   1      }
  59                  
  60          
  61          int ResShowMultiString(INT16U id, INT8U string_id, INT8U x, INT8U y)
  62          {
  63   1              INT8U *p,AddBuf;
  64   1              INT8U StrLength,string_idtemp;  
  65   1              api_bSectionFileOpen(SYS_IMAGE_FILEID);
  66   1              api_bSectionFileSeek(id * sizeof(RES_ENTRY_T)+IMAGE_OFFSET, SEEK_SET);
  67   1              api_u16SectionFileRead(res_buf, sizeof(RES_ENTRY_T));
  68   1              res_entry.u32Offset = (INT32U)res_buf[0] | ((INT32U)res_buf[1]<<8) | ((INT32U)res_buf[2]<<16) | ((INT
             -32U)res_buf[3]<<24);
  69   1              res_entry.u16Length = res_buf[4] | (res_buf[5]<<8);     
  70   1              api_bSectionFileSeek(res_entry.u32Offset+IMAGE_OFFSET, SEEK_SET);
  71   1              api_u16SectionFileRead(res_buf,50);
  72   1      
  73   1              //定位到 string_id
  74   1              p = res_buf;
  75   1              string_idtemp=string_id;
  76   1              
  77   1              while(string_id)
  78   1              {
  79   2                      
  80   2                      AddBuf=1;
  81   2                      while(*p!=0)
  82   2                      {
  83   3                              AddBuf++;    //找到第string_id 个0
  84   3                              p++;
  85   3                      }
  86   2                      string_id--;
  87   2                      res_entry.u32Offset += AddBuf;
  88   2                      api_bSectionFileSeek(res_entry.u32Offset+IMAGE_OFFSET, SEEK_SET);
  89   2                      api_u16SectionFileRead(res_buf,50);
  90   2                      p = res_buf;
  91   2                      
  92   2              }
  93   1              
  94   1              string_id=string_idtemp;
  95   1                              
  96   1              StrLength=(INT8U)strlen(p);
  97   1              
  98   1              if(x == 255)    //居中显示
  99   1              {
 100   2                      if(tUserPreference.u8LanguageId==0)
 101   2                              lcd_puts((128-(INT8U)strlen(p)*8)/2,y,p,FONTSIZE_HYPER);
 102   2                      if(tUserPreference.u8LanguageId>4)
 103   2                              lcd_puts((128-(INT8U)strlen(p)*8)/2,y,p,FONTSIZE_8x8);
 104   2                      else
 105   2                              lcd_puts((128-(INT8U)strlen(p)*8)/2,y,p,FONTSIZE_HYPER);                                                                
 106   2              }
 107   1              else
 108   1              {
 109   2                      if(tUserPreference.u8LanguageId==0)
 110   2                              lcd_puts(x,y,p,FONTSIZE_HYPER);
 111   2                      else if(tUserPreference.u8LanguageId>4)
 112   2                              lcd_puts(x,y,p,FONTSIZE_8x8);                   
 113   2                      else
C51 COMPILER V7.50   RES_SHOW                                                              08/18/2008 13:43:40 PAGE 3   

 114   2                              lcd_puts(x,y,p,FONTSIZE_HYPER);
 115   2              }
 116   1              
 117   1              return 1;
 118   1      }
 119                  


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    926    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =     66      57
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----    ----
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -