<?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>matt.west.co.tt &#187; Hacks</title>
	<atom:link href="http://matt.west.co.tt/category/hacks/feed/" rel="self" type="application/rss+xml" />
	<link>http://matt.west.co.tt</link>
	<description>adventures of a retro electro media hacker type person</description>
	<lastBuildDate>Sat, 14 Aug 2010 15:32:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>JSModPlayer &#8211; a Javascript .MOD player</title>
		<link>http://matt.west.co.tt/music/jsmodplayer/</link>
		<comments>http://matt.west.co.tt/music/jsmodplayer/#comments</comments>
		<pubDate>Sun, 23 May 2010 02:22:27 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Demoscene]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Music]]></category>

		<guid isPermaLink="false">http://matt.west.co.tt/?p=156</guid>
		<description><![CDATA[The epic Pacman 30th anniversary Google Doodle, along with Ben Firshman&#8217;s dynamicaudio.js library for dynamically generating audio, collectively persuaded me that I haven&#8217;t done any mad Javascript hacking for far too long. My response to this state of affairs is JSModPlayer, a player for .MOD music files (the mainstay of Amiga and PC sample-based music [...]]]></description>
			<content:encoded><![CDATA[<p>The epic Pacman 30th anniversary Google Doodle, along with Ben Firshman&#8217;s <a href="http://github.com/bfirsh/dynamicaudio.js">dynamicaudio.js</a> library for dynamically generating audio, collectively persuaded me that I haven&#8217;t done any mad Javascript hacking for far too long. My response to this state of affairs is <b><a href="http://jsspeccy.zxdemo.org/jsmodplayer/">JSModPlayer</a></b>, a player for .MOD music files (the mainstay of Amiga and PC sample-based music circa 1990).</p>
<p>So far it only implements a subset of the possible sample effects, and it demands a very fast Javascript engine &#8211; luckily all the new breed of browsers are pretty competitive at that now. Even so, unless your CPU is an absolute behemoth, it&#8217;ll probably struggle to keep up &#8211; the audio output is fixed at 44100Hz, and that&#8217;s rather a lot of numbers for Javascript to crunch, especially when the MOD file gets up to 16 or more channels. Which, amusingly enough, is exactly the situation we had back when we were using Gravis Ultrasounds on 386es. Hurrah for progress!</p>
<p><strong>Update 2010-06-08:</strong> Oops. In the process of testing how Safari 5 shapes up, I discovered a rather silly oversight: the audio buffering routine was set up to never use more than 10% of CPU. Now that I&#8217;ve fixed it, it turns out that Chrome and Safari (at least) have no trouble at all playing Jugi&#8217;s <em>Dope</em> theme in its 28-channel glory. (However, taking the brakes off the buffering does mean that we can&#8217;t reliably pause the audio any more. A small price to pay, I think you&#8217;ll agree.)</p>
]]></content:encoded>
			<wfw:commentRss>http://matt.west.co.tt/music/jsmodplayer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>DivIDEo v0.2.0 &#8211; video converters for the masses</title>
		<link>http://matt.west.co.tt/demoscene/divideo-v0-2-0-video-converters-for-the-masses/</link>
		<comments>http://matt.west.co.tt/demoscene/divideo-v0-2-0-video-converters-for-the-masses/#comments</comments>
		<pubDate>Tue, 18 May 2010 23:53:08 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Demoscene]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Spectrum]]></category>

		<guid isPermaLink="false">http://matt.west.co.tt/?p=152</guid>
		<description><![CDATA[I&#8217;ve rewritten the DivIDEo converter app in pure C, and as a result it&#8217;s now available in friendly standalone Windows and Mac OS X command line executables (and slightly less crazy and Ruby-ish to compile for other platforms). All the necessary libraries (including a major chunk of ffmpeg) are compiled in, so now there&#8217;s nothing [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve rewritten the DivIDEo converter app in pure C, and as a result it&#8217;s now available in friendly standalone Windows and Mac OS X command line executables (and slightly less crazy and Ruby-ish to compile for other platforms). All the necessary libraries (including a major chunk of <a href="http://ffmpeg.org/">ffmpeg</a>) are compiled in, so now there&#8217;s nothing standing between you and full-on ZX Spectrum video converting action. Head over to <a href="http://divideo.zxdemo.org/">the DivIDEo website</a> for the downloads.</p>
<p>Incidentally, a couple of people have asked about the identity of the singer in <a href="http://www.youtube.com/watch?v=bVO5NUy7uZE">the Outline presentation</a>. Apparently, while that clip is what we sneeringly refer to as an &#8220;internet phenomenon&#8221;, it&#8217;s not quite reached 100% saturation, so: it is <a href="http://knowyourmeme.com/memes/trololo-edward-hill-russian-rickroll">Edward Anatolevich Hill</a>, with a Russian TV performance of the song &#8220;I am very glad, because I&#8217;m finally back home&#8221;, or as it&#8217;s becoming increasingly better known, <a href="http://trololololololololololo.com/">Trololololo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://matt.west.co.tt/demoscene/divideo-v0-2-0-video-converters-for-the-masses/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DivIDEo &#8211; Spectrum streaming video</title>
		<link>http://matt.west.co.tt/demoscene/divideo-spectrum-streaming-video/</link>
		<comments>http://matt.west.co.tt/demoscene/divideo-spectrum-streaming-video/#comments</comments>
		<pubDate>Mon, 03 May 2010 15:06:36 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Demoscene]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Spectrum]]></category>

		<guid isPermaLink="false">http://matt.west.co.tt/?p=148</guid>
		<description><![CDATA[Six years after my first tentative attempts at streaming video from the DivIDE interface were presented at Notcon 2004, I&#8217;ve finally come up with a system that I&#8217;m happy with. It boasts 25fps playback with audio somewhere above the &#8216;nails in a vacuum cleaner&#8217; quality of previous attempts (through the use of delta compression on [...]]]></description>
			<content:encoded><![CDATA[<p>Six years after my first tentative attempts at streaming video from the DivIDE interface were presented at Notcon 2004, I&#8217;ve finally come up with a system that I&#8217;m happy with. It boasts 25fps playback with audio somewhere above the &#8216;nails in a vacuum cleaner&#8217; quality of previous attempts (through the use of delta compression on the video data and variable bitrate audio to use up whatever processor time is left), a one-shot conversion utility that handles all the video decoding, rendering and re-packing, and a player routine that more or less respects the ATA spec (so won&#8217;t fall apart as soon as someone else tries it on a different CompactFlash card. Hopefully). Here&#8217;s how I presented it at the Outline demo party:</p>
<p><object width="480" height="279"><param name="movie" value="http://www.youtube.com/v/bVO5NUy7uZE&#038;hl=en_GB&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/bVO5NUy7uZE&#038;hl=en_GB&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="279"></embed></object></p>
<p>The full description, and a whole bunch of downloads, is on the <a href="http://divideo.zxdemo.org/">DivIDEo project website</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://matt.west.co.tt/demoscene/divideo-spectrum-streaming-video/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JSSpeccy v20091121</title>
		<link>http://matt.west.co.tt/spectrum/jsspeccy-20091121/</link>
		<comments>http://matt.west.co.tt/spectrum/jsspeccy-20091121/#comments</comments>
		<pubDate>Sat, 21 Nov 2009 23:12:29 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[JSSpeccy]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Spectrum]]></category>

		<guid isPermaLink="false">http://matt.west.co.tt/?p=139</guid>
		<description><![CDATA[Yesterday&#8217;s Full Frontal javascript conference turned out to be the ideal setting to compare notes with Ben Firshman of JSNES fame on the finer points of implementing emulators in Javascript &#8211; so this new release of JSSpeccy is the natural consequence of that. I&#8217;ve put in an optimisation which might possibly be a speed boost [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday&#8217;s <a href="http://2009.full-frontal.org/">Full Frontal javascript conference</a> turned out to be the ideal setting to compare notes with Ben Firshman of <a href="http://benfirshman.com/projects/jsnes/">JSNES</a> fame on the finer points of implementing emulators in Javascript &#8211; so this new release of JSSpeccy is the natural consequence of that. I&#8217;ve put in an optimisation which might possibly be a speed boost on Chrome (only writing bytes to ImageData when absolutely <em>absolutely</em> necessary), and the much-needed ability to load your own snapshot files, using the little-known getAsBinary method on file upload objects. (Unfortunately Firefox 3.5 is the only browser which supports it right now, but it looks like it may be in the process of getting the official W3C blessing right now.) And since I was on a roll, on the train back I implemented tape loading traps and the ability to load .TAP files (again, only on Firefox 3.5). Wahey!</p>
<ul>
<li><a href="http://jsspeccy.zxdemo.org/">Play online</a></li>
<li><a href="http://jsspeccy.zxdemo.org/jsspeccy-20091121.zip">Download JSSpeccy v20091121</a> (680Kb)</li>
<li><a href="http://svn.matt.west.co.tt/svn/jsspec/">JSSpeccy subversion repository</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://matt.west.co.tt/spectrum/jsspeccy-20091121/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Midibeep</title>
		<link>http://matt.west.co.tt/music/midibeep/</link>
		<comments>http://matt.west.co.tt/music/midibeep/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 00:11:52 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Spectrum]]></category>

		<guid isPermaLink="false">http://matt.west.co.tt/?p=130</guid>
		<description><![CDATA[Last week I posted possibly the most tedious Basic type-in listing ever to World Of Spectrum: (continues for approx 1500 more lines) Anyone typing it in in its entirety would be rewarded with this: Download midibeep_minute_waltz.mp3 Not bad for an evening&#8217;s work. Mind you, I did take an ever so teeny shortcut, by writing a [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I posted possibly <a href="http://www.worldofspectrum.org/forums/showthread.php?t=27028">the most tedious Basic type-in listing ever</a> to <a href="http://www.worldofspectrum.org/forums/">World Of Spectrum</a>:</p>
<p><img src="http://matt.west.co.tt/images/beep.png" width="320" height="240" alt="5 BEEP 0.212765, 20; 10 BEEP 0.106383,19..." /><br />
<em>(continues for approx 1500 more lines)</em></p>
<p>Anyone typing it in in its entirety would be rewarded with this:</p>
<p><a href="http://www.zxdemo.org/gasman/music/midibeep_minute_waltz.mp3">Download midibeep_minute_waltz.mp3</a></p>
<p>Not bad for an evening&#8217;s work. Mind you, I did take an ever so teeny shortcut, by writing a Ruby program to convert a MIDI file to BEEP format. (Any .mid file will do, although ones with a single instrument will survive the rather primitive selective-note-butchering process better. Oh, and anything much longer than this one will exceed the 48K Spectrum memory&#8230;) And now you can try it out too:</p>
<ul>
<li><a href="http://github.com/gasman/midibeep/">Midibeep source/downloads at Github</a></li>
<li><a href="http://www.zxdemo.org/extra/src/Mid2BEEP.zip">Midibeep Windows build</a> (thanks to Karl McNeil)</li>
<li><a href="http://www.zxdemo.org/gasman/music/chopin.tap">Minute Waltz (TAP, 38K)</a></li>
</ul>
<p><strong>Update 2010-05-26:</strong> Karl McNeil has adapted Midibeep into a variant called Mid2ASM, which outputs an assembler listing rather than Basic &#8211; this enables the data to be packed much more efficiently, paving the way for altogether longer pieces of music. <a href="http://www.zxdemo.org/extra/src/Mid2ASM.zip">Download Mid2ASM</a> (453K, Windows EXE included)</p>
<p><strong>Update 2010-06-02:</strong> Another update from Karl, featuring a Windows GUI, more space-saving tweaks, and embedding the output in a Basic REM statement. <a href="http://www.zxdemo.org/extra/src/Mid2ASM-2.zip">Download Mid2ASM v2</a> (3.4Mb)</p>
]]></content:encoded>
			<wfw:commentRss>http://matt.west.co.tt/music/midibeep/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
<enclosure url="http://www.zxdemo.org/gasman/music/midibeep_minute_waltz.mp3" length="1780424" type="audio/mpeg" />
		</item>
		<item>
		<title>JSSpeccy v20090929 (Don&#8217;t-Mess-With-Geeks Edition)</title>
		<link>http://matt.west.co.tt/spectrum/jsspeccy-20090929/</link>
		<comments>http://matt.west.co.tt/spectrum/jsspeccy-20090929/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 00:21:19 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[JSSpeccy]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Spectrum]]></category>

		<guid isPermaLink="false">http://matt.west.co.tt/?p=127</guid>
		<description><![CDATA[I wasn&#8217;t really planning on developing JSSpeccy further, because I didn&#8217;t consider it a serious project with a future. However, it turns out that someone else did. Enough to rip it off wholesale and pass it off as their own work on the iPhone app store for Â£1.29 a pop, no less. Yes, thanks to [...]]]></description>
			<content:encoded><![CDATA[<p>I wasn&#8217;t really planning on developing JSSpeccy further, because I didn&#8217;t consider it a serious project with a future. However, it turns out that someone else <em>did</em>. Enough to rip it off wholesale and pass it off as their own work on the iPhone app store for Â£1.29 a pop, no less. Yes, thanks to <a href="http://jorallan.livejournal.com/9645.html">the detective work of Phil Kendall</a> we now know that ZXGamer, the much heralded Spectrum emulator for the iPhone, was nothing more than JSSpeccy with a fancy title screen tacked on. (Which of course is a blatant violation of the GPL, and being pure Javascript, would explain why it ran at less than the speed of a real Spectrum on a 600 MHz device, and why it was overwhelmingly rated at one out of five stars. Epic fail.) It&#8217;s been pulled from the app store now &#8211; so while ZXGamer is gradually disappearing from the internet, it&#8217;s time to redress the balance a bit.</p>
<p><a href="http://jsspeccy.zxdemo.org/">A new version of JSSpeccy is out</a>. It doesn&#8217;t run at full speed on an iPhone either (although it positively speeds along on recent versions of Safari on real computers), but it does boast the following changes:</p>
<ul>
<li><strong>GPL v3 licenced</strong>, with prominent notices to make it clear that playing silly buggers like the above will not be tolerated (even if they do include source&#8230;)</li>
<li><strong>A bit of speed optimisation</strong> (about 15% faster maybe)</li>
<li><strong>A pimped-up user interface</strong> with shiny icons</li>
<li>And most relevantly, <strong>entirely controllable via iPhone / iPod Touch touchscreen</strong>. In principle. (If you&#8217;re expecting an immersive gaming experience, you&#8217;ll be disappointed.)</li>
</ul>
<p>So there you go &#8211; probably the best Spectrum emulator for the iPhone ever. And it&#8217;s free.</p>
<ul>
<li><a href="http://jsspeccy.zxdemo.org/">Play online</a></li>
<li><a href="http://jsspeccy.zxdemo.org/jsspeccy-20090929.zip">Download, inc source</a> (674Kb)</li>
<li><a href="http://svn.matt.west.co.tt/svn/jsspec/">JSSpeccy Subversion repository</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://matt.west.co.tt/spectrum/jsspeccy-20090929/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Sleeper &#8211; mapping European night trains</title>
		<link>http://matt.west.co.tt/ruby/sleeper/</link>
		<comments>http://matt.west.co.tt/ruby/sleeper/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 21:24:06 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://matt.west.co.tt/?p=118</guid>
		<description><![CDATA[It&#8217;s now been 10 months and 10 demo parties since I last saw the inside of an airport (with plenty more to come over the next couple of months&#8230; parties that is, not airports), and for any eco-conscious European traveller like me, knowing which sleeper trains to catch is the key to happy travels. So, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://sleeper.demozoo.org/"><img src="http://matt.west.co.tt/images/sleeper.jpg" width="250" height="201" alt="" style="float: left; padding-right: 8px;" /></a> It&#8217;s now been 10 months and 10 demo parties since I last saw the inside of an airport (with plenty more to come over the next couple of months&#8230; parties that is, not airports), and for any eco-conscious European traveller like me, knowing which sleeper trains to catch is the key to happy travels. So, it&#8217;s a bit of a shame that there&#8217;s no single website you can go to to find out the best sleeper train to get to European Destination X. Sure, <a href="http://www.seat61.com/">Seat 61</a> is a fantastic resource for finding out how to get to your country of choice, but you can never be sure whether you&#8217;d get better results by heading just across the border, or tweaking your journey times slightly&#8230;</p>
<p>So, in a classic case of building a website to scratch a personal itch, and not wanting to let niggly licencing issues get in the way of a cool idea&#8230; <strong><a href="http://sleeper.demozoo.org/">Sleeper</a></strong> is my new website aimed at searching and mapping the European sleeper train network in its entirety. It&#8217;s been put together with <a href="http://www.ruby-lang.org/">Ruby</a>, <a href="http://www.rubyonrails.org/">Rails</a> (gosh, that&#8217;s rather apt isn&#8217;t it&#8230;), <a href="http://geokit.rubyforge.org/">Geokit</a>, Google Maps, <a href="http://wiki.github.com/why/hpricot">Hpricot</a> and my own freshly open-sourced <a href="http://github.com/gasman/bahn/">Bahn</a> library for snarfing data from <a href="http://www.bahn.de/">Deutsche Bahn</a>&#8216;s website, and hopefully it can give you a fuller picture than ever before of what actually exists in the wonderful world of sleeper trains. Right now it stops short of providing one overall definitive map of the network (it would probably crash your browser if I tried plotting it on Google Maps), but that&#8217;s on the todo list.</p>
]]></content:encoded>
			<wfw:commentRss>http://matt.west.co.tt/ruby/sleeper/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Ode To Claire / Snakebite</title>
		<link>http://matt.west.co.tt/music/ode-to-claire-snakebite/</link>
		<comments>http://matt.west.co.tt/music/ode-to-claire-snakebite/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 20:17:25 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Demoscene]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[Spectrum]]></category>

		<guid isPermaLink="false">http://matt.west.co.tt/?p=117</guid>
		<description><![CDATA[A couple of fast-made Spectrum releases for last month&#8217;s most excellent]]></description>
			<content:encoded><![CDATA[<p>A couple of fast-made Spectrum releases for last month&#8217;s most excellent <a href=http://www.outlinedemoparty.nl/">Outline</a> demo party. <strong>Ode To Claire</strong> is a curious little 128 byte intro, using a trick I&#8217;ve been wanting to try out for ages. It&#8217;s not exactly a fast-paced action extravaganza, but it does fit 150-odd characters of avant-garde poetry, the printing routine, and a demo effect into 128 bytes of code. Working out how is an exercise for the reader (and I&#8217;m quite interested to know whether the secret is immediately obvious to anyone who&#8217;s at all familiar with the Spectrum&#8230;)</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/3LSzKeh-6sQ&#038;hl=en&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/3LSzKeh-6sQ&#038;hl=en&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<ul>
<li><a href="http://www.zxdemo.org/f/200905/ode_to_claire.zip">Download Ode To Claire</a></li>
<li><a href="http://pouet.net/prod.php?which=53180">Ode To Claire on Pouet</a></li>
</ul>
<p>On the musical front, <strong>Snakebite</strong> is a chiptune with a middle-eastern vibe, modelled after every Turkish Eurovision entry ever. It got third place in the competition, and originally they weren&#8217;t going to give out a third prize, but they had some spare food left over on the Saturday night, so I won a jar of sausages. <em>Best. Prize. Ever.</em></p>
<p><a href="http://music.matt.west.co.tt/speccy/gasman_-_snakebite.mp3">Download gasman_-_snakebite.mp3</a></p>
<ul>
<li><a href="http://music.matt.west.co.tt/speccy/gasman_-_snakebite.mp3">Download Snakebite &#8211; MP3 (2.5Mb)</li>
<li><a href="http://music.matt.west.co.tt/speccy/gasman_-_snakebite.stc">Download Snakebite &#8211; STC (5.1Kb)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://matt.west.co.tt/music/ode-to-claire-snakebite/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
<enclosure url="http://music.matt.west.co.tt/speccy/gasman_-_snakebite.mp3" length="2604390" type="audio/mpeg" />
		</item>
		<item>
		<title>JSSpeccy: A ZX Spectrum emulator in Javascript</title>
		<link>http://matt.west.co.tt/spectrum/jsspeccy/</link>
		<comments>http://matt.west.co.tt/spectrum/jsspeccy/#comments</comments>
		<pubDate>Sun, 19 Oct 2008 21:23:26 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[JSSpeccy]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Spectrum]]></category>

		<guid isPermaLink="false">http://matt.west.co.tt/?p=110</guid>
		<description><![CDATA[I&#8217;m really typecasting myself here. If there were an international &#8220;Person most likely to write a Spectrum emulator in Javascript&#8221; award, I&#8217;d have taken it for the last five years running. So here it is &#8211; probably the most stereotypical project I&#8217;ll ever come up with. Readme file Run JSSpeccy online (includes 10 classic games!) [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m really typecasting myself here. If there were an international &#8220;Person most likely to write a Spectrum emulator in Javascript&#8221; award, I&#8217;d have taken it for the last five years running. So here it is &#8211; probably the most stereotypical project I&#8217;ll ever come up with.</p>
<ul>
<li><a href="http://jsspeccy.zxdemo.org/README">Readme file</a></li>
<li><strong><a href="http://jsspeccy.zxdemo.org/">Run JSSpeccy online</a> (includes 10 classic games!)</strong></li>
<li><a href="http://jsspeccy.zxdemo.org/jsspeccy-20081019.zip">Download JSSpeccy</a> (644Kb)</li>
<li><a href="http://svn.matt.west.co.tt/svn/jsspec/">JSSpeccy Subversion repository</a></li>
</ul>
<p>Writing this wasn&#8217;t actually such a big deal &#8211; the Z80 core was ported from the one in <a href="http://fuse-emulator.sourceforge.net/">Fuse</a>, with the Perl-and-C-preprocessor-munging trickery still intact, and Javascript is syntactically close enough to C that that wasn&#8217;t a mammoth task. (I got 90% of it done on the train journey back from International Vodka Party alongside <a href="http://matt.west.co.tt/music/5090-2008/#edgware-road">recording silly songs about tube stations</a>.) The one fiddly bit was working around the places where the Fuse code used low-level C constructs to its advantage: using unions to chop and change between individual registers and 16-bit register pairs, and relying on limited-size C data types (often in pretty subtle ways) to truncate 8-bit and 16-bit values at the right time, whereas Javascript only has integers. (Actually, the really time-consuming bit was debugging it all&#8230; luckily, Fuse has a rather excellent test suite too.)</p>
<p>The rest is just creative abuse of the &lt;canvas&gt; element, as usual&#8230; it&#8217;ll take advantage of the putImageData interface to do the pixel pushing if available (on my machine Firefox has it, Safari doesn&#8217;t) and fall back on drawing 1&#215;1 pixel rectangles otherwise. This time I&#8217;ve thrown in Google&#8217;s <a href="http://excanvas.sourceforge.net/">ExplorerCanvas</a> as a nod to those poor unfortunates still stuck with Internet Explorer. Incidentally, I&#8217;d be curious to know how it rates on Google Chrome (I don&#8217;t have an XP/Vista box to test on) &#8211; if the hype is true (and it implements the putImageData interface like all good up-to-date browsers should) then I&#8217;d expect it to comfortably reach 100% Spectrum speed on modest hardware.</p>
]]></content:encoded>
			<wfw:commentRss>http://matt.west.co.tt/spectrum/jsspeccy/feed/</wfw:commentRss>
		<slash:comments>82</slash:comments>
		</item>
		<item>
		<title>Antisocial</title>
		<link>http://matt.west.co.tt/demoscene/antisocial/</link>
		<comments>http://matt.west.co.tt/demoscene/antisocial/#comments</comments>
		<pubDate>Thu, 09 Oct 2008 00:08:02 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Canvastastic]]></category>
		<category><![CDATA[Demoscene]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Talks]]></category>

		<guid isPermaLink="false">http://matt.west.co.tt/?p=108</guid>
		<description><![CDATA[This is it then&#8230; my big comeback to the Javascript demo scene after a two year absence, and also the moment when my demo coding muse returned from a long holiday, I guess. Ladies and gentlemen, I give you&#8230; Antisocial, a biting satire on social networking phenomena. Visit the Antisocial microsite&#8230; With my characteristic lack [...]]]></description>
			<content:encoded><![CDATA[<p><img src="/images/antisocial.png" width="177" height="200" alt="" style="float:right; border:8px solid silver;margin-left: 16px;" /> This is it then&#8230; my big comeback to the Javascript demo scene after a two year absence, and also the moment when my demo coding muse returned from a long holiday, I guess. Ladies and gentlemen, I give you&#8230; <strong>Antisocial</strong>, a biting satire on social networking phenomena.</p>
<p><strong><a href="http://antisocial.demozoo.org/">Visit the <em>Antisocial</em> microsite&#8230;</a></strong></p>
<p>With my characteristic lack of organisation, I found myself with two weeks to go to the <a href="http://sundowndemoparty.org/">Sundown</a> party, having promised a demo release, and with nothing specific in the pipeline. So, I decided to take a chance and run with an idea that had been sitting on top of my &#8220;demos to write when I have more free time than I do right now&#8221; pile for the best part of a year. I had it all planned out in my head, right down to the soundtrack: a mysterious track from an unlabelled CD I picked up at a <a href="http://myspace.com/zxspectrumorchestra">ZX Spectrum Orchestra</a> gig in 2005 (which turned out to be <i>Round</i>, from their Clive Live^3 EP). A quick bit of permission-getting later, and I was at the point of no return.</p>
<p>I knew it would be an ambitious job, and a bit of a leap artistically and technically from my usual stuff. I pencilled in a rough project plan in my diary. I drew up storyboards. I read up on the maths that was too nasty to contemplate on previous projects. And shockingly enough, I actually <em>enjoyed</em> all of the above.</p>
<p><span id="more-108"></span><br />
As it happens, browser technology (as far as the <tt>&lt;canvas&gt;</tt> element goes at least) has not moved on one jot in the last two years, so I was able to dust off the <a href="http://matt.west.co.tt/javascript/canvastastic-beta-1/">Canvastastic</a> codebase and found it still pleasantly usable and not too affected by code rot. I gave it a slightly more OpenGL-ish API (within the limitations of my &#8220;someone at the pub described it to me once&#8221; knowledge of OpenGL) and patched up the more glaring omissions (like Z-plane clipping, so that you can have polygons going behind the camera. Proper <a href="http://www.cubic.org/docs/3dclip.htm">frustum clipping</a> would have been a better idea, so that I didn&#8217;t end up with it trying to plot 20000&#215;40000 pixel triangles and sending Windows into a stroboscopic flashing fit and having to hack up a fix after the party. Macs are fine with it&#8230;).</p>
<p>The demo code was only half the job though; to handle the camera paths and synchronisation and the million other details where hard-coding wouldn&#8217;t cut it this time, I joined the big league of the demoscene by building a demo tool (still all in Javascript) that probably only I can understand. (It&#8217;s included in the final release, so have a play. I dare you.) As I didn&#8217;t have any meaningful experience in 3dMAX, or Flash, or Werkkzeug, or Quartz Composer, or any of the other things I really ought to have been using as reference points, it was a grand exercise in Making It Up As I Went Along. I&#8217;d almost forgotten how much fun it is to code that way, but naturally a fair few bad decisions came out of that as well. Firstly, it turns out that organising things around a timeline interface doesn&#8217;t really fit all that well; it means that every object and event is treated as independent of everything else, so things get a bit clunky when they have to share resources (such as lots of camera shots of the same scene). Looks like you can&#8217;t beat the good old boxes-and-arrows-all-over-the-place approach.</p>
<p>Secondly, and what probably comes as no surprise to anyone but me &#8211; Javascript is a bit horrible for building demo tools in. The demo itself, no problem &#8211; but for the user interface widgets I found myself constantly wishing for nice, sensible class-based inheritance. Yep, I know the language boffins will say that prototype-based OOP is more powerful, but I guess I&#8217;ve just had my mind addled by programming in the real world. I know of a few attempts to graft class-like behaviour onto Javascript, and that should probably be at the heart of any attempted rewrite of this. Alternatively, there&#8217;s a growing-but-not-quite-there-yet buzz around alternative scripting languages in the browser (just like there&#8217;s a buzz in the opposite direction for server-side Javascript), so perhaps it wouldn&#8217;t be out of the question to have a browser demo tool written in Ruby or Python. Or have the browser environment embedded in a ruby/python desktop app &#8211; at which point, why stop at browser demos? Could it be designed as a more general tool, where the browser is just one of many platforms that can be swapped in? It&#8217;s tempting. Onward and upward!</p>
]]></content:encoded>
			<wfw:commentRss>http://matt.west.co.tt/demoscene/antisocial/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
