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.
This commit is contained in:
BearOso 2020-08-06 16:51:52 -05:00
parent f04f1bbe44
commit e705e71a97
9 changed files with 8 additions and 59 deletions

View File

@ -2412,15 +2412,15 @@ void S9xApplyCommand (s9xcommand_t cmd, int16 data1, int16 data2)
break; break;
case BeginRecordingMovie: case BeginRecordingMovie:
if (S9xMovieActive()) // if (S9xMovieActive())
S9xMovieStop(FALSE); // S9xMovieStop(FALSE);
S9xMovieCreate(S9xChooseMovieFilename(FALSE), 0xFF, MOVIE_OPT_FROM_RESET, NULL, 0); // S9xMovieCreate(S9xChooseMovieFilename(FALSE), 0xFF, MOVIE_OPT_FROM_RESET, NULL, 0);
break; break;
case LoadMovie: case LoadMovie:
if (S9xMovieActive()) // if (S9xMovieActive())
S9xMovieStop(FALSE); // S9xMovieStop(FALSE);
S9xMovieOpen(S9xChooseMovieFilename(TRUE), FALSE); // S9xMovieOpen(S9xChooseMovieFilename(TRUE), FALSE);
break; break;
case EndRecordingMovie: case EndRecordingMovie:

View File

@ -298,10 +298,6 @@
<p> <p>
Called when Snes9x wants to know the directory <code>dirtype</code>. Called when Snes9x wants to know the directory <code>dirtype</code>.
</p> </p>
<h3><code>const char *S9xChooseMovieFilename (bool8 read_only)</code></h3>
<p>
If your port can match Snes9x's built-in <code>BeginRecordingMovie</code>/<code>LoadMovie</code> command (see <code>controls.cpp</code>), you may choose to use this function. Otherwise return <code>NULL</code>.
</p>
<h3><code>const char *S9xBasename (const char *path)</code></h3> <h3><code>const char *S9xBasename (const char *path)</code></h3>
<p> <p>
Called when Snes9x wants to know the name of the ROM image. Typically, extract the filename from <code>path</code> and return it. Called when Snes9x wants to know the name of the ROM image. Typically, extract the filename from <code>path</code> and return it.

View File

@ -16,19 +16,6 @@
static char buf[PATH_MAX]; 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) const char *S9xGetFilenameInc(const char *e, enum s9x_getdirtype dirtype)
{ {
static char filename[PATH_MAX + 1]; static char filename[PATH_MAX + 1];

View File

@ -220,7 +220,7 @@ void Snes9xWindow::connect_signals()
if (S9xMovieActive()) if (S9xMovieActive())
S9xMovieStop(false); S9xMovieStop(false);
S9xMovieOpen(S9xChooseMovieFilename(true), false); S9xMovieOpen(open_movie_dialog(true).c_str(), false);
}); });
get_object<Gtk::MenuItem>("stop_recording_item")->signal_activate().connect([&] { get_object<Gtk::MenuItem>("stop_recording_item")->signal_activate().connect([&] {
@ -236,7 +236,7 @@ void Snes9xWindow::connect_signals()
if (S9xMovieActive()) if (S9xMovieActive())
S9xMovieStop(false); 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<Gtk::MenuItem>("cheats_item")->signal_activate().connect([&] { get_object<Gtk::MenuItem>("cheats_item")->signal_activate().connect([&] {
@ -631,7 +631,6 @@ void Snes9xWindow::open_multicart_dialog()
std::string Snes9xWindow::open_movie_dialog(bool readonly) std::string Snes9xWindow::open_movie_dialog(bool readonly)
{ {
this->pause_from_focus_change(); this->pause_from_focus_change();
std::string title; std::string title;

View File

@ -2138,7 +2138,6 @@ void S9xParseArg(char**, int&, int) {}
void S9xExit() {} void S9xExit() {}
bool S9xPollPointer(unsigned int, short*, short*) { return false; } bool S9xPollPointer(unsigned int, short*, short*) { return false; }
const char *S9xChooseMovieFilename(unsigned char) { return NULL; }
void S9xMessage(int type, int, const char* s) void S9xMessage(int type, int, const char* s)
{ {
if (!log_cb) return; if (!log_cb) return;

View File

@ -365,11 +365,6 @@ const char * S9xGetFilenameInc (const char *inExt, enum s9x_getdirtype dirtype)
return (NULL); return (NULL);
} }
const char * S9xChooseMovieFilename (bool8 read_only)
{
return (NULL);
}
bool8 S9xOpenSnapshotFile (const char *fname, bool8 read_only, STREAM *file) bool8 S9xOpenSnapshotFile (const char *fname, bool8 read_only, STREAM *file)
{ {
if (read_only) if (read_only)

View File

@ -48,7 +48,6 @@ int S9xMovieGetInfo (const char *, struct MovieInfo *);
void S9xMovieStop (bool8); void S9xMovieStop (bool8);
void S9xMovieToggleRecState (void); void S9xMovieToggleRecState (void);
void S9xMovieToggleFrameDisplay (void); void S9xMovieToggleFrameDisplay (void);
const char * S9xChooseMovieFilename (bool8);
// methods used by the emulation // methods used by the emulation
void S9xMovieInit (void); void S9xMovieInit (void);

View File

@ -588,25 +588,6 @@ const char * S9xBasename (const char *f)
return (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) bool8 S9xOpenSnapshotFile (const char *filename, bool8 read_only, STREAM *file)
{ {
char s[PATH_MAX + 1]; char s[PATH_MAX + 1];

View File

@ -10843,13 +10843,6 @@ void S9xHandlePortCommand(s9xcommand_t cmd, int16 data1, int16 data2)
return; return;
} }
// NYI
const char *S9xChooseMovieFilename (bool8 read_only)
{
return NULL;
}
const char * S9xStringInput(const char *msg) const char * S9xStringInput(const char *msg)
{ {
return NULL; return NULL;