<?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>Cuppadev &#187; Hacks</title>
	<atom:link href="http://www.cuppadev.co.uk/category/hacks/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cuppadev.co.uk</link>
	<description>Cuppalicious coding!</description>
	<lastBuildDate>Sat, 14 Aug 2010 10:12:44 +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>Where is ScummC?</title>
		<link>http://www.cuppadev.co.uk/hacks/where-is-scummc/</link>
		<comments>http://www.cuppadev.co.uk/hacks/where-is-scummc/#comments</comments>
		<pubDate>Sat, 17 Jul 2010 21:42:29 +0000</pubDate>
		<dc:creator>James Urquhart</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[problem solving]]></category>
		<category><![CDATA[SCUMM]]></category>
		<category><![CDATA[software development]]></category>

		<guid isPermaLink="false">http://www.cuppadev.co.uk/?p=739</guid>
		<description><![CDATA[With the recent remakes of certain Lucasarts adventure games, i thought to myself &#8220;i wonder how the scummc compiler project is getting on?&#8221; To my shock however, it seems the scummc website suddenly died sometime last year, so nobody was able to check out and learn from the only functioning third party SCUMM compiler. Thankfully [...]]]></description>
			<content:encoded><![CDATA[<p>With the recent remakes of certain Lucasarts adventure games, i thought to myself &#8220;i wonder how the scummc compiler project is getting on?&#8221;</p>
<p>To my shock however, it seems the scummc website suddenly died sometime last year, so nobody was able to check out and learn from the only functioning third party SCUMM compiler.</p>
<p>Thankfully i was able to obtain a fairly recent copy of the files in the SVN repository, and coupled with the SVN commit logs on the mailing list i have been able to re-create the repository using GIT as far back as revision 359.</p>
<p>So what are you waiting for? Check it out on <a href="http://github.com/jamesu/scummc">github</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cuppadev.co.uk/hacks/where-is-scummc/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t write that framework</title>
		<link>http://www.cuppadev.co.uk/hacks/dont-write-that-framework/</link>
		<comments>http://www.cuppadev.co.uk/hacks/dont-write-that-framework/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 00:28:48 +0000</pubDate>
		<dc:creator>James Urquhart</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[disaster]]></category>
		<category><![CDATA[software development]]></category>

		<guid isPermaLink="false">http://www.cuppadev.co.uk/?p=728</guid>
		<description><![CDATA[Writing frameworks is a waste of time. That is the conclusion after spending most of my time on my last project writing a framework, in order to make the project &#8220;easier&#8221; to write. The trouble is every minute you divert to the framework, half of your project dies. And since there is an inherent division [...]]]></description>
			<content:encoded><![CDATA[<p>Writing frameworks is a waste of time. </p>
<p>That is the conclusion after spending most of my time on my last project <strong>writing a framework</strong>, in order to make the project &#8220;easier&#8221; to write.</p>
<p>The trouble is every minute you divert to the framework, half of your project dies. And since there is an inherent division between project and framework, by the time you have everything working you have lost your original train of thought.</p>
<p>Then you realize: the project is way <strong>behind schedule</strong>; there goes a cool feature that could gave landed you a multitude of sales. Or even worse, everyone has lost interest.</p>
<p>Instead, I suggest the following mode of thought:</p>
<ul>
<li>Find an existing framework that does most of what you require.</li>
<li>If the framework falls short, rethink your approach.</li>
<li>If you find your code has become a mess, re-factor it into a <strong>small</strong> library.</li>
</ul>
<p>Don&#8217;t be tempted to spend time writing a <strong>monolith</strong> of a framework. And beware the trap of thinking you can turn it into a product in itself; after all, there is a reason why a large proportion of frameworks are free.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cuppadev.co.uk/hacks/dont-write-that-framework/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>More CSS Animations</title>
		<link>http://www.cuppadev.co.uk/hacks/more-css-animations/</link>
		<comments>http://www.cuppadev.co.uk/hacks/more-css-animations/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 20:31:28 +0000</pubDate>
		<dc:creator>James Urquhart</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[webkit]]></category>

		<guid isPermaLink="false">http://www.cuppadev.co.uk/?p=711</guid>
		<description><![CDATA[A few days ago i popped across Anthony Calzadillas &#8220;Pure CSS3 AT-AT Walker&#8220;, which is a great application of using CSS3 Transforms and Animations to create a scene of an AT-AT Walker walking along in a simulated iPad. Anthony explains in great detail how he built the AT-AT, but i couldn&#8217;t help but think &#8220;I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago i popped across Anthony Calzadillas &#8220;<a href="http://anthonycalzadilla.com/css3-ATAT/index.html">Pure CSS3 AT-AT Walker</a>&#8220;, which is a great application of using CSS3 Transforms and Animations to create a scene of an AT-AT Walker walking along in a simulated iPad.</p>
<p>Anthony explains in great detail how he built the AT-AT, but i couldn&#8217;t help but think &#8220;I&#8217;ve got a better way of doing this!&#8221;. </p>
<p>Last year i made a <a href="http://www.cuppadev.co.uk/projects/css-transform-exporter-for-blender/">CSS Transform Exporter</a> for Blender, which can take any scene and generate a corresponding version in a nice and simple HTML page.</p>
<p>So it can take this:</p>
<p><a href="http://www.cuppadev.co.uk/wp-content/uploads/2010/02/atatblend.jpg"><img src="http://www.cuppadev.co.uk/wp-content/uploads/2010/02/atatblend-300x165.jpg" alt="atat in blender" title="atat in blender" width="300" height="165" class="alignnone size-thumbnail wp-image-712" /></a></p>
<p>And turn it into this:</p>
<p><a href="http://www.cuppadev.co.uk/wp-content/uploads/atat/atat.html"><img src="http://www.cuppadev.co.uk/wp-content/uploads/2010/02/atatwkit-251x200.jpg" alt="atat webkit" title="atat webkit" width="251" height="200" class="alignnone size-thumbnail wp-image-713" /></a></p>
<p>Admittedly simple, but it does show off the potential power in adopting CSS3 and HTML5. After all, who needs to use Flash when you can make everything work in actual web browser instead?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cuppadev.co.uk/hacks/more-css-animations/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Surviving a Game Development Job Interview</title>
		<link>http://www.cuppadev.co.uk/hacks/surviving-a-game-development-job-interview/</link>
		<comments>http://www.cuppadev.co.uk/hacks/surviving-a-game-development-job-interview/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 12:12:09 +0000</pubDate>
		<dc:creator>James Urquhart</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[game development]]></category>
		<category><![CDATA[interview]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.cuppadev.co.uk/?p=345</guid>
		<description><![CDATA[The recent demise downfall of Free Radical brought back some fond memories of when i was trying to get a real programmer job in the Game Development industry. Sad to say, i didn&#8217;t make it &#8211; but then again after second thoughts, i kind of figured it wasn&#8217;t the best career path for me anyway. [...]]]></description>
			<content:encoded><![CDATA[<p>The recent <del datetime="2009-02-04T22:35:29+00:00">demise</del> downfall of <a href="http://www.1up.com/do/newsStory?cId=3172060">Free Radical</a> brought back some fond memories of when i was trying to get a real programmer job in the Game Development industry. Sad to say, i didn&#8217;t make it &#8211; but then again after <a href="http://www.isotx.com/wordpress/?p=162">second thoughts</a>, i kind of figured it wasn&#8217;t the <a href="http://en.wikipedia.org/wiki/Video_game_developer">best career path</a> for me anyway.</p>
<p>Still, i learnt quite a lot about what is expected from a game development job interview. And i thought i&#8217;d list my top 3 points here, which are general enough to apply to any game development profession:</p>
<h2>1) Bring a laptop to show off how good you are</h2>
<p>This is perhaps the <strong>most important</strong> point. You cannot rely on thumb drives, cd&#8217;s, or the internet.</p>
<p>There is a high probability that your demos will not load properly on your interviewers systems. So be sure to show them on one that you know does work &#8211; yours.</p>
<p>In addition, the very fact that your demos are on your own hardware gives that extra inclination that you made them yourself.</p>
<h2>2) Brush up on common knowledge pertaining to your profession.</h2>
<p>Chances are that you will be given some form of test, either on paper or through meticulous quizzing. The aim of this is to weed out clueless candidates. Make sure you are not clueless.</p>
<h2>3) Have something to say, questions to ask.</h2>
<p>If you find that the interviewer is talking more than you are, then chances are they are more interested in themselves rather than who they should be interested in &#8211; you.</p>
<p>Have something well-formed to talk about. Don&#8217;t let the interviewer get carried away talking about some obscure technical concept.</p>
<p>The focus should be on you.</p>
<p>So after waffling on with the usual interview talk, your interviewer will usually ask &#8220;<em>Any more questions?</em>&#8220;. At this point, if you answer &#8220;<em>No</em>&#8221; then chances are you will fail the interview.</p>
<p>Why? Well, remember that there are two parties being interviewed. You and your interviewer. They are giving the reins over to you, in a sense.</p>
<p>So now is your last chance to stand out from the crowd (if you haven&#8217;t done so already). If you do not take it, then there will be little to distinguish yourself from the rest of the candidates.</p>
<h2>To conclude</h2>
<p>Anyone else have any more suggestions? Feel free to comment below!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cuppadev.co.uk/hacks/surviving-a-game-development-job-interview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Converting RubyCocoa Projects to MacRuby</title>
		<link>http://www.cuppadev.co.uk/hacks/converting-rubycocoa-projects-to-macruby/</link>
		<comments>http://www.cuppadev.co.uk/hacks/converting-rubycocoa-projects-to-macruby/#comments</comments>
		<pubDate>Sun, 05 Oct 2008 13:59:29 +0000</pubDate>
		<dc:creator>James Urquhart</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[macruby]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[rubycocoa]]></category>
		<category><![CDATA[software development]]></category>

		<guid isPermaLink="false">http://www.cuppadev.co.uk/?p=298</guid>
		<description><![CDATA[After trying out MacRuby, the port of which directly runs on Objective C, i decided to try and convert some of my existing RubyCocoa projects over in order to take advantage of the speed boost and the simplified interface. While the process was relatively straightforward, i have decided to reproduce it here so anyone else [...]]]></description>
			<content:encoded><![CDATA[<p>After trying out <a href="http://www.macruby.org">MacRuby</a>, the port of which <a href="http://www.macruby.org/trac/wiki/WhyMacRuby">directly runs on Objective C</a>, i decided to try and convert some of my existing <a href="http://rubycocoa.sourceforge.net/">RubyCocoa</a> projects over in order to take advantage of the speed boost and the simplified interface.</p>
<p>While the process was relatively straightforward, i have decided to reproduce it here so anyone else in my predicament can get their applications up and running in RubyCocoa with the minimum of fuss.</p>
<h3>Preamble</h3>
<p style="text-align:left"><img class="alignnone size-thumbnail wp-image-306" title="rco-sdk" src="http://www.cuppadev.co.uk/wp-content/uploads/2008/10/rco-sdk-300x113.png" alt="" width="300" height="113" /></p>
<p>Firstly, open up the Project Info box by double clicking on your project in the tree.</p>
<p style="text-align:left"><img class="alignnone size-thumbnail wp-image-310" title="rco-sdk1" src="http://www.cuppadev.co.uk/wp-content/uploads/2008/10/rco-sdk1-300x158.png" alt="" width="300" height="158" /></p>
<p>Your project needs to use the 10.5 sdk, since that is the only version which MacRuby supports. If you are planning on targeting 10.4, then MacRuby is not for you.</p>
<p>In addition you need to make sure you enable the Garbage Collection for Objective C, otherwise the MacRuby framework won&#8217;t link. In case you have forgotten where this option is, go to the build tab, select &#8220;<strong>All Configurations</strong>&#8221; for the configuration, then look for &#8220;<strong>Objective-C Garbage Collection</strong>&#8220;.</p>
<p style="text-align:left"><img class="alignnone size-thumbnail wp-image-306" title="rco-sdk" src="http://www.cuppadev.co.uk/wp-content/uploads/2008/10/rco-sdk-300x113.png" alt="" width="300" height="113" /></p>
<p>I selected &#8220;<strong>Supported</strong>&#8220;, though you can use &#8220;<strong>Required</strong>&#8221; as well.</p>
<h3>Spot the difference</h3>
<p>While a MacRuby project is similar to a RubyCocoa one, there are a few differences. Obviously, they use different frameworks, the initialization in ruby is slightly different, and of course there are a few big differences in the interface.</p>
<h4>1) main.m</h4>
<p><strong>RubyCocoa</strong></p>
<pre><code>#import &lt;Cocoa/Cocoa.h&gt;
#import &lt;RubyCocoa/RBRuntime.h&gt;

int main(int argc, const char *argv[])
{
    return RBApplicationMain("rb_main.rb", argc, argv);
}
</code></pre>
<p><strong>MacRuby</strong></p>
<pre><code>#import &lt;MacRuby/MacRuby.h&gt;

int main(int argc, char *argv[])
{
    return macruby_main("rb_main.rb", argc, argv);
}
</code></pre>
<h4>2) rb_main.rb</h4>
<p><strong>RubyCocoa</strong></p>
<pre><code>require 'osx/cocoa'

def rb_main_init
  path = OSX::NSBundle.mainBundle.resourcePath.fileSystemRepresentation
  rbfiles = Dir.entries(path).select {|x| /\.rb\z/ =~ x}
  rbfiles -= [ File.basename(__FILE__) ]
  rbfiles.each do |path|
    require( File.basename(path) )
  end
end

if $0 == __FILE__ then
  rb_main_init
  OSX.NSApplicationMain(0, nil)
end
</code></pre>
<p><strong>MacRuby</strong></p>
<pre><code>framework 'Cocoa'

# Loading all the Ruby project files.
dir_path = NSBundle.mainBundle.resourcePath.fileSystemRepresentation
Dir.entries(dir_path).each do |path|
  if path != File.basename(__FILE__) and path[-3..-1] == '.rb'
    require(path)
  end
end

# Starting the Cocoa main loop.
NSApplicationMain(0, nil)
</code></pre>
<h4>3) Framework link</h4>
<p><strong>RubyCocoa</strong></p>
<p style="text-align:left"><img class="alignnone size-thumbnail wp-image-302" title="rco-framework" src="http://www.cuppadev.co.uk/wp-content/uploads/2008/10/rco-framework.png" alt="" width="229" height="140" /></p>
<p>Located in /System/Library/Frameworks/RubyCocoa.framework</p>
<p><strong>MacRuby</strong></p>
<p style="text-align:left"><img class="alignnone size-thumbnail wp-image-303" title="mrb-framework" src="http://www.cuppadev.co.uk/wp-content/uploads/2008/10/mrb-framework.png" alt="" width="229" height="140" /></p>
<p>Located in /Library/Frameworks/MacRuby.framework</p>
<h4>4) Generally speaking</h4>
<p>Ignore the <strong>OSX</strong> module, use <strong>framework</strong> instead of <strong>require</strong> for frameworks, and don&#8217;t use <strong>ib_outlet</strong> or <strong>ib_action</strong>.</p>
<p><strong>RubyCocoa</strong></p>
<pre><code>require 'osx/cocoa'

class MyClass &lt; OSX::NSObject
  ib_outlet :myOutlet
  ib_action :myAction do |sender|
  end
end
</code></pre>
<p><strong>MacRuby</strong></p>
<pre><code>framework 'Cocoa'

class MyClass &lt; NSObject
  attr_writer :myOutlet
  def myAction(sender)
  end
end
</code></pre>
<p>In addition, since MacRuby is based on Ruby 1.9 (as opposed to 1.8.x) it would be a good idea to <a href="http://eigenclass.org/hiki/Changes+in+Ruby+1.9">check for incompatibilities</a> in your code which arise from changes in Ruby 1.9.</p>
<h3>Celebrate</h3>
<p>With any luck, provided you have followed the above and managed to convert all of your RubyCocoa code over, your app should now run with MacRuby!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cuppadev.co.uk/hacks/converting-rubycocoa-projects-to-macruby/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Another way of using iPhone Web Apps Offline</title>
		<link>http://www.cuppadev.co.uk/hacks/another-way-of-using-iphone-web-apps-offline/</link>
		<comments>http://www.cuppadev.co.uk/hacks/another-way-of-using-iphone-web-apps-offline/#comments</comments>
		<pubDate>Sat, 09 Aug 2008 13:52:59 +0000</pubDate>
		<dc:creator>James Urquhart</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[webkit]]></category>

		<guid isPermaLink="false">http://www.cuppadev.co.uk/?p=229</guid>
		<description><![CDATA[I mentioned a while ago that it was possible to make off-line web apps using a combination of the data:/ uri support and the database storage on the iPhone 2.0 firmware. While this solution works, it sure is a bit of a hack. Fortunately there is another way to use web apps offline on the [...]]]></description>
			<content:encoded><![CDATA[<p>I <a href="http://www.cuppadev.co.uk/oldbrew/iphone-magic/">mentioned a while ago</a> that it was possible to make off-line web apps using a combination of the data:/ uri support and the database storage on the iPhone 2.0 firmware. While this solution works, it sure is a bit of a hack.</p>
<p>Fortunately there is another way to use web apps offline on the iPhone. It turned out to be so simple i wondered why i didn&#8217;t think of it before. Well, here is how you do it:</p>
<p style="text-align:center;"><iframe src="http://docs.google.com/present/embed?id=dg44j92p_739svz9tz" frameborder="0" width="410" height="342"></iframe></p>
<p><strong>EDIT</strong>: also downloadable as <a href='http://www.cuppadev.co.uk/wp-content/uploads/2008/08/Using_iPhone_Web_Apps_Offline.pdf'>Using_iPhone_Web_Apps_Offline</a></p>
<p>Hey presto! While you do get a warning, you can still use your lovely web app offline. Unless of course, you restart your iPhone or close the window. If that happens, your data will still be safe if your web app uses the database api to store it. Just hope you get your signal back so you can start working again. :)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cuppadev.co.uk/hacks/another-way-of-using-iphone-web-apps-offline/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>SCUMM in JavaScript</title>
		<link>http://www.cuppadev.co.uk/hacks/scumm-in-javascript/</link>
		<comments>http://www.cuppadev.co.uk/hacks/scumm-in-javascript/#comments</comments>
		<pubDate>Wed, 28 May 2008 21:19:44 +0000</pubDate>
		<dc:creator>James Urquhart</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[openquest]]></category>
		<category><![CDATA[SCUMM]]></category>
		<category><![CDATA[scummc]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://crm.cuppadev.co.uk/?p=145</guid>
		<description><![CDATA[Soon after bumping into haXe and Doomed Online, they got me thinking. &#8220;Would it be possible to run SCUMM games in flash?&#8221;. The answer to that of course is yes, as was demonstrated by my SCUMM Interpreter written in haXe. Though as with anything, you really need to spend the time to implement everything, and [...]]]></description>
			<content:encoded><![CDATA[<p>Soon after bumping into <a href="http://www.haxe.org">haXe</a> and <a href="http://code.google.com/p/doomedonline/">Doomed Online</a>, they got me thinking. &#8220;Would it be possible to run <span class="caps">SCUMM</span> games in flash?&#8221;. The answer to that of course is yes, as was demonstrated by my <a href="http://www.cuppadev.co.uk/2007/11/22/flash-plays-scumm-take-two/"><span class="caps">SCUMM</span> Interpreter written in haXe</a>. Though as with anything, you really need to spend the <strong>time</strong> to implement everything, and justify it somewhat.</p>
<p>(Not to mention that Flash 10 is supposedly going to be able to compile C code, thus making my complete port more or less redundant)</p>
<p>Now i would have stopped there, if i hadn&#8217;t noticed that haXe targets multiple platforms, including every web developer&#8217;s best friend, JavaScript. Thus i thought, &#8220;<strong>Would it be possible to run <span class="caps">SCUMM</span> games in Javascript?</strong>&#8221;. For the answer&#8230; well, take a look!</p>
<p style="text-align:left;"><a href="http://www.cuppadev.co.uk/assets/hiscumm_js.png"><img src="http://www.cuppadev.co.uk/assets/hiscumm_js_th.png" title="OpenQuest in a browser" alt="OpenQuest in a browser" /></a></p>
<p>Yes, that is an image of <a href="http://alban.dotsec.net/13.html">OpenQuest</a> running in a web browser, specifically Firefox. It can run in other browsers too, though to date i have only tested Firefox and Safari, the latter of which mysteriously crashes.</p>
<p>And if you want, you can <a href="http://stuff.cuppadev.co.uk/hiscumm/js_test.html">try it yourself by clicking here</a>. A <strong>word of warning though</strong>, it is highly recommended that you use <a href="http://www.mozilla.com/firefox/">Firefox</a> to run it. Otherwise you might get a nasty crash, or a big disappointment.</p>
<p>As previously, just about enough is implemented to get the first room of OpenQuest loaded. Actors, verbs, objects, and sounds are not implemented, though it would certainly be possible. However the engine runs <strong>much slower than in Flash</strong>, so i doubt anything that could be considered to be &#8220;playable&#8221; could be implemented with it.</p>
<p>Still, i feel I&#8217;ve now accomplished what i set out to do when writing this interpreter &#8211; that is to push haXe, Flash, and JavaScript to the limit and see what i can get out of them. And of course, learn a bit more about <span class="caps">SCUMM</span> too.</p>
<p>Again, i would like to congratulate the ScummVM team for their <span class="caps">SCUMM</span> interpreter and Alban Bedel for his scummc compiler. Without their efforts, i wouldn&#8217;t have had any code or references from which to base my haXe-based <span class="caps">SCUMM</span> interpreter.</p>
<p><strong>Edit</strong>: Source code available from <a href="http://github.com/jamesu/hiscumm/tree/master">github</a>.</p>
<p><strong>Edit</strong>: No longer crashes in Safari provided you are using Safari 3.1.2 or later.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cuppadev.co.uk/hacks/scumm-in-javascript/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Flash Plays SCUMM, Take Two</title>
		<link>http://www.cuppadev.co.uk/hacks/flash-plays-scumm-take-two/</link>
		<comments>http://www.cuppadev.co.uk/hacks/flash-plays-scumm-take-two/#comments</comments>
		<pubDate>Fri, 23 Nov 2007 01:00:00 +0000</pubDate>
		<dc:creator>James Urquhart</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[haxe]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[SCUMM]]></category>

		<guid isPermaLink="false">http://crm.cuppadev.co.uk/?p=132</guid>
		<description><![CDATA[Last month after bumping into haXe and Doomed Online, i somehow got the strange idea that i could get flash to play SCUMM games, like ScummVM. While i did get it working as a proof of concept, there was a really off-putting bug in the image decode routines which meant that any displayed room graphics [...]]]></description>
			<content:encoded><![CDATA[<p>Last month after bumping into <a href="http://www.haxe.org">haXe</a> and <a href="http://blog.brokenfunction.com/2007/07/20/flash-plays-doom/">Doomed Online</a>, i somehow got the strange idea that i could <a href="http://cuppadev.co.uk/2007/10/06/flash-plays-scumm-sort-of/">get flash to play <span class="caps">SCUMM</span> games</a>, like ScummVM.</p>
<p>While i did get it working as a proof of concept, there was a really off-putting bug in the image decode routines which meant that any displayed room graphics were a jumbled mess.</p>
<p>Recently though i decided to do a bit of intensive debugging to try and solve the problem. To sum it up, after:</p>
<ul>
<li><a href="http://www.digitalflipbook.com/archives/2005/07/trace_from_the.php">Turning on the trace output</a> in the Flash debug player</li>
<li>Telling scvm and hiscumm to dump crucial info their trace logs</li>
<li>Comparing the output of scvm and hiscumm using diff to see where the differences were</li>
<li>Modifying the trace output to pinpoint the problem while <a href="http://www.antunkarlovac.com/blog/?p=56">dealing with script timeout errors</a>.</li>
</ul>
<p>I managed to fix the decode routines. Now instead of a jumbled mess like this:</p>
<p style="text-align:center;"><img src="http://cuppadev.co.uk/assets/2007/10/6/hiscumm-ex.png" title="Before, courtesy of Albans Road example" alt="Before, courtesy of Albans Road example" /></p>
<p>You get something more like this:</p>
<p style="text-align:center;"><img src="http://cuppadev.co.uk/assets/2007/11/20/hiscumm-rmin-fix.png" title="After, courtesy of OpenQuest" alt="After, courtesy of OpenQuest" /></p>
<p>Which safe to say is much nicer to look at. It&#8217;s also as far as i am willing to go with this <span class="caps">SCUMM</span> implementation.</p>
<p>With a lot of work put into it, i&#8217;m sure it could run <a href="http://en.wikipedia.org/wiki/Day_of_the_Tentacle">Day of the Tentacle</a> or <a href="http://en.wikipedia.org/wiki/Sam_%26_Max_Hit_the_Road">Sam N Max Hit the Road</a>. But there would not be much sense in doing that, except for that 5 seconds of awe after seeing it running in a web browser.</p>
<p>As previously, you can download the hiscumm code for reference <a href="http://cuppadev.co.uk/assets/2007/11/22/hiscumm.tar.gz">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cuppadev.co.uk/hacks/flash-plays-scumm-take-two/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash Plays SCUMM (sort of)</title>
		<link>http://www.cuppadev.co.uk/hacks/flash-plays-scumm-sort-of/</link>
		<comments>http://www.cuppadev.co.uk/hacks/flash-plays-scumm-sort-of/#comments</comments>
		<pubDate>Sun, 07 Oct 2007 01:44:00 +0000</pubDate>
		<dc:creator>James Urquhart</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[haxe]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[SCUMM]]></category>

		<guid isPermaLink="false">http://crm.cuppadev.co.uk/?p=120</guid>
		<description><![CDATA[Soon after bumping into haXe and Doomed Online, i somehow got the strange idea that i could get flash to play SCUMM games, like ScummVM. Safe to say, i ended up with this rather odd Flash-based app written in haXe which when provided with the &#8221;.000&#8221; and &#8221;.001&#8221; files of any unencrypted V6 SCUMM game [...]]]></description>
			<content:encoded><![CDATA[<p>Soon after bumping into <a href="http://cuppadev.co.uk/2007/10/4/haxe-web-oriented-universal-language">haXe</a> and <a href="http://blog.brokenfunction.com/2007/07/20/flash-plays-doom/">Doomed Online</a>, i somehow got the strange idea that i could get flash to play <span class="caps">SCUMM</span> games, like <a href="http://www.scummvm.org/">ScummVM</a>.</p>
<p>Safe to say, i ended up with this rather odd Flash-based app written in haXe which when provided with the &#8221;.000&#8221; and &#8221;.001&#8221; files of any unencrypted <span class="caps">V6 SCUMM</span> game will be able to load and play it. Or rather, attempt to.</p>
<p style="text-align:center;"><img src="http://cuppadev.co.uk/assets/2007/10/6/hiscumm-ex.png" title="Obligatory example image" alt="Obligatory example image" /></p>
<p>Sadly i bumped into a problem in the image decode routines, so what is displayed isn&#8217;t pretty. But it is quite capable of executing enough opcode&#8217;s to get to the input event loop in Alban Bedel&#8217;s road example for his scummc compiler, which is great.</p>
<p>As for other games, i would doubt that they would get very far. A lot still needs to be implemented in the runtime.</p>
<p>In any case, if you dare you can try out my Flash-based <span class="caps">SCUMM</span> interpreter by downloading and extracting <a href="http://cuppadev.co.uk/assets/2007/10/6/hiscumm-bin.tar.gz">this</a> archive. Simply load &#8220;test.html&#8221; into your web browser. Note though that you will need Flash 9 in order to run the interpreter.</p>
<p>In addition i also decided to open up the code for everyone to look at. It&#8217;s a mess, but it works. You can grab it from <a href="http://cuppadev.co.uk/assets/2007/10/5/hiscumm.tar.gz">here</a>.</p>
<p>Finally i would like to congratulate the ScummVM team for their <span class="caps">SCUMM</span> interpreter and Alban Bedel for his scummc compiler. Without their efforts, i wouldn&#8217;t have had any code or references from which to base my haXe-based <span class="caps">SCUMM</span> interpreter.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cuppadev.co.uk/hacks/flash-plays-scumm-sort-of/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Doomed Online</title>
		<link>http://www.cuppadev.co.uk/hacks/doomed-online/</link>
		<comments>http://www.cuppadev.co.uk/hacks/doomed-online/#comments</comments>
		<pubDate>Tue, 18 Sep 2007 16:23:00 +0000</pubDate>
		<dc:creator>James Urquhart</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[doomed online]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[fun]]></category>

		<guid isPermaLink="false">http://crm.cuppadev.co.uk/?p=118</guid>
		<description><![CDATA[Just as i thought i had found some of the most freakiest flash apps, i found this rather playable re-implementation of doom called Doomed Online. What is amazing about it is that it uses the original data files &#8211; something which i never considered would have been possible with flash. But then again i&#8217;ve not [...]]]></description>
			<content:encoded><![CDATA[<p>Just as i thought i had found some of the most <a href="http://cuppadev.co.uk/2007/9/15/freaky-flash">freakiest flash apps</a>, i found this rather playable re-implementation of doom called <a href="http://code.google.com/p/doomedonline/">Doomed Online</a>.</p>
<p style="text-align:center;"><img src="http://cuppadev.co.uk/assets/2007/9/18/doom-screenshot.png" title="Obligatory Screenshot" alt="Obligatory Screenshot" /></p>
<p>What is amazing about it is that it uses the <strong>original data files</strong> &#8211; something which i never considered would have been possible with flash. But then again i&#8217;ve not quite been keeping up with all of the technical advances in flash over the years, so it is really no surprise.</p>
<p>The demo is available <a href="http://doomedonline.googlecode.com/files/doom.swf">here</a>. For those of you who might have checked out the <a href="http://toastytech.com/dooma/index.html">pre-release versions of Doom</a>, the demo plays very much like them &#8211; as in you can&#8217;t shoot anything and there is no AI. Hopefully in the future these issues will be resolved and it&#8217;ll be that much more interesting to play.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cuppadev.co.uk/hacks/doomed-online/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
