osd_palette.h
上传用户:poi891205
上传日期:2013-07-15
资源大小:9745k
文件大小:6k
源码类别:

DVD

开发平台:

C/C++

  1. /************************************************************
  2. define
  3. ************************************************************/
  4. #define LINK_NULL   (0xffff)
  5. #define __palette(Y,Cb,Cr,BlendFactor) 
  6.     (
  7. (((UINT32)(Y)     & 0x3f)<<10)   
  8. | (((UINT32)(Cb)    & 0x0f)<<6)    
  9. | (((UINT32)(Cr)    & 0x0f)<<2)    
  10. | (((UINT32)(BlendFactor) & 0x03)) 
  11. )
  12. #define __palette2(Y,Cb,Cr,Blend,Fill) 
  13.     (
  14. (((UINT32)(Y)     & 0x3f)<<10)   
  15. | (((UINT32)(Cb)    & 0x0f)<<6)    
  16. | (((UINT32)(Cr)    & 0x0f)<<2)    
  17. | ((Blend) ? 0x02 : 0x01)      
  18. | ((Fill)  ? 0x01 : 0x00)      
  19. )
  20. #define __paletteF(Y,B,R,BlendFactor) 
  21. __palette((Y)>>2, (B)>>4, (R)>>4, (BlendFactor))
  22. #define __palette2F(Y,B,R,Blend,Fill) 
  23. __palette2((Y)>>2, (B)>>4, (R)>>4, (Blend), (Fill))
  24. #define SOUND_MAX_REGION        5
  25. //#define HEADER_SIZE     0x10
  26. /*
  27. #define NORMAL_HEADER   0
  28. #define EQ_HEADER       1
  29. #define SETUP_HEADER    2
  30. #define NES_HEADER      3
  31. #ifdef  BBK_NEW_SETUP     //fengjl  add for BBK's NEW_SETUP  3-11-17 16:08
  32. #define BBK_SETUP_HEADER      4
  33. #endif
  34. #ifdef VIRTUAL_KEYBOARD
  35. #define KEYBOARD_HEADER 4   //liweihua add for 256 color keyboard 2003-11-10 19:28
  36. #endif
  37. */
  38. #define ONE_BYTE_POINT 4 //4 color -> 1 byte has 4 point 
  39. #define DASH_MARK 0x2d
  40. #ifdef NEW_SETUP_OSD                     // majinping 2002-05-02 for new setup menu
  41. #define SETUP_MAIN_YSTART       1
  42. #endif
  43. #ifndef NULL
  44. #define NULL ((void *)0)
  45. #endif
  46. #define OSD_FONT_HEIGHT 24
  47. #define REGIONS_ACTIVE 6
  48. #define SETUP_BTN_HEIGHT        (OSD_FONT_HEIGHT+8)
  49. #define MAX_VOLUME 25
  50. #define TRANS_COLOR 0x0000
  51. #define DRK_GREEN_COLOR 0xeeee
  52. #define MID_GREEN_COLOR 0x8888
  53. #define BR_GREEN_COLOR 0x9999
  54. #define YELLOW_COLOR 0x7777
  55. #define DRK_ORANGE 0x5555
  56. #define BR_ORANGE 0x5555
  57. #define DRK_RED_COLOR 0xdddd
  58. #define BR_RED_COLOR 0xcccc
  59. #define GRAY_COLOR 0x3333
  60. const UINT16  bColorTab[]=
  61. { DRK_GREEN_COLOR,MID_GREEN_COLOR,BR_GREEN_COLOR,
  62. YELLOW_COLOR,DRK_ORANGE,DRK_RED_COLOR,BR_RED_COLOR 
  63. };  
  64. //0 -> 00(OSD background)
  65. //1 -> 11(yellow-green)
  66. //font boundary(only horizontal) -> 01(anti-background)
  67. #ifdef DRAW_BLACK_FRAME
  68. static const BYTE PatternEdge[] = { //Detect Edge 
  69.     0x00,                                                   //0000 0000 0000
  70.     0x01,                                                   //0001 0000 0001
  71.     0x04,                                                   //0010 0000 0100
  72.     0x05,                                                   //0011 0000 0101
  73.     0x10,                                                   //0100 0001 0000
  74.     0x11,                                                   //0101 0001 0001
  75.     0x14,                                                   //0110 0001 0100
  76.     0x15,                                                   //0111 0001 0101
  77.     0x40,                                                   //1000 0100 0000
  78.     0x41,                                                   //1001 0100 0001
  79.     0x44,                                                   //1010 0100 0100
  80.     0x45,                                                   //1011 0100 0101
  81.     0x50,                                                   //1100 0101 0000
  82.     0x51,                                                   //1101 0101 0001
  83.     0x54,                                                   //1110 0101 0100
  84.     0x55                                                    //1111 0101 0101
  85. };
  86. static const BYTE pattern_4[] = { //old:pattern_4
  87.     0x00,                                                   //0000 0000 0000
  88.     0x07,                                                   //0001 0000 0111
  89.     0x1d,                                                   //0010 0001 1101
  90.     0x1f,                                                   //0011 0001 1111
  91.     0x74,                                                   //0100 0111 0100
  92.     0x77,                                                   //0101 0111 0111
  93.     0x7d,                                                   //0110 0111 1101
  94.     0x7f,                                                   //0111 0111 1111
  95.     0xd0,                                                   //1000 1101 0000
  96.     0xd7,                                                   //1001 1101 0111
  97.     0xdd,                                                   //1010 1101 1101
  98.     0xdf,                                                   //1011 1101 1111
  99.     0xf4,                                                   //1100 1111 0100
  100.     0xf7,                                                   //1101 1111 0111
  101.     0xfd,                                                   //1110 1111 1101
  102.     0xff,                                                   //1111 1111 1111
  103. };
  104. #else
  105. static const BYTE pattern_4[]=
  106. {//0=>00 1=>11
  107. 0x00, 0x03, 0x0c, 0x0f, 0x30, 0x33, 0x3c, 0x3f,
  108. 0xc0, 0xc3, 0xcc, 0xcf, 0xf0, 0xf3, 0xfc, 0xff
  109. };
  110. #endif
  111. const BYTE pattern_a4[]=
  112. {//0=>10 1=>11
  113. 0xaa, 0xab, 0xae, 0xaf, 0xba, 0xbb, 0xbe, 0xbf,
  114. 0xea, 0xeb, 0xee, 0xef, 0xfa, 0xfb, 0xfe, 0xff
  115. };
  116. const BYTE pattern_b4[]=
  117. {//0=>01 1=>11
  118. 0x55, 0x57, 0x5D, 0x5F, 0x75, 0x77, 0x7D, 0x7F,
  119. 0xD5, 0xD7, 0xDD, 0xDF, 0xF5, 0xF7, 0xFD, 0xFF,
  120. };
  121. //define in osd_drv.h
  122. //#define OSD_PAL_16b
  123. //#define OSD_PAL_32b
  124. //#define OSD_PAL_RGB_32b
  125. #ifdef OSD_PAL_16b
  126. #include "osd_pal_16b.h"
  127. #endif
  128. #ifdef OSD_PAL_32b
  129. #include "osd_pal_32b.h"
  130. #endif
  131. #ifdef OSD_PAL_RGB_32b
  132. #include "osd_pal_rgb_32b.h"
  133. #endif
  134. //#ifdef OSD_BMP
  135. //#include "Osd_BmpPalette.h"
  136. //#endif
  137. #define OSD_DATA_OFFSET(f)     (osd_header_offset[(f)&OSD_FORMAT_MASK])
  138. #define OBV_BASE         (SDRAM_BASE + regs0->osd_base_addr*1024)
  139. #define get_osdbuf_baseptr() ((void *)OBV_BASE)
  140. BYTE PatternMode;
  141. BYTE  bEqMaxKeepTm=0;
  142. BYTE    header_id;
  143. extern UINT8 safe_on;