<?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>Lukasz.dk &#187; PlayStation 2</title>
	<atom:link href="http://lukasz.dk/category/playstation-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://lukasz.dk</link>
	<description>Personal homepage of Lukasz Bruun</description>
	<lastBuildDate>Fri, 08 Jan 2010 23:17:28 +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>Datel Memory Plus 64 MB</title>
		<link>http://lukasz.dk/2008/04/22/datel-memory-plus-64-mb/</link>
		<comments>http://lukasz.dk/2008/04/22/datel-memory-plus-64-mb/#comments</comments>
		<pubDate>Tue, 22 Apr 2008 06:10:49 +0000</pubDate>
		<dc:creator>Lukasz Bruun</dc:creator>
				<category><![CDATA[PlayStation 2]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://lukasz.dk/?p=83</guid>
		<description><![CDATA[Recently I stumbled upon some interesting information regarding Datel's new PS2 memory card Memory Plus 64 MB at PS2 Save Tools. What caught my eye were the instructions for this memory card, as they state that you can load an PS2 ELF of the memory card or a USB Pendrive, without the need to load [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I stumbled upon some interesting information regarding Datel's new PS2 memory card <em>Memory Plus 64 MB</em> at <a href="http://www.ps2savetools.com/article.php?sid=200&amp;mode=thread&amp;order=0&amp;thold=0">PS2 Save Tools</a>. What caught my eye were the instructions for this memory card, as they state that you can load an PS2 ELF of the memory card or a USB Pendrive, without the need to load CD/DVD software.</p>
<p><a href="http://lukasz.dk/files/mpluss.jpg"><img class="alignnone size-thumbnail wp-image-87" title="mpluss" src="http://lukasz.dk/files/mpluss-150x150.jpg" alt="" width="150" height="150" /></a><a href="http://lukasz.dk/files/mplusinstructions.jpg"><img class="alignnone size-thumbnail wp-image-86" title="mplusinstructions" src="http://lukasz.dk/files/mplusinstructions-150x150.jpg" alt="" width="150" height="150" /></a></p>
<p>Since this memory card could be used for launching PS2Link directly of the memory card itself or an USB Pendrive and thereby enabling PS2 programming on an unmodified PS2 console, I went ahead and bought one from the <a href="http://www.codejunkies.com/">Codejunkies</a> webshop (also available from <a href="http://www.play-asia.com/paOS-13-71-p-49-en-15-memory+plus-70-2on8.html">Play-Asia</a>).</p>
<p>I was unfortunate to get a memory card where built-in software was not installed, but after sending an email to Codejunkies, I returned the card to them and some days later I got it back and this time the built-in software did boot when the memory card was inserted to either PS2 memory card slot.</p>
<p>The built-in memory card manager takes about 25 seconds load, for the entire period there is a black screen. Below are some screenshots of the memory manager and how it shows up the PS2 memory card browser.</p>
<p><a href="http://lukasz.dk/files/mplus1.jpg"><img class="alignnone size-thumbnail wp-image-88" title="mplus1" src="http://lukasz.dk/files/mplus1-150x150.jpg" alt="" width="150" height="150" /></a><a href="http://lukasz.dk/files/mplus2.jpg"><img class="alignnone size-thumbnail wp-image-89" title="mplus2" src="http://lukasz.dk/files/mplus2-150x150.jpg" alt="" width="150" height="150" /></a><a href="http://lukasz.dk/files/mplus-browser.jpg"><img class="alignnone size-thumbnail wp-image-91" title="mplus-browser" src="http://lukasz.dk/files/mplus-browser-150x150.jpg" alt="" width="150" height="150" /></a></p>
<p>I was hoping I could just insert an USB pendrive to one of the PS2 USB ports, with PS2Link named RUNME1.ELF and it would boot, <span style="text-decoration: line-through;">however none of my 4 USB pendrives were recognized by the built in memory manager. I tried FAT 12/16/32 file systems, also FAT32 W95 LBA, but none of them seemed to work. One of the pendrives I tried was the 16 MB Pendrive from Datel's own Max Drive product, which is recognized in the Max Drive memory manager, which looks very similar.</span></p>
<p style="text-align: center;"><a href="http://lukasz.dk/files/max-memory.jpg"><img class="alignnone size-thumbnail wp-image-93" title="max-memory" src="http://lukasz.dk/files/max-memory-150x150.jpg" alt="" width="150" height="150" /></a></p>
<p>Since the memory manager wasn't helping me get PS2Link launched, I had to figure out some other way of getting it onto the memory card and so the "hacking" begins :-)</p>
<p>For transfering data to the memory card of my chipped PS2 I used ps2netfs.irx from PS2SDK. This IRX provides an interface to file systems on the PS2 over the network. I used <em>fsclient</em> as the client (part of <em>ps2client</em> package), combined with PS2Link/ps2client. Before you can access the memory cards with ps2netfs, you need to load the memory card IOP modules SIO2MAN and MCMAN from the BIOS. The following 3 commands below load ps2netfs with memory card support.</p>
<blockquote><p>ps2client -t 1 execiop rom0:SIO2MAN<br />
ps2client -t 1 execiop rom0:MCMAN<br />
ps2client -t 1 execiop host:ps2netfs.irx</p></blockquote>
<p>Once this was done, I could now browse the Memory Plus memory card.</p>
<blockquote>
<pre>fsclient dir mc0:</pre>
<pre>[Contents of mc0:]</pre>
<pre>drwxrwxrwx          6 04-08-2008 17:01:30 .
drw-rw-rw-          0 04-08-2008 16:53:54 ..
-r-xr-xr-x         14 04-08-2008 16:53:57 BEEXEC-SYSTEM
-r-xr-xr-x         14 04-08-2008 16:55:26 BAEXEC-SYSTEM
drwxrwxrwx          6 04-22-2008 02:29:47 BESLES-00000 MP</pre>
</blockquote>
<p>The BEEXEC-SYSTEM and BAEXEC-SYSTEM directories contain the same files, to support respectively European (E) and American (A) PS2 models.</p>
<blockquote>
<pre>fsclient dir "mc0:BEEXEC-SYSTEM"</pre>
<pre>[Contents of mc0:BEEXEC-SYSTEM]</pre>
<pre>drwxrwxrwx          0 04-08-2008 16:53:57 .
drwxrwxrwx          0 04-08-2008 16:53:57 ..
-rwxrwxrwx    1344000 04-08-2008 16:54:00 osd110.elf
-rwxrwxrwx    1344000 04-08-2008 16:54:06 osd120.elf
-rwxrwxrwx    1344000 04-08-2008 16:54:11 osd130.elf
-rwxrwxrwx    1344000 04-08-2008 16:54:17 osd140.elf
-rwxrwxrwx    1344000 04-08-2008 16:54:23 osd150.elf
-rwxrwxrwx    1344000 04-08-2008 16:54:29 osd160.elf
-rwxrwxrwx    1344000 04-08-2008 16:54:35 osd170.elf
-rwxrwxrwx    1344000 04-08-2008 16:54:41 osd180.elf
-rwxrwxrwx    1344000 04-08-2008 16:54:47 osd190.elf
-rwxrwxrwx    1344000 04-08-2008 16:54:54 osdmain.elf
-rwxrwxrwx        964 04-08-2008 16:55:13 icon.sys
-rwxrwxrwx      33688 04-08-2008 16:55:19 mcp.ico</pre>
</blockquote>
<p>These directories are what make booting an ELF of the memory card possible in the first place. Sony included support for updating the OSD (the software which starts when you power on your PS2 without any game in it) of the PS2 in the PS2 BIOS. The OSD looks for a osd1xx.elf on the memory, what ELF filename exactly depends on your PS2 model, hence thats why all the osd1xx.elf files are identical.</p>
<p>The reason this "exploit" hasn't been discovered earlier is because the OSD ELF's on the memory must be encrypted with <a href="http://en.wikipedia.org/wiki/MagicGate">MagicGate</a> or the OSD won't load the ELF's. So it's not really an exploit, just a feature protected by encryption. Even though the Memory Plus is a 64 MB memory card, which will be the main the selling point for the memory card, the more interesting part is the fact that Datel have managed to <span style="text-decoration: line-through;">encrypt</span> inject their own code into already encrypted ELF's for this <a href="http://www.eurasia.nu/modules.php?name=News&amp;file=article&amp;sid=759">GateCrasher</a> based memory card.</p>
<p>Anyway, returning to the original task of getting PS2Link to boot of the memory card. While listing the contents of the "BESLES-00000 MP", I realised that this is the directory in which the RUNME1.ELF and RUNME2.ELF should be put, as it already contained a RUNME.ELF.</p>
<blockquote>
<pre>fsclient dir "mc0:BESLES-00000 MP"</pre>
<pre>[Contents of mc0:BESLES-00000 MP]</pre>
<pre>drwxrwxrwx          0 04-08-2008 16:56:54 .
drwxrwxrwx          0 04-08-2008 16:56:54 ..
-rwxrwxrwx     763200 04-08-2008 16:56:56 RUNME.ELF
-rwxrwxrwx        964 04-08-2008 16:57:09 icon.sys
-rwxrwxrwx      33688 04-08-2008 16:57:15 mcp.ico</pre>
</blockquote>
<p>First thing I did was make a copy of RUNME.ELF (should I accidently overwrite it) with the following command.</p>
<blockquote>
<pre>fsclient copyfrom "mc0:BESLES-00000 MP/RUNME.ELF" mplus-manager.elf</pre>
</blockquote>
<p>As you might have already guessed from the command above, the RUNME.ELF is the built-in memory card manager of the Memory Plus card. I tried to load the mplus-manager.elf (filename of RUNME.ELF copy) using PS2Link and it runs just fine.</p>
<p>This means that the files in the BEEXEC-SYSTEM and BAEXEC-SYSTEM directories are really just launcher files for the ELF files in the "BESLES-00000 MP" directory. What this also means is that the memory card manager can be replaced by a free one with more features (like support for my pendrives, which work with usb_mass).</p>
<p>I'm would be very interested in hearing from any one who might have a  different version of the memory card manager (filesize of mine is 763200 bytes), as another version might have proper USB pendrive support.</p>
<p>I copied PS2LINK.ELF using the following fsclient command</p>
<blockquote>
<pre>fsclient copyto PS2LINK.ELF "mc0:BESLES-00000 MP/RUNME1.ELF"</pre>
</blockquote>
<p>I then rebooted my PS2 with the memory card inserted into the first slot and waited more than 25 seconds and nothing happend. So I decided to try something a bit simpler than PS2Link and tried my very own simple <a href="http://www.lukasz.dk/ps2dev/ttc/demos/round26/torus-lkz.zip">Torus demo</a> from <a href="http://lukasz.dk/playstation-2-programming/the-third-creation/">The Third Creation</a> and it did boot ;-)</p>
<p style="text-align: center;"><a href="http://lukasz.dk/files/mplus-torus.jpg"><img class="alignnone size-thumbnail wp-image-95" title="mplus-torus" src="http://lukasz.dk/files/mplus-torus-150x150.jpg" alt="" width="150" height="150" /></a></p>
<p>So the fun of debugging begins. The unknown factors in finding the bug(s) which caused PS2Link not to boot are, how is the ELF loaded by the encrypted launcher on the memory card and how is the method different from how ELF's are normally loaded?</p>
<p>I suspected the issue might be with the arguments passed to PS2Link, as PS2Link uses these to figure out from which device it was booted. So I made a small PS2SDK application which prints the arguments to the screen using <em>scr_printf()</em>. However it turned out that this simple application did not boot of the memory either. In fact, the first line of code in <em>main</em> never got executed (changing BGCOLOR). This could only mean that the issue was within the <em>crt0.s</em> (<em>C runtime entry point</em>) code, so I commented all the code related to argument handling, as the launcher code probably passes garbage arguments to the ELF when it loads it and this case is not handled by crt0.s, which causes the PS2 to hang/crash. After doing this, my simple application did boot of the memory card. I made some quick changes to PS2Link to make it support the altered crt0.s and hardcoded the boot path inside the PS2Link source. And PS2Link booted of the Memory Plus card.</p>
<p style="text-align: center;"><a href="http://lukasz.dk/files/mplus-ps2link.jpg"><img class="alignnone size-thumbnail wp-image-94" title="mplus-ps2link" src="http://lukasz.dk/files/mplus-ps2link-150x150.jpg" alt="" width="150" height="150" /></a></p>
<p><span style="text-decoration: line-through;">A precompiled version of the PS2Link 1.51 ELF which boots of the Memory Plus memory card is avaliable <a href="http://lukasz.dk/files/PS2LINK_151_MPLUS.ELF">here</a>.</span></p>
<p><span style="text-decoration: line-through;">A real patch should be made for crt0.s, so it would support the arguments passed by the Memory Plus loader without breaking any existing code. This task will require more time than I spent on getting PS2Link running. I will submit a patch for crt0.s once I get the time to develop it, unless some one beats me to it *hint hint* :-) This crt0.s patch is required to make any PS2SDK based applications boot of the memory card.</span></p>
<p><span style="text-decoration: line-through;">Once crt0.s is patched, making the required changes to PS2Link should be easy, if the Memory Plus card can be uniquely identified based upon the arguments passed to <em>main()</em>.</span></p>
<p><strong>Update:</strong></p>
<p>Based upon <a href="http://lukasz.dk/2008/04/22/datel-memory-plus-64-mb/#comment-556">the comment by PS2onCrack</a>, I tried to format my Pendrives yet again to FAT32 and it turns out that one of my 4 pendrives is actually detected by the Memory Plus manager. In order to format it properly under Ubuntu I had to do the following: First find where its mounted with the <em>df</em> command (my pendrive partition mounts at /dev/sdb1). Then umount the partition.</p>
<blockquote>
<pre>sudo umount /dev/sdb1</pre>
</blockquote>
<p>Then use fdisk, to change system id of the partition to "W95 FAT32"</p>
<blockquote>
<pre>sudo fdisk /dev/sdb</pre>
</blockquote>
<p>Note that I use /dev/sdb (the device) and not /dev/sdb1 (the partition). With fdisk I used the <em>t</em> option (Change system id), then <em>b</em> for "W95 FAT32", and finally <em>w</em> to writing the changes. I then formatted the partition to FAT32.</p>
<blockquote>
<pre>sudo mkfs.vfat -F 32 /dev/sdb1</pre>
</blockquote>
<p>Now my Noname 512 MB pendrive works with the Memory Plus manager. The following pendrives did not work: 1 GB Kingston DataTraveler, Datel Max Drive 16 MB and 256 MB MyCom MP3 Player.</p>
<p>I also realized that patching crt0.s in PS2SDK and making the necessary changes to PS2Link to make it boot of the Memory Plus card is not the best solution, as this will only fix all ELFs compiled against the updated PS2SDK and not all ELFs already available.</p>
<p>So instead I made a small Memory Plus ELF loader, which boots of the memory card and then tries to load an ELF correctly, which should work with most, if not all ELFs.</p>
<p><strong>Download</strong></p>
<ul>
<li><a href="http://lukasz.dk/files/MPLUS-LOADER.ELF">MPLUS-LOADER.ELF</a></li>
<li><a href="http://lukasz.dk/files/mplus-loader-src.zip">mplus-loader-src.zip</a> (source)<a href="http://lukasz.dk/files/mplus-loader-src.zip"><br />
</a></li>
<li><a href="http://lukasz.dk/files/PS2LINK151.ELF">PS2LINK151.ELF</a> (PS2Link 1.51 compiled from Subversion)<a href="http://lukasz.dk/files/PS2LINK151.ELF"><br />
</a></li>
</ul>
<p>To make it work, rename MPLUS-LOADER.ELF to either RUNME1.ELF or RUNME2.ELF and put in on the Memory Plus card, as described in the Memory Plus instructions.</p>
<p>Then take the ELF you wish to run  (you can test with PS2LINK151.ELF) and rename it EXECUTE1.ELF (if you want to boot it when the Memory Plus card is inserted into memory card port 1, otherwise EXECUTE2.ELF for port 2) and put it either on the Memory Plus card or your USB pendrive.</p>
<p>Now boot the Memory Plus card in port 1, this will now load the Memory Plus ELF loader (RUNME1.ELF), which will then load the EXECUTE1.ELF of either the Memory Plus card or the USB pendrive. If the ELF does not exist, the Memory Plus manager will be booted.</p>
<p><strong>Update 2:</strong></p>
<p>I've updated the Memory Plus Loader, so now more ELFs should boot. Tested with uLaunchELF v4.12 and SMS 2.8 (Rev. 1). Also I've added a seperate Memory Plus Loader ELF which patches the Memory Plus manager to NTSC mode before starting it. To make it work you just need to add RUNME1.ELF (or RUNME2.ELF) and not have EXECUTE1.ELF (or EXECUTE2.ELF) present, then the Memory Plus manager will be booted in NTSC mode.</p>
<p><strong>Download</strong></p>
<ul>
<li><a href="http://lukasz.dk/files/MPLUS-LOADER2.ELF">MPLUS-LOADER2.ELF</a></li>
<li><a href="http://lukasz.dk/files/MPLUS-LOADER2-NTSC.ELF">MPLUS-LOADER2-NTSC.ELF</a></li>
<li><a href="http://lukasz.dk/files/mplus-loader2-src.zip">mplus-loader2-src.zip</a></li>
</ul>
<p><strong>Update 3:</strong></p>
<p>The Memory Plus Loader has been updated to stop the CD/DVD drive for spinning. It's now also possible to initialize the CD/DVD drive. The solution was found by <a href="http://www.psx-scene.com/forums/freevast/57899-free-vast-continues-32.html">ffgriever </a>for the <a href="http://www.psx-scene.com/forums/freevast/">Free McBoot/FreeVast project</a>. There are some people reporting that this does not work with all consoles, however it works with my PAL console :-)</p>
<p><strong>Download</strong></p>
<ul>
<li><a href="http://lukasz.dk/files/MPLUS-LOADER3.ELF">MPLUS-LOADER3.ELF</a></li>
<li><a href="http://lukasz.dk/files/MPLUS-LOADER3-NTSC.ELF">MPLUS-LOADER3-NTSC.ELF</a></li>
<li><a href="http://lukasz.dk/files/mplus-loader3-src.zip">mplus-loader3-src.zip</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://lukasz.dk/2008/04/22/datel-memory-plus-64-mb/feed/</wfw:commentRss>
		<slash:comments>40</slash:comments>
		</item>
		<item>
		<title>Oddments Demo</title>
		<link>http://lukasz.dk/2008/04/01/oddments-demo/</link>
		<comments>http://lukasz.dk/2008/04/01/oddments-demo/#comments</comments>
		<pubDate>Tue, 01 Apr 2008 14:37:50 +0000</pubDate>
		<dc:creator>Lukasz Bruun</dc:creator>
				<category><![CDATA[PlayStation 2]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://lukasz.dk/?p=74</guid>
		<description><![CDATA[I found an ISO of the Breakpoint 2004 PS2 demo Oddments by adresd, emoon, jar, raizor and TyRaNiD in my archive of PS2DEV files. I wrote the ISO to a CD-R and ran it on my PS2 and took some screenshots in the process. Since I was unable to find the ISO online, I uploaded [...]]]></description>
			<content:encoded><![CDATA[<p>I found an ISO of the <a href="http://breakpoint.untergrund.net/2004/">Breakpoint 2004</a> PS2 demo <em>Oddments</em> by adresd, emoon, jar, raizor and TyRaNiD in my archive of PS2DEV files. I wrote the ISO to a CD-R and ran it on my PS2 and took some screenshots in the process. Since I was unable to find the ISO online, I uploaded it and you can download it <a href="http://lukasz.dk/playstation-2-programming/file-mirror/">here</a>.</p>
<p><a href="http://lukasz.dk/files/oddment1.jpg"><img class="alignnone size-thumbnail wp-image-75" title="oddment1" src="http://lukasz.dk/files/oddment1-150x150.jpg" alt="" width="150" height="150" /></a><a href="http://lukasz.dk/files/oddment2.jpg"><img class="alignnone size-thumbnail wp-image-76" title="oddment2" src="http://lukasz.dk/files/oddment2-150x150.jpg" alt="" width="150" height="150" /></a><a href="http://lukasz.dk/files/oddment3.jpg"><img class="alignnone size-thumbnail wp-image-77" title="oddment3" src="http://lukasz.dk/files/oddment3-150x150.jpg" alt="" width="150" height="150" /></a></p>
<p><a href="http://lukasz.dk/files/oddment4.jpg"><img class="alignnone size-thumbnail wp-image-78" title="oddment4" src="http://lukasz.dk/files/oddment4-150x150.jpg" alt="" width="150" height="150" /></a><a href="http://lukasz.dk/files/oddment5.jpg"><img class="alignnone size-thumbnail wp-image-79" title="oddment5" src="http://lukasz.dk/files/oddment5-150x150.jpg" alt="" width="150" height="150" /></a><a href="http://lukasz.dk/files/oddment6.jpg"><img class="alignnone size-thumbnail wp-image-80" title="oddment6" src="http://lukasz.dk/files/oddment6-150x150.jpg" alt="" width="150" height="150" /></a></p>
<p><a href="http://lukasz.dk/files/oddment7.jpg"><img class="alignnone size-thumbnail wp-image-81" title="oddment7" src="http://lukasz.dk/files/oddment7-150x150.jpg" alt="" width="150" height="150" /></a><a href="http://lukasz.dk/files/oddment8.jpg"><img class="alignnone size-thumbnail wp-image-82" title="oddment8" src="http://lukasz.dk/files/oddment8-150x150.jpg" alt="" width="150" height="150" /></a></p>
<p>This demo is a very overlooked PS2DEV production. I recommend checking it out, if you have a PS2 capable of running CD-R's. The source code for it is also available in the PS2DEV.org Subversion repository, you can obtain it with the following Subversion command:</p>
<p><strong><span class="postbody">svn co svn://<span class="linkification-ext"><a class="linkification-ext" title="Linkification: http://svn.ps2dev.org/ps2ware/trunk/BPDemoHarness" href="http://svn.ps2dev.org/ps2ware/trunk/BPDemoHarness">svn.ps2dev.org/ps2ware/trunk/BPDemoHarness</a></span></span></strong></p>
<p>The source code will most likely require some tweaking to make it compile against the the current version of PS2SDK.</p>
]]></content:encoded>
			<wfw:commentRss>http://lukasz.dk/2008/04/01/oddments-demo/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Doom &#8211; PlayStation 2 Port</title>
		<link>http://lukasz.dk/2008/02/11/doom-playstation-2-port/</link>
		<comments>http://lukasz.dk/2008/02/11/doom-playstation-2-port/#comments</comments>
		<pubDate>Mon, 11 Feb 2008 18:37:51 +0000</pubDate>
		<dc:creator>Lukasz Bruun</dc:creator>
				<category><![CDATA[PlayStation 2]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[doom]]></category>
		<category><![CDATA[port]]></category>
		<category><![CDATA[ps2]]></category>
		<category><![CDATA[sdl]]></category>

		<guid isPermaLink="false">http://lukasz.dk/2008/02/11/doom-playstation-2-port/</guid>
		<description><![CDATA[Update 28/2/09: Cosmito has been doing alot of addition work on my quick PS2 port of doom lately, recently adding sound support. To keep updated on the latest PS2Doom changes,  check Cosmitos website. Original post: Doom by id Software seems to available for every platform known to man, except for the PlayStation 2. So I [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update 28/2/09:</strong></p>
<p><a href="http://forums.ps2dev.org/profile.php?mode=viewprofile&amp;u=8970">Cosmito</a> has been doing alot of addition work on my quick PS2 port of doom lately, <a href="http://ps2homebrewing.wordpress.com/2009/02/24/ps2doom-with-proper-sound-at-last/">recently adding sound support</a>. To keep updated on the latest PS2Doom changes,  check Cosmitos <a href="http://ps2homebrewing.wordpress.com/">website</a>.</p>
<p><strong>Original post:</strong></p>
<p><a href="http://en.wikipedia.org/wiki/Doom_%28video_game%29">Doom by id Software</a> seems to available for every platform known to man, except for the PlayStation 2. So I wondered how long it would take to port it over to PS2 and the answer to that question turned out to be less than 3 hours. Using the PS2 port of SDL, gsKit (SDL requires it for video) and PS2SDK, all available from <a href="http://svn.ps2dev.org">PS2dev.org Subversion repository</a> and a SDL port of Doom <a href="http://www.libsdl.org/projects/doom/">available here</a>, I managed to get a very basic (read: hackish) port of Doom running on the PS2 without much effort.</p>
<p align="center"><a title="PS2 Doom Screenshot" rel="attachment wp-att-57" href="http://lukasz.dk/2008/02/11/doom-playstation-2-port/ps2-doom-screenshot/"><img src="http://lukasz.dk/files/ps2doom1.thumbnail.jpg" alt="PS2 Doom Screenshot" /></a> <a title="PS2 Doom Screenshot 2" rel="attachment wp-att-58" href="http://lukasz.dk/2008/02/11/doom-playstation-2-port/ps2-doom-screenshot-2/"><img src="http://lukasz.dk/files/ps2doom2.thumbnail.jpg" alt="PS2 Doom Screenshot 2" /></a></p>
<p>I've only tested the port over PS2Link and it will most likely not run from a CD-R. There is no sound, however there is support for sound in PS2 SDL, but does not appear to work with Doom and I havn't investigated the cause. Saving and loading of games works, as they just save to host/PC. The Dualshock controls are as follow (USB keyboard and mouse are untested)</p>
<blockquote>
<pre>Left Analog Stick : Move</pre>
<pre>Cross             : Enter</pre>
<pre>Square/R1         : CTRL / Fire</pre>
<pre>Circle/R2         : Space / Open doors</pre>
<pre>Triangle          : Escape</pre>
<pre>L1                : x</pre>
<pre>L2                : y</pre>
<pre>L1 and L2 are for entering savegame names</pre>
</blockquote>
<p>I will not continue to work on this port, it was just a quick nostalgic proof of concept port :-)</p>
<p><strong>Download:</strong> <a title="ps2doom-src.zip" href="http://lukasz.dk/files/ps2doom-src.zip">ps2doom-src.zip</a> <a title="ps2doom-bin.zip" href="http://lukasz.dk/files/ps2doom-bin.zip">ps2doom-bin.zip</a> (Binary includes shareware data)</p>
<p><strong>Update:</strong> Follow <a href="http://forums.ps2dev.org/viewtopic.php?t=9798">this thread</a> for further work on this port.</p>
<p><strong>Update 2:</strong> A <a href="http://firehead.org/~jessh/lsdldoom/">lsdldoom</a> PS2 port by <a href="http://www.jasonyu.net/">Jason Yu</a> with sound effect support has <a href="http://forums.ps2dev.org/viewtopic.php?p=66358#66358">surfaced</a>. I've compiled the source into a single ELF with the DOOM shareware data included, which should run from CD-ROM, USB, etc (not tested). Included in the archive is also a <a href="http://ps2dev.org/ps2/Tools/Packers/Unpackers/PS2-Packer_0.4.4">ps2-packer</a> compressed version of DOOM.ELF named DOOMP.ELF.<strong> </strong></p>
<p><strong>Download:</strong> <span class="postbody"><a href="http://lukasz.dk/files/lsdldoom-ps2-bin.zip" target="_blank">lsdldoom-ps2-bin.zip</a></span></p>
<p><span class="postbody"> </span></p>
]]></content:encoded>
			<wfw:commentRss>http://lukasz.dk/2008/02/11/doom-playstation-2-port/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>An Introduction to PS2DEV</title>
		<link>http://lukasz.dk/2008/01/19/an-introduction-to-ps2dev/</link>
		<comments>http://lukasz.dk/2008/01/19/an-introduction-to-ps2dev/#comments</comments>
		<pubDate>Sat, 19 Jan 2008 17:27:23 +0000</pubDate>
		<dc:creator>Lukasz Bruun</dc:creator>
				<category><![CDATA[PlayStation 2]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://lukasz.dk/2008/01/19/an-introduction-to-ps2dev/</guid>
		<description><![CDATA[I've written an article which tries to give an introduction to PS2DEV, read it here. Feel free to comment, suggest additions and corrections in this thread at forums.PS2DEV.org or at the bottom of the article.]]></description>
			<content:encoded><![CDATA[<p>I've written an article which tries to give an introduction to PS2DEV, <a href="http://lukasz.dk/playstation-2-programming/an-introduction-to-ps2dev/">read it here</a>. Feel free to comment, suggest additions and corrections in <a href="http://forums.ps2dev.org/viewtopic.php?p=63784">this thread</a> at <a href="http://forums.ps2dev.org">forums.PS2DEV.org</a> or at the bottom of the article.</p>
]]></content:encoded>
			<wfw:commentRss>http://lukasz.dk/2008/01/19/an-introduction-to-ps2dev/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Building PS2 Toolchains in MinGW</title>
		<link>http://lukasz.dk/2007/07/09/building-ps2-toolchains-in-mingw/</link>
		<comments>http://lukasz.dk/2007/07/09/building-ps2-toolchains-in-mingw/#comments</comments>
		<pubDate>Mon, 09 Jul 2007 10:03:23 +0000</pubDate>
		<dc:creator>Lukasz Bruun</dc:creator>
				<category><![CDATA[PlayStation 2]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://lukasz.dk/blog/2007/07/09/building-ps2-toolchains-in-mingw/</guid>
		<description><![CDATA[Due to the problems with building the PS2 toolchains in Cygwin, I have now written a tutorial which explains how to build the PS2 toolchains in MinGW, a lightweight GNU enviroment for Windows. The tutorial also provides binaries of the toolchains. Check it out here. Update: The tutorial has been updated with a link to [...]]]></description>
			<content:encoded><![CDATA[<p>Due to the <a href="http://lukasz.dk/2006/03/18/cygwin-problems/">problems</a> with building the PS2 toolchains in Cygwin, I have now written a tutorial which explains how to build the PS2 toolchains in <a href="http://www.mingw.org">MinGW</a>, a lightweight GNU enviroment for Windows. The tutorial also provides binaries of the toolchains. Check it out <a href="http://lukasz.dk/playstation-2-programming/mingw-tutorial/">here</a>.</p>
<p><strong>Update:</strong> The tutorial has been updated with a link to instructions on how to build the toolchains in Windows Vista, provided by chip.</p>
<p><strong>Update 2:</strong> It appears that the PS2 toolchains, when built in MinGW, do not always generate correct code. If a solution to this problem is found, I will post it here and update the MinGW tutorial. Until then you can follow the progress of overcoming the problem in <a href="http://forums.ps2dev.org/viewtopic.php?t=8568">this thread</a> at the PS2Dev.org forums.</p>
<p><strong>Update 3:</strong> <span class="name">ragnarok2040</span> has now supplied a patch the PS2 toolchains to fix the code generation bug and the ps2toolchain patches have been updated. Today I've rebuilt the PS2 toolchains for MinGW and uploaded the new binaries. I've tested them and verified that the bug is fixed, great work ragnarok2040!</p>
]]></content:encoded>
			<wfw:commentRss>http://lukasz.dk/2007/07/09/building-ps2-toolchains-in-mingw/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PS2Dev File Mirror</title>
		<link>http://lukasz.dk/2007/05/29/ps2dev-file-mirror/</link>
		<comments>http://lukasz.dk/2007/05/29/ps2dev-file-mirror/#comments</comments>
		<pubDate>Tue, 29 May 2007 15:01:36 +0000</pubDate>
		<dc:creator>Lukasz Bruun</dc:creator>
				<category><![CDATA[PlayStation 2]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://lukasz.dk/blog/2007/05/29/ps2dev-file-mirror/</guid>
		<description><![CDATA[I've mirrored the reversed IOP modules and other files from [RO]man's website "PS2DEV: Bios Details for Developers by [RO]man", as the website is offline at the moment. I the future I will upload more PS2Dev related files as they disappear from the net, making sure they are not lost forever :-) Get the files here.]]></description>
			<content:encoded><![CDATA[<p>I've mirrored the reversed IOP modules and other files from [RO]man's website "PS2DEV: Bios Details for Developers by [RO]man", as the website is offline at the moment. I the future I will upload more PS2Dev related files as they disappear from the net, making sure they are not lost forever :-) <a href="http://lukasz.dk/playstation-2-programming/file-mirror/">Get the files here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://lukasz.dk/2007/05/29/ps2dev-file-mirror/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PS2Link Debugging Tutorial</title>
		<link>http://lukasz.dk/2007/01/27/ps2link-debugging-tutorial/</link>
		<comments>http://lukasz.dk/2007/01/27/ps2link-debugging-tutorial/#comments</comments>
		<pubDate>Sat, 27 Jan 2007 14:40:57 +0000</pubDate>
		<dc:creator>Lukasz Bruun</dc:creator>
				<category><![CDATA[PlayStation 2]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://lukasz.dk/blog/2007/01/27/ps2link-debugging-tutorial/</guid>
		<description><![CDATA[I've written a new tutorial on debugging with PS2Link, using ee-addr2line (which comes with binutils) instead of ps2dis. Direct link and also available through the PlayStation 2 Programming page.]]></description>
			<content:encoded><![CDATA[<p>I've written a new tutorial on debugging with PS2Link, using ee-addr2line (which comes with binutils) instead of ps2dis. <a href="http://lukasz.dk/playstation-2-programming/ps2link-debugging/">Direct link</a> and also available through the PlayStation 2 Programming page.</p>
]]></content:encoded>
			<wfw:commentRss>http://lukasz.dk/2007/01/27/ps2link-debugging-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Third Creation Demo Archive Mirror</title>
		<link>http://lukasz.dk/2006/04/16/the-third-creation-demo-archive-mirror/</link>
		<comments>http://lukasz.dk/2006/04/16/the-third-creation-demo-archive-mirror/#comments</comments>
		<pubDate>Sun, 16 Apr 2006 13:24:33 +0000</pubDate>
		<dc:creator>Lukasz Bruun</dc:creator>
				<category><![CDATA[PlayStation 2]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://lukasz.dk/wordpress/blog/2006/04/16/the-third-creation-demo-archive-mirror/</guid>
		<description><![CDATA[One of the great things that came out of homebrew PlayStation 2 development were all the demos entered for The Third Creation, a demo contest without any prizes. Unfortunately, The Third Creation website has been been down for quite some time. Luckily, I had a backup of all the demos and most of the screenshots, [...]]]></description>
			<content:encoded><![CDATA[<p>One of the great things that came out of homebrew PlayStation 2 development were all the demos entered for The Third Creation, a demo contest without any prizes. Unfortunately, The Third Creation website has been been down for quite some time. Luckily, I had a backup of all the demos and most of the screenshots, so I made a mirror of the demo archive <a href="http://www.lukasz.dk/playstation-2-programming/the-third-creation/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://lukasz.dk/2006/04/16/the-third-creation-demo-archive-mirror/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cygwin Problems</title>
		<link>http://lukasz.dk/2006/03/18/cygwin-problems/</link>
		<comments>http://lukasz.dk/2006/03/18/cygwin-problems/#comments</comments>
		<pubDate>Sat, 18 Mar 2006 09:38:12 +0000</pubDate>
		<dc:creator>Lukasz Bruun</dc:creator>
				<category><![CDATA[PlayStation 2]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://lukasz.dk/wordpress/blog/2006/03/18/cygwin-problems/</guid>
		<description><![CDATA[Some recent updates to Cygwin cause the PS2Dev toolchains not to build under Cygwin, this can be fixed by downgrading some packages, more information available at this thread. I've added a notice to the Cygwin tutorial.]]></description>
			<content:encoded><![CDATA[<p>Some recent updates to Cygwin cause the PS2Dev toolchains not to build under Cygwin, this can be fixed by downgrading some packages, more information available at <a href="http://forums.ps2dev.org/viewtopic.php?t=4909">this thread</a>. I've added a notice to the Cygwin tutorial.</p>
]]></content:encoded>
			<wfw:commentRss>http://lukasz.dk/2006/03/18/cygwin-problems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using The PS2Link Exception Screen</title>
		<link>http://lukasz.dk/2005/12/08/new-tutorial-using-the-ps2link-exception-screen/</link>
		<comments>http://lukasz.dk/2005/12/08/new-tutorial-using-the-ps2link-exception-screen/#comments</comments>
		<pubDate>Thu, 08 Dec 2005 18:43:22 +0000</pubDate>
		<dc:creator>Lukasz Bruun</dc:creator>
				<category><![CDATA[PlayStation 2]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://lukasz.dk/wordpress/blog/2005/12/08/new-tutorial-using-the-ps2link-exception-screen/</guid>
		<description><![CDATA[Today I've written a short tutorial which explains how you can use the PS2Link exception screen to track down your bugs. Direct link here and also linked from the PlayStation 2 Programming page. Enjoy :-)]]></description>
			<content:encoded><![CDATA[<p>Today I've written a short tutorial which explains how you can use the PS2Link exception screen to track down your bugs. <a href="http://lukasz.dk/playstation-2-programming/using-the-ps2link-exception-screen/">Direct link here</a> and also linked from the PlayStation 2 Programming page. Enjoy :-)</p>
]]></content:encoded>
			<wfw:commentRss>http://lukasz.dk/2005/12/08/new-tutorial-using-the-ps2link-exception-screen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
