Added support for loading ROM files from Lua script on Linux
This commit is contained in:
parent
5f4af397d0
commit
ec72160f39
|
@ -206,6 +206,12 @@ DriverKill()
|
||||||
inited=0;
|
inited=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int reloadLastGame() {
|
||||||
|
std::string lastRom;
|
||||||
|
g_config->getOption(std::string("SDL.LastOpenFile"), &lastRom);
|
||||||
|
return LoadGame(lastRom.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads a game, given a full path/filename. The driver code must be
|
* Loads a game, given a full path/filename. The driver code must be
|
||||||
* initialized after the game is loaded, because the emulator code
|
* initialized after the game is loaded, because the emulator code
|
||||||
|
|
|
@ -189,6 +189,12 @@ static void ShowUsage(char *prog)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int reloadLastGame() {
|
||||||
|
std::string lastRom;
|
||||||
|
g_config->getOption(std::string("SDL.LastOpenFile"), &lastRom);
|
||||||
|
return LoadGame(lastRom.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads a game, given a full path/filename. The driver code must be
|
* Loads a game, given a full path/filename. The driver code must be
|
||||||
* initialized after the game is loaded, because the emulator code
|
* initialized after the game is loaded, because the emulator code
|
||||||
|
|
|
@ -545,6 +545,17 @@ static int emu_loadrom(lua_State *L) {
|
||||||
} else {
|
} else {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
const char *nameo2 = luaL_checkstring(L,1);
|
||||||
|
char nameo[2048];
|
||||||
|
strncpy(nameo, nameo2, sizeof(nameo));
|
||||||
|
if(!FCEUI_LoadGame(nameo, 0, true)) {
|
||||||
|
extern void reloadLastGame();
|
||||||
|
reloadLastGame();
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue