Changes in uspace/srv/hid/fb/fb.c [19f857a:369a5f8] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/fb/fb.c
r19f857a r369a5f8 59 59 #include <stdio.h> 60 60 #include <byteorder.h> 61 #include <io/screenbuffer.h> 61 62 62 63 #include "font-8x16.h" 63 64 #include "fb.h" 64 65 #include "main.h" 65 #include "../console/screenbuffer.h"66 66 #include "ppm.h" 67 67 … … 72 72 #define DEFAULT_FGCOLOR 0x000000 73 73 74 #define GLYPH_UNAVAIL 75 76 #define MAX_ANIM_LEN 77 #define MAX_ANIMATIONS 78 #define MAX_PIXMAPS 79 #define MAX_VIEWPORTS 74 #define GLYPH_UNAVAIL '?' 75 76 #define MAX_ANIM_LEN 8 77 #define MAX_ANIMATIONS 4 78 #define MAX_PIXMAPS 256 /**< Maximum number of saved pixmaps */ 79 #define MAX_VIEWPORTS 128 /**< Viewport is a rectangular area on the screen */ 80 80 81 81 /** Function to render a pixel from a RGB value. */ … … 956 956 bb_cell_t *bbp; 957 957 attrs_t *a; 958 attr_rgb_t rgb;959 958 960 959 for (j = 0; j < h; j++) { … … 966 965 967 966 a = &data[j * w + i].attrs; 967 968 attr_rgb_t rgb; 969 rgb.fg_color = 0; 970 rgb.bg_color = 0; 968 971 rgb_from_attr(&rgb, a); 969 972 … … 1511 1514 rgb->bg_color = color_table[COLOR_WHITE]; 1512 1515 break; 1516 case STYLE_INVERTED: 1517 rgb->fg_color = color_table[COLOR_WHITE]; 1518 rgb->bg_color = color_table[COLOR_BLACK]; 1519 break; 1520 case STYLE_SELECTED: 1521 rgb->fg_color = color_table[COLOR_WHITE]; 1522 rgb->bg_color = color_table[COLOR_RED]; 1523 break; 1513 1524 default: 1514 1525 return EINVAL; 1515 1526 } 1516 1527 1517 1528 return EOK; 1518 1529 } … … 1756 1767 async_set_client_connection(fb_client_connection); 1757 1768 1758 void *fb_ph_addr = (void *) sysinfo_value("fb.address.physical"); 1759 unsigned int fb_offset = sysinfo_value("fb.offset"); 1760 unsigned int fb_width = sysinfo_value("fb.width"); 1761 unsigned int fb_height = sysinfo_value("fb.height"); 1762 unsigned int fb_scanline = sysinfo_value("fb.scanline"); 1763 unsigned int fb_visual = sysinfo_value("fb.visual"); 1764 1765 unsigned int fbsize = fb_scanline * fb_height; 1769 sysarg_t fb_ph_addr; 1770 if (sysinfo_get_value("fb.address.physical", &fb_ph_addr) != EOK) 1771 return -1; 1772 1773 sysarg_t fb_offset; 1774 if (sysinfo_get_value("fb.offset", &fb_offset) != EOK) 1775 fb_offset = 0; 1776 1777 sysarg_t fb_width; 1778 if (sysinfo_get_value("fb.width", &fb_width) != EOK) 1779 return -1; 1780 1781 sysarg_t fb_height; 1782 if (sysinfo_get_value("fb.height", &fb_height) != EOK) 1783 return -1; 1784 1785 sysarg_t fb_scanline; 1786 if (sysinfo_get_value("fb.scanline", &fb_scanline) != EOK) 1787 return -1; 1788 1789 sysarg_t fb_visual; 1790 if (sysinfo_get_value("fb.visual", &fb_visual) != EOK) 1791 return -1; 1792 1793 sysarg_t fbsize = fb_scanline * fb_height; 1766 1794 void *fb_addr = as_get_mappable_page(fbsize); 1767 1768 if (physmem_map( fb_ph_addr + fb_offset, fb_addr,1795 1796 if (physmem_map((void *) fb_ph_addr + fb_offset, fb_addr, 1769 1797 ALIGN_UP(fbsize, PAGE_SIZE) >> PAGE_WIDTH, AS_AREA_READ | AS_AREA_WRITE) != 0) 1770 1798 return -1; 1771 1799 1772 1800 if (screen_init(fb_addr, fb_width, fb_height, fb_scanline, fb_visual)) 1773 1801 return 0; 1774 1802 1775 1803 return -1; 1776 1804 }
Note:
See TracChangeset
for help on using the changeset viewer.