-
Notifications
You must be signed in to change notification settings - Fork 3
CtrBootManager setup
CtrBootManager needs a configuration file to be customized. The configuration file must be ta following path:
- SDCardRoot:/boot.cfg for CtrBootManager.3dsx
- SDCardRoot:/a9lh.cfg for CtrBootManager9.bin
This configuration file is a ".ini" document style. So the syntax of this file must look like this:
[category1]
property1=value1;
property2=value2;
[category2]
property3=value3;
Currently, CtrBootManager reads the following categories:
- [general] : generic boot parameters
- [theme] : background, menu and text default colors
- [animation] : animations for background, menu and text colors
- [topMovie] and [bottomMovie] : setup for top/bottom screen movies
- [entry] : list of possible boot entries (first opened menu)
[general]
timeout=-1;
recovery=3;
default=3;
autobootfix=8;
- "default" : the entry index which will be selected on CtrBootManager start
- "timeout" : the time in seconds before automatic boot on default entry if no key is pressed
- "-1" means disable the timer
- "0" means instantaneous boot on default entry (see "recovery" key)
- "recovery" : key to stop instantaneous automatic boot
- "0" is the A button
- "1" is the B button
- "2" is the Select button
- "3" is the Start button
- "4" is the Right direction
- "5" is the Left direction
- "6" is the Up direction
- "7" is the Down direction
- "8" is the Right trigger
- "9" is the Left trigger
- "10" is the X button
- "11" is the Y button
- "autobootfix" (only for 3DSX version) : the number of frames wait before automatic boot (it can avoid some instabilities)
Those properties are all integer values.
[theme]
bgTop1=000000;
bgTop2=000000;
bgBottom=000000;
highlight=FF00004F;
borders=C9FFFCBF;
font1=C9FFFCBF;
font2=C9FFFC;
bgImgTop=/directory/image_RGB_400x240.bin;
bgImgBot=/directory/image_RGB_320x240.bin;
- "bgTop1" : RGB color on top screen (gradient bottom)
- "bgTop2" : RGB color on top screen (gradient top)
- "bgBottom" : RGB color on bottom screen
- "highlight" : RGBA color for selection rectangle
- "borders" : RGBA color for border lines
- "font1" : RGBA color for all texts execpt the one under selection
- "font2" : RGBA color for text under selection
- "bgImgTop" : path to an image for top screen
- It hides impact of "bgTop1" and "bgTop2" properties
- The given image must have a resolution of 400x240 and it must be in RGB format (its size must be 288000 bytes)
- "bgImgBot" : path to an image for bottom screen
- It hides impact of "bgBottom" property
- The given image must have a resolution of 320x240 and it must be in RGB format (its size must be 230400 bytes)
Colors are in hexadecimal form. For each color channel, 00 is the minimum and FF is the maximum (which represents 255 in decimal value).
RGB colors take the following form: "XXYYZZ"
- XX is the red color
- YY is the blue color
- ZZ is the green color You can use the following page to visualize a color: http://www.colorpicker.com/
RGBA colors take the following form: "XXYYZZAA"
- XX is the red color
- YY is the blue color
- ZZ is the green color
- AA is the transparency
- 00 means you won't see the object
- FF means the object is fully opaque (nothing behind it is seen) You can replace an RGBA color with an RGB color, in that case "AA" will be at maximum value (fully opaque).
For images, you can use this web tool to convert most files: https://xem.github.io/3DShomebrew/tools/image-to-bin.html
Don't forget that you need a RGB image, no transparency! So uncheck "preserve transparency" box on the given page.
[animation]
bgTop1=30:0:FF0000;
bgTop2=30:15:0000FF;
bgBottom=20:0:00FF00;
highlight=12:0:FF0000AF;
borders=30:0:C9FFFCBF;
font1=12:0:FFFFFFFF;
font2=12:0:FFFFFF;
menuFadeIn=20:10;
WARNING: Most animation properties have the same name as theme properties, so category is essential to avoid any confusion!
For properties which have the same name as properties inside the theme category, the syntax takes the following form: "X:Y:COLOR"
- COLOR is the animation target color (it can be an RGB or RGBA color, depending on which theme property it animates)
- X is a positive integer which represents the duration in frames for go from the original theme color to the target color
- Y is an integer which adds an offset (if 2 animated properties have the same duration but you wish them to be desynchronized) A complete animation loop for a property is 2 times "X" (for a round-trip).
The only property which doesn't have a common name with a theme category property is "menuFadeIn". This property allow to hide all menu elements (texts, selection rectangle and borders) during a given time, then they fully appear in another given time. It follows this syntax: "X:Y"
- X is the time in frames where all menu elements stay hidden
- Y is the time in frame for elements apparition with full opacity So menu elements take "X"+"Y" frames to appear with their maximum opacity.
[topMovie]
path=/anim/0/anim;
compression=QuickLZ;
loopCount=infinite;
loopStreamType=compressed_memory;
loopReverse=yes;
loopStartFrame=10;
delayOnLoopStart=5;
loopEndFrame=30;
delayOnLoopEnd=5;
[bottomMovie]
path=/anim/0/bottom_anim;
compression=0;
loopCount=5;
loopStreamType=memory;
loopReverse=no;
loopStartFrame=0;
loopEndFrame=-1;
The "topMovie" category allows to setup a movie for top screen and the "bottom" category is for the bottom screen. Keep in mind that movie resolution must be 400x240 for top screen and 320x240 for bottom screen.
Property names are the same for top and bottom movies:
- "path" : path to the movie file
- "compression" : specify if the given file is a compressed movie
- "0" means that the movie is not compressed (default value)
- "QuickLZ" or currently any not null integer value means that the movie is compressed
- "loopCount" : movie loops to do once the movie is over
- It can be "infinite", "INFINITE" or a negative value to infinitely loop the movie
- "0" means the movie won't be played again after it is over (default value)
- "loopStreamType" : specify how the movie loop is stored for replay
- "file" or "0" means the movie file will be kept opened and used again for each loop (loops could be very slow, default value)
- "memory" or any integer value other than "0" and "2" means the loop frames are kept uncompressed in memory (movie file is closed)
- "compressed_memory" or "2" (only available for compressed movies) means compressed data to restore loop frames is kept in memory
- "loopReverse" : allows loop play in reverse mode
- "yes", "YES" or any not null integer means that reverse mode will be active
- "no", "NO" or "0" means that reverse mode will be deactivated (default value)
- When this mode is active, movie continuity will be preserved (so if "loopEndFrame" is not at movie end, the movie won't be played entirely even on first time)
- "loopStartFrame" : movie start frame for loop (positive integer)
- "0" means the movie first frame will be used (default value)
- If this value is too big, the loop will be reduced to the movie last frame (it will look like a static image)
- "delayOnLoopStart" : once a loop play is on the first frame, it will stay on this frame during the time in frames specified on this value
- "loopStartEnd" : movie start frame for loop (positive integer)
- A negative integer means that the movie last frame will be used (default value)
- If this value is less than "loopStartFrame", it will be set at "loopStartFrame" value (so the loop will be reduced to "loopStartFrame")
- "delayOnLoopEnd" : once a loop play is on the last frame, it will stay on this frame during the time in frames specified on this value
By default, "loopStreamType" is set to "file" to avoid any crash due to insuffisent memory if movie loops are too long. You can change this default value if you wish to optimize loop replays. The fastest mode is "memory" but it can easily crash on too long movies, "compressed_memory" is a good compromise for compressed movies.
Once movie is played and all its loops are over, CtrBootManager will fallback on theme default background behavior (image first then color if no image is specified).
CtrBootManager is compatible with BootAnim9 movies. To generate your own movies, you can follow "cots" tutorial: https://gbatemp.net/threads/tutorial-a9lh-boot-animations.430867/ However, the "framerate" will be ignored and, if the movie is compressed, you must specify it in the "compression" property.
[entry]
title=Luma3DS;
path=/MyLuma3DSPath.bin;
offset=0;
patchMemSearch=730064006D0063003A002F00;
patchMemOverwriteWStr=sdmc:/MyLuma3DSPath.bin;
patchOccurence=1;
key=-1;
[entry]
title=CtrBootManager with another configuration;
path=/luma/payloads/start_CtrBootManager9.bin;
offset=0;
patchMemSearch=2F61396C682E63666700;
patchMemOverwriteStr=/other_a9lh.cfg;
patchOccurence=0;
key=-1;
All CtrBootManager versions read the following properties:
- "title" : title to display in menu
- "path" : the binary file path
- It should be a ".dat" or a ".bin" file for A9LH
- ".3dsx" files are only supported by 3DSX version
- "offset" : entry point offset in binary file in hexadecimal value
- For ".3dsx" and most ".bin" binary files, it should be "0"
- For most ".dat" binary files, it should be "12000"
- "key" : key which could be maintained at CtrBootManager start to direcly boot into this entry
- The key values are the same as "recovery" property description in "[general]" category
- "-1" means that the entry cannot be directly boot by maintaining a key
- This property MUST be used to end an entry!
Only A9LH version supports binary patch feature. This feature allow to dynamicaly modify the loaded binary. The feature primary usage was for Luma3DS which must internally have its path for GBA and TWL reboot support.
So the following properties are read by A9LH version:
- "patchMemSearch" : binary data (in hexadecimal form) to search in loaded binary file
- "patchMemOverwrite" : binary data (in hexadecimal form) which will be used to overwrite found "patchMemSearch"
- "patchMemOverwriteStr" : binary string which will be used to overwrite found "patchMemSearch"
- This property replaces "patchMemOverwrite" and "patchMemOverwriteWStr"
- It allows a more easily readable content than "patchMemOverwrite"
- This string is ended by a null character which will "cut" the rest of found "patchMemSearch"
- "patchMemOverwriteWStr" : binary string with wide characters which will be used to overwrite found "patchMemSearch"
- This property replaces "patchMemOverwrite" and "patchMemOverwriteStr"
- It is basicly the same as "patchMemOverwriteStr" with additional null byte between each character
- "patchOccurence" : occurence found in binary file which must be replaced
- "0" means all occurences in binary file will be replaced
- Other strictly positive integer will indicate to replace only one occurence in the binary file
- This property MUST be used to end a binary patch description!
Some useful "patchMemOverwrite":
- 730064006D0063003A002F00 => "sdmc:/" separated with null byte between each character (used for Luma3DS)
- 2F61396C682E63666700 => "/a9lh.cfg" (CtrBootManager9.bin configuration file)
The "[entry]" category text can be repeat for each boot entry to simplify configuration file reading. However, it is the "key" property which really ends an entry and starts a new one! The same goes for binary patches, each patch is ended with "patchOccurence" property.
Up to 11 entries are supported with 4 binary patches per entry.