#include
#include
#include
#include
#include
#include "image_cfg.h"
#include "s3c2440x_lcd.h"
#include
//------------------------------------------------------------------------------
// Definition
#define MAXLOGONUM 18
const char LOGOTag[8]={'A','M','O','I','L','O','G','O'};
static DWORD PowonLogoNum=0;
DWORD ChgLogoNum;
DWORD UpdateLogoNum;
static HANDLE g_hSTORE = NULL;
//------------------------------------------------------------------------------
// Frame buffer
//static USHORT s_frameBuffer[320 * 240];
static LOGOINFO LogoInfo[MAXLOGONUM];// the max num of the logo is 10
//Function: InitOrCloseBootstore
//IsInit == True,will init the bootstore
//ISInit == False,will Deinit the bootstore
BOOL InitOrCloseBootstore(BOOL IsInit)
{
//#ifdef SHIP_BUILD
if(IsInit)
{
g_hSTORE = BootStoreInit(&g_bootStoreInit);
if (g_hSTORE == NULL)
{
RETAILMSG(OAL_INFO, (L"INFO: "
L"Failed Init store!\r\n"));
return FALSE;
}
}
else if(!IsInit)
{
//BootStoreDeinit(g_hSTORE);
BootStoreClose(g_hSTORE);
}
// #endif
return TRUE;
}
//------------------------------------------------------------------------------
//
// Function: ShowLogo
//
BOOL
ShowPowonLogo(
)
{
BOOL rc=TRUE;
InitOrCloseBootstore(TRUE);
if(ReadLogoHead() ==FALSE)//读取LOGO头文件失败
{
OALMSG(OAL_INFO, (L"INFO: "
L" POWON logo read ReadLogoHead fail!\r\n"));
return rc = FALSE;
}
if( ReadLogoAndDisplay(0,POWONLOGO)==FALSE)//读取和显示LOGO失败
{
OALMSG(OAL_INFO, (L"INFO: "
L"POWON logo ReadLogoAndDisplay fail!\r\n"));
rc = FALSE;
}
InitOrCloseBootstore(FALSE);//初始化失败
return rc;
}
BOOL ReadLogoHead()
{
// #ifdef SHIP_BUILD
UINT16 *pHBuffer,*pInfoBuffer;
DWORD TotalLogo;
UINT16 LogoIndex;
UINT16 PowonLogoIndex=0,ChgLogIndex=0,UpdateLogoIndex=0;
LogoRegionHeader LogoHeader;
int i;
/* UINT16 *P1,*p2,*p3;
UINT32 Pa1,pc3;
UINT16 a[10]={1,1,2,3,1,3},b[10],c[10];
p2=b;
P1=a;
memcpy(p2,P1,sizeof(a));
for(i=0;i<10;i++)
RETAILMSG(1, (L"memory cache to cache %x\r\n",p2));
Pa1=OALVAtoPA(&a[0]);
P1 =OALPAtoUA(Pa1);
pc3=OALVAtoPA(&c[0]);
p3 =OALPAtoUA(pc3);
memcpy(p2,P1,sizeof(a));
for(i=0;i<10;i++)
RETAILMSG(1, (L"uncache to cache %x\r\n",p2));
memcpy(p3,p2,sizeof(a));
for(i=0;i<10;i++)
RETAILMSG(1, (L"cache to uncache %x\r\n",p3));*/
pHBuffer = (UINT16 *)&LogoHeader;
pInfoBuffer = (UINT16 *)LogoInfo;
if (!BootStoreOpenReservedRegion(g_hSTORE, BOOT_STORE_ACCESS_READ, "LOGO"))
{
RETAILMSG(1, (L"INFO: "
L"Failed open reserved region LOGO!\r\n"));
return FALSE;
}
if(BootStoreRead(g_hSTORE, pHBuffer, sizeof(LogoHeader)) != sizeof(LogoHeader))
{
RETAILMSG(1, (L"INFO: "
L"Failed read logo header from reserved region!\r\n"));
return FALSE;
}
if(memcmp(LogoHeader.LogoTag,LOGOTag,8)==0)
{
TotalLogo = LogoHeader.TotalNumber;
if(TotalLogo > MAXLOGONUM)
{
TotalLogo = MAXLOGONUM;
}
if(!BootStoreSeek(g_hSTORE,(sizeof(LogoHeader)-sizeof(LOGOINFO))))
{
RETAILMSG(1, (L"INFO: "
L"seek to the headInfo fail in reserved region!\r\n"
));
return FALSE;
}
if(BootStoreRead(g_hSTORE, pInfoBuffer, TotalLogo*sizeof(LOGOINFO)) != TotalLogo*sizeof(LOGOINFO))
{
RETAILMSG(1, (L"INFO: "
L"Failed read logo info from reserved region!\r\n"));
return FALSE;
}
for(LogoIndex =0;LogoIndex < TotalLogo;LogoIndex++)
{
//POWON logo
if(LogoInfo[LogoIndex].LogoID == 1)
{
PowonLogoIndex++;
}
//CHARGE LOGO
else if(LogoInfo[LogoIndex].LogoID == 2)
{
ChgLogIndex++;
}
else if(LogoInfo[LogoIndex].LogoID == 3)
{
UpdateLogoIndex++;
}
}
PowonLogoNum = PowonLogoIndex;
ChgLogoNum = ChgLogIndex;
UpdateLogoNum = UpdateLogoIndex;
return TRUE;
}
else
// #endif
{
//for debug
for(i=0;i
{
RETAILMSG(1, (L"LogoHeader.LogoTag %x\r\n",LogoHeader.LogoTag));
}
RETAILMSG(1, (L"INFO: "L"logo not exist!\r\n"));
return FALSE;
}
}
//function: ReadLogoAndDisplay;
//argument:
// LogoIndex: the LogoIndex is begin at 0 to the max logonum -1.
// logo: indicate the chargelogo or powon logo that should be showed.
BOOL ReadLogoAndDisplay(WORD LogoIndex,LOGO Logo)
{
//#ifdef SHIP_BUILD
UINT16 *pBuffer;
DWORD logosize;
DWORD index;
pBuffer = (UINT16*)IMAGE_FRAMEBUFFER_UA_BASE;
if (g_hSTORE == NULL)
{
OALMSG(OAL_INFO, (L"INFO: "
L"g_hSTORE is not initted!\r\n"));
return FALSE;
}
if(Logo == POWONLOGO)
{
if(LogoIndex >= PowonLogoNum)
{
return FALSE;
}
index = LogoIndex;
if(!BootStoreSeek(g_hSTORE,LogoInfo[index].LocationOffSet))
{
OALMSG(OAL_INFO, (L"INFO: "
L"seek to the PowonLogo fail in reserved region!\r\n"));
return FALSE;
}
}
else if(Logo == CHGLOGO)
{
if(LogoIndex >= ChgLogoNum)
{
return FALSE;
}
index = PowonLogoNum + LogoIndex;
if(!BootStoreSeek(g_hSTORE,LogoInfo[index].LocationOffSet))
{
OALMSG(OAL_INFO, (L"INFO: "
L"seek to the chargelog fail in reserved region!\r\n" ));
return FALSE;
}
}
else if(Logo == UPDATELOGO)
{
if(LogoIndex >= UpdateLogoNum)
{
return FALSE;
}
index = PowonLogoNum + ChgLogoNum + LogoIndex;
if(!BootStoreSeek(g_hSTORE,LogoInfo[index].LocationOffSet))
{
OALMSG(OAL_INFO, (L"INFO: "
L"seek to the chargelog fail in reserved region!\r\n" ));
return FALSE;
}
}
if(LogoInfo[index].Pos.x != 0)
{
OALMSG(OAL_INFO, (L"INFO: "
L"pos.x should be zero!!\r\n"));
return FALSE;
}
pBuffer = pBuffer+ (LogoInfo[index].Pos.y * LogoInfo[index].Pos.width);
logosize = (LogoInfo[index].size)* 2;
if(BootStoreRead(g_hSTORE,pBuffer,LogoInfo[index].size *2) != LogoInfo[index].size * 2)
{
OALMSG(OAL_INFO, (L"INFO: "
L"Failed read logo info from reserved region!\r\n"
));
return FALSE;
}
// Start display
//BootStartDisplay(pBuffer,LCD_ARRAY_SIZE_TFT_16BIT);
// #endif
return TRUE;
}
在这段LOGO代码里面,哪一段是换图片需要修改的代码