Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using libretro_common's filestream for file access #81

Merged
merged 24 commits into from
Jun 24, 2017
Merged

Using libretro_common's filestream for file access #81

merged 24 commits into from
Jun 24, 2017

Conversation

albertofustinoni
Copy link

No description provided.

@albertofustinoni
Copy link
Author

albertofustinoni commented Jun 20, 2017

@twinaphex This is going to make it a lot easier to implement file system virtualization/UWP support down the line in Retroarch for this core AND it's the least disruptive way I to do so I could come up with: the only new code I am including is straight from the libretro_common repo. It would also allow me to rejoin upstream for RetriX.

I know I haven't modified the makefiles to include the toolkit include dirs. and file_stream.c: if you could provide guidance I'd be happy to do so.

@inactive123
Copy link

Does Sega CD still work with your changes?

@albertofustinoni
Copy link
Author

albertofustinoni commented Jun 24, 2017

Yes, I managed to ply Sonic CD yesterday in my front end thanks to those changes.

I could also play Mega Drive roms from within zip files (decompressed the rom to RAM, had file IO point to that stream with virtualization) - as you know Genesis Plus GX has require_full_path=true

@inactive123
Copy link

The only issue I see with this is that it has to edit parts of the core code - but as you yourself indicated, we can't have direct file I/O access going on in the core anyway if we want this to work on RT, so the original author would have to come up with a solution to that anyway. He might as well use our filestream code then.

So it's OK, I will merge this.

@inactive123 inactive123 merged commit 61b6fb9 into libretro:master Jun 24, 2017
@albertofustinoni
Copy link
Author

Thank you very much for accepting this. I'm very happy to be able to rejoin upstream.

@inactive123
Copy link

No problem.

@sergiobenrocha2
Copy link

sergiobenrocha2 commented Jun 24, 2017

Build failing on Linux, you need something like this

diff --git a/libretro/Makefile.common b/libretro/Makefile.common
index acb620a..f246dfb 100644
--- a/libretro/Makefile.common
+++ b/libretro/Makefile.common
@@ -18,4 +18,6 @@ SOURCES_C += $(LIBRETRO_DIR)/libretro.c
 
 SOURCES_C += $(LIBRETRO_DIR)/scrc32.c
 
-INCFLAGS += $(foreach dir,$(GENPLUS_SRC_DIR),-I$(dir)) -I$(LIBRETRO_DIR)
+SOURCES_C += $(CORE_DIR)/libretro-common/streams/file_stream.c
+
+INCFLAGS += $(foreach dir,$(GENPLUS_SRC_DIR),-I$(dir)) -I$(LIBRETRO_DIR) -I$(CORE_DIR)/libretro-common/include

And then, I get this:

cc -o libretro-common/streams/file_stream.o -c libretro-common/streams/file_stream.c  -DGIT_VERSION=\"" 61b6fb9"\" -O3 -DNDEBUG -fPIC -DUSE_LIBTREMOR  -I./core -I./core/z80 -I./core/m68k -I./core/ntsc -I./core/sound -I./core/input_hw -I./core/cd_hw -I./core/cart_hw -I./core/cart_hw/svp -I./libretro -I./libretro-common/include -DUSE_16BPP_RENDERING -DFRONTEND_SUPPORTS_RGB565 -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN -DHAVE_ZLIB -D__LIBRETRO__ -DINLINE="static inline"
In file included from libretro-common/streams/file_stream.c:66:0:
./libretro-common/include/retro_miscellaneous.h:110:1: error: duplicate ‘static’
 static INLINE void retro_sleep(unsigned msec)
 ^
./libretro-common/include/retro_miscellaneous.h:142:1: error: duplicate ‘static’
 static INLINE uint32_t next_pow2(uint32_t v)
 ^
./libretro-common/include/retro_miscellaneous.h:162:1: error: duplicate ‘static’
 static INLINE uint32_t prev_pow2(uint32_t v)
 ^
./libretro-common/include/retro_miscellaneous.h:172:1: error: duplicate ‘static’
 static INLINE uint32_t read_le(const uint8_t *data, unsigned size)
 ^

@inactive123
Copy link

Pushed a buildfix.

@sergiobenrocha2
Copy link

It's working now, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants