Conversion from a Zlib to QRS MK Armageddon

Textures, recreate headers, conversions, algorithms and parsing of image files
Insoumius
Posts: 6
Joined: Fri Jun 24, 2016 2:28 pm

Conversion from a Zlib to QRS MK Armageddon

Post by Insoumius »

I extract the zlib files from editing on GGS and i get something like this

-Data of the file (80h)
-Palette info (0400h)
-Texture info (x20000h)

The QRS format file it's
- Information 1 (xC0h)
-Texture info from zlib file (x20000h)
- Information 2 (x80h)
-Palette info from zlib file (x400h)
- Information 3 (x20h)



I need a way to convert that files, so i need a way to

ADD information 1

Code: Select all

01 00 00 00 08 00 00 00 00 02 00 00 04 02 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
18 00 00 00 38 80 00 00 80 00 02 00 80 04 00 00
00 02 00 00 04 00 00 00 02 00 00 00 00 00 00 00
00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00
00 00 31 61 02 00 00 20 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 07 20 00 50
03 80 00 00 00 00 00 10 0E 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 51 00 00 00 00 00 00 00
80 00 00 00 00 01 00 00 52 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 53 00 00 00 00 00 00 00
00 A0 00 00 00 00 00 08 00 00 00 00 00 00 00 00



Put texture information of zlib file, 20000h of data starting on 480h of zlib file




Then ADD information 2

Code: Select all

01 80 00 00 00 00 00 10 0E 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 3F 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 47 00 00 50
03 80 00 00 00 00 00 10 0E 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 51 00 00 00 00 00 00 00
10 00 00 00 10 00 00 00 52 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 53 00 00 00 00 00 00 00
40 80 00 00 00 00 00 08 00 00 00 00 00 00 00 00



Add the palette information of zlib file, 400h of data starting on 80h of zlib file


And for finish the file add the information 3 to finish the file


01 80 00 00 00 00 00 10 0E 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 3F 00 00 00 00 00 00 00



The information in codes aren't available on original files so must be added
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Conversion from a Zlib to QRS MK Armageddon

Post by aluigi »

Moved in the correct section but I think that you must post a pre and post example of I doubt someone will check this topic.
Insoumius
Posts: 6
Joined: Fri Jun 24, 2016 2:28 pm

Re: Conversion from a Zlib to QRS MK Armageddon

Post by Insoumius »

I posted on QuickBMS because the idea was do t with that with a script

Here are some examples

Thanks :)
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Conversion from a Zlib to QRS MK Armageddon

Post by aluigi »

Code: Select all

set INFO1 binary "\x01\x00\x00\x00\x08\x00\x00\x00\x00\x02\x00\x00\x04\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00\x38\x80\x00\x00\x80\x00\x02\x00\x80\x04\x00\x00\x00\x02\x00\x00\x04\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x31\x61\x02\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\x20\x00\x50\x03\x80\x00\x00\x00\x00\x00\x10\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x51\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x01\x00\x00\x52\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x53\x00\x00\x00\x00\x00\x00\x00\x00\xa0\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00"
set INFO2 binary "\x01\x80\x00\x00\x00\x00\x00\x10\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x47\x00\x00\x50\x03\x80\x00\x00\x00\x00\x00\x10\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x51\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x10\x00\x00\x00\x52\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x53\x00\x00\x00\x00\x00\x00\x00\x40\x80\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00"
set INFO3 binary "\x01\x80\x00\x00\x00\x00\x00\x10\x0E\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3F\x00\x00\x00\x00\x00\x00\x00"

math DATA_SIZE = 0x80
math PALETTE_SIZE = 0x400
get TEXTURE_SIZE asize
math TEXTURE_SIZE - DATA_SIZE
math TEXTURE_SIZE - PALETTE_SIZE

getdstring DATA DATA_SIZE
getdstring PALETTE PALETTE_SIZE
getdstring TEXTURE TEXTURE_SIZE

log MEMORY_FILE 0 0
append
putdstring INFO1 0xc0 MEMORY_FILE
putdstring TEXTURE TEXTURE_SIZE MEMORY_FILE
putdstring INFO2 0x80 MEMORY_FILE
putdstring PALETTE PALETTE_SIZE MEMORY_FILE
putdstring INFO3 0x20 MEMORY_FILE
append

get SIZE asize MEMORY_FILE
get NAME basename
string NAME + ".qrs"
log NAME 0 SIZE MEMORY_FILE
Insoumius
Posts: 6
Joined: Fri Jun 24, 2016 2:28 pm

Re: Conversion from a Zlib to QRS MK Armageddon

Post by Insoumius »

Wow... thanks a lot

its a way to append other script?

I tried to add it, but it only reads the first file and not the generated with that script
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Conversion from a Zlib to QRS MK Armageddon

Post by aluigi »

I don't know what you mean.
Insoumius
Posts: 6
Joined: Fri Jun 24, 2016 2:28 pm

Re: Conversion from a Zlib to QRS MK Armageddon

Post by Insoumius »

Launch a second script loading the result file for compress each file.

I attached with append codes but it loads the Zlib file and not the QRS one
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Conversion from a Zlib to QRS MK Armageddon

Post by aluigi »

You can't do that, mixing scripts and input/output...

What you can do is just the most simple solution:
- use my script on the files using a new empty folder
- run whatever script you want on the files of that new folder

Otherwise you can try to add the following instruction between my script and your appended other script:
open "." NAME

It will load the new generated file as current file.