📄 dosusr.c
字号:
#include "general.h"
#include "asicreg.h"
#include "cardimpt.h"
#include "cardui.h"
//#include "exptcode.h"
#include "dosusr.h"
#include "doslink.h"
#include "doserr.h"
#include "cardlink.h"
//patch4.2@richie@ds0509
#include "dramfunc.h"
//patch3.2@ada@0401 For DPOF
#include "dpof.h"
#include "doscon.h"
//patch3.2@ada@0401 for Multi-Frame Play Back
#include "initio.h"
#include "dosvar.h"
#include "playback.h"
#include "audio.h"
//version4.0@ada@0513 for Play Back
#include "exifhdr.h"
#include "dpof.h"
//patch4.5@ada@Complete H/W write protect function begin
#include "cardusr.h"
#include "uiflow.h"
#include "lcdtv.h"
//patch4.5@ada@Complete H/W write protect function end
//wendy@2004/8/27
extern code PUCHAR CHK_PROSWT1[];
extern code PUCHAR CHK_PROSWT2[];
//extern code PUCHAR DIRINDEX_FULL1[];
//extern code PUCHAR DIRINDEX_FULL2[];
//wendy@2004/8/27
xdata WORD G_USR_Dir0Cluster;
xdata WORD G_USR_Dir1Cluster;
xdata WORD G_USR_Dir1Count;
//version4.0@ada@0513 for Play Back
xdata USHORT G_USR_SearchPreFileIndex;
xdata USHORT G_USR_SearchNowFileIndex;
xdata USHORT G_USR_SearchNextFileIndex;
xdata USHORT G_USR_FirstFileIndex;
xdata USHORT G_USR_LastFileIndex;
#if (SINGLE_DIRECTORY == 0)
//version4.0@ada@0513 for Multi-Directory
//patch4.4@ada@DirectoryIndexOrder begin
//xdata USHORT G_USR_Dir1CountIndex;
xdata USHORT G_USR_MaxDir1Count;
//xdata USHORT G_USR_MaxOurDir1CountIndex;
xdata USHORT G_USR_TotalDirectory;
xdata UCHAR G_USR_OurDirectory;
xdata USHORT G_USR_MinDir1Count;
xdata USHORT G_USR_MaxOurDir1Count;
xdata USHORT G_USR_PrevDir1Count;
//patch4.4@ada@DirectoryIndexOrder end
//patch4.5@ada@Duplicated file index in same DCF directory begin
xdata USHORT G_USR_TempSearchNowFileIndex;
xdata USHORT G_USR_TempLastFileIndex;
xdata USHORT G_USR_TempLastJpgFileIndex;
xdata USHORT G_USR_PracticalMaxDirIndexCount;
//patch4.5@ada@Duplicated file index in same DCF directory end
#endif
xdata WORD G_USR_FileIndex;
xdata BYTE G_USR_FileType;
xdata WORD G_USR_FileCount;
xdata WORD G_USR_PlayIndex;
//patch4.4@ada@MP3 begin
#if (MP3_OPTION)
xdata WORD G_USR_Mp3Dir0Cluster;
xdata WORD G_USR_Mp3Dir1Cluster;
xdata WORD G_USR_Mp3Dir1Count;
xdata USHORT G_USR_Mp3MaxDir1Count;
xdata USHORT G_USR_Mp3TotalDirectory;
xdata USHORT G_USR_Mp3MinDir1Count;
xdata USHORT G_USR_Mp3MaxOurDir1Count;
xdata USHORT G_USR_Mp3PrevDir1Count;
#endif
//patch4.4@ada@MP3 end
//patch4.4@ada@DPOF skip AVI & WAV begin
xdata USHORT G_USR_JpgFileCount;
xdata USHORT G_USR_FirstJpgFileIndex;
xdata USHORT G_USR_LastJpgFileIndex;
UCHAR TTName[9];//wendy
//patch4.4@ada@DPOF skip AVI & WAV end
//Joe@2003.2.27 11:09 add begin
#include "JoeToEvb.h"
//Joe@2003.2.27 11:09 add end
//-----------------------------------------------------------------------------
//USR_SetBaseName
//-----------------------------------------------------------------------------
void USR_SetBaseName(BYTE *name, WORD fileIndex) USING_0
{
BYTE i;
BYTE ch;
for ( i = 0; i < 4; i++ )
name[i] = G_USR_Company_UpperSIG[i];
for (i = 7; i > 3; i--)
{
ch = (BYTE) (fileIndex % 10) + '0';
fileIndex /= 10;
name[i] = ch;
}
}
//-----------------------------------------------------------------------------
//USR_SetJpgName
//-----------------------------------------------------------------------------
void USR_SetJpgName(BYTE* name, WORD count) USING_0
{
USR_SetBaseName(name,count);
name[8] = 'J';
name[9] = 'P';
name[10] = 'G';
name[11] = 0x20;
}
//#if ( AUDIO_OPTION == 1 )
//-----------------------------------------------------------------------------
//USR_SetWaveName
//-----------------------------------------------------------------------------
void USR_SetWaveName(BYTE* name, WORD count) USING_0
{
USR_SetBaseName(name,count);
name[8] = 'W';
name[9] = 'A';
name[10] = 'V';
name[11] = 0x20;
}
//#endif
#if ( K_File_HaveVideo == 1 )
//-----------------------------------------------------------------------------
//USR_SetAviName
//-----------------------------------------------------------------------------
void USR_SetAviName(BYTE* name, WORD count) USING_0
{
USR_SetBaseName(name,count);
name[8] = 'A';
name[9] = 'V';
name[10] = 'I';
name[11] = 0x20;
}
#endif
//patch4.4@ada@MP3 begin
#if (MP3_OPTION)
//-----------------------------------------------------------------------------
//USR_SetMp3Name
//-----------------------------------------------------------------------------
void USR_SetMp3Name(BYTE* name, WORD count) USING_0
{
USR_SetBaseName(name,count);
name[8] = 'M';
name[9] = 'P';
name[10] = '3';
name[11] = 0x20;
}
//-----------------------------------------------------------------------------
//USR_SetMp3Dir0Name
//-----------------------------------------------------------------------------
void USR_SetMp3Dir0Name(BYTE* name) USING_0
{
BYTE i;
for ( i = 0; i < 12; i++ )
name[i] = G_USR_Mp3Dir0Name[i];
}
//-----------------------------------------------------------------------------
//USR_SetMp3Dir1Name
//-----------------------------------------------------------------------------
void USR_SetMp3Dir1Name(BYTE* name, WORD count) USING_0
{
BYTE i;
BYTE ch;
WORD rem = count;
for ( i = 0; i < 12; i++ )
name[i] = G_USR_Mp3Dir1Name[i];
for (i = 2; i != 0xff; i--)
{
ch = (BYTE) (rem % 10) + '0';
rem /= 10;
name[i] = ch;
}
}
#endif
//patch4.4@ada@MP3 end
//-----------------------------------------------------------------------------
//USR_SetDir0Name
//-----------------------------------------------------------------------------
void USR_SetDir0Name(BYTE* name) USING_0
{
BYTE i;
for ( i = 0; i < 12; i++ )
name[i] = G_USR_Dir0Name[i];
}
//-----------------------------------------------------------------------------
//USR_SetDir1Name
//-----------------------------------------------------------------------------
void USR_SetDir1Name(BYTE* name, WORD count) USING_0
{
BYTE i;
BYTE ch;
WORD rem = count;
for ( i = 0; i < 12; i++ )
name[i] = G_USR_Dir1Name[i];
for (i = 2; i != 0xff; i--)
{
ch = (BYTE) (rem % 10) + '0';
rem /= 10;
name[i] = ch;
}
//version4.0@ada@0513 for DCF
//G_USR_Dir1Count++;
}
//patch4.5@ada@Fix filtering DCF file name bug begin
//patch4.4@ada@DCF begin
//-----------------------------------------------------------------------------
//USR_CheckDcfFileName
//-----------------------------------------------------------------------------
UCHAR USR_CheckDcfFileName(UCHAR *fdb) USING_0
{
UCHAR sts;
UCHAR i;
for (i = 0; i < 4; i++)
{
if ((('A' <= fdb[i]) && (fdb[i] <= 'Z')) || (fdb[i] == '_') || (('0' <= fdb[i]) && (fdb[i] <= '9')))
{
sts = TRUE;
}
else
{
sts = FALSE;
return sts;
}
}
for (i = 4; i < 8; i++)
{
if (('0' <= fdb[i]) && (fdb[i] <= '9'))
{
sts = TRUE;
}
else
{
sts = FALSE;
return sts;
}
}
return sts;
}
//patch4.4@ada@DCF end
//patch4.5@ada@Fix filtering DCF file name bug end
//-----------------------------------------------------------------------------
//USR_CheckType
//-----------------------------------------------------------------------------
//patch3.2@ada@0401 For DCF
//patch3.2@ada@0401 for Multi-Frame Play Back
//version4.0@ada@0513 for DCF
void USR_CheckType(BYTE* fdb) USING_0
{
UCHAR i;
UCHAR fileType;
USHORT index = 0;
//patch4.3@ada@0618 for playback file index order
USHORT NowIndex,PreIndex,NextIndex,TempNowIndex;
UCHAR tmp1,tmp2;
//patch4.5@ada@Duplicated file index in same DCF directory begin
USHORT TempPreFileIndex;
USHORT TempNextFileIndex;
//patch4.5@ada@Duplicated file index in same DCF directory end
//ada@0401 For DCF
if (fileType = USR_FileExist(fdb))
{
//patch4.4@ada@DCF begin
if (USR_CheckDcfFileName(fdb) == FALSE)
{
return;
}
//patch4.4@ada@DCF end
//patch4.5@ada@Duplicated file index in same DCF directory begin
//G_USR_SearchPreFileIndex = G_USR_SearchNowFileIndex;
//patch4.5@ada@Duplicated file index in same DCF directory end
for (i = 4; i < 8; i++)
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -