Skip to content

Commit

Permalink
Remove S9xChooseMovieFilename
Browse files Browse the repository at this point in the history
This is integration of the frontend with the core. Disable
the button mappings that use it. The frontend should implement on
its own.
  • Loading branch information
bearoso committed Aug 7, 2020
1 parent f04f1bb commit e705e71
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 59 deletions.
12 changes: 6 additions & 6 deletions controls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 0 additions & 4 deletions docs/porting.html
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,6 @@ <h3><code>const char *S9xGetDirectory (enum s9x_getdirtype dirtype)</code></h3>
<p>
Called when Snes9x wants to know the directory <code>dirtype</code>.
</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>
<p>
Called when Snes9x wants to know the name of the ROM image. Typically, extract the filename from <code>path</code> and return it.
Expand Down
13 changes: 0 additions & 13 deletions gtk/src/gtk_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
5 changes: 2 additions & 3 deletions gtk/src/gtk_s9xwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Gtk::MenuItem>("stop_recording_item")->signal_activate().connect([&] {
Expand All @@ -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<Gtk::MenuItem>("cheats_item")->signal_activate().connect([&] {
Expand Down Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion libretro/libretro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 0 additions & 5 deletions macosx/mac-file.mm
Original file line number Diff line number Diff line change
Expand Up @@ -365,11 +365,6 @@ static void AddFolderIcon (NSURL *fref, const char *folderName)
return (NULL);
}

const char * S9xChooseMovieFilename (bool8 read_only)
{
return (NULL);
}

bool8 S9xOpenSnapshotFile (const char *fname, bool8 read_only, STREAM *file)
{
if (read_only)
Expand Down
1 change: 0 additions & 1 deletion movie.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
19 changes: 0 additions & 19 deletions unix/unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
7 changes: 0 additions & 7 deletions win32/wsnes9x.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e705e71

Please sign in to comment.