[Tutorial] Changing the logo from hekate's menu

Discussion in 'Switch - Tutorials' started by spx, Jan 21, 2019.

  1. spx
    OP

    spx Member

    Newcomer
    2
    Nov 1, 2018
    Romania
    Bucharest, 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.


    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.
    (Notice how it uses #1B1B1B (hex) / 27, 27, 27 (rgb) for blending in with the background and is 119x57)
    Untitled.
    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.
    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.
    tut6.
    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.
    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.
    tut8.
    tut9.
    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
    10
    Dec 1, 2012
    France
    So you did it in the end, congrats

    Where's my dickbutt
     
  3. spx
    OP

    spx Member

    Newcomer
    2
    Nov 1, 2018
    Romania
    Bucharest, Romania
    Thanks
     
  4. SimonMKWii

    SimonMKWii Professional Idiot

    Member
    10
    Nov 18, 2017
    Australia
    Melbourne, Victoria
    wow you finally did it
     
  5. spx
    OP

    spx Member

    Newcomer
    2
    Nov 1, 2018
    Romania
    Bucharest, 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
    6
    Feb 6, 2017
    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
    2
    Nov 1, 2018
    Romania
    Bucharest, Romania
    *angry caveman sounds*
     
  8. natinusala

    natinusala Win32 error 31 is not an error

    Member
    10
    Dec 1, 2012
    France
    ( ͡° ͜ʖ ͡°)
     
    tomGER and spx like this.
  9. mattytrog

    mattytrog Not on my watch.

    Member
    10
    Apr 27, 2018
    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
    2
    Nov 1, 2018
    Romania
    Bucharest, 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 Not on my watch.

    Member
    10
    Apr 27, 2018
    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

    Member
    7
    Jun 16, 2018
    United Kingdom
    Congrats on figuring it out. Remember the frustration you went through just to figure it out.
     
  13. spx
    OP

    spx Member

    Newcomer
    2
    Nov 1, 2018
    Romania
    Bucharest, Romania
    I'm grateful that this way I could meet the lads over at RetroNX and get banned there :^)
     
Loading...
Cookies Policy | Watch This Link! | Girls Trip