<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4018600557724482326</id><updated>2026-08-07T06:56:06.122-07:00</updated><title type='text'>The art of emulation</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://emucode.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://emucode.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Ryan</name><uri>http://www.blogger.com/profile/13161303486072318544</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_aYI8XKQ7NZc/THxLCpZjWBI/AAAAAAAAABM/mHltonO0zSM/S220/center+swirl+blue+1600x1280.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>18</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4018600557724482326.post-2281601392590153270</id><published>2010-10-12T13:50:00.000-07:00</published><updated>2010-10-12T13:50:49.896-07:00</updated><title type='text'>Emulation resources</title><content type='html'>I just noticed that my bookmarks are beginning to get pretty substantial, and most of them are resources related to emulation. I&#39;ve been far and wide on the net looking for documentation so I&#39;ll post them here. I hope someone finds them useful, or even just interesting.&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;b&gt;Nes&amp;nbsp;&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
&lt;u&gt;&lt;b&gt;(Too many links to post here, i&#39;ll post the important ones, you can find Nes docs easy anyway)&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
&lt;a href=&quot;http://nocash.emubase.de/everynes.htm#ppudimensionstimings&quot;&gt;NES nocash docs&lt;/a&gt; &lt;br /&gt;
&lt;a href=&quot;http://www.obelisk.demon.co.uk/6502/reference.html&quot;&gt;6502 reference&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;&lt;u&gt;&lt;b&gt;Super Nintendo&lt;/b&gt;&lt;/u&gt;&lt;/div&gt;&lt;a href=&quot;http://www.westerndesigncenter.com/wdc/datasheets/Programmanual.pdf&quot;&gt;Programming the 65816 &lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://en.wikibooks.org/wiki/Category:Super_NES_Programming&quot;&gt;Snes programming tutorial&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://web.archive.org/web/20071111200111/http://www.geocities.com/Qwertie256/attic/snesemu/qsnesdoc.html&quot;&gt;Snes graphics documentation&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;b&gt;GB/GBA/DS&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
&lt;a href=&quot;http://nocash.emubase.de/gbatek.htm&quot;&gt;GBA &amp;amp; DS NO$ Docs GBATEK&lt;/a&gt; &lt;br /&gt;
&lt;a href=&quot;http://www.cc.gatech.edu/classes/AY2006/cs2260_spring/gbabook/GBA_11.pdf&quot;&gt;GBA_11.pdf (application/pdf Object)&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.coranac.com/tonc/text/asm.htm&quot;&gt;Tonc: Whirlwind Tour of ARM Assembly&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.heyrick.co.uk/assembler/&quot;&gt;ARM ASSEMBLER PROGRAMMING; tutorial, resources, and examples&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://infocenter.arm.com/help/topic/com.arm.doc.ddi0210c/DDI0210B.pdf&quot;&gt;ARM7TDMI Tech manual&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.eecs.umich.edu/%7Epanalyzer/pdfs/ARM_doc.pdf&quot;&gt;ARM7TDMI data sheet&lt;/a&gt; &lt;br /&gt;
&lt;a href=&quot;http://www.cs.rit.edu/%7Etjh8300/CowBite/CowBiteSpec.htm&quot;&gt;CowBite Virtual Harware Spec&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.aaronrogers.com/ham/Day1/day1.php&quot;&gt;GBA Game development&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://nocash.emubase.de/pandocs.htm&quot;&gt;GB/GBC Specs&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.mdh165.pwp.blueyonder.co.uk/docstuts/docstuts.htm&quot;&gt;Game dev&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.wss.co.uk/pinknoise/ARMinstrs/ARMinstrs.html&quot;&gt;ARM Instruction Formats and Timings&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;b&gt;Playstation 1&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
&lt;a href=&quot;http://gshi.org/faqs/PSX.txt&quot;&gt;Everything you ever wanted.. (html)&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://gshi.org/faqs/PSX.pdf&quot;&gt;Everything you ever wanted.. (pdf)&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;b&gt;Playstation 2&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.bringyou.to/games/PS2.htm&quot;&gt;Inside the Playstation 2: PS2 Architecture, Graphics Rendering and Programming&lt;/a&gt; &lt;br /&gt;
&lt;a href=&quot;http://lukasz.dk/files/rgreen_procedural_renderinggdc2001.pdf&quot;&gt;Procedural Rendering on Playstation&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://lukasz.dk/playstation-2-programming/an-introduction-to-ps2dev/&quot;&gt;An Introduction to PS2DEV « Lukasz.dk&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://users.ece.gatech.edu/lanterma/mpg/ece4893lec_ps2.pdf&quot;&gt;PlayStation 2 Architecture (pdf)&amp;nbsp; (takes ages to load)&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://arstechnica.com/hardware/reviews/2000/02/ee.ars/&quot;&gt;A Technical Overview of the Emotion Engine&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.philvaz.com/games/PS2Basics.pdf&quot;&gt;PS2 Basics&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.philvaz.com/games/PS2IOP.pdf&quot;&gt;PS2IOP&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.philvaz.com/games/PS2BMP1.pdf&quot;&gt;PS2BMP1.pdf (application/pdf Object)&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.gshi.org/vb/threads/3103-Win32-PS2-Dev.-Intro&quot;&gt;Win32 PS2 Dev. Intro&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://gshi.org/?s=downloads&quot;&gt;Downloads - GSHI&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://en.wikibooks.org/wiki/MIPS_Assembly&quot;&gt;MIPS Assembly &lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://gshi.org/faqs/VPUThesis.pdf&quot;&gt;VPU Thesis (pdf)&lt;/a&gt;&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;b&gt;Nintendo 64&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
&lt;a href=&quot;http://infrid.com/rcp64/documents.php&quot;&gt;RCP64, Nintendo 64 Machine&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.jimb.de/Projects/N64TEK.htm&quot;&gt;Nintendo 64 Specifications&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://infrid.com/rcp64/docfiles/n64maps.txt&quot;&gt;http://infrid.com/rcp64/docfiles/n64maps.txt&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://n64.icequake.net/&quot;&gt;Nintendo 64 Tech&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://futuretech.blinkenlights.nl/n64.html&quot;&gt;Nintendo64 Technical Information...&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;b&gt;Misc&lt;/b&gt;&lt;b&gt;&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.heyrick.co.uk/assembler/sanity.html&quot;&gt;Sanity Warning&amp;nbsp;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.emuwiki.com/index.php?title=Emulation_on_PC_%28DOS/Windows%29&quot;&gt;HUGE emulator list and sources etc&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://nocash.emubase.de/&quot;&gt;NO$FUN (All NO$ docs)&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Peace</content><link rel='replies' type='application/atom+xml' href='http://emucode.blogspot.com/feeds/2281601392590153270/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://emucode.blogspot.com/2010/10/emulation-resources.html#comment-form' title='18 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/2281601392590153270'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/2281601392590153270'/><link rel='alternate' type='text/html' href='http://emucode.blogspot.com/2010/10/emulation-resources.html' title='Emulation resources'/><author><name>Ryan</name><uri>http://www.blogger.com/profile/13161303486072318544</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_aYI8XKQ7NZc/THxLCpZjWBI/AAAAAAAAABM/mHltonO0zSM/S220/center+swirl+blue+1600x1280.png'/></author><thr:total>18</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4018600557724482326.post-2069967922222370656</id><published>2010-10-10T07:25:00.000-07:00</published><updated>2010-10-12T14:24:35.418-07:00</updated><title type='text'>Be careful what you click!</title><content type='html'>This is not related&amp;nbsp; to emulation, but I feel that it&#39;s something that needs to be said. I think that Microsoft should do something about this huge weakness I have found in their operating system!&lt;br /&gt;
&lt;br /&gt;
I hate viruses, most of us do, which is why I thought I&#39;d have a try at writing one... just to see how easy it was for people to write malicious software. Turns out, it is very easy with just some basic coding knowledge.&lt;br /&gt;
&lt;br /&gt;
In my opinion, the most destructive malware would be malware that deletes information from your computer, and what better information to delete from your computer than the Master Boot Record. For those who don&#39;t know what the MBR is, it is a small peice of code (512 bytes) that lies at sector 0 of your boot disk. This is the sector that the BIOS loads into memory for immediate execution after the post screen. It essentially boots up your operating system and usually loads the kernel and jumps to it. Without a valid Master Boot Record, your entire operating system is useless, removing the MBR effectively renders your OS useless, and unbootable.&lt;br /&gt;
&lt;br /&gt;
However, there are steps you can take to repair your MBR, infact, it&#39;s very easy in modern operating systems like Vista or Windows 7. You just insert the Windows 7 system disk, and repair your operating system, however, if you do not know how to do this, or you have an older OS like XP, you are pretty screwed.&lt;br /&gt;
&lt;br /&gt;
Which brings me on to this software I wrote. The virus I wrote (which I will never be using maliciously of course), replaces your MBR with my own custom MBR, which prints a little message to the screen instead of loading your OS. Keep in mind that I have created a few safe guards to make sure that I didn&#39;t click it by accident, I created some &quot;Are you sure&quot; messageboxes just to be safe, but if I took these away, this software would be very dangerous.&lt;br /&gt;
&lt;br /&gt;
The executable needs to be run as adminstrator, but this is hardly much of a safe guard, as most users would probably be logged on as admin anyway.&lt;br /&gt;
&lt;br /&gt;
I won&#39;t release this software or source code for now, unless anyone specifically asks for it, because there is always the chance that it could be used maliciously. It is however a very small file, and the source is very small, so be careful what you click.. or you might just get your MBR deleted. The Windows 7 and Vista UAC doesn&#39;t seem like such a bad thing to me anymore...</content><link rel='replies' type='application/atom+xml' href='http://emucode.blogspot.com/feeds/2069967922222370656/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://emucode.blogspot.com/2010/10/be-careful-what-you-click.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/2069967922222370656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/2069967922222370656'/><link rel='alternate' type='text/html' href='http://emucode.blogspot.com/2010/10/be-careful-what-you-click.html' title='Be careful what you click!'/><author><name>Ryan</name><uri>http://www.blogger.com/profile/13161303486072318544</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_aYI8XKQ7NZc/THxLCpZjWBI/AAAAAAAAABM/mHltonO0zSM/S220/center+swirl+blue+1600x1280.png'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4018600557724482326.post-4707452421438840955</id><published>2010-10-09T05:28:00.000-07:00</published><updated>2010-10-12T14:24:29.990-07:00</updated><title type='text'>PS2 Development</title><content type='html'>For ages now, I&#39;ve wanted to develop my own programs/games for the PS2, and up untill today, I&#39;ve had no luck in finding a straight forward, up to date enough tutorial. For anyone interested in PS2 dev, I would highly recommened &lt;a href=&quot;http://www.gshi.org/vb/threads/3103-Win32-PS2-Dev.-Intro&quot;&gt;this&lt;/a&gt; guide, and the pre-compiled PS2SDK mentioned in the tutorial, from &lt;a href=&quot;http://gshi.org/?s=downloads#section18&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
You can use the PCSX2 to run the resulting ELF files, on the file menu, &quot;Open ELF file&quot;.&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
Well, that&#39;s about all I have to say about that, I will be hopefully posting updates on my own emulators, although I have so much left to do.&lt;br /&gt;
&lt;br /&gt;
Peace</content><link rel='replies' type='application/atom+xml' href='http://emucode.blogspot.com/feeds/4707452421438840955/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://emucode.blogspot.com/2010/10/ps2-development.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/4707452421438840955'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/4707452421438840955'/><link rel='alternate' type='text/html' href='http://emucode.blogspot.com/2010/10/ps2-development.html' title='PS2 Development'/><author><name>Ryan</name><uri>http://www.blogger.com/profile/13161303486072318544</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_aYI8XKQ7NZc/THxLCpZjWBI/AAAAAAAAABM/mHltonO0zSM/S220/center+swirl+blue+1600x1280.png'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4018600557724482326.post-211075007061297594</id><published>2010-09-17T12:12:00.000-07:00</published><updated>2010-09-17T12:12:33.896-07:00</updated><title type='text'>GBA emulator progress</title><content type='html'>Progress with my GBA emulator is going relatively slow, as this is a much bigger project than I realised. Emulating the CPU is probably the hardest task and is taking ages, but I&#39;m getting there, one opcode at a time.&lt;br /&gt;
&lt;br /&gt;
As of next week, I am going to be studying 5 days a week, and also on the weekends, so I probably won&#39;t be working on my emulator, or updating my blog as much, so I apologise in advanced for any long absenses from me. I have to do well this year in my college so I can get into university, so I will obviously proritise that over my hobbies and and such.&lt;br /&gt;
&lt;br /&gt;
Anyway, thanks everyone for reading, more to come soon.&lt;br /&gt;
&lt;br /&gt;
Peace</content><link rel='replies' type='application/atom+xml' href='http://emucode.blogspot.com/feeds/211075007061297594/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://emucode.blogspot.com/2010/09/gba-emulator-progress.html#comment-form' title='15 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/211075007061297594'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/211075007061297594'/><link rel='alternate' type='text/html' href='http://emucode.blogspot.com/2010/09/gba-emulator-progress.html' title='GBA emulator progress'/><author><name>Ryan</name><uri>http://www.blogger.com/profile/13161303486072318544</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_aYI8XKQ7NZc/THxLCpZjWBI/AAAAAAAAABM/mHltonO0zSM/S220/center+swirl+blue+1600x1280.png'/></author><thr:total>15</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4018600557724482326.post-2077761262525028017</id><published>2010-09-13T17:45:00.000-07:00</published><updated>2010-09-13T17:57:40.612-07:00</updated><title type='text'>Emulation - what&#39;s the point?</title><content type='html'>Alot of people ask the question, &quot;why bother writing emulators? why emulate a system when you can own the original?&quot; etc... The motivation behind it is obviously going to be different for everyone, but I&#39;ll try to convey my reasons for (attempting) to write emulators, successfully or usuccessfully. &lt;b&gt;Be aware that these are my personal opinions and motivation, there are obvious real advantages to emulators, such as using them to test games that are being written for a system that requires some sort of media, such as CD/DVD&#39;s or cartridges to be written to. There are many other reasons though, such as virtualization of operating systems, you know, Virtual PC, VMware etc...&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
First of all, let me just state that in my opinion, writing emulators is not the most rewarding hobby if you want to see immediate results and get immediate satisfaction, it takes alot of work to get any tangable output from an emulator. For me, this in itself is good motivation, as when you do get something working in an emulator, it feels much more rewarding, like you&#39;ve really achieved something.&lt;br /&gt;
&lt;br /&gt;
The other reasons why I try to write emulators are simple, I enjoy programming, I enjoy games, and I enjoy learning exactly what makes computers &quot;tick&quot;, put all those together, and emulation seems the perfect hobby for me, which it is. Sometimes it is maddening, sometimes it makes your brain hurt, but these are all things which are necessary sacrifices.&lt;br /&gt;
&lt;br /&gt;
The final reason is that I find the emulation scene very attractive, and one day, i hope to write (or atleast contribute to) an emulator that will actually be useful to someone, and not just a learning project for me. I look up to the authors of all emulators, but especially ones like the PCSX2, and Dolphin. One day, maybe I&#39;ll be knowledgable enough to do something to help out... *bwwwww*&lt;br /&gt;
&lt;br /&gt;
At the end of the day, i do it because i personally find it fun, i would imagine that all emulator authors feel the same way, or else we wouldn&#39;t seen such an amazing amount of them out there today. I remember seeing a thread on the PCSX2 site, stating reasons why the authors chose to write the PCSX2, they said that they wanted to prove that PS2 emulation was possible, and they succeeded in that i think we all agree, but i digress.&lt;br /&gt;
&lt;br /&gt;
Peace</content><link rel='replies' type='application/atom+xml' href='http://emucode.blogspot.com/feeds/2077761262525028017/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://emucode.blogspot.com/2010/09/emulation-whats-point.html#comment-form' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/2077761262525028017'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/2077761262525028017'/><link rel='alternate' type='text/html' href='http://emucode.blogspot.com/2010/09/emulation-whats-point.html' title='Emulation - what&#39;s the point?'/><author><name>Ryan</name><uri>http://www.blogger.com/profile/13161303486072318544</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_aYI8XKQ7NZc/THxLCpZjWBI/AAAAAAAAABM/mHltonO0zSM/S220/center+swirl+blue+1600x1280.png'/></author><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4018600557724482326.post-1419733941537181080</id><published>2010-09-10T17:03:00.000-07:00</published><updated>2010-09-10T17:35:11.909-07:00</updated><title type='text'>Motivation</title><content type='html'>I have a question for all you readers, as this is something that I seem to be struggling with recently. &lt;b&gt;What keeps you motivated and focused?&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
It seems that i am not alone in this problem, I think it&#39;s fairly common amongst programmers for their mind to wonder every now and then. What keeps you motivated?&lt;br /&gt;
&lt;br /&gt;
Of course I&#39;m talking about anyone here, not just programmers.</content><link rel='replies' type='application/atom+xml' href='http://emucode.blogspot.com/feeds/1419733941537181080/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://emucode.blogspot.com/2010/09/motivation.html#comment-form' title='23 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/1419733941537181080'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/1419733941537181080'/><link rel='alternate' type='text/html' href='http://emucode.blogspot.com/2010/09/motivation.html' title='Motivation'/><author><name>Ryan</name><uri>http://www.blogger.com/profile/13161303486072318544</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_aYI8XKQ7NZc/THxLCpZjWBI/AAAAAAAAABM/mHltonO0zSM/S220/center+swirl+blue+1600x1280.png'/></author><thr:total>23</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4018600557724482326.post-3242332190901462864</id><published>2010-09-08T09:24:00.000-07:00</published><updated>2010-09-08T09:24:42.040-07:00</updated><title type='text'>Another blog</title><content type='html'>I just added a new blog page, which will be for posting (C++) code snippets, but I may post some tutorials too. The link is at the top of the page in the top menu bar, below the title. Hope it&#39;s useful to someone, enjoy :)&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://cppcodesnippets.blogspot.com/&quot;&gt;Code Snippets&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://emucode.blogspot.com/feeds/3242332190901462864/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://emucode.blogspot.com/2010/09/another-blog.html#comment-form' title='22 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/3242332190901462864'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/3242332190901462864'/><link rel='alternate' type='text/html' href='http://emucode.blogspot.com/2010/09/another-blog.html' title='Another blog'/><author><name>Ryan</name><uri>http://www.blogger.com/profile/13161303486072318544</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_aYI8XKQ7NZc/THxLCpZjWBI/AAAAAAAAABM/mHltonO0zSM/S220/center+swirl+blue+1600x1280.png'/></author><thr:total>22</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4018600557724482326.post-7792965898964438702</id><published>2010-09-06T13:24:00.000-07:00</published><updated>2010-09-06T13:52:02.558-07:00</updated><title type='text'>Playstation 3 emulation?</title><content type='html'>Ok, so this I&#39;m just about sick of videos like &lt;a href=&quot;http://www.youtube.com/watch?v=qhyKMozFtQ0&quot;&gt;this&lt;/a&gt;, and &lt;a href=&quot;http://www.youtube.com/watch?v=l9sMMOCN6uM&amp;amp;feature=related&quot;&gt;this&lt;/a&gt;. Your average coder can tell you straight off the bat that these are obviously fakes, but is PS3 emulation really feasable at the moment, or even possible? The short answer is &lt;u&gt;&lt;b&gt;NO&lt;/b&gt;&lt;/u&gt;. Xbox 360 emulation and PS3 emulation is just not going to happen yet, for various reason which I will now go over briefly. (Note that these are my just my opinions, if you want better answers, then google the subject.)&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;&lt;b&gt;These threads on the PCSX2 site. &lt;a href=&quot;http://forums.pcsx2.net/Thread-PCSX3--15534&quot;&gt;here&lt;/a&gt;, &lt;a href=&quot;http://forums.pcsx2.net/Thread-pcsx3&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;http://forums.pcsx2.net/Thread-PS3-emu-will-ever-exists&quot;&gt;here&lt;/a&gt;.&amp;nbsp;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Any software emulator automatically takes on alot of overhead compared to the original console or system. This is simply the limitations of software.&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;The PS3 has many different chips, which will all have to be emulated in sequence, unlike the PS3 which of course runs all the chips at the same time. For example, an emulator might run a scanlines worth of clock cycles, then emulate the graphics, then the sound... you see?&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;The PS3 uses a Cell&lt;/b&gt; &lt;b&gt;Processor with a PowerPC-base Core @3.2GHzper core. This CPU also have 7 cores. In an emulator, I can&#39;t even begin to think what kinda of techincal difficulties this would entail. Generally speaking, you will require a 10x faster CPU to emulate the CPU in question, but I think this is an extremely generous figure, the reality if probably FAR worse emulating the PS3.&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Lack of documentation, people have only just started to hack the memory of the PS3.&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Many more reasons which i do not know yet.&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
The people that make fake videos on PS3 and xbox 360 emulation are more often than not just attention seeking, sometimes, you get a person who genuinely thinks they have a PS3 emulator, and for some reason, it won&#39;t work... hmmm.. can&#39;t imagine why. &lt;a href=&quot;http://www.youtube.com/watch?v=JugKeJUyH30&amp;amp;feature=related&quot;&gt;Here&lt;/a&gt; for example&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://rombiosemulator.blogspot.com/2010/06/ps3-emulator-working.html&quot;&gt;Here&lt;/a&gt; is an &quot;interesting&quot; blog I found that claims that he has a working PS3 emulator... i am disappoint if anyone believes him. I dunno, i guess some people will believe anything.&lt;br /&gt;
&lt;br /&gt;
I just want to add that the fake ps3 emulators that arn&#39;t viruses may seem harmless, but in my opinion, it is quite insulting to the people that spend alot of time writing real emulators like the PCSX2 and Dolphin, and giving all their hard work away for free. It detracts from the emulation scene and makes a mockery of it... maybe I&#39;m over reacting, i dunno, but either way, it&#39;s pretty insulting to the effort made by emu authors.&lt;br /&gt;
&lt;br /&gt;
Here is a short, not very good video I made a while back exposing a forged PS3 emulator, it&#39;s pretty over the top but I hope it gives the message I wanted it to, PS3 emulation is not happening yet!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;object height=&quot;385&quot; width=&quot;480&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/Zs1mMOQUU4Q?fs=1&amp;amp;hl=en_GB&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/Zs1mMOQUU4Q?fs=1&amp;amp;hl=en_GB&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;480&quot; height=&quot;385&quot;&gt;&lt;/embed&gt;&lt;/object&gt;</content><link rel='replies' type='application/atom+xml' href='http://emucode.blogspot.com/feeds/7792965898964438702/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://emucode.blogspot.com/2010/09/playstation-3-emulation.html#comment-form' title='17 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/7792965898964438702'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/7792965898964438702'/><link rel='alternate' type='text/html' href='http://emucode.blogspot.com/2010/09/playstation-3-emulation.html' title='Playstation 3 emulation?'/><author><name>Ryan</name><uri>http://www.blogger.com/profile/13161303486072318544</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_aYI8XKQ7NZc/THxLCpZjWBI/AAAAAAAAABM/mHltonO0zSM/S220/center+swirl+blue+1600x1280.png'/></author><thr:total>17</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4018600557724482326.post-9083676460923976218</id><published>2010-09-05T23:17:00.000-07:00</published><updated>2010-09-05T23:27:11.966-07:00</updated><title type='text'>Decoding the ARM instruction set</title><content type='html'>I haven&#39;t got far myself in decoding the ARM instruction set, but I have the basic idea, so I&#39;ll share it with anyone who&#39;s remotely interested. In writing this, I&#39;m assuming you have a base knowledge about the ARM processor and you have studied the instruction sets. This will only just scratch the surface of the ARM instruction set, basically, it will give you a logical pattern to follow that can be used to decode the entire instruction set.&lt;br /&gt;
&lt;br /&gt;
Unlike THUMB instructions, each ARM instruction is a full 32 bits, so decoding each instruction is a bit more complex, but not that much. First of all, take a look at the binary opcode format for an ARM instruction. &lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixbuZVCuduZXyNv2XZnMtybEVm1Bi-3EzWNvmJ8gY24oqguOBg-1-jpfTfXT5kAGoHTrwL_OzHWjIAp9PEVCc1j4P6vxRwVCNAtPAndJdik3YJUY1P5aX_t1PGWps13ijH7iZgedCSoQ/s1600/Untitled.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;324&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixbuZVCuduZXyNv2XZnMtybEVm1Bi-3EzWNvmJ8gY24oqguOBg-1-jpfTfXT5kAGoHTrwL_OzHWjIAp9PEVCc1j4P6vxRwVCNAtPAndJdik3YJUY1P5aX_t1PGWps13ijH7iZgedCSoQ/s400/Untitled.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
This reference isn&#39;t completely accurate though, it does miss some important details which we will need to decode the first instruction and which I&#39;ll go over soon.&lt;br /&gt;
&lt;br /&gt;
So, to start off with, when we decoded the THUMB instruction set, we were simply using the upper 8 bits of the instruction, which allowed us to unambiguously decode the instruction. This time however, things are a little harder... let&#39;s say we took bits 27-20, and tried to figure out which instruction it is, this would be ambiguous, as more than one type of instruction can easilly have all of bits 27-20 unset (0). So, what we are going to do is take the high 8 bits (bits 27-20) and the base 4 bits (bits 7-4), and add them end to end. Here&#39;s a picture that should demonstrate the principle a little better.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEix6wuRL67XFzZFQIUSP5LNLP0HhEwIwtfSe3Ha54tw-WESE8wVjqD5WFb-xuV-jsS_0tMxNRYgfT69zcAUftP4WiVA1WiMqKcK_G8Xs5Z7QP3bLhxM4sUUOPqNU5ReSy1SEfh5DXSq_g/s1600/Untitled.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;166&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEix6wuRL67XFzZFQIUSP5LNLP0HhEwIwtfSe3Ha54tw-WESE8wVjqD5WFb-xuV-jsS_0tMxNRYgfT69zcAUftP4WiVA1WiMqKcK_G8Xs5Z7QP3bLhxM4sUUOPqNU5ReSy1SEfh5DXSq_g/s400/Untitled.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
In C/C++, to actually retrieve this value, you just need to to a bit of bitwise finicking. For example.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;u32 instruction = fetch();&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;u16 _12Bits = (((instruction &amp;gt;&amp;gt; 16) &amp;amp; 0xFF0) | ((instruction &amp;gt;&amp;gt; 4) &amp;amp; 0x0F));&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
So now we have a 12 bit number that we are going to use to decode the instruction. Let&#39;s start from the beginning.&lt;br /&gt;
&lt;br /&gt;
What if this 12 bit number was 0, ie every bit was unset. By looking at the opcode format, you can see that there is only 1 instruction format that allows this, the &quot;Data processing / PSR&quot; instructions. Now, already we know what type of instruction this is, but we need more info to see exactly what instruction it is. In the &quot;Data processing / PSR&quot; format, you see an &quot;Operand 2&quot; field. This field has a format that is not shown in the binary opcode format above, here is the specifications for the operand 2 field.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRycNoZtqhvR6MdC3kzC6YCT-wzYgCPogfcbEZxH_dBclCB5ijrhQNRhwkOeIQ3oDGhE1Cc23C0Ae0w5RYIZYyUVJEE8LGIvCjcvNCWc3MV1vxnnm7-bDVJf0uR20N7IILBHMnM7MVNg/s1600/Untitled.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRycNoZtqhvR6MdC3kzC6YCT-wzYgCPogfcbEZxH_dBclCB5ijrhQNRhwkOeIQ3oDGhE1Cc23C0Ae0w5RYIZYyUVJEE8LGIvCjcvNCWc3MV1vxnnm7-bDVJf0uR20N7IILBHMnM7MVNg/s400/Untitled.png&quot; width=&quot;390&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
In our circumstance, the &quot;immediate&quot; bit (bit 25) is not set (all bits are zero, remember), so that means that we are using a shifted register. (I wont go into barrel shifts at the moment, this is beyond the scope of this.... you know the drill...). Here is a more formal way of putting it, straight from the manual.&lt;br /&gt;
&lt;blockquote style=&quot;color: blue;&quot;&gt;&quot;When the second operand is specified to be a shifted register, the operation of the&lt;br /&gt;
barrel shifter is controlled by the Shift field in the instruction.&quot;&lt;/blockquote&gt;&amp;nbsp; The shift field format is as follows...&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1qWvDG0JCKJ45uViKYF3q8dMBEzrJVJj0qUTzQp4r_l9jOo8vCym2MOJZB1G_iK6CksH-SQfZ8ViBv_Kgw7w9gz4ZXiBUIuoK4UVMFFcWJfSj_-3rvGVlFlmDdy0G_pyhlrtyyOdplQ/s1600/Untitled.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;137&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1qWvDG0JCKJ45uViKYF3q8dMBEzrJVJj0qUTzQp4r_l9jOo8vCym2MOJZB1G_iK6CksH-SQfZ8ViBv_Kgw7w9gz4ZXiBUIuoK4UVMFFcWJfSj_-3rvGVlFlmDdy0G_pyhlrtyyOdplQ/s400/Untitled.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
I know this is all very complicated, but it is best that you read &lt;a href=&quot;http://www.eecs.umich.edu/%7Epanalyzer/pdfs/ARM_doc.pdf&quot;&gt;the manual&lt;/a&gt; to get a better grasp of what the hell I&#39;m going on about.&lt;br /&gt;
&lt;br /&gt;
Anyway, stay with me now! Let&#39;s go through what we have gathered about this instruction so far... assuming that all our 12 bits are 0 that is...&lt;br /&gt;
&lt;ol&gt;&lt;li&gt; &lt;b&gt;This is a Data Processing instruction. &lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;It uses a shifted register barrel shift operation.&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;It is an AND instruction (opcode is bits 24-21).&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Bit 4 is 0, so this must be a shift operation that shifts the shifted register by an immediate value, hence, uses the first shift field format (format to the right of the above picture).&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;The entire shifted register field is 0, so this shift operation must be a&amp;nbsp; &lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;This does your head in if you think about it too much...&lt;/b&gt;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;So, by process of elimination, this instruction must be... *drumroll*&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;background-color: white; color: red;&quot;&gt;AND Rd, Rn, Rm, LSL #imm5&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
This instruction does the following.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;b&gt;Logically shift Rm left (LSL) by an immediate 5 bit value.&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Logically AND Rn with Rm&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Store the result in Rd&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;Anyway, to conclude, I hope this was informative in some way, even if you didn&#39;t know what I was rambling on about. Next time you look at a GBA or GBA emulator, think about what&#39;s going on inside, it&#39;s like &quot;Whoaaa&quot;... imo&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;EDIT: Forgot to mention the condition codes...&amp;nbsp;&lt;/u&gt;&lt;br /&gt;
Every ARM instruction can be executed conditionally, and bits 28 to 31 specify the condition that this instruction executes under. For more info, check out &lt;a href=&quot;http://www.eecs.umich.edu/%7Epanalyzer/pdfs/ARM_doc.pdf&quot;&gt;the manual&lt;/a&gt;, no point in me making is even harder to understand than it already is.&lt;br /&gt;
&lt;br /&gt;
Peace</content><link rel='replies' type='application/atom+xml' href='http://emucode.blogspot.com/feeds/9083676460923976218/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://emucode.blogspot.com/2010/09/decoding-arm-instruction-set.html#comment-form' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/9083676460923976218'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/9083676460923976218'/><link rel='alternate' type='text/html' href='http://emucode.blogspot.com/2010/09/decoding-arm-instruction-set.html' title='Decoding the ARM instruction set'/><author><name>Ryan</name><uri>http://www.blogger.com/profile/13161303486072318544</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_aYI8XKQ7NZc/THxLCpZjWBI/AAAAAAAAABM/mHltonO0zSM/S220/center+swirl+blue+1600x1280.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixbuZVCuduZXyNv2XZnMtybEVm1Bi-3EzWNvmJ8gY24oqguOBg-1-jpfTfXT5kAGoHTrwL_OzHWjIAp9PEVCc1j4P6vxRwVCNAtPAndJdik3YJUY1P5aX_t1PGWps13ijH7iZgedCSoQ/s72-c/Untitled.png" height="72" width="72"/><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4018600557724482326.post-4860842744319664264</id><published>2010-09-04T12:48:00.000-07:00</published><updated>2010-09-04T12:48:10.337-07:00</updated><title type='text'>Check this video out</title><content type='html'>This isn&#39;t necessarily about coding, but I thought this was the best &lt;a href=&quot;http://en.wikipedia.org/wiki/Tool-assisted_speedrun&quot;&gt;TAS&lt;/a&gt; video I have ever seen, I had to post it. I found it on someone elses blog so excuse me if you feel I&#39;ve ripped the idea from you, it&#39;s just so awesome.&lt;br /&gt;
&lt;br /&gt;
Enjoy&lt;br /&gt;
&lt;br /&gt;
&lt;object width=&quot;480&quot; height=&quot;385&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/ztVgZm0ht7w?fs=1&amp;amp;hl=en_GB&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/ztVgZm0ht7w?fs=1&amp;amp;hl=en_GB&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;480&quot; height=&quot;385&quot;&gt;&lt;/embed&gt;&lt;/object&gt;</content><link rel='replies' type='application/atom+xml' href='http://emucode.blogspot.com/feeds/4860842744319664264/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://emucode.blogspot.com/2010/09/check-this-video-out.html#comment-form' title='21 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/4860842744319664264'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/4860842744319664264'/><link rel='alternate' type='text/html' href='http://emucode.blogspot.com/2010/09/check-this-video-out.html' title='Check this video out'/><author><name>Ryan</name><uri>http://www.blogger.com/profile/13161303486072318544</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_aYI8XKQ7NZc/THxLCpZjWBI/AAAAAAAAABM/mHltonO0zSM/S220/center+swirl+blue+1600x1280.png'/></author><thr:total>21</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4018600557724482326.post-3244523486781974103</id><published>2010-09-03T14:10:00.000-07:00</published><updated>2010-09-03T14:10:38.713-07:00</updated><title type='text'>Keeping this updated</title><content type='html'>Sorry about not posting for a couple of days, but I&#39;ve been trying to figure out something decent to post, rather than just some random brain fart that comes into my mind. I have however updated my emulator review blogs, check them out, I&#39;ll keep em&#39; coming.&lt;br /&gt;
&lt;br /&gt;
When I get further along in the development of my GBA emulator, I&#39;ll be sure to post the progress. As of yet though, there is little to report, as I&#39;ve been a little busy with some other stuff recently. Sometimes soon, I will make a small post of how I decode the ARM instruction set, hopefully this will be of use to someone, but it might not be much of an interest to people not interested in GBA emulator development. &lt;br /&gt;
&lt;br /&gt;
Anyway, this was just an update to show my dedication. Keep checking up on me for more if you&#39;re interested. If anyone has any specific things that they think I should blog about  relating to emulators and coding, I&#39;ll be happy to take them into consideration. I was thinking maybe a specific tutorial on how to write an emulator, a small emulator like the Chip8 maybe. Not sure.&lt;br /&gt;
&lt;br /&gt;
In the mean time, here&#39;s the start of a great computer science course on youtube that you might want to check out, if you&#39;re into computer science that is.&lt;br /&gt;
&lt;object width=&quot;480&quot; height=&quot;385&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/hE7l6Adoiiw?fs=1&amp;amp;hl=en_GB&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/hE7l6Adoiiw?fs=1&amp;amp;hl=en_GB&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;480&quot; height=&quot;385&quot;&gt;&lt;/embed&gt;&lt;/object&gt;</content><link rel='replies' type='application/atom+xml' href='http://emucode.blogspot.com/feeds/3244523486781974103/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://emucode.blogspot.com/2010/09/keeping-this-updated.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/3244523486781974103'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/3244523486781974103'/><link rel='alternate' type='text/html' href='http://emucode.blogspot.com/2010/09/keeping-this-updated.html' title='Keeping this updated'/><author><name>Ryan</name><uri>http://www.blogger.com/profile/13161303486072318544</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_aYI8XKQ7NZc/THxLCpZjWBI/AAAAAAAAABM/mHltonO0zSM/S220/center+swirl+blue+1600x1280.png'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4018600557724482326.post-5584378892732770060</id><published>2010-09-01T22:47:00.000-07:00</published><updated>2010-09-01T22:48:25.317-07:00</updated><title type='text'>A new blog</title><content type='html'>I just started another blog which will be dedicated to reviewing emulators. If you&#39;re feeling nostalgic about the old games you used to play, you should check it out from time to time. You can find it here.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://emulatorreviews.blogspot.com/&quot;&gt;http://emulatorreviews.blogspot.com/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&quot;Emulation and Coding&quot; will remain my main blog, but I&#39;ll keep both updated regularly.&lt;br /&gt;
Hope you like it.&lt;br /&gt;
&lt;br /&gt;
Peace</content><link rel='replies' type='application/atom+xml' href='http://emucode.blogspot.com/feeds/5584378892732770060/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://emucode.blogspot.com/2010/09/new-blog.html#comment-form' title='31 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/5584378892732770060'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/5584378892732770060'/><link rel='alternate' type='text/html' href='http://emucode.blogspot.com/2010/09/new-blog.html' title='A new blog'/><author><name>Ryan</name><uri>http://www.blogger.com/profile/13161303486072318544</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_aYI8XKQ7NZc/THxLCpZjWBI/AAAAAAAAABM/mHltonO0zSM/S220/center+swirl+blue+1600x1280.png'/></author><thr:total>31</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4018600557724482326.post-3911765462080076730</id><published>2010-08-31T11:16:00.000-07:00</published><updated>2010-08-31T16:55:29.827-07:00</updated><title type='text'>Setting up an OpenGL texture for emulation</title><content type='html'>In this post, I will describe how I render graphics in my emulators using OpenGL, although, the idea of drawing to textures applies to any modern graphics library.&lt;br /&gt;
&lt;br /&gt;
I interface the Windows API and OpenGL to create a GUI that I can render graphics to. To render the graphics, I create a texture in the following way.&lt;br /&gt;
&lt;br /&gt;
// create a texture &lt;br /&gt;
glTexImage2D(GL_TEXTURE_2D, 0, 3, x_res, y_res, 0, GL_RGB, GL_UNSIGNED_BYTE, screenData);&lt;br /&gt;
&lt;br /&gt;
// set up the texture&lt;br /&gt;
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);&lt;br /&gt;
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);&lt;br /&gt;
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);&lt;br /&gt;
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
and update the texture like this&lt;br /&gt;
&lt;br /&gt;
// Update texture&lt;br /&gt;
glTexSubImage2D(GL_TEXTURE_2D, 0 ,0, 0, NTSC_WIDTH, NTSC_HEIGHT, GL_RGB, GL_UNSIGNED_BYTE, screenData);&lt;br /&gt;
&lt;br /&gt;
The pixel buffer i use is a 3 dimensional array, which is layed out in the following way.&lt;br /&gt;
&lt;br /&gt;
u8 screenData[y][x][3]; &lt;br /&gt;
&lt;br /&gt;
The last 3 being the RGB value for each pixel&lt;br /&gt;
So, lets say I wanted to draw a blue pixel at coords(X:10, Y:15), i would do something like this.&lt;br /&gt;
&lt;br /&gt;
// Draw blue pixel&lt;br /&gt;
screenData[15][10][0] = 0;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; // R&lt;br /&gt;
screenData[15][10][1] = 0;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // G&lt;br /&gt;
screenData[15][10][2] = 255;&amp;nbsp;&amp;nbsp;&amp;nbsp; // B&lt;br /&gt;
&lt;br /&gt;
I wont&#39; explain too much more, instead, I&#39;ll provide the source to a small program I created to show you, which can be download from the following link. It can be compiled with Visual C++ 2010. This program creates a texture and draws some pixels to it, and also stretches the scene depending on the width and height of the window and creates a small menu, just for the sake of it.&lt;br /&gt;
&lt;a href=&quot;http://www.blogger.com/goog_68592261&quot;&gt;&lt;br /&gt;
&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.2shared.com/file/1STD7k4U/send.html&quot;&gt;Download here.&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
You will notice that in my DrawScene() function, I rotate and texture, this is because by default the bottom left is coord 0,0, when i want the top left to be 0,0. &lt;br /&gt;
&lt;br /&gt;
If link goes down, make me aware please.&lt;br /&gt;
Peace</content><link rel='replies' type='application/atom+xml' href='http://emucode.blogspot.com/feeds/3911765462080076730/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://emucode.blogspot.com/2010/08/setting-up-opengl-texture-for-emulation.html#comment-form' title='21 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/3911765462080076730'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/3911765462080076730'/><link rel='alternate' type='text/html' href='http://emucode.blogspot.com/2010/08/setting-up-opengl-texture-for-emulation.html' title='Setting up an OpenGL texture for emulation'/><author><name>Ryan</name><uri>http://www.blogger.com/profile/13161303486072318544</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_aYI8XKQ7NZc/THxLCpZjWBI/AAAAAAAAABM/mHltonO0zSM/S220/center+swirl+blue+1600x1280.png'/></author><thr:total>21</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4018600557724482326.post-3823784681730746814</id><published>2010-08-31T08:20:00.000-07:00</published><updated>2010-10-12T10:10:33.248-07:00</updated><title type='text'>How emulators work</title><content type='html'>&lt;div style=&quot;background-color: white; color: black;&quot;&gt;In this post, I&#39;ll attempt to explain how emulators fundamentally work.&lt;/div&gt;&lt;br /&gt;
&lt;u&gt;&lt;b&gt;The legalities &lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
In general, writing an emulator is considered legal, as long as it&#39;s is all your work and all the documentation has been gathered legally, but spreading copyrighted work such as ROMs is highly illegal and I will not provide download links, so please, don&#39;t ask. &lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;b&gt;Different methods of emulating a system&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
The CPU of any system is pretty much the most important part, it is essentially the brain of the system, assuming the system doesn&#39;t have two or more brains (co processors), so your emulator will be based around the CPU core you write. To write a CPU emulator, you need to first understand how a CPU works. A CPU works on the basis of fetch, decode, execute.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;b&gt;Fetch:&lt;/b&gt; &lt;i&gt;Retrieve the instruction from memory.&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Decode:&lt;/b&gt; &lt;i&gt;Figure out what the instruction is, this may be simple in an older 8 bit CPU.&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Execute:&lt;/b&gt;&lt;i&gt; Execute the instruction and write back any resulting values etc...&lt;/i&gt;&lt;/li&gt;
&lt;/ul&gt;To emulate this process, we can use a few different methods. &lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;b&gt;Interpreter &lt;/b&gt;&lt;br /&gt;
An interpreter is the most popular method of emulating chips such as CPU&#39;s inside systems.&lt;b&gt; &lt;/b&gt;Here is the basic way that an interpreter works.&lt;b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/b&gt;cyclesThisUpdate = 0;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;while&lt;/span&gt; (cyclesThisUpdate &amp;lt; cyclesToExecute)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; opcode =&amp;nbsp; readMem(PC++);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // fetch instruction&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; executeOpcode(opcode);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // decode and execute instruction&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; // do cyclic tasks&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; doGraphics();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; doSound();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; checkInterupts();&lt;br /&gt;
}&lt;b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/b&gt;Let me explain, &quot;cyclesThisUpdate&quot; is going to be the amount of cycles that the CPU has executed this update, usually we update the emulator one frame at a time then draw the screen. &quot;cyclesThisUpdate&quot; must be reset at the start of the loop. &quot;cyclesToExecute&quot; is simply the amount of cycles we want to execute for this update, for example, lets say we wanted to update about a frame, we would work out how many CPU cycles a frame takes to emulate. Be aware that &quot;cyclesThisUpdate&quot; will be incremented a certain amount by the instruction, certain instructions will take more cycles than others to execute, not including memory access times. You will need to keep track of these cycles.&lt;br /&gt;
&lt;br /&gt;
As you can see, the first thing we do is fetch the instruction, we then decode and execute the instruction, after this, we do all the cyclic tasks that need to be emulated, such as video, sound and CPU interupts.&lt;b&gt; &lt;/b&gt;Fetching the instruction involves memory I/O&lt;b&gt;, &lt;/b&gt;which will need to be emulated. For example, your fetch step will probably be some kind of readMemory() function which takes an address as a parameter, and returns the data as that address. This will serve the purpose of figuring out where in memory you are trying to read&lt;b&gt;, &lt;/b&gt;and acting appropriately. For example, in the Gameboy Classic&lt;b&gt;, &lt;/b&gt;reading addresses 0x4000, to 0x7FFF is reading a memory bank, and you must perform ROM memory banking to return the correct bytes. The &quot;PC&quot; is the program counter, which keeps track of where we are in the program, instructions like branches and jumps will change this register and it is incremented past each instruction everytime one is executed. If this confuses you, don&#39;t worry, you will understand eventually. &lt;b&gt;&lt;br /&gt;
&lt;br /&gt;
TL:DR Emulator is updated until cycles per update (usually per frame) is achieved.&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;Benefits of interpretation &lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Easy to debug&lt;/li&gt;
&lt;li&gt;Simple to implement&lt;/li&gt;
&lt;li&gt;Portable&lt;/li&gt;
&lt;li&gt;Easy to synchronise your system &lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&amp;nbsp;&lt;b&gt;&lt;u&gt;Drawbacks of interpretation &lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Very slow compared to other methods&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Dynamic Recompilation&lt;/b&gt; &lt;br /&gt;
Recompilation or Dynarec for short&lt;b&gt;,&lt;/b&gt; is a complex&lt;b&gt; &lt;/b&gt;subject that I&#39;m not really fully qualified to explain. The theory is that instead of executing the instructions, you translate them into mechine code instructions for your system and cache them in code blocks. The idea behind this is for optimization, because most code that is executed might be executed thousands of times, so if it is cached and optimized, it will execute much faster. &lt;a href=&quot;http://forums.pcsx2.net/Thread-blog-Introduction-to-Dynamic-Recompilation&quot;&gt;Here&lt;/a&gt; is a great tutorial by one of thr PCSX2 authors, CottonVibes on Dynarec. &lt;br /&gt;
&lt;br /&gt;
Emulators like PCSX2, ePSXe, PJ64, 1964 and Dolphin use Dynamic Recompilation. You can freely download the PCSX2 source and the 1964 source and take a look at there recompilers, 1964 even has a pdf document floating around somewhere with details on there recompiler, ask me if you want it, ill upload it somewhere for you. &lt;b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/b&gt;&lt;b&gt;&lt;u&gt;Benefits of dynarec&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Speed&lt;/li&gt;
&lt;li&gt;Speed&lt;/li&gt;
&lt;li&gt;Speed&lt;/li&gt;
&lt;/ol&gt;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&lt;b&gt;&lt;u&gt;Drawbacks of dynarec&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Not portable&lt;/li&gt;
&lt;li&gt;Difficult to debug&lt;/li&gt;
&lt;li&gt;Hard to impliment&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
There is another method called static recompilation, but I won&#39;t go into that as I feel that the benefits are few and far between.&lt;br /&gt;
&lt;br /&gt;
Peace&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By the way, i have no idea why this post won&#39;t format correctly, sorry. I tried.&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://emucode.blogspot.com/feeds/3823784681730746814/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://emucode.blogspot.com/2010/08/idea-theory-behind-emulation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/3823784681730746814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/3823784681730746814'/><link rel='alternate' type='text/html' href='http://emucode.blogspot.com/2010/08/idea-theory-behind-emulation.html' title='How emulators work'/><author><name>Ryan</name><uri>http://www.blogger.com/profile/13161303486072318544</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_aYI8XKQ7NZc/THxLCpZjWBI/AAAAAAAAABM/mHltonO0zSM/S220/center+swirl+blue+1600x1280.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4018600557724482326.post-9182690091035861642</id><published>2010-08-30T13:07:00.000-07:00</published><updated>2010-08-30T18:21:53.229-07:00</updated><title type='text'>A C++ wallpaper</title><content type='html'>After seeing the antiRTFM&#39;s C++ tutorials on youtube, I saw that he had an awesome wallpaper that he designed. People kept requesting it so I thought I&#39;d make my own impression of it. Do what you will with it. Enjoy :)&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQQvAVB56xVQcn4-9L4AIlW_u9zrvhjuWJuV0HRW8W5_b_ybSJqrFBB2a3VvzyfWB5Z82wJzElCokngaAi4TYlpOV6QQvy42-QIy08B1hn4EJqClYHEeINGyNuu5YJvKyP1e54CC7QHA/s1600/SolarWorlds_CrescentMoon_1280x1024+copy.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;256&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQQvAVB56xVQcn4-9L4AIlW_u9zrvhjuWJuV0HRW8W5_b_ybSJqrFBB2a3VvzyfWB5Z82wJzElCokngaAi4TYlpOV6QQvy42-QIy08B1hn4EJqClYHEeINGyNuu5YJvKyP1e54CC7QHA/s320/SolarWorlds_CrescentMoon_1280x1024+copy.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Peace</content><link rel='replies' type='application/atom+xml' href='http://emucode.blogspot.com/feeds/9182690091035861642/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://emucode.blogspot.com/2010/08/c-wallpaper.html#comment-form' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/9182690091035861642'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/9182690091035861642'/><link rel='alternate' type='text/html' href='http://emucode.blogspot.com/2010/08/c-wallpaper.html' title='A C++ wallpaper'/><author><name>Ryan</name><uri>http://www.blogger.com/profile/13161303486072318544</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_aYI8XKQ7NZc/THxLCpZjWBI/AAAAAAAAABM/mHltonO0zSM/S220/center+swirl+blue+1600x1280.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQQvAVB56xVQcn4-9L4AIlW_u9zrvhjuWJuV0HRW8W5_b_ybSJqrFBB2a3VvzyfWB5Z82wJzElCokngaAi4TYlpOV6QQvy42-QIy08B1hn4EJqClYHEeINGyNuu5YJvKyP1e54CC7QHA/s72-c/SolarWorlds_CrescentMoon_1280x1024+copy.jpg" height="72" width="72"/><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4018600557724482326.post-7630406615954875540</id><published>2010-08-30T11:56:00.000-07:00</published><updated>2010-08-30T11:58:28.890-07:00</updated><title type='text'>Writing an emulator</title><content type='html'>In this quick post, I&#39;ll go over the processes that led up to me writing emulators.&lt;br /&gt;
&lt;br /&gt;
*&lt;u&gt;First of all, a disclaimer&lt;/u&gt;. I am &lt;b&gt;not&lt;/b&gt; an expert, or even a particularly advanced emulator author, but I am learning more everyday and really enjoying it. If you want to speak to expert emulator authors, go to a site like PCSX2.net. These people deserve enormous respect in my humble opinion. &lt;br /&gt;
&lt;br /&gt;
From the very first time I used an emulator, I knew that I wanted to learn more about them, I don&#39;t even think I was a programmer at that time, it was the interest that motivated me from the start. The reason I chose to actually attempt to write emulators is simple, I love playing games, and I love low level programming tasks and learning what makes machines &quot;tick&quot;, emulation is ideal for me. Unfortunately, I noticed that learning the theory behind emulation is easier said than done, not to mention that lack of simple documentation on the basics which can be maddening. Emulating a games machine, or any machine is not a simple thing to do (in my opinion), although obviously writing a PS2 emulator is going to be alot harder than writing a Gameboy emulator for example, so it&#39;s subjective. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Here&#39;s a few suggestions.&lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;First of all, you obviously need to learn a programming language, i recommend C and/or C++ as most software, including most emulators will be written in this language, even Windows is written almost entirely in C. &lt;/li&gt;
&lt;li&gt;Emulation is not really a good project for learning your language of choice, be confident in your language before you attempt writing any emulator, as you don&#39;t want to be discouraged from emulation by your lack of knowledge of a language, a language should be used like any other tool, which you should know how to make full use of before attempting projects like this. Although, I have heard of people saying that they learned to program by writing emulators, but I digress.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;Don&#39;t ever just copy somone elses source code because you can&#39;t figure it out yourself, this is a huge mistake and will ultimately screw you over, it feels so much better to know you have witten it all yourself.&lt;/li&gt;
&lt;li&gt;Learn about the system you&#39;re trying to emulate &lt;b&gt;before&lt;/b&gt; writing any code. &lt;/li&gt;
&lt;li&gt;Learn about computer architecture before trying ti write an emulator.&lt;/li&gt;
&lt;li&gt;Learn about bitwise operators like OR, EOR and AND. Also, learn about different numeral systems like binary and hexadecimal.&lt;/li&gt;
&lt;li&gt;Find as much documentation as you can on the system you&#39;re trying to emulate. &lt;/li&gt;
&lt;li&gt; Don&#39;t give up.&lt;/li&gt;
&lt;li&gt;Have fun. :)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;???&lt;/li&gt;
&lt;li&gt;Profit!&lt;/li&gt;
&lt;/ul&gt;Here are some links that will get you started writing emulators.&lt;br /&gt;
&lt;br /&gt;
Don&#39;t know how to program in C++?&lt;a href=&quot;http://www.youtube.com/watch?v=tyVhn0FWWB4&quot;&gt; Here&#39;s a good tutorial.&amp;nbsp;&lt;/a&gt;&lt;br /&gt;
Don&#39;t know how to program graphics and GUI in C++? &lt;a href=&quot;http://nehe.gamedev.net/&quot;&gt;Here&#39;s a good tutorial.&amp;nbsp; &lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Take a look at &lt;a href=&quot;http://www.sendspace.com/file/tvamdz&quot;&gt;this video&lt;/a&gt; before writing an emulator, it will help you understand what the basics are. (not sure about the copyright, but I tried to contact the author, no response). If the link goes down, please tell me, i will re-upload it for you.&lt;br /&gt;
&lt;br /&gt;
Confident in your language of choice? &lt;a href=&quot;http://www.codeslinger.co.uk/pages/projects/chip8.html&quot;&gt;This is an awesome blog&lt;/a&gt; taking you step by step through how to write an emulator. From the Chip8, to the Gameboy Classic, to the Master System, to infinity... and beyond!&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.emuwiki.com/index.php?title=Emulation_on_PC_%28DOS/Windows%29&quot;&gt;A great site&lt;/a&gt; for emulator source code and such. &lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://nocash.emubase.de/&quot;&gt;The NO$&lt;/a&gt; series of emulators and documentation. (great, great documentation on various systems like the Gameboy Advanced, Nintendo DS and the NES etc...). this will probably be your main source of documentation for a few emulators.&lt;br /&gt;
&lt;br /&gt;
And of course, if you want more documentation, don&#39;t be afraid to use the official documentation released by the system vendors (if they have of course). For example, the &lt;a href=&quot;http://www.westerndesigncenter.com/wdc/documentation/Programmanual.pdf&quot;&gt;6502 processor used in the NES has a whole manual.&amp;nbsp; &lt;/a&gt;Same with the GBA CPU, &lt;a href=&quot;http://www.eecs.umich.edu/%7Epanalyzer/pdfs/ARM_doc.pdf&quot;&gt;the ARM7TDI manual. &lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
One last thing, don&#39;t forget to actually &lt;b&gt;play&lt;/b&gt; emulators, they are so much fun. try the latest ones, the PCSX2 and Dolphin, they be bitchin!&lt;br /&gt;
&lt;br /&gt;
Peace</content><link rel='replies' type='application/atom+xml' href='http://emucode.blogspot.com/feeds/7630406615954875540/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://emucode.blogspot.com/2010/08/writing-emulator.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/7630406615954875540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/7630406615954875540'/><link rel='alternate' type='text/html' href='http://emucode.blogspot.com/2010/08/writing-emulator.html' title='Writing an emulator'/><author><name>Ryan</name><uri>http://www.blogger.com/profile/13161303486072318544</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_aYI8XKQ7NZc/THxLCpZjWBI/AAAAAAAAABM/mHltonO0zSM/S220/center+swirl+blue+1600x1280.png'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4018600557724482326.post-5372949679997769535</id><published>2010-08-27T16:13:00.000-07:00</published><updated>2010-08-27T17:42:31.101-07:00</updated><title type='text'>Decoding the THUMB instruction set</title><content type='html'>Recently, I have began work on a GBA emulator which is keeping me busy. The emulator that I worked on before this (and still do) is a Nes emulator, so this is a huge step up for me, but where is the fun without challenge?&lt;br /&gt;
&lt;br /&gt;
So far, i haven&#39;t even finished decoding the instruction sets so don&#39;t expect much yet, the ARM7TDMI is a pretty complex CPU. I will outline the method that I am using to decode the instruction sets of the ARM7TDMI, incase it&#39;s useful to any other GBA emulator authors who were stuck like I was blankly staring at the ARM7 opcode format for ages.&lt;br /&gt;
&lt;br /&gt;
Keep in mind that it is very difficult to explain the exact way that i decode each instruction without alot of text, but I will try to explain as best I can with some abstraction. &lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;The ARM7TDMI  effectively has two instruction sets, one that makes use of full 32bit  instructions called the ARM instruction set, and another which only uses  16 bit instructions called the THUMB instruction set which reduces code density but removes some instructions as well as limiting the immediate values that can be used. You can independently switch between these two instruction sets on the fly using the BX instruction.&lt;/span&gt;&lt;/span&gt;&lt;u&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/u&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;u&gt;&lt;span style=&quot;font-size: large;&quot;&gt;THUMB instruction set&amp;nbsp;&lt;/span&gt;&lt;/u&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;As the THUMB instruction set is the easiest to decode, I will tackle this first.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;Binary opcode format of the THUMB instruction set.&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioLCFXVZYzO4u9eeIG3xrE8thE8j6moI8UbVsbZ3dj1rsZvxDWakHe_3YHPYUp9Jva53QNv_c1GpikzjAkbZ-Q0EraM2ObR_Hs9ANaiPXDhVrYs5YE8YXfpkdje4xQkufBpWa0pcAJJg/s1600/Untitled.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;397&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioLCFXVZYzO4u9eeIG3xrE8thE8j6moI8UbVsbZ3dj1rsZvxDWakHe_3YHPYUp9Jva53QNv_c1GpikzjAkbZ-Q0EraM2ObR_Hs9ANaiPXDhVrYs5YE8YXfpkdje4xQkufBpWa0pcAJJg/s400/Untitled.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Each instruction is made up of 2 bytes (half word), and each instruction has it&#39;s own format that is decoded by the CPU. As you can see, some instruction formats like format 1 have an opcode field which will specify the particular instruction that this is, for example, the &quot;Move shifted register&quot; format has a 2 bit opcode field. If you want more detail on the specifics of the instructions and the fields, then take a look at the manual &lt;a href=&quot;http://www.eecs.umich.edu/%7Epanalyzer/pdfs/ARM_doc.pdf&quot;&gt;here&lt;/a&gt;, or check out NO$GBA specs &lt;a href=&quot;http://nocash.emubase.de/gbatek.htm#thumbinstructionset&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Now, the way I decode an instruction is by taking the upper 8 bits of the instruction and checking it&#39;s value. For example, if I took the upper 8 bits and the value was equal to 0 to 7, I would know that this must be a &quot;LSL Rd, Rs, Offset&quot;. Why? This is because while the upper 8 bits equal 0 to 7, then the opcode field (move shifted register format) is equal to 0 and all the other bits for this format are correct. here is a &lt;i&gt;more&lt;/i&gt; visual example.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPiLwriimfjDjy8f80MXz0c55Yt0jVJml_b1Qu5ElI001i07wLi5RGIG4eonhlhFYa4c470G59z7lqkgqiEQrewwQTebHJMQd-gJBISCfE_Wtb_dmBFmOzRD2NCEFx863dpWc-3cE99A/s1600/Untitled.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;181&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPiLwriimfjDjy8f80MXz0c55Yt0jVJml_b1Qu5ElI001i07wLi5RGIG4eonhlhFYa4c470G59z7lqkgqiEQrewwQTebHJMQd-gJBISCfE_Wtb_dmBFmOzRD2NCEFx863dpWc-3cE99A/s400/Untitled.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Let&#39;s say our upper 8 bits look like the ones in the picture&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;00000101&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
If we check the instruction format, we can see that the &quot;Move shifted register&quot; format allows for this value, as the bottom three bits of 8 bit value we are using are the &lt;b&gt;top three bits&lt;/b&gt; of the offset5 field (bits 8,9, 10), which could therefor be anything as they are arbitrary, so the following binary values can therefor reperesent the same instruction. (&quot;LSL Rd, Rs, Offset5&quot;). &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;00000000 &amp;nbsp;&amp;nbsp; (0)&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;00000001&lt;/b&gt;&lt;b&gt; &amp;nbsp;&amp;nbsp; (1)&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;00000010&lt;/b&gt;&lt;b&gt; &amp;nbsp;&amp;nbsp; (2)&lt;/b&gt;&lt;b&gt; &lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;00000011&lt;/b&gt;&lt;b&gt; &amp;nbsp;&amp;nbsp; (3)&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;00000100&lt;/b&gt;&lt;b&gt; &amp;nbsp;&amp;nbsp; (4)&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;00000101&lt;/b&gt;&lt;b&gt; &amp;nbsp;&amp;nbsp; (5)&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;00000110&lt;/b&gt;&lt;b&gt; &amp;nbsp;&amp;nbsp; (6)&lt;/b&gt;&lt;b&gt; &lt;/b&gt;&lt;br /&gt;
&lt;b&gt;00000111&lt;/b&gt;&lt;b&gt; &amp;nbsp;&amp;nbsp; (7)&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
If we were to get a value of 8 (&lt;b&gt;00001000), &lt;/b&gt;this would mean that the opcode field had increased by one, so the instruction would now be &quot;LSR Rd, Rs, Offset5&quot;. So now, we need to do the same again, as the bottom three bits could be anything. these binary values will all be the same instruction.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;00001000&lt;/b&gt;&lt;b&gt; &amp;nbsp;&amp;nbsp; (8)&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;00001001&lt;/b&gt;&lt;b&gt; &amp;nbsp;&amp;nbsp; (9)&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;00001010&lt;/b&gt;&lt;b&gt; &amp;nbsp;&amp;nbsp; (A)&lt;/b&gt;&lt;b&gt; &lt;/b&gt;&lt;br /&gt;
&lt;b&gt;00001011&lt;/b&gt;&lt;b&gt; &amp;nbsp;&amp;nbsp; (B)&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;00001100&lt;/b&gt;&lt;b&gt; &amp;nbsp;&amp;nbsp; (C)&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;00001101&lt;/b&gt;&lt;b&gt; &amp;nbsp;&amp;nbsp; (D)&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;00001110&lt;/b&gt;&lt;b&gt; &amp;nbsp;&amp;nbsp; (E)&lt;/b&gt;&lt;b&gt; &lt;/b&gt;&lt;br /&gt;
&lt;b&gt;00001111&lt;/b&gt;&lt;b&gt; &amp;nbsp;&amp;nbsp; (F)&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now to decode the rest of the instruction set, you just follow this logical pattern.&lt;br /&gt;
&lt;br /&gt;
Here is a coded example of how you might decode the first couple of instructions...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;textarea&amp;gt;u16 instruction = fetch();&lt;br /&gt;
&lt;br /&gt;
switch (instruction &amp;gt;&amp;gt; 8)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; case 0:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; case 1:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; case 2:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; case 3:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; case 4:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; case 5:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; case 6:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; case 7:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // LSL Rd, Rs, Offset5&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; } break;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; case 8:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; case 9:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; case 0xA:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; case 0xB:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; case 0xC:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; case 0xD:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; case 0xE:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; case 0xF:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // LSR Rd, Rs, Offset5&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; } break;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
or you may choose to use an array of function pointers.&lt;br /&gt;
&lt;br /&gt;
void (*CPU_Thumb_Instruction[0x100]) (u16 instruction) =&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Thumb_LSL_Rd_Rs_Offset,&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // 00h&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Thumb_LSL_Rd_Rs_Offset,&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // 01h&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Thumb_LSL_Rd_Rs_Offset,&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // 02h&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Thumb_LSL_Rd_Rs_Offset,&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // 03h&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Thumb_LSL_Rd_Rs_Offset,&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // 04h&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Thumb_LSL_Rd_Rs_Offset,&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // 05h&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Thumb_LSL_Rd_Rs_Offset,&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // 06h&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Thumb_LSL_Rd_Rs_Offset,&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // 07h&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /*-------------------*/&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Thumb_LSR_Rd_Rs_Offset,&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // 08h&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Thumb_LSR_Rd_Rs_Offset,&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // 09h&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Thumb_LSR_Rd_Rs_Offset,&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // 0Ah&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Thumb_LSR_Rd_Rs_Offset,&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // 0Bh&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Thumb_LSR_Rd_Rs_Offset,&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // 0Ch&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Thumb_LSR_Rd_Rs_Offset,&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // 0Dh&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Thumb_LSR_Rd_Rs_Offset,&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // 0Eh&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Thumb_LSR_Rd_Rs_Offset,&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // 0Fh&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/textarea&amp;gt;&lt;br /&gt;
I will explain how to decode the ARM instruction set at a later date, as it is considerably more complex, and requires much more thought and care.&lt;br /&gt;
&lt;br /&gt;
Peace</content><link rel='replies' type='application/atom+xml' href='http://emucode.blogspot.com/feeds/5372949679997769535/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://emucode.blogspot.com/2010/08/gba-emulator.html#comment-form' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/5372949679997769535'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/5372949679997769535'/><link rel='alternate' type='text/html' href='http://emucode.blogspot.com/2010/08/gba-emulator.html' title='Decoding the THUMB instruction set'/><author><name>Ryan</name><uri>http://www.blogger.com/profile/13161303486072318544</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_aYI8XKQ7NZc/THxLCpZjWBI/AAAAAAAAABM/mHltonO0zSM/S220/center+swirl+blue+1600x1280.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioLCFXVZYzO4u9eeIG3xrE8thE8j6moI8UbVsbZ3dj1rsZvxDWakHe_3YHPYUp9Jva53QNv_c1GpikzjAkbZ-Q0EraM2ObR_Hs9ANaiPXDhVrYs5YE8YXfpkdje4xQkufBpWa0pcAJJg/s72-c/Untitled.png" height="72" width="72"/><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4018600557724482326.post-6854718164889335204</id><published>2010-08-27T15:18:00.000-07:00</published><updated>2010-08-27T19:16:32.631-07:00</updated><title type='text'>Welcome</title><content type='html'>Hi, this is a blog I thought I&#39;d start just to note my progress and thoughts of various coding projects I am working on. Nuff said, let&#39;s do this.</content><link rel='replies' type='application/atom+xml' href='http://emucode.blogspot.com/feeds/6854718164889335204/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://emucode.blogspot.com/2010/08/welcome.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/6854718164889335204'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4018600557724482326/posts/default/6854718164889335204'/><link rel='alternate' type='text/html' href='http://emucode.blogspot.com/2010/08/welcome.html' title='Welcome'/><author><name>Ryan</name><uri>http://www.blogger.com/profile/13161303486072318544</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_aYI8XKQ7NZc/THxLCpZjWBI/AAAAAAAAABM/mHltonO0zSM/S220/center+swirl+blue+1600x1280.png'/></author><thr:total>2</thr:total></entry></feed>