Hacking [Release+Mini Tutorial] AIO.bat: All-In-1 batch file for compiling 3DS stuff

  • Thread starter Thread starter Madridi
  • Start date Start date
  • Views Views 30,696
  • Replies Replies 195
  • Likes Likes 20
Info:

If you want to build Homebrew Launcher (HBL) v1.1.1 you need ctrulib commit b6e0555 Date:2016-04-09 to get a working build.
(Not commit 2706026 from the same date, that one will not work)

[EDIT]
If you're gonna build it yourself:
- Before you start go into c:\devkitpro
- Rename your current libctru folder to something like, libctru_current
- Now build and install your ctrulib commit b6e0555
- Then build your HBL (You need to have 3ds_portlibs zlib installed)
- When done, go back to c:\devkitpro
- Rename your libctru to libctru_hbl or something
- Rename your libctru_current back to libctru
 
Last edited by DjoeN,
  • Like
Reactions: Madridi
@DjoeN @Rohul1997 i'm glad you guys know what you're doing i sure don't

--------------------- MERGED ---------------------------

@DjoeN can you please clarify how to install cygwin in "develop mode"? several minutes of googling yielded nothing, i think this might be a language barrier (is it called something else in other languages?)
 
@DjoeN @Rohul1997 i'm glad you guys know what you're doing i sure don't

--------------------- MERGED ---------------------------

@DjoeN can you please clarify how to install cygwin in "develop mode"? several minutes of googling yielded nothing, i think this might be a language barrier (is it called something else in other languages?)
When you try to install Cygwin, it will list a lot of packages. One of them is developer, make sure you mark that as install. Beware though that the installation takes a LOT of time. Like an hour or something
 
Update:

Homebrew Launcher has an upstream version that got updated so it can be compiled with latest ctrulib commits
https://github.com/smealum/3ds_hb_menu/tree/libctru-upstream

Just let's call it "Homebrew Launcher Upstream"
- This build HBL v1.1.1 (needed for HumbleHax i think) cause it supports mmap

Code:
@echo off
cls
%~d0
cd %~dp0
Title = Homebrew Launcher upstream...
if exist "Homebrew_Launcher_upstream" (
    echo Making a backup of your current 3ds_hb_menu folder
    xcopy "3ds_hb_menu\*" "Backups_Compiles\Backup_3ds_hb_menu" /e /i /y >nul
    ren Homebrew_Launcher_upstream 3ds_hb_menu
    cls
    cd 3ds_hb_menu
    Title = Building Homebrew Launcher upstream ^(Update^)...
    echo Updating repo...
    git pull origin master
    git submodule update --init --recursive
) else (
    Title = Building Homebrew Launcher upstream ^(Clone^)...
    echo Cloning repo...
    git clone --recursive https://github.com/smealum/3ds_hb_menu -b libctru-upstream
    cd 3ds_hb_menu
)
echo Building...
Title = Building Homebrew Launcher upstream ^(Clean^)...
make clean
Title = Building Homebrew Launcher upstream ^(Release^)...
make
Title = Building Homebrew Launcher upstream ^(Done^)
echo.
echo ############################################
cd %~dp0
ren 3ds_hb_menu Homebrew_Launcher_upstream
color A
echo Done. Files are in the "Homebrew_Launcher_upstream" folder.
echo.
echo Press any key to continue ...
Pause >nul
exit
 
Last edited by DjoeN,
  • Like
Reactions: Madridi
Update:

Homebrew Launcher has an upstream version that got updated so it can be compiled with lates ctrulib commits
https://github.com/smealum/3ds_hb_menu/tree/libctru-upstream

Just let's call it "Homebrew Launcher Upstream"
- This build HBL v1.1.1 (needed for HumbleHax i think) cause it supports mmap

Code:
@echo off
cls
%~d0
cd %~dp0
Title = Homebrew Launcher upstream...
if exist "Homebrew_Launcher_upstream" (
    echo Making a backup of your current 3ds_hb_menu folder
    xcopy "3ds_hb_menu\*" "Backups_Compiles\Backup_3ds_hb_menu" /e /i /y >nul
    ren Homebrew_Launcher_upstream 3ds_hb_menu
    cls
    cd 3ds_hb_menu
    Title = Building Homebrew Launcher upstream ^(Update^)...
    echo Updating repo...
    git pull origin master
    git submodule update --init --recursive
) else (
    Title = Building Homebrew Launcher upstream ^(Clone^)...
    echo Cloning repo...
    git clone --recursive https://github.com/smealum/3ds_hb_menu -b libctru-upstream
    cd 3ds_hb_menu
)
echo Building...
Title = Building Homebrew Launcher upstream ^(Clean^)...
make clean
Title = Building Homebrew Launcher upstream ^(Release^)...
make
Title = Building Homebrew Launcher upstream ^(Done^)
echo.
echo ############################################
cd %~dp0
ren 3ds_hb_menu Homebrew_Launcher_upstream
color A
echo Done. Files are in the "Homebrew_Launcher_upstream" folder.
echo.
echo Press any key to continue ...
Pause >nul
exit
What does upstream version mean? What does it do?
 
I've been trying to compile FreeType 2.6.2 for the longest time without avail. Can anyone help me with solving this error?
 

Attachments

  • Capture.PNG
    Capture.PNG
    13.3 KB · Views: 220
I've been trying to compile FreeType 2.6.2 for the longest time without avail. Can anyone help me with solving this error?
It can't find the c compiler it needs, did u install devkitpro correctly and checked if c:\devkitpro; is in your path?
 
  • Like
Reactions: Madridi
That's already what we have been doing with the original one. But no that doesn't seem to be the issue right now. I noticed that it cleans some files if you run make clean after the build is complete, but not everything. The way to properly build this is also not correct in the bat, and I don't know how to fix this yet.

I hate cmake lol..

If you're cloning off git, run git clean -fxd. That removes all files and directories not tracked by git. I use that often with cmake-based projects.
 
Maybe a little extra, so we know what version we are using.
(It's just cosmetic ;) )

Code:
@echo off
:TYPE
Title = ALL-IN-ONE v1.6...
cls
ECHO .......................................
ECHO . 3DS All in One Build Main Menu v1.6 .
ECHO .......................................
 
If you're cloning off git, run git clean -fxd. That removes all files and directories not tracked by git. I use that often with cmake-based projects.
Wow this works! Thanks for the info. I never knew about it. I'll add it in the next update. I'm wondering if I should add this for everything and remove "make clean"

Thanks!

--------------------- MERGED ---------------------------

Maybe a little extra, so we know what version we are using.
(It's just cosmetic ;) )

Code:
@echo off
:TYPE
Title = ALL-IN-ONE v1.6...
cls
ECHO .......................................
ECHO . 3DS All in One Build Main Menu v1.6 .
ECHO .......................................
Sure, I'll do that :)
 
  • Like
Reactions: Rohul1997
some new info:
@Aurora Wright has updated arm9loaderhax with merged screeninit and no screeninit.
the noscreeninit branch is removed from the git

:AURORA
cls
Title = Building arm9loaderhax...
ECHO ...........................................................
ECHO . Aurora's A9LH Menu. Which Build do you want to compile? .
ECHO ...........................................................
ECHO.
ECHO A - Screeninit
ECHO B - No Screeninit
ECHO C - Return to Arm9loaderhax Menu
ECHO D - Return to Main Menu
ECHO E - EXIT Program
ECHO.
choice /C ABCDE /M "Enter the letter of your choice:"
IF ERRORLEVEL 5 exit
IF ERRORLEVEL 4 GOTO TYPE
IF ERRORLEVEL 3 GOTO A9LH
IF ERRORLEVEL 2 GOTO NOINIT
IF ERRORLEVEL 1 GOTO INIT


Code:
:AURORA
cls
if exist "A9LH-AURORA" (
    echo Making a backup of your current A9LH-AUR-init folder
    xcopy "A9LH-AURORA\*" "Backups_Compiles\Backup_A9LH-AURORA" /e /i /y >nul
    Timeout /t 1 /nobreak >nul
    ren A9LH-AURORA arm9loaderhax
    cd arm9loaderhax
    Title = Building A9LH-AURORA ^(Update^)...
    echo Updating repo...
    git pull origin master
    git submodule update --init --recursive
) else (
    Title = Building A9LH-AURORA ^(Clone^)...
    echo Cloning repo...
    git clone --recursive https://github.com/AuroraWright/arm9loaderhax.git
    cd arm9loaderhax
)
set PATH=c:\Python27\;%PATH%
echo Building...
Title = Building A9LH-AURORA ^(Clean^)...
make clean
Title = Building A9LH-AURORA ^(Release^)...
make all
Title = Building A9LH-AURORA ^(Done^)
echo.
echo ##################################################
color A
cd ..
ren arm9loaderhax A9LH-AURORA
echo Done. Files are in the "A9LH-AURORA/out" folder. && echo Press any key to continue ...
Pause >nul
GOTO END
 
some new info:
@Aurora Wright has updated arm9loaderhax with merged screeninit and no screeninit.
the noscreeninit branch is removed from the git

:AURORA
cls
Title = Building arm9loaderhax...
ECHO ...........................................................
ECHO . Aurora's A9LH Menu. Which Build do you want to compile? .
ECHO ...........................................................
ECHO.
ECHO A - Screeninit
ECHO B - No Screeninit
ECHO C - Return to Arm9loaderhax Menu
ECHO D - Return to Main Menu
ECHO E - EXIT Program
ECHO.
choice /C ABCDE /M "Enter the letter of your choice:"
IF ERRORLEVEL 5 exit
IF ERRORLEVEL 4 GOTO TYPE
IF ERRORLEVEL 3 GOTO A9LH
IF ERRORLEVEL 2 GOTO NOINIT
IF ERRORLEVEL 1 GOTO INIT


Code:
:AURORA
cls
if exist "A9LH-AURORA" (
    echo Making a backup of your current A9LH-AUR-init folder
    xcopy "A9LH-AURORA\*" "Backups_Compiles\Backup_A9LH-AURORA" /e /i /y >nul
    Timeout /t 1 /nobreak >nul
    ren A9LH-AURORA arm9loaderhax
    cd arm9loaderhax
    Title = Building A9LH-AURORA ^(Update^)...
    echo Updating repo...
    git pull origin master
    git submodule update --init --recursive
) else (
    Title = Building A9LH-AURORA ^(Clone^)...
    echo Cloning repo...
    git clone --recursive https://github.com/AuroraWright/arm9loaderhax.git
    cd arm9loaderhax
)
set PATH=c:\Python27\;%PATH%
echo Building...
Title = Building A9LH-AURORA ^(Clean^)...
make clean
Title = Building A9LH-AURORA ^(Release^)...
make all
Title = Building A9LH-AURORA ^(Done^)
echo.
echo ##################################################
color A
cd ..
ren arm9loaderhax A9LH-AURORA
echo Done. Files are in the "A9LH-AURORA/out" folder. && echo Press any key to continue ...
Pause >nul
GOTO END
Yeah I already added this a while ago. I just haven't released it yet (until I get some time to look at ctrbootmanager issue)

Thanks for the help though :)
 
  • Like
Reactions: Rohul1997 and DjoeN
Some things i use and think some may find also usefull:

So as you know some homebrew compiles with latest libctru, some don't (you need an older libctru build for that)

IF somebody has an easier solution or has a setup that doesn't need what i did below, just post it in this thread :)

First:
When stuff like Decrypt9WIP etc... compiles fine:
Make a copy of your current libctru folder to "libctru_old"
Run AIO and install latest ctrulib by smea

What now:
What i used to do -> when i would like to build "Decrypt9" for example i go to c:\devkitPro and rename "libctru" -> "libctru_new" and "libctru_old" to "libctru" and vica versa.
You can understand i got tired of this quickly

So some time ago i wrote a little batch for that and added a check in the build scripts to see what libctru version is the active one. (Yes, i use my own versions of the batch script, but will not use them in this examples)

Code:
@echo off

%~d0
cd %~dp0
Title = LIBCTRU Switcher...
cls
ECHO .............................................
ECHO . LIBCTRU Switch Menu. Choose your LIBCTRU: .
ECHO .............................................
ECHO.
ECHO 1 - Switch to newest LIBCTRU
ECHO 2 - Switch to older LIBCTRU
ECHO 3 - EXIT Program
ECHO.
choice /C 123 /M "Enter the letter of your choice:"
IF ERRORLEVEL 3 exit
IF ERRORLEVEL 2 GOTO OLD
IF ERRORLEVEL 1 GOTO NEW

:NEW
Title = Switch to newest LIBCTRU...
c:
cd c:\devkitPro
if not exist "libctru_old" GOTO SWITCH
ECHO.
ECHO.
ECHO - You already are using a newer libctru version!!!
ECHO.
ECHO.
ECHO Press any key to exit!
d:
cd %~dp0
Pause >nul
exit

:OLD
Title = Switch to older LIBCTRU...
c:
cd c:\devkitPro
if not exist "libctru_new" GOTO SWAP
ECHO.
ECHO.
ECHO - You already are using an older libctru version!!!
ECHO.
ECHO.
ECHO Press any key to exit!
d:
cd %~dp0
Pause >nul
exit

:SWITCH
ren libctru libctru_old
Timeout /t 1 /nobreak >nul
ren libctru_new libctru
d:
cd %~dp0
ECHO.
ECHO.
ECHO - You are now using a newer libctru version!
ECHO.
ECHO.
ECHO Press any key to exit!
Pause >nul
exit

:SWAP
ren libctru libctru_new
Timeout /t 1 /nobreak >nul
ren libctru_old libctru
d:
cd %~dp0
ECHO.
ECHO.
ECHO - You are now using an older libctru version!
ECHO.
ECHO.
ECHO Press any key to exit!
Pause >nul
exit


and added a check in the build scripts to see what libctru version is the active one
For homebrew that needs the newest libctru:
Code:
if not exist "c:\devkitPro\libctru_old" GOTO WARN
So it checks if there is a folder "libctru_old" in the "c:\devkitPro" folder
if it doesn't exist go to label WARN
if it does exist, continue with the next line

.
.
.
or for homebrew that needs an older version of libctru:
Code:
if not exist "c:\devkitPro\libctru_new" GOTO WARN
So it checks if there is a folder "libctru_new" in the "c:\devkitPro" folder
if it doesn't exist go to label WARN
if it does exist, continue with the next line

.
.
.
label WARN
Code:
:WARN
ECHO.
ECHO.
ECHO Warning!
ECHO ---------
ECHO.
ECHO You are not using the correct libctru version to compile this!
ECHO Run switch_libctru.bat to switch to the correct libctru version.
ECHO.
ECHO.
ECHO Press any key to continue...
Pause >nul
GOTO END
Warning output at the end of the batch file
Only gets shown if not using the correct libctru version.


EXAMPLE:
Code:
:FBI
cls
if not exist "c:\devkitPro\libctru_old" GOTO WARN
Title = Building FBI...
if exist "FBI" (
    echo Making a backup of your current FBI folder
    xcopy "FBI\*" "Backups_Compiles\Backup_FBI" /e /i /y >nul
    cd FBI
    Title = Building FBI ^(Update^)...
    echo Updating repo...
    git pull origin master
    git submodule update --init --recursive
) else (
    Title = Building FBI ^(Clone^)...
    echo Cloning repo...
    git clone --recursive https://github.com/Steveice10/FBI.git
    cd FBI
)
set PATH=c:\Python27\;%PATH%
echo Building...
Title = Building FBI ^(Clean^)...
make clean
Title = Building FBI ^(Release^)...
make
Title = Building FBI ^(Done^)
echo.
echo ####################################
color A
cd ..
echo Done. Files are in the "FBI" folder. && echo Press any key to continue ...
Pause >nul
GOTO END

:D9WIP
cls
if not exist "c:\devkitPro\libctru_new" GOTO WARN
Title = Building Decrypt9WIP...
if exist "Decrypt9WIP" (
    echo Making a backup of your current Decrypt9WIP folder
    xcopy "Decrypt9WIP\*" "Backups_Compiles\Backup_Decrypt9WIP" /e /i /y >nul
    cd Decrypt9WIP
    Title = Building Decrypt9WIP ^(Update^)...
    echo Updating repo...
    git pull origin master
    git submodule update --init --recursive
) else (
    Title = Building Decrypt9WIP ^(Clone^)...
    echo Cloning repo...
    git clone --recursive https://github.com/d0k3/Decrypt9WIP.git
    cd Decrypt9WIP
)
set PATH=c:\Python27\;%PATH%
echo Building...
Title = Building Decrypt9WIP ^(Clean^)...
make clean
Title = Building Decrypt9WIP ^(Release^)...
make release
Title = Building Decrypt9WIP ^(Done^)
echo.
echo ####################################################
color A
cd ..
echo Done. Files are in the "Decrypt9WIP/release" folder. && echo Press any key to continue ...
Pause >nul
GOTO END

:WARN
ECHO.
ECHO.
ECHO Warning!
ECHO ---------
ECHO.
ECHO You are not using the correct libctru version to compile this!
ECHO Run switch_libctru.bat to switch to the correct libctru version.
ECHO.
ECHO.
ECHO Press any key to continue...
Pause >nul
GOTO END

I know it will get useless once all homebrew is updated to use latest ctrulib (like JKSM just did today and CakesFW a few days ago.)

So, this is just informative, no request or git pull, you can do whatever you want with this information :)


[EDIT]
Some homebrew like "HourGlass9" compiles fine on whatever libctru version you are, so no check is needed
 
Last edited by DjoeN,
  • Like
Reactions: Madridi
[EDIT]
Some homebrew like "HourGlass9" compiles fine on whatever libctru version you are, so no check is needed

Hourglass9, Decrypt9WIP etc compile fine since arm9 homebrew doesn't use ctrulib.
 
  • Like
Reactions: Madridi
@DjoeN
I see what you did there, I do the libctru change manually for more than one reason:
- other libs sometimes are installed inside libctru, so if you update one, the other libctru you have will not be updated, until you remember that you never did
- libctru as well as many other sources, their compatibility change everyday with every homebrew. New and old might get confusing at some point when a certain libctru update breaks something.

For the reasons above, I'd rather have the user install their intended commit of libctru at will
 
atm when trying to Compile Luma3DS, this Errors out and the Compile doesnt complete:

khaxinit.cpp
arm-none-eabi-g++ -MMD -MP -MF /c/Users/Cael/Downloads/Work/Luma3DS/CakeBrah/build/khaxinit.d -g -Wall -Wextra -O3 -mword-relocations -fomit-frame-pointer -ffast-math -march=armv6k -mtune=mpcore -mfloat-abi=hard -I/c/Users/Cael/Downloads/Work/Luma3DS/CakeBrah/include -I/c/devkitPro/libctru/include -I/c/Users/Cael/Downloads/Work/Luma3DS/CakeBrah/build -DARM11 -D_3DS -DARM_ARCH -DLAUNCHER_PATH='"Luma3DS.dat"' -fno-rtti -fno-exceptions -std=gnu++11 -c /c/Users/Cael/Downloads/Work/Luma3DS/CakeBrah/source/libkhax/khaxinit.cpp -o khaxinit.o
c:/Users/Cael/Downloads/Work/Luma3DS/CakeBrah/source/libkhax/khaxinit.cpp: In function 'Result KHAX::IsNew3DS(bool*, u32)':
c:/Users/Cael/Downloads/Work/Luma3DS/CakeBrah/source/libkhax/khaxinit.cpp:985:47: error: cannot convert 'bool*' to 'u8* {aka unsigned char*}' for argument '1' to 'Result APT_CheckNew3DS(u8*)'
if (Result error = APT_CheckNew3DS(&isNew3DS))
^
make[2]: *** [khaxinit.o] Error 1
make[1]: *** [build] Error 2
make: *** [out/3ds/Luma3DS] Error 2
 

Site & Scene News

Popular threads in this forum