Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

153 lines
4.0 KiB

  1. /******************************************************************************\
  2. * *
  3. * HLI.C - Highlight related code. *
  4. * *
  5. * Copyright (c) C-Cube Microsystems 1996 *
  6. * All Rights Reserved. *
  7. * *
  8. * Use of C-Cube Microsystems code is governed by terms and conditions *
  9. * stated in the accompanying licensing statement. *
  10. * *
  11. \******************************************************************************/
  12. #include "Headers.h"
  13. #pragma hdrstop
  14. #include "hli.h"
  15. #include "cl6100.h"
  16. #define TIMEOUT_COUNT 10
  17. static DWORD dwTimeOut = TIMEOUT_COUNT;
  18. BOOL bJustHighLight = FALSE;
  19. extern void UpdateOrdinalNumber(IN PHW_DEVICE_EXTENSION pHwDevExt);
  20. static void HighlightSetProp( PHW_DEVICE_EXTENSION pHwDevExt );
  21. /*
  22. ** HighlightSetPropIfAdapterReady ()
  23. **
  24. ** Set property handling routine for the Highlight.
  25. **
  26. ** Arguments:
  27. **
  28. ** pSrb -> property command block
  29. ** pSrb->CommandData.PropertyInfo describes the requested property
  30. **
  31. ** Returns:
  32. **
  33. ** Side Effects:
  34. */
  35. void HighlightSetPropIfAdapterReady( PHW_DEVICE_EXTENSION pHwDevExt )
  36. {
  37. // PHW_DEVICE_EXTENSION pHwDevExt = (PHW_DEVICE_EXTENSION)pSrb->HwDeviceExtension;
  38. PKSPROPERTY_SPHLI hli = &(pHwDevExt->hli);
  39. if ( hli->StartPTM == 0 )
  40. {
  41. //
  42. // Make sure that the next real Highlight is not executed before
  43. // valid SPU is received (and before it's time).
  44. //
  45. pHwDevExt->bValidSPU = FALSE;
  46. //
  47. // Set HLI here to clean up the screen.
  48. //
  49. HighlightSetProp( pHwDevExt );
  50. pHwDevExt->bHliPending = FALSE;
  51. }
  52. else
  53. {
  54. if ( ( !pHwDevExt->bValidSPU || (hli->StartPTM > DVD_GetSTC()) ) && dwTimeOut )
  55. {
  56. MonoOutStr( " !!! Schedule HLI CB !!! " );
  57. dwTimeOut--;
  58. StreamClassScheduleTimer( NULL, pHwDevExt,
  59. 100000,
  60. (PHW_TIMER_ROUTINE)HighlightSetPropIfAdapterReady,
  61. pHwDevExt );
  62. if(pHwDevExt->bTimerScheduled) //temp fix //sri
  63. {
  64. pHwDevExt->bTimerScheduled = FALSE;
  65. MonoOutStr("CallAdapterSend");
  66. UpdateOrdinalNumber(pHwDevExt);
  67. AdapterSendData(pHwDevExt);
  68. }
  69. }
  70. else
  71. {
  72. //
  73. // This set most likely will be called when menu is already ON.
  74. //
  75. HighlightSetProp( pHwDevExt );
  76. pHwDevExt->bHliPending = FALSE;
  77. }
  78. }
  79. }
  80. /*
  81. ** HighlightSetProp ()
  82. **
  83. ** Set property handling routine for the Highlight.
  84. **
  85. ** Arguments:
  86. **
  87. ** pSrb -> property command block
  88. ** pSrb->CommandData.PropertyInfo describes the requested property
  89. **
  90. ** Returns:
  91. **
  92. ** Side Effects:
  93. */
  94. static void HighlightSetProp( PHW_DEVICE_EXTENSION pHwDevExt )
  95. {
  96. DWORD dwContrast;
  97. DWORD dwColor;
  98. DWORD dwYGeom;
  99. DWORD dwXGeom;
  100. PKSPROPERTY_SPHLI hli = &(pHwDevExt->hli);
  101. dwColor = ( (DWORD)(hli->ColCon.emph1col) << 8) +
  102. ( (DWORD)(hli->ColCon.emph2col) << 12) +
  103. ( (DWORD)(hli->ColCon.backcol) << 0) +
  104. ( (DWORD)(hli->ColCon.patcol) << 4);
  105. dwContrast = ( (DWORD)(hli->ColCon.emph1con) << 8) +
  106. ( (DWORD)(hli->ColCon.emph2con) << 12) +
  107. ( (DWORD)(hli->ColCon.backcon) << 0) +
  108. ( (DWORD)(hli->ColCon.patcon) << 4);
  109. dwYGeom = ( ((DWORD)(hli->StartY)) << 12) + (hli->StopY);
  110. dwXGeom = ( ((DWORD)(hli->StartX)) << 12) + (hli->StopX);
  111. MonoOutChar('<');
  112. MonoOutULong( hli->StartPTM );
  113. MonoOutChar('-');
  114. MonoOutULong( hli->EndPTM );
  115. MonoOutChar('>');
  116. DVD_GetSTC();
  117. //bJustHighLight = TRUE;
  118. if((dwXGeom == 0)&& (dwYGeom==0))
  119. return;
  120. if ( !DVD_HighLight2( dwContrast, dwColor, dwYGeom, dwXGeom ) )
  121. {
  122. MonoOutStr( " !!!! DVD_HighLight2 has failed !!!! " );
  123. }
  124. //
  125. // Restore the Timeout counter
  126. //
  127. dwTimeOut = TIMEOUT_COUNT;
  128. }