Пример #1
0
//ステータス表示
//int& stats
//stats ステータス文字画像のハンドル
void Display::stats(int& stats){
  SetDrawBright(0, 0, 0);//描画する画像の色光度を設定(黒)

  int y = 0, m = 0, w = 0;
  if (year > 9) y = 12;//2ケタの時に表示位置をずらす
  if (month > 9) m = 12;//2ケタの時に表示位置をずらす
  if (weeks > 9) w = 12;//2ケタの時に表示位置をずらす

  //年
  dispNum(40, 10, 12, 25, 0, 0, year, 0, stats);
  DrawRectGraph(62 + y, 10, 0, 50, 48, 26, stats, true, false);

  //月
  dispNum(120 + y, 10, 12, 25, 0, 0, month, 0, stats);
  DrawRectGraph(142 + m + y, 10, 50, 50, 24, 26, stats, true, false);

  //週
  dispNum(180 + y + m, 10, 12, 25, 0, 0, weeks, 0, stats);
  DrawRectGraph(202 + y + m + w, 10, 75, 50, 48, 26, stats, true, false);

  //お金
  dispNum(1020, 10, 12, 25, 0, 0, money, 0, stats);
  DrawRectGraph(950, 10, 175, 50, 48, 26, stats, true, false);

  //体力
  dispNum(620, 10, 12, 25, 0, 0, health, 0, stats);
  DrawRectGraph(550, 10, 125, 50, 48, 26, stats, true, false);
  
  SetDrawBright(255, 255, 255);//描画する画像の色光度を設定(白)
}
Пример #2
0
int main(int argc, char *argv[])
{   
  int i;
  int j;

  setvbuf(stdout,NULL,_IONBF,0);
 signal(SIGINT  ,handler);
 signal(SIGILL	,handler);
 signal(SIGFPE	,handler);
 signal(SIGSEGV	,handler);
 signal(SIGTERM	,handler);
 signal(SIGBREAK,handler);
 signal(SIGABRT,handler);
  printf("Starting...\n");
  for (j=0; j<4; j++)
    {
      for (i=0;i<10;i++)
	{
	  dispNum(i);
	  Sleep(400);
	}
      for (i=9;i>-1;i--)
	{
	  dispNum(i); Sleep(300);
	}
    }
  printf("Finished.\n");
    return 0;
}
Пример #3
0
void get_curr_setting_data(u8 setting)
{
	u8  setting_buff_high=0,setting_buff_low=0;
	switch(setting)
	{
		case 0:
			setting_buff_high=curr_date.year/100%100;
			setting_buff_low=curr_date.year%100;
#if defined(KPL_BIG_LED_MODULE)
		    	LED_STATUS_COL&=~LED_2POINT;
#else				
	    		LED_STATUS &= ~LED_2POINT;			
#endif
			break;
		case 1:
		case 2:
			if(rtc_mode == ALM_SET_MODE){
				setting_buff_high=curr_alm.hour;
				setting_buff_low =curr_alm.minutes;				
			}				
			else{
				setting_buff_high=curr_date.month;
				setting_buff_low = curr_date.day;
			}	
#if defined(KPL_BIG_LED_MODULE)
		    	LED_STATUS_COL|=LED_2POINT;
#else				
	    		LED_STATUS |= LED_2POINT;				
#endif
			break;
		case 3:
		case 4:
			if(rtc_mode == ALM_SET_MODE){
				setting_buff_high=curr_alm.hour;
				setting_buff_low =curr_alm.minutes;	
 			}
			else{
				setting_buff_high=curr_date.hour;
				setting_buff_low =curr_date.minutes;	
			}
#if defined(KPL_BIG_LED_MODULE)
		    	LED_STATUS_COL|=LED_2POINT;
#else				
	    		LED_STATUS |= LED_2POINT;					
#endif
		break;
		case 5:
  				setting_buff_low = curr_date.date;
	    		LED_STATUS &= ~LED_2POINT;					
			break;		
		default:break;			
	}	    

	    dispNum(((setting_buff_high/10)%10),3);
	    dispNum((setting_buff_high%10),2);
		
	    dispNum(((setting_buff_low/10)%10),1);
	    dispNum((setting_buff_low%10),0);

}
Пример #4
0
void Disp_Timer_OFF(void)
{
    dispchar('S',3);
    dispchar('L',2);
	
    dispNum((timer_disp/10)%10,1);
    dispNum(timer_disp%10,0);
}
Пример #5
0
void Disp_Num(void)
{

    dispNum((u8)((cfilenum/1000)%10),3);
    dispNum((u8)((cfilenum/100)%10),2);
    dispNum((u8)((cfilenum/10)%10),1);
    dispNum(cfilenum%10,0);
}
Пример #6
0
/*----------------------------------------------------------------------------*/
void Disp_Eq(void)
{
#ifdef DISP_EQ_STR
    dispchar('E',3);
    dispchar('Q',2);
    dispNum(eq_mode,0);
#else
    dispchar('E',2);
    dispNum(eq_mode,1);
#endif
}
Пример #7
0
void Disp_Scan_NO(void )
{
#if defined(FM_DISP_CH_STR)
    dispchar('C',3);
    dispchar('H',2);
#else	
    dispchar('P',2);
#endif
    dispNum((u8)((all_channl/10)%10),1);
    dispNum(all_channl%10,0);
    //LED_STATUS |= LED_FM;

}
Пример #8
0
void Disp_Balence(void)
{
#ifndef NO_PT_STR_DISPLAY
	dispstring("BA",0);
#endif
	if(PT_Balence_Val<7){
		dispchar('Z',1);
		dispNum(7-PT_Balence_Val,0);
	}
	else{
		dispNum(PT_Balence_Val-7,0);
	}	
}
Пример #9
0
void Disp_Fade(void)
{
#ifndef NO_PT_STR_DISPLAY
	dispstring("Fd",0);
#endif
	if(PT_Fade_Val<7){
		dispchar('W',1);
		dispNum(7-PT_Fade_Val,0);
	}
	else{
		dispNum(PT_Fade_Val-7,0);
	}	
}
Пример #10
0
void loop()
{
 i += 1;
 if (i > 9) i = 0;
 dispNum(i);
 delay(1000);
}
Пример #11
0
//途中経過表示
//int&,Parameters&,bool&はBG,numbers,words,Parameters,next,endの順
//BG 背景画像のハンドル
//numbers 数字画像のハンドル
//words 文字画像のハンドル
//Parameters ゲームパラメーター
//next 次の年に進ませるフラグ
//end ゲーム終了フラグ
void Display::result(int& BG, int& numbers, int& words, Parameters& object, bool& next, bool& end){
  
  Mouse mouse;
  GetMousePoint(&mouse.x, &mouse.y);

  DrawGraph(0, 0, BG, true);
  dispNum(200, 200, 18, 37, 0, 0, year, 0, numbers);//x年目が終わりました
  if (year > 9){
    DrawRectGraph(228 + 18, 200, 0, 100, 396, 37, words, true, false);
  }
  else  DrawRectGraph(228, 200, 0, 100, 396, 37, words, true, false);
 
  DrawRectGraph(200, 300, 0, 150, 540, 37, words, true, false);//今年はこんぐらい稼げました

  if (Mouse_Sq(200, 400, 288, 37, mouse)){//次の年へ進む
    SetDrawBright(255, 0, 0);
    if (GetMouseInput_Once(Mouse_Buttons::Left)){
      next = true;
    }
  }
  else SetDrawBright(255, 255, 255);
  DrawRectGraph(200, 400, 0, 200, 288, 37, words, true, false);

  if (Mouse_Sq(200, 500, 324, 37, mouse)){//一旦きゅ〜け〜
    SetDrawBright(255, 0, 0);
    if (GetMouseInput_Once(Mouse_Buttons::Left)){
      end = true;
    }
  }
  else SetDrawBright(255, 255, 255);
  DrawRectGraph(200, 500, 0, 250, 324, 37, words, true, false);

  SetDrawBright(255, 255, 255);//描画する画像の色光度を再設定
}
Пример #12
0
void Disp_RTC_Date()
{
#if defined(NEW_RTC_SETTING_CTRL)
	u8  setting_buff_high=0,setting_buff_low=0;

	if(new_rtc_setting==1){

		setting_buff_high=curr_date.year/100%100;
		setting_buff_low=curr_date.year%100;
	    	LED_STATUS &= ~LED_2POINT;		
	}
	else if(new_rtc_setting==2){

		setting_buff_high=curr_date.month;
		setting_buff_low = curr_date.day;
	    	LED_STATUS |= LED_2POINT;		
	}
	else if(new_rtc_setting==3){
		setting_buff_high=curr_alm.hour;
		setting_buff_low =curr_alm.minutes;	
	    	LED_STATUS |= LED_2POINT;				
	}
	else if(new_rtc_setting==4){

	    	  if (alm_sw)
       	     dispstring("ON",0);
       	 else
            		dispstring("OFF",0);
		 return;
	}


    dispNum(((setting_buff_high/10)%10),3);
    dispNum((setting_buff_high%10),2);
	
    dispNum(((setting_buff_low/10)%10),1);
    dispNum((setting_buff_low%10),0);
#else
	static _xdata u8 date_show=0;

	if(date_show++>4)date_show=0;
	get_curr_setting_data(date_show);
#endif
}
Пример #13
0
void disp_file_time(void)
{

    u16 sec;
    u16 min;
    u32 file_play_time;
    //mad_decode_dsc.total_time;

    file_play_time = get_music_play_time();

    sec = file_play_time % 60;
    min = (file_play_time/60) % 60;
#if defined(LED_USE_1X888)
    LED_STATUS |= LED_2POINT;
#else
    LED_STATUS |= LED_2POINT;
#endif

#if defined(COMMON_CATHODE)	
	LED_BUFF[2] |= BIT(LED_H);
#endif
    dispNum((u8)((min/10)%10),3);
    dispNum(min%10,2);
    dispNum((u8)((sec/10)%10),1);
    dispNum(sec%10,0);

#if defined(LED_USE_COMMON_4X8)	
    LED_STATUS |= LED_2POINT;
#elif defined(KPL_BIG_LED_MODULE)
    LED_STATUS &=~LED_2POINT;
    LED_STATUS_COL|=LED_2POINT;
#endif

    disp_active();

    /*
    sec = mad_decode_dsc.total_time % 60;
    min = (mad_decode_dsc.total_time/60) % 60;
    dispNum((u8)((min/10)%10));
    dispNum(min%10);
    dispNum((u8)((sec/10)%10));
    dispNum(sec%10);
    */
}
Пример #14
0
/*----------------------------------------------------------------------------*/
void Disp_Vol(void)
{
#if defined(K000_HG_898_V001)
	if(get_super_mute_lock()){
    		dispchar('V',2);
    		dispNum((0/10),1);
    		dispNum(0%10,0);
			return;
	}
#endif
#if defined(DISP_VOL_V_CHAR)||defined(K015_983_1_SW005_V001)||defined(K000_HG_898_V001)||defined(K566_JLH_566_V001)||defined(K769_JinRui_769_V001)||defined(K668_YJH_815_V001)||defined(K812_DingChuangXin_D903_V001)||defined(K566_JinRui_566_V001)||defined(K568_JinRui_568_V001)
    dispchar('V',2);
#elif defined(DISP_VOL_V_CHAR_ALIGN_LEFT)
    dispchar('V',3);
#endif
    dispNum((my_music_vol/10),1);
    dispNum(my_music_vol%10,0);
#ifdef VOL_DISP_COL_ICON
    LED_STATUS |= LED_2POINT;
#endif

}
Пример #15
0
void Disp_temp(void)
{
    dispNum((curr_temp/10),5);
    dispNum(curr_temp%10,4);
}
Пример #16
0
void Disp_RTC()
{
    if ((rtc_mode == RTC_PLAY_MODE)||(rtc_mode==ALM_UP_MODE))
    {
	    dispNum((u8)((curr_date.hour/10)%10),3);
	    dispNum(curr_date.hour%10,2);
	    dispNum((u8)((curr_date.minutes/10)%10),1);
	    dispNum(curr_date.minutes%10,0);
	   Disp_RTC_POINT();
    }	
    else if(rtc_mode == RTC_SET_MODE)
    {
	    get_curr_setting_data(rtc_set);
	    oppo_area_rtc(rtc_set);	

    }
    else if(rtc_mode == ALM_SET_MODE)
    {
    	if(alm_set==0){

#if defined(KPL_BIG_LED_MODULE)
    LED_STATUS_COL&= ~LED_2POINT;
#else	
	  LED_STATUS &= ~LED_2POINT;
#endif

#if defined(MINI_DIGIT_BOX)
    	  if (alm_sw)
            dispstring("A ON",0);
        else
            dispstring("AOFF",0);
#else
#ifdef RIGHT_ALIGN_DISP
    	  if (alm_sw)
            dispstring(" ON",0);
        else
            dispstring(" OFF",0);
#else
    	  if (alm_sw)
            dispstring("ON",0);
        else
            dispstring("OFF",0);
#endif
	#ifdef ALARM_ADJ_FLASH_ON_OFF
	    oppo_area_rtc(0);	
	#endif		
#endif				
    	}
#ifdef ALARM_SEL_SOURCE		
       else if(alm_set==3){

			if(alm_source==0){
            			dispstring("beep",0);
			}
			else if(alm_source==1){
            			dispstring("USB",0);

			}	
			else if(alm_source==2){
            			dispstring("FM",0);
			}		
	 }
#elif defined(ALARM_ADJ_VOL)
       else if(alm_set==3){
	    Disp_Vol();
	    oppo_area_rtc(2);	
	}
#endif	   
	else{
	    get_curr_setting_data(alm_set);
	    oppo_area_rtc(alm_set);	
	}
    }

}
Пример #17
0
void Disp_Filenum(void)
{
#if defined(K619_FXK_619_V001)

	disp_active();
	if(config_led_by_gpio==0){

		if(given_file_number>999)
		    dispNum((u8)((given_file_number/1000)%10),3);
		if(given_file_number>99)
		    dispNum((u8)((given_file_number/100)%10),2);
		if(given_file_number>9)
		    dispNum((u8)((given_file_number/10)%10),1);

		    dispNum(given_file_number%10,0);
	}
	else{
	    dispNum((u8)((given_file_number/1000)%10),3);
	    dispNum((u8)((given_file_number/100)%10),2);
	    dispNum((u8)((given_file_number/10)%10),1);
	    dispNum(given_file_number%10,0);
	}
#elif defined(DISP_DEV_AT_PLAY)
	disp_active();

#elif defined(DISP_FILE_NUM_NEW_TYPE)
	if(given_file_number>999)
	    dispNum((u8)((given_file_number/1000)%10),3);
	if(given_file_number>99)
	    dispNum((u8)((given_file_number/100)%10),2);
	if(given_file_number>9)
	    dispNum((u8)((given_file_number/10)%10),1);

	    dispNum(given_file_number%10,0);

    disp_active();		
#else

    dispNum((u8)((given_file_number/1000)%10),3);
    dispNum((u8)((given_file_number/100)%10),2);
    dispNum((u8)((given_file_number/10)%10),1);
    dispNum(given_file_number%10,0);
    disp_active();
	
#endif

#if defined(K189_JM_201_V001)
    LED_STATUS |= LED_MP3;
    LED_STATUS |= LED_PLAY;
#elif defined(K619_FXK_619_V001)
	if(config_led_by_gpio==0){

    		LED_STATUS |= LED_PLAY;
	}
#elif defined(K000_HG_898_V001)
    LED_STATUS |= LED_MP3;
#endif
	
}
Пример #18
0
void Disp_Freq(void )
{
    /*
    dispNum((u8)((fre_channl/10)%10),0);
    dispNum(fre_channl%10,0);
    dispchar(' ',0,0);
    dispNum((u8)((all_channl/10)%10),0);
    dispNum(all_channl%10,0);
    */
    if (frequency > 999)
    {
        dispNum((u8)((frequency/1000)%10),3);
    }
    else{
#if defined(FM_DISP_CH_STR)
    dispchar(' ',3);
#endif	
    }
    dispNum((u8)((frequency/100)%10),2);
    dispNum((u8)((frequency/10)%10),1);
    dispNum(frequency%10,0);

#ifdef RADIO_AM_WM_ENABLE
	if(work_mode == SYS_FMREV){
    		LED_STATUS |= LED_FM;
	}
	else if(work_mode == SYS_AMREV){
#if defined(KPL_BIG_LED_MODULE)
		LED_STATUS_AM |=LED_AM;
#endif
	}
#else	

#if defined(LED_USE_COMMON_4X8)
    LED_STATUS_FM |= LED_FM;
#else
    LED_STATUS |= LED_FM;
#endif

#endif

#if defined(FM_PLAY_KEY_PAUSE)    
#if defined(DISP_PAU_STRING_ONLY_IN_FM_MODE)
      if (play_status==0){
    		dispstring(" PAU",0);
#ifndef DISP_FM_STR_WHEN_PAUS			
		LED_STATUS &=~LED_FM;
      	}
#endif	  
#elif defined(DISP_PAUS_STRING)
      if (play_status==0){
    		dispstring("PAUS",0);

      }
#endif
#endif
	
#ifdef K619_FXK_619_V001
	if(config_led_by_gpio){
    		LED_STATUS |=BIT(LED_G);
	}
#endif
	
#ifdef UART_ENABLE
	printf("-----> Disp_Freq  %4u \r\n ",frequency);
#endif

}