{"id":7853,"date":"2012-09-08T10:26:34","date_gmt":"2012-09-08T14:26:34","guid":{"rendered":"http:\/\/scruss.com\/blog\/?p=7853"},"modified":"2018-07-05T19:55:05","modified_gmt":"2018-07-05T23:55:05","slug":"2d-star-dodge-flies-again","status":"publish","type":"post","link":"https:\/\/scruss.com\/blog\/2012\/09\/08\/2d-star-dodge-flies-again\/","title":{"rendered":"2D Star Dodge flies again!"},"content":{"rendered":"<p>There&#8217;s rather more nostalgia in this post than I&#8217;d want to deal with. If you want to just play the game, go <a href=\"http:\/\/scruss.com\/CPCInAJar\/stardoj_bcpl.html\">here<\/a> <del><a href=\"#game\">here<\/a><\/del> and skip this blurb.<\/p>\n<p><strong>Update<\/strong>: the Java emulator doesn&#8217;t work in the browser any more, so here&#8217;s Arnold playing the BASIC version: <a href=\"http:\/\/scruss.com\/cpc\/6128s.html?stardoj.dsk\/run%22stardoj2\">http:\/\/scruss.com\/cpc\/6128s.html?stardoj.dsk\/run%22stardoj2<\/a><\/p>\n<p>About 25 years ago, I was a smallish computer nerd obsessed with programming his <a href=\"http:\/\/cpcwiki.eu\/index.php\/CPC_old_generation\">Amstrad CPC464<\/a>. I had got a <a href=\"https:\/\/www.cl.cam.ac.uk\/~mr10\/BCPL.html\">BCPL<\/a> rom-based compiler for cheap and was looking for things to do with it. &#8220;Why not write a game?&#8221; I asked myself.<\/p>\n<p>There were two minor hurdles. I had no imagination, and I certainly wasn&#8217;t focused enough to write anything big. Fortunately, it was still the 80s, so we knew how to rip stuff off without being called out for it. I merrily copied a game my friend Alan Cook had written for the <a href=\"http:\/\/www.dragon32.com\/\">Dragon 32<\/a>, and called it <em>2D Star Dodge<\/em>.<\/p>\n<p>2D Star Dodge was the perfect rip off. Not merely had I ripped off the idea from Alan, but he had ripped off the idea in turn from a <a href=\"http:\/\/www.bbcbasic.co.uk\/bbcbasic.html\">BBC Basic<\/a> one-liner game called <del>(as verified by <a href=\"http:\/\/pure-gns.blogspot.ca\/\">Graeme Smith<\/a>) &#8220;One Line&#8221;<\/del> <a href=\"http:\/\/scruss.com\/blog\/2018\/07\/05\/space-acid-poisoning\/\">Asterisk Tracker<\/a>. The name <em>2D Star Dodge<\/em> was an, um, <em>homage<\/em> to Realtime Games&#8217; <a href=\"http:\/\/cpcwiki.eu\/index.php\/3D_Starstrike\">3D Starstrike<\/a>, which itself was &#8220;strongly influenced&#8221; by the Star Wars arcade game. Originality? Pfft.<\/p>\n<p>So I wrote the game. Well, okay, I wrote a mockup in <a href=\"http:\/\/cpcwiki.eu\/index.php\/Locomotive_BASIC\">Locomotive BASIC<\/a>, which ran a bit slowly, but gave me something to work from. Here it is, if you want to play it in you (Java-enabled) browser: <a href=\"http:\/\/scruss.com\/CPCInAJar\/stardoj_basic.html\">2D Star Dodge &#8211; BASIC<\/a>. I then meticulously translated it into BCPL, and ended up with something that looked liked this:<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/scruss.com\/CPCInAJar\/stardoj_bcpl.html\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5124\" title=\"2D Star Dodge\" src=\"http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2010\/02\/untitled.png\" alt=\"\" width=\"384\" height=\"272\" srcset=\"https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2010\/02\/untitled.png 384w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2010\/02\/untitled-160x113.png 160w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2010\/02\/untitled-320x226.png 320w\" sizes=\"auto, (max-width: 384px) 100vw, 384px\" \/><\/a><em>(if you click on that image, you can play the BCPL version in your browser.)<\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7857\" title=\"level 1\" src=\"http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2012\/09\/disk1a.png\" alt=\"\" width=\"384\" height=\"272\" srcset=\"https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2012\/09\/disk1a.png 384w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2012\/09\/disk1a-160x113.png 160w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2012\/09\/disk1a-320x226.png 320w\" sizes=\"auto, (max-width: 384px) 100vw, 384px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7856\" title=\"next screen\" src=\"http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2012\/09\/disk1d.png\" alt=\"\" width=\"384\" height=\"272\" srcset=\"https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2012\/09\/disk1d.png 384w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2012\/09\/disk1d-160x113.png 160w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2012\/09\/disk1d-320x226.png 320w\" sizes=\"auto, (max-width: 384px) 100vw, 384px\" \/><\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7855\" title=\"game in play, screen 3\" src=\"http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2012\/09\/disk1e.png\" alt=\"this is actuall screen three, hope no-one notices ...\" width=\"384\" height=\"272\" srcset=\"https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2012\/09\/disk1e.png 384w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2012\/09\/disk1e-160x113.png 160w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2012\/09\/disk1e-320x226.png 320w\" sizes=\"auto, (max-width: 384px) 100vw, 384px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7854\" title=\"game over\" src=\"http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2012\/09\/disk1f.png\" alt=\"\" width=\"384\" height=\"272\" srcset=\"https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2012\/09\/disk1f.png 384w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2012\/09\/disk1f-160x113.png 160w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2012\/09\/disk1f-320x226.png 320w\" sizes=\"auto, (max-width: 384px) 100vw, 384px\" \/><\/p>\n<p style=\"text-align: center;\"><em>\u00c2\u00a0<\/em><\/p>\n<p>The gameplay \u00e2\u20ac\u201d press a key to go up, stop pressing a key to go down \u00e2\u20ac\u201d is a bit like <a href=\"http:\/\/itunes.apple.com\/ca\/app\/sfcave\/id445590887?mt=12\">SFCave<\/a> (obligatory Java version: <a href=\"http:\/\/www.lab6.com\/sfcave\/index.html\">Lab6 SFCave<\/a>) or even my current favourite <a href=\"http:\/\/itunes.apple.com\/ca\/app\/tiny-wings\/id417817520?mt=8\">Tiny Wings<\/a>.<\/p>\n<p>Once I&#8217;d finished the BCPL version, I had bought the <a href=\"http:\/\/www.cpcwiki.eu\/index.php\/MAXAM\">MAXAM<\/a> assembler ROM, and got learning the Z80 opcodes. Soon, a third port was complete, now needing hardcoded delays to be playable as it would kill you off in about one screen refresh without them.<\/p>\n<p>So, now I had three versions of the same game. There was only a limited number of local folks I could give it to, so I decided to send all three versions to Amstrad Computer User magazine to print as a type-in. Thankfully, it arrived on the desk of the freshly minted (yet still beardy) assistant editor Jeff Walker, who had founded the <em>jam econo<\/em> CPC magazine\/club <a href=\"http:\/\/cpcwiki.eu\/index.php\/WACCI\">WACCI<\/a>. Jeff had the idea for me to turn the simple game into a comparison of programming in three languages.<\/p>\n<p>Thanks to the <a href=\"http:\/\/www.cpcwiki.eu\/forum\/index.php?action=dldir;sa=list;id=7\">CPCWiki forum<\/a>, you can now read the articles I wrote in Amstrad Computer User in 1988 that went with the code. Writing style best described as &#8220;typing&#8221;:<\/p>\n<ul>\n<li><a href=\"http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2012\/09\/AmstradComputerUser198809-StarDodger1-BASIC.pdf\">Amstrad Computer User 1988\/09 &#8211; Star Dodger 1 &#8211; BASIC<\/a><\/li>\n<li><a href=\"http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2012\/09\/AmstradComputerUser198810-StarDodger2-BCPL.pdf\">Amstrad Computer User 1988\/10 &#8211; Star Dodger 2 &#8211; BCPL<\/a><\/li>\n<li><a href=\"http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2012\/09\/AmstradComputerUser198811-StarDodger3-Assembly.pdf\">Amstrad Computer User 1988\/11 &#8211; Star Dodger 3 &#8211; Assembler<\/a><\/li>\n<\/ul>\n<p><a name=\"game\"><\/a>To play the game in an astonishing JavaScript emulator:<\/p>\n<ol>\n<li>Download this disc image file: <a href=\"http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2012\/09\/stardoj.zip\">stardoj<\/a><\/li>\n<li>Unzip it<\/li>\n<li>Go to <a href=\"http:\/\/cpcbox.com\/\">CPCBox<\/a><\/li>\n<li>&#8220;Choose configuration &#8230;&#8221; of <em>Boot CPC464<\/em> (or 664, or 6128)<\/li>\n<li>Select your downloaded stardoj.dsk as Drive A:<\/li>\n<li>Annoyingly, it seems to be stuck with an AZERTY keymap, so to catalogue the disc (<code>cat<\/code>) you have to type <code>cqt<\/code><\/li>\n<li>To run the BASIC version, type <code>run\"stardoj2<\/code> (on my American keyboard, that becomes <code>run@stqrdoj2<\/code>; quotes are Shift+2). Hitting Escape twice will quit back to the prompt.<\/li>\n<li>To run the BCPL version, type <code>run\"2dstardo<\/code>. The only way to quit is to reset the emulator.<\/li>\n<\/ol>\n<p>The BASIC version is based on the published type-in. The BCPL version I found as a disk image (<a href=\"http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2012\/09\/2dstardo.zip\">2dstardo.dsk<\/a>) on a download site \u00e2\u20ac\u201d it&#8217;s exactly as I submitted it to the magazine, dubious copyright message and all. I&#8217;m not sure how it got out there; I suspect either my network of, ahem, <em>software protection experts<\/em> I knew through Colin Harris of Nemesis, or it went via my CPC-owning French penpal (Hi Benoit H\u00c3\u00a9bert, formerly of Le Havre).<\/p>\n<p>I had to modify the BCPL binary to run on modern emulators, as the real Amstrad CPC did <a title=\"Amstrad CPC INKEY codes\" href=\"http:\/\/scruss.com\/blog\/2012\/09\/06\/amstrad-cpc-inkey-codes\/\">a thing with its keymapping<\/a> that is really hard to get right on modern systems. Originally, the game used the Shift key, but I modified it to use Space, which is easier to emulate as it&#8217;s a printing character. Can I just say that I remembered how to read and modify Z80 binaries after a quarter century? Old school, literally. I used <a href=\"http:\/\/koaks.amstrad.free.fr\/amstrad\/projets\/\">iDsk<\/a>&#8216;s disassembler\/hex dumper and emacs&#8217;s <a href=\"http:\/\/emacswiki.org\/emacs\/HexlMode\">hexl<\/a> mode to do the deed.<\/p>\n<p>I recently discovered that someone created a Flash game based on my type-in: <a href=\"http:\/\/www.kongregate.com\/games\/kevglass\/star-dodger\">Star Dodger<\/a>. Mind = Blown.<\/p>\n<p><strong>Update, 2018<\/strong>: <em>Lawks<\/em>! Someone wrote a <a href=\"https:\/\/github.com\/paf31\/star-dodge-clone\">PureScript version<\/a>! It doesn&#8217;t exactly work for me on Firefox, but it does on Chromium.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There&#8217;s rather more nostalgia in this post than I&#8217;d want to deal with. If you want to just play the game, go here here and skip this blurb. Update: the Java emulator doesn&#8217;t work in the browser any more, so here&#8217;s Arnold playing the BASIC version: http:\/\/scruss.com\/cpc\/6128s.html?stardoj.dsk\/run%22stardoj2 About 25 years ago, I was a smallish [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[7],"tags":[3142,641,2062,2063,2061,2055,1812,2557],"class_list":["post-7853","post","type-post","status-publish","format-standard","hentry","category-computers-suck","tag-2dstardodge","tag-amstrad","tag-basic","tag-bcpl","tag-cpc","tag-emulation","tag-game","tag-z80"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pQNZZ-22F","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/7853","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/comments?post=7853"}],"version-history":[{"count":19,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/7853\/revisions"}],"predecessor-version":[{"id":15041,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/7853\/revisions\/15041"}],"wp:attachment":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/media?parent=7853"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/categories?post=7853"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/tags?post=7853"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}