?? swosd.c
字號:
}
// brian, multiple bitmap screen saver
{
if (__bBitmapIndex+1 >= BITMAP_NUMBER)
__bBitmapIndex = 0;
else
__bBitmapIndex++;
}
#endif //#ifndef SUPPORT_SCREEN_SAVER
#endif //#ifndef NO_OSD
}
// LLY.042-2 create
// *************************************************************************
// Function : OSD_SetSCR_Position
// Description : Set desired postion to OSD header for screen saver mode
// for screen saver mode
// Arguments : dwSCRXStart, the start point for horizontal
// dwSCRYStart, the start point for vertical
// Return : NULL
// Side Effect :
// *************************************************************************
void OSD_SetSCR_Position()
{
#ifndef NO_OSD
#ifndef NO_SCREEN_SAVER
// WORD wSCRXEnd, wSCRYEnd; WYC.050a use __wTemp to replace them
// Step 1: Calculate start/end pixel/line
// LLY.047, base on "HOR_DUPLICATION" value to calculate horizontal end
//wSCRXEnd=wSCRXStart+__wSCRWidth*4; // 4 = 2 clock/pixel * 2 (H2D=0)
// LLY.100, remove "HOR_DUPLICATION" definition, only keep H2D status
//__wTemp=wSCRXStart+__wSCRWidth*HOR_DUPLICATION*2; // 2 means: 2 clock/pixel
// printf("(X,Y)= (%ld, %ld)\n", dwSCRXStart, dwSCRYStart);
__wTemp=_wSCRXPos+__wSCRWidth*2*2; // 2 means: 2 clock/pixel
// Step 2: Spcify start/end pixel/line to HEADER2 and HEADER3
_dwSWOSDHeaders[0]=( HEADER2_BMP | (((DWORD)__bSCRResolution)<<30) |
(((DWORD)_wSCRXPos) << 12) |
(((DWORD)__wTemp) << 1) );
__wTemp=_wSCRYPos+__wSCRHeight; // Step1
_dwSWOSDHeaders[1]=( HEADER3_BMP | (((DWORD)_wSCRYPos)<<9) | ((DWORD)__wTemp) );
//Brian0.91, CT908, mix ratio moves to header 3
#ifdef MIX_RATIO_EFFECT
_dwSWOSDHeaders[1] = _dwSWOSDHeaders[1] & 0xFFF3FFFF;
_dwSWOSDHeaders[1] = _dwSWOSDHeaders[1] | ((_dwMoveCnt/FADING_SPEED) << 18);
#endif
// LLY.047, split top/bottom region address
// decide which bitmap's header is to be set
W99AV_WriteDRAMBurst(__dwBitmapTBuffer+2, _dwSWOSDHeaders, 2);
W99AV_WriteDRAMBurst(__dwBitmapBBuffer+2, _dwSWOSDHeaders, 2);
#endif // #ifndef NO_SCREEN_SAVER
#endif // #ifndef NO_OSD
}
// LLY.050, remove from OSD.C
// *********************************************************************
// Function : OSD_SetPosition
// Description : Set the row/ col position for S/W OSD display
// Arguments : iRow, row position
// : iCol, col position
// Return : NULL
// Side Effect :
// *********************************************************************
//LJY1.20, support 4M flash, remove digest
#ifndef NO_DIGEST
void OSD_SetPosition(int iRow, int iCol)
{
// only used for MSG_DIGESTNUMBER
__iRow=iRow;
__iCol=iCol;
}
#endif
// *********************************************************************
// Function : _OSD_ShowMPEG
// Description : Show MPEG LOGO
// Arguments : NULL
// Return : NULL
// Side Effect :
// *********************************************************************
// hwtan 6.10 begin
// Chuan DVD_171 12/11/2001: pwLogoData declared as code * to improve the speed
// Please see WinDVD Trace Note [100] in detail
void _OSD_ShowMPEG(WORD code *pwLogoData)
{
// Input format
// Word 0:0x4D4D
// Word 1:Words Length
// Word 2:resolution
// Word 3:Hsize
// Word 4:Vsize
// MPEG data
//NTSC/PAL,H/N(0x10,0x20,0x30,0x40,0x80,0xc0)
#ifndef NO_LOGO
//LJY1.00, add the define of "LET_LOGO_TVMODE_SAME_AS_PREVIOUS_VIDEO"
//LJY1.10, fix the problem of logo is always in PAL mode no matter the logo is a NTSC or PAL size BMP when TV mode is set as auto.
#ifdef LET_LOGO_TVMODE_SAME_AS_PREVIOUS_VIDEO
extern BIT start_service_420;
if(start_service_420==FALSE) // start_service_420 is a existing variable. It's "FALSE" during power-on.
#endif
{
// BYTE bResolution; JYLiu 2002/4/12, xdata reduce
if (pwLogoData[3]<=352) // normal, JYLiu 2002/4/12 modified begin
{
if (pwLogoData[4]<=240) //NTSC
__btNTSCBitStream = TRUE;
else //PAL
__btNTSCBitStream = FALSE;
}
else //high
{
if (pwLogoData[4]<=480) //NTSC
__btNTSCBitStream = TRUE;
else //PAL
__btNTSCBitStream = FALSE;
} // JYLiu 2002/4/12 modified end
}
// must reset CD-IF first
// close CD-IF
// marked because don't know why to add this
/*
EA= 0;
W99AV_Reset(W99AV_RESET_CDIF);
HAL_SetInputPath(HAL_INPUT_PATH_HOSTIF);
HAL_ControlCDIF(HAL_CDIF_CLOSE); // CISNR=0x0100
EA= 1;
*/
// then reset video, or CD-IF data might remain in FIFO
W99AV_Reset(W99AV_RESET_TOTAL);
W99AV_InitialVideo ();
// !!!why set twice, just for set BS swap!!!, can't remove
HAL_SetInputPath(HAL_INPUT_PATH_HOSTIF);
// LLY.0411, using HAL_Reset(HAL_RESET_PARSER), becasue it will
// issue disable parser and parser reset.
// Must call HAL_ControlParser(HAL_PARSER_ENABLE, NULL)
//W99AV_Reset(W99AV_RESET_PARSER);
HAL_Reset(HAL_RESET_PARSER);
// LLY.0411 end ...
// LLY2.80a, set AVIDR=0x4XXXX; BSFORMATR[3:0]=0000; BSFORMATR[5]=1 for LOGO display
HAL_ControlParser(HAL_PARSER_VIDEO_ONLY, 0x0);
#ifdef HOST_JPG //alex2.34 JPEG_LOGO
HAL_JPEGInitial();
// Set BSFORMATR to tell thumbnail or slide show decoding
__wW99AVAVIDRHigh=0x0004;
W99AV_WriteInternalRegDW(AVIDR, __wW99AVAVIDRLow, __wW99AVAVIDRHigh);
#endif //
// LLY.0411, must enable parsr after finishing video ID setting
HAL_ControlParser(HAL_PARSER_ENABLE, (BYTE)NULL );
// LLY.0411 end ...
// f/w 0.45
// set still picture mode
#ifndef HOST_JPG //alex2.34 JPEG_LOGO
HAL_SetStillPicture(TRUE, TRUE);
#endif //#ifndef HOST_JPG //alex2.34 JPEG_LOGO
#ifdef HOST_JPG //alex2.34 JPEG LOGO
__wHStart = FM_JPEG_FRAME_START_H;
__wVStart = FM_JPEG_FRAME_START_V;
__wWidth = FM_JPEG_FRAME_WIDTH;
__wHeight = FM_JPEG_FRAME_HEIGHT;
__btActiveFrame = 0;
__bJPEGOperation = 1;
__bJPEGEffect = HAL_JPEG_EFFECT_NO_EFFECT;
HAL_JPEGParseHeader();
#endif //#ifdef HOST_JPG //alex2.34 JPEG LOGO
W99AV_Command1(COMMAND_PLAY, 0);
// disable vidoe output
HAL_Display(HAL_DISPLAY_VIDEO, FALSE);
if (_OSD_LogoFillData(pwLogoData[1], pwLogoData)) //9
{
HAL_AdjustTVMode();
// LLY.278, Only need to set SCART info. while disable this define
// Because, SCART info. has been setting while setup item changed
#ifndef SET_SCART_FROM_SETUP
// TCC275f, set to 4:3 in LOGO
HAL_SetSCART(HAL_SCART_POWER_ON);
#endif // #ifndef SET_SCART_FROM_SETUP
#ifdef HOST_JPG //alex2.34 JPEG LOGO
__dwCTime = UTL_GetSysTimer();
while ((UTL_GetSysTimer() - __dwCTime) <= COUNT_1_SEC)
{
__bTemp=HAL_QueryStatus(HAL_JPEG_PARSE_HEADER);
if (__bTemp == HAL_QUERY_RESULT_OK)
break;
}
HAL_JPEGDecode(HAL_JPEG_DECODE);
HAL_PushFIFOData( (HAL_PUSHDATA_IFIFO|HAL_WITH_SYNC), 68);
__dwCTime = UTL_GetSysTimer();
while ((UTL_GetSysTimer() - __dwCTime) <= COUNT_3_SEC)
{
__bTemp = HAL_QueryStatus(HAL_JPEG_DECODE_STATUS);
if (__bTemp == HAL_QUERY_RESULT_OK)
break;
}
HAL_Display(HAL_DISPLAY_JPEG, HAL_JPEG_DECODE); //CoCo1.21, remove __bDecodeMode
#endif//
// enable video output
HAL_Display(HAL_DISPLAY_VIDEO, TRUE);
}
// if draw LOGO fail, do not open video output
//LJY0.87, fix stop->resume unstable(easy no ACK) & stop mode digest fialed issue.
HAL_ControlParser(HAL_PARSER_DISABLE, (BYTE)NULL );
// DVD018, recover the input path to default after show LOGO
HAL_SetInputPath(HAL_INPUT_PATH_DEFAULTIF);
#endif // NO_LOGO
}
// hwtan 6.10 end
// *********************************************************************
// Function : _OSD_LogoFillData
// Description : Write the LOGO data to FIFO
// Arguments : wWords : number of words to write
// Return : TRUE, all data are written
// Side Effect :
// *********************************************************************
// Chuan DVD_171 12/11/2001: pwLogoData declared as code * to improve the speed
// Please see WinDVD Trace Note [100] in detail
BIT _OSD_LogoFillData(WORD wWords, WORD code *pwLogoData)
{
// LLY.045-1, porting for new define depending on 22QF055.DOC
// it's only performance issue
//Kevin1.20, use include rather than file open for epp & e-up
// Chuan DVD_171 12/11/2001: wptr declared as code * to improve the speed
WORD code *wptr;
int lasti;
BYTE j; // WYC.050a replace int to byte
//WORD wTemp; WYC.050a use __wTemp to replace it
// WYC.050a BYTE bIFIFORemainder;
wptr = pwLogoData; // Point to start of buffer
// the first MPEG data
wptr+=5;
lasti = ((wWords) / FILL_FIFO_WORDS); // Set # of N Bytes loops
while(lasti--)
{
//Kevin1.20, monitor IBFIFO
#ifndef SYSTEM_8051 //not monitor IBFIFO on e-up for performance issue
{
DWORD _dwSWTemp;
_dwSWTemp=0;
do
{
W99AV_ReadInfo(W99AV_INFO_IFIFO_REMAIN, &__dwTemp);
_dwSWTemp++;
if (_dwSWTemp>=128)
return FALSE;
}
while (__dwTemp > W99AV_FIFO_SIZE-FILL_FIFO_BYTES);
}
#endif
for (j = 0; j < FILL_FIFO_WORDS; j++, wptr++)
{
#ifdef SYSTEM_8051
OUTB(IBDPR0,LOBYTE(*wptr));
OUTB(IBDPR0,HIBYTE(*wptr));
#else //Kevin1.20
_outp((WORD)IBDPR0, LOBYTE(*wptr));
_outp((WORD)IBDPR0, HIBYTE(*wptr));
#endif
}
}//end of lasti
lasti=wWords%FILL_FIFO_WORDS;
if (lasti)
{
for (j = 0; j < lasti; j++, wptr++)
{
#ifdef SYSTEM_8051
OUTB(IBDPR0,LOBYTE(*wptr));
OUTB(IBDPR0,HIBYTE(*wptr));
#else //Kevin1.20
_outp((WORD)IBDPR0, LOBYTE(*wptr));
_outp((WORD)IBDPR0, HIBYTE(*wptr));
#endif
}
}
// Padding extra bytes to push last data out.
// 32*8=256,
// for (j = 0; j < 32; j++)
// Micky1.21-3, must push more data when thriugh ac fifo.
// 64*8=512
// Chuan1.22, push 0xb7 to avoid wrong LOGO file that create by old meg2txt tool
for (j = 0; j < 128; j++)
{
#ifdef SYSTEM_8051
OUTB(IBDPR0,0xb7);
OUTB(IBDPR0,0xb7);
OUTB(IBDPR0,0xb7);
OUTB(IBDPR0,0xb7);
#else //Kevin1.20
_outp((WORD)IBDPR0, 0xb7);
_outp((WORD)IBDPR0, 0xb7);
_outp((WORD)IBDPR0, 0xb7);
_outp((WORD)IBDPR0, 0xb7);
#endif
}
return TRUE;
// LLY.045-1 end ...
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -