Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
- INPUT/BSV/REPLAY: Add checkpoint and initial savestate compression, following the `savestate_file_compression` config boolean. Use zstd if available, or fall back to zlib.
- INPUT/BSV/REPLAY: Add incremental checkpoints based on statestreams (depending on `HAVE_STATESTREAM` compile time flag). As an example, 60 `pcsx_rearmed` savestates would take 267MB uncompressed; with incremental encoding this is reduced to 77MB. Compressing the result can reduce the size to just 4MB.
- INPUT/BSV/REPLAY: Checkpoint compression and encoding can be combined. For example, 60 `pcsx_rearmed` checkpoints can take up just 15MB if each state is incremental and compressed. This is not as optimal as using incremental states without save state compression followed by offline compression, but is a good compromise in many use cases.
- INPUT/BSV/REPLAY: Add hotkeys and text commands to force a checkpoint insertion into the currently recording replay, and to seek backwards to the previous checkpoint and forwards to the next checkpoint.
- INPUT/BSV/REPLAY: Add a text command to seek to a specific frame of the currently playing/recording replay; it will return via the command replier the actual seeked-to frame (right now it only supports seeking to checkpoints).
- INTL: Add Irish Gaelic to selectable languages
- IOS: Fix crash on iOS9 when fetching refresh rate
- LINUX: Add full complement of key/value pairs to desktop entry
Expand Down
12 changes: 6 additions & 6 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ ifeq ($(HAVE_SAPI), 1)
LIBS += sapi.dll
endif

ifeq ($(HAVE_STATESTREAM), 1)
DEF_FLAGS += -DHAVE_STATESTREAM
endif

ifeq ($(HAVE_GL_CONTEXT),)
HAVE_GL_CONTEXT = 0
HAVE_GL_MODERN = 0
Expand Down Expand Up @@ -455,8 +451,12 @@ endif

ifeq ($(HAVE_BSV_MOVIE), 1)
DEFINES += -DHAVE_BSV_MOVIE
OBJ += input/bsv/bsvmovie.o \
input/bsv/uint32s_index.o
OBJ += input/bsv/bsvmovie.o
endif

ifeq ($(HAVE_STATESTREAM), 1)
DEFINES += -DHAVE_STATESTREAM
OBJ += input/bsv/uint32s_index.o
endif

ifeq ($(HAVE_RUNAHEAD), 1)
Expand Down
37 changes: 37 additions & 0 deletions command.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* If not, see <http://www.gnu.org/licenses/>.
*/

#include "input/input_driver.h"
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
Expand Down Expand Up @@ -802,6 +803,42 @@ bool command_play_replay_slot(command_t *cmd, const char *arg)
#endif
}

bool command_seek_replay(command_t *cmd, const char *arg)
{
#ifdef HAVE_BSV_MOVIE
char reply[32];
bool ret = true;
char *endptr;
size_t _len;
int64_t frame = strtoll(arg, &endptr, 10), target_frame;
input_driver_state_t *input_st = input_state_get_ptr();
if (!endptr)
ret = false;
if (!(input_st->bsv_movie_state.flags & (BSV_FLAG_MOVIE_PLAYBACK | BSV_FLAG_MOVIE_RECORDING)))
ret = false;
#ifdef HAVE_CHEEVOS
ret = !rcheevos_hardcore_active();
#endif
if (ret)
ret = movie_seek_to_frame(input_st, frame);
if (ret)
{
_len = strlcpy(reply, "OK ", sizeof(reply));
_len += snprintf(reply+_len, sizeof(reply)-_len,
"%ld", input_st->bsv_movie_state.seek_target_frame);
}
else
_len = strlcpy(reply, "NO", sizeof(reply));
reply[_len] = '\n';
reply[++_len] = '\0';
cmd->replier(cmd, reply, _len);
return ret;
#else
cmd->replier(cmd, "NO\n", 4);
return false;
#endif
}

bool command_save_savefiles(command_t *cmd, const char* arg)
{
char reply[4];
Expand Down
8 changes: 8 additions & 0 deletions command.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ enum event_command
CMD_EVENT_PLAY_REPLAY,
CMD_EVENT_RECORD_REPLAY,
CMD_EVENT_HALT_REPLAY,
CMD_EVENT_SAVE_REPLAY_CHECKPOINT,
CMD_EVENT_PREV_REPLAY_CHECKPOINT,
CMD_EVENT_NEXT_REPLAY_CHECKPOINT,
CMD_EVENT_REPLAY_DECREMENT,
CMD_EVENT_REPLAY_INCREMENT,
/* Save state actions. */
Expand Down Expand Up @@ -421,6 +424,7 @@ bool command_get_config_param(command_t *cmd, const char* arg);
bool command_show_osd_msg(command_t *cmd, const char* arg);
bool command_load_state_slot(command_t *cmd, const char* arg);
bool command_play_replay_slot(command_t *cmd, const char* arg);
bool command_seek_replay(command_t *cmd, const char *arg);
bool command_save_savefiles(command_t *cmd, const char* arg);
bool command_load_savefiles(command_t *cmd, const char* arg);
#ifdef HAVE_CHEEVOS
Expand Down Expand Up @@ -449,6 +453,7 @@ static const struct cmd_action_map action_map[] = {

{ "LOAD_STATE_SLOT",command_load_state_slot, "<slot number>"},
{ "PLAY_REPLAY_SLOT",command_play_replay_slot, "<slot number>"},
{ "SEEK_REPLAY",command_seek_replay, "<frame number>"},

{ "SAVE_FILES", command_save_savefiles, "No argument"},
{ "LOAD_FILES", command_load_savefiles, "No argument"},
Expand Down Expand Up @@ -480,6 +485,9 @@ static const struct cmd_map map[] = {
{ "PLAY_REPLAY", RARCH_PLAY_REPLAY_KEY },
{ "RECORD_REPLAY", RARCH_RECORD_REPLAY_KEY },
{ "HALT_REPLAY", RARCH_HALT_REPLAY_KEY },
{ "SAVE_REPLAY_CHECKPOINT", RARCH_SAVE_REPLAY_CHECKPOINT_KEY },
{ "PREV_REPLAY_CHECKPOINT", RARCH_PREV_REPLAY_CHECKPOINT_KEY },
{ "NEXT_REPLAY_CHECKPOINT", RARCH_NEXT_REPLAY_CHECKPOINT_KEY },
{ "REPLAY_SLOT_PLUS", RARCH_REPLAY_SLOT_PLUS },
{ "REPLAY_SLOT_MINUS", RARCH_REPLAY_SLOT_MINUS },

Expand Down
21 changes: 21 additions & 0 deletions config.def.keybinds.h
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,27 @@ static const struct retro_keybind retro_keybinds_1[] = {
RARCH_HALT_REPLAY_KEY, NO_BTN, NO_BTN, 0,
true
},
{
NULL, NULL,
AXIS_NONE, AXIS_NONE,
MENU_ENUM_LABEL_VALUE_INPUT_META_SAVE_REPLAY_CHECKPOINT_KEY, RETROK_UNKNOWN,
RARCH_SAVE_REPLAY_CHECKPOINT_KEY, NO_BTN, NO_BTN, 0,
true
},
{
NULL, NULL,
AXIS_NONE, AXIS_NONE,
MENU_ENUM_LABEL_VALUE_INPUT_META_PREV_REPLAY_CHECKPOINT_KEY, RETROK_UNKNOWN,
RARCH_PREV_REPLAY_CHECKPOINT_KEY, NO_BTN, NO_BTN, 0,
true
},
{
NULL, NULL,
AXIS_NONE, AXIS_NONE,
MENU_ENUM_LABEL_VALUE_INPUT_META_NEXT_REPLAY_CHECKPOINT_KEY, RETROK_UNKNOWN,
RARCH_NEXT_REPLAY_CHECKPOINT_KEY, NO_BTN, NO_BTN, 0,
true
},
{
NULL, NULL,
AXIS_NONE, AXIS_NONE,
Expand Down
3 changes: 3 additions & 0 deletions configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,9 @@ const struct input_bind_map input_config_bind_map[RARCH_BIND_LIST_END_NULL] = {
DECLARE_META_BIND(1, play_replay, RARCH_PLAY_REPLAY_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_PLAY_REPLAY_KEY),
DECLARE_META_BIND(1, record_replay, RARCH_RECORD_REPLAY_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_RECORD_REPLAY_KEY),
DECLARE_META_BIND(1, halt_replay, RARCH_HALT_REPLAY_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_HALT_REPLAY_KEY),
DECLARE_META_BIND(1, save_replay_checkpoint,RARCH_SAVE_REPLAY_CHECKPOINT_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_SAVE_REPLAY_CHECKPOINT_KEY),
DECLARE_META_BIND(1, prev_replay_checkpoint,RARCH_PREV_REPLAY_CHECKPOINT_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_PREV_REPLAY_CHECKPOINT_KEY),
DECLARE_META_BIND(1, next_replay_checkpoint,RARCH_NEXT_REPLAY_CHECKPOINT_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_NEXT_REPLAY_CHECKPOINT_KEY),
DECLARE_META_BIND(2, replay_slot_increase, RARCH_REPLAY_SLOT_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_META_REPLAY_SLOT_PLUS),
DECLARE_META_BIND(2, replay_slot_decrease, RARCH_REPLAY_SLOT_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_META_REPLAY_SLOT_MINUS),

Expand Down
Loading
Loading