<?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"
	>

<channel>
	<title>Emulator Development</title>
	<atom:link href="http://codeslinger.co.uk/pages/blog/wordpress/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://codeslinger.co.uk/pages/blog/wordpress</link>
	<description>The art of emulator programming</description>
	<pubDate>Mon, 10 May 2010 11:39:21 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Update</title>
		<link>http://codeslinger.co.uk/pages/blog/wordpress/?p=30</link>
		<comments>http://codeslinger.co.uk/pages/blog/wordpress/?p=30#comments</comments>
		<pubDate>Mon, 10 May 2010 11:39:21 +0000</pubDate>
		<dc:creator>codeslinger</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://codeslinger.co.uk/pages/blog/wordpress/?p=30</guid>
		<description><![CDATA[Hi all
Sorry it has been so long since my last update. I&#8217;ve had projects that took higher priority than my emulation development. I still have very little free time to work on emulation but I will make more of an effort to make time for it and this site.
I will start looking back into gameboy [...]]]></description>
			<content:encoded><![CDATA[<p>Hi all</p>
<p>Sorry it has been so long since my last update. I&#8217;ve had projects that took higher priority than my emulation development. I still have very little free time to work on emulation but I will make more of an effort to make time for it and this site.</p>
<p>I will start looking back into gameboy sound emulation and will write a tutorial on it when I finish.</p>
<p>Also I wanted to say thanks to those of you who have left positive comments, it is appreciated. Ive been searching the internet and  found a few people using my tutorials for their own emulators which is great to see.</p>
<p>Thanks</p>
<p>CS</p>
]]></content:encoded>
			<wfw:commentRss>http://codeslinger.co.uk/pages/blog/wordpress/?feed=rss2&amp;p=30</wfw:commentRss>
		</item>
		<item>
		<title>Gameboy Sound Emulation Update</title>
		<link>http://codeslinger.co.uk/pages/blog/wordpress/?p=28</link>
		<comments>http://codeslinger.co.uk/pages/blog/wordpress/?p=28#comments</comments>
		<pubDate>Wed, 06 May 2009 07:26:49 +0000</pubDate>
		<dc:creator>codeslinger</dc:creator>
		
		<category><![CDATA[Gameboy]]></category>

		<guid isPermaLink="false">http://codeslinger.co.uk/pages/blog/wordpress/?p=28</guid>
		<description><![CDATA[Well I have implemented all 4 channels and individually they sound correct. When I combine them though there is a serious issue. Although I can still hear each channel playing correctly it is like the mixing is causing the seperate channels to be playing at the wrong volume. Still it shouldnt be too long until [...]]]></description>
			<content:encoded><![CDATA[<p>Well I have implemented all 4 channels and individually they sound correct. When I combine them though there is a serious issue. Although I can still hear each channel playing correctly it is like the mixing is causing the seperate channels to be playing at the wrong volume. Still it shouldnt be too long until I have it working. Expect a gameboy sound tutorial soon. Im hoping to be on to my Sega Mega Drive/Genesis emulator by the start of June</p>
<p>CS.</p>
]]></content:encoded>
			<wfw:commentRss>http://codeslinger.co.uk/pages/blog/wordpress/?feed=rss2&amp;p=28</wfw:commentRss>
		</item>
		<item>
		<title>Gameboy sound emulation</title>
		<link>http://codeslinger.co.uk/pages/blog/wordpress/?p=27</link>
		<comments>http://codeslinger.co.uk/pages/blog/wordpress/?p=27#comments</comments>
		<pubDate>Mon, 27 Apr 2009 06:44:32 +0000</pubDate>
		<dc:creator>codeslinger</dc:creator>
		
		<category><![CDATA[Gameboy]]></category>

		<guid isPermaLink="false">http://codeslinger.co.uk/pages/blog/wordpress/?p=27</guid>
		<description><![CDATA[Well I have finally started sound emulation for the gameboy and am finding it much more difficult than the SMS. There really seems to be a lack of sound emulation resources on the net. For the time being I am only emulating the two square waves as I have experience with how these work from [...]]]></description>
			<content:encoded><![CDATA[<p>Well I have finally started sound emulation for the gameboy and am finding it much more difficult than the SMS. There really seems to be a lack of sound emulation resources on the net. For the time being I am only emulating the two square waves as I have experience with how these work from the SMS. Although I have implemented everything to do with the square waves it still isnt producing the correct tune. The beat seems correct but the notes are completely off. Still encouraging though as this was exactly how my SMS sounded a day or two before I cracked it.</p>
<p>On a slightly annoying note my trunk svn gameboy dev seems to have a few bugs in the vdp and cpu that have appeared out of nowhere. I might look into redeveloping my Gameboy emulator when I have finished the sound as the knowledge I have gained from developing the SMS I feel I could take it to the next level. Still I&#8217;m getting impatient to start my mega drive/genesis emulator&#8230;</p>
<p>CS</p>
]]></content:encoded>
			<wfw:commentRss>http://codeslinger.co.uk/pages/blog/wordpress/?feed=rss2&amp;p=27</wfw:commentRss>
		</item>
		<item>
		<title>SMS tutorials complete</title>
		<link>http://codeslinger.co.uk/pages/blog/wordpress/?p=26</link>
		<comments>http://codeslinger.co.uk/pages/blog/wordpress/?p=26#comments</comments>
		<pubDate>Tue, 17 Mar 2009 09:00:23 +0000</pubDate>
		<dc:creator>codeslinger</dc:creator>
		
		<category><![CDATA[Sega Master System]]></category>

		<guid isPermaLink="false">http://codeslinger.co.uk/pages/blog/wordpress/?p=26</guid>
		<description><![CDATA[Well it has taken me a ridiculous amount of time to pull my finger out and complete the SMS tutorials, but I have finally finished. You can view these tutorials here
I feel more motivated lately to continue wih my emulation work after a few months break. I&#8217;ll more than likely optimize my gameboy emulator and [...]]]></description>
			<content:encoded><![CDATA[<p>Well it has taken me a ridiculous amount of time to pull my finger out and complete the SMS tutorials, but I have finally finished. You can view these tutorials <a href="http://www.codeslinger.co.uk/pages/projects/mastersystem.html">here</a></p>
<p>I feel more motivated lately to continue wih my emulation work after a few months break. I&#8217;ll more than likely optimize my gameboy emulator and add sound to it next.</p>
<p>CS</p>
]]></content:encoded>
			<wfw:commentRss>http://codeslinger.co.uk/pages/blog/wordpress/?feed=rss2&amp;p=26</wfw:commentRss>
		</item>
		<item>
		<title>Still Alive</title>
		<link>http://codeslinger.co.uk/pages/blog/wordpress/?p=25</link>
		<comments>http://codeslinger.co.uk/pages/blog/wordpress/?p=25#comments</comments>
		<pubDate>Tue, 03 Feb 2009 10:49:56 +0000</pubDate>
		<dc:creator>codeslinger</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://codeslinger.co.uk/pages/blog/wordpress/?p=25</guid>
		<description><![CDATA[Just a quick note to let you all know that Im still alive and kicking. I have completed most of my SMS emulation tutorials which can be found here. All that is left to do is the VDP emulation tutorial which Ive mostly written so expect it in the next few days.
Whilst writing these tutorials [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick note to let you all know that Im still alive and kicking. I have completed most of my SMS emulation tutorials which can be found <a href="http://www.codeslinger.co.uk/pages/projects/mastersystem.html">here</a>. All that is left to do is the VDP emulation tutorial which Ive mostly written so expect it in the next few days.</p>
<p>Whilst writing these tutorials I have had one eye on the sega mega drive/genesis hardware notes so hopefully soon I can start emulating this system. This system looks very interesting and should be a good step up in difficulty.</p>
<p>CS</p>
]]></content:encoded>
			<wfw:commentRss>http://codeslinger.co.uk/pages/blog/wordpress/?feed=rss2&amp;p=25</wfw:commentRss>
		</item>
		<item>
		<title>SMS Emu completion</title>
		<link>http://codeslinger.co.uk/pages/blog/wordpress/?p=24</link>
		<comments>http://codeslinger.co.uk/pages/blog/wordpress/?p=24#comments</comments>
		<pubDate>Thu, 18 Dec 2008 12:19:03 +0000</pubDate>
		<dc:creator>codeslinger</dc:creator>
		
		<category><![CDATA[Sega Master System]]></category>

		<guid isPermaLink="false">http://codeslinger.co.uk/pages/blog/wordpress/?p=24</guid>
		<description><![CDATA[I am ready to release the first version of my sega master system emulator. It has approximately 95% compatibility which is enough for me to start writing the SMS tutorials and upload them to the main site. Hopefully I should have them written by the end of the week and I can go back to [...]]]></description>
			<content:encoded><![CDATA[<p>I am ready to release the first version of my sega master system emulator. It has approximately 95% compatibility which is enough for me to start writing the SMS tutorials and upload them to the main site. Hopefully I should have them written by the end of the week and I can go back to my Gameboy emulator and implement sound.</p>
<p>The SMS has been a really fun project and I&#8217;ve learnt a lot more about emulation programming from it, but have also realised how much left there is to learn. Hopefully my next emulator (Sega Mega Drive/Genesis) will have more advance emulation techniques.</p>
<p>Keep watching this space for the release of my emulator along with source code and the &#8220;how-to&#8221; tutorials.</p>
<p>CS</p>
]]></content:encoded>
			<wfw:commentRss>http://codeslinger.co.uk/pages/blog/wordpress/?feed=rss2&amp;p=24</wfw:commentRss>
		</item>
		<item>
		<title>Sound Emulation</title>
		<link>http://codeslinger.co.uk/pages/blog/wordpress/?p=23</link>
		<comments>http://codeslinger.co.uk/pages/blog/wordpress/?p=23#comments</comments>
		<pubDate>Tue, 16 Dec 2008 08:00:32 +0000</pubDate>
		<dc:creator>codeslinger</dc:creator>
		
		<category><![CDATA[Sega Master System]]></category>

		<guid isPermaLink="false">http://codeslinger.co.uk/pages/blog/wordpress/?p=23</guid>
		<description><![CDATA[I&#8217;ve been searching the internet recently trying to find some good documentation on sound emulation. None exist. Hopefully when I finish my emulator and write my &#8220;how to emulate the sega master system&#8221; tutorial on my site, the section on sound emulation should be a good resource to new programmers.
I have found a good article [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been searching the internet recently trying to find some good documentation on sound emulation. None exist. Hopefully when I finish my emulator and write my &#8220;how to emulate the sega master system&#8221; tutorial on my site, the section on sound emulation should be a good resource to new programmers.</p>
<p>I have found a good article on the SMS sound chip SN79489 written by Maxim which explains how it works, and I have been programming in the dark trying to implement this into my emu. I believe my sound emulator is now 100% complete with the tiny problem that it doesnt seem to be synchronised with the cpu so the frequency of the music is incorrect. Apart from this it seems to be working fine.</p>
<p>Now im on my christmas holidays I should have enough time to get my SMS emulator finished by the end of the week which will be a great achievement. As soon as it&#8217;s finished I&#8217;ll write the tutorials for it and then go back to my gameboy emulator to tweak it and emulate sound before moving on to the sega mega drive, which im really looking forward to.</p>
<p>Merry Christmas all</p>
<p>CS.</p>
]]></content:encoded>
			<wfw:commentRss>http://codeslinger.co.uk/pages/blog/wordpress/?feed=rss2&amp;p=23</wfw:commentRss>
		</item>
		<item>
		<title>Debugging an emulator is a pain</title>
		<link>http://codeslinger.co.uk/pages/blog/wordpress/?p=21</link>
		<comments>http://codeslinger.co.uk/pages/blog/wordpress/?p=21#comments</comments>
		<pubDate>Mon, 10 Nov 2008 21:10:55 +0000</pubDate>
		<dc:creator>codeslinger</dc:creator>
		
		<category><![CDATA[Sega Master System]]></category>

		<guid isPermaLink="false">http://codeslinger.co.uk/pages/blog/wordpress/?p=21</guid>
		<description><![CDATA[Well this week I&#8217;ve entered a world of pain with my emulator debugger. First of all I had to debug street fighter to see why it wasnt working and it turned out that it was relying on the reading of the mapper control registers (0xFFFC-0xFFFF) to return the values of the mapped address of 0xDFFC-0xDFFF. [...]]]></description>
			<content:encoded><![CDATA[<p>Well this week I&#8217;ve entered a world of pain with my emulator debugger. First of all I had to debug street fighter to see why it wasnt working and it turned out that it was relying on the reading of the mapper control registers (0xFFFC-0xFFFF) to return the values of the mapped address of 0xDFFC-0xDFFF. As soon as I put this into the game I had immediate success.</p>
<p>I finally managed to get mode 2 sprite emulation working which was down to a really stupid error on my part.</p>
<p>Finally I&#8217;ve been debugging why my code masters larger res screen doesnt work and why the graphics are screwy in mortal kombat.</p>
<p>Luckily for me they were both the same error. The error was with my 8 and 16 bit opcodes for adc and sbc. Now this is how I emulated 8 bit adc (for when adding register c to register a):</p>
<blockquote><p><em>BYTE before = m_RegisterAF.hi ;<br />
BYTE toAdd = m_RegisterBC.lo ;</em></p>
<p><em>if (isCarrySet)<br />
toAdd++ ;</em></p>
<p><em>m_RegisterAF.hi += toAdd ;</em></p>
<p><em>if ((before + toAdd) &gt; 0xFF)<br />
SetCarryFlag() ;<br />
else<br />
ResetCarryFlag() ;</em></p>
<p><em>// code to work out the other flags </em></p></blockquote>
<p>Can you spot whats wrong with the above code?</p>
<p>Solution:<br />
At first glance this looks fine however think what would happen if register C was 0xFF? When the carry gets added the toAdd variable wraps back round to 0. So register a stays set to 0xFF which is correct, however the setting of the c flag never gets set. This was causing the following instruction in mortal kombat (jump if carry is set) to fail.</p>
<p>That took me ages to find!</p>
<p>However both mortal kombat and micro machines are playable. My main concern now is why half of the games I play suffer from graphic flicker&#8230;. Better get my debugger back out.</p>
<p>Fortunately this is the last of the big bugs that need debugging and then it&#8217;s on to sound emulation (oh joy). However the end feels just round the corner.</p>
<p>CS</p>
]]></content:encoded>
			<wfw:commentRss>http://codeslinger.co.uk/pages/blog/wordpress/?feed=rss2&amp;p=21</wfw:commentRss>
		</item>
		<item>
		<title>Testing does not prove the absence of bugs, only the presence</title>
		<link>http://codeslinger.co.uk/pages/blog/wordpress/?p=20</link>
		<comments>http://codeslinger.co.uk/pages/blog/wordpress/?p=20#comments</comments>
		<pubDate>Sun, 02 Nov 2008 18:25:11 +0000</pubDate>
		<dc:creator>codeslinger</dc:creator>
		
		<category><![CDATA[Sega Master System]]></category>

		<guid isPermaLink="false">http://codeslinger.co.uk/pages/blog/wordpress/?p=20</guid>
		<description><![CDATA[If any of you are writing a Z80 emulator then take it from me dont rely on zexall too much. If zexalls output says you have a bug then you most definately do. However if it says that the test went ok it doesnt mean that they are bug free.
I managed to fix a bug [...]]]></description>
			<content:encoded><![CDATA[<p>If any of you are writing a Z80 emulator then take it from me dont rely on zexall too much. If zexalls output says you have a bug then you most definately do. However if it says that the test went ok it doesnt mean that they are bug free.</p>
<p>I managed to fix a bug in my emulator without zexalls help which was causing a few games to display the background incorrectly. Mainly Lemmings and Land of Illusion. This bug has been haunting me for awhile so im quite relieved to have fixed it.</p>
<p>I have recently found out that some games run at the wrong speed with my emulator so after checking all my opcodes to see if they are emulating their cycles correctly I was left with the conclusion it must be an error with my vsync emultion. Sure enough I wasnt moving on to the next scanline quick enough which was causing too few vsync interrupts to occur which is one of the main way speed is controlled in games. This is now fixed (after a day of headache) and all games play at the correct speed ( or should I say all tested games? <img src='http://codeslinger.co.uk/pages/blog/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> )</p>
<p>Over the past few days I have also emulated the none maskable reset interrupt, the different screen resolution controlled by the current vdp mode and the codemasters mapper. Although the codemasters mapper is implemented correctly the majority of the games show issues with background rendering. However I believe this to be a problem with the background rendering routine rather than the mapper iteself because there is not much room for error with the mapper (compared to the sega mapper anyway).</p>
<p><img src="http://www.codeslinger.co.uk/pages/projects/mastersystem/images/lemmings.png" alt="" /></p>
<p>CS</p>
]]></content:encoded>
			<wfw:commentRss>http://codeslinger.co.uk/pages/blog/wordpress/?feed=rss2&amp;p=20</wfw:commentRss>
		</item>
		<item>
		<title>Checklist</title>
		<link>http://codeslinger.co.uk/pages/blog/wordpress/?p=19</link>
		<comments>http://codeslinger.co.uk/pages/blog/wordpress/?p=19#comments</comments>
		<pubDate>Wed, 29 Oct 2008 15:36:54 +0000</pubDate>
		<dc:creator>codeslinger</dc:creator>
		
		<category><![CDATA[Sega Master System]]></category>

		<guid isPermaLink="false">http://codeslinger.co.uk/pages/blog/wordpress/?p=19</guid>
		<description><![CDATA[I&#8217;m starting to come to the end of my master system emulator and thought it best to make a list of what needs  doing before I start writing the tutorials.
Easy:

All control pad buttons including player 2 (Implemented)

Correct Game Speed (Fixed)
Reset Interrupt (Fixed)
CodeMasters Mapper (Fixed)

Medium:

Zexall test completion (Fixed)

Speed optimizations (Implemented)

Render background correctly for larger screen res [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m starting to come to the end of my master system emulator and thought it best to make a list of what needs  doing before I start writing the tutorials.</p>
<p><strong>Easy:</strong></p>
<ul>
<li><span style="color: #000000;">All control pad buttons including player 2 (<strong>Implemented</strong>)<br />
</span></li>
<li><span style="color: #000000;">Correct Game Speed (<strong>Fixed</strong>)</span></li>
<li><span style="color: #000000;">Reset Interrupt (<strong>Fixed</strong>)</span></li>
<li><span style="color: #000000;">CodeMasters Mapper (<strong>Fixed</strong>)</span></li>
</ul>
<p><strong>Medium:</strong></p>
<ul>
<li><span style="color: #000000;">Zexall test completion (<strong>Fixed</strong>)<br />
</span></li>
<li><span style="color: #000000;">Speed optimizations (<strong>Implemented</strong>)<br />
</span></li>
<li><span style="color: #000000;">Render background correctly for larger screen res (<strong>Fixed</strong>)<br />
</span></li>
<li><span style="color: #000000;">Render mode 2 sprites correctly (<strong>Fixed</strong>)<br />
</span></li>
<li><span style="color: #000000;">Change screen res for codemaster games (<strong>Fixed</strong>)</span></li>
</ul>
<p><strong>Difficult:</strong></p>
<ul>
<li><span style="color: #000000;">Sound (<strong>Implemented</strong>)<br />
</span></li>
<li><span style="color: #000000;">Fix graphical bugs found in Land of Illusion, Lemmings (<strong>Fixed</strong>)</span></li>
<li><span style="color: #000000;">Fix bug Street Fighter (<strong>Fixed</strong>)</span></li>
<li><span style="color: #000000;">Find out why some roms dont show first screen (<strong>Fixed</strong>)</span></li>
<li><span style="color: #000000;">Fix bug in mortal kombat (<strong>Fixed</strong>)</span></li>
<li><span style="color: #000000;">Fix black graphic flicker in some games (<strong>Fixed</strong>)<br />
</span></li>
</ul>
<p>Whenever I fix one of these items I&#8217;ll edit this post and label them as fixed.</p>
<p>Doesn&#8217;t look too bad does it? <img src='http://codeslinger.co.uk/pages/blog/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>CS</p>
]]></content:encoded>
			<wfw:commentRss>http://codeslinger.co.uk/pages/blog/wordpress/?feed=rss2&amp;p=19</wfw:commentRss>
		</item>
	</channel>
</rss>

