📄 l1_playback.c
字号:
#include "general.h"
#include "main.h"
#include "initio.h"
UCHAR L1_PBOne(UCHAR ID) USING_0
{
/*
//PRINT_L1(" L1_PBOne: Enter\n");
ULONG AFBAddr;
ULONG DSPAddr;
DSPAddr = K_SDRAM_DisplayBufAAddr;
AFBAddr = K_SDRAM_FrameBufAAddr;
if(G_Hsize==1152 && G_Vsize==864 && (ID<6)) ID = (ID%2);
else if(G_Hsize==1280 && G_Vsize==960 && (ID<6)) ID = (ID%2)+2;
else if(G_Hsize==1600 && G_Vsize==1200&& (ID<6)) ID = (ID%2)+4;
else ID = (ID%2)+6;
G_PBID=ID;
//////////////////////// first step: playback the thumbnail //////////////////
// Load the thumbnail (160,120) from the NAND to FreeArea
L1_NANDtoDRAM(G_FreeAddr, 0x400000+ ID*(ULONG)0x4000, 0x4000);
// Decompress the thumbnail from FreeArea to AFB with JFIF compatible
L2_DeCompress(G_FreeAddr, 160, 120, AFBAddr, 0x00, 0x04, 0x00); // 0x04: JFIF Compatible
//PRINT_L1(" L1_PBOne: Decompress error=%bx\n",L2_CheckDecompress());
// scale up image from AFB(160,120) to AFB(G_DSPHsize,G_DSPVsize) using FreeArea as temporary buffer
L2_ScaleUpImage(AFBAddr, 160, 120, AFBAddr, G_DSPHsize, G_DSPVsize, G_FreeAddr);
// copy the displayed image from AFB to the DSP buffer
L2_CopyImage(AFBAddr, G_DSPHsize, G_DSPVsize, 0, 0, G_DSPHsize, G_DSPVsize, DSPAddr, G_DSPHsize, G_DSPVsize, 0, 0);
// set the displayed address and size
L2_SetBFBAddr(DSPAddr);
L2_SetBFBSize(G_DSPHsize,G_DSPVsize);
//////////////////////// second step: playback the picture //////////////////
// Load the picture (1152,864) from the NAND to FreeArea
L1_NANDtoDRAM(G_FreeAddr,0x80000*ID,0x80000);
// Decompress the picture from FreeArea to AFB with JFIF compatible
L2_DeCompress(G_FreeAddr, G_Hsize, G_Vsize, AFBAddr, 0x00, 0x04, 0x00);
//PRINT_L1(" L1_PBOne: Decompress error=%bx\n",L2_CheckDecompress());
// scale down image from AFB(G_Hsize,G_Vsize) to AFB(G_DSPHsize,G_DSPVsize) using FreeArea as temporary buffer
L2_ScaleDownImage(AFBAddr, G_Hsize, G_Vsize, AFBAddr, G_DSPHsize, G_DSPVsize, G_FreeAddr);
// copy the displayed image from AFB to the DSP buffer
L2_CopyImage(AFBAddr, G_DSPHsize, G_DSPVsize, 0, 0, G_DSPHsize, G_DSPVsize, DSPAddr, G_DSPHsize, G_DSPVsize, 0, 0);
// set the displayed address and size
L2_SetBFBAddr(DSPAddr);
L2_SetBFBSize(G_DSPHsize,G_DSPVsize);
//PRINT_L1(" L1_PBOne: Exit\n");
*/
return L1K_SUCCESS;
}
UCHAR L1_PBNine(void) USING_0
{
/*
USHORT i,j;
USHORT dnhsize,dnvsize;
UCHAR hoff ,voff;
ULONG AFBAddr, BFBAddr;
ULONG DSPAddr;
DSPAddr = K_SDRAM_DisplayBufAAddr;
AFBAddr = K_SDRAM_FrameBufAAddr;
BFBAddr = K_SDRAM_FrameBufBAddr;
//PRINT_L1(" L1_PBNine: Enter\n");
// prepare the background picture in the G_FreeAddr with size (G_DSPHsize, G_DSPVsize)
// with color "black"
L2_FillDRAM(G_FreeAddr, G_DSPHsize*G_DSPVsize, 144, 0);
dnhsize = (G_DSPHsize - 24)/3;
dnvsize = (G_DSPVsize - 16)/3;
dnhsize = dnhsize - (dnhsize %2);
dnvsize = dnvsize - (dnvsize %2);
hoff = (G_DSPHsize - dnhsize *3)/2;
voff = (G_DSPVsize - dnvsize *3)/2;
for(j=0 ; j<3; j++) {
for(i=0; i<3 ; i++) {
// Load the thumbnail (160,120) from the NAND to AFB
L1_NANDtoDRAM(AFBAddr, 0x400000+((j*3+i)%8)*(ULONG)0x4000, 0x4000);
// Decompress the thumbnail from AFB to BFB with JFIF compatible
L2_DeCompress(AFBAddr, 160, 120, BFBAddr, 0x00, 0x04, 0x00);
if(L2_CheckDecompress()!=0)
{
//PRINT_L1(" L1_PBNine: Decompress error=%bx\n",L2_CheckDecompress());
}
if(dnhsize <160)
// scale down the image from BFB(160,120) to BFB(dnhsize,dnvsize) using AFB as temporary buffer
L2_ScaleDownImage(BFBAddr, 160, 120, BFBAddr, dnhsize, dnvsize, AFBAddr);
else
// scale up the image from BFB(160,120) to BFB(dnhsize,dnvsize) using AFB as temporary buffer
L2_ScaleUpImage(BFBAddr, 160, 120, BFBAddr, dnhsize, dnvsize, AFBAddr);
// copy the image(dnhsize, dnvsize) to the background picture
L2_CopyImage(BFBAddr, dnhsize, dnvsize, 0, 0, dnhsize, dnvsize, G_FreeAddr, G_DSPHsize, G_DSPVsize, hoff+(USHORT)i*(dnhsize+6), voff+(USHORT)j*(dnvsize+4));
}
}
// copy the displayed image from G_FreeAddr to the DSP buffer
L2_CopyImage(G_FreeAddr, G_DSPHsize, G_DSPVsize, 0, 0, G_DSPHsize, G_DSPVsize, DSPAddr, G_DSPHsize, G_DSPVsize, 0, 0);
// set the displayed address and size
L2_SetBFBAddr(DSPAddr);
L2_SetBFBSize(G_DSPHsize,G_DSPVsize);
//PRINT_L1(" L1_PBNine: Exit\n");
*/
return L1K_SUCCESS;
}
//-----------------------------------------------------------------------------
//L1_PBFour
//-----------------------------------------------------------------------------
UCHAR L1_PBFour(UCHAR Para0) USING_0
{
/*
UCHAR Temp0 = Para0;
//PRINT_L1(" L1_PBFour: Enter.\n");
//PRINT_L1(" L1_PBFour: Exit.\n");
*/
return L1K_SUCCESS;
}
//-----------------------------------------------------------------------------
//L1_PBZoom
//-----------------------------------------------------------------------------
/*
arguments:
factor - 10: zoom factor 1.0x
11: zoom factor 1.1x
12: zoom factor 1.2x
.
.
20: zoom factor 2.0x
*/
UCHAR L1_PBZoom(UCHAR Factor) USING_0
{
/*
USHORT srchsize, srcvsize;
//PRINT_L1(" L1_PBZoom: Enter.\n");
G_PBZFactor = Factor;
if(Factor > 20 || Factor <10) return L1K_ERROR_PARAMETER;
// if the zoom factor is 1.0x, reset to the original setting
if(Factor == 10) {
L2_SetDisplaySrcImgSize(G_DSPHsize, G_DSPVsize, G_DisplayType);
L2_SetDisplayOffset(0,0);
return L1K_SUCCESS;
}
// calculate the factor parameter
srchsize = ((ULONG)G_DSPHsize * 10) / Factor;
srcvsize = ((ULONG)G_DSPVsize * 10) / Factor;
// setting the LCD/TV zoom factor
L2_SetDisplaySrcImgSize(srchsize, srcvsize, G_DisplayType);
// setting the LCD/TV offset
L2_SetDisplayOffset((G_DSPHsize-srchsize)/4*2,(G_DSPVsize-srcvsize)/4*2);
//PRINT_L1(" L1_PBZoom: Exit.\n");
*/
return L1K_SUCCESS;
}
//-----------------------------------------------------------------------------
//L1_PBPan
//-----------------------------------------------------------------------------
UCHAR L1_PBPan(USHORT Xoff, USHORT Yoff) USING_0
{
/*
//PRINT_L1(" L1_PBPan: Enter.\n");
// setting the LCD/TV offset
L2_SetDisplayOffset(Xoff, Yoff);
//PRINT_L1(" L1_PBPan: Exit.\n");
*/
return L1K_SUCCESS;
}
//-----------------------------------------------------------------------------
//L1_PBInfo
//-----------------------------------------------------------------------------
UCHAR L1_PBInfo(UCHAR Para0) USING_0
{
/*
UCHAR Temp0 = Para0;
//PRINT_L1(" L1_PBInfo: Enter.\n");
//PRINT_L1(" L1_PBInfo: Exit.\n");
*/
return L1K_SUCCESS;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -