Help! .bclim files to .png?

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

  1. Author
    OP

    Author ****NEWS**FLASH**** 1 /̵͇̿̿/'̿-̅-̅-̅''

    Member
    458
    419
    Aug 30, 2014
    GBAtemp
    Hi GBAtemp.

    As most of you are aware, some over at the Homebrew subforum have been attempting to hack Badge Arcade. We've arrived at an error, however. The badge files are in the .bclim format, and up until now, we've found no solution to extract a .png out of it and repack it back into the .bclim.

    Yes, we already attempted to do this with Kaphotics' tool, bclim2png, which can be found here: https://github.com/kwsch/png2bclim


    Any ideas?
     


  2. Razorzeto

    Razorzeto Darkness can not drive out darkness.

    Member
    182
    216
    Aug 27, 2015
    Currently living in Chile.
    Can you upload a .bclim file?
     
  3. Author
    OP

    Author ****NEWS**FLASH**** 1 /̵͇̿̿/'̿-̅-̅-̅''

    Member
    458
    419
    Aug 30, 2014
    GBAtemp
    Here's one. https://dropfile.to/30bId
    Straightly from Badge Arcade.
     
  4. Kaphotics

    Kaphotics badc0ded

    Member
    610
    460
    Sep 10, 2010
    United States
    Said file has no bclim footer. Looks like its 16bpp.

    Try creating a footer with a hex editor and see if it parses.
     
    Last edited by Kaphotics, Nov 15, 2015
    MasterLel likes this.
  5. MasterLel

    MasterLel You have an error in your SQL syntax;

    Member
    1,240
    449
    Mar 14, 2015
    France
    If you swap files (load def.bclim instead of abc.bclim), does it works ?
     
  6. Author
    OP

    Author ****NEWS**FLASH**** 1 /̵͇̿̿/'̿-̅-̅-̅''

    Member
    458
    419
    Aug 30, 2014
    GBAtemp
    Fancy seeing you here. Thanks for the tip, I'll get on to working.

    edit: I would have thought I'd find a tutorial online, but no luck. Didn't want to sound like an idiot, but I guess I will have to. How do I make a footer?
     
    Last edited by Author, Nov 15, 2015
  7. szymbar15

    szymbar15 GBAtemp Regular

    Member
    263
    176
    Apr 6, 2012
    Poland
    I'll try to do one manually and see if it works.
     
    Author likes this.
  8. MasterLel

    MasterLel You have an error in your SQL syntax;

    Member
    1,240
    449
    Mar 14, 2015
    France
    Copy paste from other bclim files (ones with headers or footers) I think
     
    Last edited by MasterLel, Nov 15, 2015
  9. Kaphotics

    Kaphotics badc0ded

    Member
    610
    460
    Sep 10, 2010
    United States
    [​IMG]

    result in pk3DS:
    [​IMG]

    result in png2bclim (same):
    [​IMG]

    Obviously the footer I used may have not been the best fit, but you'd have to tweak it to maybe show up right. Who knows, maybe they have a custom color palette stored in the game files.
     
    szymbar15 likes this.
  10. Author
    OP

    Author ****NEWS**FLASH**** 1 /̵͇̿̿/'̿-̅-̅-̅''

    Member
    458
    419
    Aug 30, 2014
    GBAtemp
    Thank you!
     
  11. Kaphotics

    Kaphotics badc0ded

    Member
    610
    460
    Sep 10, 2010
    United States
    Correct footer is as follows. Fileformat is 5.

    Code:
    43 4C 49 4D FF FE 14 00 00 00 02 02 28 20 00 00 
    01 00 00 00 69 6D 61 67 10 00 00 00 28 00 28 00 
    05 00 00 00 00 20 00 00
    [​IMG]

    For rebuilding just clip off the last 0x28 bytes of the file I guess.
     
    szymbar15 likes this.
  12. szymbar15

    szymbar15 GBAtemp Regular

    Member
    263
    176
    Apr 6, 2012
    Poland
    Oh, and here I thought I was smart for figuring it out myself a while ago. Nice stuff man :)
    While we're at it, is there any BCLIM specification in the internet? I have a few more files that share the similar fileformat, but they have less or more bytes (like one image I just dumped which has 0x300 bytes) and I don't know what bytes in the footer do I have to edit to make it work.
    This is my file anyway, I added some kind of a footer but I have no idea what size it is.
    https://dropfile.to/wvAl9
    Oops, forgot to call you, @Kaphotics
     
    Last edited by szymbar15, Nov 15, 2015
  13. Kaphotics

    Kaphotics badc0ded

    Member
    610
    460
    Sep 10, 2010
    United States
    https://github.com/kwsch/png2bclim/blob/master/png2bclim/Form1.cs#L879

    That one is odd, probably isn't a bclim since there's 384 pixels (3*2^7), which isn't an even*even dimension.

    Should also investigate if the method of dumping to obtain these files may have an error...?
     
    Last edited by Kaphotics, Nov 15, 2015
    szymbar15 likes this.
  14. szymbar15

    szymbar15 GBAtemp Regular

    Member
    263
    176
    Apr 6, 2012
    Poland
    It turned out that all the BCLIM files are 8192 bytes in there after all, just sometimes the files look as if they are about to end, but they don't until 0x2000 bytes are over.
    Thanks for the documentation, will surely come in handy :)
     
  15. Reserved

    Reserved GBAtemp Regular

    Member
    213
    68
    Mar 14, 2015
    United States
  16. Reisyukaku

    Reisyukaku Onii-sama~

    Member
    1,183
    2,291
    Feb 11, 2014
    United States
    cearp and Reserved like this.
  17. Reserved

    Reserved GBAtemp Regular

    Member
    213
    68
    Mar 14, 2015
    United States
    I'm still lost ;w;

    Whenever I put the .bclim file I provided you into png2bclim, it gives me an "Invalid FileFormat" error. I tried setting the BCLIM Output Format as ETC1 and tried both Square/Rectangle options, yet nothing would load the file and give the .png file I need. Did you use the same program, or the pk3DS one (although I think they're the same, idk)?

    I'm terrible at working with 3DS stuff, lol. pls halp<3
     
  18. Reserved

    Reserved GBAtemp Regular

    Member
    213
    68
    Mar 14, 2015
    United States
    somebody pls help reis died (or didn't care because i'm so b@d)
     
  19. gdkchan

    gdkchan GBAtemp Regular

    Member
    159
    189
    Jul 8, 2015
    Brazil
    it works on the old Ohana3DS (the new one doesnt have support for bclim yet)
     
  20. DarkFlare69

    DarkFlare69 GBAtemp Psycho!

    Member
    4,629
    2,466
    Dec 8, 2014
    United States
    Ohio
    Uh, you do know that EFE can load BCLIM files and then save them as png?