<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Slashdev</title>
	<atom:link href="http://www.slashdev.ca/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.slashdev.ca</link>
	<description>Hardware, software, and just general tinkering</description>
	<lastBuildDate>Mon, 12 Mar 2012 04:38:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>SNES USB Gamepad</title>
		<link>http://www.slashdev.ca/2011/10/20/snes-usb-gamepad/</link>
		<comments>http://www.slashdev.ca/2011/10/20/snes-usb-gamepad/#comments</comments>
		<pubDate>Thu, 20 Oct 2011 09:48:28 +0000</pubDate>
		<dc:creator>jiGGaK</dc:creator>
				<category><![CDATA[AVR]]></category>
		<category><![CDATA[Make]]></category>
		<category><![CDATA[Show & Tell]]></category>

		<guid isPermaLink="false">http://www.slashdev.ca/?p=504</guid>
		<description><![CDATA[I was inspired for this build by an instructables user who used my teensy ps3 gamepad code to build a SNES USB controller for the PS3. I can&#8217;t say enough good things about the Teensy development board. It&#8217;s affordable and just so damn versatile. John&#8217;s code is great and all but I just needed something [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_505" class="wp-caption aligncenter" style="width: 459px"><a href="http://www.slashdev.ca/wp-content/uploads/2011/10/gamepad.jpg"><img src="http://www.slashdev.ca/wp-content/uploads/2011/10/gamepad-449x300.jpg" alt="" title="gamepad" width="449" height="300" class="size-medium wp-image-505" /></a><p class="wp-caption-text">Ready for some Mega Man 7</p></div>
<p>I was inspired for this build by an instructables user who used my <a href="http://www.slashdev.ca/2010/05/25/ps3-gamepad-with-home-button/">teensy ps3 gamepad</a> code to build a <a href="http://www.instructables.com/id/SNES-Teensy-USBPS3-Gamepad/">SNES USB controller for the PS3</a>.</p>
<p>I can&#8217;t say enough good things about the <a href="http://www.pjrc.com/teensy/">Teensy</a> development board. It&#8217;s affordable and just so damn versatile.</p>
<p><a href="https://github.com/johnburkert/YeOldeJoystick">John&#8217;s code</a> is great and all but I just needed something to work with my <a href="http://www.slashdev.ca/2008/08/11/lean-mean-mediacenter-machine/">Linux media center PC</a> so I set out to create a simpler version. Click through for some build tips, links to the code, and a few more photos.</p>
<p><span id="more-504"></span></p>
<h2>Download</h2>
<ul>
<li>source code from <a href="http://git.slashdev.ca/teensy-snes/about">here</a> or <a href="https://github.com/jiggak/teensy-snes">here</a></li>
<li>source compiled to <a href="http://www.slashdev.ca/download/gamepad_v1.hex">ihex for flashing</a></li>
</ul>
<h2>Tips &#038; Photos</h2>
<div id="attachment_514" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.slashdev.ca/wp-content/uploads/2011/10/teensy.jpg"><img src="http://www.slashdev.ca/wp-content/uploads/2011/10/teensy-300x300.jpg" alt="" title="teensy" width="300" height="300" class="size-medium wp-image-514" /></a><p class="wp-caption-text">Teensy /w SNES controller wires</p></div>
<p>In tight spaces like a gamepad it&#8217;s no fun at all to be wrestling with a rats nests of wires. Heat shrink tubing is great for managing bunches of wires, but it can make the whole thing difficult to bend. Using a few small rings will still give you a neat bunch of wires, while maintaining flexibility.</p>
<div id="attachment_522" class="wp-caption aligncenter" style="width: 460px"><a href="http://www.slashdev.ca/wp-content/uploads/2011/10/assembled.jpg"><img src="http://www.slashdev.ca/wp-content/uploads/2011/10/assembled-450x300.jpg" alt="" title="assembled" width="450" height="300" class="size-medium wp-image-522" /></a><p class="wp-caption-text">Teensy installed</p></div>
<p>John had a really great tip. Cut off the USB plug housing with a sharp knife to make fitting the cable easier.</p>
<div id="attachment_527" class="wp-caption aligncenter" style="width: 460px"><a href="http://www.slashdev.ca/wp-content/uploads/2011/10/cut_post.jpg"><img src="http://www.slashdev.ca/wp-content/uploads/2011/10/cut_post-450x300.jpg" alt="" title="cut_post" width="450" height="300" class="size-medium wp-image-527" /></a><p class="wp-caption-text">Make room for the Teensy</p></div>
<p>The Teensy will just fit inside the controller without too much fuss. The only modification required is to remove a plastic post in the middle of the rear cover. Break it or cut it off and then use an x-acto-knife to clean up the remaining material.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.slashdev.ca/2011/10/20/snes-usb-gamepad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ATX PSU into Bench PSU</title>
		<link>http://www.slashdev.ca/2011/09/24/atx-psu-into-bench-psu/</link>
		<comments>http://www.slashdev.ca/2011/09/24/atx-psu-into-bench-psu/#comments</comments>
		<pubDate>Sat, 24 Sep 2011 09:24:04 +0000</pubDate>
		<dc:creator>jiGGaK</dc:creator>
				<category><![CDATA[Make]]></category>
		<category><![CDATA[Show & Tell]]></category>

		<guid isPermaLink="false">http://www.slashdev.ca/?p=486</guid>
		<description><![CDATA[I stumbled upon this video by Phil Levchenko showing how to turn an ATX power supply into a bench power supply. I had an old PSU laying around and thought this would be a perfect way to give it a new life. Phil&#8217;s video is great, but I found the video tutorial format a bit [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_487" class="wp-caption aligncenter" style="width: 457px"><a href="http://www.slashdev.ca/wp-content/uploads/2011/09/IMG_4019.jpg"><img src="http://www.slashdev.ca/wp-content/uploads/2011/09/IMG_4019-447x300.jpg" alt="" title="Finished PSU" width="447" height="300" class="size-medium wp-image-487" /></a><p class="wp-caption-text">Bench-top power supply</p></div>
<p>I stumbled upon this video by <a href="http://jumperone.com/2011/06/atx-power-supply-tutorial/">Phil Levchenko showing how to turn an ATX power supply into a bench power supply</a>. I had an old PSU laying around and thought this would be a perfect way to give it a new life. Phil&#8217;s video is great, but I found the video tutorial format a bit tricky to follow at times.</p>
<p>Click through for some pictures, tips and diagrams that you may find helpful.</p>
<p><span id="more-486"></span></p>
<h2>Diagrams</h2>
<p><em>Standard ATX wire colours&#8230;</em></p>
<p><img src="http://www.slashdev.ca/wp-content/uploads/2011/09/atx.png" alt="" title="atx" width="530" height="270" class="aligncenter size-full wp-image-491" /></p>
<p><em>Schematic&#8230;</em></p>
<p><img src="http://www.slashdev.ca/wp-content/uploads/2011/09/atx-sch.png" alt="" title="atx-sch" width="530" height="387" class="aligncenter size-full wp-image-496" /></p>
<h2>Tips</h2>
<div id="attachment_499" class="wp-caption aligncenter" style="width: 460px"><a href="http://www.slashdev.ca/wp-content/uploads/2011/09/IMG_4029.jpg"><img src="http://www.slashdev.ca/wp-content/uploads/2011/09/IMG_4029-450x300.jpg" alt="" title="IMG_4029" width="450" height="300" class="size-medium wp-image-499" /></a><p class="wp-caption-text">Lots-o-wires</p></div>
<p>When I started tearing down the PSU I was tempted to start de-soldering all those extra red, yellow, orange, and black wires. Twisting them together and routing them to binding posts seemed like too much of a pain. Then I realized that these PSUs are capable of providing a pretty significant amount of current (~20 Amps on 5v rail)! The wires in my power supply are 18 AWG, and I couldn&#8217;t find a definitive answer to how much current a single wire could safely carry. So in the end I kept 6 wires per colour&#8230; just to be safe.</p>
<p>In my PSU I chose to pull out +12v, +5v, and +3.3v to binding posts since I can&#8217;t imagine a use for -12v or -5v.</p>
<div id="attachment_501" class="wp-caption aligncenter" style="width: 460px"><a href="http://www.slashdev.ca/wp-content/uploads/2011/09/IMG_4025.jpg"><img src="http://www.slashdev.ca/wp-content/uploads/2011/09/IMG_4025-450x300.jpg" alt="" title="IMG_4025" width="450" height="300" class="size-medium wp-image-501" /></a><p class="wp-caption-text">One last glamour shot</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.slashdev.ca/2011/09/24/atx-psu-into-bench-psu/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Doughduino &#8211; High-tech Bread Making</title>
		<link>http://www.slashdev.ca/2011/09/15/doughduino/</link>
		<comments>http://www.slashdev.ca/2011/09/15/doughduino/#comments</comments>
		<pubDate>Thu, 15 Sep 2011 22:51:10 +0000</pubDate>
		<dc:creator>jiGGaK</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Make]]></category>

		<guid isPermaLink="false">http://www.slashdev.ca/?p=452</guid>
		<description><![CDATA[Several months ago a friend of mine really into making bread inquired about a possible solution for proving bread dough and making pre-ferment starters in the winter. You see, here in Canada winters are cold. Very cold. And heat isn&#8217;t free. Yeast likes to be in nice warm moist conditions, but my wallet likes to [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_473" class="wp-caption alignleft" style="width: 210px"><a href="http://www.slashdev.ca/wp-content/uploads/2011/09/doughduino.jpg"><img src="http://www.slashdev.ca/wp-content/uploads/2011/09/doughduino-200x300.jpg" alt="" title="doughduino" width="200" height="300" class="size-medium wp-image-473" /></a><p class="wp-caption-text">Arduino - It Only Does Everything!</p></div>
<p>Several months ago a friend of mine really into making bread inquired about a possible solution for proving bread dough and making pre-ferment starters in the winter. You see, here in Canada winters are cold. Very cold. And heat isn&#8217;t free. Yeast likes to be in nice warm moist conditions, but my wallet likes to be in the cold with a thick sweater.</p>
<p>So the goal was to create an efficient device that monitors temperature and switches a heat source on/off as necessary to maintain a constant temperature inside of an enclosed space such as a camping cooler.</p>
<p>And here is the result! It&#8217;s based on the bare <a href="http://itp.nyu.edu/physcomp/Tutorials/ArduinoBreadboard">minimum circuitry needed for an Arduino compatible board</a> and then builds on top of that; character LCD display, two buttons, DS18S20 temperature sensor, and a small relay for switching an AC lamp.</p>
<p><span id="more-452"></span></p>
<h2>Source code, schematic, PCB layout</h2>
<div id="attachment_464" class="wp-caption aligncenter" style="width: 421px"><a href="http://www.slashdev.ca/wp-content/uploads/2011/09/doughduino-v1-brd.png"><img src="http://www.slashdev.ca/wp-content/uploads/2011/09/doughduino-v1-brd-411x300.png" alt="" title="doughduino-v1-brd" width="411" height="300" class="size-medium wp-image-464" /></a><p class="wp-caption-text">v1 PCB - component side</p></div>
<ul>
<li>source files from <a href="http://git.slashdev.ca/doughduino/">my git repo</a>, or <a href="https://github.com/jiggak/doughduino">github</a></li>
<li>see <a href="http://git.slashdev.ca/doughduino/about/">README</a> file for ATmega flashing details</li>
<li><a href='http://www.slashdev.ca/wp-content/uploads/2011/09/doughduino-v1.pdf'>v1 PCB artwork</a> [PDF] for toner transfer or exposing pre-sensitized copper clad</li>
<li><a href='http://www.slashdev.ca/wp-content/uploads/2011/09/doughduino-v1-sch.pdf'>v1 schematic</a> [PDF]</li>
</ul>
<h2>What&#8217;s inside</h2>
<p>The doughduino deviates slightly from the <em>Arduino on a breadboard</em>; it does not have a power supply regulator so an external 5v supply is needed. I was pleasantly surprised to find that the guts from an old cell phone charger worked just fine (many chargers are 5 volt, 1 amp supplies).</p>
<div id="attachment_472" class="wp-caption aligncenter" style="width: 424px"><a href="http://www.slashdev.ca/wp-content/uploads/2011/09/psu.jpg"><img src="http://www.slashdev.ca/wp-content/uploads/2011/09/psu-414x300.jpg" alt="" title="psu" width="414" height="300" class="size-medium wp-image-472" /></a><p class="wp-caption-text">Guts from a cell phone charger</p></div>
<div id="attachment_480" class="wp-caption aligncenter" style="width: 371px"><a href="http://www.slashdev.ca/wp-content/uploads/2011/09/clamshell.jpg"><img src="http://www.slashdev.ca/wp-content/uploads/2011/09/clamshell-361x300.jpg" alt="" title="clamshell" width="361" height="300" class="size-medium wp-image-480" /></a><p class="wp-caption-text">Fully assembled internals</p></div>
<div id="attachment_478" class="wp-caption aligncenter" style="width: 422px"><a href="http://www.slashdev.ca/wp-content/uploads/2011/09/pcb_labeled.jpg"><img src="http://www.slashdev.ca/wp-content/uploads/2011/09/pcb_labeled-412x300.jpg" alt="" title="pcb_labeled" width="412" height="300" class="size-medium wp-image-478" /></a><p class="wp-caption-text">Assembled PCB with annotations</p></div>
<h2>Questions/Comments</h2>
<p>Feel free to post a comment or short questions below. If you need help please use the <a href="http://forum.slashdev.ca/">forums</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.slashdev.ca/2011/09/15/doughduino/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hide Toolbar Buttons in Nautilus 3.x</title>
		<link>http://www.slashdev.ca/2011/05/03/hide-toolbar-buttons-in-nautilus-3-x/</link>
		<comments>http://www.slashdev.ca/2011/05/03/hide-toolbar-buttons-in-nautilus-3-x/#comments</comments>
		<pubDate>Tue, 03 May 2011 13:24:51 +0000</pubDate>
		<dc:creator>jiGGaK</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.slashdev.ca/?p=447</guid>
		<description><![CDATA[Are you as annoyed as I am about the superfluous screen real estate consumed by the toolbar buttons in Nautilus 3? Of course you are, that&#8217;s why the oracle brought you here. To remove them, modify /usr/share/nautilus/ui/nautilus-toolbar-ui.xml and comment out all the &#60;toolitem&#62; elements.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.slashdev.ca/wp-content/uploads/2011/05/nautilus.png"><img src="http://www.slashdev.ca/wp-content/uploads/2011/05/nautilus-500x135.png" alt="" title="nautilus toolbar" width="500" height="135" class="aligncenter size-medium wp-image-448" /></a></p>
<p>Are you as annoyed as I am about the superfluous screen real estate consumed by the toolbar buttons in Nautilus 3? Of course you are, that&#8217;s why the <a href="http://www.google.com">oracle</a> brought you here.</p>
<p>To remove them, modify <tt><strong>/usr/share/nautilus/ui/nautilus-toolbar-ui.xml</strong></tt> and comment out all the <tt>&lt;toolitem&gt;</tt> elements.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;ui&gt;
&lt;toolbar name=&quot;Toolbar&quot;&gt;
    &lt;!--&lt;toolitem name=&quot;Back&quot; action=&quot;Back&quot;/&gt;
    &lt;toolitem name=&quot;Forward&quot; action=&quot;Forward&quot;/&gt;
    &lt;toolitem name=&quot;Search&quot; action=&quot;Search&quot;/&gt;--&gt;
&lt;/toolbar&gt;
&lt;/ui&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.slashdev.ca/2011/05/03/hide-toolbar-buttons-in-nautilus-3-x/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Sample &#8211; Portable Mobile Game Code</title>
		<link>http://www.slashdev.ca/2011/04/26/sample-portable-mobile-game-code/</link>
		<comments>http://www.slashdev.ca/2011/04/26/sample-portable-mobile-game-code/#comments</comments>
		<pubDate>Tue, 26 Apr 2011 21:51:43 +0000</pubDate>
		<dc:creator>jiGGaK</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://www.slashdev.ca/?p=413</guid>
		<description><![CDATA[I&#8217;ve decided I want to try and break into the market of mobile gaming but I needed a way to evaluate how practical it was to target multiple platforms at once. Android and iOS are the main players right now but keeping myself open to others seems like it would be a prudent step. And [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve decided I want to try and break into the market of mobile gaming but I needed a way to evaluate how practical it was to target multiple platforms at once. Android and iOS are the main players right now but keeping myself open to others seems like it would be a prudent step. And writing <em>everything</em> from scratch multiple times is not an option.</p>
<p>If we look at all of the popular mobile platforms, they each provide some sort of native development kit all based around a GCC toolchain with OpenGL ES 2.0. So obviously we want to use as much portable C/C++ as possible, but what about all the little (and not so little) differences between the platforms? I needed to get my hands dirty and write a proof of concept.</p>
<p><img src="http://www.slashdev.ca/wp-content/uploads/2011/04/balldemo-467x300.png" alt="" title="balldemo" width="467" height="300" class="aligncenter size-medium wp-image-431" /></p>
<p>The result is a simple <a href="http://git.slashdev.ca/balldemo/">bouncing ball</a> simulation and it runs on Android, iOS, and desktop (Mac, Windows, Linux). <a href="http://www.box2d.org/">Box2D</a> is used for the physics engine, and the rest of the code is licensed under the permissive <a href="http://en.wikipedia.org/wiki/Beerware">beerware license</a>; please respect the license and buy me a beer&#8230; if we ever meet.</p>
<p><span id="more-413"></span></p>
<h2>The code: what it is and is not</h2>
<p>This is <strong>2D</strong> only. This is <strong>not</strong> a framework. This is <strong>not</strong> everything needed to make a game. The purpose of this demo is to get an idea for how one might structure a project to maximize the use of portable code.</p>
<p>As it turns out using C/C++ for our game engine, logic, and graphics accounts for quite a lot. But several platform specific aspects are worth mentioning.</p>
<p>The obvious first difference is the fact that Android is Java/Dalvik and iOS is Objective C/Cocoa Touch. The basics for application development differ significantly from platform to platform so we have to just grin and bear it. For Android we need to use JNI<sup><a href="http://www.slashdev.ca/2011/04/26/sample-portable-mobile-game-code/#footnote_0_413" id="identifier_0_413" class="footnote-link footnote-identifier-link" title="when targeting Android 2.3 and up the NDK supports writing all code in C using native activies">1</a></sup> to call into our C/C++ code (avoid JNI inside render loop due to overhead). On iOS Objective C is a pure superset of C so it mixes nicely. You can also tell XCode to use the Objective C++ compiler which lets you freely mix C++ and Objective C by simply making sure your implementation files have a <em>.mm</em> file extension.</p>
<p>The second is the way OpenGL context is setup. On Android we have <a href="http://developer.android.com/reference/android/opengl/GLSurfaceView.html">GLSurfaceView</a>, on iOS EAGLContext/CAEAGLLayer (see <a href="http://developer.apple.com/library/ios/samplecode/GLES2Sample/Introduction/Intro.html">GLES2Sample</a>), and desktop <a href="http://freeglut.sourceforge.net/">freeglut</a>.</p>
<p>The third is asset loading. To handle this in the demo I defined a basic set of function declarations that need to be implemented on each platform (see <a href="http://git.slashdev.ca/balldemo/tree/common/assets.h">assets.h</a>).</p>
<pre class="brush: cpp; light: true; title: ; notranslate">
/// Structure containing raw asset data and length of data.
typedef struct asset_t {
   uint8_t *data;
   int size;
} asset_t;

/// Load asset from relative path.
asset_t * loadAsset(const char * path);

/// Deallocate an asset structure returned by loadAsset() function.
void freeAsset(asset_t * asset);
</pre>
<p>On iOS the implementation is simple: resolve the path relative to the applications bundle and read the file into memory.</p>
<p>Android was a bit more complicated. I had to do some JNI voodoo to call back into the Dalvik VM to open and read files. The Java code itself was simple, and the JNI code isn&#8217;t <em>that bad</em> either, but there is some serious implications when it comes to JNI state. Basically in order to call back from C/C++ into Dalvik we need a valid pointer to the JNI interface and the JNI pointer to the instance of <a href="http://developer.android.com/reference/android/app/Activity.html">Activity</a> but these pointers are only guaranteed to be valid within the scope of a JNI call. I ended up just saving the JNI related pointers into global variables before calling any engine code that will call the <em>loadAsset()</em> function<sup><a href="http://www.slashdev.ca/2011/04/26/sample-portable-mobile-game-code/#footnote_1_413" id="identifier_1_413" class="footnote-link footnote-identifier-link" title="when targeting Android 2.3 and up the NDK provides a native asset loading API">2</a></sup>.</p>
<p>The last platform difference I want to mention is user input handling. In the demo a simple struct is defined to abstract out the type of action and the related (x,y) coordinate:</p>
<pre class="brush: cpp; light: true; title: ; notranslate">
/// Action structure containing the type of action and x,y coordinates.
/// Touch actions use x,y coordinates in screen space. Tilt action uses
/// x,y values to represent a force vector in the range -9.18 to 9.18.
typedef struct action_t {
   action_t(action_type_t t_, float x_, float y_) : type(t_), x(x_), y(y_) { }
   action_type_t type;
   float x, y;
} action_t;
</pre>
<p>The render loop extracts these actions from a queue and handles them. The threading model varies from platform to platform so it&#8217;s important to make sure that actions are queued on the same thread as the renderer to avoid potential race conditions.</p>
<h2>Running the demo on desktop</h2>
<p>To build on the desktop a few libraries are used to simplify the use of OpenGL: <a href="http://freeglut.sourceforge.net/">freeglut</a> for creating the window and OpenGL context, and <a href="http://glew.sourceforge.net/">GLEW</a> to check for OpenGL 2.0<sup><a href="http://www.slashdev.ca/2011/04/26/sample-portable-mobile-game-code/#footnote_2_413" id="identifier_2_413" class="footnote-link footnote-identifier-link" title="OpenGL ES 2.0 is a subset of OpenGL 2.0">3</a></sup> support and include the various OpenGL headers.</p>
<p>Use your distro&#8217;s package manager to install freeglut and GLEW:</p>
<p><code>sudo pacman -S freeglut glew</code></p>
<p>On Mac OS X an implementation of GLUT is provided with XCode. To install GLEW first install <a href="http://www.macports.org/">MacPorts</a> and then run:</p>
<p><code>sudo port install glew</code></p>
<p>On Windows <a href="http://www.mingw.org">MinGW</a> needs to be installed and configured. Download the <a href="https://sourceforge.net/downloads/mingw">Automated MinGW Installer</a> package<sup><a href="http://www.slashdev.ca/2011/04/26/sample-portable-mobile-game-code/#footnote_3_413" id="identifier_3_413" class="footnote-link footnote-identifier-link" title="at time of writing the mingw installer was mingw-get-inst-20110316.exe">4</a></sup> to simplify things and select <em>C++ Compiler</em> and <em>MinGW Developer ToolKit</em> during setup.</p>
<p><img src="http://www.slashdev.ca/wp-content/uploads/2011/04/mingw.png" alt="" title="mingw" width="533" height="418" class="aligncenter size-full wp-image-437" /></p>
<p>Once installed download the freeglut and GLEW source packages and compile/install them from the MinGW Shell:</p>
<p><code>unzip glew-1.5.8.zip<br />
cd glew-1.5.8<br />
make<br />
make install GLEW_DEST=/mingw<br />
</code></p>
<p><code>tar -zxvf freeglut-2.6.0.tar.gz<br />
cd freeglut-2.6.0<br />
./configure --prefix=/mingw<br />
make<br />
make install<br />
</code></p>
<p>To build the demo just run <tt>make</tt> in the <a href="http://git.slashdev.ca/balldemo/tree/desktop">desktop</a> directory. The asset loading implementation looks for assets in the path <em><tt>../assets</tt></em> so be sure to run the balldemo executable from inside the desktop directory.</p>
<ol class="footnotes"><li id="footnote_0_413" class="footnote">when targeting Android 2.3 and up the NDK supports writing all code in C using <a href="http://developer.android.com/reference/android/app/NativeActivity.html">native activies</a></li><li id="footnote_1_413" class="footnote">when targeting Android 2.3 and up the NDK provides a native asset loading API</li><li id="footnote_2_413" class="footnote">OpenGL ES 2.0 is a subset of OpenGL 2.0</li><li id="footnote_3_413" class="footnote">at time of writing the mingw installer was mingw-get-inst-20110316.exe</li></ol>]]></content:encoded>
			<wfw:commentRss>http://www.slashdev.ca/2011/04/26/sample-portable-mobile-game-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Canon 2 Stage Shutter Switch</title>
		<link>http://www.slashdev.ca/2011/03/05/canon-2-stage-shutter-switch/</link>
		<comments>http://www.slashdev.ca/2011/03/05/canon-2-stage-shutter-switch/#comments</comments>
		<pubDate>Sat, 05 Mar 2011 20:59:46 +0000</pubDate>
		<dc:creator>jiGGaK</dc:creator>
				<category><![CDATA[Make]]></category>

		<guid isPermaLink="false">http://www.slashdev.ca/?p=397</guid>
		<description><![CDATA[Here is a nifty weekend project. It&#8217;s a 2-stage shutter remote for my Canon T2i DSLR. The red push button is a full press and the arcade button is a half press. Since it requires less force to push the arcade button than it does the red push button, it functions exactly as the cameras [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_399" class="wp-caption aligncenter" style="width: 460px"><a href="http://www.slashdev.ca/wp-content/uploads/2011/03/IMG_3162.jpg"><img src="http://www.slashdev.ca/wp-content/uploads/2011/03/IMG_3162-450x300.jpg" alt="" title="Finished Shutter Switch" width="450" height="300" class="size-medium wp-image-399" /></a><p class="wp-caption-text">Yet another use for an arcade button</p></div>
<p>Here is a nifty weekend project. It&#8217;s a 2-stage shutter remote for my Canon T2i DSLR. The red push button is a full press and the arcade button is a half press. Since it requires less force to push the arcade button than it does the red push button, it functions exactly as the cameras built-in shutter switch. I got the inspiration for this project from a <a href="http://www.diyphotography.net/release_cable_for_canon_dslr">guide on diyphotography.net</a>.</p>
<p><span id="more-397"></span></p>
<p><a href="http://www.slashdev.ca/wp-content/uploads/2011/03/IMG_2972.jpg"><img src="http://www.slashdev.ca/wp-content/uploads/2011/03/IMG_2972-450x300.jpg" alt="" title="IMG_2972" width="450" height="300" class="aligncenter size-medium wp-image-402" /></a></p>
<p><a href="http://www.slashdev.ca/wp-content/uploads/2011/03/IMG_2974.jpg"><img src="http://www.slashdev.ca/wp-content/uploads/2011/03/IMG_2974-450x300.jpg" alt="" title="IMG_2974" width="450" height="300" class="aligncenter size-medium wp-image-403" /></a></p>
<p><a href="http://www.slashdev.ca/wp-content/uploads/2011/03/IMG_2980.jpg"><img src="http://www.slashdev.ca/wp-content/uploads/2011/03/IMG_2980-450x300.jpg" alt="" title="IMG_2980" width="450" height="300" class="aligncenter size-medium wp-image-404" /></a></p>
<p><a href="http://www.slashdev.ca/wp-content/uploads/2011/03/IMG_3141.jpg"><img src="http://www.slashdev.ca/wp-content/uploads/2011/03/IMG_3141-450x300.jpg" alt="" title="IMG_3141" width="450" height="300" class="aligncenter size-medium wp-image-406" /></a></p>
<p><a href="http://www.slashdev.ca/wp-content/uploads/2011/03/IMG_3137.jpg"><img src="http://www.slashdev.ca/wp-content/uploads/2011/03/IMG_3137-450x300.jpg" alt="" title="IMG_3137" width="450" height="300" class="aligncenter size-medium wp-image-405" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.slashdev.ca/2011/03/05/canon-2-stage-shutter-switch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BlackBerry Push Service &#8211; Fail</title>
		<link>http://www.slashdev.ca/2011/02/01/blackberry-push-service-fail/</link>
		<comments>http://www.slashdev.ca/2011/02/01/blackberry-push-service-fail/#comments</comments>
		<pubDate>Tue, 01 Feb 2011 16:05:29 +0000</pubDate>
		<dc:creator>jiGGaK</dc:creator>
				<category><![CDATA[BlackBerry]]></category>
		<category><![CDATA[Rants]]></category>

		<guid isPermaLink="false">http://www.slashdev.ca/?p=382</guid>
		<description><![CDATA[This really is depressing. Being Canadian and all I really want to root for the home team. Moreover I hate polluting my blog with complaints about BlackBerry development. Alas, here we go again&#8230; Todays topic: BlackBerry Push Service. BlackBerry push can be routed through BlackBerry Internet Service or it can route through a BlackBerry Enterprise [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_387" class="wp-caption aligncenter" style="width: 510px"><img src="http://www.slashdev.ca/wp-content/uploads/2011/01/graph.png" alt="" title="graph" width="500" height="400" class="size-full wp-image-387" /><p class="wp-caption-text">Everyone loves graphs...</p></div>
<p>This really is depressing. Being Canadian and all I really want to root for the home team. Moreover I hate polluting my blog with complaints about BlackBerry development. Alas, here we go again&#8230;</p>
<p>Todays topic: <a href="http://www.blackberry.com/developers/pushservice">BlackBerry Push Service</a>. BlackBerry push can be routed through <em>BlackBerry Internet Service</em> or it can route through a <em>BlackBerry Enterprise Server</em>. The difference? BIS is the one you want to use if you are a developer targeting the consumer market at large. To route push notifications through BIS, you must <a href="https://www.blackberry.com/profile/?eventId=8121">request</a> to evaluate the push service. It also appears you must submit another request when you want to go live, but I haven&#8217;t made it that far.</p>
<p>This is where the problem lies. I have submitted three requests in the past two weeks with no response. Each time I submit one, I&#8217;m greeted with a friendly message:</p>
<blockquote><p><em>&#8220;Thank you, someone will contact you in <strong>two business days</strong>&#8220;</em></p></blockquote>
<p>Bottom line I can&#8217;t finish OR test my app without access to this service.</p>
<h2>What about the other guys?</h2>
<p>This is where it gets sad. The software I&#8217;m working on is also being developed in parallel for Android and iOS. So what does the process look like for the other platforms?</p>
<h3>Android</h3>
<p>The <a href="http://code.google.com/android/c2dm/">Android Cloud to Device Messaging</a> framework also requires developers to <a href="http://code.google.com/android/c2dm/">signup</a> to access the service. The difference being two seconds after you fill out the signup form you are ready to go!</p>
<p>Slightly off topic, but the C2DM API is extremely simple to use. It was a pleasure to work with since I could use basic Unix shell scripting to send requests to the service during testing.</p>
<h3>Apple</h3>
<p>After you register as an iOS developer (and you drop $100 US for the privilege), Apple gives you access to something called the <em>iOS Provisioning Portal</em> which is a web interface for generating all manor of certificates and mobile provisioning bits and bobs. In this portal access to the APNS (Apple Push Notification Service) can also be enabled with a few mouse clicks&#8230; instantly.</p>
<h2>So what have I done so far?</h2>
<p>Not wait on RIM, that&#8217;s for sure! In the last two weeks I have managed to completely finish the iOS and Android versions of my app including full push integration.</p>
<p>Let me say that again. In the time it&#8217;s taking RIM to <em>grant</em> me permission to write software that uses their services, I have created the same thing on competing platforms.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.slashdev.ca/2011/02/01/blackberry-push-service-fail/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Wire Harness Lacing &#8211; A Dead Art?</title>
		<link>http://www.slashdev.ca/2010/06/13/wire-harness-lacing-a-dead-art/</link>
		<comments>http://www.slashdev.ca/2010/06/13/wire-harness-lacing-a-dead-art/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 01:53:45 +0000</pubDate>
		<dc:creator>jiGGaK</dc:creator>
				<category><![CDATA[Make]]></category>

		<guid isPermaLink="false">http://www.slashdev.ca/?p=367</guid>
		<description><![CDATA[I don&#8217;t pretend to be a master of wire lacing. To be honest this is my first attempt but I am thoroughly pleased with the results. I was inspired by a recent article by Keith Neufeld in which he showed off his x0xb0x Wiring Harnesses. This is my latest arcade joystick build incorporating my recent [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_370" class="wp-caption aligncenter" style="width: 410px"><a href="http://www.slashdev.ca/wp-content/uploads/2010/06/IMG_2554.jpg"><img src="http://www.slashdev.ca/wp-content/uploads/2010/06/IMG_2554-400x300.jpg" alt="" title="IMG_2554" width="400" height="300" class="size-medium wp-image-370" /></a><p class="wp-caption-text">A wire harness promoting proper dental hygiene.</p></div>
<p>I don&#8217;t pretend to be a master of wire lacing. To be honest this is my first attempt but I am thoroughly pleased with the results. I was inspired by a recent article by <a href="http://www.neufeld.newton.ks.us/electronics/">Keith Neufeld</a> in which he showed off his <a href="http://www.neufeld.newton.ks.us/electronics/?p=1091">x0xb0x Wiring Harnesses</a>.</p>
<p>This is my latest arcade joystick build incorporating my recent <a href="/2010/05/25/ps3-gamepad-with-home-button/">teensy++ based controller</a>. Locating resources on the web describing the art of wire harness lacing can be tricky as it doesn&#8217;t seem to be a popular practice but I found a decent writeup <a href="http://www.dairiki.org/hammond/cable-lacing-howto/">here</a>. The wires on my controller are 24 gauge so the thick string Keith used would have been overkill. Instead I opted for waxed dental floss to wrap the wires (tip: waxed is important as it helps the knots stay tight).</p>
<p><span id="more-367"></span></p>
<div id="attachment_373" class="wp-caption aligncenter" style="width: 410px"><a href="http://www.slashdev.ca/wp-content/uploads/2010/06/IMG_2547.jpg"><img src="http://www.slashdev.ca/wp-content/uploads/2010/06/IMG_2547-400x300.jpg" alt="" title="IMG_2547" width="400" height="300" class="size-medium wp-image-373" /></a><p class="wp-caption-text">Full harness</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.slashdev.ca/2010/06/13/wire-harness-lacing-a-dead-art/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PS3 Gamepad With Home Button</title>
		<link>http://www.slashdev.ca/2010/05/25/ps3-gamepad-with-home-button/</link>
		<comments>http://www.slashdev.ca/2010/05/25/ps3-gamepad-with-home-button/#comments</comments>
		<pubDate>Tue, 25 May 2010 14:45:36 +0000</pubDate>
		<dc:creator>jiGGaK</dc:creator>
				<category><![CDATA[AVR]]></category>
		<category><![CDATA[Make]]></category>

		<guid isPermaLink="false">http://www.slashdev.ca/?p=353</guid>
		<description><![CDATA[It&#8217;s no secret the PS3 will work with most USB HID gamepads or joysticks. However the Home button is something special. If you connect your sixaxis controller to your PC and monitor button presses, the Home button comes up as button number 13. If you then create a standard gamepad with the same button mapping, [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_354" class="wp-caption aligncenter" style="width: 410px"><a href="http://www.slashdev.ca/wp-content/uploads/2010/05/IMG_2539.jpg"><img src="http://www.slashdev.ca/wp-content/uploads/2010/05/IMG_2539-400x300.jpg" alt="" title="ps3-teensy-shield" width="400" height="300" class="size-medium wp-image-354" /></a><p class="wp-caption-text">Teensy++ on a breakout board</p></div>
<p>It&#8217;s no secret the PS3 will work with most <a href="http://www.slashdev.ca/2010/05/22/simple-6-button-ps3-gamepad/">USB HID gamepads or joysticks</a>. However the Home button is something special. If you connect your sixaxis controller to your PC and monitor button presses, the Home button comes up as button number 13. If you then create a standard gamepad with the same button mapping, the PS3 will refuse to recognize the Home button.</p>
<p>After some tracing of the USB traffic from an official Madcatz Street Fighter IV FightStick I was able to come up with a solution! There are 8 bytes transfered during the enumeration phase, just after the device sends it&#8217;s report descriptor. Mimicking the same exchange results in the Home button functioning correctly when button 13 is pressed.</p>
<p>I used the amazingly awesome <a href="http://www.pjrc.com/teensy/">Teensy++</a> development board after being inspired by <a href="http://diy-machine.blogspot.com/">this guys work</a>. I also used the report descriptor from Toodles <a href="http://www.shoryuken.com/showthread.php?t=131230">UPCB</a> project which appears to come from the SEGA VIRTUA STICK. This descriptor is very similar to the one from the Madcatz controller, except their is one endpoint instead of two which simplifies things somewhat.</p>
<p>I also created a shield (pictured above) which brings several pins on the Teensy to convenient screw terminals.</p>
<p>Source code and Eagle files are available in a <a href="http://git.slashdev.ca/ps3-teensy-hid/">git repository</a>. Code is licensed under the <a href="http://www.gnu.org/licenses/">GPL v3</a> and the PCB design is distributed under a Creative Commons license <a href="http://creativecommons.org/licenses/by-sa/2.5/">Attribution-ShareAlike 2.5</a>.</p>
<div id="attachment_359" class="wp-caption aligncenter" style="width: 358px"><img src="http://www.slashdev.ca/wp-content/uploads/2010/05/ps3-teensy-hid-v11.png" alt="" title="ps3-teensy-hid-v11" width="348" height="243" class="size-full wp-image-359" /><p class="wp-caption-text">Terminal reference</p></div>
<p><a href='http://www.slashdev.ca/wp-content/uploads/2010/05/ps3-teensy-hid-v11.pdf'>This document</a> can be printed onto transparency for exposing your pre-sensitized copper clad. To use this for toner transfer, be sure to mirror the image first.</p>
<p>And a compiled version of the <a href="http://git.slashdev.ca/ps3-teensy-hid/tree/ps3-teensy-hid.hex">code in ihex</a>. This is for the teensy++ 2.0. The code might work with other versions of the teensy, but a re-compile will be required.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.slashdev.ca/2010/05/25/ps3-gamepad-with-home-button/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Simple 6-Button PS3 Gamepad</title>
		<link>http://www.slashdev.ca/2010/05/22/simple-6-button-ps3-gamepad/</link>
		<comments>http://www.slashdev.ca/2010/05/22/simple-6-button-ps3-gamepad/#comments</comments>
		<pubDate>Sat, 22 May 2010 23:56:45 +0000</pubDate>
		<dc:creator>jiGGaK</dc:creator>
				<category><![CDATA[AVR]]></category>
		<category><![CDATA[Make]]></category>

		<guid isPermaLink="false">http://www.slashdev.ca/?p=341</guid>
		<description><![CDATA[I built this board several months ago. It&#8217;s a USB gamepad circuit with 6 buttons mapped to correlate with the standard layout of a Street Fighter IV FightStick for the PS3. It&#8217;s based on another design by Raphaël Assénat. You&#8217;ll find the source code and Eagle files here, both licensed under the GPL. PS: It&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p>I built this board several months ago. It&#8217;s a USB gamepad circuit with 6 buttons mapped to correlate with the standard layout of a Street Fighter IV FightStick for the PS3.</p>
<div id="attachment_342" class="wp-caption aligncenter" style="width: 410px"><a href="http://www.slashdev.ca/wp-content/uploads/2010/05/img_1735.jpg"><img src="http://www.slashdev.ca/wp-content/uploads/2010/05/img_1735-400x300.jpg" alt="" title="ps3-hid" width="400" height="300" class="size-medium wp-image-342" /></a><p class="wp-caption-text">Gamepad Circuit Board</p></div>
<div id="attachment_347" class="wp-caption aligncenter" style="width: 416px"><img src="http://www.slashdev.ca/wp-content/uploads/2010/05/ps3-usb-hid.png" alt="" title="ps3-usb-hid-eagle" width="406" height="270" class="size-full wp-image-347" /><p class="wp-caption-text">Export from EagleCAD with terminal labels</p></div>
<p>It&#8217;s based on <a href="http://www.slashdev.ca/2009/04/12/nes-usb-gamepad/">another design</a> by <a href="http://www.raphnet.net/electronique/usb_game12/index_en.php">Raphaël Assénat</a>.</p>
<p>You&#8217;ll find the source code and Eagle files <a href="http://git.slashdev.ca/ps3-usb-hid">here</a>, both licensed under the GPL.</p>
<p>PS: It&#8217;ll also work just fine on a Window/Linux/Mac OS X computer as well since all operating systems come with drivers for USB HID gamepads.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.slashdev.ca/2010/05/22/simple-6-button-ps3-gamepad/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

