mirror of
https://github.com/holub/mame
synced 2025-06-29 23:48:56 +03:00
Added swpath. Allows users to specify location of loose software.
This commit is contained in:
parent
e4acf3380a
commit
e2718c91de
@ -377,11 +377,29 @@ bool device_image_interface::try_change_working_directory(const std::string &sub
|
|||||||
|
|
||||||
void device_image_interface::setup_working_directory()
|
void device_image_interface::setup_working_directory()
|
||||||
{
|
{
|
||||||
// first set up the working directory to be the starting directory
|
bool success = false;
|
||||||
osd_get_full_path(m_working_directory, ".");
|
// get user-specified directory and make sure it exists
|
||||||
|
m_working_directory = device().mconfig().options().sw_path();
|
||||||
|
// if multipath, get first
|
||||||
|
size_t i = m_working_directory.find_first_of(";");
|
||||||
|
if (i != std::string::npos)
|
||||||
|
m_working_directory.resize(i);
|
||||||
|
// validate directory
|
||||||
|
if (!m_working_directory.empty())
|
||||||
|
if (osd::directory::open(m_working_directory))
|
||||||
|
success = true;
|
||||||
|
|
||||||
// now try browsing down to "software"
|
// if not exist, use previous method
|
||||||
if (try_change_working_directory("software"))
|
if (!success)
|
||||||
|
{
|
||||||
|
// first set up the working directory to be the starting directory
|
||||||
|
osd_get_full_path(m_working_directory, ".");
|
||||||
|
// now try browsing down to "software"
|
||||||
|
if (try_change_working_directory("software"))
|
||||||
|
success = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (success)
|
||||||
{
|
{
|
||||||
// now down to a directory for this computer
|
// now down to a directory for this computer
|
||||||
int gamedrv = driver_list::find(device().machine().system());
|
int gamedrv = driver_list::find(device().machine().system());
|
||||||
|
@ -39,6 +39,7 @@ const options_entry emu_options::s_option_entries[] =
|
|||||||
{ OPTION_CROSSHAIRPATH, "crosshair", OPTION_STRING, "path to crosshair files" },
|
{ OPTION_CROSSHAIRPATH, "crosshair", OPTION_STRING, "path to crosshair files" },
|
||||||
{ OPTION_PLUGINSPATH, "plugins", OPTION_STRING, "path to plugin files" },
|
{ OPTION_PLUGINSPATH, "plugins", OPTION_STRING, "path to plugin files" },
|
||||||
{ OPTION_LANGUAGEPATH, "language", OPTION_STRING, "path to language files" },
|
{ OPTION_LANGUAGEPATH, "language", OPTION_STRING, "path to language files" },
|
||||||
|
{ OPTION_SWPATH, "software", OPTION_STRING, "path to loose software" },
|
||||||
|
|
||||||
// output directory options
|
// output directory options
|
||||||
{ nullptr, nullptr, OPTION_HEADER, "CORE OUTPUT DIRECTORY OPTIONS" },
|
{ nullptr, nullptr, OPTION_HEADER, "CORE OUTPUT DIRECTORY OPTIONS" },
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#define OPTION_CROSSHAIRPATH "crosshairpath"
|
#define OPTION_CROSSHAIRPATH "crosshairpath"
|
||||||
#define OPTION_PLUGINSPATH "pluginspath"
|
#define OPTION_PLUGINSPATH "pluginspath"
|
||||||
#define OPTION_LANGUAGEPATH "languagepath"
|
#define OPTION_LANGUAGEPATH "languagepath"
|
||||||
|
#define OPTION_SWPATH "swpath"
|
||||||
|
|
||||||
// core directory options
|
// core directory options
|
||||||
#define OPTION_CFG_DIRECTORY "cfg_directory"
|
#define OPTION_CFG_DIRECTORY "cfg_directory"
|
||||||
@ -224,6 +225,7 @@ public:
|
|||||||
const char *crosshair_path() const { return value(OPTION_CROSSHAIRPATH); }
|
const char *crosshair_path() const { return value(OPTION_CROSSHAIRPATH); }
|
||||||
const char *plugins_path() const { return value(OPTION_PLUGINSPATH); }
|
const char *plugins_path() const { return value(OPTION_PLUGINSPATH); }
|
||||||
const char *language_path() const { return value(OPTION_LANGUAGEPATH); }
|
const char *language_path() const { return value(OPTION_LANGUAGEPATH); }
|
||||||
|
const char *sw_path() const { return value(OPTION_SWPATH); }
|
||||||
|
|
||||||
// core directory options
|
// core directory options
|
||||||
const char *cfg_directory() const { return value(OPTION_CFG_DIRECTORY); }
|
const char *cfg_directory() const { return value(OPTION_CFG_DIRECTORY); }
|
||||||
|
@ -33,6 +33,7 @@ struct folders_entry
|
|||||||
static const folders_entry s_folders[] =
|
static const folders_entry s_folders[] =
|
||||||
{
|
{
|
||||||
{ __("ROMs"), OPTION_MEDIAPATH, ADDING },
|
{ __("ROMs"), OPTION_MEDIAPATH, ADDING },
|
||||||
|
{ __("Software Media"), OPTION_SWPATH, CHANGE },
|
||||||
{ __("UI"), OPTION_UI_PATH, CHANGE },
|
{ __("UI"), OPTION_UI_PATH, CHANGE },
|
||||||
{ __("Language"), OPTION_LANGUAGEPATH, CHANGE },
|
{ __("Language"), OPTION_LANGUAGEPATH, CHANGE },
|
||||||
{ __("Samples"), OPTION_SAMPLEPATH, ADDING },
|
{ __("Samples"), OPTION_SAMPLEPATH, ADDING },
|
||||||
|
Loading…
Reference in New Issue
Block a user