mirror of
https://github.com/zenith391/OCEmu.git
synced 2025-10-01 00:57:36 -04:00
Allow save path to be specified from the command line to boot.lua
This commit is contained in:
parent
fd4c364243
commit
3c284b0ba3
10
src/boot.lua
10
src/boot.lua
@ -6,6 +6,13 @@ local lfs = require("lfs")
|
|||||||
|
|
||||||
local sdlinit = false
|
local sdlinit = false
|
||||||
|
|
||||||
|
local args = table.pack(...)
|
||||||
|
local emulationInstancePath = (os.getenv("HOME") or os.getenv("APPDATA")) .. "/.ocemu"
|
||||||
|
|
||||||
|
if #args > 0 then
|
||||||
|
emulationInstancePath = args[1]
|
||||||
|
end
|
||||||
|
|
||||||
local function boot()
|
local function boot()
|
||||||
local ret, err = not b(SDL.init(SDL.INIT_AUDIO + SDL.INIT_EVENTS + SDL.INIT_VIDEO))
|
local ret, err = not b(SDL.init(SDL.INIT_AUDIO + SDL.INIT_EVENTS + SDL.INIT_VIDEO))
|
||||||
|
|
||||||
@ -108,7 +115,7 @@ local function boot()
|
|||||||
return lfs.attributes(path,"size")
|
return lfs.attributes(path,"size")
|
||||||
end,
|
end,
|
||||||
getSaveDirectory = function()
|
getSaveDirectory = function()
|
||||||
return (os.getenv("HOME") or os.getenv("APPDATA")) .. "/.ocemu"
|
return emulationInstancePath
|
||||||
end,
|
end,
|
||||||
remove = function(path)
|
remove = function(path)
|
||||||
return recursiveDelete(path)
|
return recursiveDelete(path)
|
||||||
@ -149,6 +156,7 @@ local function boot()
|
|||||||
SDL.delay(1)
|
SDL.delay(1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
print(xpcall(boot,debug.traceback))
|
print(xpcall(boot,debug.traceback))
|
||||||
if sdlinit then
|
if sdlinit then
|
||||||
SDL.quit()
|
SDL.quit()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user