1. spx

    OP spx Member
    Newcomer

    Joined:
    Nov 1, 2018
    Messages:
    19
    Country:
    Romania
    This tutorial will show you how to change the menu logo to any desired picture.
    To avoid confusion, this is the logo I am talking about.
    20190119_185053.jpg


    Requirements:

    • Setting up the dev environment (on Windows you just have to run the devkitPro updater that you can find on github, make sure to check the Switch development option, the other option doesn't matter)
    • An image (119x57, changing the resolution is possible but too much to teach for this tutorial, use the color of hekate's background - #1B1B1B (RGB - 27, 27, 27) - for transparency)
    • Image editing software that supports exporting as bmp, I will be using MS Paint for simplicity's sake
    • HxD or any other hex editor that supports exporting as a byte array or some sort of script to do that
    • memloader (v3 is the latest) for its built-in blz compression tool (not from github, from the switchtools site which will appear in Google search but is only one page that you have to scroll down on)
    Step 1 - Preparing the image
    This is very straight forward, in MS Paint you do
    File > Save as, then select 24-Bit BMP as the type. The image I am using for the tutorial and what to select from the drop-down menu are below.
    THE PAYLOAD SIZE LIMIT IS TIGHT, MAKE SURE YOUR IMAGE DOESN'T HAVE TOO MANY COLORS/TOO MUCH DETAIL

    tutorial.png
    (Notice how it uses #1B1B1B (hex) / 27, 27, 27 (rgb) for blending in with the background and is 119x57)
    Untitled.png
    Step 2 - Convert the image to raw pixels
    This can be done easily with this online tool and it's called Convertio. Select bmp as source extension and rgb as destination extension. It claims to not only work with bmp's but from my experience, none of the other source formats work. Below you can see the detailed steps.
    tut.PNG
    (Then select your bmp)
    tut2.png
    tut3.PNG
    (then save the file)
    Step 3 - Compress the rgb file
    For this, you will need memloader. After downloading it (check requirements for the link), extract just the tools folder and put your .rgb file in there for easier access, then open a CMD window in that directory by typing cmd in the address bar and press enter and a window should appear. Once in it, type blzcomp.exe tutorial.rgb compressed.blz (replace tutorial.rgb with whatever your filename is).
    tut5.png
    tut6.png
    As output you will get the source file size next to the compressed file size. The compressed one is different depending on how detailed the image you are using is (how many colors and their position). The source file size is constant and should be 20349. If it's not, that means you messed something up. Check initial resolution again and make sure you exported as a 24-bit bmp.
    Step 4 - Exporting the compressed file as a byte array
    For
    this you have to open HxD and drag and drop the file created (compressed.blz) and you should see some bytes appear. After that, do File > Export > C and save the file somewhere.
    tut6.png
    Step 5 - Replace the code then build hekate
    First off, you will need hekate's code. For this, you can go to the latest release (v4.6) on the github page and select
    Source code (zip). Extract it somewhere and you should end up with a hekate folder. Open the file called logos.h that can be found in hekate-v4.6/bootloader/gfx and the compressed.c file with the text editor of your choice (I'm using Notepad++). First thing you want to do is comment out the menu logo byte array (the first list at the top of the logos.h file, starts at the curly bracket). To do that, add a /* at the beginning and a */ at the end (NOT the end of the file, the end of the 1st list), like shown below. After that, copy the array length that is in between the square brackets to the value assigned to SZ_MENU_LOGO_BLZ. The last step before compiling is copying the bytes from compressed.c (just what is between curly brackets, not everything) and pasting that after the */ that you added at the bottom of the first list from logos.h. Don't forget to save! After that, all you want to do is go to the hekate-v4.6 folder, type CMD in the address bar, enter, and type make. If everything was done correctly, it shouldn't have any errors. After compiling make sure that the payload size is smaller than the max payload size. If it is not, your image was too detailed/too many colors. For this and for any other problem, to retry you have to type make clean and then try all over again.
    tut7.png
    tut8.png
    tut9.png
    After all of that, inject hekate.bin from the output folder. If it won't inject, the payload is bigger than max payload size most likely. Don't worry, your Switch won't brick, just try again.
     

    Attached Files:

    Essasetic, CVFireDragon and ravihpa like this.
  2. natinusala

    natinusala Win32 error 31 is not an error
    Member

    Joined:
    Dec 1, 2012
    Messages:
    1,032
    Country:
    France
    So you did it in the end, congrats

    Where's my dickbutt
     
  3. spx

    OP spx Member
    Newcomer

    Joined:
    Nov 1, 2018
    Messages:
    19
    Country:
    Romania
    Thanks
     
  4. SimonMKWii

    SimonMKWii Professional Idiot
    Member

    Joined:
    Nov 18, 2017
    Messages:
    666
    Country:
    Australia
    wow you finally did it
     
  5. spx

    OP spx Member
    Newcomer

    Joined:
    Nov 1, 2018
    Messages:
    19
    Country:
    Romania
    I was patiently waiting for someone to do a guide after I did the thing some weeks ago but nobody made one so I decided to make a shitty guide myself
     
    ravihpa likes this.
  6. tomGER

    tomGER GBAtemp Fan
    Member

    Joined:
    Feb 6, 2017
    Messages:
    348
    Country:
    Germany
    We did it reddit! After nine years in development, hopefully it has been worth the wait *shrek*

    I already know this thread will stay relevant ;^)
     
    Last edited by tomGER, Jan 21, 2019
  7. spx

    OP spx Member
    Newcomer

    Joined:
    Nov 1, 2018
    Messages:
    19
    Country:
    Romania
    *angry caveman sounds*
     
  8. natinusala

    natinusala Win32 error 31 is not an error
    Member

    Joined:
    Dec 1, 2012
    Messages:
    1,032
    Country:
    France
    ( ͡° ͜ʖ ͡°)
     
    tomGER and spx like this.
  9. mattytrog

    mattytrog You don`t want to listen to anything I say.
    Member

    Joined:
    Apr 27, 2018
    Messages:
    3,708
    Country:
    United Kingdom
    It can be bigger, just make sureit doesn`t exceed the size of the payload.

    Edit::: op is on about menu_logo. I referring to boot_logo

    If your new logo is off-centre, change this in main.c until you get it right...

    gfx_set_rect_grey(&gfx_ctxt, BOOTLOGO, X_BOOTLOGO, Y_BOOTLOGO, 330, 520);

    330 & 520 example are the x & y coordinates.

    Also, you can delete MENU_LOGO too and all references. If you just delete the array, you will get a white box. This will save A LOT of space.

    Use GIMP, save as RAW (*.data or *.raw) 8bpp greyscale

    blzcomp it down, open compressed file in HxD, copy as C, paste in logos.h

    Take a look at my OEM styled example attached. Cheers

    EDIT:

    Oh yeah...

    Edit this to change the background from grey to oem black...

    old value:
    gfx_clear_grey(&gfx_ctxt, 0x1B);

    new value:
    gfx_clear_grey(&gfx_ctxt, 0x00);
     

    Attached Files:

    Last edited by mattytrog, Jan 21, 2019
  10. spx

    OP spx Member
    Newcomer

    Joined:
    Nov 1, 2018
    Messages:
    19
    Country:
    Romania
    1. This tut is about the menu logo, not bootlogo
    2. I wanted to mention removing the bootlogo but I was tight on time, might edit it, and also it would save just a little amount of space since its 8BPP
     
  11. mattytrog

    mattytrog You don`t want to listen to anything I say.
    Member

    Joined:
    Apr 27, 2018
    Messages:
    3,708
    Country:
    United Kingdom
    Oh shit. Sorry.

    Sorry was flying visit.

    I`ll get my coat.

    First commandment of gbatemp is "Thou shalt always read OP first"
     
    Last edited by mattytrog, Jan 21, 2019
    spx likes this.
  12. Essasetic

    Essasetic Your Local TX Fanboy Rebirth
    Member

    Joined:
    Jun 16, 2018
    Messages:
    1,578
    Country:
    United Kingdom
    Congrats on figuring it out. Remember the frustration you went through just to figure it out.
     
  13. spx

    OP spx Member
    Newcomer

    Joined:
    Nov 1, 2018
    Messages:
    19
    Country:
    Romania
    I'm grateful that this way I could meet the lads over at RetroNX and get banned there :^)
     
Draft saved Draft deleted
Loading...

Hide similar threads Similar threads with keywords - [Tutorial], Changing, hekates