crunchers with c and asm sources
Hey guys, I'm looking for a data cruncher for my current project, and I'm hoping to not write one from scratch. Do you know if there are some good ones out there that:
1. have c source for the cruncher (so I can run it on PC) 2. have asm source for decruncher, so it runs on an unaccelerated a500 3. deals with raw data, not amiga hunks 4. is fast at decrunching Have any of you ever used (or seen) any code that can help with this? |
Back in the day of PSX demo coding Gargoyle/Polka Brothers (if memory serves me right) ported ByteKiller to C. I should still have the source somewhere if that helps you? Decruncher in assembler is not a problem either of course. If you can live with the (nowadays) poor crunching efficiency it should be exactly what you need.
|
There was also a C port of the RNC mode 1 decruncher (and there is a PC native dos exe for propack to crunch your data), which was quite a good packer although perhaps not fast enough decrunch for you. I believe the C port was intended for the Nintendo64 scene - if you can find a mirror of the old "Dextrose" website you might track it down.
Also there is a short/fast lz77 and lz78 implementation by Ray/TsCC which comes with 680x0 decrunch and C source. |
I have asm code for my own LZ-variant I wrote for Mr Beanbag, I recently wrote a much faster compressor but I haven't got round to writing the decoder yet :/
|
the Bytekiller c source would be great. Could you post it? I remember Bytekiller from back in the day, I may even have used it.
The Ray/TsCC lz77 code is also an option, thanks for the tip. It sounds like both of these have been used in multiple productions, so I will look at them first. I looked at RNC before, but I couldn't find source for the cruncher, only for the decruncher. I didn't want to rely on an old dos program for crunching :-) thanks for the help |
Source for a RNC cruncher can be found here: http://www.yoda.arachsys.com/dk/utils.html
|
Quote:
http://eab.abime.net/showthread.php?t=65683 |
thanks again, you guys rock :-)
|
Hi,
I can't make RNC from Dungeon Keeper Small Utilities work It doesn't run natively, so I tried running it on DOSBox, but I get the usage each time, or "internal fault", whatever the options I'm trying. I checked the source code, and it seems that "mode" isn't initialized. So I recompiled, and after fixing the "mode" stuff, I got "unable to handle leeway > 255"... Sounds that this one is very broken. Anyone could make that work? it seems to be the only program able to compress RNC files with C source (a long time ago I tried to make it work, and I could compress some files but on some other files compression/decompression failed so the program is not portable to 32/64 or even gcc I suppose) |
https://github.com/AxisOxy/Planet-Ro...s/doynamite68k
This has a portable C compressor with asm depacker. |
Thanks, bit I want to unpack/pack for RNC because of a project involving a classic game which uses RNC (same problem as with SWOS team editor)
|
|
Hi,
Just rebuilt the RNC/DERNC from Dungeon Keeper Utilities (in the zone) for windows (sources included) I have fixed the command line (well, at least RNC "file" works, -o doesn't, and it didn't even with the original exe on dosbox: never could make the options work) & a few other things. - dernc: rnc decompressor: works great - rnc: rnc compressor: decompresses OK with dernc or xfddecrunch. I still had crashes with some games, so maybe there's a limitation with some game decrunchers (I know there's a CRC which isn't there in some cases, but that doesn't seem to be that) I'll let you test it. |
Quote:
Most (i.e. not the old RNC1) of RNC1/RNC2 files do have CRC for both packed and unpacked data thus verifying RNC-files should be straightforward ... However, in my tests I have seen unexpected CRC-failures and concluded that there can only be modded implementations used in many places :rolleyes |
I think that the CRC is ignored most of the time. It's useful to tell between old and new RNC1: if CRC fails, then it's not CRC it's RNC1. WHDLoad & CD32load use that property to know which unpacking method to use with RNC1 headers.
The issue I have with this RNC packing code is that it doesn't work with asm unpackers from games (Magic Pockets PC & Amiga version crash when I feed it with this packed file). XFDdecrunch has no issue depacking it, though. Any thoughts? |
Quote:
This is what I use: Code:
if (hdr==FourCC('RNC\001')) Quote:
|
> Do you have example files? I could peek in those what they are made of
I was hoping you'd say that :) I zoned "rnc_files.zip" for you. There are 3 files in it: - NEW1.PIN: the file packed with rnc (dungeon utilities) - NEW1_orig.PIN: original file packed with "official" propack - NEW1_orig_unp.PIN: unpacked file I hope you can find why it fails. Do you have any RNC cruncher source handy? You've shown some nice C++ code for RNC unpack, maybe you have the pack side too and want to share? |
Quote:
Happy news is that my own decompressor actually detected this just fine :D Quote:
|
I got it working by adding this (your luck might be different, the rnc seems to be very sensitive to compilers...)
Here is a diff (to the original sources). In theory the chunk count should not be filled at all, but I can see something is there... Code:
--- utilsrc/rnc.c |
that's it!! now it decrunches properly and doesn't crash anymore.
The funny part is that I figured that out when making a diff between original & DK crunched files, but somehow I must have zapped it or changed the value in the binary and overwritten with a bad file again. That's the first RNC packer with source freely available that works. To reduce the risk of compiler abuse, I fixed the "int" as 16-bit values (like the original compiler did). There was also a lot of warnings & undefined variables. Now it works fine, thanks a million. Source & exes in the zone. Will put that on my website too. |
All times are GMT +2. The time now is 03:26. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.