<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Just Another Rom Hacker</title>
	<atom:link href="http://esperknight.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://esperknight.wordpress.com</link>
	<description>Ramblings and teachings on rom hacking</description>
	<lastBuildDate>Tue, 13 Apr 2010 20:46:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='esperknight.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Just Another Rom Hacker</title>
		<link>http://esperknight.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://esperknight.wordpress.com/osd.xml" title="Just Another Rom Hacker" />
	<atom:link rel='hub' href='http://esperknight.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Load block from CDROM (PCE/TG16)</title>
		<link>http://esperknight.wordpress.com/2009/06/14/load-block-from-cdrom-pcetg16/</link>
		<comments>http://esperknight.wordpress.com/2009/06/14/load-block-from-cdrom-pcetg16/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 20:47:50 +0000</pubDate>
		<dc:creator>esperknight</dc:creator>
				<category><![CDATA[romhacking]]></category>

		<guid isPermaLink="false">http://esperknight.wordpress.com/?p=20</guid>
		<description><![CDATA[I love the PCE and figured I&#8217;d share some of the things I&#8217;ve been learning about it. So my next couple of posts will be about different things I&#8217;ve learned. For any PCE hacking I wholeheartedly recommend Mednafen. One thing I noticed that is not documented though is that if you hit L on the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=esperknight.wordpress.com&amp;blog=1161048&amp;post=20&amp;subd=esperknight&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I love the PCE and figured I&#8217;d share some of the things I&#8217;ve been learning about it.  So my next couple of posts will be about different things I&#8217;ve learned.  For any PCE hacking I wholeheartedly recommend Mednafen.  One thing I noticed that is not documented though is that if you hit L on the debug screen (hit ALT + D, ALT + 1) it&#8217;ll bring up a window where you can type in the file name you want to trace out to.  Very useful feature as I find it easier to look at a trace then at a debug screen when first analyzing something.  Anyways, on to the whole point of the post&#8230;</p>
<p>For our example, were looking at Tengai Makyou Ziria.  For TMZ, it&#8217;ll load into one of the MPRs the bank location in RAM it wants to write to (in my case it was MPR5, I&#8217;m not sure if it matters, although it did load MPR6 with the next bank).  You then call the subroutine at 0xE009.  In your trace you can then look for reads from location 0&#215;1808 or just search for the location in the MPR it&#8217;s writing too (in my case I looked for 0xA000).</p>
<p>One thing I&#8217;ll check into and look for is if you can specify how many blocks to load as it loads in 0&#215;800 (2048) blocks.  I&#8217;ll update this later when I find out&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/esperknight.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/esperknight.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/esperknight.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/esperknight.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/esperknight.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/esperknight.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/esperknight.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/esperknight.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/esperknight.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/esperknight.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/esperknight.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/esperknight.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/esperknight.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/esperknight.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=esperknight.wordpress.com&amp;blog=1161048&amp;post=20&amp;subd=esperknight&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://esperknight.wordpress.com/2009/06/14/load-block-from-cdrom-pcetg16/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d1f03a7662460a4baeb8e589aa4cce51?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">esperknight</media:title>
		</media:content>
	</item>
		<item>
		<title>Finding the text&#8230;</title>
		<link>http://esperknight.wordpress.com/2009/05/14/finding-the-text/</link>
		<comments>http://esperknight.wordpress.com/2009/05/14/finding-the-text/#comments</comments>
		<pubDate>Thu, 14 May 2009 02:49:26 +0000</pubDate>
		<dc:creator>esperknight</dc:creator>
				<category><![CDATA[romhacking]]></category>

		<guid isPermaLink="false">http://esperknight.wordpress.com/?p=14</guid>
		<description><![CDATA[Alrighty, let&#8217;s get started. I do want to warn though, for finding stuff like this, it requires a lot of patience and a lot of guess work (as you&#8217;ll see below). By no means will this work for every game but I hope this will help somehow. For this I recommend you read the document [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=esperknight.wordpress.com&amp;blog=1161048&amp;post=14&amp;subd=esperknight&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Alrighty, let&#8217;s get started.</p>
<p>I do want to warn though, for finding stuff like this, it requires a lot of patience and a lot of guess work (as you&#8217;ll see below).  By no means will this work for every game but I hope this will help somehow.</p>
<p>For this I recommend you read the document located here : <a href="http://agtp.romhack.net/docs/dmalog/">DMA Transfers, Compression, and You</a></p>
<p>This document describes how were going to find the font but using a different game called Filerna.  I&#8217;ll of course explain here how I&#8217;m going about finding the font as well.</p>
<p>For our utilitie I recommend Geiger&#8217;s Snes9x Debugger located here : <a href="http://www.romhacking.net/">Romhacking.net</a>, click on Utilities, from the category dropdown select Special Emulators/Debuggers, for Platform dropdown, select Super Nintendo and click ok.</p>
<p>And also ZSNES (it&#8217;s easier to dump the VRAM with this).  <a href="http://www.zsnes.com/">ZSNES</a></p>
<p>For our tile editor, I recommend YY-CHR located at Romhacking.net, search for YY-CHR.<span id="more-14"></span></p>
<p>Load up the game in ZSNES and play past the start screen up to the first screen with the talking head.</p>
<p>Go ahead and save using a save state.  Now load this up in YY-CHR.  Go ahead and start scrolling and seeing if you can find anything and play around with the tile modes.</p>
<p>If you read the above log/tutorial you&#8217;ll know that $20C13 is where VRAM starts, $C13 is where bank 1 of RAM starts (bank $7E), $10C13 is where bank 2 of RAM starts ($7F).</p>
<p>Looking through this you&#8217;ll notice that the font is not in RAM (it was worth a shot&#8230;) but it is located in RAM at $2AC24 set to tilemode 2BPP GB (I&#8217;ve noticed quite a bit of games use this for fonts)</p>
<p>So now we have a choice.  We can use this to find our font decompression routine or we can use this to possibly find the text  decompression routine.  I chose the latter so that&#8217;s what we&#8217;ll go with <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Alrighty, so now let&#8217;s make an educated guess.  Let&#8217;s assume our table starts at $00 = 0, $10 = G, $20 = W, etc etc.</p>
<p>This could possibly be wrong but we&#8217;ll go with this for right now.</p>
<p>So let&#8217;s think about how we&#8217;ll go about this.</p>
<p>First we create our table so we&#8217;ll know what the possible values of our characters will be.  The first value is usually a space, so make sure to do set $00 = (space), then start with the rest of the table.  It is possible it&#8217;s not a space but most likely if you don&#8217;t see a space character within the table itself, it&#8217;s the first character (as is with this game since if you notice there are no empty blocks for where a space may reside).</p>
<p>Second we find a line that is easy for us to read and use our table for.</p>
<p>Third we trace up to the showing of this line from some starting point.</p>
<p>With this in mind, let&#8217;s go!</p>
<p>Alrighty, go ahead and close ZSNES if you haven&#8217;t already, we&#8217;re done with this for right now.</p>
<p>Instead fire up Geiger&#8217;s SNES9X and load up SMT If (it breaks upon opening a rom so click Run).  Play up to the face again.  Looking at this line I couldn&#8217;t read a lot of it or match it up to our table above.  So go ahead to the next one.  Looking at this we have a nice long run of characters we an match up with. So let us reset and the fun start&#8230;</p>
<p>For our options in SNES9X, uncheck the squelch part (which set it&#8217;s so if something occurs again, it won&#8217;t show up, basically used for loops).  You could uncheck the split but I wouldn&#8217;t recommend it as it&#8217;ll chunk up the files and this can get quite huge.</p>
<p>Once you&#8217;re up to the first dialogue entry of the talking head, click Step Into.  Now click the CPU checkmark under logging.  This&#8217;ll start logging from where were at.  We clicked the step into so we can try to keep the file down in size.  Now click Run and hit the button to advance the dialogue as quick as you can.  Once the dialogue shows up for the second entry click the CPU checkmark to uncheck it.</p>
<p>Now here&#8217;s where Notepad++ comes in handy.  Go ahead and load up all of the files in Notepad++.  Now let&#8217;s look for the letters we see in Snes9x.  We&#8217;ll look for the A in ANATA.  ANATA = 25 39 34.  We can probably guess that it&#8217;ll be loaded into A, and the first 2 bytes will be set to 00, the rest to our letter.  So let&#8217;s look for A:0025.  Search for this in all open files.  Now look for something storing this letter&#8230;</p>
<p>Our first hit is $03/94BC 8D 04 05    STA $0504  [$03:0504]   A:0025</p>
<p>If we look above, we can see it&#8217;s loading it off something that is indexed by Y and actually comes up as $8025.</p>
<p>So we think this may be a possible match, let&#8217;s look for $03/94BC to see if it repeats&#8230;</p>
<p>Search for the next one using a normal search.  We should hit upon $03/952B B7 B4       LDA [$B4],y[$20:E1AA]   A:E19C<br />
Look at the next line to see what A will be after this load.  Well look at that, it&#8217;s $8039!  (Which changes to $0039 further down&#8230;)</p>
<p>Let&#8217;s search the next one&#8230;</p>
<p>Now we see $4000.  No big deal, let&#8217;s keep going as sometimes there&#8217;s codes embedded to tell the loop what to do.</p>
<p>Next one is $8047!  I think we found our decompression loop!</p>
<p>Now here comes the hard part&#8230; figuring out how it works and writing our own utility to decompress the scripts&#8230;</p>
<p>And with this I bid everyone a found farewell!  Till next time!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/esperknight.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/esperknight.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/esperknight.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/esperknight.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/esperknight.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/esperknight.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/esperknight.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/esperknight.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/esperknight.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/esperknight.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/esperknight.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/esperknight.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/esperknight.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/esperknight.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=esperknight.wordpress.com&amp;blog=1161048&amp;post=14&amp;subd=esperknight&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://esperknight.wordpress.com/2009/05/14/finding-the-text/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d1f03a7662460a4baeb8e589aa4cce51?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">esperknight</media:title>
		</media:content>
	</item>
		<item>
		<title>Introduction</title>
		<link>http://esperknight.wordpress.com/2009/04/28/introduction/</link>
		<comments>http://esperknight.wordpress.com/2009/04/28/introduction/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 00:52:32 +0000</pubDate>
		<dc:creator>esperknight</dc:creator>
				<category><![CDATA[romhacking]]></category>

		<guid isPermaLink="false">http://esperknight.wordpress.com/?p=3</guid>
		<description><![CDATA[Welcome one and all! Looking around I noticed there really aren&#8217;t too many tutorials/howto that go into the assembly side of hacking games.  I&#8217;m hoping with this blog that I can go into some of how this is done.  I&#8217;m only talking about how to figure out compression/encryption schemes for graphics and text though.  I&#8217;m [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=esperknight.wordpress.com&amp;blog=1161048&amp;post=3&amp;subd=esperknight&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Welcome one and all!</p>
<p>Looking around I noticed there really aren&#8217;t too many tutorials/howto that go into the assembly side of hacking games.  I&#8217;m hoping with this blog that I can go into some of how this is done.  I&#8217;m only talking about how to figure out compression/encryption schemes for graphics and text though.  I&#8217;m in no way talking about cracking a game to get around copyright protection so if you&#8217;re looking for that or asking how to go about doing it, you might as well leave as I can&#8217;t help you there.</p>
<p>For the best place to find documents relating to assembly hacking (and rom hacking in general), check out <a href="http://www.romhacking.net">Romhacking.net</a>.  I&#8217;ll be referencing some of the docs here pointing out the techniques I learned from them that we&#8217;ll apply.</p>
<p>For the first game we&#8217;ll be looking at the font and text in Shin Megami Tensei If&#8230; for the SNES by Atlus.</p>
<p>I recommend checking out Romhacking.net and looking at the docs there on the SNES.  Also, I&#8217;m not teaching how to romhack here (although I may explain some things) so I definitely recommend looking at some of the newbie guides on there.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/esperknight.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/esperknight.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/esperknight.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/esperknight.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/esperknight.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/esperknight.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/esperknight.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/esperknight.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/esperknight.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/esperknight.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/esperknight.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/esperknight.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/esperknight.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/esperknight.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=esperknight.wordpress.com&amp;blog=1161048&amp;post=3&amp;subd=esperknight&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://esperknight.wordpress.com/2009/04/28/introduction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d1f03a7662460a4baeb8e589aa4cce51?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">esperknight</media:title>
		</media:content>
	</item>
	</channel>
</rss>
