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

📄 osd.c

📁 车载电子影音系统dvd播放系统原程序代码
💻 C
📖 第 1 页 / 共 5 页
字号:
                if((__bLOGO == LOGO_CDG) && (__bCountStop == 1))
                {
                    break;
                }
				
                // enable display logo flag while prepare to show LOGO
                __bLOGO=LOGO_DEFAULT;
				
                // LLY2.80, turn-on "logo display from open/close action" flag
                if(wParam==OSD_LOGO_FROM_OPEN)
                {
                    __bLOGO |= LOGO_FROM_OPEN;
                }
				
                _OSD_ShowLogo();
            }
        }
        break;
    case    MSG_OSDAPP:
        if (wParam == OSD_APPMODE_SETUP)
        {
            // Brian0.91
            _bPreviousUI = _bCurrentUI;
            _bCurrentUI = OSD_UI_SETUP;
            break;
        }
#ifndef NO_SCREEN_SAVER // Brian1.20
        else if (wParam == OSD_APPMODE_SCR1) // Brian0.91 enter SCR
        {
            OSD_ShowBitmap(OSD_SCR_MODE1);
			
        }
#endif
		
        if (wParam == OSD_APPMODE_EXIT ||
            wParam == (OSD_APPMODE_EXIT | EXIT_AUTOUPGRADE) )
        {
            // Brian0.86, clear region when auto-upgrade abort
            if (wParam == (OSD_APPMODE_EXIT | EXIT_AUTOUPGRADE) )
            {
#ifdef MINI_OSD_REGION
                _OSD_SetNormalOSDRegion();
#endif
                GDI_ClearRegion(0);
            }
			
			
            // Brian0.91
#ifndef NO_SCREEN_SAVER
            if (__bScreenSaver==TRIGGER_SCREEN_SAVER)
            {
                W99AV_WriteDRAMData(W99AV_DRAM_OSDT_ADR,0);
                W99AV_WriteDRAMData(W99AV_DRAM_OSDB_ADR,0);
				
                // restore the palette
                __dwW99AV_SrcDRAM = GDI_PAL_BACKUP_ADDR; 
                __dwW99AV_DestDRAM = PAL_ADDR;
                W99AV_DRAMCopy(256);
                W99AV_WriteDRAMData(W99AV_DRAM_NEW_LOAD_PAL, 0x10000);
				
                if (__bSetupMode)
                {
                    //GDI_LoadPalette(1); // load color table for Setup UI BMP
					
                    GDI_SetMixRatio(40);
                    GDI_ActivateRegion();
                    break;
                }
				
                //GDI_SetGDIPalEntry();
                GDI_ClearRegion_By_RISC(0);
                GDI_ActivateRegion();
				
                {
					extern  BYTE    __bNowBTNNumber;      // current selection BTNN
					
					//turn on highlight
					HAL_ControlHighlight(HAL_HLI_ACTION_SELECT, __bNowBTNNumber);
					HAL_Display(HAL_DISPLAY_SPST, TRUE);
					//clear VCD3.0 highlight
					HAL_VCD30_Area(FALSE);
					// Brian2.39a-2
					OSD_ShowHighlight(TRUE);
                }
                
            }
            // Brian1.10, fix bug when Display mode ->Setup->Screen saver->exit Setup, Display mode not recover.
            else
                _bCurrentUI = _bPreviousUI;
#else
			
            _bCurrentUI = _bPreviousUI;
#endif
			
			// Brian0.86
			// Reload 4-bit OSD palette, it has been destroied by Setup palette
#ifdef GDI_4_BIT_OSD
			GDI_SetGDIPalEntry();
			
			// if there is some bitmap copy operation in Setup, region 0 will remain some garbage.
			if (!__bThumbnailMode) // when Setup back to Thumbnail, all OSD has been displayed correct, so don't clear region
			{
#ifdef USE_ONE_OSD_REGION
				// Brian1.08, set back for 4-bit mode
				__bColorMode = COLOR_MODE_4_BIT;
#ifdef MINI_OSD_REGION // CT908S
                _OSD_SetNormalOSDRegion();
#else 
				GDI_InitialRegion (0); // initialize region to set it to 4-bit mode
#endif //MINI_OSD_REGION
				OSD_FillHeadtoDRAM(0); // brian1.11a, fix PAL mode, enter Setup, OSD V position shift (it was set to NTSC by Init region)
#endif
				GDI_ClearRegion (0);
			}
#endif
			
			// till now, if it is exiting from Setup, the active region is still region 1 (Setup region)
			// so the following function calls should contain code to set active region back to region 0 (for Display mode,...)
			
            switch(_bCurrentUI)
            {
            case OSD_UI_DISPLAY:
            case OSD_UI_NONE:
#ifdef SHOW_6_DISPLAY_MODE   //ch00.105
				if (__bDisplay == 1) //wendy.105
                {
					_OSD_DisplayVP(); //++CoCo1.21
                }
                else if ((__bDisplay == 2)||(__bDisplay == 3)||(__bDisplay == 4)||(__bDisplay == 5)) //wendy
                {
                    OSDVP_Update(MSG_CLEAR_ALL, NULL); 
                    _bCurrentUI = OSD_UI_DISPLAY;
					if((__dwDisplayStartTimer!=0) || (__wDiscType & BOOK_M1))//XULI1015
					{
						_OSD_DisplayLD(); //++CoCo1.21
					}
					else	//xuli1.07 Directly return to only show time & program state
					{
                        // Brian1.10, fix Exit Setup, NU message is not displayed the first time
                        OSDND_Update(MSG_DEFAULT_STATE, 0);
						
						_OSDLD_ShowTime();	//xuli1.07
						_OSDLD_ShowInfo(MSG_PROGRAM); //xuli1.07
					}
                }
                else // Brian1.05
                {
                    OSDND_Update(MSG_DEFAULT_STATE, 0);
                    //GDI_ActivateRegion();
                }				
                _RecoverNUNBMessage(); 
				
#else //#ifdef SHOW_6_DISPLAY_MODE   //ch00.105
                if (__bDisplay == 1)
                {
					_OSD_DisplayLD(); //++CoCo1.21
                }
                else if (__bDisplay == 2)
                {
                    OSDLD_Update(MSG_CLEAR_ALL, NULL);
					_OSD_DisplayVP(); //++CoCo1.21
                }
                else // Brian1.05
                {
                    OSDND_Update(MSG_DEFAULT_STATE, 0);
                }
				
                _RecoverNUNBMessage(); 
#endif //#ifdef SHOW_6_DISPLAY_MODE   //ch00.105
                break;
            case OSD_UI_FM:
#ifdef  SUPPORT_FM_BUTTONS //CoCo2.31, for code reduction.
            case OSD_UI_PROGRAM_LIST:
#endif
                FM_RecoverMenu(FM_RESTORE_MENU);
                // Brian1.10, also need to recover NU/NB message
                _RecoverNUNBMessage();
				
                break;
            case OSD_UI_THUMBNAIL:
                // When exit Setup, AdjustTVMode will always call THUMBNAIL_Recover when thumbnail mode,
                // so here I don't call it again
                // Brian0.91, but if it is exitting from screen saver, need recover it
#ifndef NO_SCREEN_SAVER
                if (__bScreenSaver==TRIGGER_SCREEN_SAVER)
                    THUMBNAIL_Recover(OSD_MSG_RECOVER_ALL);
#endif
				
                break;
#ifndef NO_DIGEST                
                // Brian1.00
            case OSD_UI_DIGEST:
				OSDDG_Update(MSG_DIGEST, wParam); //--CoCo1.21, remove _wDigestParam
                _bCurrentUI = OSD_UI_DIGEST;
                break;
#endif
            }
        }
        else
        {
			
#ifndef NO_SCREEN_SAVER
            // Brian1.10, enter screen saver mode doesn't change OSD UI, so don't it
            if (__bScreenSaver!=ENTER_SCREEN_SAVER)
                _bPreviousUI = _bCurrentUI;
#else
            _bPreviousUI = _bCurrentUI;
#endif
        }
		
        break;
    case    MSG_GUI:
        if (bSec)
        {
            // bSec != 0 ( ==> 0xFF) means we are entering an UI other than Display Mode UI
            // the new UI mode may be FM or Thumbnail, ...
            _bCurrentUI = (BYTE)wParam;
			
            // Brian1.10
            // It is ok to keep Display mode for F/W version before 1.07a for FM or Thumbnail mode
            // But now we support SUPPORT_SIMPLE_FM_PROGRAM, the OSD interaction is more complicated
            // it's better we clear Display mode to save troubles otherwise there will be problem. 
            __bDisplay = 0;
        }
        else
        {
			//CoCo1.21, only thumbnail mode will use bSec == 0 to tell OSD to exist thumbnail mode.
			//And the __bDisplay must be 0 because of the above case set it to 0 always.
			_bCurrentUI = OSD_UI_NONE;
			OSDND_Update(MSG_DEFAULT_STATE, 0);
        }
        break;
		// Brian0.86
		// Auto-upgrade Message
    case    MSG_AUTOUPGRADE:
        switch (wParam)
        {
        case AUTOUPGRADE_PREPARE:
//alex2.31,move mini_osd_region to avoid clear osd two times        
#ifdef MINI_OSD_REGION
            __bColorMode = COLOR_MODE_4_BIT;
            __dwRegionHeight = GDI_REGION_HEIGHT;
            // Need to set to the correct DRAM address
            //Alex2.32 ,Change RegionTAddress / RegionBAddress ,from 0x68000,0x74000-> 0x64000,0x69000
            __dwRegionTAddr = 0x64000 ; // Brian2.30-2nd
            __dwRegionBAddr = 0x69000 ; // Brian2.30-2nd
            GDI_ClearRegion_By_RISC(0);
            GDI_InitialRegion(0);
            GDI_ActivateRegion(); //open GDI
#endif
            GDI_ClearRegion(0);
            GDI_FILL_RECT(110, 60, 530, 350, OSDND_PALETTE_ENTRY_BACKGROUND);
            GDI_OUTPUT_TEXT(160, 80, aUpgradeFlash);
            //Brian1.21-3, show flash version on system.
            __wGDIString[0]=2;
            __wGDIString[1]=FLASH_SW_VERSION/10+CHAR_0;
            __wGDIString[2]=FLASH_SW_VERSION%10+CHAR_0;
            GDI_DRAW_STRING(480 ,80);          

            GDI_FILL_RECT(130, 114, 505, 116, OSDND_PALETTE_ENTRY_BOTTOM_STRING);
            GDI_OUTPUT_TEXT(230, 210, aUpgradePrrpareData);
            break;
        case AUTOUPGRADE_CHECK:
            GDI_OUTPUT_TEXT(138, 280, aUpgradeCheck);
            GDI_SetTextColor(TEXT_FG_COLOR, OSDND_PALETTE_ENTRY_BOTTOM_STRING);
            GDI_OUTPUT_TEXT(351, 280, aUpgradeAnswer);
            GDI_SetTextColor(TEXT_FG_COLOR, OSDND_PALETTE_ENTRY_UPPER_RIGHT_STRING);
            break;
        case AUTOUPGRADE_ABORT:
            GDI_FILL_RECT(110, 200, 530, 350, OSDND_PALETTE_ENTRY_BACKGROUND);
            GDI_SetTextColor(TEXT_FG_COLOR, OSDND_PALETTE_ENTRY_BOTTOM_STRING);
            GDI_OUTPUT_TEXT(150, 210, aUpgradeAbort);
            break;
        case AUTOUPGRADE_CHECKSUM:
            {
				extern DWORD _dwINITIALTemp;
				GDI_FILL_RECT(110, 200, 530, 350, OSDND_PALETTE_ENTRY_BACKGROUND);
				GDI_OUTPUT_TEXT(180, 210, aUpgradeCheckSUM);
				GDI_OUTPUT_NUMBERHEX(190, 280,(WORD)_dwINITIALTemp); // Chuan1.00-2, Display Hex Number
            }
            break;
        case AUTOUPGRADE_WRITING:
            GDI_FILL_RECT(110, 200, 530, 350, OSDND_PALETTE_ENTRY_BACKGROUND);
            GDI_OUTPUT_TEXT(190, 210, aUpgradeWriting);
            break;
            //alex1.24a,Set different color to show error        
            //----------------------------------------------------    
        case AUTOUPGRADE_FAILED:
            {
                extern DWORD _bINITIALTemp;
                switch (_bINITIALTemp)
                {
                case  FLASH_FAIL_CDROMDECODE:   				        
                    GDI_FILL_RECT(140, 150, 500, 320, GDI_ENTRY_4B_COLOR_GREEN);
                    GDI_SetTextColor(TEXT_BG_COLOR,GDI_ENTRY_4B_COLOR_GREEN );
                    GDI_OUTPUT_TEXT(230, 210, aUpgradeFailDecode);  
                    break;
                case FLASH_FAIL_USER_ABORT:
                    GDI_FILL_RECT(140, 150, 500, 320, GDI_ENTRY_4B_COLOR_ORANGE);
                    GDI_SetTextColor(TEXT_BG_COLOR,GDI_ENTRY_4B_COLOR_ORANGE );
                    GDI_OUTPUT_TEXT(200, 210, aUpgradeFailUserAbort);  
                    break;
                case FLASH_FAIL_INVALID_DISC:
                    GDI_FILL_RECT(140, 150, 500, 320, GDI_ENTRY_4B_COLOR_YELLOW);
                    GDI_SetTextColor(TEXT_BG_COLOR,GDI_ENTRY_4B_COLOR_YELLOW );
                    GDI_OUTPUT_TEXT(210, 210, aUpgradeFailInvalidDisc);  
                    break;
                case FLASH_FAIL_CHECKSUM:
                    GDI_FILL_RECT(140, 150, 500, 320, GDI_ENTRY_4B_COLOR_RED);
                    GDI_SetTextColor(TEXT_BG_COLOR,GDI_ENTRY_4B_COLOR_RED );
                    GDI_OUTPUT_TEXT(220, 210, aUpgradeFailCheckSum);  
                    break;
                }			
            }
            break;
        }        
        break;		
        //alex1.22a,20040204 combine gototime , search,bookmark
//Combine MSG_BOOKMARK/SETSERACH/SETGOTOTIME/SEARCH/GOTOTIME in _OSD_processNoneDisplaymessage
//**********************************************************************
#ifdef SUPPORT_BOOKMARK //CoCo1.24, add SUPPORT_BOOKMARK define
        case MSG_BOOKMARK:	
            OSDSRCH_BookMark(bMessage, wParam, bSec);
            if (wParam == OSD_CANCEL_TIME || wParam == OSD_COMPLETE_TIME)
            {
                _OSD_ShowDisplayMode();
			    _RecoverNUNBMessage(); // Brian1.02

            }            
            break;
#endif
		case MSG_SETSEARCH:	

            // Brian1.24a, no need to clear Search Mode UI if the current UI is not Search UI
            if ((wParam == OSD_CANCEL_TIME || wParam == OSD_COMPLETE_TIME) && (_bCurrentUI != OSD_UI_SEARCH))
            {
                break;
            }
		    OSDSRCH_Search(bMessage, wParam, bSec);  
            //alex1.22a,20040210 remove double define osd part #12            
			//if (wParam == OSD_CANCEL_SEARCH || wParam == OSD_COMPLETE_SEARCH)				    
            if (wParam == OSD_CANCEL_TIME || wParam == OSD_COMPLETE_TIME)				    
			{
    		    // Leave Search
	    		_OSD_ShowDisplayMode();
		    	_RecoverNUNBMessage(); // Brian1.02
			}			    
            break;
        case MSG_SEARCH:				    
            OSDSRCH_Search(bMessage, wParam, bSec);            
            break;
//**********************************************************************
    
		case MSG_SETPROGRAM:
			_bPreviousUI = _bCurrentUI; // Brian1.10
			_bCurrentUI = OSD_UI_DVD_PROGRAM;
			OSDND_Update(MSG_DEFAULT_STATE, 0); // Brian1.10-2, must call this to set OSD message state (pos, color..) to normal display
			GDI_ClearRegion(0);
		case MSG_CLEARPROGRAM:
			if ( _bCurrentUI == OSD_UI_DVD_PROGRAM)
#ifndef SUPPORT_SIMPLE_FM_PROGRAM //Kevin1.10       
				if (__wDiscType & (BOOK_DVD|BOOK_VCD|BOOK_SVCD|BOOK_CVD|BOOK_CDDA)) // Brian0.90 add CDDA
#endif
					
				{
					OSDPRGM_Display(bMessage); //CoCo1.21, modify the function declaraction
					if (bMessage == MSG_CLEARPROGRAM)
					{     
						_bCurrentUI = _bPreviousUI; // Brian1.10

                        _OSD_SetNormalOSDRegion(); //CoCo.230, set the normal OSD region.

                        OSDND_Update(MSG_DEFAULT_STATE, 0); //CoCo2.39, Fix the bug about KEY_PROGRAM==>KEY_PROGRAM, the background of normal display is changed to transparent.
						
#ifdef SUPPORT_SIMPLE_FM_PROGRAM //Kevin1.10            
						if (_bCurrentUI == OSD_UI_FM)
							FM_RecoverMenu(FM_RESTORE_MENU); //restore to previous FM menu
						else if (_bCurrentUI == OSD_UI_THUMBNAIL)
							THUMBNAIL_Recover(OSD_MSG_RECOVER_ALL); //restore to previous Thumbnail
						else 
							_OSD_ShowDisplayMode();
						
#else
						_OSD_ShowDisplayMode();

⌨️ 快捷键说明

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