From dac72ff371ceadc4bfe0cb975a9c88b2f15eb322 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Wed, 22 Feb 2017 17:22:27 +0300 Subject: [PATCH] Automatic dev_* dir creation --- .../data/font/Put_font_files_here.txt | 0 .../sys/external/Put_flash_files_here.txt | 0 bin/dev_hdd1/.gitignore | 2 -- bin/dev_hdd1/cache/README.txt | 1 - bin/dev_hdd1/game/README.txt | 1 - bin/dev_usb000/.gitignore | 2 +- rpcs3/Emu/System.cpp | 22 +++++++++++++++++++ 7 files changed, 23 insertions(+), 5 deletions(-) delete mode 100644 bin/dev_flash/data/font/Put_font_files_here.txt delete mode 100644 bin/dev_flash/sys/external/Put_flash_files_here.txt delete mode 100644 bin/dev_hdd1/cache/README.txt delete mode 100644 bin/dev_hdd1/game/README.txt diff --git a/bin/dev_flash/data/font/Put_font_files_here.txt b/bin/dev_flash/data/font/Put_font_files_here.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/bin/dev_flash/sys/external/Put_flash_files_here.txt b/bin/dev_flash/sys/external/Put_flash_files_here.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/bin/dev_hdd1/.gitignore b/bin/dev_hdd1/.gitignore index 5e4974bd2e..5e7d2734cf 100644 --- a/bin/dev_hdd1/.gitignore +++ b/bin/dev_hdd1/.gitignore @@ -2,5 +2,3 @@ * # Except this file !.gitignore -!cache -!cache/README.txt \ No newline at end of file diff --git a/bin/dev_hdd1/cache/README.txt b/bin/dev_hdd1/cache/README.txt deleted file mode 100644 index 866145c799..0000000000 --- a/bin/dev_hdd1/cache/README.txt +++ /dev/null @@ -1 +0,0 @@ -This directory is used for cache functionality, so don't store any data here. diff --git a/bin/dev_hdd1/game/README.txt b/bin/dev_hdd1/game/README.txt deleted file mode 100644 index fdf4ca2135..0000000000 --- a/bin/dev_hdd1/game/README.txt +++ /dev/null @@ -1 +0,0 @@ -This directory is used for temporary gamedata functionality, so don't store any data here. diff --git a/bin/dev_usb000/.gitignore b/bin/dev_usb000/.gitignore index 86d0cb2726..5e7d2734cf 100644 --- a/bin/dev_usb000/.gitignore +++ b/bin/dev_usb000/.gitignore @@ -1,4 +1,4 @@ # Ignore everything in this directory * # Except this file -!.gitignore \ No newline at end of file +!.gitignore diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index 393d98cba1..2ca973ca8f 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -85,6 +85,28 @@ void Emulator::Init() // Reload global configuration cfg::root.from_string(fs::file(fs::get_config_dir() + "/config.yml", fs::read + fs::create).to_string()); + // Create directories + const std::string emu_dir_ = g_cfg_vfs_emulator_dir; + const std::string emu_dir = emu_dir_.empty() ? fs::get_config_dir() : emu_dir_; + const std::string dev_hdd0 = fmt::replace_all(g_cfg_vfs_dev_hdd0, "$(EmulatorDir)", emu_dir); + const std::string dev_hdd1 = fmt::replace_all(g_cfg_vfs_dev_hdd1, "$(EmulatorDir)", emu_dir); + const std::string dev_usb = fmt::replace_all(g_cfg_vfs_dev_usb000, "$(EmulatorDir)", emu_dir); + + fs::create_path(dev_hdd0); + fs::create_dir(dev_hdd0 + "game/"); + fs::create_dir(dev_hdd0 + "game/TEST12345/"); + fs::create_dir(dev_hdd0 + "game/TEST12345/USRDIR/"); + fs::create_dir(dev_hdd0 + "home/"); + fs::create_dir(dev_hdd0 + "home/00000001/"); + fs::create_dir(dev_hdd0 + "home/00000001/exdata/"); + fs::create_dir(dev_hdd0 + "home/00000001/savedata/"); + fs::create_dir(dev_hdd0 + "home/00000001/trophy/"); + if (fs::file f{dev_hdd0 + "home/00000001/localusername", fs::create + fs::excl + fs::write}) f.write("User"s); + fs::create_dir(dev_hdd1 + "cache/"); + fs::create_dir(dev_hdd1 + "game/"); + fs::create_path(dev_hdd1); + fs::create_path(dev_usb); + SetCPUThreadStop(0); }