mirror of
https://github.com/zenith391/OCEmu.git
synced 2025-09-29 07:53:29 -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 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 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")
|
||||
end,
|
||||
getSaveDirectory = function()
|
||||
return (os.getenv("HOME") or os.getenv("APPDATA")) .. "/.ocemu"
|
||||
return emulationInstancePath
|
||||
end,
|
||||
remove = function(path)
|
||||
return recursiveDelete(path)
|
||||
@ -149,6 +156,7 @@ local function boot()
|
||||
SDL.delay(1)
|
||||
end
|
||||
end
|
||||
|
||||
print(xpcall(boot,debug.traceback))
|
||||
if sdlinit then
|
||||
SDL.quit()
|
||||
|
Loading…
x
Reference in New Issue
Block a user