📄 osd.c
字号:
// Side Effect : none.// Notes : // *********************************************************************void _OSD_UpdateStatus(BYTE bMessage, WORD wParam){ switch (bMessage) { case MSG_TOTALTRACKS: gcShowStatus.wTotalTracks=wParam; break; case MSG_STOPWAIT: _bWaitingCnt=2; if(wParam) { // set the system information to gcShowStatus gcShowStatus = *((STATUS *) __bpDataPointer); __bpDataPointer=NULL; } break; case MSG_ENDLIST: gcShowStatus.bPlayingMode=MSG_STOP; break; case MSG_PBC: // update the PBC status gcShowStatus.bPBCMode=LOBYTE(wParam);#ifndef NO_DISC_MODE //CoCo2.37 if(__wDiscType & BOOK_DVD) { } else#endif //#ifndef NO_DISC_MODE //CoCo2.37 { gcShowStatus.bStill=LOBYTE(wParam); } break; case MSG_PLAYING: case MSG_STEP: case MSG_FAST: case MSG_STOP: case MSG_PAUSE: case MSG_SLOW: case MSG_SCANFORWARD: case MSG_SCANBACKWARD: case MSG_FREEZE: // update the play mode gcShowStatus.bPlayingMode=bMessage; // update the speed factor // now the speed factor is valid for SCF/SCB/SLOW only // OSD display is level * 2 //_bSpeedFactor=LOBYTE(wParam); _bSpeedFactor=1; for(_bOSDTemp=0; _bOSDTemp<(BYTE)(wParam); _bOSDTemp++) { _bSpeedFactor*=2; } //If the status is SCFx? and cross the track, main flow will send MSG_PLAY to update the playing mode. //At this time, we will delete the MSG_SCANFORWARD/MSG_SCANBACKWARD/MSG_FAST/MSG_SLOW if they are in the stack. break; case MSG_MOTION: // update the play item mode // wParam=TRUE, means play motion, otherwise play STILL gcShowStatus.bStill=!LOBYTE(wParam); break; case MSG_OPEN: case MSG_POWER: if (bMessage == MSG_POWER) gcShowStatus.bPowerDown=LOBYTE(wParam); // set play mode as STOP gcShowStatus.bPlayingMode=MSG_STOP; if (bMessage == MSG_POWER) { //CoCo, update __bLOGO variable in OSD kernel? __bLOGO=LOGO_NONE; // clear OSD when power down if (wParam) { GDI_ClearRegion(0); } } break; case MSG_TRACK: // update the current play track gcShowStatus.wCurrentTrack=wParam; // LLY2.53, expand the time value from WORD to DWORD unit // Since, we will use [23:16]:hour, [15:8]:min, [7:0]: sec //gcShowStatus.wCurrentTime=0; gcShowStatus.dwCurrentTime=0; break; default: break; }}//***************************************************************************// Function : _OSD_UpdateMessage// Abstract : This function will some specific messages when receiving // : bMessage.// Arguments : bMessage: the input message// Return : none.// Side Effect : none.// Notes : //***************************************************************************void _OSD_UpdateMessage(BYTE bMessage){ switch(bMessage) { case MSG_WAITING: _OSD_ClearMsg(MSG_OPEN); //Clear MSG_OPEN because MSG_WAITING and MSG_OPEN are excursive break; case MSG_STOPWAIT: _OSD_ClearMsg(MSG_WAITING); //Clear MSG_WAITING break; case MSG_STOP: _OSD_ClearMsg(MSG_ANGLE_CTL); //Clear MSG_ANGLE_CTL break; case MSG_OPEN: case MSG_POWER: _OSD_ClearMsg(MSG_WAITING); //Clear MSG_WAITING _OSD_ClearMsg(MSG_DISCTYPE); //Clear MSG_DISCTYPE _OSD_ClearMsg(MSG_ANGLE_CTL); //Clear MSG_ANGLE_CTL _OSD_ClearMsg(MSG_ABNORMAL_DISC); //Clear MSG_ABNORMAL_DISC break; //CoCo0.76, clear the playing message from the stack. case MSG_PLAYING: case MSG_STEP: case MSG_FAST: case MSG_PAUSE: case MSG_SLOW: case MSG_SCANFORWARD: case MSG_SCANBACKWARD: case MSG_FREEZE: _OSD_ClearMsg(MSG_STEP); _OSD_ClearMsg(MSG_FAST); _OSD_ClearMsg(MSG_PAUSE); _OSD_ClearMsg(MSG_SLOW); _OSD_ClearMsg(MSG_SCANFORWARD); _OSD_ClearMsg(MSG_SCANBACKWARD); _OSD_ClearMsg(MSG_FREEZE); break; case MSG_REPEATAB: //CoCo0.91, Clear MSG_REPEATAB because our flow will not send bSec == 0 to clear MSG_REPEATAB. //If MSG_REPEATAB is overwritten by other forever message, it may not be cleared in the stack. _OSD_ClearMsg(MSG_REPEATAB); break; case MSG_MUTE: _OSD_ClearMsg(MSG_MUTE); break; default: break; } }//***************************************************************************// Function : _OSD_PushForeverMsg// Abstract : This function will push the forever message to the stack.// Arguments : bMessage: the input message.// Return : none.// Side Effect : none.// Notes : //***************************************************************************void _OSD_PushForeverMsg(BYTE bMessage){ //Get message's position _bOSDTemp = OSDND_GetMessagePos(bMessage); switch (_bOSDTemp) { case OSD_ND_UPPER_RIGHT_REGION: if (_OSDNUCurMsg.bMessage != MSG_NULL) { if (_OSDNUCurMsg.bSec == 0xFF) { if (_OSD_SearchMsg(bMessage)) return; //push the forever message to the stack. _OSDNUStack[_bOSDNUIndex].bMessage = _OSDNUCurMsg.bMessage; _OSDNUStack[_bOSDNUIndex].wParam = _OSDNUCurMsg.wParam; _OSDNUStack[_bOSDNUIndex].bSec = _OSDNUCurMsg.bSec; _bOSDNUIndex++; } } break; case OSD_ND_BOTTOM_REGION: if (_OSDNBCurMsg.bMessage != MSG_NULL) { if (_OSDNBCurMsg.bSec == 0xFF) { if (_OSD_SearchMsg(bMessage)) return; //push the forever message to the stack. _OSDNBStack[_bOSDNBIndex].bMessage = _OSDNBCurMsg.bMessage; _OSDNBStack[_bOSDNBIndex].wParam = _OSDNBCurMsg.wParam; _OSDNBStack[_bOSDNBIndex].bSec = _OSDNBCurMsg.bSec; _bOSDNBIndex++; } } break; default: break; }}//***************************************************************************// Function : _OSD_PushForeverMsg// Abstract : This function will push the forever message to the stack.// Arguments : bMessage: the input message.// Return : none.// Side Effect : none.// Notes : //***************************************************************************BYTE _OSD_SearchMsg(BYTE bMessage){ //Get message's position _bOSDTemp = OSDND_GetMessagePos(bMessage); switch (_bOSDTemp) { case OSD_ND_UPPER_RIGHT_REGION: for (_bOSDTemp = 0; _bOSDTemp < _bOSDNUIndex; _bOSDTemp++) { if (_OSDNUStack[_bOSDTemp].bMessage == bMessage) return TRUE; } break; case OSD_ND_BOTTOM_REGION: for (_bOSDTemp = 0; _bOSDTemp < _bOSDNBIndex; _bOSDTemp++) { if (_OSDNBStack[_bOSDTemp].bMessage == bMessage) return TRUE; } break; default: break; } return FALSE;}//***************************************************************************// Function : _OSD_SetCurrentMsg// Abstract : This function will set the message to normal upper or bottom message.// Arguments : bMessage: the input message.// Return : none.// Side Effect : none.// Notes : //***************************************************************************void _OSD_SetCurrentMsg(BYTE bMessage, WORD wParam, BYTE bSec){ //Get message's position _bOSDTemp = OSDND_GetMessagePos(bMessage); switch (_bOSDTemp) { case OSD_ND_UPPER_RIGHT_REGION: //Save current normal upper message _OSDNUCurMsg.bMessage = bMessage; _OSDNUCurMsg.wParam = wParam; _OSDNUCurMsg.bSec = bSec; //Save the display time for normal upper message. _wOSDNUDisplayTickCount = (WORD)((WORD)bSec*COUNT_1_SEC); _dwOSDNUStartTickCount = OS_GetSysTimer(); break; case OSD_ND_BOTTOM_REGION: //Save current normal bottom message _OSDNBCurMsg.bMessage = bMessage; _OSDNBCurMsg.wParam = wParam; _OSDNBCurMsg.bSec = bSec; //Save the display time for normal bottom message. _wOSDNBDisplayTickCount = (WORD)((WORD)bSec*COUNT_1_SEC); _dwOSDNBStartTickCount = OS_GetSysTimer(); break; default: break; }}//***************************************************************************// Function : OSD_Initial// Abstract : This function will initialize OSD-relative variables.// Arguments : none.// Return : none.// Side Effect : none.// Notes : //***************************************************************************void OSD_Initial(void){ //Initialize GDI. The palette is also initialized in this function. GDI_Initial(); //Initialize normal display status. OSDND_Update(MSG_INITIAL_PALETTE, 0); OSDND_Update(MSG_DEFAULT_STATE, 0); //Set OSD language. //_bOSDLang = (__SetupInfo.bOSDLanguage - SETUP_LANGUAGE_OSD_BASE); //--CoCo2.38 _OSD_ResetState(); GDI_ClearRegion(0); //CoCo.CT909}//***************************************************************************// Function : _OSD_RemoveMsgFromStack// Abstract : This function will remove the message from stack.// Arguments : none.// Return : none.// Side Effect : none.// Notes : //***************************************************************************void _OSD_RemoveMsgFromStack(BYTE bMessage){ //Get message's position _bOSDTemp = OSDND_GetMessagePos(bMessage); switch (_bOSDTemp) { case OSD_ND_UPPER_RIGHT_REGION: for (_bOSDTemp=0; _bOSDTemp < OSD_MAX_DEPTH_OF_MSG_STACK; _bOSDTemp++) { if (bMessage == _OSDNUStack[_bOSDTemp].bMessage) { _OSDNUStack[_bOSDTemp].bMessage = MSG_NULL; if (_bOSDTemp == (_bOSDNUIndex-1)) { // we just clear the topest msg from the stack // so decrease index by 1 _bOSDNUIndex--; } } } break; case OSD_ND_BOTTOM_REGION: for (_bOSDTemp=0; _bOSDTemp < OSD_MAX_DEPTH_OF_MSG_STACK; _bOSDTemp++) { if (bMessage == _OSDNBStack[_bOSDTemp].bMessage) { _OSDNBStack[_bOSDTemp].bMessage = MSG_NULL; if (_bOSDTemp == (_bOSDNBIndex-1)) { // we just clear the topest msg from the stack // so decrease index by 1 _bOSDNBIndex--; } } } break; default: break; }}//***************************************************************************// Function : _OSD_ClearMsg// Abstract : This function will clear the message and remove the message from the stack.// Arguments : bMessage: the message that we want to clear.// Return : none.// Side Effect : none.// Notes : //***************************************************************************void _OSD_ClearMsg(BYTE bMessage){ if ((bMessage == _OSDNUCurMsg.bMessage) || (bMessage == _OSDNBCurMsg.bMessage)) { //clear the message. _OSD_ClearNUNBRegion(OSDND_GetMessagePos(bMessage));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -