don't click here

Puyo Tools

Discussion in 'Technical Discussion' started by NickW, Sep 25, 2008.

  1. NickW

    NickW

    Member
    http://code.google.com/p/puyotools/

    This is a project by me and nmn over at Puyo Nexus (see topic) that allows you to decompress files, create/extract archives from various Puyo Puyo games (some of the supported archive formats are also used in Sonic games). It's GUI based and requires .NET Framework 3.5.

    Currently, it contains support for decompressing CNX, CXLZ, LZ01, LZSS/LZ77, PRS, and ONZ compressed files, and a archive creator/extractor for ACX, AFS, GNT, GVM, MDL, MRG, NARC, ONE (Sonic Unleashed & Storybook Series), PVM, SNT, SPK, TEX, TXAG, and VDD. My AFS extractor has been able to extract filenames for archives that AFS Explorer has not been able to (though if it can't find filenames the filenames will probably be junk data.)

    Also it includes VrSharp by nmn and me which is used for GVR, SVR, and PVR image support (not all formats are supported and some that are supported may display the image correctly), and GimSharp by me which is used for PSP GIM image support.

    Oh, the downloads are on the page at the topic of this post.
     
  2. P.P.A.

    P.P.A.

    SONIC 2 SUCKS, SONIC CD FOREVER Member
    644
    0
    0
    Germany
    Sonic MD (Currently: Art for Zone 3)
    Can you extract stuff from the Saturn version of PPS too?
     
  3. British Gaijin

    British Gaijin

    Go play Nier. Member
    154
    0
    0
    Great Britain, UK
    The EscapeRoute Show
    I think you have just have won so much harder than anyone has ever before.
    If I can do what I wish to do with these tools, you'll have won my heart. Here's hoping.
     
  4. NickW

    NickW

    Member
    No. Nothing in the Saturn version is stored in archives, but the graphics are in some weird format. The PSX & PC versions can have their graphics ripped though (ironically those 2 versions store their stuff in an archive, grp.dat).


    I hope. :)
     
  5. drx

    drx

    mfw Researcher
    2,254
    350
    63
    :rolleyes:
    Is there any more decompression/compression work that needs to be done?
     
  6. NickW

    NickW

    Member
    CNX & LZ00 decompression still need to be done, along with compression for all of these (compression right now isn't a top priority now, decompression is.) nmn is currently working on LZ00 decompression, If anybody wants to take a look at CNX compression, here is a file:
    http://www.puyonexus.net/files/misc/PUYO32_1555.CNX
     
  7. Meat Miracle

    Meat Miracle

    Researcher
    1,664
    5
    18
    CNX is like the only important format out of all of those.

    make a functional compresser/decomrpesser for that, and I'll translate Madou Monogatari Segasaturn for you. (or at least, write a complete walktrough)

    edit: here is the gallery from Madou Monogatari, the files from the game disc, in CNX format. To me, it looks more like an encryption than compression.
    http://evilboris.sonic-cult.net/madou/cnxgallery.rar
    When decoded to images, they should look like these (the ones on the right, without text), in black and white (no palette).
    http://evilboris.sonic-cult.net/madou/
     
  8. NickW

    NickW

    Member
    I wouldn't be surprised if it is the same image format used in Puyo Sun for Saturn.
     
  9. Meat Miracle

    Meat Miracle

    Researcher
    1,664
    5
    18
    From what I can tell, both MM and PPS on Saturn uses the same formats (for everything - backgrounds, sprites), except for the CNX in MM.

    I've yet to check Wakupuyo Dungeon, though. That one may be different, it also has a hires title screen iirc.
     
  10. Meat Miracle

    Meat Miracle

    Researcher
    1,664
    5
    18
  11. drx

    drx

    mfw Researcher
    2,254
    350
    63
    :rolleyes:
    http://trash.drx.pl/cnx-dec1.0.rar

    Includes Windows executable and source code. You can see how the CNX compression works by looking at the source.

    Most CNX (CNX GMP) files decompress to GMP files, which are like bitmaps, but differently formatted. I made a dump "unpacker" that you can use with the option "-gmp" to extract CNXGMP files straight into BMP files.

    I've been able to decompress any CNX file I came across properly, but I didn't test many. If you find any that don't work, or need a feature that's not in the code, let me know.

    Is there any need for a compressor? I could do that, maybe.
     
  12. NickW

    NickW

    Member
    Hey it works :P Thanks again, drx. The only change you should make (well, I could always do it when I incorporate it into Puyo Tools) is to just check for CNX, 0x2 in the header. Files from Puyo~n use CNX, 0x2, pvr in the header, which causes them to not work, but they will decompress fine when you change the header to CNX, 0x2, GMP.

    In this case I think a compressor would be needed, since unlike CXLZ and LZ01 we are able to edit and play games using modified files.
     
  13. drx

    drx

    mfw Researcher
    2,254
    350
    63
    :rolleyes:
    Yeah, I wasn't sure about checking 0x04-0x07. But it's still the CNX header... I'll try to write a compressor, shouldn't be hard.

    I was a bit puzzled by mode 0 at first, btw. It seemed weird to me, until I discovered I did something very wrong, and it turned out to be padding :P

    edit: btw, in Windows, you can drag and drop a CNX file onto the executable and it'll decompress it automatically
     
  14. NickW

    NickW

    Member
    I added CNX decompression to Puyo Tools now. GMP -> BMP (or PNG) will be added in the next version.
     
  15. Meat Miracle

    Meat Miracle

    Researcher
    1,664
    5
    18
    2 requests
    - when decompressing, save to the file extension inside the cnx file (byte 0x04 to 0x06)
    - process logging to textfile (so it tells what was decompressed, what was demuxed, what was identified as what format, what files were skipped and why, et cetera)

    I could decompress all the files in Madou Monogatari, every graphic shows up wonderfully, the font, found the dungeon maps as well (they seem to be in ASCII), but I couldn't find the #&@!% goddamn game script. I think its in the SEQ files but I can't read anything from them.

    Did any of the previously translated discstation games needed some kind of font tables, or did they just store plaintext?
     
  16. NickW

    NickW

    Member
    I already added that to my current version, which I'll upload soon.

    I never thought about adding that, but I always could. It would be useful.

    I don't know. You should ask Hernan about that.
     
  17. drx

    drx

    mfw Researcher
    2,254
    350
    63
    :rolleyes:
    I was gonna do that in 1.1 but seeing as you can manage the thing just fine, I'll guess I'll leave the rest to you.
     
  18. NickW

    NickW

    Member
    Yea, don't worry about the decompression. I got that taken care of. Same thing with GMP -> BMP (Well, right now it is GMP -> PNG; it's harder to set up the image data and palettes, but C# makes it ridiculously easy to save in different image formats). The compression still needs to be finished though.
     
  19. drx

    drx

    mfw Researcher
    2,254
    350
    63
    :rolleyes:
    Yeah, I'm gonna (probably), but I'm moving tomorrow and I'm not even packet yet lol, and I need some sleep after a party.
     
  20. NickW

    NickW

    Member
    I updated Puyo Tools. CNX decompression will now use the file extension that is defined in the file (unless you tell it not to.) I also added GMP -> PNG conversion (8-bit GMP images only, I don't know if GMP's of other bit-depths exist).