Hacking Custom Boot Logo for Switch

binkinator

Garfield’s Fitness Coach
Member
GBAtemp Patron
Joined
Mar 29, 2021
Messages
6,507
Trophies
2
XP
6,200
Country
United States
That was only true for the Sept payload, which is now deprecated. The Atmosphere logo splash can be edited and I have done so myself, although it was pre-covid so it has been a while.

If I recall correctly this is the line that actually draws the logo on screen, you will have to edit the width and height of the image as well as the X Y coordinates here.
https://github.com/Atmosphere-NX/At...sphere/boot/source/boot_splash_screen.cpp#L40

The actual splash screen image is a raw RGB framebuffer stored in a unsigned 32 bit integer array. I did create a tool to automatically generate the array from a PNG but I don't think I have it anymore, if I do have it I don't know where I put it.

https://github.com/Atmosphere-NX/At...ere/boot/source/boot_splash_screen_notext.inc

You can edit this line to adjust how long the logo shows for. The default is 2 seconds, I don't know if you can make it any lower since there may be another thread doing stuff in the background that takes at least 2 seconds to complete it's task. https://github.com/Atmosphere-NX/At...sphere/boot/source/boot_splash_screen.cpp#L41

So I was able to compile AND run my own copy of Atmos. Cool stuff! Thanks for the redirect!

C3CB370C-2985-4C3D-933C-5D53623FF716.jpeg


I see where the X*2+(image width) and Y*2+(image height) = 1280x720 screen resolution.

I see the banding pattern of an image.

What I’m unclear on is that I’ve been working with RGBA lately and I expected to see 0x00, 0x00, 0x00, 0xFF and this is exactly the reverse of that.

I understand you said it‘s a 32 bit unsigned framebuffer but I can’t find a decent example to prove my theory.
I can’t figure out how to display this image (and thus build the knowledge to substitute my own).

Is there different name for this image I should be looking for?

What tool will display it?

e: is it RGB565? It can’t be…it’s supposed to be 32 bit.

I found the following discussion about sending an image back to the framebufder and the solution was this:
convert -resize 1440x900 -background black -gravity center -extent 1440x900 01.jpg bgra:/dev/fb0

BRGA? It’s flipped, but again, not the way I would expect with a 0xFF000000 pattern for the image in Atmos. Both the Pi and Switch use Arm so I doubt it’s endianness or something basic like that.


RGBA .. red greeb blue alpha ... 32 bit mode
Code:

#pragma pack(1) // Must be packed
typedef struct tagRGBA {
union {
struct {
uint8_t rgbBlue; // The intensity of blue in the color
uint8_t rgbGreen; // The intensity of green in the color
uint8_t rgbRed; // The intensity of red in the color
uint8_t rgbAlpha; // The alpha of the color
};
RGBTRIPLE rgb; // First 3 bytes are same as RGB
uint32_t Raw32; // Raw32 bit access if needed
};
} RGBA;
#pragma pack()



RGB565 ... 16 bit mode
Code:

#pragma pack(1) // Must be packed
typedef struct RGB565 {
union {
struct {
uint16_t B : 5; // Blue 5 bits
uint16_t G : 6; // Green 6 bits
uint16_t R : 5; // Red 5 bits
};
uint16_t Raw16; // Raw 16 bit access if needed
};

} RGB565;
#pragma pack()

Any clues would be greatly appreciated.
 
Last edited by binkinator,
  • Like
Reactions: CompSciOrBust
Joined
Sep 9, 2019
Messages
903
Trophies
1
Location
Switch scene
Website
github.com
XP
2,676
Country
Korea, North
So I was able to compile AND run my own copy of Atmos. Cool stuff! Thanks for the redirect!

View attachment 312043

I see where the X*2+(image width) and Y*2+(image height) = 1280x720 screen resolution.

I see the banding pattern of an image.

What I’m unclear on is that I’ve been working with RGBA lately and I expected to see 0x00, 0x00, 0x00, 0xFF and this is exactly the reverse of that.

I understand you said it‘s a 32 bit unsigned framebuffer but I can’t find a decent example to prove my theory.
I can’t figure out how to display this image (and thus build the knowledge to substitute my own).

Is there different name for this image I should be looking for?

What tool will display it?

e: is it RGB565? It can’t be…it’s supposed to be 32 bit.

I found the following discussion about sending an image back to the framebufder and the solution was this:
convert -resize 1440x900 -background black -gravity center -extent 1440x900 01.jpg bgra:/dev/fb0

BRGA? It’s flipped, but again, not the way I would expect with a 0xFF000000 pattern for the image in Atmos. Both the Pi and Switch use Arm so I doubt it’s endianness or something basic like that.


RGBA .. red greeb blue alpha ... 32 bit mode
Code:

#pragma pack(1) // Must be packed
typedef struct tagRGBA {
union {
struct {
uint8_t rgbBlue; // The intensity of blue in the color
uint8_t rgbGreen; // The intensity of green in the color
uint8_t rgbRed; // The intensity of red in the color
uint8_t rgbAlpha; // The alpha of the color
};
RGBTRIPLE rgb; // First 3 bytes are same as RGB
uint32_t Raw32; // Raw32 bit access if needed
};
} RGBA;
#pragma pack()



RGB565 ... 16 bit mode
Code:

#pragma pack(1) // Must be packed
typedef struct RGB565 {
union {
struct {
uint16_t B : 5; // Blue 5 bits
uint16_t G : 6; // Green 6 bits
uint16_t R : 5; // Red 5 bits
};
uint16_t Raw16; // Raw 16 bit access if needed
};

} RGB565;
#pragma pack()

Any clues would be greatly appreciated.
I'm waiting for some food to be delivered right now but I'll dig through some old hard drives later to see if I can find that tool I made. I can't remember much about the format so my code should shed some light on what needs to be done. Do you have Discord? It might be easier to talk there and then summarize all of the known correct information here once we figure it out.
 

binkinator

Garfield’s Fitness Coach
Member
GBAtemp Patron
Joined
Mar 29, 2021
Messages
6,507
Trophies
2
XP
6,200
Country
United States
I'm waiting for some food to be delivered right now but I'll dig through some old hard drives later to see if I can find that tool I made. I can't remember much about the format so my code should shed some light on what needs to be done. Do you have Discord? It might be easier to talk there and then summarize all of the known correct information here once we figure it out.
much appreciated. I certainly do: WWIII#8567
 

binkinator

Garfield’s Fitness Coach
Member
GBAtemp Patron
Joined
Mar 29, 2021
Messages
6,507
Trophies
2
XP
6,200
Country
United States

I think this one works similar to @friedkeenan‘s switch-logo-patcher, no?

The image we’re manipulating is the 210x172 Atmosphere logo itself located here:

https://github.com/Atmosphere-NX/At...ere/boot/source/boot_splash_screen_notext.inc

With @CompSciOrBust ‘s help Imwas able to extract the image using GIMP however, I’m still not understanding why the original image is 2X the size it needs to be. All my attempts at precisely 1/2 the size of the original and I don’t know exactly why yet.

figured it out…you need to ensure you use AARRGGBB format (and not ARGB…1/2 the size!)
 
Last edited by binkinator,
  • Like
Reactions: impeeza

impeeza

¡Kabito!
Member
Joined
Apr 5, 2011
Messages
8,125
Trophies
4
Age
46
Location
At my chair.
XP
27,577
Country
Colombia

Kronos2308

Well-Known Member
Newcomer
Joined
Feb 9, 2018
Messages
47
Trophies
0
Age
29
XP
332
Country
Spain
This is a gui for a phyton script but even it works always generate biggers ups files and the files generated add up to 60 seconds of delay on startup
🥴

The gui it's a hta file (a html with JavaScript or VBS script on it)
yes i do what i can with the gui, but you can select the target firmware or create all the ips that work for all fimwares
and only take 20s to build all firmwares ips
 
  • Love
Reactions: impeeza

impeeza

¡Kabito!
Member
Joined
Apr 5, 2011
Messages
8,125
Trophies
4
Age
46
Location
At my chair.
XP
27,577
Country
Colombia
Hi, fidgeting with the boot_splash_screen_notext.inc file I have a semi-manual proccess to get the values:

Start with a graphic file (Atmosphere.bmp on this case, can be PNG or JPG).


Please note what the if the image is full of colors, the size should be less of 563200 Pixels, if you use a bigger file, the resultant PACKAGE3 file will have a size great than 8 Mb (8388608 Bytes) and fusee.bin refuses to load a package3 > than 8Mb. For images on black and white or low colors count this warning doesn't apply.​
If you use Hekate to load package3 (fss0=atmosphere/package3 NOT payload=bootloader/payloads/fusee.bin on hekate_ipl.ini ), this check is not held so you can have a Package3 file bigger than 8M.​

Then create a "framebuffer" binary file from the image:
  • Using the python script "convertfb.py" (https://github.com/zqb-all/convertfb), you need to have installed, PYTHON 2.X (since april's 14th 2023 the repo get updted to Python 3) and the python-imaging module (pillow) use command: pip install pillow. An example of the command:
convertfb.py -i Atmosphere.bmp -o Atmosphere.DATA -f ARGB

The Original convertfb.py requieres Python 2, I am attaching a modified version which works fine on Python 3, still require Pillow.

Or use Gimp, (sorry guys Gimp only generate RAW files on RGBA format but we need it on ARGB format, so by now only the python script is the solution.)

Then convert the binary file to a C++ .h file, Using the command bin2header.exe (https://github.com/AntumDeluge/bin2header/releases/), you need to specify 32 bits variables, an example of the command:

bin2header.exe -p 32 Atmosphere.DATA
The above command create a file called "Atmosphere.DATA.h" with a content like:

C++:
#ifndef ATMOSPHERE_FB_H
#define ATMOSPHERE_FB_H

static const unsigned int Atmosphere_fb[] = {
    0xff297ba4, 0xff297ba4, 0xff297ba4, ...

Now you can copy the content of the array to the original file, I had to use Notepad++ because the original file have all members of the array on an only BIG row and for successful compiling had to mimic at the new file.

You need to set the correct values for the others variables on the file:

C++:
/* This are the values for a [B]bigger full screen splash compliant with 8M restriction, centered on screen[/B]*/

constexpr size_t SplashScreenX = 0;     // X position of the image
constexpr size_t SplashScreenY = 140;     // Y position of the image
constexpr size_t SplashScreenW = 1280;  // Width of the image
constexpr size_t SplashScreenH = 440;   // Height of the image



--Edited to add gimp instructions--

--Edit 2 correct some typos and expand the description of needed image --
 

Attachments

  • convertfb3.zip
    1.1 KB · Views: 111
Last edited by impeeza,

binkinator

Garfield’s Fitness Coach
Member
GBAtemp Patron
Joined
Mar 29, 2021
Messages
6,507
Trophies
2
XP
6,200
Country
United States
Hi, fidgeting with the boot_splash_screen_notext.inc file I have a semi-manual proccess to get the values:
  • Start with a graphic file (Atmosphere.bmp on this case, can be PNG or JPG).
  • Create a "framebuffer" binary file, using the python script "convertfb.py" (https://github.com/zqb-all/convertfb), you need to have installed the python-imaging module (pillow) use command: pip install pillow. An example of the command:
    • convertfb.py -i Atmosphere.bmp -o Atmosphere.fb -f ARGB
  • Then convert the binary file to a C++ .h file, Using the command bin2header.exe (https://github.com/AntumDeluge/bin2header/releases/), you need to specify 32 bits variables, an example of the command:
    • bin2header.exe -p 32 Atmosphere.fb
  • The latter command create a file called "Atmosphere.fb.h" with a content like:
C++:
#ifndef ATMOSPHERE_FB_H
#define ATMOSPHERE_FB_H

static const unsigned int Atmosphere_fb[] = {
    0xff297ba4, 0xff297ba4, 0xff297ba4, ...

Now you can copy the content of the array to the original file, I had to use Notepad++ because the original file have all members of the array on an only BIG row and for successful compiling had to mimic at the new file.

You need to set the correct values for the others variables on the file:

C++:
/* This are the values for a full screen splash */

constexpr size_t SplashScreenX = 0;     // X position of the image
constexpr size_t SplashScreenY = 0;     // Y position of the image
constexpr size_t SplashScreenW = 1280;  // Width of the image
constexpr size_t SplashScreenH = 720;   // Height of the image
Wow! i didn’t know about bin2header…this is a good addition. My way is much more cumbersome.
 
  • Love
Reactions: impeeza

Jayro

MediCat USB Dev
Developer
Joined
Jul 23, 2012
Messages
13,713
Trophies
7
Location
WA State
Website
ko-fi.com
XP
18,620
Country
United States
Can we change out the official boot logos on the sysNAND? I know it's more risky, and would probably be over-written with system updates, but I'm just curious if it's plausible, as it's not at all practical.
 

impeeza

¡Kabito!
Member
Joined
Apr 5, 2011
Messages
8,125
Trophies
4
Age
46
Location
At my chair.
XP
27,577
Country
Colombia
  • Like
Reactions: Jayro

binkinator

Garfield’s Fitness Coach
Member
GBAtemp Patron
Joined
Mar 29, 2021
Messages
6,507
Trophies
2
XP
6,200
Country
United States
I rather have one that says f*ck you Nintendo my Vita says Suck Fony you can see how much i disprove of these company tactics as a whole
@ELY_M posted this earlier in the thread. You like?

(I have this one on mine…so I might be biased)

1665953428434.jpeg
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: @SylverReZ, im glad