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

📄 fsgui.c

📁 dvd里面的一个文件系统的代码
💻 C
📖 第 1 页 / 共 2 页
字号:
			cc2 = big5font_table[index + i4x - 1] & 0x0f;
#endif
			my12Bits = (cc1<<4) | cc2;
		}
		else
		{
			i4x = i * 3 / 2;
#ifdef SUPPORT_FONT_UTIL
            cc1 = pBmp[i4x];
            cc2 = pBmp[i4x+1]&0xf0;
#else
			cc1 = big5font_table[index + i4x];
			cc2 = big5font_table[index + i4x+1] & 0xf0;
#endif
			my12Bits = (cc1<<4) | (cc2>>4);
		}
		
		for (j = 0; j <12; j++)
		{
			if ((1 << j) & my12Bits)
			{
				if (vid == 2)  //Jeff 20020823
				{
					*Y_XYB( (x+14-j), (y+i) ) = iY;
					*C_XYB( (x+14-j), (y+i) ) = iCbCr;
				}
				else
				{
					*Y_XY( (x+14-j), (y+i) ) = iY;
					*C_XY( (x+14-j), (y+i) ) = iCbCr;
				}
			}
		}
	}
} // yhwang 20021001
#endif   //end #ifdef MP3_LARGE_GUI //Maoyong 2004.1.13
#endif	//end #ifdef USE_BIG5_FONT

#if defined (MP3_LARGE_GUI) || defined (FS_BMP_GUI)//#ifdef MP3_LARGE_GUI
void FSGUI_ShowString(int x, int y, const char *s, BYTE iY, UINT16 iCbCr)
{
	int	i = 0;
	BYTE* p = (BYTE *)s;
	int length = 0;
	//sometime may exceed 25 chinese
	//zhaoyanhua modify. 2003-8-26 14:36
	#ifdef MP3_TXT_DISPLAY
	unsigned char ss[100];
	#else
	unsigned char ss[50];
	#endif
	unsigned char* ss_ptr = ss;

	strcpy(ss_ptr, p);
	
	while(p[i])
	{
		length++;
		i++;
	}
	i = 0;
	
	while (*p)
	{
		BYTE    c;
		BYTE    c1;
		int     iRes = 0;
        
		//  which character
		c = *p;
		c1 = *(p + 1);

#ifdef USE_GB2312_FONT
		if (((c >= 0xA1) && (c <= 0xF8)) && ((c1 >= 0xA1) && (c1 < 0xFF)))             
		 {
			// GB code
			iRes = 3;
		 }
		 else  
#endif
#if defined( USE_BIG5_FONT )        // 2004/12/23 yltseng
		if(((c >= 0xA1) && (c <= 0xF9)) && ((c1 >= 0x40 && c1 <= 0x7E) || (c1 >= 0xA1 && c1 <= 0xFE))) // yhwang for big5 20021001
		{
			// Big5 code
			iRes = 2;
		}
		else 
#endif
#ifdef USE_BIG5_COMMON_FONT         // 2004/12/23 yltseng
		if(((c >= 0xA1) && (c <= 0xC6)) && ((c1 >= 0x40 && c1 <= 0x7E) || (c1 >= 0xA1 && c1 <= 0xFE))) // yhwang for big5 20021001
		{
			// Big5 code
			iRes = 2;
		}
		else 
#endif
		if ((c >= 32) && (c <= 126)) // ASCII code
			iRes = 1;
		else
		{
			iRes = 0;
			c = '_';
		}
		
		if ((iRes == 0) || (iRes == 1))
		{
#ifdef SUPPORT_CHINESE_FONT // Clead
			if ((c == '!') || (c == '"') || (c == '#') || (c == '$') ||
				(c == '&') || (c == '\'') || (c == '(') || (c == ')') ||
				(c == ',') || (c == ';') || (c == '=') || (c == '^'))
#ifdef USE_GB2312_FONT
			{
				c1 = 0x03 + 0xa0;
				c = c + 0x80;
				FSGUI_GBShowChar(0, (x + i), y, c1, c, iY, iCbCr);
			}
			else
#elif defined( USE_BIG5_FONT ) || defined( USE_BIG5_COMMON_FONT )//#ifdef USE_GB2312_FONT
			{
				if(c < 114)
				{
					c1 = 0xa2;
					c = c + 0x8e;
				}
				else
				{
					c1 = 0xa3;
					c = c - 113 + 0x40;
				}
				FSGUI_Big5ShowChar(0, (x + i), y, c1, c, iY, iCbCr);
			}
			else
#endif////#ifdef USE_GB2312_FONT
				FSGUI_ShowChar(0, (x + i), y, c, iY, iCbCr);
#else//#ifdef SUPPORT_CHINESE_FONT // Clead
			FSGUI_ShowChar(0, (x + i), y, c, iY, iCbCr);
#endif//#ifdef SUPPORT_CHINESE_FONT // Clead
			i += 16;
			p++;
		}

#if defined( USE_BIG5_FONT ) || defined( USE_BIG5_COMMON_FONT )
		else if(iRes == 2)  //BIG5 code
		{
			FSGUI_Big5ShowChar(0, (x + i), y, c, c1, iY, iCbCr);
			i += 26;
			p += 2;
		}
#endif
#ifdef USE_GB2312_FONT
		else if (iRes == 3) //GB code
		{
			FSGUI_GBShowChar(0, (x+i), y, c, c1, iY, iCbCr);
			i += 26;
			p += 2;
		} 
#endif
		else
		{
			c = '-';
			FSGUI_ShowChar(0, (x+i), y, c, iY, iCbCr); 
			i += 16;
			p++;
		}
		if (i > 540)
			break;  

	}
}
#else//#if defined (MP3_LARGE_GUI) || defined (FS_BMP_GUI)
void FSGUI_ShowString(int x, int y, const UINT8 *s, BYTE iY, UINT16 iCbCr)
{
	int	i = 0;
	BYTE* p = (BYTE *)s;
	int length = 0;
	//sometime may exceed 25 chinese
	//zhaoyanhua modify. 2003-8-26 14:36
	#ifdef MP3_TXT_DISPLAY
	unsigned char ss[100];
	#else
	unsigned char ss[50];
	#endif
	unsigned char* ss_ptr = ss;

	strcpy(ss_ptr, p);
	
	while(p[i])
	{
		length++;
		i++;
	}
	i = 0;
    
	while (*p)
	{
		BYTE    c;
		BYTE    c1;
		int     iRes = 0;
        
		//  which character
		c = *p;
		c1 = *(p + 1);

#ifdef USE_GB2312_FONT
		if (((c >= 0xA1) && (c <= 0xF8)) && ((c1 >= 0xA1) && (c1 < 0xFF)))             
		 {
			// GB code
			iRes = 3;
		 }
		 else  
#endif
#if defined( USE_BIG5_FONT )        // 2004/12/23 yltseng
		if(((c >= 0xA1) && (c <= 0xF9)) && ((c1 >= 0x40 && c1 <= 0x7E) || (c1 >= 0xA1 && c1 <= 0xFE))) // yhwang for big5 20021001
		{
			// Big5 code
			iRes = 2;
		}
		else 
#endif
#ifdef USE_BIG5_COMMON_FONT         // 2004/12/23 yltseng
		if(((c >= 0xA1) && (c <= 0xC6)) && ((c1 >= 0x40 && c1 <= 0x7E) || (c1 >= 0xA1 && c1 <= 0xFE))) // yhwang for big5 20021001
		{
			// Big5 code
			iRes = 2;
		}
		else 
#endif
		if ((c >= 32) && (c <= 126)) // ASCII code
			iRes = 1;
		else
		{
			iRes = 0;
			c = '_';
		}
		
		if ((iRes == 0) || (iRes == 1))
		{
#ifdef SUPPORT_CHINESE_FONT // Clead
			if ((c == '!') || (c == '"') || (c == '#') || (c == '$') ||
				(c == '&') || (c == '\'') || (c == '(') || (c == ')') ||
				(c == ',') || (c == ';') || (c == '=') || (c == '^'))
#ifdef USE_GB2312_FONT
			{
				c1 = 0x03 + 0xa0;
				c = c + 0x80;
				FSGUI_GBShowChar(0, (x + i), y, c1, c, iY, iCbCr);
			}
			else
#elif defined( USE_BIG5_FONT ) || defined( USE_BIG5_COMMON_FONT )
			{
				if(c < 114)
				{
					c1 = 0xa2;
					c = c + 0x8e;
				}
				else
				{
					c1 = 0xa3;
					c = c - 113 + 0x40;
				}
				FSGUI_Big5ShowChar(0, (x + i), y, c1, c, iY, iCbCr);
			}
			else
#endif
				FSGUI_ShowChar(0, (x + i), y, c, iY, iCbCr);
#else
			FSGUI_ShowChar(0, (x + i), y, c, iY, iCbCr);
#endif
			#ifdef PULIANG_6PIC_GUI	//yaowh add 05-02-04
			if (JPEG_THUMBNAIL_MODE == pFsJpeg->g_nJpegMode)
				i += 16;
			else
			#endif
				i += 9;
			p++;
		}

#if defined( USE_BIG5_FONT ) || defined( USE_BIG5_COMMON_FONT )
		else if(iRes == 2)  //BIG5 code
		{
			FSGUI_Big5ShowChar(0, (x + i), y, c, c1, iY, iCbCr);
			#ifdef PULIANG_6PIC_GUI	//yaowh add 05-02-04
			if (JPEG_THUMBNAIL_MODE == pFsJpeg->g_nJpegMode)
				i += 26;
			else
			#endif
				i += 14;
			p += 2;
		}
#endif
#ifdef USE_GB2312_FONT
		else if (iRes == 3) //GB code
		{
			FSGUI_GBShowChar(0, (x+i), y, c, c1, iY, iCbCr);

			//liweihua mod 2004-11-23
			//for display more Russian characters
			#ifdef ETON_DVD
			if(c == 0xA7)
			    i += 10;
			else 
			#endif
			#ifdef PULIANG_6PIC_GUI	//yaowh add 05-02-04
			if (JPEG_THUMBNAIL_MODE == pFsJpeg->g_nJpegMode)
				i += 26;
			else
			#endif
				i += 14;
			p += 2;
		} 
#endif
		else
		{
			c = '-';
			FSGUI_ShowChar(0, (x+i), y, c, iY, iCbCr); 
			#ifdef PULIANG_6PIC_GUI	//yaowh add 05-02-04
			if (JPEG_THUMBNAIL_MODE == pFsJpeg->g_nJpegMode)
				i += 16;
			else
			#endif
				i += 9;
			p++;
		}
		#ifdef PULIANG_6PIC_GUI	//yaowh add 05-02-04
		if (JPEG_THUMBNAIL_MODE == pFsJpeg->g_nJpegMode)
			if (i > 2540)
		else
		#endif
		if (i > 260)
			break;  // yhwang, for limiting the length of FSGUI_ShowString
	}
}
#endif //#if defined (MP3_LARGE_GUI) || defined (FS_BMP_GUI)

#ifdef FS_BMP_GUI
/*
    Function:In order to show little string in Sunplus New GUI
    Creator:Feeling
*/
void FSGUI_ShowLittleString(int x, int y, const char *s, BYTE iY, UINT16 iCbCr)
{
	int	i = 0;
	BYTE* p = (BYTE *)s;
	int length = 0;
	//sometime may exceed 25 chinese
	//zhaoyanhua modify. 2003-8-26 14:36
	#ifdef MP3_TXT_DISPLAY
	unsigned char ss[100];
	#else
	unsigned char ss[50];
	#endif
	unsigned char* ss_ptr = ss;

	strcpy(ss_ptr, p);
	
	while(p[i])
	{
		length++;
		i++;
	}
	i = 0;
	
	while (*p)
	{
		BYTE    c;
		BYTE    c1;
		int     iRes = 0;
        
		//  which character
		c = *p;
		c1 = *(p + 1);

#ifdef USE_GB2312_FONT
		if (((c >= 0xA1) && (c <= 0xF8)) && ((c1 >= 0xA1) && (c1 < 0xFF)))             
		 {
			// GB code
			iRes = 3;
		 }
		 else  
#endif
#if defined( USE_BIG5_FONT ) || defined( USE_BIG5_COMMON_FONT )
		if(((c >= 0xA1) && (c <= 0xF9)) && ((c1 >= 0x40 && c1 <= 0x7E) || (c1 >= 0xA1 && c1 <= 0xFE))) // yhwang for big5 20021001
		{
			// Big5 code
			iRes = 2;
		}
		else 
#endif
		if ((c >= 32) && (c <= 126)) // ASCII code
			iRes = 1;
		else
		{
			iRes = 0;
			c = '_';
		}
		
		if ((iRes == 0) || (iRes == 1))
		{
#ifdef SUPPORT_CHINESE_FONT // Clead
			if ((c == '!') || (c == '"') || (c == '#') || (c == '$') ||
				(c == '&') || (c == '\'') || (c == '(') || (c == ')') ||
				(c == ',') || (c == ';') || (c == '=') || (c == '^'))
#ifdef USE_GB2312_FONT
			{
				c1 = 0x03 + 0xa0;
				c = c + 0x80;
				FSGUI_GBShowChar(0, (x + i), y, c1, c, iY, iCbCr);
			}
			else
#elif defined( USE_BIG5_FONT ) || defined( USE_BIG5_COMMON_FONT )
			{
				if(c < 114)
				{
					c1 = 0xa2;
					c = c + 0x8e;
				}
				else
				{
					c1 = 0xa3;
					c = c - 113 + 0x40;
				}
				FSGUI_Big5ShowChar(0, (x + i), y, c1, c, iY, iCbCr);
			}
			else
#endif
				FSGUI_ShowLittleChar(0, (x + i), y, c, iY, iCbCr);
#else
			FSGUI_ShowLittleChar(0, (x + i), y, c, iY, iCbCr);
#endif
			i += 9;
			p++;
		}

#if defined( USE_BIG5_FONT ) || defined( USE_BIG5_COMMON_FONT )
		else if(iRes == 2)  //BIG5 code
		{
			FSGUI_Big5ShowChar(0, (x + i), y, c, c1, iY, iCbCr);
			i += 14;
			p += 2;
		}
#endif
#ifdef USE_GB2312_FONT
		else if (iRes == 3) //GB code
		{
			FSGUI_GBShowChar(0, (x+i), y, c, c1, iY, iCbCr);
			i += 14;
			p += 2;
		} 
#endif
		else
		{
			c = '-';
			FSGUI_ShowLittleChar(0, (x+i), y, c, iY, iCbCr); 
		
			i += 9;
			p++;
		}
		if (i > 300)
			break;  // for limiting the length of FSGUI_ShowString
	}
}
#endif

//void FSGUI_ShowImage(BYTE* MapArray, int xStart, int yStart, int width, int height)
//{
//        int i, j,x,y;
//        UINT8 z;
//
//        for (i=0; i<height; i++) {
//                for (j=0; j<width; j++) {
//                        x=xStart+j;
//                        y=yStart+i;
//                        z=*(MapArray+i*width+j);
//                        *Y_XY(x,y) = RGB8_Y[z];
//                        *C_XY(x,y) = RGB8_CrCb[z];
//                }
//        }
//}
#endif//20020801



⌨️ 快捷键说明

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