@@ -713,7 +713,7 @@ intfstream_t *intfstream_open_memory(void *data,
713713 info .type = INTFSTREAM_MEMORY ;
714714 info .memory .buf .data = (uint8_t * )data ;
715715 info .memory .buf .size = size ;
716- info .memory .writable = false ;
716+ info .memory .writable = ( mode & RETRO_VFS_FILE_ACCESS_WRITE ) != 0 ;
717717
718718 if (!(fd = (intfstream_t * )intfstream_init (& info )))
719719 return NULL ;
@@ -729,23 +729,7 @@ intfstream_t *intfstream_open_memory(void *data,
729729intfstream_t * intfstream_open_writable_memory (void * data ,
730730 unsigned mode , unsigned hints , uint64_t size )
731731{
732- intfstream_info_t info ;
733- intfstream_t * fd = NULL ;
734-
735- info .type = INTFSTREAM_MEMORY ;
736- info .memory .buf .data = (uint8_t * )data ;
737- info .memory .buf .size = size ;
738- info .memory .writable = true;
739-
740- if (!(fd = (intfstream_t * )intfstream_init (& info )))
741- return NULL ;
742-
743- if (intfstream_open (fd , NULL , mode , hints ))
744- return fd ;
745-
746- intfstream_close (fd );
747- free (fd );
748- return NULL ;
732+ return intfstream_open_memory (data , mode | RETRO_VFS_FILE_ACCESS_WRITE , hints , size );
749733}
750734
751735intfstream_t * intfstream_open_chd_track (const char * path ,
0 commit comments