<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://elinux.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://elinux.org/index.php?title=ZipIt_Framebuffer_Example&amp;feed=atom&amp;action=history</id>
		<title>ZipIt Framebuffer Example - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://elinux.org/index.php?title=ZipIt_Framebuffer_Example&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://elinux.org/index.php?title=ZipIt_Framebuffer_Example&amp;action=history"/>
		<updated>2013-05-23T17:44:02Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.21alpha</generator>

	<entry>
		<id>http://elinux.org/index.php?title=ZipIt_Framebuffer_Example&amp;diff=8011&amp;oldid=prev</id>
		<title>FransMeulenbroeks: removed ref to nonexisting page</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/index.php?title=ZipIt_Framebuffer_Example&amp;diff=8011&amp;oldid=prev"/>
				<updated>2008-11-17T20:42:23Z</updated>
		
		<summary type="html">&lt;p&gt;removed ref to nonexisting page&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 20:42, 17 November 2008&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;================&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;================&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;'''UPDATE''': This code is incomplete, and doesn't work 100% correctly. If you're interested in drawing graphics on a [[ZipIt]], &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;[[&lt;/del&gt;Albert Santoni&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;]] &lt;/del&gt;has provided [[Zipit Gfx]], a small library that provides some basic graphics drawing capabilities.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;'''UPDATE''': This code is incomplete, and doesn't work 100% correctly. If you're interested in drawing graphics on a [[ZipIt]], Albert Santoni has provided [[Zipit Gfx]], a small library that provides some basic graphics drawing capabilities.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;zipitgfx can be found [http://www.santoni.ca/albert/zipit.html here]. (More information is available in the README posted [http://groups.yahoo.com/group/zipitwireless/message/1542 here].)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;zipitgfx can be found [http://www.santoni.ca/albert/zipit.html here]. (More information is available in the README posted [http://groups.yahoo.com/group/zipitwireless/message/1542 here].)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key elinux:diff:version:1.11a:oldid:3855:newid:8011 --&gt;
&lt;/table&gt;</summary>
		<author><name>FransMeulenbroeks</name></author>	</entry>

	<entry>
		<id>http://elinux.org/index.php?title=ZipIt_Framebuffer_Example&amp;diff=3855&amp;oldid=prev</id>
		<title>Chris at 10:30, 14 July 2007</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/index.php?title=ZipIt_Framebuffer_Example&amp;diff=3855&amp;oldid=prev"/>
				<updated>2007-07-14T10:30:13Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 10:30, 14 July 2007&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 81:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 81:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Zipit]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key elinux:diff:version:1.11a:oldid:2285:newid:3855 --&gt;
&lt;/table&gt;</summary>
		<author><name>Chris</name></author>	</entry>

	<entry>
		<id>http://elinux.org/index.php?title=ZipIt_Framebuffer_Example&amp;diff=2285&amp;oldid=prev</id>
		<title>RBot: Bot (Edward's framework)</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/index.php?title=ZipIt_Framebuffer_Example&amp;diff=2285&amp;oldid=prev"/>
				<updated>2007-03-07T03:34:56Z</updated>
		
		<summary type="html">&lt;p&gt;Bot (Edward&amp;#039;s framework)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;================&lt;br /&gt;
&lt;br /&gt;
'''UPDATE''': This code is incomplete, and doesn't work 100% correctly. If you're interested in drawing graphics on a [[ZipIt]], [[Albert Santoni]] has provided [[Zipit Gfx]], a small library that provides some basic graphics drawing capabilities.&lt;br /&gt;
zipitgfx can be found [http://www.santoni.ca/albert/zipit.html here]. (More information is available in the README posted [http://groups.yahoo.com/group/zipitwireless/message/1542 here].)&lt;br /&gt;
&lt;br /&gt;
================&lt;br /&gt;
&lt;br /&gt;
From [http://groups.yahoo.com/group/zipitwireless/message/600 bomberman0's post]...&lt;br /&gt;
&lt;br /&gt;
Here's sample code for writing to the [[ZipIt]]'s screen. (I've tested it&lt;br /&gt;
and it works fine on my [[ZipIt]].)&lt;br /&gt;
If you know C or C++ at all, it shouldn't be very hard to figure out&lt;br /&gt;
how to draw other stuff with this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
#include &amp;lt;linux/fb.h&amp;gt;&lt;br /&gt;
#include &amp;lt;sys/mman.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
int main()&lt;br /&gt;
{&lt;br /&gt;
int fbfd = 0;&lt;br /&gt;
struct fb_var_screeninfo vinfo;&lt;br /&gt;
struct fb_fix_screeninfo finfo;&lt;br /&gt;
long int screensize = 0;&lt;br /&gt;
char *fbp = 0;&lt;br /&gt;
int x = 0, y = 0;&lt;br /&gt;
long int location = 0;&lt;br /&gt;
&lt;br /&gt;
/* Open the file for reading and writing */&lt;br /&gt;
fbfd = open(&amp;quot;/dev/fb0&amp;quot;, O_RDWR);&lt;br /&gt;
if (!fbfd) {&lt;br /&gt;
printf(&amp;quot;Error: cannot open framebuffer device.\n&amp;quot;);&lt;br /&gt;
exit(1);&lt;br /&gt;
}&lt;br /&gt;
printf(&amp;quot;The framebuffer device was opened successfully.\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
/* Get fixed screen information */&lt;br /&gt;
if (ioctl(fbfd, FBIOGET_FSCREENINFO, &amp;amp;finfo)) {&lt;br /&gt;
printf(&amp;quot;Error reading fixed information.\n&amp;quot;);&lt;br /&gt;
exit(2);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* Get variable screen information */&lt;br /&gt;
if (ioctl(fbfd, FBIOGET_VSCREENINFO, &amp;amp;vinfo)) {&lt;br /&gt;
printf(&amp;quot;Error reading variable information.\n&amp;quot;);&lt;br /&gt;
exit(3);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* Figure out the size of the screen in bytes */&lt;br /&gt;
screensize = vinfo.xres * vinfo.yres * vinfo.bits_per_pixel / 8;&lt;br /&gt;
&lt;br /&gt;
/* Map the device to memory */&lt;br /&gt;
fbp = (char *)mmap(0, screensize, PROT_READ | PROT_WRITE,&lt;br /&gt;
MAP_SHARED, fbfd, 0);&lt;br /&gt;
if ((int)fbp == -1) {&lt;br /&gt;
printf(&amp;quot;Error: failed to map framebuffer device to memory.\n&amp;quot;);&lt;br /&gt;
exit(4);&lt;br /&gt;
}&lt;br /&gt;
printf(&amp;quot;The framebuffer device was mapped to memory successfully.\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
for (y = 0; y &amp;lt; 240; y++)&lt;br /&gt;
{&lt;br /&gt;
for (x = 0; x &amp;lt; 320; x++)&lt;br /&gt;
{&lt;br /&gt;
//x = 100; y = 100; /* Where we are going to put the pixel */&lt;br /&gt;
&lt;br /&gt;
/* Figure out where in memory to put the pixel */&lt;br /&gt;
location = (x+vinfo.xoffset) * (vinfo.bits_per_pixel/4) +&lt;br /&gt;
(y+vinfo.yoffset) * finfo.line_length;&lt;br /&gt;
&lt;br /&gt;
*(fbp + location) = 255; //Paint a black pixel.&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
munmap(fbp, screensize);&lt;br /&gt;
close(fbfd);&lt;br /&gt;
return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>RBot</name></author>	</entry>

	</feed>