Rev 1713 | Rev 1723 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1713 | Rev 1720 | ||
---|---|---|---|
Line 290... | Line 290... | ||
290 | * @param lines Positive number - scroll up, negative - scroll down |
290 | * @param lines Positive number - scroll up, negative - scroll down |
291 | */ |
291 | */ |
292 | static void scroll_port_nodb(viewport_t *vport, int lines) |
292 | static void scroll_port_nodb(viewport_t *vport, int lines) |
293 | { |
293 | { |
294 | int y; |
294 | int y; |
295 | int startline; |
- | |
296 | int endline; |
- | |
297 | 295 | ||
298 | if (lines > 0) { |
296 | if (lines > 0) { |
299 | for (y=vport->y; y < vport->y+vport->height - lines; y++) |
297 | for (y=vport->y; y < vport->y+vport->height - lines; y++) |
300 | memcpy(&screen.fbaddress[POINTPOS(vport->x,y)], |
298 | memcpy(&screen.fbaddress[POINTPOS(vport->x,y)], |
301 | &screen.fbaddress[POINTPOS(vport->x,y + lines)], |
299 | &screen.fbaddress[POINTPOS(vport->x,y + lines)], |
Line 561... | Line 559... | ||
561 | * @param data Text data fitting exactly into viewport |
559 | * @param data Text data fitting exactly into viewport |
562 | */ |
560 | */ |
563 | static void draw_text_data(viewport_t *vport, keyfield_t *data) |
561 | static void draw_text_data(viewport_t *vport, keyfield_t *data) |
564 | { |
562 | { |
565 | int i; |
563 | int i; |
566 | char c; |
- | |
567 | int col,row; |
564 | int col,row; |
568 | 565 | ||
569 | clear_port(vport); |
566 | clear_port(vport); |
570 | for (i=0; i < vport->cols * vport->rows; i++) { |
567 | for (i=0; i < vport->cols * vport->rows; i++) { |
571 | if (data[i].character == ' ' && style_same(data[i].style,vport->style)) |
568 | if (data[i].character == ' ' && style_same(data[i].style,vport->style)) |
Line 597... | Line 594... | ||
597 | 594 | ||
598 | (*screen.rgb2scr)(&pmap->data[pos],color); |
595 | (*screen.rgb2scr)(&pmap->data[pos],color); |
599 | } |
596 | } |
600 | 597 | ||
601 | /** Create a new pixmap and return appropriate ID */ |
598 | /** Create a new pixmap and return appropriate ID */ |
602 | static int shm2pixmap(char *shm, size_t size) |
599 | static int shm2pixmap(unsigned char *shm, size_t size) |
603 | { |
600 | { |
604 | int pm; |
601 | int pm; |
605 | pixmap_t *pmap; |
602 | pixmap_t *pmap; |
606 | 603 | ||
607 | pm = find_free_pixmap(); |
604 | pm = find_free_pixmap(); |
Line 645... | Line 642... | ||
645 | static int shm_handle(ipc_callid_t callid, ipc_call_t *call, int vp) |
642 | static int shm_handle(ipc_callid_t callid, ipc_call_t *call, int vp) |
646 | { |
643 | { |
647 | static keyfield_t *interbuffer = NULL; |
644 | static keyfield_t *interbuffer = NULL; |
648 | static size_t intersize = 0; |
645 | static size_t intersize = 0; |
649 | 646 | ||
650 | static char *shm = NULL; |
647 | static unsigned char *shm = NULL; |
651 | static ipcarg_t shm_id = 0; |
648 | static ipcarg_t shm_id = 0; |
652 | static size_t shm_size; |
649 | static size_t shm_size; |
653 | 650 | ||
654 | int handled = 1; |
651 | int handled = 1; |
655 | int retval = 0; |
652 | int retval = 0; |
Line 670... | Line 667... | ||
670 | while (1) |
667 | while (1) |
671 | ; |
668 | ; |
672 | return 1; |
669 | return 1; |
673 | } else { |
670 | } else { |
674 | intersize = IPC_GET_ARG2(*call); |
671 | intersize = IPC_GET_ARG2(*call); |
675 | receive_comm_area(callid,call,(void **)&interbuffer); |
672 | receive_comm_area(callid,call,(void *)&interbuffer); |
676 | } |
673 | } |
677 | return 1; |
674 | return 1; |
678 | case FB_PREPARE_SHM: |
675 | case FB_PREPARE_SHM: |
679 | if (shm_id) |
676 | if (shm_id) |
680 | retval = EBUSY; |
677 | retval = EBUSY; |
Line 732... | Line 729... | ||
732 | return handled; |
729 | return handled; |
733 | } |
730 | } |
734 | 731 | ||
735 | static void copy_vp_to_pixmap(viewport_t *vport, pixmap_t *pmap) |
732 | static void copy_vp_to_pixmap(viewport_t *vport, pixmap_t *pmap) |
736 | { |
733 | { |
737 | int x,y; |
734 | int y; |
738 | int rowsize; |
735 | int rowsize; |
739 | int tmp; |
736 | int tmp; |
740 | int width = vport->width; |
737 | int width = vport->width; |
741 | int height = vport->height; |
738 | int height = vport->height; |
742 | 739 | ||
Line 783... | Line 780... | ||
783 | */ |
780 | */ |
784 | static int draw_pixmap(int vp, int pm) |
781 | static int draw_pixmap(int vp, int pm) |
785 | { |
782 | { |
786 | pixmap_t *pmap = &pixmaps[pm]; |
783 | pixmap_t *pmap = &pixmaps[pm]; |
787 | viewport_t *vport = &viewports[vp]; |
784 | viewport_t *vport = &viewports[vp]; |
788 | int x,y; |
785 | int y; |
789 | int tmp, srcrowsize; |
786 | int tmp, srcrowsize; |
790 | int realwidth, realheight, realrowsize; |
787 | int realwidth, realheight, realrowsize; |
791 | int width = vport->width; |
788 | int width = vport->width; |
792 | int height = vport->height; |
789 | int height = vport->height; |
793 | 790 | ||
Line 921... | Line 918... | ||
921 | animations[i].vp = nvp; |
918 | animations[i].vp = nvp; |
922 | retval = i; |
919 | retval = i; |
923 | break; |
920 | break; |
924 | case FB_ANIM_DROP: |
921 | case FB_ANIM_DROP: |
925 | i = IPC_GET_ARG1(*call); |
922 | i = IPC_GET_ARG1(*call); |
926 | if (nvp >= MAX_ANIMATIONS || i < 0) { |
923 | if (i >= MAX_ANIMATIONS || i < 0) { |
927 | retval = EINVAL; |
924 | retval = EINVAL; |
928 | break; |
925 | break; |
929 | } |
926 | } |
930 | animations[i].initialized = 0; |
927 | animations[i].initialized = 0; |
931 | break; |
928 | break; |
Line 1139... | Line 1136... | ||
1139 | if (i < 0 || i >= MAX_VIEWPORTS) { |
1136 | if (i < 0 || i >= MAX_VIEWPORTS) { |
1140 | retval = EINVAL; |
1137 | retval = EINVAL; |
1141 | break; |
1138 | break; |
1142 | } |
1139 | } |
1143 | if (! viewports[i].initialized ) { |
1140 | if (! viewports[i].initialized ) { |
1144 | while (1) |
- | |
1145 | ; |
- | |
1146 | retval = EADDRNOTAVAIL; |
1141 | retval = EADDRNOTAVAIL; |
1147 | break; |
1142 | break; |
1148 | } |
1143 | } |
1149 | viewports[i].dboffset = 0; |
1144 | viewports[i].dboffset = 0; |
1150 | if (IPC_GET_ARG2(call) == 1 && !viewports[i].dbdata) |
1145 | if (IPC_GET_ARG2(call) == 1 && !viewports[i].dbdata) |
Line 1202... | Line 1197... | ||
1202 | case FB_GET_RESOLUTION: |
1197 | case FB_GET_RESOLUTION: |
1203 | ipc_answer_fast(callid, 0, screen.xres,screen.yres); |
1198 | ipc_answer_fast(callid, 0, screen.xres,screen.yres); |
1204 | continue; |
1199 | continue; |
1205 | case FB_POINTER_MOVE: |
1200 | case FB_POINTER_MOVE: |
1206 | mouse_move(IPC_GET_ARG1(call), IPC_GET_ARG2(call)); |
1201 | mouse_move(IPC_GET_ARG1(call), IPC_GET_ARG2(call)); |
- | 1202 | retval = 0; |
|
1207 | break; |
1203 | break; |
1208 | default: |
1204 | default: |
1209 | retval = ENOENT; |
1205 | retval = ENOENT; |
1210 | } |
1206 | } |
1211 | ipc_answer_fast(callid,retval,0,0); |
1207 | ipc_answer_fast(callid,retval,0,0); |