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

📄 fsosd.c

📁 一个两碟控制的VCD的代码,两碟之间的转动及连续播放,已大量生产的CODE.
💻 C
📖 第 1 页 / 共 3 页
字号:
    /* Don't display if region is suppressed */
    if ( !(OSD_suppressed_regions & OSD_TIME_REGION_MASK) )
        OSD_update_regions |= OSD_TIME_REGION_MASK;    

    if ( !(OSD_suppressed_regions & OSD_TRACK_REGION_MASK) )
        OSD_update_regions |= OSD_TRACK_REGION_MASK;
#endif
}
#endif

/*
 *  OSD_clear_region():
 *  This function is used to clear a specified OSD region.
 *
 *  Inputs:
 *      region -    OSD region to be cleared (1 to OSD_MAX_REGIONS).
 */
void
OSD_clear_region(int region)
{
    int     i;
    char    *string;
    unsigned short  tmp_mask;
    unsigned short  region_mask = ptrLshift[region-1];
  
    if ( !(OSD_displayed_regions & region_mask) )
        return;  /* no osd showing in region..don't bother */

    if ( region_mask & (OSD_TIME_REGION_MASK|OSD_TRACK_REGION_MASK) )
    {
        if (region_mask == OSD_TIME_REGION_MASK) {
            string = OSD_new_time;	    
#ifdef CUST4
	    OSD_suppressed_regions &= ~OSD_TIME_REGION_MASK;
	    if (OSD_msg_override)
		OSD_msg_override = 0;
#endif /* CUST4 */
	} else { /* TRACK_REGION */
            string = OSD_new_track;
        }
        for (i = 0; i < ( (region_mask == OSD_TIME_REGION_MASK) ?
		         OSD_TIME_SIZE : OSD_TRACK_SIZE ); i++)
        {
            string[i] = ' ';                            
        }
    }
    else  /* Generic OSD region */
    {
        EPRINTF(("I'm clearing generic\n"));
        for (i = 0; i < OSD_MAX_CHAR; i++)
        {
	    asm("nop");
            OSD_new[i] = ' ';
        }

#ifndef CUST4 /*CUST4 messages don't overlap*/
        /* Do clean up if this region's message overlapped on other regions */
        if ( region_mask & (OSD_SECT_1|OSD_SECT_2) )
        {   /* "Unsuppress" regions */
	    /* Check adjacent region */
	    tmp_mask = region_mask << 1;
	    if (OSD_suppressed_regions & tmp_mask) { 
                OSD_suppressed_regions &= ~tmp_mask;

		/* Check last region in line, if in first section */
		if (region_mask & OSD_SECT_1) {
		    tmp_mask = region_mask << 2;
		    if (OSD_suppressed_regions & tmp_mask) { 
			OSD_suppressed_regions &= ~tmp_mask;
		    } 
		}
 	    } 
        }
#endif /*CUST4*/
	            
    }
    OSD_update_regions |= region_mask;

    OSD_copy_data(0); /* Clear OSD region */
    OSD_displayed_regions &= ~region_mask;

#ifdef CUST4
    if (region == OSD_blink_region) {
	OSD_blink_region = OSD_blink_time = 0;
    }
#endif
}

/*
 *  OSD_clear_all():
 *  This function is used to clear all of the OSD regions at once. 
 *  Calling this function is much more efficient than clearing fifteen 
 *  regions with repeated calls to OSD_clear_region().
 *
 *  NOTE: moved to osdcore.c.. used in time critical situation.
 */


#ifndef BF43
/*
 *  OSD_clear_line():
 *  This function is used to clear a specified OSD line.
 *
 *  Inputs:
 *      line_index -   	index of OSD line to be cleared.
 *	line_mask -	mask values of the regions in the line.
 */
void
OSD_clear_line(int line_index, unsigned short line_mask)
{
    int i, region_index;
    unsigned int region_mask;
    
    for (i = 0; i < OSD_MAX_CHAR; i++)
    {    
        OSD_new[i] = ' ';
    }
    region_index = OSD_REGIONS_PER_LINE * line_index; 
    region_mask = ptrLshift[region_index];
    OSD_update_regions |= (unsigned short)region_mask;
    OSD_regions[region_index].end = OSD_MAX_CHAR;

    OSD_copy_data(1);  /* clear DRAM */

    /* Clearing status bits */
    OSD_displayed_regions &= ~line_mask;
    OSD_scheduled_regions &= ~line_mask;
    OSD_suppressed_regions &= ~line_mask;

#ifdef CUST4 /* currently not used by CUST4 */
    {
	unsigned int blink_region_mask = ptrLshift[OSD_blink_region-1];
	if (blink_region_mask & line_mask) {
	    OSD_blink_region = OSD_blink_time = 0;
    }
#endif
}
#endif /* not BF43 */

#if (CUST4 || CUST71)
/*
 *  OSD_delay_clear_region():
 *  This function is used to clear a specified OSD region after a 
 *  specified delay time.
 *
 *  Inputs:
 *      region -    	OSD region to be cleared (1 to OSD_MAX_REGIONS).
 *	delay_time -	Amount of delay time(in secs) before actual clearing.
 */
void
OSD_delay_clear_region(int region, int delay_time)
{
    unsigned short region_mask = ptrLshift[region-1];

    if ( !(OSD_displayed_regions & region_mask) )
        return;  /* no osd showing in region..don't bother */

    OSD_schedule_time[region-1] = glbTimer + ((int) ONE_SECOND * delay_time);
    OSD_scheduled_regions |= region_mask;  /* set bit */

#ifdef CUST4
    if (region == OSD_blink_region) {
	OSD_blink_region = 0; /* So that blinking region can be cleared */
    }
#endif
}
#endif

#ifdef ECHO

/*
 * OSD for echo. We support up to 15 levels.
 */
#define ECHO_LEVEL_POS	6
#define CECHO_LEVEL_POS	4

unsigned char echo_msg[] = "ECHO +0 ";
#ifdef BILINGUAL_OSD
unsigned char c_echo_msg[] = { CN_HUI2, CN_SHENG1, ' ', '+', '0', ' ', 0};
#endif

void OSD_echo()
{
    int tmp, pos, cpos;
    if (vcx_echo == -1) {
       #ifdef FU265
         #ifdef USE_ECHO
          panel_karaoke_off(0);
         #endif
       #endif
       #ifdef SVA_06MM
           panel_karaoke_off(0);
       #endif
 	OUTOSD(OSD_KARAOKE_REGION, MSG_mic_off, MSG_c_mic_off, 5);
    } else {
	if (vcx_echo == 0){
       #ifdef FU265
           #ifdef USE_ECHO
             panel_karaoke_off(1);
           #endif
       #endif

       #ifdef SVA_06MM
           panel_karaoke_off(1);
       #endif
       OUTOSD(OSD_KARAOKE_REGION, MSG_mic_on, MSG_c_mic_on, 5);
     } else {
	    tmp = vcx_echo;
	    pos = ECHO_LEVEL_POS;
	    cpos = CECHO_LEVEL_POS;

	    if (vcx_echo >= 10) {
		echo_msg[ECHO_LEVEL_POS] = '1';
#ifdef BILINGUAL_OSD
		c_echo_msg[CECHO_LEVEL_POS] = '1';
#endif
		tmp -= 10;
		pos++;
		cpos++;
	    }
	    
	    echo_msg[ECHO_LEVEL_POS+1] = ' ';
	    echo_msg[pos] = '0' + tmp;
#ifdef BILINGUAL_OSD
	    c_echo_msg[CECHO_LEVEL_POS+1] = ' ';
	    c_echo_msg[cpos] = '0' + tmp;
#endif

	    OUTOSD(OSD_KARAOKE_REGION, echo_msg, c_echo_msg, 5);
	}
    }
}
#endif /* #ifdef ECHO */


#ifdef CUST4
/* No OSD_pitch_bar() for CUST4 */
void OSD_pitch_bar(level)
int level;
{
}
#else
/*
 * Display pitch/volume bar. 8 characters, one space, +/- level
 */
#if 0
PRIVATE unsigned char	pitchbarbuf[12] = "           ";
#else
PRIVATE unsigned char	pitchbarbuf[15];
#endif
void OSD_pitch_bar(level)
int level;
{
#if 0   /*PV force use of 'musical' pitch bar */
    int i, j;

    for (i = 0; i < 8; i++) {
	asm("nop");
	pitchbarbuf[i] = FONT_SS;
    }

    if (level >= 0) {
	i = 4;
	j = level;
	if (level >= 4)	{
	    pitchbarbuf[4] = pitchbarbuf[5] = FONT_LL;
	    i = 6;
	    j -= 4;
	}
	pitchbarbuf[i]   = posbar_array[j].pair[0];
	pitchbarbuf[i+1] = posbar_array[j].pair[1];

	pitchbarbuf[3]	 = FONT_SL;
	pitchbarbuf[9]	 = '+';
	pitchbarbuf[10]	 = level + '0';
    } 

    if (level <= 0) {
	i = 3;
	j = level;
	if (level <= -4) {
	    pitchbarbuf[2] = pitchbarbuf[3] = FONT_LL;
	    i = 1;
	    j += 4;
	}
	j += 3;
	pitchbarbuf[i]   = negbar_array[j].pair[1];
	pitchbarbuf[i-1] = negbar_array[j].pair[0];

	pitchbarbuf[4]	 = FONT_LS;
	pitchbarbuf[9]	 = '-';
	pitchbarbuf[10]	 = -level + '0';
    }

    if (level == 0) pitchbarbuf[9] = pitchbarbuf[10] = ' ';

    OUTOSD(OSD_KARAOKE_REGION, pitchbarbuf, pitchbarbuf, 5);
#else
    int i;
    for (i = 0; i < 15; i++) {
	asm("nop");
	pitchbarbuf[i] = FONT_KEYSCALE;
    }
    
    pitchbarbuf[15]	 = '\0';
    pitchbarbuf[0]       = FONT_KEYLOW; 
    pitchbarbuf[7]       = FONT_KEYMID;
    pitchbarbuf[14]      = FONT_KEYHIGH;
    pitchbarbuf[level+7] = FONT_KEYCURR;

    OUTOSD(OSD_KARAOKE_REGION, pitchbarbuf, pitchbarbuf, 5);
#endif

}
#endif /* CUST4 */

#if (PLAY20 && !CUST4)
void OSD_digest_menu(int selection)
{
    char * line_1, * line_2;
#ifdef BILINGUAL_OSD
    char * c_line_1, * c_line_2;
#endif

    if (selection == 2) {
	assign_osd_msg(line_1, MSG_intro_1_disc_X, c_line_1, 
		       MSG_c_intro_1_disc_X);
#ifdef JUMPGAME
	assign_osd_msg(line_2, MSG_track_X_game_4, c_line_2,
		       MSG_c_track_X_game_4);
#else
	assign_osd_msg(line_2, MSG_track_X_exit_4, c_line_2,
		       MSG_c_track_X_exit_4);
#endif
    }
    else {
	assign_osd_msg(line_1, MSG_intro_1_disc_2, c_line_1, 
		       MSG_c_intro_1_disc_2);
#ifdef JUMPGAME
	assign_osd_msg(line_2, MSG_track_3_game_4, c_line_2,
		       MSG_c_track_3_game_4);
#else
	assign_osd_msg(line_2, MSG_track_3_exit_4, c_line_2,
		       MSG_c_track_3_exit_4);
#endif
    }    
    
    OUTOSD(1, MSG_digest_menu, MSG_c_digest_menu, 0);
    OUTOSD(10, line_1, c_line_1, 0);
    OUTOSD(13, line_2, c_line_2, 0);
#ifdef JUMPGAME
    OUTOSD(7, MSG_exit_5, MSG_c_exit_5, 0);
#endif
}
#endif /* PLAY20 && !CUST4 */

#ifdef BILINGUAL_OSD
/*
 * Toggling OSD language
 * For CUST3 : NO_OSD -> Chinese -> English -> NO_OSD
 * For others: Chinese -> English -> Chinese
 */
void OSD_language_change()
{
    extern int DiscMode;
    int i, k = 1;
    unsigned short displayed_region;

    if (OSD_language == ENGLISH_OSD) {
	OSD_language = CHINESE_OSD;
	if (OSD_displayed_regions) {
	    displayed_region = OSD_displayed_regions;
	} else {
	    displayed_region = OSD_display_backup;
	    OSD_update_regions = OSD_update_backup;
	    OSD_scheduled_regions = OSD_schedule_backup;
	}
    } else {
	displayed_region = OSD_displayed_regions;
	OSD_language = ENGLISH_OSD;
    } 
    for (i = 0; i < OSD_MAX_REGIONS; i++) {
	if (displayed_region & k)
	    OUTOSD(i+1, english_ptr[i], chinese_ptr[i], 
		   OSD_KEEP_TIMEOUT);
	k = k << 1;
    }

     OSD_update_info();
}
#endif


⌨️ 快捷键说明

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