<?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>strcpy(blog_title, witty_saying)</title>
	<atom:link href="http://blogs.ijw.co.nz/matthew/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.ijw.co.nz/matthew</link>
	<description>//what a dirty hack</description>
	<lastBuildDate>Thu, 05 Aug 2010 07:43:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Brewing the Nintendo DS from the comfort of the home, Part 2</title>
		<link>http://blogs.ijw.co.nz/matthew/index.php/2009/09/brewing-the-nintendo-ds-from-the-comfort-of-the-home-part-2/</link>
		<comments>http://blogs.ijw.co.nz/matthew/index.php/2009/09/brewing-the-nintendo-ds-from-the-comfort-of-the-home-part-2/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 21:00:34 +0000</pubDate>
		<dc:creator>Matthew Bowra-Dean</dc:creator>
				<category><![CDATA[Personal Project]]></category>
		<category><![CDATA[dice roller]]></category>
		<category><![CDATA[ds homebrew]]></category>

		<guid isPermaLink="false">http://blogs.ijw.co.nz/matthew/?p=32</guid>
		<description><![CDATA[Well my first version of the dice roller has turned out to be very easy to produce. I initially wanted to stay away from any graphics code and devkitPro provides a good avenue for that in the form of a console that supports ANSI escape codes. A built-in on-screen keyboard can be used for user [...]]]></description>
			<content:encoded><![CDATA[<p>Well my first version of the dice roller has turned out to be very easy to produce. I initially wanted to stay away from any graphics code and devkitPro provides a good avenue for that in the form of a console that supports <a href="http://en.wikipedia.org/wiki/ANSI_escape_code">ANSI escape codes</a>. A built-in on-screen keyboard can be used for user input and access to the SLOT-1 device&#8217;s filesystem is accessible through the standard C I/O functions (fopen, getc etc.).</p>
<p>Here&#8217;s a basic overview of the code:<br />
<span id="more-32"></span></p>
<h2>main.c</h2>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">int</span> main<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> argc<span style="color: #339933;">,</span> <span style="color: #993333;">char</span> <span style="color: #339933;">**</span> argv<span style="color: #009900;">&#41;</span> 
<span style="color: #009900;">&#123;</span>
    PROGRAM_STATE pState <span style="color: #339933;">=</span> MENU<span style="color: #339933;">;</span>
    touchPosition touch<span style="color: #339933;">;</span>
    consoleDemoInit<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    filesystem_init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><code>consoleDemoInit()</code> is a libnds function that initialises the DS&#8217; displays for console only display. <code>filesystem_init()</code> calls the libndsfat function <code>fatInitDefault()</code> to initialise the filesystem and if successful reads from a config file on the SLOT-1 device.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">    <span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">;;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">//update input state</span>
        scanKeys<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        touchRead<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>touch<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">switch</span> <span style="color: #009900;">&#40;</span>pState<span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">case</span> MENU<span style="color: #339933;">:</span>
            menu_draw<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">switch</span><span style="color: #009900;">&#40;</span>menu_handleinput<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>touch<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
            <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">case</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">:</span>
                pState <span style="color: #339933;">=</span> CONFIG<span style="color: #339933;">;</span>
                <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">case</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">:</span>
                pState <span style="color: #339933;">=</span> ROLLER<span style="color: #339933;">;</span>
                <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">case</span> CONFIG<span style="color: #339933;">:</span>
            config_draw<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>config_handleinput<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>touch<span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span>
                pState <span style="color: #339933;">=</span> MENU<span style="color: #339933;">;</span>
            <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">case</span> ROLLER<span style="color: #339933;">:</span>
            roller_draw<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>roller_handleinput<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>touch<span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span>
                pState <span style="color: #339933;">=</span> MENU<span style="color: #339933;">;</span>
            <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        swiWaitForVBlank<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        consoleClear<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>The second part of the main function is the program loop. It is a simple state machine that has three states, a main menu, a configuration menu and the roller itself.<br />
The first couple of function calls each loop are to libnds functions that update the user input state, <code>scanKeys()</code> for button presses and <code>touchRead(&#038;touch)</code> for the touchscreen&#8217;s currently pressed coordinates. Each state then has a <code>draw</code> function and a <code>handleInput</code> function. </p>
<p>Finally there are another couple of calls to libnds. The first (<code>swiWaitForVBlank()</code>) blocks the program until the VBlank interrupt is triggered indicating that the screen has finished drawing. The second (<code>consoleClear()</code>) clears the console with an ANSI escape sequence.</p>
<h2>menu.c</h2>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">void</span> menu_draw<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #993333;">int</span> i<span style="color: #339933;">;</span>
    iprintf<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #660099; font-weight: bold;">\x1b</span>[2;2H&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    iprintf<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Welcome to DS Dice Roller<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This is the menu drawing function. <code>iprintf</code> is used rather than <code>printf</code> to avoid any inadvertent formatting of floats. The &#8220;\x1b[&#8221; string is the ANSI control sequence indicator and is followed by the row and the column of the desired position of the cursor.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">int</span> menu_handleinput<span style="color: #009900;">&#40;</span>touchPosition <span style="color: #339933;">*</span> touch<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #993333;">int</span> keys <span style="color: #339933;">=</span> keysDown<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><code>keysDown()</code> is a libnds function that returns an integer that is a bitwise OR of the current buttons pressed by the user. It is masked off to find the status of the buttons.</p>
<h2>config.c</h2>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">void</span> config_numberinput<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> <span style="color: #339933;">*</span> n<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> max<span style="color: #339933;">,</span> Keyboard <span style="color: #339933;">**</span> k<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #993333;">int</span> key<span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!*</span>k<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #339933;">*</span>k <span style="color: #339933;">=</span> keyboardDemoInit<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">*</span>k<span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span>visible<span style="color: #009900;">&#41;</span>
        keyboardShow<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    key <span style="color: #339933;">=</span> keyboardUpdate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>key <span style="color: #339933;">==</span> <span style="color: #ff0000;">'<span style="color: #000099; font-weight: bold;">\b</span>'</span><span style="color: #009900;">&#41;</span>
        <span style="color: #339933;">*</span>n <span style="color: #339933;">/=</span> <span style="color: #0000dd;">10</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>key <span style="color: #339933;">&gt;=</span> <span style="color: #ff0000;">'0'</span> <span style="color: #339933;">&amp;&amp;</span> key <span style="color: #339933;">&lt;=</span> <span style="color: #ff0000;">'9'</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #339933;">*</span>n <span style="color: #339933;">*=</span> <span style="color: #0000dd;">10</span><span style="color: #339933;">;</span>
        <span style="color: #339933;">*</span>n <span style="color: #339933;">+=</span> key <span style="color: #339933;">-</span> <span style="color: #ff0000;">'0'</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">*</span>n <span style="color: #339933;">&gt;</span> max<span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span>n <span style="color: #339933;">=</span> max<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>key <span style="color: #339933;">==</span> <span style="color: #ff0000;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        keyboardHide<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>filesystemInitialised<span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #993333;">char</span> buf<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">8</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
            <span style="color: #993333;">int</span> n<span style="color: #339933;">;</span>
            FILE <span style="color: #339933;">*</span> f <span style="color: #339933;">=</span> fopen<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;diceconfig.bin&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;wb&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            n <span style="color: #339933;">=</span> snprintf<span style="color: #009900;">&#40;</span>buf<span style="color: #339933;">,</span> <span style="color: #0000dd;">8</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;%d<span style="color: #000099; font-weight: bold;">\n</span>%d&quot;</span><span style="color: #339933;">,</span> num_sides<span style="color: #339933;">,</span> num_dice<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>n <span style="color: #339933;">&gt;</span> <span style="color: #0000dd;">8</span><span style="color: #009900;">&#41;</span> n <span style="color: #339933;">=</span> <span style="color: #0000dd;">8</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>f <span style="color: #339933;">!=</span> NULL<span style="color: #009900;">&#41;</span>
            <span style="color: #009900;">&#123;</span>
                fwrite<span style="color: #009900;">&#40;</span>buf<span style="color: #339933;">,</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">,</span> n<span style="color: #339933;">,</span> f<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                fclose<span style="color: #009900;">&#40;</span>f<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
        cState <span style="color: #339933;">=</span> CONFIG_SELECTION<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>The only other interesting function. <code>keyboardDemoInit()</code> is called once to initialise the default on-screen keyboard. <code>keyboardShow()</code> displays the keyboard and <code>keyboardUpdate()</code> returns the ASCII character that represents the key pressed. As you can see, writing the results to storage is a simple matter of calling the appropriate C I/O functions.</p>
<p>Next on the schedule is the interesting part, actually rendering something other than text on the screen.</p>
<p>Up to date source code for the project can be cloned from the <a href="http://github.com/beedee/DSDiceRoller">project site on Github</a> or if you don&#8217;t use Git, can be downloaded from <a href="http://blogs.ijw.co.nz/matthew/wp-content/uploads/2009/09/DSDiceRoller.tar.gz">here.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.ijw.co.nz/matthew/index.php/2009/09/brewing-the-nintendo-ds-from-the-comfort-of-the-home-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Brewing the Nintendo DS from the comfort of the home, Part 1</title>
		<link>http://blogs.ijw.co.nz/matthew/index.php/2009/07/brewing-the-nintendo-ds-from-the-comfort-of-the-home-part-1/</link>
		<comments>http://blogs.ijw.co.nz/matthew/index.php/2009/07/brewing-the-nintendo-ds-from-the-comfort-of-the-home-part-1/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 19:00:55 +0000</pubDate>
		<dc:creator>Matthew Bowra-Dean</dc:creator>
				<category><![CDATA[Personal Project]]></category>
		<category><![CDATA[dice roller]]></category>
		<category><![CDATA[ds homebrew]]></category>

		<guid isPermaLink="false">http://blogs.ijw.co.nz/matthew/?p=29</guid>
		<description><![CDATA[A little while ago I was looking to start doing some hobbyist embedded programming. I’d fallen in love with the challenges embedded platforms present in software development thanks in part to both the course I did on hardware architecture and assembly language last trimester and the contract work I’ve been doing in the uni holidays. [...]]]></description>
			<content:encoded><![CDATA[<p>A little while ago I was looking to start doing some hobbyist embedded programming. I’d fallen in love with the challenges embedded platforms present in software development thanks in part to both the course I did on hardware architecture and assembly language last trimester and the contract work I’ve been doing in the uni holidays.</p>
<p>Luckily for me the Nintendo DS has a fairly mature homebrew scene so back in April I bought the new DSi hoping all the eager software pirates out there would be quick to crack the firmware and enable the running of unofficial software on it. Unfortunately this hasn’t really happened but fortunately enough, a few <a href="http://en.wikipedia.org/wiki/Nintendo_DS_homebrew#SLOT-1_and_SLOT-2_devices" target="_blank">DS SLOT-1 device</a> manufacturers were able get versions of their devices out that would support DS homebrew on the DSi. None of the extra DSi features or power are available but it’s better than nothing.</p>
<p>So, on to the meat of the story. The Nintendo DS is a very capable little beast. It has two CPUs; an ARM7 clocked at 33MHz which is mainly used for interacting with the hardware; and an ARM9 clocked at 67MHz which does most of the processing grunt work. You also have 4MB of RAM to play with not including the VRAM and numerous caches. The DSi one ups all of this; doubling the clock speed of the processors and quadrupling the size of the RAM. Unfortunately this is unusable to homebrew developers at the moment as only the “DS mode” has been cracked meaning the clock speeds and available RAM are constrained to the DS’ capabilities.</p>
<p>Using the fantastic <a href="http://www.devkitpro.org/" target="_blank">devkitPro</a> toolchain I was quickly able to get a build environment up and going and through the tutorials <a href="http://patater.com/manual" target="_blank">here</a> and <a href="http://www.dev-scene.com/NDS/Tutorials" target="_blank">here</a> I was able to get a handle on the libnds library provided by devkit. So I’ve decided to start hacking on a dice roller. One of my loves in life is pen and paper roleplaying games and a recent game of <a href="http://www.white-wolf.com/Scion/index.php" target="_blank">Scion</a> is beginning to get out of hand with the amount of 10-sided dice I am having to roll. In the interest of having something to waffle on about and impress random strangers on the internet with I am going to chronicle my attempts here (with BSD licensed source of course). Hopefully someone gets something out of this other than me.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.ijw.co.nz/matthew/index.php/2009/07/brewing-the-nintendo-ds-from-the-comfort-of-the-home-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Assembly is not a black art</title>
		<link>http://blogs.ijw.co.nz/matthew/index.php/2009/03/assembly-is-not-a-black-art/</link>
		<comments>http://blogs.ijw.co.nz/matthew/index.php/2009/03/assembly-is-not-a-black-art/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 20:45:49 +0000</pubDate>
		<dc:creator>Matthew Bowra-Dean</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[assembly]]></category>

		<guid isPermaLink="false">http://blogs.ijw.co.nz/matthew/?p=25</guid>
		<description><![CDATA[Something that I have always been hesitant about learning in my travels as a computer science student has been the lowest of the low as far as programming interfaces go: assembly. It has long seemed like mysterious, obfuscated magic to me. While I am only a second year computer science student, I have a good [...]]]></description>
			<content:encoded><![CDATA[<p>Something that I have always been hesitant about learning in my travels as a computer science student has been the lowest of the low as far as programming interfaces go: assembly. It has long seemed like mysterious, obfuscated magic to me. While I am only a second year computer science student, I have a good many more than two years of experience in both high and low level languages and yet I&#8217;ve always been hesitant about going that one step lower than C.</p>
<p>Little did I realise until I started the relevant course at University that there is really no magic to it. Most of the concepts like memory layout and addressing, the stack, the heap and bit wrangling I&#8217;d already picked up in dealing with C. The existence of Registers and why all operations are done on them makes sense when thinking about the phsyical nature of the chip. It&#8217;s almost disappointing in a way, like a Magician revealing how he does his tricks.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.ijw.co.nz/matthew/index.php/2009/03/assembly-is-not-a-black-art/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Congratulations Chris</title>
		<link>http://blogs.ijw.co.nz/matthew/index.php/2009/01/congratulations-chris/</link>
		<comments>http://blogs.ijw.co.nz/matthew/index.php/2009/01/congratulations-chris/#comments</comments>
		<pubDate>Mon, 12 Jan 2009 02:01:21 +0000</pubDate>
		<dc:creator>Matthew Bowra-Dean</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://blogs.ijw.co.nz/matthew/?p=18</guid>
		<description><![CDATA[Nothing to do with software today. I&#8217;d just like the opportunity to congratulate Chris on his marriage to the wonderful Rosanna this last Saturday. Hopefully you&#8217;ll forgive me for rickrolling you at your reception.]]></description>
			<content:encoded><![CDATA[<p>Nothing to do with software today. I&#8217;d just like the opportunity to congratulate Chris on his marriage to the wonderful Rosanna this last Saturday. Hopefully you&#8217;ll forgive me for rickrolling you at your reception.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.ijw.co.nz/matthew/index.php/2009/01/congratulations-chris/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New Zealand Copyright (New Technologies) Amendment Bill</title>
		<link>http://blogs.ijw.co.nz/matthew/index.php/2008/06/new-zealand-copyright-new-technologies-amendment-bill/</link>
		<comments>http://blogs.ijw.co.nz/matthew/index.php/2008/06/new-zealand-copyright-new-technologies-amendment-bill/#comments</comments>
		<pubDate>Fri, 13 Jun 2008 23:11:07 +0000</pubDate>
		<dc:creator>Matthew Bowra-Dean</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[Copyright Law]]></category>
		<category><![CDATA[DRM]]></category>

		<guid isPermaLink="false">http://blogs.ijw.co.nz/matthew/?p=10</guid>
		<description><![CDATA[I didn&#8217;t really want to make my first post on such a subject but it is an important issue that needs to be addressed. The Copyright (New Technologies) Amendment Bill is the New Zealand Government&#8217;s answer to the notorious DMCA of the USA. It was passed back in April with only the Green Party and [...]]]></description>
			<content:encoded><![CDATA[<p>I didn&#8217;t really want to make my first post on such a subject but it is an important issue that needs to be addressed. The Copyright (New Technologies) Amendment Bill is the New Zealand Government&#8217;s answer to the notorious DMCA of the USA. It was passed back in April with only the Green Party and the Maori Party opposing it.</p>
<p><span id="more-10"></span></p>
<p>While there are some good things about it compared to other countries&#8217; equivalent laws (software decompilation for interopability purposes is allowed for example), there are still some massive shortcomings. Most Kiwis are aware of the copyright laws introduced in the days of the VCR that effectively make it illegal to shift any digital content to another format (e.g. ripping your CDs so you can play them on your portable music player). These were retarded back in the day and are even more so now. One of the things this amendment was supposed to fix and indeed what most people are fixating on, is this problem of format-shifting. While the illustrated example has been fixed in <a href="http://www.legislation.govt.nz/act/public/2008/0027/latest/DLM1122619.html" target="_blank">section 81A</a>, this only applies to recorded sound. There is no such provision for digital video. Quite frankly it isn&#8217;t fucking good enough.</p>
<p>If I were to purchase the &#8220;right&#8221; to download a digital video on to my hard-drive (that wasn&#8217;t protected by DRM but we&#8217;ll get to that later) and convert it to a format that would play on my iRiver that has modified firmware to let it play video, I would in fact be breaking the law. Fuck you <a href="http://www.parliament.nz/en-NZ/PB/Legislation/Bills/b/2/a/00DBHOH_BILL7735_1-Copyright-New-Technologies-Amendment-Bill.htm" target="_blank">Judith Tizard</a>.</p>
<p>Then we get to the <a href="http://www.legislation.govt.nz/act/public/2008/0027/latest/DLM1122722.html" target="_blank">clauses on Technological Protection Measures</a> (TPMs) of which DRM is a type of. Like the DMCA it is illegal to circumvent or provide/describe methods for circumvention of TPMs. Only if the TPM is preventing rights that fall under <a href="http://www.legislation.govt.nz/act/public/1994/0143/latest/whole.html#DLM345958" target="_blank">part 3</a> of the original Copyright Act of 1994, which effectively just covers libraries and educational institutes, is it allowed to bypass the TPM. Cases like the recent <a href="http://arstechnica.com/news.ars/post/20080422-drm-sucks-redux-microsoft-to-nuke-msn-music-drm-keys.html" target="_blank">MSN Music debacle</a> are not covered.</p>
<p>As any scientist worth his salt will tell you, it is <a href="http://en.wikipedia.org/wiki/Digital_rights_management#Shortcomings_of_DRM" target="_blank">impossible</a> to produce a perfect DRM system. Those bits have to be decrypted at some point. Unless the Recording Industry is completely fucking retarded, they have to realise this and in fact this whole business with DRM is not to stop pirates but to impose further restrictions on legitimate users. But that&#8217;s another matter.</p>
<p>As a content creator and consumer I say this whole amendment sucks for both sides unless you&#8217;re a large content provider in which case it will make you bucket loads of money.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.ijw.co.nz/matthew/index.php/2008/06/new-zealand-copyright-new-technologies-amendment-bill/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
