Skip to content

Commit 432ffee

Browse files
Use LoadGame instead of FCEUI_LoadGame
1 parent ec72160 commit 432ffee

File tree

10 files changed

+21
-14
lines changed

10 files changed

+21
-14
lines changed

src/attic/pc/dface.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ void LockConsole(void);
4444
void UnlockConsole(void);
4545
void ToggleFS(); /* SDL */
4646

47-
int LoadGame(const char *path);
47+
int LoadGame(const char *path, bool silent = false);
4848
int CloseGame(void);
4949
int GUI_Init(int argc, char **argv, int (*dofunc)(void));
5050
int GUI_Idle(void);

src/attic/pc/main.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,12 @@ static void DoArgs(int argc, char *argv[])
275275
provides data necessary for the driver code(number of scanlines to
276276
render, what virtual input devices to use, etc.).
277277
*/
278-
int LoadGame(const char *path)
278+
int LoadGame(const char *path, bool silent)
279279
{
280280
FCEUGI *tmp;
281281

282282
CloseGame();
283-
if(!(tmp=FCEUI_LoadGame(path,1)))
283+
if(!(tmp=FCEUI_LoadGame(path,1,silent)))
284284
return 0;
285285
CurGame=tmp;
286286
ParseGI(tmp);

src/drivers/Qt/dface.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ void LockConsole(void);
2929
void UnlockConsole(void);
3030
void ToggleFS(); /* SDL */
3131

32-
int LoadGame(const char *path);
32+
int LoadGame(const char *path, bool silent);
3333
//int CloseGame(void);
3434

3535
void Giggles(int);

src/drivers/Qt/fceuWrapper.cpp

+6-3
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,13 @@ DriverKill()
206206
inited=0;
207207
}
208208

209+
/**
210+
* Reloads last game
211+
*/
209212
int reloadLastGame() {
210213
std::string lastRom;
211214
g_config->getOption(std::string("SDL.LastOpenFile"), &lastRom);
212-
return LoadGame(lastRom.c_str());
215+
return LoadGame(lastRom.c_str(), false);
213216
}
214217

215218
/**
@@ -218,7 +221,7 @@ int reloadLastGame() {
218221
* provides data necessary for the driver code(number of scanlines to
219222
* render, what virtual input devices to use, etc.).
220223
*/
221-
int LoadGame(const char *path)
224+
int LoadGame(const char *path, bool silent)
222225
{
223226
int gg_enabled, autoLoadDebug, autoOpenDebugger;
224227

@@ -233,7 +236,7 @@ int LoadGame(const char *path)
233236

234237
FCEUI_SetGameGenie (gg_enabled);
235238

236-
if(!FCEUI_LoadGame(path, 1)) {
239+
if(!FCEUI_LoadGame(path, 1, silent)) {
237240
return 0;
238241
}
239242

src/drivers/Qt/fceuWrapper.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ extern unsigned int gui_draw_area_height;
1919
// global configuration object
2020
extern Config *g_config;
2121

22-
int LoadGame(const char *path);
22+
int LoadGame(const char *path, bool silent = false);
2323
int CloseGame(void);
2424

2525
int fceuWrapperInit( int argc, char *argv[] );

src/drivers/Qt/sdl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ extern int dendy;
2424
extern int pal_emulation;
2525
extern bool swapDuty;
2626

27-
int LoadGame(const char *path);
27+
int LoadGame(const char *path, bool silent);
2828
int CloseGame(void);
2929
void FCEUD_Update(uint8 *XBuf, int32 *Buffer, int Count);
3030
uint64 FCEUD_GetTime();

src/drivers/sdl/dface.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ void LockConsole(void);
2929
void UnlockConsole(void);
3030
void ToggleFS(); /* SDL */
3131

32-
int LoadGame(const char *path);
32+
int LoadGame(const char *path, bool silent);
3333
//int CloseGame(void);
3434

3535
void Giggles(int);

src/drivers/sdl/sdl.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,9 @@ static void ShowUsage(char *prog)
189189

190190
}
191191

192+
/**
193+
* Reloads last game.
194+
*/
192195
int reloadLastGame() {
193196
std::string lastRom;
194197
g_config->getOption(std::string("SDL.LastOpenFile"), &lastRom);
@@ -201,12 +204,12 @@ int reloadLastGame() {
201204
* provides data necessary for the driver code(number of scanlines to
202205
* render, what virtual input devices to use, etc.).
203206
*/
204-
int LoadGame(const char *path)
207+
int LoadGame(const char *path, bool silent)
205208
{
206209
if (isloaded){
207210
CloseGame();
208211
}
209-
if(!FCEUI_LoadGame(path, 1)) {
212+
if(!FCEUI_LoadGame(path, 1, silent)) {
210213
return 0;
211214
}
212215

src/drivers/sdl/sdl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ extern int dendy;
2424
extern int pal_emulation;
2525
extern bool swapDuty;
2626

27-
int LoadGame(const char *path);
27+
int LoadGame(const char *path, bool silent = false);
2828
int CloseGame(void);
2929
void FCEUD_Update(uint8 *XBuf, int32 *Buffer, int Count);
3030
uint64 FCEUD_GetTime();

src/lua-engine.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,7 @@ static int emu_getdir(lua_State *L) {
520520

521521

522522
extern void ReloadRom(void);
523+
extern int LoadGame(const char*, bool);
523524

524525
// emu.loadrom(string filename)
525526
//
@@ -549,7 +550,7 @@ static int emu_loadrom(lua_State *L) {
549550
const char *nameo2 = luaL_checkstring(L,1);
550551
char nameo[2048];
551552
strncpy(nameo, nameo2, sizeof(nameo));
552-
if(!FCEUI_LoadGame(nameo, 0, true)) {
553+
if(!LoadGame(nameo, true)) {
553554
extern void reloadLastGame();
554555
reloadLastGame();
555556
return 0;

0 commit comments

Comments
 (0)