<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Tutorial 6: Button detection</title>
	<atom:link href="http://www.codemii.com/2008/09/14/tutorial-6-button-detection/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codemii.com/2008/09/14/tutorial-6-button-detection/</link>
	<description>Home of the Homebrew Browser and Wii tutorials</description>
	<lastBuildDate>Thu, 02 Feb 2012 00:41:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: yohandris</title>
		<link>http://www.codemii.com/2008/09/14/tutorial-6-button-detection/#comment-11403</link>
		<dc:creator>yohandris</dc:creator>
		<pubDate>Thu, 08 Apr 2010 00:06:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.codemii.com/?p=206#comment-11403</guid>
		<description>You added a extra WPAD_ in WPAD_WPAD_Accel(0, &amp;accel);
Just saying in case someone trys to use that.</description>
		<content:encoded><![CDATA[<p>You added a extra WPAD_ in WPAD_WPAD_Accel(0, &amp;accel);<br />
Just saying in case someone trys to use that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: yohandris</title>
		<link>http://www.codemii.com/2008/09/14/tutorial-6-button-detection/#comment-11402</link>
		<dc:creator>yohandris</dc:creator>
		<pubDate>Wed, 07 Apr 2010 23:41:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.codemii.com/?p=206#comment-11402</guid>
		<description>ok thanks i got it from here</description>
		<content:encoded><![CDATA[<p>ok thanks i got it from here</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: teknecal</title>
		<link>http://www.codemii.com/2008/09/14/tutorial-6-button-detection/#comment-11400</link>
		<dc:creator>teknecal</dc:creator>
		<pubDate>Wed, 07 Apr 2010 09:12:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.codemii.com/?p=206#comment-11400</guid>
		<description>To access the accelerometer you would use something like:

vec3w_t accel;

// in while loop
WPAD_WPAD_Accel(0, &amp;accel);

Then you can print out:
accel.x
accel.y
accel.z

More functions can be found in your devkitpro installation at C:\devkitPro\libogc\include\wiiuse

Yep GRRLIB takes a while to know how to work it. A tutorial on internet access wouldn&#039;t be too complicated however there is source available showing you how to download files and how to request pages: http://www.wiibrew.org/wiki/Homebrew_Browser#NetSend_Example_.2B_HTTP_Download_Example</description>
		<content:encoded><![CDATA[<p>To access the accelerometer you would use something like:</p>
<p>vec3w_t accel;</p>
<p>// in while loop<br />
WPAD_WPAD_Accel(0, &#038;accel);</p>
<p>Then you can print out:<br />
accel.x<br />
accel.y<br />
accel.z</p>
<p>More functions can be found in your devkitpro installation at C:\devkitPro\libogc\include\wiiuse</p>
<p>Yep GRRLIB takes a while to know how to work it. A tutorial on internet access wouldn&#8217;t be too complicated however there is source available showing you how to download files and how to request pages: <a href="http://www.wiibrew.org/wiki/Homebrew_Browser#NetSend_Example_.2B_HTTP_Download_Example" rel="nofollow">http://www.wiibrew.org/wiki/Homebrew_Browser#NetSend_Example_.2B_HTTP_Download_Example</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: yohandris</title>
		<link>http://www.codemii.com/2008/09/14/tutorial-6-button-detection/#comment-11393</link>
		<dc:creator>yohandris</dc:creator>
		<pubDate>Wed, 07 Apr 2010 01:59:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.codemii.com/?p=206#comment-11393</guid>
		<description>Hello teknecal, how would you acces the wiimote&#039;s accelerometer? Is their anyway to use the wii speak and the motion plus gyroscope?

Also grrlib is working great for me and without any problems and it really made things easier. It took me a while to figure out that im suppososed to use raw2c on my images but im all good now. Maybe you should make a tutorial on it because the examples were a bit confusing and not exact and i had to trial and error what was rot, scale, position, and that i had to change the makefile to include the gfx folder.

Do you think a tutorial on using internet access would be to complicated?</description>
		<content:encoded><![CDATA[<p>Hello teknecal, how would you acces the wiimote&#8217;s accelerometer? Is their anyway to use the wii speak and the motion plus gyroscope?</p>
<p>Also grrlib is working great for me and without any problems and it really made things easier. It took me a while to figure out that im suppososed to use raw2c on my images but im all good now. Maybe you should make a tutorial on it because the examples were a bit confusing and not exact and i had to trial and error what was rot, scale, position, and that i had to change the makefile to include the gfx folder.</p>
<p>Do you think a tutorial on using internet access would be to complicated?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: yohandris</title>
		<link>http://www.codemii.com/2008/09/14/tutorial-6-button-detection/#comment-11143</link>
		<dc:creator>yohandris</dc:creator>
		<pubDate>Fri, 29 Jan 2010 03:09:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.codemii.com/?p=206#comment-11143</guid>
		<description>ok thxs</description>
		<content:encoded><![CDATA[<p>ok thxs</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: teknecal</title>
		<link>http://www.codemii.com/2008/09/14/tutorial-6-button-detection/#comment-11118</link>
		<dc:creator>teknecal</dc:creator>
		<pubDate>Tue, 26 Jan 2010 01:10:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.codemii.com/?p=206#comment-11118</guid>
		<description>That&#039;s all fine, probably has to do with the new compiler version that DevKitPPC uses (r17 to r19). It has actually compiled the dol and elf file. Run the dol with gcube and you&#039;ll see it work.

For GRRLIB install:
First thing is to run that install.bat found in GRRLIB\GRRLIB\lib.
Second thing is to open up CMD (Start -&gt; Run, type cmd.exe), then navigate to the GRRLIB\GRRLIB\GRRLIB directory (e.g. cd GRRLIB\GRRLIB\GRRLIB) that contains a file called “Makefile”. Type in “make clean all install”, hit enter and it should be good to go.

You should then take a look into some of the examples that&#039;s included with GRRLIB, some are a bit complex so try to find the easy ones.</description>
		<content:encoded><![CDATA[<p>That&#8217;s all fine, probably has to do with the new compiler version that DevKitPPC uses (r17 to r19). It has actually compiled the dol and elf file. Run the dol with gcube and you&#8217;ll see it work.</p>
<p>For GRRLIB install:<br />
First thing is to run that install.bat found in GRRLIB\GRRLIB\lib.<br />
Second thing is to open up CMD (Start -> Run, type cmd.exe), then navigate to the GRRLIB\GRRLIB\GRRLIB directory (e.g. cd GRRLIB\GRRLIB\GRRLIB) that contains a file called “Makefile”. Type in “make clean all install”, hit enter and it should be good to go.</p>
<p>You should then take a look into some of the examples that&#8217;s included with GRRLIB, some are a bit complex so try to find the easy ones.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: yohandris</title>
		<link>http://www.codemii.com/2008/09/14/tutorial-6-button-detection/#comment-11113</link>
		<dc:creator>yohandris</dc:creator>
		<pubDate>Mon, 25 Jan 2010 21:32:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.codemii.com/?p=206#comment-11113</guid>
		<description>ok i got a problem now. when i try to compile your display_png file it gives me this error

&gt; &quot;make&quot; 
main.c
c:/Users/yohandris/Desktop/display_png/source/main.c: In function &#039;main&#039;:
c:/Users/yohandris/Desktop/display_png/source/main.c:135: warning: assignment from incompatible pointer type
c:/Users/yohandris/Desktop/display_png/source/main.c:142: warning: pointer targets in passing argument 1 of &#039;RGB24toYUY2&#039; differ in signedness
c:devkitprodevkitppcbin../lib/gcc/powerpc-eabi/4.4.2/../../../../powerpc-eabi/include/png/huffyuv.h:7: note: expected &#039;char *&#039; but argument is of type &#039;unsigned char *&#039;
c:/Users/yohandris/Desktop/display_png/source/main.c:188: warning: pointer targets in passing argument 2 of &#039;YUY2toRGB24&#039; differ in signedness
c:devkitprodevkitppcbin../lib/gcc/powerpc-eabi/4.4.2/../../../../powerpc-eabi/include/png/huffyuv.h:8: note: expected &#039;u8 *&#039; but argument is of type &#039;char *&#039;
Compiling ... toucan.s
linking ... display_png.elf
output ... display_png.dol

&gt; Process Exit Code: 0
&gt; Time Taken: 00:02

any ideas? also how do i use grrlib? i can&#039;t find out how to install it</description>
		<content:encoded><![CDATA[<p>ok i got a problem now. when i try to compile your display_png file it gives me this error</p>
<p>&gt; &#8220;make&#8221;<br />
main.c<br />
c:/Users/yohandris/Desktop/display_png/source/main.c: In function &#8216;main&#8217;:<br />
c:/Users/yohandris/Desktop/display_png/source/main.c:135: warning: assignment from incompatible pointer type<br />
c:/Users/yohandris/Desktop/display_png/source/main.c:142: warning: pointer targets in passing argument 1 of &#8216;RGB24toYUY2&#8242; differ in signedness<br />
c:devkitprodevkitppcbin../lib/gcc/powerpc-eabi/4.4.2/../../../../powerpc-eabi/include/png/huffyuv.h:7: note: expected &#8216;char *&#8217; but argument is of type &#8216;unsigned char *&#8217;<br />
c:/Users/yohandris/Desktop/display_png/source/main.c:188: warning: pointer targets in passing argument 2 of &#8216;YUY2toRGB24&#8242; differ in signedness<br />
c:devkitprodevkitppcbin../lib/gcc/powerpc-eabi/4.4.2/../../../../powerpc-eabi/include/png/huffyuv.h:8: note: expected &#8216;u8 *&#8217; but argument is of type &#8216;char *&#8217;<br />
Compiling &#8230; toucan.s<br />
linking &#8230; display_png.elf<br />
output &#8230; display_png.dol</p>
<p>&gt; Process Exit Code: 0<br />
&gt; Time Taken: 00:02</p>
<p>any ideas? also how do i use grrlib? i can&#8217;t find out how to install it</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: yohandris</title>
		<link>http://www.codemii.com/2008/09/14/tutorial-6-button-detection/#comment-11112</link>
		<dc:creator>yohandris</dc:creator>
		<pubDate>Mon, 25 Jan 2010 20:40:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.codemii.com/?p=206#comment-11112</guid>
		<description>ohh wait i see were you put the link now.</description>
		<content:encoded><![CDATA[<p>ohh wait i see were you put the link now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: yohandris</title>
		<link>http://www.codemii.com/2008/09/14/tutorial-6-button-detection/#comment-11111</link>
		<dc:creator>yohandris</dc:creator>
		<pubDate>Mon, 25 Jan 2010 20:04:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.codemii.com/?p=206#comment-11111</guid>
		<description>ok i understand it now but i need the libraries</description>
		<content:encoded><![CDATA[<p>ok i understand it now but i need the libraries</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: teknecal</title>
		<link>http://www.codemii.com/2008/09/14/tutorial-6-button-detection/#comment-11099</link>
		<dc:creator>teknecal</dc:creator>
		<pubDate>Sun, 24 Jan 2010 00:06:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.codemii.com/?p=206#comment-11099</guid>
		<description>Hi, I won&#039;t do a tutorial on it (as it&#039;s easier to use GRRLIB) but I will give a quick run down on it. If you&#039;ve read the tutorial about displaying JPGs you should be fine.

Reading though main.c:

We have the normal variables like in jpg
extern char toucan[];
extern int toucanlength;

Some variables for PNG
/*** User defined types from pngogc ***/
  PNGWRAPPER png;
  PNG_MEMFILE *mf;

  /*** General ***/
  char *pic;		/*** Picture buffer ***/
  int row, col;
  u32 *upic;

We can skip the rest until this part which opens up the toucan file (shown by toucan.s) like in JPG
mf = pngmem_fopen(toucan, toucanlength);
  if ( mf == NULL )
    {
      printf(&quot;No memory file!\n&quot;);
      while(1);
    }

It then decodes the PNG with the following.
if ( PNG_Decode(mf, &amp;png) == PNGOGC_SUCCESS )
    {
pic = (char *)malloc(png.height * png.width * 2);
      upic = (u32 *)pic;
RGB24toYUY2(png.image, png.width, png.height, pic, png.width * 2);

You can ignore that offset two lines (centring image).

Then we come to the below which tells it where to draw the PNG file. If you put offset to 50, it will move it 50 pixels to the right, etc.
int offsetx = 0;
		int offsety = 0;

	int i,j;
	for(i=0;i&lt;=(png.width-(png.width/2)-1);i++)
		for(j=1;j&lt;=png.height-2;j++) 
			xfb[0][(i+offsetx)+320*(j+16+offsety)]=upic[i+(png.width-(png.width/2))*j];


Then just clearing up the PNG memory.
free(pic);
PNG_Clear(&amp;png);
pngmem_fclose(mf);</description>
		<content:encoded><![CDATA[<p>Hi, I won&#8217;t do a tutorial on it (as it&#8217;s easier to use GRRLIB) but I will give a quick run down on it. If you&#8217;ve read the tutorial about displaying JPGs you should be fine.</p>
<p>Reading though main.c:</p>
<p>We have the normal variables like in jpg<br />
extern char toucan[];<br />
extern int toucanlength;</p>
<p>Some variables for PNG<br />
/*** User defined types from pngogc ***/<br />
  PNGWRAPPER png;<br />
  PNG_MEMFILE *mf;</p>
<p>  /*** General ***/<br />
  char *pic;		/*** Picture buffer ***/<br />
  int row, col;<br />
  u32 *upic;</p>
<p>We can skip the rest until this part which opens up the toucan file (shown by toucan.s) like in JPG<br />
mf = pngmem_fopen(toucan, toucanlength);<br />
  if ( mf == NULL )<br />
    {<br />
      printf(&#8220;No memory file!\n&#8221;);<br />
      while(1);<br />
    }</p>
<p>It then decodes the PNG with the following.<br />
if ( PNG_Decode(mf, &amp;png) == PNGOGC_SUCCESS )<br />
    {<br />
pic = (char *)malloc(png.height * png.width * 2);<br />
      upic = (u32 *)pic;<br />
RGB24toYUY2(png.image, png.width, png.height, pic, png.width * 2);</p>
<p>You can ignore that offset two lines (centring image).</p>
<p>Then we come to the below which tells it where to draw the PNG file. If you put offset to 50, it will move it 50 pixels to the right, etc.<br />
int offsetx = 0;<br />
		int offsety = 0;</p>
<p>	int i,j;<br />
	for(i=0;i&lt;=(png.width-(png.width/2)-1);i++)<br />
		for(j=1;j&lt;=png.height-2;j++)<br />
			xfb[0][(i+offsetx)+320*(j+16+offsety)]=upic[i+(png.width-(png.width/2))*j];</p>
<p>Then just clearing up the PNG memory.<br />
free(pic);<br />
PNG_Clear(&amp;png);<br />
pngmem_fclose(mf);</p>
]]></content:encoded>
	</item>
</channel>
</rss>

