Changing the logo from hekate's menu

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.
 

Attachments

  • 20190119_185053.jpg
    20190119_185053.jpg
    1.7 MB · Views: 391
  • Untitled.png
    Untitled.png
    41.2 KB · Views: 353
  • tut7.png
    tut7.png
    97.6 KB · Views: 345

tomGER

Well-Known Member
Member
Joined
Feb 6, 2017
Messages
347
Trophies
0
XP
1,222
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,

mattytrog

You don`t want to listen to anything I say.
Member
Joined
Apr 27, 2018
Messages
3,708
Trophies
0
Age
48
XP
4,328
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);
 

Attachments

  • hekate_simple-uf2.zip
    70.6 KB · Views: 318
Last edited by mattytrog,

spx

Member
OP
Newcomer
Joined
Nov 1, 2018
Messages
19
Trophies
0
Age
23
Location
Bucharest, Romania
XP
197
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
 

mattytrog

You don`t want to listen to anything I say.
Member
Joined
Apr 27, 2018
Messages
3,708
Trophies
0
Age
48
XP
4,328
Country
United Kingdom
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
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,
  • Like
Reactions: spx

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: Watching the fallout series it is pretty decent