Quote from: Majin3 on May 21, 2011, 10:02:43 am
Thanks, guys. I didn't understand it completely, though...
The first example (1FF8): Why is it -8? Isn't FFF-FF8=7? And by looking at the compressed file, the distance to "nce" is even 9.
The third example (0FF7): Once again, isn't it -8? But -9 is right here.
And as for the other 2, I don't get where they should be pointing at all. The second one points to B6 0F 8F (should be 00 4B 02) and the fourth one to 75 B7 1F 08 (should be 00 00 00 00).
But I think I got the rest now at least.
jjjewel, are you planning to write a (de)compressor for that "NDS games that use similar compression"?
Or I guess I could ask the writer of DSDecmp or something to implement this one...
The first example (1FF8): Why is it -8? Isn't FFF-FF8=7? And by looking at the compressed file, the distance to "nce" is even 9.
The third example (0FF7): Once again, isn't it -8? But -9 is right here.
And as for the other 2, I don't get where they should be pointing at all. The second one points to B6 0F 8F (should be 00 4B 02) and the fourth one to 75 B7 1F 08 (should be 00 00 00 00).
But I think I got the rest now at least.
jjjewel, are you planning to write a (de)compressor for that "NDS games that use similar compression"?
Or I guess I could ask the writer of DSDecmp or something to implement this one...
*headdesks* Yeah, it looks like I fudged my math. Add 1 to get the actual distance.
Also, you misunderstand. It looks in the uncompressed data for the snippets, not the compressed. "nce" will be eight characters back from the output address at that time.
Let's look at that "getOnceInstance" sequence again.
get($FF)OnceInst($BA)a($F8)($1F)
When it hits the compression code, the output looks like this:
getOnceInsta
And "length 3, distance 8" tells it that the next snippet is:
getOnceInstance
Get it now?