Rev 2479 | Rev 2677 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2479 | Rev 2621 | ||
---|---|---|---|
Line 79... | Line 79... | ||
79 | 79 | ||
80 | static int active_console = 0; |
80 | static int active_console = 0; |
81 | 81 | ||
82 | static void vp_switch(int vp) |
82 | static void vp_switch(int vp) |
83 | { |
83 | { |
84 | async_msg(fbphone,FB_VIEWPORT_SWITCH, vp); |
84 | async_msg_1(fbphone,FB_VIEWPORT_SWITCH, vp); |
85 | } |
85 | } |
86 | 86 | ||
87 | /** Create view port */ |
87 | /** Create view port */ |
88 | static int vp_create(unsigned int x, unsigned int y, |
88 | static int vp_create(unsigned int x, unsigned int y, unsigned int width, |
89 | unsigned int width, unsigned int height) |
89 | unsigned int height) |
90 | { |
90 | { |
91 | return async_req_2(fbphone, FB_VIEWPORT_CREATE, |
91 | return async_req_2_0(fbphone, FB_VIEWPORT_CREATE, (x << 16) | y, |
92 | (x << 16) | y, (width << 16) | height, NULL, NULL); |
92 | (width << 16) | height); |
93 | } |
93 | } |
94 | 94 | ||
95 | static void clear(void) |
95 | static void clear(void) |
96 | { |
96 | { |
97 | async_msg(fbphone, FB_CLEAR, 0); |
97 | async_msg_0(fbphone, FB_CLEAR); |
98 | } |
98 | } |
99 | 99 | ||
100 | static void set_style(int fgcolor, int bgcolor) |
100 | static void set_style(int fgcolor, int bgcolor) |
101 | { |
101 | { |
102 | async_msg_2(fbphone, FB_SET_STYLE, fgcolor, bgcolor); |
102 | async_msg_2(fbphone, FB_SET_STYLE, fgcolor, bgcolor); |
Line 138... | Line 138... | ||
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(fbphone, FB_ANIM_START, animation); |
143 | async_msg_1(fbphone, FB_ANIM_START, animation); |
144 | } else { |
144 | } else { |
145 | if (console_state[active_console] == CONS_DISCONNECTED_SEL) |
145 | if (console_state[active_console] == CONS_DISCONNECTED_SEL) |
146 | console_state[active_console] = CONS_DISCONNECTED; |
146 | console_state[active_console] = CONS_DISCONNECTED; |
147 | else |
147 | else |
148 | console_state[active_console] = CONS_IDLE; |
148 | console_state[active_console] = CONS_IDLE; |
Line 222... | Line 222... | ||
222 | else |
222 | else |
223 | console_state[active_console] = CONS_IDLE; |
223 | console_state[active_console] = CONS_IDLE; |
224 | redraw_state(active_console); |
224 | redraw_state(active_console); |
225 | 225 | ||
226 | if (animation != -1) |
226 | if (animation != -1) |
227 | async_msg(fbphone, FB_ANIM_STOP, animation); |
227 | async_msg_1(fbphone, FB_ANIM_STOP, animation); |
228 | 228 | ||
229 | active_console = KERNEL_CONSOLE; /* Set to kernel console */ |
229 | active_console = KERNEL_CONSOLE; /* Set to kernel console */ |
230 | vp_switch(0); |
230 | vp_switch(0); |
231 | } |
231 | } |
232 | 232 | ||
Line 320... | Line 320... | ||
320 | if (shm == MAP_FAILED) |
320 | if (shm == MAP_FAILED) |
321 | return; |
321 | return; |
322 | 322 | ||
323 | memcpy(shm, logo, size); |
323 | memcpy(shm, logo, size); |
324 | /* Send area */ |
324 | /* Send area */ |
325 | rc = async_req_2(fbphone, FB_PREPARE_SHM, (ipcarg_t) shm, 0, NULL, |
325 | rc = async_req_1_0(fbphone, FB_PREPARE_SHM, (ipcarg_t) shm); |
326 | NULL); |
- | |
327 | if (rc) |
326 | if (rc) |
328 | goto exit; |
327 | goto exit; |
329 | rc = async_req_3(fbphone, IPC_M_AS_AREA_SEND, (ipcarg_t) shm, 0, |
328 | rc = async_req_3_0(fbphone, IPC_M_AS_AREA_SEND, (ipcarg_t) shm, 0, |
330 | PROTO_READ, NULL, NULL, NULL); |
329 | PROTO_READ); |
331 | if (rc) |
330 | if (rc) |
332 | goto drop; |
331 | goto drop; |
333 | /* Draw logo */ |
332 | /* Draw logo */ |
334 | async_msg_2(fbphone, FB_DRAW_PPM, x, y); |
333 | async_msg_2(fbphone, FB_DRAW_PPM, x, y); |
335 | drop: |
334 | drop: |
336 | /* Drop area */ |
335 | /* Drop area */ |
337 | async_msg(fbphone, FB_DROP_SHM, 0); |
336 | async_msg_0(fbphone, FB_DROP_SHM); |
338 | exit: |
337 | exit: |
339 | /* Remove area */ |
338 | /* Remove area */ |
340 | munmap(shm, size); |
339 | munmap(shm, size); |
341 | } |
340 | } |
342 | 341 | ||
Line 383... | Line 382... | ||
383 | if (shm == MAP_FAILED) |
382 | if (shm == MAP_FAILED) |
384 | return -1; |
383 | return -1; |
385 | 384 | ||
386 | memcpy(shm, data, size); |
385 | memcpy(shm, data, size); |
387 | /* Send area */ |
386 | /* Send area */ |
388 | rc = async_req_2(fbphone, FB_PREPARE_SHM, (ipcarg_t) shm, 0, NULL, |
387 | rc = async_req_1_0(fbphone, FB_PREPARE_SHM, (ipcarg_t) shm); |
389 | NULL); |
- | |
390 | if (rc) |
388 | if (rc) |
391 | goto exit; |
389 | goto exit; |
392 | rc = async_req_3(fbphone, IPC_M_AS_AREA_SEND, (ipcarg_t) shm, 0, |
390 | rc = async_req_3_0(fbphone, IPC_M_AS_AREA_SEND, (ipcarg_t) shm, 0, |
393 | PROTO_READ, NULL, NULL, NULL); |
391 | PROTO_READ); |
394 | if (rc) |
392 | if (rc) |
395 | goto drop; |
393 | goto drop; |
396 | 394 | ||
397 | /* Obtain pixmap */ |
395 | /* Obtain pixmap */ |
398 | rc = async_req(fbphone, FB_SHM2PIXMAP, 0, NULL); |
396 | rc = async_req_0_0(fbphone, FB_SHM2PIXMAP); |
399 | if (rc < 0) |
397 | if (rc < 0) |
400 | goto drop; |
398 | goto drop; |
401 | pxid = rc; |
399 | pxid = rc; |
402 | drop: |
400 | drop: |
403 | /* Drop area */ |
401 | /* Drop area */ |
404 | async_msg(fbphone, FB_DROP_SHM, 0); |
402 | async_msg_0(fbphone, FB_DROP_SHM); |
405 | exit: |
403 | exit: |
406 | /* Remove area */ |
404 | /* Remove area */ |
407 | munmap(shm, size); |
405 | munmap(shm, size); |
408 | 406 | ||
409 | return pxid; |
407 | return pxid; |
Line 421... | Line 419... | ||
421 | static void make_anim(void) |
419 | static void make_anim(void) |
422 | { |
420 | { |
423 | int an; |
421 | int an; |
424 | int pm; |
422 | int pm; |
425 | 423 | ||
426 | an = async_req(fbphone, FB_ANIM_CREATE, cstatus_vp[KERNEL_CONSOLE], |
424 | an = async_req_1_0(fbphone, FB_ANIM_CREATE, cstatus_vp[KERNEL_CONSOLE]); |
427 | NULL); |
- | |
428 | if (an < 0) |
425 | if (an < 0) |
429 | return; |
426 | return; |
430 | 427 | ||
431 | pm = make_pixmap(_binary_anim_1_ppm_start, |
428 | pm = make_pixmap(_binary_anim_1_ppm_start, |
432 | (int) &_binary_anim_1_ppm_size); |
429 | (int) &_binary_anim_1_ppm_size); |
Line 442... | Line 439... | ||
442 | 439 | ||
443 | pm = make_pixmap(_binary_anim_4_ppm_start, |
440 | pm = make_pixmap(_binary_anim_4_ppm_start, |
444 | (int) &_binary_anim_4_ppm_size); |
441 | (int) &_binary_anim_4_ppm_size); |
445 | async_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm); |
442 | async_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm); |
446 | 443 | ||
447 | async_msg(fbphone, FB_ANIM_START, an); |
444 | async_msg_1(fbphone, FB_ANIM_START, an); |
448 | 445 | ||
449 | animation = an; |
446 | animation = an; |
450 | } |
447 | } |
451 | 448 | ||
452 | extern char _binary_cons_selected_ppm_start[0]; |
449 | extern char _binary_cons_selected_ppm_start[0]; |
Line 465... | Line 462... | ||
465 | int i; |
462 | int i; |
466 | int status_start = STATUS_START; |
463 | int status_start = STATUS_START; |
467 | 464 | ||
468 | fbphone = phone; |
465 | fbphone = phone; |
469 | 466 | ||
470 | rc = async_req_2(phone, FB_GET_RESOLUTION, 0, 0, &xres, &yres); |
467 | rc = async_req_0_2(phone, FB_GET_RESOLUTION, &xres, &yres); |
471 | if (rc) |
468 | if (rc) |
472 | return; |
469 | return; |
473 | 470 | ||
474 | if (xres < 800 || yres < 600) |
471 | if (xres < 800 || yres < 600) |
475 | return; |
472 | return; |