mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
Add hint defines to libretro.h
This commit is contained in:
parent
38e6d2443f
commit
61d3f90cae
@ -2640,8 +2640,10 @@ static int cheevos_iterate(coro_t* coro)
|
||||
/* Load the content into memory, or copy it over to our own buffer */
|
||||
if (!CHEEVOS_VAR_DATA)
|
||||
{
|
||||
CHEEVOS_VAR_STREAM = filestream_open(CHEEVOS_VAR_PATH,
|
||||
RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE);
|
||||
CHEEVOS_VAR_STREAM = filestream_open(
|
||||
CHEEVOS_VAR_PATH,
|
||||
RETRO_VFS_FILE_ACCESS_READ,
|
||||
RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
||||
|
||||
if (!CHEEVOS_VAR_STREAM)
|
||||
CORO_STOP();
|
||||
|
@ -3793,17 +3793,20 @@ bool config_save_file(const char *path)
|
||||
#ifdef HAVE_LAKKA
|
||||
if (settings->bools.ssh_enable)
|
||||
filestream_close(filestream_open(LAKKA_SSH_PATH,
|
||||
RETRO_VFS_FILE_ACCESS_WRITE, RFILE_HINT_NONE));
|
||||
RETRO_VFS_FILE_ACCESS_WRITE,
|
||||
RETRO_VFS_FILE_ACCESS_HINT_NONE));
|
||||
else
|
||||
path_file_remove(LAKKA_SSH_PATH);
|
||||
if (settings->bools.samba_enable)
|
||||
filestream_close(filestream_open(LAKKA_SAMBA_PATH,
|
||||
RETRO_VFS_FILE_ACCESS_WRITE, RFILE_HINT_NONE));
|
||||
RETRO_VFS_FILE_ACCESS_WRITE,
|
||||
RETRO_VFS_FILE_ACCESS_HINT_NONE));
|
||||
else
|
||||
path_file_remove(LAKKA_SAMBA_PATH);
|
||||
if (settings->bools.bluetooth_enable)
|
||||
filestream_close(filestream_open(LAKKA_BLUETOOTH_PATH,
|
||||
RETRO_VFS_FILE_ACCESS_WRITE, RFILE_HINT_NONE));
|
||||
RETRO_VFS_FILE_ACCESS_WRITE,
|
||||
RETRO_VFS_FILE_ACCESS_HINT_NONE));
|
||||
else
|
||||
path_file_remove(LAKKA_BLUETOOTH_PATH);
|
||||
#endif
|
||||
|
@ -721,7 +721,8 @@ static void gx_efb_screenshot(void)
|
||||
int x, y;
|
||||
uint8_t tga_header[] = {0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0xE0, 0x01, 0x18, 0x00};
|
||||
RFILE *out = filestream_open("/screenshot.tga",
|
||||
RETRO_VFS_FILE_ACCESS_WRITE, RFILE_HINT_NONE);
|
||||
RETRO_VFS_FILE_ACCESS_WRITE,
|
||||
RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
||||
|
||||
if (!out)
|
||||
return;
|
||||
|
@ -547,7 +547,8 @@ bool video_shader_resolve_parameters(config_file_t *conf,
|
||||
* Ideally, we'd get rid of this path sooner or later. */
|
||||
#endif
|
||||
file = filestream_open(path,
|
||||
RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE);
|
||||
RETRO_VFS_FILE_ACCESS_READ,
|
||||
RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
||||
|
||||
if (!file)
|
||||
{
|
||||
|
@ -321,7 +321,8 @@ static unsigned char check_arm_cpu_feature(const char* feature)
|
||||
char line[1024];
|
||||
unsigned char status = 0;
|
||||
RFILE *fp = filestream_open("/proc/cpuinfo",
|
||||
RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE);
|
||||
RETRO_VFS_FILE_ACCESS_READ,
|
||||
RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
||||
|
||||
if (!fp)
|
||||
return 0;
|
||||
|
@ -355,7 +355,8 @@ static config_file_t *config_file_new_internal(
|
||||
|
||||
conf->include_depth = depth;
|
||||
file = filestream_open(path,
|
||||
RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE);
|
||||
RETRO_VFS_FILE_ACCESS_READ,
|
||||
RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
||||
|
||||
if (!file)
|
||||
{
|
||||
|
@ -412,7 +412,8 @@ bool path_file_exists(const char *path)
|
||||
return false;
|
||||
|
||||
dummy = filestream_open(path,
|
||||
RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE);
|
||||
RETRO_VFS_FILE_ACCESS_READ,
|
||||
RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
||||
|
||||
if (!dummy)
|
||||
return false;
|
||||
|
@ -216,7 +216,8 @@ bool rbmp_save_image(
|
||||
{
|
||||
bool ret = false;
|
||||
RFILE *file = filestream_open(filename,
|
||||
RETRO_VFS_FILE_ACCESS_WRITE, RFILE_HINT_NONE);
|
||||
RETRO_VFS_FILE_ACCESS_WRITE,
|
||||
RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
||||
if (!file)
|
||||
return false;
|
||||
|
||||
|
@ -228,7 +228,8 @@ static bool rpng_save_image(const char *path,
|
||||
uint32_t total_in = 0;
|
||||
uint32_t total_out = 0;
|
||||
RFILE *file = filestream_open(path,
|
||||
RETRO_VFS_FILE_ACCESS_WRITE, RFILE_HINT_NONE);
|
||||
RETRO_VFS_FILE_ACCESS_WRITE,
|
||||
RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
||||
if (!file)
|
||||
GOTO_END_ERROR();
|
||||
|
||||
|
@ -420,7 +420,8 @@ rxml_document_t *rxml_load_document(const char *path)
|
||||
const char *mem_ptr = NULL;
|
||||
long len = 0;
|
||||
RFILE *file = filestream_open(path,
|
||||
RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE);
|
||||
RETRO_VFS_FILE_ACCESS_READ,
|
||||
RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
||||
if (!file)
|
||||
return NULL;
|
||||
|
||||
|
@ -512,7 +512,8 @@ int sha1_calculate(const char *path, char *result)
|
||||
unsigned char buff[4096];
|
||||
int rv = 1;
|
||||
RFILE *fd = filestream_open(path,
|
||||
RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE);
|
||||
RETRO_VFS_FILE_ACCESS_READ,
|
||||
RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
||||
|
||||
if (!fd)
|
||||
goto error;
|
||||
|
@ -1051,6 +1051,9 @@ struct retro_hw_render_context_negotiation_interface
|
||||
#define RETRO_VFS_FILE_ACCESS_READ_WRITE (RETRO_VFS_FILE_ACCESS_READ | RETRO_VFS_FILE_ACCESS_WRITE) /* Read-write mode, discard contents and overwrites existing file unless RETRO_VFS_FILE_ACCESS_UPDATE is also specified*/
|
||||
#define RETRO_VFS_FILE_ACCESS_UPDATE_EXISTING (1 << 2) /* Prevents discarding content of existing files opened for writing */
|
||||
|
||||
#define RETRO_VFS_FILE_ACCESS_HINT_NONE (0)
|
||||
/* Indicate that we would want to map the file into memory if possible. Requires RETRO_VFS_FILE_ACCESS_READ. This is only a hint and it is up to the frontend to honor and implement it. */
|
||||
#define RETRO_VFS_FILE_ACCESS_HINT_MEMORY_MAP (1 << 0)
|
||||
|
||||
#define RETRO_MEMDESC_CONST (1 << 0) /* The frontend will never change this memory area once retro_load_game has returned. */
|
||||
#define RETRO_MEMDESC_BIGENDIAN (1 << 1) /* The memory area contains big endian data. Default is little endian. */
|
||||
|
@ -43,10 +43,6 @@ typedef struct RFILE RFILE;
|
||||
|
||||
#define FILESTREAM_REQUIRED_VFS_VERSION 1
|
||||
|
||||
#define RFILE_HINT_NONE (0)
|
||||
/* requires RETRO_VFS_FILE_ACCESS_READ */
|
||||
#define RFILE_HINT_MMAP (1 << 9)
|
||||
|
||||
int64_t filestream_get_size(RFILE *stream);
|
||||
|
||||
void filestream_set_size(RFILE *stream);
|
||||
|
@ -76,6 +76,7 @@
|
||||
|
||||
#define RFILE_HINT_UNBUFFERED (1 << 8)
|
||||
|
||||
#include <libretro.h>
|
||||
#include <streams/file_stream.h>
|
||||
#include <string/stdstring.h>
|
||||
#include <memmap.h>
|
||||
@ -164,11 +165,11 @@ RFILE *filestream_open(const char *path, unsigned mode, unsigned hints)
|
||||
stream->hints = hints;
|
||||
|
||||
#ifdef HAVE_MMAP
|
||||
if (stream->hints & RFILE_HINT_MMAP && mode == RETRO_VFS_FILE_ACCESS_READ)
|
||||
if (stream->hints & RETRO_VFS_FILE_ACCESS_HINT_MEMORY_MAP && mode == RETRO_VFS_FILE_ACCESS_READ)
|
||||
stream->hints |= RFILE_HINT_UNBUFFERED;
|
||||
else
|
||||
#endif
|
||||
stream->hints &= ~RFILE_HINT_MMAP;
|
||||
stream->hints &= ~RETRO_VFS_FILE_ACCESS_HINT_MEMORY_MAP;
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
@ -260,7 +261,7 @@ RFILE *filestream_open(const char *path, unsigned mode, unsigned hints)
|
||||
if (stream->fd == -1)
|
||||
goto error;
|
||||
#ifdef HAVE_MMAP
|
||||
if (stream->hints & RFILE_HINT_MMAP)
|
||||
if (stream->hints & RETRO_VFS_FILE_ACCESS_HINT_MEMORY_MAP)
|
||||
{
|
||||
stream->mappos = 0;
|
||||
stream->mapped = NULL;
|
||||
@ -275,7 +276,7 @@ RFILE *filestream_open(const char *path, unsigned mode, unsigned hints)
|
||||
stream->mapsize, PROT_READ, MAP_SHARED, stream->fd, 0);
|
||||
|
||||
if (stream->mapped == MAP_FAILED)
|
||||
stream->hints &= ~RFILE_HINT_MMAP;
|
||||
stream->hints &= ~RETRO_VFS_FILE_ACCESS_HINT_MEMORY_MAP;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@ -322,7 +323,7 @@ ssize_t filestream_seek(RFILE *stream, ssize_t offset, int whence)
|
||||
#ifdef HAVE_MMAP
|
||||
/* Need to check stream->mapped because this function is
|
||||
* called in filestream_open() */
|
||||
if (stream->mapped && stream->hints & RFILE_HINT_MMAP)
|
||||
if (stream->mapped && stream->hints & RETRO_VFS_FILE_ACCESS_HINT_MEMORY_MAP)
|
||||
{
|
||||
/* fseek() returns error on under/overflow but allows cursor > EOF for
|
||||
read-only file descriptors. */
|
||||
@ -398,7 +399,7 @@ ssize_t filestream_tell(RFILE *stream)
|
||||
#ifdef HAVE_MMAP
|
||||
/* Need to check stream->mapped because this function
|
||||
* is called in filestream_open() */
|
||||
if (stream->mapped && stream->hints & RFILE_HINT_MMAP)
|
||||
if (stream->mapped && stream->hints & RETRO_VFS_FILE_ACCESS_HINT_MEMORY_MAP)
|
||||
return stream->mappos;
|
||||
#endif
|
||||
if (lseek(stream->fd, 0, SEEK_CUR) < 0)
|
||||
@ -424,7 +425,7 @@ ssize_t filestream_read(RFILE *stream, void *s, size_t len)
|
||||
return fread(s, 1, len, stream->fp);
|
||||
|
||||
#ifdef HAVE_MMAP
|
||||
if (stream->hints & RFILE_HINT_MMAP)
|
||||
if (stream->hints & RETRO_VFS_FILE_ACCESS_HINT_MEMORY_MAP)
|
||||
{
|
||||
if (stream->mappos > stream->mapsize)
|
||||
goto error;
|
||||
@ -459,7 +460,7 @@ ssize_t filestream_write(RFILE *stream, const void *s, size_t len)
|
||||
return fwrite(s, 1, len, stream->fp);
|
||||
|
||||
#ifdef HAVE_MMAP
|
||||
if (stream->hints & RFILE_HINT_MMAP)
|
||||
if (stream->hints & RETRO_VFS_FILE_ACCESS_HINT_MEMORY_MAP)
|
||||
goto error;
|
||||
#endif
|
||||
return write(stream->fd, s, len);
|
||||
@ -520,7 +521,7 @@ int filestream_close(RFILE *stream)
|
||||
else
|
||||
{
|
||||
#ifdef HAVE_MMAP
|
||||
if (stream->hints & RFILE_HINT_MMAP)
|
||||
if (stream->hints & RETRO_VFS_FILE_ACCESS_HINT_MEMORY_MAP)
|
||||
munmap(stream->mapped, stream->mapsize);
|
||||
#endif
|
||||
}
|
||||
@ -553,7 +554,8 @@ int filestream_read_file(const char *path, void **buf, ssize_t *len)
|
||||
ssize_t content_buf_size = 0;
|
||||
void *content_buf = NULL;
|
||||
RFILE *file = filestream_open(path,
|
||||
RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE);
|
||||
RETRO_VFS_FILE_ACCESS_READ,
|
||||
RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
||||
|
||||
if (!file)
|
||||
{
|
||||
@ -620,7 +622,8 @@ bool filestream_write_file(const char *path, const void *data, ssize_t size)
|
||||
{
|
||||
ssize_t ret = 0;
|
||||
RFILE *file = filestream_open(path,
|
||||
RETRO_VFS_FILE_ACCESS_WRITE, RFILE_HINT_NONE);
|
||||
RETRO_VFS_FILE_ACCESS_WRITE,
|
||||
RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
||||
if (!file)
|
||||
return false;
|
||||
|
||||
|
@ -805,7 +805,8 @@ int main(int argc, char** argv)
|
||||
}
|
||||
|
||||
rdb_file = filestream_open(rdb_path,
|
||||
RETRO_VFS_FILE_ACCESS_WRITE, RFILE_HINT_NONE);
|
||||
RETRO_VFS_FILE_ACCESS_WRITE,
|
||||
RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
||||
|
||||
if (!rdb_file)
|
||||
{
|
||||
|
@ -218,7 +218,8 @@ int libretrodb_open(const char *path, libretrodb_t *db)
|
||||
libretrodb_metadata_t md;
|
||||
int rv = 0;
|
||||
RFILE *fd = filestream_open(path,
|
||||
RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE);
|
||||
RETRO_VFS_FILE_ACCESS_READ,
|
||||
RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
||||
|
||||
if (!fd)
|
||||
return -errno;
|
||||
@ -434,7 +435,8 @@ int libretrodb_cursor_open(libretrodb_t *db, libretrodb_cursor_t *cursor,
|
||||
return -errno;
|
||||
|
||||
fd = filestream_open(db->path,
|
||||
RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_MMAP);
|
||||
RETRO_VFS_FILE_ACCESS_READ,
|
||||
RETRO_VFS_FILE_ACCESS_HINT_MEMORY_MAP);
|
||||
|
||||
if (!fd)
|
||||
return -errno;
|
||||
|
@ -93,7 +93,8 @@ int main(int argc, char ** argv)
|
||||
call_init(L, argc - 2, (const char **) argv + 2);
|
||||
|
||||
dst = filestream_open(db_file,
|
||||
RETRO_VFS_FILE_ACCESS_WRITE, RFILE_HINT_NONE);
|
||||
RETRO_VFS_FILE_ACCESS_WRITE,
|
||||
RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
||||
|
||||
if (!dst)
|
||||
{
|
||||
|
@ -107,7 +107,8 @@ static int create_db(lua_State *L)
|
||||
lua_setfield(L, LUA_REGISTRYINDEX, "testlib_get_value");
|
||||
|
||||
dst = filestream_open(db_file,
|
||||
RETRO_VFS_FILE_ACCESS_WRITE, RFILE_HINT_NONE);
|
||||
RETRO_VFS_FILE_ACCESS_WRITE,
|
||||
RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
||||
if (!dst)
|
||||
{
|
||||
lua_pushstring(L, "Could not open destination file");
|
||||
|
@ -187,7 +187,8 @@ int main(void)
|
||||
{
|
||||
struct stub_state state;
|
||||
RFILE *fd = filestream_open("test.msgpack",
|
||||
RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE);
|
||||
RETRO_VFS_FILE_ACCESS_READ,
|
||||
RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
||||
|
||||
state.i = 0;
|
||||
state.stack[0] = 0;
|
||||
|
@ -1878,7 +1878,8 @@ static void systemd_service_toggle(const char *path, char *unit, bool enable)
|
||||
|
||||
if (enable)
|
||||
filestream_close(filestream_open(path,
|
||||
RETRO_VFS_FILE_ACCESS_WRITE, RFILE_HINT_NONE));
|
||||
RETRO_VFS_FILE_ACCESS_WRITE,
|
||||
RETRO_VFS_FILE_ACCESS_HINT_NONE));
|
||||
else
|
||||
path_file_remove(path);
|
||||
|
||||
|
44
movie.c
44
movie.c
@ -20,7 +20,7 @@
|
||||
#include <rhash.h>
|
||||
#include <compat/strl.h>
|
||||
#include <retro_endianness.h>
|
||||
#include <streams/file_stream.h>
|
||||
#include <streams/interface_stream.h>
|
||||
|
||||
#include "configuration.h"
|
||||
#include "movie.h"
|
||||
@ -35,7 +35,7 @@
|
||||
|
||||
struct bsv_movie
|
||||
{
|
||||
RFILE *file;
|
||||
intfstream_t *file;
|
||||
|
||||
/* A ring buffer keeping track of positions
|
||||
* in the file for each frame. */
|
||||
@ -75,8 +75,9 @@ static bool bsv_movie_init_playback(bsv_movie_t *handle, const char *path)
|
||||
uint32_t state_size = 0;
|
||||
uint32_t content_crc = 0;
|
||||
uint32_t header[4] = {0};
|
||||
RFILE *file = filestream_open(path,
|
||||
RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE);
|
||||
intfstream_t *file = intfstream_open_file(path,
|
||||
RETRO_VFS_FILE_ACCESS_READ,
|
||||
RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
||||
|
||||
if (!file)
|
||||
{
|
||||
@ -87,7 +88,7 @@ static bool bsv_movie_init_playback(bsv_movie_t *handle, const char *path)
|
||||
handle->file = file;
|
||||
handle->playback = true;
|
||||
|
||||
filestream_read(handle->file, header, sizeof(uint32_t) * 4);
|
||||
intfstream_read(handle->file, header, sizeof(uint32_t) * 4);
|
||||
/* Compatibility with old implementation that
|
||||
* used incorrect documentation. */
|
||||
if (swap_if_little32(header[MAGIC_INDEX]) != BSV_MAGIC
|
||||
@ -123,7 +124,8 @@ static bool bsv_movie_init_playback(bsv_movie_t *handle, const char *path)
|
||||
|
||||
handle->state = buf;
|
||||
handle->state_size = state_size;
|
||||
if (filestream_read(handle->file, handle->state, state_size) != state_size)
|
||||
if (intfstream_read(handle->file,
|
||||
handle->state, state_size) != state_size)
|
||||
{
|
||||
RARCH_ERR("%s\n", msg_hash_to_str(MSG_COULD_NOT_READ_STATE_FROM_MOVIE));
|
||||
return false;
|
||||
@ -153,8 +155,9 @@ static bool bsv_movie_init_record(bsv_movie_t *handle, const char *path)
|
||||
uint32_t state_size = 0;
|
||||
uint32_t content_crc = 0;
|
||||
uint32_t header[4] = {0};
|
||||
RFILE *file = filestream_open(path,
|
||||
RETRO_VFS_FILE_ACCESS_WRITE, RFILE_HINT_NONE);
|
||||
intfstream_t *file = intfstream_open_file(path,
|
||||
RETRO_VFS_FILE_ACCESS_WRITE,
|
||||
RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
||||
|
||||
if (!file)
|
||||
{
|
||||
@ -183,7 +186,7 @@ static bool bsv_movie_init_record(bsv_movie_t *handle, const char *path)
|
||||
RARCH_ERR("----- debug %u -----\n", header[3]);
|
||||
#endif
|
||||
|
||||
filestream_write(handle->file, header, 4 * sizeof(uint32_t));
|
||||
intfstream_write(handle->file, header, 4 * sizeof(uint32_t));
|
||||
|
||||
handle->min_file_pos = sizeof(header) + state_size;
|
||||
handle->state_size = state_size;
|
||||
@ -201,7 +204,8 @@ static bool bsv_movie_init_record(bsv_movie_t *handle, const char *path)
|
||||
|
||||
core_serialize(&serial_info);
|
||||
|
||||
filestream_write(handle->file, handle->state, state_size);
|
||||
intfstream_write(handle->file,
|
||||
handle->state, state_size);
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -212,7 +216,7 @@ static void bsv_movie_free(bsv_movie_t *handle)
|
||||
if (!handle)
|
||||
return;
|
||||
|
||||
filestream_close(handle->file);
|
||||
intfstream_close(handle->file);
|
||||
|
||||
free(handle->state);
|
||||
free(handle->frame_pos);
|
||||
@ -258,7 +262,7 @@ void bsv_movie_set_frame_start(void)
|
||||
{
|
||||
if (bsv_movie_state_handle)
|
||||
bsv_movie_state_handle->frame_pos[bsv_movie_state_handle->frame_ptr]
|
||||
= filestream_tell(bsv_movie_state_handle->file);
|
||||
= intfstream_tell(bsv_movie_state_handle->file);
|
||||
}
|
||||
|
||||
void bsv_movie_set_frame_end(void)
|
||||
@ -284,7 +288,7 @@ static void bsv_movie_frame_rewind(bsv_movie_t *handle)
|
||||
{
|
||||
/* If we're at the beginning... */
|
||||
handle->frame_ptr = 0;
|
||||
filestream_seek(handle->file, handle->min_file_pos, SEEK_SET);
|
||||
intfstream_seek(handle->file, handle->min_file_pos, SEEK_SET);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -296,11 +300,11 @@ static void bsv_movie_frame_rewind(bsv_movie_t *handle)
|
||||
* plus another. */
|
||||
handle->frame_ptr = (handle->frame_ptr -
|
||||
(handle->first_rewind ? 1 : 2)) & handle->frame_mask;
|
||||
filestream_seek(handle->file,
|
||||
intfstream_seek(handle->file,
|
||||
handle->frame_pos[handle->frame_ptr], SEEK_SET);
|
||||
}
|
||||
|
||||
if (filestream_tell(handle->file) <= (long)handle->min_file_pos)
|
||||
if (intfstream_tell(handle->file) <= (long)handle->min_file_pos)
|
||||
{
|
||||
/* We rewound past the beginning. */
|
||||
|
||||
@ -311,17 +315,17 @@ static void bsv_movie_frame_rewind(bsv_movie_t *handle)
|
||||
/* If recording, we simply reset
|
||||
* the starting point. Nice and easy. */
|
||||
|
||||
filestream_seek(handle->file, 4 * sizeof(uint32_t), SEEK_SET);
|
||||
intfstream_seek(handle->file, 4 * sizeof(uint32_t), SEEK_SET);
|
||||
|
||||
serial_info.data = handle->state;
|
||||
serial_info.size = handle->state_size;
|
||||
|
||||
core_serialize(&serial_info);
|
||||
|
||||
filestream_write(handle->file, handle->state, handle->state_size);
|
||||
intfstream_write(handle->file, handle->state, handle->state_size);
|
||||
}
|
||||
else
|
||||
filestream_seek(handle->file, handle->min_file_pos, SEEK_SET);
|
||||
intfstream_seek(handle->file, handle->min_file_pos, SEEK_SET);
|
||||
}
|
||||
}
|
||||
|
||||
@ -389,7 +393,7 @@ bool bsv_movie_init(void)
|
||||
|
||||
bool bsv_movie_get_input(int16_t *bsv_data)
|
||||
{
|
||||
if (filestream_read(bsv_movie_state_handle->file, bsv_data, 1) != 1)
|
||||
if (intfstream_read(bsv_movie_state_handle->file, bsv_data, 1) != 1)
|
||||
return false;
|
||||
|
||||
*bsv_data = swap_if_big16(*bsv_data);
|
||||
@ -450,7 +454,7 @@ bool bsv_movie_ctl(enum bsv_ctl_state state, void *data)
|
||||
int16_t *bsv_data = (int16_t*)data;
|
||||
|
||||
*bsv_data = swap_if_big16(*bsv_data);
|
||||
filestream_write(bsv_movie_state_handle->file, bsv_data, 1);
|
||||
intfstream_write(bsv_movie_state_handle->file, bsv_data, 1);
|
||||
}
|
||||
break;
|
||||
case BSV_MOVIE_CTL_NONE:
|
||||
|
@ -395,7 +395,7 @@ void playlist_write_file(playlist_t *playlist)
|
||||
return;
|
||||
|
||||
file = filestream_open(playlist->conf_path,
|
||||
RETRO_VFS_FILE_ACCESS_WRITE, RFILE_HINT_NONE);
|
||||
RETRO_VFS_FILE_ACCESS_WRITE, RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
||||
|
||||
if (!file)
|
||||
{
|
||||
@ -495,7 +495,8 @@ static bool playlist_read_file(
|
||||
unsigned i;
|
||||
char buf[PLAYLIST_ENTRIES][1024];
|
||||
RFILE *file = filestream_open(
|
||||
path, RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE);
|
||||
path, RETRO_VFS_FILE_ACCESS_READ,
|
||||
RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
||||
|
||||
for (i = 0; i < PLAYLIST_ENTRIES; i++)
|
||||
buf[i][0] = '\0';
|
||||
|
@ -207,7 +207,7 @@ static bool intfstream_file_get_serial(const char *name,
|
||||
uint8_t *data = NULL;
|
||||
ssize_t file_size = -1;
|
||||
intfstream_t *fd = intfstream_open_file(name,
|
||||
RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE);
|
||||
RETRO_VFS_FILE_ACCESS_READ, RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
||||
|
||||
if (!fd)
|
||||
return 0;
|
||||
@ -239,7 +239,7 @@ static bool intfstream_file_get_serial(const char *name,
|
||||
intfstream_close(fd);
|
||||
free(fd);
|
||||
fd = intfstream_open_memory(data, RETRO_VFS_FILE_ACCESS_READ,
|
||||
RFILE_HINT_NONE,
|
||||
RETRO_VFS_FILE_ACCESS_HINT_NONE,
|
||||
size);
|
||||
if (!fd)
|
||||
{
|
||||
@ -324,7 +324,7 @@ static int task_database_chd_get_serial(const char *name, char* serial)
|
||||
intfstream_t *fd = intfstream_open_chd_track(
|
||||
name,
|
||||
RETRO_VFS_FILE_ACCESS_READ,
|
||||
RFILE_HINT_NONE,
|
||||
RETRO_VFS_FILE_ACCESS_HINT_NONE,
|
||||
CHDSTREAM_TRACK_FIRST_DATA);
|
||||
if (!fd)
|
||||
return 0;
|
||||
@ -357,7 +357,7 @@ static bool intfstream_file_get_crc(const char *name,
|
||||
{
|
||||
int rv;
|
||||
intfstream_t *fd = intfstream_open_file(name,
|
||||
RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE);
|
||||
RETRO_VFS_FILE_ACCESS_READ, RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
||||
uint8_t *data = NULL;
|
||||
ssize_t file_size = -1;
|
||||
|
||||
@ -388,7 +388,7 @@ static bool intfstream_file_get_crc(const char *name,
|
||||
intfstream_close(fd);
|
||||
free(fd);
|
||||
fd = intfstream_open_memory(data, RETRO_VFS_FILE_ACCESS_READ,
|
||||
RFILE_HINT_NONE, size);
|
||||
RETRO_VFS_FILE_ACCESS_HINT_NONE, size);
|
||||
|
||||
if (!fd)
|
||||
goto error;
|
||||
@ -481,7 +481,7 @@ static bool task_database_chd_get_crc(const char *name, uint32_t *crc)
|
||||
intfstream_t *fd = intfstream_open_chd_track(
|
||||
name,
|
||||
RETRO_VFS_FILE_ACCESS_READ,
|
||||
RFILE_HINT_NONE,
|
||||
RETRO_VFS_FILE_ACCESS_HINT_NONE,
|
||||
CHDSTREAM_TRACK_PRIMARY);
|
||||
if (!fd)
|
||||
return 0;
|
||||
@ -505,7 +505,7 @@ static void task_database_cue_prune(database_info_handle_t *db,
|
||||
size_t i;
|
||||
char *path = (char *)malloc(PATH_MAX_LENGTH + 1);
|
||||
intfstream_t *fd = intfstream_open_file(name,
|
||||
RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE);
|
||||
RETRO_VFS_FILE_ACCESS_READ, RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
||||
|
||||
if (!fd)
|
||||
goto end;
|
||||
@ -538,7 +538,7 @@ static void gdi_prune(database_info_handle_t *db, const char *name)
|
||||
size_t i;
|
||||
char *path = (char *)malloc(PATH_MAX_LENGTH + 1);
|
||||
intfstream_t *fd = intfstream_open_file(name,
|
||||
RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE);
|
||||
RETRO_VFS_FILE_ACCESS_READ, RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
||||
|
||||
if (!fd)
|
||||
goto end;
|
||||
|
@ -414,7 +414,7 @@ static ssize_t get_file_size(const char *path)
|
||||
{
|
||||
ssize_t rv;
|
||||
RFILE *fd = filestream_open(path,
|
||||
RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE);
|
||||
RETRO_VFS_FILE_ACCESS_READ, RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
||||
if (fd == NULL)
|
||||
return -1;
|
||||
rv = filestream_get_size(fd);
|
||||
@ -469,7 +469,7 @@ int cue_find_track(const char *cue_path, bool first,
|
||||
goto error;
|
||||
|
||||
if (!intfstream_open(fd, cue_path,
|
||||
RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE))
|
||||
RETRO_VFS_FILE_ACCESS_READ, RETRO_VFS_FILE_ACCESS_HINT_NONE))
|
||||
{
|
||||
RARCH_LOG("Could not open CUE file '%s': %s\n", cue_path,
|
||||
strerror(errno));
|
||||
@ -624,7 +624,7 @@ int gdi_find_track(const char *gdi_path, bool first,
|
||||
goto error;
|
||||
|
||||
if (!intfstream_open(fd, gdi_path,
|
||||
RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE))
|
||||
RETRO_VFS_FILE_ACCESS_READ, RETRO_VFS_FILE_ACCESS_HINT_NONE))
|
||||
{
|
||||
RARCH_LOG("Could not open GDI file '%s': %s\n", gdi_path,
|
||||
strerror(errno));
|
||||
|
@ -158,7 +158,7 @@ static void autosave_thread(void *data)
|
||||
{
|
||||
/* Should probably deal with this more elegantly. */
|
||||
RFILE *file = filestream_open(save->path,
|
||||
RETRO_VFS_FILE_ACCESS_WRITE, RFILE_HINT_NONE);
|
||||
RETRO_VFS_FILE_ACCESS_WRITE, RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
||||
|
||||
if (file)
|
||||
{
|
||||
@ -566,7 +566,7 @@ static void task_save_handler(retro_task_t *task)
|
||||
if (!state->file)
|
||||
{
|
||||
state->file = filestream_open(state->path, RETRO_VFS_FILE_ACCESS_WRITE,
|
||||
RFILE_HINT_NONE);
|
||||
RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
||||
|
||||
if (!state->file)
|
||||
return;
|
||||
@ -740,7 +740,7 @@ static void task_load_handler(retro_task_t *task)
|
||||
{
|
||||
state->file = filestream_open(state->path,
|
||||
RETRO_VFS_FILE_ACCESS_READ,
|
||||
RFILE_HINT_NONE);
|
||||
RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
||||
|
||||
if (!state->file)
|
||||
goto error;
|
||||
|
Loading…
x
Reference in New Issue
Block a user