gonzui


Format: Advanced Search

tkernel_2/include/device/videomode.hbare sourcepermlink (0.02 seconds)

Search this content:

    1: /*
    2:  *----------------------------------------------------------------------
    3:  *    T-Kernel 2.0 Software Package
    4:  *
    5:  *    Copyright 2011 by Ken Sakamura.
    6:  *    This software is distributed under the latest version of T-License 2.x.
    7:  *----------------------------------------------------------------------
    8:  *
    9:  *    Released by T-Engine Forum(http://www.t-engine.org/) at 2011/05/17.
   10:  *    Modified by TRON Forum(http://www.tron.org/) at 2015/06/01.
   11:  *
   12:  *----------------------------------------------------------------------
   13:  */
   14: 
   15: /*
   16:  *      videomode.h
   17:  *
   18:  *       video mode definitions
   19:  */
   20: 
   21: #ifndef __DEVICE_VIDEOMODE_H__
   22: #define __DEVICE_VIDEOMODE_H__
   23: 
   24: #include <machine.h>
   25: 
   26: /* below are some modes that are not supported by a particular system */
   27: 
   28: #ifdef __cplusplus
   29: extern "C" {
   30: #endif
   31: 
   32: #define MAX_VIDEO_SZIX  8
   33: 
   34: /*
   35:         video mode
   36: */
   37: typedef enum {
   38:         DMi240x8       = 0,  /* 240 x 320 256 colors (color map)     */
   39:         DMi240x16      = 1, /* 240 x 320 16 bits(R5-G6-B5)    */
   40:         DMi240x32      = 2, /* 240 x 320 32 bits (R8-G8-B8)    */
   41: 
   42:         DMe640x8       = 3,  /* 640 x 480 256 colors (color map)     */
   43:         DMe640x16      = 4, /* 640 x 480 16 bits (R5-G6-B5)    */
   44:         DMe640x32      = 5, /* 640 x 480 32 bits (R8-G8-B8)    */
   45: 
   46:         DMe800x8       = 6,  /* 800 x 600 256 colors (color map)      */
   47:         DMe800x16      = 7, /* 800 x 600 16 bits (R5-G6-B5)    */
   48:         DMe800x32      = 8, /* 800 x 600 32 bits (R8-G8-B8)    */
   49: 
   50:         DMe1024x8      = 9, /* 1024 x 768 256 colors (colar map)   */
   51:         DMe1024x16     = 10,       /* 1024 x 768 16 bits (R5-G6-B5)  */
   52:         DMe1024x32     = 11,       /* 1024 x 768 32 bits(R8-G8-B8)  */
   53: 
   54:         DMe1152x8      = 12,        /* 1152 x 864 256 colors (color map)    */
   55:         DMe1152x16     = 13,       /* 1152 x 864 16 bits (R5-G6-B5)  */
   56:         DMe1152x32     = 14,       /* 1152 x 864 32 bits (R8-G8-B8)  */
   57: 
   58:         DMe1280x8      = 15,        /* 1280 x 1024 256 colors (color map)    */
   59:         DMe1280x16     = 16,       /* 1280 x 1024 16 bits (R5-G6-B5) */
   60:         DMe1280x32     = 17,       /* 1280 x 1024 32 bits (R8-G8-B8) */
   61: 
   62:         DMi480x8       = 18, /* 480 x 640 256 colors (color map)    */
   63:         DMi480x16      = 19,        /* 480 x 640 16 bits (R5-G6-B5)    */
   64:         DMi480x32      = 20,        /* 480 x 640 32 bits (R8-G8-B8)    */
   65: 
   66:         DMeWVGAx16     = 22,       /* 800 x 480 16 bits (R5-G6-B5)    */
   67: } VideoMode;
   68: 
   69: #define MAX_VIDEO_COLIX         3
   70: #define MAX_VIDEO_MODE          (MAX_VIDEO_SZIX * MAX_VIDEO_COLIX)
   71: 
   72: #define VideoSzIx(mode)         ((mode) / MAX_VIDEO_COLIX)
   73: #define VideoColIx(mode)        ((mode) % MAX_VIDEO_COLIX)
   74: #define VALID_VIDEO_MODE(mode)  ((mode) >= 0 && (mode) < MAX_VIDEO_MODE)
   75: 
   76: /* screen horizontal size */
   77: #define VideoHsize(mode)        __vHsize[VideoSzIx(mode)]
   78: /* screen vertical size */
   79: #define VideoVsize(mode)        __vVsize[VideoSzIx(mode)]
   80: 
   81: /* number of bits per pixel */
   82: #define VideoPixBits(mode)      __vPixBits[VideoColIx(mode)]
   83: 
   84: /* number of entries in color map */
   85: #define VideoCmapEnt(mode)      __vCmapEnt[VideoColIx(mode)]
   86: #define MAX_COLMAP_ENT          256
   87: 
   88: /* number of bits and the location of bits for component color in direct color method */
   89: #define VideoRedInf(mode)       __vRedInf[VideoColIx(mode)]
   90: #define VideoGreenInf(mode)     __vGreenInf[VideoColIx(mode)]
   91: #define VideoBlueInf(mode)      __vBlueInf[VideoColIx(mode)]
   92: 
   93: LOCAL   const     UH  __vHsize[MAX_VIDEO_SZIX] =
   94:                         {240, 640, 800, 1024, 1152, 1280, 480, 800};
   95: LOCAL   const     UH  __vVsize[MAX_VIDEO_SZIX] =
   96:                         {320, 480, 600,  768,  864, 1024, 640, 480};
   97: LOCAL   const     UH  __vPixBits[MAX_VIDEO_COLIX] =
   98:                         {0x0808, 0x1010, 0x2018};
   99: LOCAL   const     UH  __vCmapEnt[MAX_VIDEO_COLIX] =
  100:                         {256, 0, 0};
  101: LOCAL   const     UH  __vRedInf[MAX_VIDEO_COLIX] =
  102:                         {0x0000, 0x0B05, 0x1008};
  103: LOCAL   const     UH  __vGreenInf[MAX_VIDEO_COLIX] =
  104:                         {0x0000, 0x0506, 0x0808};
  105: LOCAL   const     UH  __vBlueInf[MAX_VIDEO_COLIX] =
  106:                         {0x0000, 0x0005, 0x0008};
  107: 
  108: #ifdef __cplusplus
  109: }
  110: #endif
  111: 
  112: #endif  /* __DEVICE_VIDEOMODE_H__ */