Rev 3795 | Rev 4456 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 3795 | Rev 4421 | ||
|---|---|---|---|
| Line 25... | Line 25... | ||
| 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | */ |
27 | */ |
| 28 | 28 | ||
| 29 | /** @addtogroup console |
29 | /** @addtogroup console |
| 30 | * @{ |
30 | * @{ |
| 31 | */ |
31 | */ |
| 32 | /** @file |
32 | /** @file |
| 33 | */ |
33 | */ |
| 34 | 34 | ||
| 35 | #include <ipc/fb.h> |
35 | #include <ipc/fb.h> |
| Line 41... | Line 41... | ||
| 41 | #include <align.h> |
41 | #include <align.h> |
| 42 | 42 | ||
| 43 | #include "console.h" |
43 | #include "console.h" |
| 44 | #include "gcons.h" |
44 | #include "gcons.h" |
| 45 | 45 | ||
| 46 | #define CONSOLE_TOP 66 |
46 | #define CONSOLE_TOP 66 |
| 47 | #define CONSOLE_MARGIN 6 |
47 | #define CONSOLE_MARGIN 6 |
| 48 | 48 | ||
| 49 | #define STATUS_START 110 |
49 | #define STATUS_START 110 |
| 50 | #define STATUS_TOP 8 |
50 | #define STATUS_TOP 8 |
| 51 | #define STATUS_SPACE 4 |
51 | #define STATUS_SPACE 4 |
| 52 | #define STATUS_WIDTH 48 |
52 | #define STATUS_WIDTH 48 |
| 53 | #define STATUS_HEIGHT 48 |
53 | #define STATUS_HEIGHT 48 |
| 54 | 54 | ||
| 55 | #define MAIN_COLOR 0xffffff |
55 | #define MAIN_COLOR 0xffffff |
| 56 | 56 | ||
| 57 | static int use_gcons = 0; |
57 | static int use_gcons = 0; |
| 58 | static ipcarg_t xres,yres; |
58 | static ipcarg_t xres,yres; |
| 59 | 59 | ||
| 60 | enum butstate { |
60 | enum butstate { |
| Line 112... | Line 112... | ||
| 112 | static void redraw_state(int consnum) |
112 | static void redraw_state(int consnum) |
| 113 | { |
113 | { |
| 114 | char data[5]; |
114 | char data[5]; |
| 115 | int i; |
115 | int i; |
| 116 | enum butstate state = console_state[consnum]; |
116 | enum butstate state = console_state[consnum]; |
| 117 | 117 | ||
| 118 | vp_switch(cstatus_vp[consnum]); |
118 | vp_switch(cstatus_vp[consnum]); |
| 119 | if (ic_pixmaps[state] != -1) |
119 | if (ic_pixmaps[state] != -1) |
| 120 | async_msg_2(fbphone, FB_VP_DRAW_PIXMAP, cstatus_vp[consnum], |
120 | async_msg_2(fbphone, FB_VP_DRAW_PIXMAP, cstatus_vp[consnum], |
| 121 | ic_pixmaps[state]); |
121 | ic_pixmaps[state]); |
| 122 | 122 | ||
| 123 | if (state != CONS_DISCONNECTED && state != CONS_KERNEL && |
123 | if (state != CONS_DISCONNECTED && state != CONS_KERNEL && |
| 124 | state != CONS_DISCONNECTED_SEL) { |
124 | state != CONS_DISCONNECTED_SEL) { |
| 125 | snprintf(data, 5, "%d", consnum + 1); |
125 | snprintf(data, 5, "%d", consnum + 1); |
| 126 | for (i = 0; data[i]; i++) |
126 | for (i = 0; data[i]; i++) |
| 127 | tran_putch(data[i], 1, 2 + i); |
127 | tran_putch(data[i], 1, 2 + i); |
| 128 | } |
128 | } |
| 129 | } |
129 | } |
| 130 | 130 | ||
| 131 | /** Notification run on changing console (except kernel console) */ |
131 | /** Notification run on changing console (except kernel console) */ |
| 132 | void gcons_change_console(int consnum) |
132 | void gcons_change_console(int consnum) |
| 133 | { |
133 | { |
| 134 | int i; |
134 | int i; |
| 135 | 135 | ||
| 136 | if (!use_gcons) |
136 | if (!use_gcons) |
| 137 | return; |
137 | return; |
| 138 | 138 | ||
| 139 | if (active_console == KERNEL_CONSOLE) { |
139 | if (active_console == KERNEL_CONSOLE) { |
| 140 | for (i = 0; i < CONSOLE_COUNT; i++) |
140 | for (i = 0; i < CONSOLE_COUNT; i++) |
| 141 | redraw_state(i); |
141 | redraw_state(i); |
| 142 | if (animation != -1) |
142 | if (animation != -1) |
| 143 | async_msg_1(fbphone, FB_ANIM_START, animation); |
143 | async_msg_1(fbphone, FB_ANIM_START, animation); |
| Line 147... | Line 147... | ||
| 147 | else |
147 | else |
| 148 | console_state[active_console] = CONS_IDLE; |
148 | console_state[active_console] = CONS_IDLE; |
| 149 | redraw_state(active_console); |
149 | redraw_state(active_console); |
| 150 | } |
150 | } |
| 151 | active_console = consnum; |
151 | active_console = consnum; |
| 152 | 152 | ||
| 153 | if (console_state[consnum] == CONS_DISCONNECTED) { |
153 | if (console_state[consnum] == CONS_DISCONNECTED) { |
| 154 | console_state[consnum] = CONS_DISCONNECTED_SEL; |
154 | console_state[consnum] = CONS_DISCONNECTED_SEL; |
| 155 | redraw_state(consnum); |
155 | redraw_state(consnum); |
| 156 | } else |
156 | } else |
| 157 | console_state[consnum] = CONS_SELECTED; |
157 | console_state[consnum] = CONS_SELECTED; |
| 158 | redraw_state(consnum); |
158 | redraw_state(consnum); |
| 159 | 159 | ||
| 160 | vp_switch(console_vp); |
160 | vp_switch(console_vp); |
| 161 | } |
161 | } |
| 162 | 162 | ||
| 163 | /** Notification function that gets called on new output to virtual console */ |
163 | /** Notification function that gets called on new output to virtual console */ |
| 164 | void gcons_notify_char(int consnum) |
164 | void gcons_notify_char(int consnum) |
| 165 | { |
165 | { |
| 166 | if (!use_gcons) |
166 | if (!use_gcons) |
| 167 | return; |
167 | return; |
| 168 | 168 | ||
| 169 | if (consnum == active_console || |
169 | if ((consnum == active_console) || |
| 170 | console_state[consnum] == CONS_HAS_DATA) |
170 | (console_state[consnum] == CONS_HAS_DATA)) |
| 171 | return; |
171 | return; |
| 172 | 172 | ||
| 173 | console_state[consnum] = CONS_HAS_DATA; |
173 | console_state[consnum] = CONS_HAS_DATA; |
| 174 | 174 | ||
| 175 | if (active_console == KERNEL_CONSOLE) |
175 | if (active_console == KERNEL_CONSOLE) |
| 176 | return; |
176 | return; |
| 177 | 177 | ||
| 178 | redraw_state(consnum); |
178 | redraw_state(consnum); |
| 179 | 179 | ||
| 180 | vp_switch(console_vp); |
180 | vp_switch(console_vp); |
| 181 | } |
181 | } |
| 182 | 182 | ||
| 183 | /** Notification function called on service disconnect from console */ |
183 | /** Notification function called on service disconnect from console */ |
| 184 | void gcons_notify_disconnect(int consnum) |
184 | void gcons_notify_disconnect(int consnum) |
| 185 | { |
185 | { |
| 186 | if (!use_gcons) |
186 | if (!use_gcons) |
| 187 | return; |
187 | return; |
| - | 188 | ||
| 188 | if (active_console == consnum) |
189 | if (active_console == consnum) |
| 189 | console_state[consnum] = CONS_DISCONNECTED_SEL; |
190 | console_state[consnum] = CONS_DISCONNECTED_SEL; |
| 190 | else |
191 | else |
| 191 | console_state[consnum] = CONS_DISCONNECTED; |
192 | console_state[consnum] = CONS_DISCONNECTED; |
| 192 | 193 | ||
| Line 200... | Line 201... | ||
| 200 | /** Notification function called on console connect */ |
201 | /** Notification function called on console connect */ |
| 201 | void gcons_notify_connect(int consnum) |
202 | void gcons_notify_connect(int consnum) |
| 202 | { |
203 | { |
| 203 | if (!use_gcons) |
204 | if (!use_gcons) |
| 204 | return; |
205 | return; |
| - | 206 | ||
| 205 | if (active_console == consnum) |
207 | if (active_console == consnum) |
| 206 | console_state[consnum] = CONS_SELECTED; |
208 | console_state[consnum] = CONS_SELECTED; |
| 207 | else |
209 | else |
| 208 | console_state[consnum] = CONS_IDLE; |
210 | console_state[consnum] = CONS_IDLE; |
| 209 | 211 | ||
| 210 | if (active_console == KERNEL_CONSOLE) |
212 | if (active_console == KERNEL_CONSOLE) |
| 211 | return; |
213 | return; |
| 212 | 214 | ||
| 213 | redraw_state(consnum); |
215 | redraw_state(consnum); |
| 214 | vp_switch(console_vp); |
216 | vp_switch(console_vp); |
| 215 | } |
217 | } |
| 216 | 218 | ||
| 217 | /** Change to kernel console */ |
219 | /** Change to kernel console */ |
| Line 223... | Line 225... | ||
| 223 | active_console = KERNEL_CONSOLE; |
225 | active_console = KERNEL_CONSOLE; |
| 224 | vp_switch(0); |
226 | vp_switch(0); |
| 225 | } |
227 | } |
| 226 | 228 | ||
| 227 | /** Return x, where left <= x <= right && |a-x|==min(|a-x|) is smallest */ |
229 | /** Return x, where left <= x <= right && |a-x|==min(|a-x|) is smallest */ |
| 228 | static inline int limit(int a,int left, int right) |
230 | static inline int limit(int a, int left, int right) |
| 229 | { |
231 | { |
| 230 | if (a < left) |
232 | if (a < left) |
| 231 | a = left; |
233 | a = left; |
| 232 | if (a >= right) |
234 | if (a >= right) |
| 233 | a = right - 1; |
235 | a = right - 1; |
| Line 244... | Line 246... | ||
| 244 | */ |
246 | */ |
| 245 | void gcons_mouse_move(int dx, int dy) |
247 | void gcons_mouse_move(int dx, int dy) |
| 246 | { |
248 | { |
| 247 | mouse_x = limit(mouse_x + dx, 0, xres); |
249 | mouse_x = limit(mouse_x + dx, 0, xres); |
| 248 | mouse_y = limit(mouse_y + dy, 0, yres); |
250 | mouse_y = limit(mouse_y + dy, 0, yres); |
| 249 | 251 | ||
| 250 | async_msg_2(fbphone, FB_POINTER_MOVE, mouse_x, mouse_y); |
252 | async_msg_2(fbphone, FB_POINTER_MOVE, mouse_x, mouse_y); |
| 251 | } |
253 | } |
| 252 | 254 | ||
| 253 | static int gcons_find_conbut(int x, int y) |
255 | static int gcons_find_conbut(int x, int y) |
| 254 | { |
256 | { |
| 255 | int status_start = STATUS_START + (xres - 800) / 2; |
257 | int status_start = STATUS_START + (xres - 800) / 2; |
| 256 | 258 | ||
| 257 | if (y < STATUS_TOP || y >= STATUS_TOP + STATUS_HEIGHT) |
259 | if ((y < STATUS_TOP) || (y >= STATUS_TOP + STATUS_HEIGHT)) |
| 258 | return -1; |
260 | return -1; |
| 259 | 261 | ||
| 260 | if (x < status_start) |
262 | if (x < status_start) |
| 261 | return -1; |
263 | return -1; |
| 262 | 264 | ||
| Line 273... | Line 275... | ||
| 273 | * @param state New state (1-pressed, 0-depressed) |
275 | * @param state New state (1-pressed, 0-depressed) |
| 274 | */ |
276 | */ |
| 275 | int gcons_mouse_btn(int state) |
277 | int gcons_mouse_btn(int state) |
| 276 | { |
278 | { |
| 277 | int conbut; |
279 | int conbut; |
| 278 | 280 | ||
| 279 | if (state) { |
281 | if (state) { |
| 280 | conbut = gcons_find_conbut(mouse_x, mouse_y); |
282 | conbut = gcons_find_conbut(mouse_x, mouse_y); |
| 281 | if (conbut != -1) { |
283 | if (conbut != -1) { |
| 282 | btn_pressed = 1; |
284 | btn_pressed = 1; |
| 283 | btn_x = mouse_x; |
285 | btn_x = mouse_x; |
| 284 | btn_y = mouse_y; |
286 | btn_y = mouse_y; |
| 285 | } |
287 | } |
| 286 | return -1; |
288 | return -1; |
| 287 | } |
289 | } |
| - | 290 | ||
| 288 | if (!state && !btn_pressed) |
291 | if ((!state) && (!btn_pressed)) |
| 289 | return -1; |
292 | return -1; |
| - | 293 | ||
| 290 | btn_pressed = 0; |
294 | btn_pressed = 0; |
| 291 | 295 | ||
| 292 | conbut = gcons_find_conbut(mouse_x, mouse_y); |
296 | conbut = gcons_find_conbut(mouse_x, mouse_y); |
| 293 | if (conbut == gcons_find_conbut(btn_x, btn_y)) |
297 | if (conbut == gcons_find_conbut(btn_x, btn_y)) |
| 294 | return conbut; |
298 | return conbut; |
| - | 299 | ||
| 295 | return -1; |
300 | return -1; |
| 296 | } |
301 | } |
| 297 | 302 | ||
| 298 | 303 | ||
| 299 | /** Draw a PPM pixmap to framebuffer |
304 | /** Draw a PPM pixmap to framebuffer |
| Line 305... | Line 310... | ||
| 305 | */ |
310 | */ |
| 306 | static void draw_pixmap(char *logo, size_t size, int x, int y) |
311 | static void draw_pixmap(char *logo, size_t size, int x, int y) |
| 307 | { |
312 | { |
| 308 | char *shm; |
313 | char *shm; |
| 309 | int rc; |
314 | int rc; |
| 310 | 315 | ||
| 311 | /* Create area */ |
316 | /* Create area */ |
| 312 | shm = mmap(NULL, size, PROTO_READ | PROTO_WRITE, MAP_SHARED | |
317 | shm = mmap(NULL, size, PROTO_READ | PROTO_WRITE, MAP_SHARED | |
| 313 | MAP_ANONYMOUS, 0, 0); |
318 | MAP_ANONYMOUS, 0, 0); |
| 314 | if (shm == MAP_FAILED) |
319 | if (shm == MAP_FAILED) |
| 315 | return; |
320 | return; |
| 316 | 321 | ||
| 317 | memcpy(shm, logo, size); |
322 | memcpy(shm, logo, size); |
| - | 323 | ||
| 318 | /* Send area */ |
324 | /* Send area */ |
| 319 | rc = async_req_1_0(fbphone, FB_PREPARE_SHM, (ipcarg_t) shm); |
325 | rc = async_req_1_0(fbphone, FB_PREPARE_SHM, (ipcarg_t) shm); |
| 320 | if (rc) |
326 | if (rc) |
| 321 | goto exit; |
327 | goto exit; |
| - | 328 | ||
| 322 | rc = ipc_share_out_start(fbphone, shm, PROTO_READ); |
329 | rc = ipc_share_out_start(fbphone, shm, PROTO_READ); |
| 323 | if (rc) |
330 | if (rc) |
| 324 | goto drop; |
331 | goto drop; |
| - | 332 | ||
| 325 | /* Draw logo */ |
333 | /* Draw logo */ |
| 326 | async_msg_2(fbphone, FB_DRAW_PPM, x, y); |
334 | async_msg_2(fbphone, FB_DRAW_PPM, x, y); |
| - | 335 | ||
| 327 | drop: |
336 | drop: |
| 328 | /* Drop area */ |
337 | /* Drop area */ |
| 329 | async_msg_0(fbphone, FB_DROP_SHM); |
338 | async_msg_0(fbphone, FB_DROP_SHM); |
| - | 339 | ||
| 330 | exit: |
340 | exit: |
| 331 | /* Remove area */ |
341 | /* Remove area */ |
| 332 | munmap(shm, size); |
342 | munmap(shm, size); |
| 333 | } |
343 | } |
| 334 | 344 | ||
| 335 | extern char _binary_helenos_ppm_start[0]; |
345 | extern char _binary_gfx_helenos_ppm_start[0]; |
| 336 | extern int _binary_helenos_ppm_size; |
346 | extern int _binary_gfx_helenos_ppm_size; |
| 337 | extern char _binary_nameic_ppm_start[0]; |
347 | extern char _binary_gfx_nameic_ppm_start[0]; |
| 338 | extern int _binary_nameic_ppm_size; |
348 | extern int _binary_gfx_nameic_ppm_size; |
| 339 | 349 | ||
| 340 | /** Redraws console graphics */ |
350 | /** Redraws console graphics */ |
| 341 | void gcons_redraw_console(void) |
351 | void gcons_redraw_console(void) |
| 342 | { |
352 | { |
| 343 | int i; |
353 | int i; |
| Line 346... | Line 356... | ||
| 346 | return; |
356 | return; |
| 347 | 357 | ||
| 348 | vp_switch(0); |
358 | vp_switch(0); |
| 349 | set_rgb_color(MAIN_COLOR, MAIN_COLOR); |
359 | set_rgb_color(MAIN_COLOR, MAIN_COLOR); |
| 350 | clear(); |
360 | clear(); |
| 351 | draw_pixmap(_binary_helenos_ppm_start, |
361 | draw_pixmap(_binary_gfx_helenos_ppm_start, |
| 352 | (size_t) &_binary_helenos_ppm_size, xres - 66, 2); |
362 | (size_t) &_binary_gfx_helenos_ppm_size, xres - 66, 2); |
| 353 | draw_pixmap(_binary_nameic_ppm_start, |
363 | draw_pixmap(_binary_gfx_nameic_ppm_start, |
| 354 | (size_t) &_binary_nameic_ppm_size, 5, 17); |
364 | (size_t) &_binary_gfx_nameic_ppm_size, 5, 17); |
| 355 | 365 | ||
| 356 | for (i = 0; i < CONSOLE_COUNT; i++) |
366 | for (i = 0; i < CONSOLE_COUNT; i++) |
| 357 | redraw_state(i); |
367 | redraw_state(i); |
| - | 368 | ||
| 358 | vp_switch(console_vp); |
369 | vp_switch(console_vp); |
| 359 | } |
370 | } |
| 360 | 371 | ||
| 361 | /** Creates a pixmap on framebuffer |
372 | /** Creates a pixmap on framebuffer |
| 362 | * |
373 | * |
| Line 367... | Line 378... | ||
| 367 | static int make_pixmap(char *data, int size) |
378 | static int make_pixmap(char *data, int size) |
| 368 | { |
379 | { |
| 369 | char *shm; |
380 | char *shm; |
| 370 | int rc; |
381 | int rc; |
| 371 | int pxid = -1; |
382 | int pxid = -1; |
| 372 | 383 | ||
| 373 | /* Create area */ |
384 | /* Create area */ |
| 374 | shm = mmap(NULL, size, PROTO_READ | PROTO_WRITE, MAP_SHARED | |
385 | shm = mmap(NULL, size, PROTO_READ | PROTO_WRITE, MAP_SHARED | |
| 375 | MAP_ANONYMOUS, 0, 0); |
386 | MAP_ANONYMOUS, 0, 0); |
| 376 | if (shm == MAP_FAILED) |
387 | if (shm == MAP_FAILED) |
| 377 | return -1; |
388 | return -1; |
| 378 | 389 | ||
| 379 | memcpy(shm, data, size); |
390 | memcpy(shm, data, size); |
| - | 391 | ||
| 380 | /* Send area */ |
392 | /* Send area */ |
| 381 | rc = async_req_1_0(fbphone, FB_PREPARE_SHM, (ipcarg_t) shm); |
393 | rc = async_req_1_0(fbphone, FB_PREPARE_SHM, (ipcarg_t) shm); |
| 382 | if (rc) |
394 | if (rc) |
| 383 | goto exit; |
395 | goto exit; |
| - | 396 | ||
| 384 | rc = ipc_share_out_start(fbphone, shm, PROTO_READ); |
397 | rc = ipc_share_out_start(fbphone, shm, PROTO_READ); |
| 385 | if (rc) |
398 | if (rc) |
| 386 | goto drop; |
399 | goto drop; |
| 387 | 400 | ||
| 388 | /* Obtain pixmap */ |
401 | /* Obtain pixmap */ |
| 389 | rc = async_req_0_0(fbphone, FB_SHM2PIXMAP); |
402 | rc = async_req_0_0(fbphone, FB_SHM2PIXMAP); |
| 390 | if (rc < 0) |
403 | if (rc < 0) |
| 391 | goto drop; |
404 | goto drop; |
| - | 405 | ||
| 392 | pxid = rc; |
406 | pxid = rc; |
| - | 407 | ||
| 393 | drop: |
408 | drop: |
| 394 | /* Drop area */ |
409 | /* Drop area */ |
| 395 | async_msg_0(fbphone, FB_DROP_SHM); |
410 | async_msg_0(fbphone, FB_DROP_SHM); |
| - | 411 | ||
| 396 | exit: |
412 | exit: |
| 397 | /* Remove area */ |
413 | /* Remove area */ |
| 398 | munmap(shm, size); |
414 | munmap(shm, size); |
| 399 | 415 | ||
| 400 | return pxid; |
416 | return pxid; |
| 401 | } |
417 | } |
| 402 | 418 | ||
| 403 | extern char _binary_anim_1_ppm_start[0]; |
419 | extern char _binary_gfx_anim_1_ppm_start[0]; |
| 404 | extern int _binary_anim_1_ppm_size; |
420 | extern int _binary_gfx_anim_1_ppm_size; |
| 405 | extern char _binary_anim_2_ppm_start[0]; |
421 | extern char _binary_gfx_anim_2_ppm_start[0]; |
| 406 | extern int _binary_anim_2_ppm_size; |
422 | extern int _binary_gfx_anim_2_ppm_size; |
| 407 | extern char _binary_anim_3_ppm_start[0]; |
423 | extern char _binary_gfx_anim_3_ppm_start[0]; |
| 408 | extern int _binary_anim_3_ppm_size; |
424 | extern int _binary_gfx_anim_3_ppm_size; |
| 409 | extern char _binary_anim_4_ppm_start[0]; |
425 | extern char _binary_gfx_anim_4_ppm_start[0]; |
| 410 | extern int _binary_anim_4_ppm_size; |
426 | extern int _binary_gfx_anim_4_ppm_size; |
| 411 | 427 | ||
| 412 | static void make_anim(void) |
428 | static void make_anim(void) |
| 413 | { |
429 | { |
| 414 | int an; |
- | |
| 415 | int pm; |
- | |
| 416 | - | ||
| 417 | an = async_req_1_0(fbphone, FB_ANIM_CREATE, cstatus_vp[KERNEL_CONSOLE]); |
430 | int an = async_req_1_0(fbphone, FB_ANIM_CREATE, cstatus_vp[KERNEL_CONSOLE]); |
| 418 | if (an < 0) |
431 | if (an < 0) |
| 419 | return; |
432 | return; |
| 420 | 433 | ||
| 421 | pm = make_pixmap(_binary_anim_1_ppm_start, |
434 | int pm = make_pixmap(_binary_gfx_anim_1_ppm_start, |
| 422 | (int) &_binary_anim_1_ppm_size); |
435 | (int) &_binary_gfx_anim_1_ppm_size); |
| 423 | async_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm); |
436 | async_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm); |
| 424 | 437 | ||
| 425 | pm = make_pixmap(_binary_anim_2_ppm_start, |
438 | pm = make_pixmap(_binary_gfx_anim_2_ppm_start, |
| 426 | (int) &_binary_anim_2_ppm_size); |
439 | (int) &_binary_gfx_anim_2_ppm_size); |
| 427 | async_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm); |
440 | async_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm); |
| 428 | 441 | ||
| 429 | pm = make_pixmap(_binary_anim_3_ppm_start, |
442 | pm = make_pixmap(_binary_gfx_anim_3_ppm_start, |
| 430 | (int) &_binary_anim_3_ppm_size); |
443 | (int) &_binary_gfx_anim_3_ppm_size); |
| 431 | async_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm); |
444 | async_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm); |
| 432 | 445 | ||
| 433 | pm = make_pixmap(_binary_anim_4_ppm_start, |
446 | pm = make_pixmap(_binary_gfx_anim_4_ppm_start, |
| 434 | (int) &_binary_anim_4_ppm_size); |
447 | (int) &_binary_gfx_anim_4_ppm_size); |
| 435 | async_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm); |
448 | async_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm); |
| 436 | 449 | ||
| 437 | async_msg_1(fbphone, FB_ANIM_START, an); |
450 | async_msg_1(fbphone, FB_ANIM_START, an); |
| 438 | 451 | ||
| 439 | animation = an; |
452 | animation = an; |
| 440 | } |
453 | } |
| 441 | 454 | ||
| 442 | extern char _binary_cons_selected_ppm_start[0]; |
455 | extern char _binary_gfx_cons_selected_ppm_start[0]; |
| 443 | extern int _binary_cons_selected_ppm_size; |
456 | extern int _binary_gfx_cons_selected_ppm_size; |
| 444 | extern char _binary_cons_idle_ppm_start[0]; |
457 | extern char _binary_gfx_cons_idle_ppm_start[0]; |
| 445 | extern int _binary_cons_idle_ppm_size; |
458 | extern int _binary_gfx_cons_idle_ppm_size; |
| 446 | extern char _binary_cons_has_data_ppm_start[0]; |
459 | extern char _binary_gfx_cons_has_data_ppm_start[0]; |
| 447 | extern int _binary_cons_has_data_ppm_size; |
460 | extern int _binary_gfx_cons_has_data_ppm_size; |
| 448 | extern char _binary_cons_kernel_ppm_start[0]; |
461 | extern char _binary_gfx_cons_kernel_ppm_start[0]; |
| 449 | extern int _binary_cons_kernel_ppm_size; |
462 | extern int _binary_gfx_cons_kernel_ppm_size; |
| 450 | 463 | ||
| 451 | /** Initialize nice graphical console environment */ |
464 | /** Initialize nice graphical console environment */ |
| 452 | void gcons_init(int phone) |
465 | void gcons_init(int phone) |
| 453 | { |
466 | { |
| 454 | int rc; |
467 | int rc; |
| Line 462... | Line 475... | ||
| 462 | return; |
475 | return; |
| 463 | 476 | ||
| 464 | if ((xres < 800) || (yres < 600)) |
477 | if ((xres < 800) || (yres < 600)) |
| 465 | return; |
478 | return; |
| 466 | 479 | ||
| 467 | /* create console viewport */ |
480 | /* Create console viewport */ |
| - | 481 | ||
| 468 | /* Align width & height to character size */ |
482 | /* Align width & height to character size */ |
| 469 | console_vp = vp_create(CONSOLE_MARGIN, CONSOLE_TOP, |
483 | console_vp = vp_create(CONSOLE_MARGIN, CONSOLE_TOP, |
| 470 | ALIGN_DOWN(xres - 2 * CONSOLE_MARGIN, 8), |
484 | ALIGN_DOWN(xres - 2 * CONSOLE_MARGIN, 8), |
| 471 | ALIGN_DOWN(yres - (CONSOLE_TOP + CONSOLE_MARGIN), 16)); |
485 | ALIGN_DOWN(yres - (CONSOLE_TOP + CONSOLE_MARGIN), 16)); |
| 472 | if (console_vp < 0) |
486 | if (console_vp < 0) |
| Line 484... | Line 498... | ||
| 484 | set_rgb_color(0x202020, 0xffffff); |
498 | set_rgb_color(0x202020, 0xffffff); |
| 485 | } |
499 | } |
| 486 | 500 | ||
| 487 | /* Initialize icons */ |
501 | /* Initialize icons */ |
| 488 | ic_pixmaps[CONS_SELECTED] = |
502 | ic_pixmaps[CONS_SELECTED] = |
| 489 | make_pixmap(_binary_cons_selected_ppm_start, |
503 | make_pixmap(_binary_gfx_cons_selected_ppm_start, |
| 490 | (int) &_binary_cons_selected_ppm_size); |
504 | (int) &_binary_gfx_cons_selected_ppm_size); |
| - | 505 | ic_pixmaps[CONS_IDLE] = |
|
| 491 | ic_pixmaps[CONS_IDLE] = make_pixmap(_binary_cons_idle_ppm_start, |
506 | make_pixmap(_binary_gfx_cons_idle_ppm_start, |
| 492 | (int) &_binary_cons_idle_ppm_size); |
507 | (int) &_binary_gfx_cons_idle_ppm_size); |
| 493 | ic_pixmaps[CONS_HAS_DATA] = |
508 | ic_pixmaps[CONS_HAS_DATA] = |
| 494 | make_pixmap(_binary_cons_has_data_ppm_start, |
509 | make_pixmap(_binary_gfx_cons_has_data_ppm_start, |
| 495 | (int) &_binary_cons_has_data_ppm_size); |
510 | (int) &_binary_gfx_cons_has_data_ppm_size); |
| 496 | ic_pixmaps[CONS_DISCONNECTED] = |
511 | ic_pixmaps[CONS_DISCONNECTED] = |
| 497 | make_pixmap(_binary_cons_idle_ppm_start, |
512 | make_pixmap(_binary_gfx_cons_idle_ppm_start, |
| 498 | (int) &_binary_cons_idle_ppm_size); |
513 | (int) &_binary_gfx_cons_idle_ppm_size); |
| - | 514 | ic_pixmaps[CONS_KERNEL] = |
|
| 499 | ic_pixmaps[CONS_KERNEL] = make_pixmap(_binary_cons_kernel_ppm_start, |
515 | make_pixmap(_binary_gfx_cons_kernel_ppm_start, |
| 500 | (int) &_binary_cons_kernel_ppm_size); |
516 | (int) &_binary_gfx_cons_kernel_ppm_size); |
| 501 | ic_pixmaps[CONS_DISCONNECTED_SEL] = ic_pixmaps[CONS_SELECTED]; |
517 | ic_pixmaps[CONS_DISCONNECTED_SEL] = ic_pixmaps[CONS_SELECTED]; |
| 502 | 518 | ||
| 503 | make_anim(); |
519 | make_anim(); |
| 504 | 520 | ||
| 505 | use_gcons = 1; |
521 | use_gcons = 1; |