ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax
It is currently Sat Aug 13, 2022 3:29 am

All times are UTC




Post new topic  Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Thu Mar 10, 2022 2:18 pm 
User avatar

Joined: Thu Mar 10, 2022 1:10 pm
Posts: 4
can i supply parameters with a 0 if i dont want to use any parameters? and how will i get outsz? also im dealing with namco museum remix lzss files, should i change init_chr to '\0'? (line 300 of included/lzss.c)
Code:
int lzss_compress(u8 *in, int insz, u8 *out, int outsz, u8 *parameters)


Top
   
PostPosted: Thu Mar 10, 2022 3:27 pm 
User avatar

Joined: Tue Jan 18, 2022 12:21 am
Posts: 160
garan wrote:
can i supply parameters with a 0 if i dont want to use any parameters? and how will i get outsz? also im dealing with namco museum remix lzss files, should i change init_chr to '\0'? (line 300 of included/lzss.c)
Code:
int lzss_compress(u8 *in, int insz, u8 *out, int outsz, u8 *parameters)


http://aluigi.org/bms/namco_museum.bms


Top
   
PostPosted: Fri Mar 11, 2022 2:00 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 12982
@garan
As far as I understand you want to make a tool for decompressing the SSLZ/LZSS files of that format.

Since it's just a simple lzss with init_chr set to 0 you don't need quickbms or the lzss.c in quickbms, you can use any of the many lzss source code available for any language (as long as the settings are the same) and write your own tool in few lines.

Anyway if you want to use lzss.c from quickbms you can remove any reference/operation to "parameters" and then replacing ' ' in the two init_chr (static and lzss_init) with 0.


Top
   
PostPosted: Sun Apr 03, 2022 9:28 pm 
User avatar

Joined: Thu Mar 10, 2022 1:10 pm
Posts: 4
.

how should i use lzss.c?
i changed the parameters, messed with init_chr and removed references to `parameters` but i dont know how i should go about compressing memory.
how will i obtain `outsz` mentioned in the lzss_compress function declaration?


Top
   
PostPosted: Mon Apr 04, 2022 12:06 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 12982
out is the output buffer, outsz is its size.
Usually out/outsz must have the same size of the input buffer, better if slighly bigger in case the input can't be compressed.
Example:

outsz = insz;
out = malloc(outsz);
outsz = lzss_compress(in, insz, out, outsz);


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 5 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited