From e705e71a97ce2955ef126b5aeea5ac6172959658 Mon Sep 17 00:00:00 2001 From: BearOso Date: Thu, 6 Aug 2020 16:51:52 -0500 Subject: [PATCH] Remove S9xChooseMovieFilename This is integration of the frontend with the core. Disable the button mappings that use it. The frontend should implement on its own. --- controls.cpp | 12 ++++++------ docs/porting.html | 4 ---- gtk/src/gtk_file.cpp | 13 ------------- gtk/src/gtk_s9xwindow.cpp | 5 ++--- libretro/libretro.cpp | 1 - macosx/mac-file.mm | 5 ----- movie.h | 1 - unix/unix.cpp | 19 ------------------- win32/wsnes9x.cpp | 7 ------- 9 files changed, 8 insertions(+), 59 deletions(-) diff --git a/controls.cpp b/controls.cpp index 08a1e651..eaac35ad 100644 --- a/controls.cpp +++ b/controls.cpp @@ -2412,15 +2412,15 @@ void S9xApplyCommand (s9xcommand_t cmd, int16 data1, int16 data2) break; case BeginRecordingMovie: - if (S9xMovieActive()) - S9xMovieStop(FALSE); - S9xMovieCreate(S9xChooseMovieFilename(FALSE), 0xFF, MOVIE_OPT_FROM_RESET, NULL, 0); + // if (S9xMovieActive()) + // S9xMovieStop(FALSE); + // S9xMovieCreate(S9xChooseMovieFilename(FALSE), 0xFF, MOVIE_OPT_FROM_RESET, NULL, 0); break; case LoadMovie: - if (S9xMovieActive()) - S9xMovieStop(FALSE); - S9xMovieOpen(S9xChooseMovieFilename(TRUE), FALSE); + // if (S9xMovieActive()) + // S9xMovieStop(FALSE); + // S9xMovieOpen(S9xChooseMovieFilename(TRUE), FALSE); break; case EndRecordingMovie: diff --git a/docs/porting.html b/docs/porting.html index 183ad4f3..86e5d12c 100644 --- a/docs/porting.html +++ b/docs/porting.html @@ -298,10 +298,6 @@

Called when Snes9x wants to know the directory dirtype.

-

const char *S9xChooseMovieFilename (bool8 read_only)

-

- If your port can match Snes9x's built-in BeginRecordingMovie/LoadMovie command (see controls.cpp), you may choose to use this function. Otherwise return NULL. -

const char *S9xBasename (const char *path)

Called when Snes9x wants to know the name of the ROM image. Typically, extract the filename from path and return it. diff --git a/gtk/src/gtk_file.cpp b/gtk/src/gtk_file.cpp index dfc8c926..d5ea8e76 100644 --- a/gtk/src/gtk_file.cpp +++ b/gtk/src/gtk_file.cpp @@ -16,19 +16,6 @@ static char buf[PATH_MAX]; -const char *S9xChooseMovieFilename(bool8 read_only) -{ - static char path[PATH_MAX]; - - if (!gui_config->rom_loaded) - return ""; - - auto filename = top_level->open_movie_dialog(read_only); - strcpy(path, filename.c_str()); - - return path; -} - const char *S9xGetFilenameInc(const char *e, enum s9x_getdirtype dirtype) { static char filename[PATH_MAX + 1]; diff --git a/gtk/src/gtk_s9xwindow.cpp b/gtk/src/gtk_s9xwindow.cpp index 56c968cc..4eb741c4 100644 --- a/gtk/src/gtk_s9xwindow.cpp +++ b/gtk/src/gtk_s9xwindow.cpp @@ -220,7 +220,7 @@ void Snes9xWindow::connect_signals() if (S9xMovieActive()) S9xMovieStop(false); - S9xMovieOpen(S9xChooseMovieFilename(true), false); + S9xMovieOpen(open_movie_dialog(true).c_str(), false); }); get_object("stop_recording_item")->signal_activate().connect([&] { @@ -236,7 +236,7 @@ void Snes9xWindow::connect_signals() if (S9xMovieActive()) S9xMovieStop(false); - S9xMovieCreate(S9xChooseMovieFilename(false), 0xFF, MOVIE_OPT_FROM_RESET, nullptr, 0); + S9xMovieCreate(open_movie_dialog(false).c_str(), 0xFF, MOVIE_OPT_FROM_RESET, nullptr, 0); }); get_object("cheats_item")->signal_activate().connect([&] { @@ -631,7 +631,6 @@ void Snes9xWindow::open_multicart_dialog() std::string Snes9xWindow::open_movie_dialog(bool readonly) { - this->pause_from_focus_change(); std::string title; diff --git a/libretro/libretro.cpp b/libretro/libretro.cpp index f85fb293..03045565 100644 --- a/libretro/libretro.cpp +++ b/libretro/libretro.cpp @@ -2138,7 +2138,6 @@ void S9xParseArg(char**, int&, int) {} void S9xExit() {} bool S9xPollPointer(unsigned int, short*, short*) { return false; } -const char *S9xChooseMovieFilename(unsigned char) { return NULL; } void S9xMessage(int type, int, const char* s) { if (!log_cb) return; diff --git a/macosx/mac-file.mm b/macosx/mac-file.mm index 1fa6a437..c40641cb 100644 --- a/macosx/mac-file.mm +++ b/macosx/mac-file.mm @@ -365,11 +365,6 @@ const char * S9xGetFilenameInc (const char *inExt, enum s9x_getdirtype dirtype) return (NULL); } -const char * S9xChooseMovieFilename (bool8 read_only) -{ - return (NULL); -} - bool8 S9xOpenSnapshotFile (const char *fname, bool8 read_only, STREAM *file) { if (read_only) diff --git a/movie.h b/movie.h index 31fcb265..28f347ea 100644 --- a/movie.h +++ b/movie.h @@ -48,7 +48,6 @@ int S9xMovieGetInfo (const char *, struct MovieInfo *); void S9xMovieStop (bool8); void S9xMovieToggleRecState (void); void S9xMovieToggleFrameDisplay (void); -const char * S9xChooseMovieFilename (bool8); // methods used by the emulation void S9xMovieInit (void); diff --git a/unix/unix.cpp b/unix/unix.cpp index cc45c630..174550ae 100644 --- a/unix/unix.cpp +++ b/unix/unix.cpp @@ -588,25 +588,6 @@ const char * S9xBasename (const char *f) return (f); } -const char * S9xChooseMovieFilename (bool8 read_only) -{ - char s[PATH_MAX + 1]; - char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; - - const char *filename; - char title[64]; - - _splitpath(Memory.ROMFilename, drive, dir, fname, ext); - snprintf(s, PATH_MAX + 1, "%s.smv", fname); - sprintf(title, "Choose movie %s filename", read_only ? "playback" : "record"); - - S9xSetSoundMute(TRUE); - filename = S9xSelectFilename(s, S9xGetDirectory(HOME_DIR), "smv", title); - S9xSetSoundMute(FALSE); - - return (filename); -} - bool8 S9xOpenSnapshotFile (const char *filename, bool8 read_only, STREAM *file) { char s[PATH_MAX + 1]; diff --git a/win32/wsnes9x.cpp b/win32/wsnes9x.cpp index 9ec60a00..c66e1293 100644 --- a/win32/wsnes9x.cpp +++ b/win32/wsnes9x.cpp @@ -10843,13 +10843,6 @@ void S9xHandlePortCommand(s9xcommand_t cmd, int16 data1, int16 data2) return; } -// NYI -const char *S9xChooseMovieFilename (bool8 read_only) -{ - return NULL; -} - - const char * S9xStringInput(const char *msg) { return NULL;