1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13:
14:
15: 16: 17: 18: 19:
20:
21: #ifndef __DEVICE_VIDEOMODE_H__
22: #define __DEVICE_VIDEOMODE_H__
23:
24: #include <machine.h>
25:
26:
27:
28: #ifdef __cplusplus
29: extern "C" {
30: #endif
31:
32: #define MAX_VIDEO_SZIX 8
33:
34: 35: 36:
37: typedef enum {
38: DMi240x8 = 0,
39: DMi240x16 = 1,
40: DMi240x32 = 2,
41:
42: DMe640x8 = 3,
43: DMe640x16 = 4,
44: DMe640x32 = 5,
45:
46: DMe800x8 = 6,
47: DMe800x16 = 7,
48: DMe800x32 = 8,
49:
50: DMe1024x8 = 9,
51: DMe1024x16 = 10,
52: DMe1024x32 = 11,
53:
54: DMe1152x8 = 12,
55: DMe1152x16 = 13,
56: DMe1152x32 = 14,
57:
58: DMe1280x8 = 15,
59: DMe1280x16 = 16,
60: DMe1280x32 = 17,
61:
62: DMi480x8 = 18,
63: DMi480x16 = 19,
64: DMi480x32 = 20,
65:
66: DMeWVGAx16 = 22,
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:
77: #define VideoHsize(mode) __vHsize[VideoSzIx(mode)]
78:
79: #define VideoVsize(mode) __vVsize[VideoSzIx(mode)]
80:
81:
82: #define VideoPixBits(mode) __vPixBits[VideoColIx(mode)]
83:
84:
85: #define VideoCmapEnt(mode) __vCmapEnt[VideoColIx(mode)]
86: #define MAX_COLMAP_ENT 256
87:
88:
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