Open
Conversation
Set the default folder in config.ini with the key `default_folder`. For e.g. `default_folder = games`. Cubiboot will start with that folder open instead of in the root of the SD card.
trevor403
reviewed
Nov 7, 2025
cubeboot/source/main.c
Outdated
| // } | ||
| void *default_folder_ptr = (void*)get_symbol_value(symshdr, syment, symstringdata, "default_folder"); | ||
| if (default_folder_ptr != NULL && settings.default_folder != NULL) { | ||
| iprintf("Copying cube_logo_path: %p\n", default_folder_ptr); |
patches/source/main.c
Outdated
|
|
||
| if (!start_passthrough_game) { | ||
| gm_start_thread("/"); | ||
| if (dvd_custom_open(default_folder, FILE_ENTRY_TYPE_DIR, 0) == 0) { |
There was a problem hiding this comment.
Using an uninitialized string without checking if it is empty
Author
There was a problem hiding this comment.
Sorted this and refactored the whole thing whilst doing it because I wasn't liking the nested if statements. I'm rubbish at naming functions and variables.
Author
|
I realised that if you didn't use a |
- Added get_valid_path() helper to safely check default_folder. - Handles NULL, empty, and missing leading '/' cases. - Falls back to root '/' if folder does not exist.
49095ea to
cc276ea
Compare
- Renamed get_valid_path() to resolve_default_folder() for clarity - Switched to using a local path_buf to safely build folder paths - Moved default_folder initialisation to below cube_logo
Author
|
Didn't mean to do that |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Set the default folder in config.ini with the key
default_folder.Example:
default_folder = gamesCubiboot will start with that folder open instead of in the root of the SD card.
I tested the cubiboot.dol on a GameCube with picoboot v0.5.0.
All of these opened the games folder on boot correctly:
Setting default_folder to a directory that doesn't exist will just open the root of the SD like normal.