Building Atmosphère on Windows using MSYS2

Sometimes you need to build the binaries for Atmosphère, or you want to change something on the source code, for building your starting point should be: https://github.com/Atmosphere-NX/Atmosphere/blob/master/docs/building.md
On that document you can read:
Building Atmosphère is a very straightforward process that relies almost exclusively on tools provided by the devkitPro organization.​
Dependencies:
  • devkitA64
  • devkitARM
  • Python 2 (Python 3 may work as well, but this is not guaranteed)
  • LZ4
  • PyCryptodome (optional)
  • Hactool
Setup a DevKitPro environment: (https://devkitpro.org/wiki/Getting_Started)
Install the following packages via (dkp-)pacman:​
  • switch-dev
  • switch-glm
  • switch-libjpeg-turbo
  • devkitARM
  • devkitarm-rules
  • hactool
Install the following library via python's package manager pip, required by exosphere:​
  • lz4
Finally, clone the Atmosphère repository and run make under its root directory.​

That instructions are a little plain for we the noobs.

First you need Install a MSYS environment:
The latest instructions for install the MSYS environment are on https://gbatemp.net/threads/install-msys-environment.652234/ if you don't have one working, use them.

After you have the MSYS environment working you need to install DevKitPro
For that you can follow the instructions on the tutorial https://gbatemp.net/threads/setup-a-devkitpro-environment-on-windows.652238/

Now you can install DevKitPro packages:

You Need base DevKitPro packages:
Bash:
pacman -S --noconfirm switch-dev devkitA64 dkp-toolchain-vars libnx switch-tools switch-mesa switch-libdrm_nouveau switch-sdl2

And the Atmosphère prerequisites
Bash:
Pacman -Sy --noconfirm devkitA64 devkitARM devkitarm-rules hactool mingw-w64-x86_64-python mingw-w64-x86_64-python-lz4 mingw-w64-x86_64-python-pycryptodome switch-dev switch-glm switch-libjpeg-turbo mingw-w64-x86_64-python-pip

I had to add zip package because even if wasn't explicit indicated on the build page, the code needs it.

You also will need the packages git make lz4 for all to work, use the command:

Bash:
Pacman -Sy --noconfirm zip git make lz4


All packages on a combined command:​

Bash:
pacman -S --noconfirm switch-dev devkitA64 dkp-toolchain-vars libnx switch-tools switch-mesa switch-libdrm_nouveau switch-sdl2 devkitA64 devkitARM devkitarm-rules hactool mingw-w64-x86_64-python mingw-w64-x86_64-python-lz4 mingw-w64-x86_64-python-pycryptodome switch-dev switch-glm switch-libjpeg-turbo mingw-w64-x86_64-python-pip zip git make lz4


The package hactool need you to copy your own prod.keys file on $HOME/.switch folder. (c:\msys64\home\USERNAME\.switch if you use the default installation folder)


LibNX Dependency
Atmosphère depends heavily on LibNX, generally when a major version of firmware is released or great changes on the code are made, changes to LibNX are also made.
The Atmosphère team works on their own repo of LibNX (https://github.com/Atmosphere-NX/libnx) and forward Pull Request to official SwitchBrew LibNX repo (https://github.com/switchbrew/libnx).


So ONLY if there are changes on LibNX repository, no yet committed to DevKitPro release, you need to build it and install on your setup.
If you haven't done already, setup the environment variables
You can test it running the command
export
You should have this:
Bash:
export DEVKITPRO=/opt/devkitpro
export DEVKITARM=${DEVKITPRO}/devkitARM
export DEVKITPPC=${DEVKITPRO}/devkitPPC
export PATH=${DEVKITPRO}/tools/bin:$PATH


Then go to the Atmosphere-NX/LibNX repo and look what is the new branch for the current firmware, by example, for Firmware 16.0.0 the branch name is "1600_Support"

1677718224337.png

Then go to your MSYS MinGW64 window and clone the Atmosphere-NX/LibNX repo

Bash:
cd ~
git clone --recursive https://github.com/Atmosphere-NX/libnx.git
cd libnx

And checkout the needed branch:

Bash:
git checkout 1600_support

Then build and install the new LibNX libraries

Bash:
make install -j$(nproc)

Now you can build Atmosphère with latest LibNX code; remember if you update the pacman LibNX package the changes get reversed and you need to build LibNX again.

Now is time to build the binaries
Clone the repository:
Bash:
cd ~
git clone --recursive https://github.com/Atmosphere-NX/Atmosphere

Go to new created Atmosphère folder
Bash:
cd Atmosphere

Be sure you have defined the environment variables for DevKitPro
You can test it running the command
export
You should have this:
Bash:
export DEVKITPRO=/opt/devkitpro
export DEVKITARM=${DEVKITPRO}/devkitARM
export DEVKITPPC=${DEVKITPRO}/devkitPPC
export PATH=${DEVKITPRO}/tools/bin:$PATH


COPY YOUR PROD.KEYS FILE TO THE .SWITCH FOLDER:

Copy prod.keys file on $HOME/.switch
Bash:
mkdir ~/.switch
cp "c:\YOUR\CURRENT\PATH\TO\KEYS\PROD.KEYS" ~/.switch/prod.keys

In the case of MSYS for using localhost paths you must use "" by example in my case I use the commands:
Bash:
mkdir ~/.switch
cp "z:\Emulation\NSwitch\keys\switch\prod.keys" ~/.switch/prod.keys

Obviously you also can copy the file manually on windows to the equivalent path to ~/.switch/ which by default is c:\msys\home\USERNAME\.switch Where c:\msys is the installation folder and USERNAME is the current name for the user.


Atmosphère is a Python 2 project, even when python 2 has been deprecated by almost 5 years now. some * insist on never update it so as far as that is going, you need to change some files in order to work on python 3, on the files:
  • Atmosphere\fusee\program\update_mtc_tables.py
  • Atmosphere\fusee\program\update_sdram_params.py
The function XRANGE must to be changed to RANGE, edit the files and change xrange( to range( save the files and continue.

And now you are ready to start the building process:
Bash:
make -j$(nproc)

I do use the "-j$(nproc)" parameter to "bleed" all the available CPU to run the compiler, without that the whole process could take up to 1 hour.

Also Note:, if you use make -j is possible a Error 2 can be generated, run make again without parameters. The process will continue where failed, since the two latest versions of DevKitPro using the -j parameters is not synced and the make process can fail by timeouts.


I want to thank a lot to @binkinator and @godreborn for all the help and inspiration to make this guide, and want to ask you for help improving this guide.

Also special thanks to @godreborn for been a support of the users replies and suggestions to the OP.

Remember, as you are getting a new set of binaries, you need new set of sigpatches if you use it. So the great tool from @mrdude comes in hand, the latest release can be downloaded from: https://github.com/mrdude2478/IPS_Patch_Creator/releases/; you use the program to generate a new set of patches for your recently build package3 file.


Latest IPS Patch Creator:
https://gbatemp.net/download/ips-patch-creator-1-5-9.38850/




-Edited: add sigpatches step and clean up a little-
-Edit 2, add LibNX build-
 

Attachments

  • 1695782853186.png
    1695782853186.png
    62.7 KB · Views: 217
  • 1695782902542.png
    1695782902542.png
    6.4 KB · Views: 206
  • Sigpatch-IPS-Creator_1.5.7_Yandex.png
    Sigpatch-IPS-Creator_1.5.7_Yandex.png
    3.3 KB · Views: 136
Last edited by impeeza,
MSYS is a container environment, MSYS did not alter Windows environment.

BUY if you run the python INSIDE MSYS you need to install the packages with other commands.

by example on MinGW64 Pillow is installed by

pacman -S mingw-w64-x86_64-python-pillow

that will works ONLY INSIDE MINGW64 if you install it on MSYS and go to windows commandline WILL BE NO PILLOW on the windows python.

I was reading elsewhere a bit and did come across using pacman but was a bit busy with other stuff and hadn't gotten back to reading up on it further yet. Thank you. I'll try it. But... I'm just wasting time since it won't show the replaced image anyway right, when I'm using pkg3=atmosphere/package3 ? How do I uninstall the stuff I installed using 'pip install'?
 
I was reading elsewhere a bit and did come across using pacman but was a bit busy with other stuff and hadn't gotten back to reading up on it further yet. Thank you. I'll try it. But... I'm just wasting time since it won't show the replaced image anyway right, when I'm using pkg3=atmosphere/package3 ? How do I uninstall the stuff I installed using 'pip install'?
pip uninstall
 
  • Like
Reactions: Earthshine
MSYS is a container environment, MSYS did not alter Windows environment.

BUY if you run the python INSIDE MSYS you need to install the packages with other commands.

by example on MinGW64 Pillow is installed by

pacman -S mingw-w64-x86_64-python-pillow

that will works ONLY INSIDE MINGW64 if you install it on MSYS and go to windows commandline WILL BE NO PILLOW on the windows python.
Finally this is the result!
 

Attachments

  • IMG_2901.mov
    37.2 MB
  • Like
Reactions: impeeza
Hekate directly.

I meant... I'm not sure how to ask the right way. You must not be using fss0/pkg3 or else your replacement for the white triangle would not show up. That's what I was getting at in my earlier reply. That if you just use fss0/pkg3 method in your hekate_ipl.ini, you could have just edited a single simple line in the .ini file on your SD card instead of having to mess around with editing and compiling the atmos code.
 
Last edited by Earthshine,
using PKG3 will show Sept Logo
Nope


PKG3 shows:

Hekate bootlogo (if enabled)
AMS logo (replaces the Ninty logo)
Switch logo



Fusee shows:

Hekate logo (if enabled and launched fusee via hekate)
Sept logo
AMS logo (replaces the Ninty logo)
Switch logo
 
Nope


PKG3 shows:

Hekate bootlogo (if enabled)
AMS logo (replaces the Ninty logo)
Switch logo



Fusee shows:

Hekate logo (if enabled and launched fusee via hekate)
Sept logo
AMS logo (replaces the Ninty logo)
Switch logo

So I have an image named bootlogo.bmp in the bootloader folder on my SD card. 1280x720, 2.6MB, 24bit. The following is my hekate_ipl entry for emuMMC:

[Atmosphere emuMMC]
pkg3=atmosphere/package3
emummcforce=1
icon=bootloader/res/icon_payload.bmp
logopath=bootloader/bootlogo.bmp

The default Atmos white triangle is gone, but it's just a black screen now. The image on my sd card does not display. Is there a resolution, file size, or bit depth limit?
 
So I have an image named bootlogo.bmp in the bootloader folder on my SD card. 1280x720, 2.6MB, 24bit. The following is my hekate_ipl entry for emuMMC:

[Atmosphere emuMMC]
pkg3=atmosphere/package3
emummcforce=1
icon=bootloader/res/icon_payload.bmp
logopath=bootloader/bootlogo.bmp

The default Atmos white triangle is gone, but it's just a black screen now. The image on my sd card does not display. Is there a resolution, file size, or bit depth limit?

Yes, you have to set the time wait in the ini file.

The A logo should be shown too... Sometimes a battery logo is displayed instead it.
 
Nope


PKG3 shows:

Hekate bootlogo (if enabled)
AMS logo (replaces the Ninty logo)
Switch logo



Fusee shows:

Hekate logo (if enabled and launched fusee via hekate)
Sept logo
AMS logo (replaces the Ninty logo)
Switch logo
damn, then something bad is on my console


Post automatically merged:

On my console I use ArgonNX-SE as payload, then autoload Hekate with Autorun PKG3 loading and this is my boot sequence

Post automatically merged:

My Hekate_ipl.ini file have

Code:
[config]
autoboot=2
autoboot_list=0
bootwait=1
noticker=0
autohosoff=1
autonogc=1
bootprotect=0
updater2p=1
backlight=91


{--- Custom Firmware ---}
{--- SYSNAND START---}
[CFW (SYSNAND)]
id=SYSNAND
emummc_force_disable=1
fss0=atmosphere/package3
atmosphere=1
logopath=bootloader/bootlogo.bmp
icon=bootloader/res/atmosphere_hue_nobox.bmp
kip1patch=nosigchk
{--- SYSNAND END ---}

{--- EMUNAND START---}
[CFW (EMUMMC)]
id=EMUNAND
emummcforce=1
fss0=atmosphere/package3
atmosphere=1
logopath=bootloader/EnergyStarBL.bmp
icon=bootloader/res/payload_hue_nobox.bmp
usb3force=1

{--- EMUNAND END ---}
{--- Custom Firmware END ---}

{--- STOCK Firmware ---}
{--- Stock START---}
[Stock (SYSNAND)]
id=STOCK
emummc_force_disable=1
fss0=atmosphere/package3
stock=1
icon=bootloader/res/switch_hue_nobox.bmp
{--- Stock END ---}
{--- STOCK Firmware END ---}

{--- PAYLOADS ---}
{--- Atmosphère payload ---}
[Atmosphere fusee.bin+fs (Payload)]
id=Atmosphere
atmosphere=1
payload=bootloader/payloads/fusee_1_07_1.bin
logopath=bootloader/res/atmosphereFuseeBootLogo.bmp
icon=bootloader/res/atmosphereFusee_hue_nobox.bmp



[Atmosphere fusee.binORG (Payload)]
id=Atmosphere
atmosphere=1
payload=bootloader/payloads/fuseeSciresM.bin
logopath=bootloader/res/atmosphereFuseeBootLogo.bmp
icon=bootloader/res/atmosphereFusee_hue_nobox.bmp


{--- PAYLOADS END ---}
Post automatically merged:

Talking about everything a little, does anybody found a solution for the Warming and battery lowering issue after upgrading to FW 20.x.x I just upgraded the day before yesterday and my console get hot while on the dock on sleep mode ;(
 
Last edited by impeeza,
  • Wow
Reactions: impeeza
Yes, you have to set the time wait in the ini file.

The A logo should be shown too... Sometimes a battery logo is displayed instead it.

Nope. I set it to 5 and reboot. Still notta. Set it to 10. Reboot. Notta.

If I power off my Switch, enter rcm mode, send hekate, then boot into Atmos emuMMC from the hekate menu.... I get a blank screen with no white A, then blank screen with small battery icon on top left, then Nintendo logo, then main Switch screen.

I also tried reboot to payload to go back to Hekate, then tried loading emuMMC again. Then I DO get the white A, followed by small battery icon, then Nintendo logo, then main Switch screen.

My bootlogo.bmp file never shows up either way. Does this file need to be created in some special manner? Or can it be any image as long as it's in bmp format? As in, can I take a jpg or png and simply save it as bmp in a photo editor? Or do I need to use other method to convert to proper format?
 
There is no sept logo in your videos.

The sept logo "is" the splash.png


splash.png
Ah, ok so I have the terms with wrong name.

On my notes and my knwledge I have the terms interchanged:

1755641046692.png
 
@impeeza Thank you. I was staring at that info the entire time and looked right past it. LOL!

"The bootlogo can be any size with a maximum of 720 x 1280.

When it's smaller than 720 x 1280, it is automatically centered and the background takes the color of the first pixel.

The process is to create a landscape bootlogo and then rotate it 90 degrees counterclockwise.

Lastly, the supported format is 32-bit (ARGB) BMP. Classic 24-bit (RGB) BMPs are not supported for performance reasons."

I will try proper method later. Off for fajitas at my cousins place. :P
 
  • Love
Reactions: impeeza
@impeeza Thank you. I was staring at that info the entire time and looked right past it. LOL!

"The bootlogo can be any size with a maximum of 720 x 1280.

When it's smaller than 720 x 1280, it is automatically centered and the background takes the color of the first pixel.

The process is to create a landscape bootlogo and then rotate it 90 degrees counterclockwise.

Lastly, the supported format is 32-bit (ARGB) BMP. Classic 24-bit (RGB) BMPs are not supported for performance reasons."

I will try proper method later. Off for fajitas at my cousins place. :P
That is for Hekate's BootLogo.
 
  • Like
Reactions: GoodmanBCN
That is for Hekate's BootLogo.

Well crap. I also overlooked what git page I was looking at. :lol: But now I'm more confused. I don't know why my image is not displaying at all then. Perhaps there are similar restrictions for Atmosphere logo replacement. I have no idea. All I know is that my bootlogo.bmp image never shows despite having hekate_ipl.ini pointing to it and bootwait set to 5.
 
Well crap. I also overlooked what git page I was looking at. :lol: But now I'm more confused. I don't know why my image is not displaying at all then. Perhaps there are similar restrictions for Atmosphere logo replacement. I have no idea. All I know is that my bootlogo.bmp image never shows despite having hekate_ipl.ini pointing to it and bootwait set to 5.
The supported format is 32-bit (ARGB) BMP. Classic 24-bit (RGB) BMPs are not supported
 

Site & Scene News

Popular threads in this forum