FreeCalypso > hg > fc-tourmaline
comparison src/cs/drivers/drv_app/r2d/r2d_config.h @ 0:4e78acac3d88
src/{condat,cs,gpf,nucleus}: import from Selenite
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Fri, 16 Oct 2020 06:23:26 +0000 |
parents | |
children | 927e8b825ed1 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4e78acac3d88 |
---|---|
1 /*************************************************************************** | |
2 | |
3 Name r2d_config.h | |
4 | |
5 Function Hardware dependent configurations | |
6 | |
7 Date Modification | |
8 ----------------------- | |
9 06/12/2001 Create | |
10 ************************************************************************** | |
11 History | |
12 | |
13 ****************************************************************************/ | |
14 | |
15 | |
16 #ifndef __R2D_CONFIG__ | |
17 #define __R2D_CONFIG__ | |
18 | |
19 #ifndef _WINDOWS | |
20 #include "config/r2d.cfg" | |
21 #include "config/board.cfg" | |
22 #include "config/fc-target.h" | |
23 #include "config/swconfig.cfg" | |
24 #endif | |
25 | |
26 /******************************* | |
27 | |
28 MISC R2D CONSTANTS | |
29 | |
30 *******************************/ | |
31 | |
32 | |
33 #define R2D_ON 1 | |
34 #define R2D_OFF 0 | |
35 | |
36 #define R2D_DEBUG_LOW 0 | |
37 #define R2D_DEBUG_HIGH 1 | |
38 | |
39 // Color mode for the LCD | |
40 #define R2D_MONOCHROME 0 | |
41 #define R2D_COLOR 1 | |
42 | |
43 // Mode of refresh for the LCD | |
44 #define R2D_VERTICAL 0 | |
45 #define R2D_HORIZONTAL 1 | |
46 | |
47 // List of kind of supported LCDs | |
48 #define R2D_SIMPLE_LCD 1 | |
49 #define R2D_PC_COLOR_LCD 2 | |
50 #define R2D_MIRRORED_LCD 3 | |
51 #define R2D_CUSTOMER_LCD 4 | |
52 #define R2D_HORIZONTAL_LCD 5 | |
53 #define R2D_BOARD_COLOR_LCD 6 | |
54 #define R2D_BOARD_DSAMPLE 7 | |
55 #define R2D_BOARD_BW_DSAMPLE 8 | |
56 #define R2D_BOARD_ESAMPLE 9 | |
57 #define R2D_PC_CSAMPLE 108 | |
58 #define R2D_PC_DSAMPLE 109 | |
59 | |
60 /******************************* | |
61 | |
62 Riviera 2D configuration | |
63 | |
64 *******************************/ | |
65 | |
66 | |
67 // ln2 of dimension of dithering matrix | |
68 // (must change code if that value is changed) | |
69 #define R2D_DITHERING_DIMENSION 2 | |
70 | |
71 #define R2D_DEBUG R2D_ON | |
72 | |
73 #define R2D_DEBUG_WARNING R2D_DEBUG_LOW | |
74 | |
75 // For still on development new features | |
76 #define R2D_EXPERIMENT R2D_ON | |
77 | |
78 // C-Sample for PC | |
79 #ifdef _WINDOWS | |
80 #define R2D_REFRESH_PERIOD 50 // ms | |
81 #define R2D_EMBEDDED_LCD R2D_PC_COLOR_LCD | |
82 #endif | |
83 | |
84 #if (R2D_LCD_TEST == 1) | |
85 #define R2D_REFRESH_PERIOD 40 // ms | |
86 #define R2D_EMBEDDED_LCD R2D_BOARD_COLOR_LCD | |
87 #else | |
88 #if ((BOARD == 7) || (BOARD == 8) || (BOARD == 9) || \ | |
89 defined(CONFIG_TARGET_C139)) | |
90 // C-Sample is equipped with Mirrored LCD | |
91 #define R2D_REFRESH_PERIOD 40 // ms | |
92 #define R2D_EMBEDDED_LCD R2D_MIRRORED_LCD | |
93 #elif ((BOARD == 40) || (BOARD == 41) || (BOARD == 42) || (BOARD == 43)) | |
94 #if DSAMPLE_FULL_COLOR | |
95 // D-Sample Board with Color Display | |
96 #define R2D_REFRESH_PERIOD 40 // ms | |
97 #define R2D_EMBEDDED_LCD R2D_BOARD_DSAMPLE | |
98 #else | |
99 // D-Sample Board with simulated B&W Display | |
100 #define R2D_REFRESH_PERIOD 40 // ms | |
101 #define R2D_EMBEDDED_LCD R2D_BOARD_BW_DSAMPLE | |
102 #endif | |
103 #endif | |
104 #endif | |
105 | |
106 // Launch R2D_REFRESH_LOOP to estimate the time | |
107 // taken by one loop | |
108 #define R2D_BENCHMARKING R2D_OFF | |
109 #define R2D_REFRESH_LOOP 100 | |
110 | |
111 | |
112 /******************************* | |
113 | |
114 Hardware dependence | |
115 | |
116 *******************************/ | |
117 | |
118 // Shift by 2 to get the size of a long int | |
119 #define R2D_LONGSIZE_FACTOR 2 | |
120 | |
121 // ln2 of the size of a memory word in bits | |
122 // (2^5 = 32 bits) | |
123 #define R2D_MEMORY_WORD 5 | |
124 | |
125 /******************************* | |
126 | |
127 Values used internally | |
128 | |
129 *******************************/ | |
130 | |
131 #if (R2D_EMBEDDED_LCD == R2D_SIMPLE_LCD) | |
132 #include "r2d/lcds/Simple/R2D_simple_lcd_i.h" | |
133 #endif | |
134 | |
135 // Color LCD is just a simulation on PC and is using the | |
136 // color framebuffers | |
137 #if (R2D_EMBEDDED_LCD == R2D_PC_COLOR_LCD) | |
138 #include "r2d/lcds/ColorPC/R2D_pc_color_lcd_i.h" | |
139 #endif | |
140 | |
141 #if (R2D_EMBEDDED_LCD == R2D_PC_CSAMPLE) | |
142 #include "r2d/lcds/PC_CSAMPLE/R2D_pc_csample_lcd_i.h" | |
143 #endif | |
144 | |
145 #if (R2D_EMBEDDED_LCD == R2D_PC_DSAMPLE) | |
146 #include "r2d/lcds/PC_DSAMPLE/R2D_pc_dsample_lcd_i.h" | |
147 #endif | |
148 | |
149 // Color LCD is just a simulation on PC and is using the | |
150 // color framebuffers | |
151 #if (R2D_EMBEDDED_LCD == R2D_MIRRORED_LCD) | |
152 #include "r2d/lcds/Mirrored/R2D_mirrored_lcd_i.h" | |
153 #endif | |
154 | |
155 #if (R2D_EMBEDDED_LCD == R2D_CUSTOMER_LCD) | |
156 #include "r2d/lcds/Customer/R2D_customer_lcd_i.h" | |
157 #endif | |
158 | |
159 #if (R2D_EMBEDDED_LCD == R2D_HORIZONTAL_LCD) | |
160 #include "r2d/lcds/Horizontal/R2D_horizontal_lcd_i.h" | |
161 #endif | |
162 | |
163 #if (R2D_EMBEDDED_LCD == R2D_BOARD_COLOR_LCD) | |
164 #include "r2d/lcds/ColorBoard/R2D_board_color_lcd_i.h" | |
165 #endif | |
166 | |
167 #if (R2D_EMBEDDED_LCD == R2D_BOARD_DSAMPLE) | |
168 #include "r2d/lcds/D_Sample/R2D_board_dsample_i.h" | |
169 #endif | |
170 | |
171 #if (R2D_EMBEDDED_LCD == R2D_BOARD_BW_DSAMPLE) | |
172 #include "r2d/lcds/BW_D_Sample/R2D_board_bw_dsample_i.h" | |
173 #endif | |
174 | |
175 #if (R2D_EMBEDDED_LCD == R2D_PC_COLOR_LCD) | |
176 #ifdef R2D_ASM | |
177 #undef R2D_ASM | |
178 #endif | |
179 #define R2D_ASM R2D_OFF | |
180 #endif | |
181 | |
182 #if (R2D_ASM == R2D_ON) | |
183 #if (R2D_DITHERING == R2D_ON) | |
184 #undef R2D_DITHERING | |
185 #define R2D_DITHERING R2D_OFF | |
186 #endif | |
187 | |
188 #endif | |
189 | |
190 | |
191 // Mask used to write or read a pixel value from a memory word | |
192 // It is also used in monochrome mode to extract the intensity level | |
193 // In color mode, a pixel will contain several intensity | |
194 // level and another mask to extract components should be used | |
195 | |
196 // ifdef used because of limitation with TI preprocessor | |
197 // which is giving 0 for R2D_PIXEL_MASK instead of 0xFFFFFFFF | |
198 // when R2D_PIXEL_DEPTH is 32 | |
199 #if (R2D_PIXEL_DEPTH == 32) | |
200 #define R2D_PIXEL_MASK 0xFFFFFFFF | |
201 #else | |
202 #define R2D_PIXEL_MASK (~(-1<<R2D_PIXEL_DEPTH)) | |
203 #endif | |
204 | |
205 // Pixel value mask for dithered levels | |
206 #define R2D_DITHERED_MASK (~(-1<<R2D_DITHERING_DIMENSION)) | |
207 | |
208 | |
209 #if (R2D_PIXELS_PER_MEMORY_WORD == 0) | |
210 | |
211 // Position of the pixel in a memory word is extracted with | |
212 // that mask applied to the pixel horizontal or vertical | |
213 // coordinate (depending on the REFRESH mode) | |
214 // It allows to convert between unit pixels to unit memory words | |
215 #define R2D_WORD_POSITION_MASK 0 | |
216 | |
217 // Extension of vertical or horizontal for memory alignments | |
218 // constraints | |
219 #if (R2D_REFRESH == R2D_VERTICAL) | |
220 #define R2D_MWHEIGHT R2D_HEIGHT | |
221 #else | |
222 #define R2D_MWWIDTH R2D_WIDTH | |
223 #endif | |
224 | |
225 // Extend lengths to a integer number of memory words | |
226 // and return new length in memory word units | |
227 #define R2D_ALIGNED_MWLENGTH(a) a | |
228 #else | |
229 // Above formula are right when the number of pixels | |
230 // can be divided by 2 (so R2D_PIXELS_PER_MEMORY_WORD != 0 ) | |
231 | |
232 // Position of the pixel in a memory word is extracted with | |
233 // that mask applied to the pixel horizontal or vertical | |
234 // coordinate (depending on the REFRESH mode) | |
235 // It allows to convert between unit pixels to unit memory words | |
236 #define R2D_WORD_POSITION_MASK (~(-1<<R2D_PIXELS_PER_MEMORY_WORD)) | |
237 | |
238 // Extension of vertical or horizontal for memory alignments | |
239 // constraints (the extension is done by excess. Sometime one | |
240 // word may be added although it is not really needed) | |
241 #if (R2D_REFRESH == R2D_VERTICAL) | |
242 #define R2D_MWHEIGHT ((R2D_HEIGHT>>R2D_PIXELS_PER_MEMORY_WORD)+1) | |
243 #else | |
244 #define R2D_MWWIDTH ((R2D_WIDTH>>R2D_PIXELS_PER_MEMORY_WORD)+1) | |
245 #endif | |
246 | |
247 // Extend lengths to a integer number of memory words | |
248 // and return new length in memory word units | |
249 | |
250 // Never change it. It used for blit_rect | |
251 #define R2D_ALIGNED_MWLENGTH(a) ((a>>R2D_PIXELS_PER_MEMORY_WORD) + 1) | |
252 | |
253 | |
254 #endif | |
255 // Start of description of metrics values | |
256 // for each char | |
257 // The first values are the global ones for the font | |
258 #define R2D_METRIC_START 8 | |
259 | |
260 | |
261 // Position of buffer width value relative | |
262 // to start of char metrics in a font metric array | |
263 #define R2D_BUFFER_WIDTH_POS (-5) | |
264 | |
265 | |
266 | |
267 #endif |