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

DVD

开发平台:

C/C++

  1. /*
  2. ** COLOR Y Cr Cb
  3. **
  4. ** WHITE 0xeb 0x80 0x80
  5. ** YELLOW 0xa2 0x8e 0x2c
  6. ** CYAN 0x83 0x2c 0x9c
  7. ** GREEN 0x70 0x3a 0x48
  8. ** MAGENTA 0x54 0xc6 0xb8
  9. ** RED 0x41 0xd4 0x64
  10. ** BLUE 0x23 0x72 0xd4
  11. ** BLACK 0x10 0x80 0x80
  12. **
  13. */
  14. #define __palette4F(Y,B,R,A) 
  15.         ( ((UINT32)((Y)&0xff)<<24)|((UINT32)((B)&0xff)<<16)|((UINT32)((R)&0xff)<<8)|(A&0xff) ) 
  16.         
  17. #define CLUTE_TRANS 0x80808000
  18. #define _WHITE     __palette4F(0xeb,0x80,0x80,0xff)
  19. #define _YELLOW    __palette4F(0xa2,0x8e,0x2c,0xff)
  20. #define _CYAN      __palette4F(0x83,0x2c,0x9c,0xff)
  21. #define _GREEN     __palette4F(0x70,0x,0x2c,0xff)
  22. /************************************************************
  23.  pal
  24. ************************************************************/
  25. //for 3d-sound menu
  26. const UINT32 palette_16color[] = 
  27. {    
  28.     __palette4F(  20, 128, 128,0xff),    //11 black //Jeff 20020404
  29.     __palette4F(  75 , 85,  74,0xff),    //dark green    1
  30.     __palette4F(  112, 64,  47,0xff),    //middle green  2
  31.     __palette4F(  149, 43,  21,0xff),    //green         3
  32.     __palette4F(  199, 15, 167,0xff),    //yellow        4
  33.     __palette4F(  152, 41, 201,0xff),    //dark orange   5
  34.     __palette4F(  164, 35, 192,0xff),    //bright orange 6
  35.     __palette4F(  112, 64, 229,0xff),    //dark red      7
  36.     __palette4F(   78, 84, 255,0xff),    //bright red    8
  37.     __palette4F(  128,128, 128,0xff),    //gray white    9
  38.     __palette4F(  0xa2, 0x2c, 0x8e,0xff),    //yellow-green  10
  39.     CLUTE_TRANS,
  40.     CLUTE_TRANS,
  41.     CLUTE_TRANS,
  42.     CLUTE_TRANS,
  43.     CLUTE_TRANS,
  44. };
  45. //for setup menu and OSD0
  46. //setup : 0, 1, 2, 3, 4, 5, 6, 7
  47. //OSD0  : 0, 3, 8, 9, 10, 15
  48. static const UINT32 palette_16color_setup[] = 
  49. {
  50.     __palette4F(  0x50, 0x70, 0x70,0x80),   // 0  transparent
  51.     __palette4F(  72, 178, 120,0xff),     // 1  gray-blue
  52.     __palette4F(  196-30, 122, 130,0xff),   // 2  near white    //nono 2-3-11 14:05 for yuxing
  53.     __palette4F(  132,144, 126,0xff),     // 3  light gray
  54.     __palette4F(  72, 178, 120,0xff),     // 4  gray-blue
  55. #ifndef KONKA_DVD//20020820
  56.     __palette4F( 80, 170, 80,0xff),         // 5  gray-green
  57.     __palette4F(  112, 160, 112,0xff),     // 6  light-gray-blue
  58. #else
  59.     __palette4F(  80, 180, 80,0xff),        // 5  gray-green
  60.     __palette4F(  110, 170, 112,0xff),     // 6  light-gray-blue
  61. #endif
  62.     __palette4F(  0xa0, 0x28, 0x8c, 0xff),  // 7  yellow
  63.     __palette4F(  180, 43,  21,0xff),       // 8  green
  64.     __palette4F(  180, 0x2c, 0x8e,0xff),    // 9  yellow-green
  65.     __palette4F(  180, 41, 201,0xff),       // 10 dark orange
  66.     __palette4F(  40+10, 128, 128,0xff),    // 11 black         //nono 2-3-11 14:05for yuxing
  67.     __palette4F(  100, 128, 128,0xff),      // 12 dark-gray
  68.     CLUTE_TRANS,                            // 13
  69.     CLUTE_TRANS,                            // 14
  70. #ifdef GREY_OSD_DISP                        // ych 2-7-8 17:39
  71.     __palette4F( 100, 128, 128,0xff),       // 15 gray white  
  72. #else
  73.     CLUTE_TRANS,                            // 15 OSD shadow color(not modify)
  74. #endif 
  75. };
  76. #define C16_WHITE       2
  77. #define C16_LIGHTGRAY   3
  78. #define C16_DARKGRAY    12
  79. #define C16_BLACK       11
  80. //4 color palette
  81. const UINT32 palette_4color[] = 
  82. {   
  83.     __palette4F(  0x50, 0x70, 0x70,0x80),    //00b:background
  84. CLUTE_TRANS,                                     //01b:transparent
  85. __palette4F(  0x50, 0x70, 0x70,0xff),    //10b:anti background
  86. #ifdef GREY_OSD_DISP                        
  87. __palette4F(  166, 122, 130,0xff),       //11b:text,white  
  88. #else
  89. __palette4F(  0xa2, 0x2c, 0x8e,0xff),    //11b:text,yellow-green
  90. #endif
  91. };
  92. /************************************************************
  93.  OSD Header Config
  94.  config 0: color upate|force transparent|pixel resolution[1:0]|reserved|color mode[2:0](0:4 1:16 2:256 4:16bit#1 5:16bit#2)
  95.  config 1: shade[3:0]|blend[3:0]
  96.  config 2: CLUT entries type[1:0](0:16 bit,1:32 bit,2:27 bit)|rgb(0:YCbCr,1:RGB)|swp(0:Normal,1:BYTE swap)|shd(0:Sub,1:Ratio)|Reserved[1:0] 
  97. ************************************************************/
  98. const UINT8 osd_header_config[][3]=
  99. {
  100.       {//normal 4 color
  101.        //config 0
  102.        ((1&0x01) << BIT_CU)|((0) << BIT_FT)|((0 & 0x03) << BIT_PR),
  103.        //config 1
  104.        ((0xf & 0x0f) << BIT_SHD)| ((0xf & 0x0f) << BIT_BLND),
  105.        //config 2
  106.          V2_CLUT_TYPE(OSDV2_CLUT_32b)| V2_SWAP_BYTE_OFF| V2_SHADE_MODE_A
  107.       },
  108.       {//eq 16 color
  109.        //config 0
  110.        ((1&0x01) << BIT_CU)|((0) << BIT_FT)|((1 & 0x03) << BIT_PR),      
  111.        //config 1
  112.        ((0xc & 0x0f) << BIT_SHD)| ((0xf & 0x0f) << BIT_BLND),
  113.        //config 2
  114.          V2_CLUT_TYPE(OSDV2_CLUT_32b)| V2_SWAP_BYTE_OFF| V2_SHADE_MODE_A
  115.       },
  116.       {//setup,display
  117.        //config 0
  118.        ((1&0x01) << BIT_CU)|((0) << BIT_FT)|((0 & 0x03) << BIT_PR),      
  119.        //config 1
  120.        ((0xf & 0x0f) << BIT_SHD)| ((0xf & 0x0f) << BIT_BLND),
  121.        //config 2
  122.          V2_CLUT_TYPE(OSDV2_CLUT_32b)| V2_SWAP_BYTE_OFF| V2_SHADE_MODE_A
  123.       },
  124.       {//nes game
  125.        //config 0
  126.        ((1&0x01) << BIT_CU)|((0) << BIT_FT)|((1 & 0x03) << BIT_PR),      
  127.        //config 1
  128.        ((0xc & 0x0f) << BIT_SHD)| ((0xf & 0x0f) << BIT_BLND),
  129.        //config 2
  130.          V2_CLUT_TYPE(OSDV2_CLUT_32b)| V2_SWAP_BYTE_OFF| V2_SHADE_MODE_A
  131.       }
  132. };
  133. UINT32 *osd__pal[]=
  134. {
  135.   palette_4color,//normal
  136.   palette_16color,//eq
  137.   palette_16color_setup,//setup,display
  138.   NULL//nes game
  139. };
  140. /************************************************************
  141.  OSD Header Offset ,data block location
  142. ************************************************************/
  143. #define OSD_16b_BUG
  144. #define ALIGN_32B(x) ((x+31)/32)
  145. const UINT8 osd_header_offset[8] = 
  146. {
  147. ALIGN_32B(16 + 4*4), 
  148. ALIGN_32B(16 + 4*16), 
  149. ALIGN_32B(16 + 4*256), 
  150. ALIGN_32B(16),
  151. ALIGN_32B(16),
  152. ALIGN_32B(16),
  153. ALIGN_32B(HEADER_SIZE),
  154. ALIGN_32B(HEADER_SIZE)
  155. };