added OPTION_HOMEPATH to point to read/write folder,for now used by LUA scripts (nw)

Copied all needed files so plugins could be started under UWP
This commit is contained in:
Miodrag Milanovic 2016-11-12 15:27:22 +01:00
parent bf11bf6621
commit b73126e85a
5 changed files with 11 additions and 2 deletions

View File

@ -12,7 +12,8 @@ exports.author = { name = "Carl" }
local timer = exports
function timer.startplugin()
local timer_db = "timer/timer.db"
local dir = lfs.env_replace(manager:options().entries.homepath:value())
local timer_db = dir .. "/timer/timer.db"
local timer_started = false
local total_time = 0
local start_time = 0
@ -43,7 +44,7 @@ function timer.startplugin()
save()
end
timer_started = true
lfs.mkdir('timer')
lfs.mkdir(dir .. '/timer')
local db = assert(sqlite3.open(timer_db))
local found=false
db:exec([[select * from sqlite_master where name='timer';]], function(...) found=true return 0 end)

View File

@ -90,10 +90,14 @@ end
-- Effects and Shaders
configuration { "winstore*" }
files {
MAME_DIR .. "artwork/*",
MAME_DIR .. "artwork/**/*",
MAME_DIR .. "bgfx/*",
MAME_DIR .. "bgfx/**/*",
MAME_DIR .. "hash/*",
MAME_DIR .. "language/*",
MAME_DIR .. "language/**/*",
MAME_DIR .. "plugins/*",
MAME_DIR .. "plugins/**/*",
}
configuration "**/*"

View File

@ -28,6 +28,7 @@ const options_entry emu_options::s_option_entries[] =
// search path options
{ nullptr, nullptr, OPTION_HEADER, "CORE SEARCH PATH OPTIONS" },
{ OPTION_HOMEPATH, ".", OPTION_STRING, "path to home drictory (read/write) location" },
{ OPTION_MEDIAPATH ";rp;biospath;bp", "roms", OPTION_STRING, "path to ROMsets and hard disk images" },
{ OPTION_HASHPATH ";hash_directory;hash", "hash", OPTION_STRING, "path to hash files" },
{ OPTION_SAMPLEPATH ";sp", "samples", OPTION_STRING, "path to samplesets" },

View File

@ -25,6 +25,7 @@
#define OPTION_WRITECONFIG "writeconfig"
// core search path options
#define OPTION_HOMEPATH "homepath"
#define OPTION_MEDIAPATH "rompath"
#define OPTION_HASHPATH "hashpath"
#define OPTION_SAMPLEPATH "samplepath"
@ -214,6 +215,7 @@ public:
bool write_config() const { return bool_value(OPTION_WRITECONFIG); }
// core search path options
const char *home_path() const { return value(OPTION_HOMEPATH); }
const char *media_path() const { return value(OPTION_MEDIAPATH); }
const char *hash_path() const { return value(OPTION_HASHPATH); }
const char *sample_path() const { return value(OPTION_SAMPLEPATH); }

View File

@ -439,6 +439,7 @@ windows_options::windows_options()
set_default_value(OPTION_DIFF_DIRECTORY, (osd::text::from_wstring((LPCWSTR)path->Data()) + diff_directory()).c_str());
set_default_value(OPTION_COMMENT_DIRECTORY, (osd::text::from_wstring((LPCWSTR)path->Data()) + comment_directory()).c_str());
set_default_value(OPTION_HOMEPATH, osd::text::from_wstring((LPCWSTR)path->Data()).c_str());
set_default_value(OPTION_MEDIAPATH, (osd::text::from_wstring((LPCWSTR)path->Data()) + media_path()).c_str());
#endif
}