mirror of
https://github.com/libretro/RetroArch
synced 2025-04-18 14:42:30 +00:00
commit
b6c0688f41
23
movie.c
23
movie.c
@ -86,12 +86,7 @@ static bool bsv_movie_init_playback(bsv_movie_t *handle, const char *path)
|
|||||||
handle->file = file;
|
handle->file = file;
|
||||||
handle->playback = true;
|
handle->playback = true;
|
||||||
|
|
||||||
if (filestream_read(handle->file, header, 4) != 4)
|
filestream_read(handle->file, header, sizeof(uint32_t) * 4);
|
||||||
{
|
|
||||||
RARCH_ERR("%s\n", msg_hash_to_str(MSG_COULD_NOT_READ_MOVIE_HEADER));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Compatibility with old implementation that
|
/* Compatibility with old implementation that
|
||||||
* used incorrect documentation. */
|
* used incorrect documentation. */
|
||||||
if (swap_if_little32(header[MAGIC_INDEX]) != BSV_MAGIC
|
if (swap_if_little32(header[MAGIC_INDEX]) != BSV_MAGIC
|
||||||
@ -109,6 +104,13 @@ static bool bsv_movie_init_playback(bsv_movie_t *handle, const char *path)
|
|||||||
|
|
||||||
state_size = swap_if_big32(header[STATE_SIZE_INDEX]);
|
state_size = swap_if_big32(header[STATE_SIZE_INDEX]);
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
RARCH_ERR("----- debug %u -----\n", header[0]);
|
||||||
|
RARCH_ERR("----- debug %u -----\n", header[1]);
|
||||||
|
RARCH_ERR("----- debug %u -----\n", header[2]);
|
||||||
|
RARCH_ERR("----- debug %u -----\n", header[3]);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (state_size)
|
if (state_size)
|
||||||
{
|
{
|
||||||
retro_ctx_size_info_t info;
|
retro_ctx_size_info_t info;
|
||||||
@ -120,7 +122,6 @@ static bool bsv_movie_init_playback(bsv_movie_t *handle, const char *path)
|
|||||||
|
|
||||||
handle->state = buf;
|
handle->state = buf;
|
||||||
handle->state_size = state_size;
|
handle->state_size = state_size;
|
||||||
|
|
||||||
if (filestream_read(handle->file, handle->state, state_size) != state_size)
|
if (filestream_read(handle->file, handle->state, state_size) != state_size)
|
||||||
{
|
{
|
||||||
RARCH_ERR("%s\n", msg_hash_to_str(MSG_COULD_NOT_READ_STATE_FROM_MOVIE));
|
RARCH_ERR("%s\n", msg_hash_to_str(MSG_COULD_NOT_READ_STATE_FROM_MOVIE));
|
||||||
@ -173,8 +174,14 @@ static bool bsv_movie_init_record(bsv_movie_t *handle, const char *path)
|
|||||||
state_size = (unsigned)info.size;
|
state_size = (unsigned)info.size;
|
||||||
|
|
||||||
header[STATE_SIZE_INDEX] = swap_if_big32(state_size);
|
header[STATE_SIZE_INDEX] = swap_if_big32(state_size);
|
||||||
|
#if 0
|
||||||
|
RARCH_ERR("----- debug %u -----\n", header[0]);
|
||||||
|
RARCH_ERR("----- debug %u -----\n", header[1]);
|
||||||
|
RARCH_ERR("----- debug %u -----\n", header[2]);
|
||||||
|
RARCH_ERR("----- debug %u -----\n", header[3]);
|
||||||
|
#endif
|
||||||
|
|
||||||
filestream_write(handle->file, header, sizeof(uint32_t));
|
filestream_write(handle->file, header, 4 * sizeof(uint32_t));
|
||||||
|
|
||||||
handle->min_file_pos = sizeof(header) + state_size;
|
handle->min_file_pos = sizeof(header) + state_size;
|
||||||
handle->state_size = state_size;
|
handle->state_size = state_size;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user