Skip to content

Commit

Permalink
refactor: Use $HOME/Amiberry for all folders, under macOS installations
Browse files Browse the repository at this point in the history
  • Loading branch information
midwan committed Dec 14, 2024
1 parent ecefd7a commit f6acd99
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/osdep/amiberry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4117,7 +4117,7 @@ void create_missing_amiberry_folders()
}
}

static void init_amiberry_dirs(bool portable_mode)
static void init_amiberry_dirs(const bool portable_mode)
{
#ifdef __MACH__
const std::string amiberry_dir = "Amiberry";
Expand Down Expand Up @@ -4147,6 +4147,16 @@ static void init_amiberry_dirs(bool portable_mode)
}
else
{
#ifdef __MACH__
// We put everything under $HOME/Amiberry on macOS
amiberry_conf_file = config_path + "/amiberry.conf";
amiberry_ini_file = config_path + "/amiberry.ini";
themes_path = config_path;

controllers_path = whdboot_path = saveimage_dir = savestate_dir =
ripper_path = input_dir = screenshot_dir = nvram_dir = video_dir =
home_dir;
#else
std::string xdg_data_home = get_xdg_data_home();
if (!my_existsdir(xdg_data_home.c_str()))
{
Expand Down Expand Up @@ -4180,7 +4190,7 @@ static void init_amiberry_dirs(bool portable_mode)
controllers_path = whdboot_path = saveimage_dir = savestate_dir =
ripper_path = input_dir = screenshot_dir = nvram_dir = video_dir =
xdg_data_home;

#endif
// These go in $HOME/Amiberry by default
whdload_arch_path = floppy_path = harddrive_path =
cdrom_path = logfile_path = rom_path = rp9_path =
Expand Down Expand Up @@ -4454,7 +4464,7 @@ int main(int argc, char* argv[])
}
// Check if a file with the name "amiberry.portable" exists in the current directory
// If it does, we will set portable_mode to true
bool portable_mode = my_existsfile2("amiberry.portable");
const bool portable_mode = my_existsfile2("amiberry.portable");
init_amiberry_dirs(portable_mode);
load_amiberry_settings();
// Parse command line and remove used amiberry specific args
Expand Down

0 comments on commit f6acd99

Please sign in to comment.