<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:default="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:admin="http://webns.net/mvcb/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:content="http://purl.org/rss/1.0/modules/content/"><default:channel xmlns="http://purl.org/rss/1.0/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:admin="http://webns.net/mvcb/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" rdf:about="http://chrisfisher.blog.co.uk/"><title>Dev Diary</title><link>http://chrisfisher.blog.co.uk/</link><description></description><dc:language xmlns:dc="http://purl.org/dc/elements/1.1/">en-EU</dc:language><admin:generatorAgent xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" rdf:resource="http://www.blog.co.uk"/><sy:updatePeriod xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">hourly</sy:updatePeriod><sy:updateFrequency xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">8</sy:updateFrequency><sy:updateBase xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">2000-01-01T12:00+00:00</sy:updateBase><image><title>Dev Diary</title><link>http://chrisfisher.blog.co.uk/</link><url>http://data5.blog.de/design/preview/c0/a46c71860d0855e3a083ba9f385923_160x200.jpg</url></image><items><rdf:Seq><rdf:li rdf:resource="http://chrisfisher.blog.co.uk/2009/10/18/mips-as-promised-7195380/"/><rdf:li rdf:resource="http://chrisfisher.blog.co.uk/2009/10/18/a-brief-introduction-7193762/"/></rdf:Seq></items></default:channel><default:item xmlns:default="http://purl.org/rss/1.0/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" rdf:about="http://chrisfisher.blog.co.uk/2009/10/18/mips-as-promised-7195380/"><default:title>MIPS...as promised</default:title><default:link>http://chrisfisher.blog.co.uk/2009/10/18/mips-as-promised-7195380/</default:link><dc:date xmlns:dc="http://purl.org/dc/elements/1.1/">2009-10-18T18:17:38+02:00</dc:date><default:description>	&lt;p&gt;What is MIPS??&lt;br&gt;
MIPS is an assembly language.&lt;/p&gt;
	&lt;p&gt;Assembly Language?&lt;br&gt;
That means that it is a low level language. C++, for instance, is a high level language, meaning that it is very close to natural language i.e. how people communicate in their day to day lives. Machine code, by stark contrast is VERY low level, and very difficult for people to understand without the use of charts and graphs, or a lot of invested time – however it does make perfect sense to the number crunching beast that is your processor. MIPS and other assembly languages can be seen as a kind of middle ground between those two contrasts; it's fairly human friendly, and is also very close to machine code.&lt;/p&gt;
	&lt;p&gt;What is machine code used for?&lt;br&gt;
All programming languages, C++, Java, even MIPS, need to be compiled into machine code to run. Your processor can't understand it otherwise. Technically, machine code is all you need to create a program, but as was said earlier, it can be very difficult to understand, and even harder to write. Want to see why? No problem;&lt;/p&gt;
	&lt;p&gt;Here is some code written in C++;&lt;/p&gt;
	&lt;blockquote&gt;&lt;p&gt;
struct integer&lt;br&gt;
{&lt;br&gt;
    int i;&lt;br&gt;
    integer (int j = 0) : i (j) {}&lt;br&gt;
    integer operator* (const integer &amp;k) const&lt;br&gt;
    {&lt;br&gt;
        return integer (i + k.i);&lt;br&gt;
    }&lt;br&gt;
};&lt;/p&gt;&lt;/blockquote&gt;
	&lt;p&gt;What this does is not important,  what is useful to note is that we can create our own variables using letters, or even words, and the maths is close to real world formulae. Here is some machine code;&lt;/p&gt;
	&lt;blockquote&gt;&lt;p&gt;    8020        78&lt;br&gt;
    8021        A9 80&lt;br&gt;
    8023        8D 15 03&lt;br&gt;
    8026        A9 2D&lt;br&gt;
    8028        8D 14 03&lt;br&gt;
    802B        58&lt;br&gt;
    802C        60&lt;br&gt;
    802D        EE 20 D0&lt;br&gt;
    8030        4C 31 EA&lt;/p&gt;&lt;/blockquote&gt;
	&lt;p&gt;As we can see, it is not much more than numbers; in fact it is hexadecimal, a number system specific to computing. Even if you do not understand the code, it should be clear how different the two are.&lt;/p&gt;
	&lt;p&gt;OK, that is harder. But if C++ can be compiled into machine code, why do we still need assembly languages?&lt;br&gt;
In short, we don't, not for many day-to-day applications anyway. However, being able to understand how our source code relates to machine code is useful; the fundamentals of binary math and memory allocation are actually easier to understand in assembly. And assembly languages are still used; Some elements of Windows OS are still done in assembly, and in fact some games have been done in assembly (more recently than you might think). The reason for this is because high level code carries a certain amount of overhead, and can be done more efficiently in assembly. You also have greater control when writing in assembly; a compiler will take certain liberties when it does it job, liberties that you would otherwise have to manage.&lt;/p&gt;
	&lt;p&gt;What was that about games??&lt;br&gt;
In the lifetime of a console, games tend to get more complex, and look better with time. But how is that possible when the consoles' spec remains unchanged? Well when the game “Jax and Daxter” was released back in 2001 it pushed the boundaries for graphic beauty on the Playstation 2 console. A huge reason for this is because nearly the entire game was written in MIPS assembly, and so coders where able to (and here is the key word to answer that rhetoric; ) optimise the game flow to a staggering degree, resulting in a game that has sold over 2million copies to-date.&lt;/p&gt;
	&lt;p&gt;So games can be written in assembly language on the PS2?&lt;br&gt;
Yes! More specifically, games can be written in MIPS on any of the Playstation consoles; I will in fact be writing a game designed for the PSP using MIPS in the coming weeks.&lt;/p&gt;
	&lt;p&gt;Excellent! So can you write games in MIPS for any console?&lt;br&gt;
No, each console has a slightly different architecture, and assembly language is always written for a specific chipset; Sony use MIPS for their machines. &lt;/p&gt;
	&lt;p&gt;Any chance we can see some MIPS?&lt;br&gt;
Finding code for the PS  can be tricky unless your willing to decompile the stuff yourself. As I don't have ANY PS games with me, it makes it pretty much impossible. However I did find some MIPS code that does work on the PSX (i.e. Playstation, before the PS-One). The printgpu.zip file on this site; &lt;a href="http://psx.rules.org/psxrul2.shtml"&gt;http://psx.rules.org/psxrul2.shtml&lt;/a&gt; is where I found it if you wish to view the file in it's entirety. Here is a snippet, just as an example of MIPS on the PS;&lt;/p&gt;
	&lt;blockquote&gt;&lt;p&gt;
        lui     a0, $0800       	; initialise the GPU&lt;br&gt;
        jal     InitGPU         	; command 8&lt;br&gt;
        ori     a0,a0,$0009     	; bit $00,$01= %01 -&gt; screen width:320&lt;br&gt;
                                	; bit $03 = 1 -&gt; video mode = pal&lt;br&gt;
        la      a0,back        	        ; draw a nice backdrop&lt;br&gt;
        jal     SendList        	;&lt;br&gt;
        nop                    		;&lt;br&gt;
        jal     Loadfont       	        ; upload font data.&lt;br&gt;
        nop                    		;&lt;br&gt;
        la      a0,text1                ; a0 = pointer to string.&lt;br&gt;
        li      a1,$00200018            ; a1 : y&lt;&lt;16|x (y=$20,x=$20)&lt;br&gt;
        li      a2,$00808080            ; a2 : bgr = 808080 = white.&lt;br&gt;
        jal     PrintGPU_dma            ; print&lt;br&gt;
        nop                             ;&lt;br&gt;
        jal     SendList                ; plot text.&lt;br&gt;
        or      a0,zero,v0              ;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt; &lt;small&gt; &lt;a href="http://chrisfisher.blog.co.uk/2009/10/18/mips-as-promised-7195380/#comments"&gt;Comments&lt;/a&gt; &lt;/small&gt; &lt;/p&gt;</default:description><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[	<p>What is MIPS??<br>
MIPS is an assembly language.</p>
	<p>Assembly Language?<br>
That means that it is a low level language. C++, for instance, is a high level language, meaning that it is very close to natural language i.e. how people communicate in their day to day lives. Machine code, by stark contrast is VERY low level, and very difficult for people to understand without the use of charts and graphs, or a lot of invested time – however it does make perfect sense to the number crunching beast that is your processor. MIPS and other assembly languages can be seen as a kind of middle ground between those two contrasts; it's fairly human friendly, and is also very close to machine code.</p>
	<p>What is machine code used for?<br>
All programming languages, C++, Java, even MIPS, need to be compiled into machine code to run. Your processor can't understand it otherwise. Technically, machine code is all you need to create a program, but as was said earlier, it can be very difficult to understand, and even harder to write. Want to see why? No problem;</p>
	<p>Here is some code written in C++;</p>
	<blockquote><p>
struct integer<br>
{<br>
    int i;<br>
    integer (int j = 0) : i (j) {}<br>
    integer operator* (const integer &k) const<br>
    {<br>
        return integer (i + k.i);<br>
    }<br>
};</p></blockquote>
	<p>What this does is not important,  what is useful to note is that we can create our own variables using letters, or even words, and the maths is close to real world formulae. Here is some machine code;</p>
	<blockquote><p>    8020        78<br>
    8021        A9 80<br>
    8023        8D 15 03<br>
    8026        A9 2D<br>
    8028        8D 14 03<br>
    802B        58<br>
    802C        60<br>
    802D        EE 20 D0<br>
    8030        4C 31 EA</p></blockquote>
	<p>As we can see, it is not much more than numbers; in fact it is hexadecimal, a number system specific to computing. Even if you do not understand the code, it should be clear how different the two are.</p>
	<p>OK, that is harder. But if C++ can be compiled into machine code, why do we still need assembly languages?<br>
In short, we don't, not for many day-to-day applications anyway. However, being able to understand how our source code relates to machine code is useful; the fundamentals of binary math and memory allocation are actually easier to understand in assembly. And assembly languages are still used; Some elements of Windows OS are still done in assembly, and in fact some games have been done in assembly (more recently than you might think). The reason for this is because high level code carries a certain amount of overhead, and can be done more efficiently in assembly. You also have greater control when writing in assembly; a compiler will take certain liberties when it does it job, liberties that you would otherwise have to manage.</p>
	<p>What was that about games??<br>
In the lifetime of a console, games tend to get more complex, and look better with time. But how is that possible when the consoles' spec remains unchanged? Well when the game “Jax and Daxter” was released back in 2001 it pushed the boundaries for graphic beauty on the Playstation 2 console. A huge reason for this is because nearly the entire game was written in MIPS assembly, and so coders where able to (and here is the key word to answer that rhetoric; ) optimise the game flow to a staggering degree, resulting in a game that has sold over 2million copies to-date.</p>
	<p>So games can be written in assembly language on the PS2?<br>
Yes! More specifically, games can be written in MIPS on any of the Playstation consoles; I will in fact be writing a game designed for the PSP using MIPS in the coming weeks.</p>
	<p>Excellent! So can you write games in MIPS for any console?<br>
No, each console has a slightly different architecture, and assembly language is always written for a specific chipset; Sony use MIPS for their machines. </p>
	<p>Any chance we can see some MIPS?<br>
Finding code for the PS  can be tricky unless your willing to decompile the stuff yourself. As I don't have ANY PS games with me, it makes it pretty much impossible. However I did find some MIPS code that does work on the PSX (i.e. Playstation, before the PS-One). The printgpu.zip file on this site; <a href="http://psx.rules.org/psxrul2.shtml">http://psx.rules.org/psxrul2.shtml</a> is where I found it if you wish to view the file in it's entirety. Here is a snippet, just as an example of MIPS on the PS;</p>
	<blockquote><p>
        lui     a0, $0800       	; initialise the GPU<br>
        jal     InitGPU         	; command 8<br>
        ori     a0,a0,$0009     	; bit $00,$01= %01 -> screen width:320<br>
                                	; bit $03 = 1 -> video mode = pal<br>
        la      a0,back        	        ; draw a nice backdrop<br>
        jal     SendList        	;<br>
        nop                    		;<br>
        jal     Loadfont       	        ; upload font data.<br>
        nop                    		;<br>
        la      a0,text1                ; a0 = pointer to string.<br>
        li      a1,$00200018            ; a1 : y<<16|x (y=$20,x=$20)<br>
        li      a2,$00808080            ; a2 : bgr = 808080 = white.<br>
        jal     PrintGPU_dma            ; print<br>
        nop                             ;<br>
        jal     SendList                ; plot text.<br>
        or      a0,zero,v0              ;</p></blockquote>
<p> <small> <a href="http://chrisfisher.blog.co.uk/2009/10/18/mips-as-promised-7195380/#comments">Comments</a> </small> </p>]]></content:encoded></default:item><default:item xmlns:default="http://purl.org/rss/1.0/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" rdf:about="http://chrisfisher.blog.co.uk/2009/10/18/a-brief-introduction-7193762/"><default:title>A Brief Introduction</default:title><default:link>http://chrisfisher.blog.co.uk/2009/10/18/a-brief-introduction-7193762/</default:link><dc:date xmlns:dc="http://purl.org/dc/elements/1.1/">2009-10-18T14:15:41+02:00</dc:date><default:description>	&lt;p&gt;For all those of you who are new to my blog, or in-fact me, here's a little about myself, and a brief synopsis about what you can expect to find in this blog;&lt;/p&gt;
	&lt;p&gt;I'm Chris Fisher, a 25 year old Computer Games Programming Student at Derby University. I originally hail from Coventry where I've spent most of my life moving from town to town. I like watching football, going to see live music and I'm currently learning the guitar. I also enjoy playing computer games. After a few years flirting between jobs – some good, some not so – I headed back to college, and took a HND in Computing. It was here that I first discovered programming, and I've been enjoying it ever since.&lt;/p&gt;
	&lt;p&gt;This blog is all about Games Development, and what I learn as I delve ever deeper into programming. You can expect some long winded discussions about MIPS, C++ and Unreal Script; even info on writing a professional CV, and a decent personal statement. I hope that at least someone out there finds my musings useful, I know I certainly will. Feel free to leave me some (constructive!) comments, and don't hesitate if you have any questions; I often find that the best two ways to learn programming are to get stuck in and pass that knowledge on to others, which is exactly what I'll be doing in the coming posts.
&lt;/p&gt;
&lt;p&gt; &lt;small&gt; &lt;a href="http://chrisfisher.blog.co.uk/2009/10/18/a-brief-introduction-7193762/#comments"&gt;Comments&lt;/a&gt; &lt;/small&gt; &lt;/p&gt;</default:description><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[	<p>For all those of you who are new to my blog, or in-fact me, here's a little about myself, and a brief synopsis about what you can expect to find in this blog;</p>
	<p>I'm Chris Fisher, a 25 year old Computer Games Programming Student at Derby University. I originally hail from Coventry where I've spent most of my life moving from town to town. I like watching football, going to see live music and I'm currently learning the guitar. I also enjoy playing computer games. After a few years flirting between jobs – some good, some not so – I headed back to college, and took a HND in Computing. It was here that I first discovered programming, and I've been enjoying it ever since.</p>
	<p>This blog is all about Games Development, and what I learn as I delve ever deeper into programming. You can expect some long winded discussions about MIPS, C++ and Unreal Script; even info on writing a professional CV, and a decent personal statement. I hope that at least someone out there finds my musings useful, I know I certainly will. Feel free to leave me some (constructive!) comments, and don't hesitate if you have any questions; I often find that the best two ways to learn programming are to get stuck in and pass that knowledge on to others, which is exactly what I'll be doing in the coming posts.
</p>
<p> <small> <a href="http://chrisfisher.blog.co.uk/2009/10/18/a-brief-introduction-7193762/#comments">Comments</a> </small> </p>]]></content:encoded></default:item></rdf:RDF>
