Update lua-engine.cpp
Added functionality for unloading a ROM. utilizing a function present in "window.cpp", a new Lua function was added to the emu API to allow Lua scripts to close out of games without having to close out of the whole emulator.
This commit is contained in:
parent
d153d5182d
commit
334294a06e
|
@ -645,6 +645,13 @@ static int emu_insertOrEjectDisk(lua_State* L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
// emu.closeRom()
|
||||
// Closes out of currently running ROM to allow user to switch games
|
||||
static int emu_closeRom(lua_State* L)
|
||||
{
|
||||
CloseGame();
|
||||
return 0;
|
||||
}
|
||||
|
||||
// emu.loadrom(string filename)
|
||||
//
|
||||
|
@ -6089,6 +6096,7 @@ static const struct luaL_reg emulib [] = {
|
|||
{"getdir", emu_getdir},
|
||||
{"switchDisk", emu_switchDisk},
|
||||
{"insertOrEjectDisk", emu_insertOrEjectDisk},
|
||||
{"closeRom", emu_closeRom},
|
||||
{"loadrom", emu_loadrom},
|
||||
{"print", print}, // sure, why not
|
||||
{"exit", emu_exit}, // useful for run-and-close scripts
|
||||
|
|
Loading…
Reference in New Issue