don't click here

Is there a Commandline Kozinski Compressor?

Discussion in 'Engineering & Reverse Engineering' started by Qjimbo, Apr 24, 2004.

Thread Status:
Not open for further replies.
  1. Qjimbo

    Qjimbo

    Your friendly neighbourhood lemming. Oldbie
    Basically I'm trying to code a level art editor and I'm unable to use the KENS Libraries (I don't code in C/C++,Delphi or VB), so a commandline tool is far more practical for me.
    It's either this or I'll have to code my own Kozinski compressor <_<
     
  2. Kampfer

    Kampfer

    Member
    1,609
    5
    18
  3. Qjimbo

    Qjimbo

    Your friendly neighbourhood lemming. Oldbie
    Thanks, but I have tried that one and unfortunatly it's windows based and doesn't take command line flags :(

    The manual for the language I program in called "BBC Basic for Windows" does comment that you can use any DLL, though I don't really understand what it says in the help file:
    *head explodes*
     
  4. Quickman

    Quickman

    be attitude for gains Tech Member
    5,604
    19
    18
    :x
    omg porjcet
    Level art uses the Sega compression.
     
  5. Magus

    Magus

    Fallen Hacker From The Past Tech Member
    157
    0
    16
    Paris, France
    Translating Grandia 2 PC to French
    Funny programming language. Anyways, something like this should work:

    SYS "LoadLibrary", "KOSINSKI.DLL"
    SYS "GetModuleHandle", "KOSINSKI.DLL" TO hKosinski%
    SYS "GetProcAddress", hKosinski%, "KComp" TO KComp%
    SYS "GetProcAddress", hKosinski%, "KDecomp" TO KDecomp%

    To decompress (example):
    SYS KDecomp%, "Sonic3.bin", "AIZ1_BTiles.bin", &1A566A, 1 TO RetVal%
    The first parameter is the file from which you want to extract the data. The second one is a new file that will receive the decompressed data, the next parameter is the address to start decompressing from, and the last parameter indicates whether the data is in standard Kosinski format (0) or moduled Kosinski format (1).

    To compress (example):
    SYS KComp%, "AIZ1_BTiles.bin", "AIZ1_BTiles_C.bin, 1 TO RetVal%
    The first parameter is the file you want to compress. The second one is a new file that will receive the compressed data, and the last parameter indicates whether the data is in standard Kosinski format (0) or moduled Kosinski format (1).


    Other notes:
    * If you decompressed using the moduled kosinski, you'll have to use moduled kosinski when recompressing. If you decompressed using the standard kosinski, you'll have to use standard kosinski when recompressing.
    * When recompressing, the data is written to a new file that you will have to insert into the ROM by yourself. This was done to avoid the program to overwrite data if the recompressed data is larger.


    BTW, note that I never used that programming language, so the code I wrote may be incorrect. Make the necessary adjustments.
     
  6. Qjimbo

    Qjimbo

    Your friendly neighbourhood lemming. Oldbie
    Shhhhhhh it's leet! :D

    Wow thank you!!!!!
    I was on my way to figuring it out (by working out the code in the kisinski.h file), but your kind help definatly speeded up the process. Also it should be
    But I can hardly complain when you ported it to a language you didn't know!
    Thanks again :(
     
  7. Magus

    Magus

    Fallen Hacker From The Past Tech Member
    157
    0
    16
    Paris, France
    Translating Grandia 2 PC to French
    Glad I could help. :(

    You know what is funny ? The fact that I did a mistake on the function names while I'm the author of that library ! :D

    While I'm at it, I'm gonna ask if everything is working fine. have you tryed to call the functions ?
     
Thread Status:
Not open for further replies.