Recreate a CTPK File - Have some problems

Discussion in '3DS - ROM Hacking, Translations and Utilities' started by xXDungeon_CrawlerXx, Nov 11, 2015.

  1. xXDungeon_CrawlerXx
    OP

    xXDungeon_CrawlerXx GBAtemp Maniac

    Member
    1,202
    529
    Jul 29, 2015
    Liverpool
    Hey Guys,

    I want to edit a CTPK File (a Texture) but I've a problem now.
    I found out that the original File uses RGBA4-Format but no CTPK-Tool is able to create a file in this format.
    Now I know that I can create a BCLIM in this format and copy the CTPK-Header (0x00 - 0x7F) to this bclim file + removing the last few bytes of the bclim file.
    Now I ran into a other problem:
    The CTPK-Files of this rom are a bit different. Do you find the difference between the original File and the recreated file?
    SCREENSHOT
    exactly!
    Every single bit of the original file (excluding the header) is -1 of the recreated file.

    So my question:
    Someone who can help me by creating a tool which ADD "1" of every single bit of a file?

    I tried to use the recreated file but the game crashes when It tries to load it.
     
    Last edited by xXDungeon_CrawlerXx, Nov 11, 2015
  2. Jwiz33

    Jwiz33

    Banned
    2,654
    1,523
    Jun 5, 2014
    United States
    in the illuminati headquar—I have said too much!
    Same thing happens to me with Battleminer. What game is this?
     
  3. xXDungeon_CrawlerXx
    OP

    xXDungeon_CrawlerXx GBAtemp Maniac

    Member
    1,202
    529
    Jul 29, 2015
    Liverpool
    It's the Nisekoi Manga.
    Need to change some images/textures for custom Mangas.
     
    Jwiz33 likes this.
  4. xXDungeon_CrawlerXx
    OP

    xXDungeon_CrawlerXx GBAtemp Maniac

    Member
    1,202
    529
    Jul 29, 2015
    Liverpool
    Anyways, I got it!
    I wrote my own tool to add 0x11 to every byte of the file.
    It isn't the best solution but it works:
    Sourcecode
     
  5. The Real Jdbye

    The Real Jdbye Always Remember 30/07/08

    Member
    GBAtemp Patron
    The Real Jdbye is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    12,112
    5,180
    Mar 17, 2010
    Norway
    Alola
    Have you checked what happens if a byte is F0 or larger before adding? Does it roll around to 00? Or does that never occur?
     
  6. xXDungeon_CrawlerXx
    OP

    xXDungeon_CrawlerXx GBAtemp Maniac

    Member
    1,202
    529
    Jul 29, 2015
    Liverpool
    In the recreated file (RGBA4 Format) the highest byte is "EE".
    So F0 never appears, no need to check it ;D

    Tested it: FF will change to 10 but all my recreated files doesn't contain bytes Higher than EE
     
    Last edited by xXDungeon_CrawlerXx, Nov 12, 2015