Author
|
Topic: NDS LZ77 implemtation specs? (Read 529 times)
|
Bobbias
Guest
|
|
« on: September 28, 2007, 04:33:40 am » |
|
I'm trying to write my own program to decompress and re-compress LZ77 compressed files in the DS, but since there are so many different variations on the algorithm, and I'm not exactly good at reading the math versions published in the official documents. I'm paranoid about getting this right, because I'd rather not waste a bunch of time writing something that doesn't work right, so if anyone can help me find something that explains the LZ77 algorithm well without going overboard (and can maybe confirm it's the same one the DS uses), I'd be really appreciate it.
|
|
|
|
Normmatt
Guest
|
|
« Reply #1 on: September 28, 2007, 05:33:34 am » |
|
The NDS LZ77 is the same implementation as the GBA LZ77 except you can use callbacks in the NDS version. Check out some of the various emulator source codes fro both gba and nds and see how the decompression is implemented
|
|
|
|
Bobbias
Guest
|
|
« Reply #2 on: September 28, 2007, 05:43:19 am » |
|
Alright, I'm doing this because both of the tools hosted here don't work for me. One of them seems only for graphics, and the other botched to decompression and crashes when I try to re-compress the resulting file. I wish they'd work right, but at least you guys'll get a decent working all purpose LZ77 decompresser when I finish.
|
|
|
|
Normmatt
Guest
|
|
« Reply #3 on: September 28, 2007, 06:53:39 am » |
|
which tools did you try? I've never had any problems with GBADecmp
|
|
|
|
Bobbias
Guest
|
|
« Reply #4 on: September 28, 2007, 11:48:19 am » |
|
I did, I extracted the files individually before using it, but from a ~300k file, it only gave me ~50k or so output. And when I tried to re compress it, it just crashed.
|
|
|
|
DaMarsMan
Guest
|
|
« Reply #5 on: September 28, 2007, 12:44:48 pm » |
|
Have you considered it could be a different format compression?
|
|
|
|
Ryusui
Guest
|
|
« Reply #6 on: September 28, 2007, 12:54:22 pm » |
|
It happens. Sylvanian Families 5's title screen is LZ-compressed, but not using the native GBA format.
|
|
|
|
Bobbias
Guest
|
|
« Reply #7 on: September 28, 2007, 12:56:19 pm » |
|
Well, Tahaxan first warned me that the files were likely compressed, I just wanted to get the raw data out. Then, I posted on their forums asking about what's going on, and someone replied saying that most of the files were LZ77 compressed, and the others were the fonts. I know a bit about the algorythm, such as what I LZ77 compressed file looks like, and they certainly fit the description. Plus, since it's a DS game, it's not likely that they'd opt for something other than LZ77 or a combination between Huffman and LZ77.
|
|
|
|
Solid One
Guest
|
|
« Reply #8 on: October 01, 2007, 09:07:57 am » |
|
you could try other decompressing programs. like GBAmdc or unLZ.
all those programs recompress stuff in different ways. you'll get different results, and maybe even non-crashing ones.
|
|
|
|
Bobbias
Guest
|
|
« Reply #9 on: October 01, 2007, 10:38:40 am » |
|
After talking with some people, I think it was just being lame and decoding the first file in the archive, the bins seem to be multiple file archives and instead of simply decompressing the entire thing, it chokes when it hits the next file in the archive. I'm gonna have offsets to split the files soon then i'll try again with gbadecmp.
|
|
|
|
|