[Release] Custom Theme Auto Preview Generator

Discussion in '3DS - Homebrew Development and Emulators' started by d0k3, Apr 28, 2015.

  1. d0k3
    OP

    d0k3 3DS Homebrew Legend

    Member
    2,592
    2,609
    Dec 3, 2004
    Gambia, The
    Mainly out of my own need, I put together a little something to automagically generate previews for custom themes (in extdata format). This will use the backgrounds included in the body_LZ.bin file to generate CHMM compatible preview.png files. Alongside the preview.png, it will also generate a visual 'catalog' of your themes (= a folder with correctly named previews of all your themes) for easier selection from PC.

    The attached file contains a small programm that I wrote myself (3DSthmXtb, source code included), DSdecmp (by barubary), Basic Image Converter (by MaQleod) and batch files to make usage as easy as possible. UPDATE: Starting with v0.3, this now also generates the info.smdh file used by CHMM v2.x. The package now also includes NConvert (by XnSoftware team, replaces MaQleods convert) and smdhtool (by 3dstools).

    This will work on Windows 7/8/8.1 only! Also, it will not process 'solid color themes', however noone makes these, anyways.


    How to use
    • Extract all the files from the attached archive into your theme base folder. Your 'theme base folder' is the folder that contains, inside subfolders, your custom themes. Or, in other words, don't extract it to the folder containing body_LZ.bin, extract it to the folder above that. I guess if you managed to get CHMM running, you understand what is meant.
    • To process a single custom theme: Drag and drop the themes folder onto 'process.bat'.
    • To process all the themes in the theme base folder: Just run 'process_all_folders.bat'.
    That's it! Pretty simple, isn't it? Still, be aware that this will overwrite files without confirmation. Don't keep anything important inside your themes folders. And, don't come whining to me if this overwrites your other previews - you have been warned.

    Github repo for this: https://github.com/d0k3/CTAPG
     

    Attached Files:

    Last edited by d0k3, Nov 2, 2015
    xfxmrl, klear, Shaker78 and 9 others like this.


  2. lPolarisl

    lPolarisl GBAtemp Fan

    Member
    334
    92
    Jan 24, 2015
    Hungary
    I believe CHMM does dsplay bmp file, you just need to rename them to .png
     
  3. d0k3
    OP

    d0k3 3DS Homebrew Legend

    Member
    2,592
    2,609
    Dec 3, 2004
    Gambia, The
    I doubt that CHMM will be able to display this BMP format (BMP v5 RGB565, as RGB565 won't work in common BMP v3). If it does, I'll change the scripts to not use PNG, so let me know if you try.
     
  4. d0k3
    OP

    d0k3 3DS Homebrew Legend

    Member
    2,592
    2,609
    Dec 3, 2004
    Gambia, The
    Okay, I tested it - doesn't work. You don't neccesarily have to install ImageMagick, though, you can convert files using another software of your choice, too. In that case just use the no_im_ .BAT files instead of the default ones.
     
  5. lPolarisl

    lPolarisl GBAtemp Fan

    Member
    334
    92
    Jan 24, 2015
    Hungary
    My bad then, I thought I read that somewhere.
     
  6. d0k3
    OP

    d0k3 3DS Homebrew Legend

    Member
    2,592
    2,609
    Dec 3, 2004
    Gambia, The
    In fact, doing what you wrote (renaming the .BMP to preview.png and letting CHMM access that folder) will even crash Homebrew Launcher ;).

    Anyways, I don't like the ImageMagick requirement either, so here's an update for you (see the first post). The ImageMagick requirement was removed. Image conversion functionality is now handled by Basic Image Converter from MaQleod.
     
  7. lPolarisl

    lPolarisl GBAtemp Fan

    Member
    334
    92
    Jan 24, 2015
    Hungary
    So awesome, thanks ^^
     
    d0k3 likes this.
  8. Xsiide

    Xsiide Member

    Newcomer
    26
    15
    Nov 14, 2014
    Cote d'Ivoire
    Stgo
    It works like a charm, I had several themes without preview, and the EFE preview method is so tedious on pc.
     
    d0k3 likes this.
  9. Septimo

    Septimo GBAtemp Regular

    Member
    119
    120
    Apr 23, 2013
    United States
    (Sorry, wrong thread! An irrelevant post used to rest here. I did just use this handy generator, though. Thanks!)
     
  10. d0k3
    OP

    d0k3 3DS Homebrew Legend

    Member
    2,592
    2,609
    Dec 3, 2004
    Gambia, The
    I updated the Custom Theme Auto Preview Generator to also generate the info.smdh file used in CHMM v2.x. It's not perfect, but it is better than nothing. Check post #1 for the download!
     
    dude1709 likes this.
  11. Shadowtrance

    Shadowtrance GBAtemp Addict

    Member
    2,482
    1,513
    May 9, 2014
    Hervey Bay, Queensland
    @d0k3 Don't know if anyone else is getting this or not but with v0.3 I'm getting an error with smdhtool that is included...

    smdhtool.exe - Entry Point Not Found
    The procedure entry point __gxx_personality_sj0 could not be located in the dynamic link library.

    Now if i change smdhtool.exe from the included one ( 91 KB ) and replace it with one i just built from source ( 423 KB ) i don't have any issues at all.

    Thought I'd point that out. :)
     
    Shaker78 likes this.
  12. d0k3
    OP

    d0k3 3DS Homebrew Legend

    Member
    2,592
    2,609
    Dec 3, 2004
    Gambia, The
    Good point! Can you give me that smdhtool? :)
     
    klear likes this.
  13. Shadowtrance

    Shadowtrance GBAtemp Addict

    Member
    2,482
    1,513
    May 9, 2014
    Hervey Bay, Queensland
  14. Shaker78

    Shaker78 GBAtemp Regular

    Member
    119
    107
    Jan 17, 2007
    Gambia, The
    With the smdhtool.exe posted by Shadowtrance and the following two *.dll files
    (libgcc_s_dw2-1 and libstdc++-6) it works now perfect for me.
     
    Last edited by Shaker78, Oct 9, 2015
  15. d0k3
    OP

    d0k3 3DS Homebrew Legend

    Member
    2,592
    2,609
    Dec 3, 2004
    Gambia, The
    Dammit, there should be no additional library requirements... @Shadowtrance , could you compile again, but add this to the CFLAGS / CXXFLAGS?
    Code:
    -static-libgcc -static-libstdc++ -static
    I'd do it myself, but I have trouble compiling that right now and you already seem to have a compilable Makefile.
     
  16. Shadowtrance

    Shadowtrance GBAtemp Addict

    Member
    2,482
    1,513
    May 9, 2014
    Hervey Bay, Queensland
    Yep done. :)
    smdhtool https://mega.nz/#!SJgxACyK!QAxT6LgARcKJRqik2TDXAAl0r8mXuH6Hs0rk8PFLgNo
    3dstools-master source https://mega.nz/#!OYIGHLLY!cyUUUGPUxytj3sUOvJgVEj04WPZDokM5XnJhitATfMY
     
    d0k3 and klear like this.
  17. d0k3
    OP

    d0k3 3DS Homebrew Legend

    Member
    2,592
    2,609
    Dec 3, 2004
    Gambia, The
    I included the fixed smdhtool by @Shadowtrance into the main release. Generating info.smdh should now work properly for everyone! As for the version number... The Preview Extractor (which is a small program I coded myself) hasn't changed since v0.2, so its version number is still at 0.2. The whole package - the Preview Generator -, however is at v0.3 now. I added a new line to the batch files to make that clear.

    BTW, if you don't like the metainfo in the info.smdh files, you can edit it via editing "process.bat".
     
  18. d0k3
    OP

    d0k3 3DS Homebrew Legend

    Member
    2,592
    2,609
    Dec 3, 2004
    Gambia, The
    I've just attached another version of CTAPG that I made for the member of another forum (guess many of you will know him). The contents are the same as for the regular v0.3 release, but it also contains two additional tools for use with first extracted content of the theme pack CIA. These two will allow you to properly convert icons and extract theme names, but manual work is involved.
     
  19. d0k3
    OP

    d0k3 3DS Homebrew Legend

    Member
    2,592
    2,609
    Dec 3, 2004
    Gambia, The
    This now also has an official Github repo. I hope the lack of discussion here means that everything works mighty fine for all the users :D.
     
  20. Asia81

    Asia81 In my Ecchi World <3

    Member
    4,950
    2,433
    Nov 15, 2014
    France
    Albi
    Could you also do something like read the info.smdh and extract icon.png and name.txt for use with Howling Theme Tool ?