need help editing graphics (the format is .chr)

Discussion in 'NDS - ROM Hacking and Translations' started by psycoblaster, Sep 25, 2008.

  1. psycoblaster
    OP

    Member psycoblaster Divine

    Joined:
    Jan 26, 2008
    Messages:
    2,132
    Location:
    Seoul.. (in Korea)
    Country:
    Korea, South
    a failed post does not exist in a failed thread
     
  2. HernanZh

    Member HernanZh GBAtemp Regular

    Joined:
    Apr 6, 2008
    Messages:
    178
    Location:
    The Netherlands
    Country:
    Netherlands
    Would help if you'd actually add some info about .chr. All I can see from that screenshot, that it's 4bpp and it's tiled. You already know that. Usually I would open an image file in a hex editor first to see what kind of other data it contains. (headers, multiple graphics, tile maps, palettes etc.)
    1. Can't tell from the info you're giving whether a palette is inside the chr file or a seperate file. I know tile molester can apply a palette to the image, but I've never really worked with tile molester, so I don't know how that works.
    2. Judging from those stray pixels, I guess the chr file has a header. Usually in any tile editor, you can set an offset, so you can 'push' the pixels down.
     
  3. psycoblaster
    OP

    Member psycoblaster Divine

    Joined:
    Jan 26, 2008
    Messages:
    2,132
    Location:
    Seoul.. (in Korea)
    Country:
    Korea, South
    a failed post does not exist in a failed thread
     
  4. HernanZh

    Member HernanZh GBAtemp Regular

    Joined:
    Apr 6, 2008
    Messages:
    178
    Location:
    The Netherlands
    Country:
    Netherlands
    [​IMG] that doesn't help much either. Send me a file or two and maybe I can see what that header is for.
     
  5. psycoblaster
    OP

    Member psycoblaster Divine

    Joined:
    Jan 26, 2008
    Messages:
    2,132
    Location:
    Seoul.. (in Korea)
    Country:
    Korea, South
    a failed post does not exist in a failed thread
     
  6. HernanZh

    Member HernanZh GBAtemp Regular

    Joined:
    Apr 6, 2008
    Messages:
    178
    Location:
    The Netherlands
    Country:
    Netherlands
    Ok, so I think .chr files work like this
    (sorry for making it a bit of a long story):
    chr files have 9 subfiles. (I can't guarantee this is for all chr files) And the header contains the lengths of the subfiles (32bit integers). The first value is 0x00600000 , it's little endian so flip the bytes and you'll realise this file is 6000 bytes long. That means the first file is at 0x24 (length of header) all and goes all up to 0x6023. (0x6024 is the next file)
    This file contains an image stored in tiles.

    The second file is what I call a map file, Puyo Puyo had a shitload of these and they can be quite awkward to work with if you don't know what to do with them. (Quick explanation: a map file contains the tile arrangement of an image, that's why I call them map files, because they map the tiles.) HOWEVER: apparently this game (it's Ys I presume?) hardly makes use of this, this game doesn't store its tiles "efficiently". In a tile editor, this file would appear as vertical stripes. I shouldn't talk about this too much, I can explain a lot about them, but it's not so interesting for your case.

    The third file is an image again, the 4th a map file, etc. However the 9th file appears to be palette files. I recognize the values 0xFF7F (this is white) and 0xE003 (a yellow, usually used for transparent color), so I'm very sure this contains palettes.

    Now back to your original question about editing these: if you want to use tile molester, I'm afraid I can't really say much about it. I'm sure it's capable of editing this particular image file, try to set the offset to 0x24 and make the window 256 pixels wide (32 tiles). Personally my approach would be making my own tile editor (simply because I don't like any tile editor that is around on the internet) and customize it for .chr files, but that I don't have anything to say on that of course [​IMG].
     
  7. xvirus

    Member xvirus GBAtemp Regular

    Joined:
    Sep 30, 2006
    Messages:
    121
    Country:
    United States
    I can't quite be positive about this but it seems that say... 0x0 to 0x23 is some unknown header, 0x24 to 0x6024 store the image, 0x6025 to 0x6624 looks similar to a NSCR file so maybe a map? and its a long shot but 0x19C24 to 0x19E24 could possibly store the palette since it doesn't match any of the other areas.

    Edit: whoops, looks like someone beat me with a much better reply XD
     
  8. psycoblaster
    OP

    Member psycoblaster Divine

    Joined:
    Jan 26, 2008
    Messages:
    2,132
    Location:
    Seoul.. (in Korea)
    Country:
    Korea, South
    a failed post does not exist in a failed thread
     
  9. HernanZh

    Member HernanZh GBAtemp Regular

    Joined:
    Apr 6, 2008
    Messages:
    178
    Location:
    The Netherlands
    Country:
    Netherlands
    I meant that a map file will appear as vertical stripes if you would open them in a tile editor. Besides these are horizontal [​IMG] your offset just isn't right.
     
  10. psycoblaster
    OP

    Member psycoblaster Divine

    Joined:
    Jan 26, 2008
    Messages:
    2,132
    Location:
    Seoul.. (in Korea)
    Country:
    Korea, South
    a failed post does not exist in a failed thread
     
  11. DarthNemesis

    Member DarthNemesis GBAtemp Maniac

    Joined:
    Feb 19, 2008
    Messages:
    1,208
    Country:
    United States
    For a 16-color palette, you need to look around the file for a 32-byte block of seemingly random data (as opposed to repetitive image data). The end of the file is a good place to start.

    Once you have a guess, use Palette -> Import From -> This File, enter the offset in decimal with a size of 16, and hit OK. Keep trying different offsets like this until you one that produces the correct image.
     
  12. psycoblaster
    OP

    Member psycoblaster Divine

    Joined:
    Jan 26, 2008
    Messages:
    2,132
    Location:
    Seoul.. (in Korea)
    Country:
    Korea, South
    a failed post does not exist in a failed thread
     
  13. psycoblaster
    OP

    Member psycoblaster Divine

    Joined:
    Jan 26, 2008
    Messages:
    2,132
    Location:
    Seoul.. (in Korea)
    Country:
    Korea, South
    a failed post does not exist in a failed thread
     
  14. DarthNemesis

    Member DarthNemesis GBAtemp Maniac

    Joined:
    Feb 19, 2008
    Messages:
    1,208
    Country:
    United States
    Try reducing the canvas size so that the screen doesn't show the entire image.
     

Share This Page