From 69ad3273b9410c000bd8738bb565821d52696752 Mon Sep 17 00:00:00 2001 From: Francisco Javier Trujillo Mata Date: Mon, 24 Dec 2018 16:15:05 +0100 Subject: [PATCH] Disable use of `setvbuf` for the PS2 --- Makefile.ps2 | 15 +++++++-------- gfx/drivers/ps2_gfx.c | 1 - libretro-common/file/config_file.c | 2 ++ libretro-common/vfs/vfs_implementation.c | 2 ++ 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Makefile.ps2 b/Makefile.ps2 index d770baf8ed..5c82d24d40 100644 --- a/Makefile.ps2 +++ b/Makefile.ps2 @@ -6,7 +6,7 @@ HAVE_FILE_LOGGER = 1 HAVE_THREADS = 0 BIG_STACK = 0 WHOLE_ARCHIVE_LINK = 0 -PS2_IP = 192.168.1.150 +PS2_IP = 192.168.2.150 #Configuration for IRX EE_BIN2O = bin2o @@ -26,7 +26,7 @@ ifeq ($(WHOLE_ARCHIVE_LINK), 1) WHOLE_END := -Wl,--no-whole-archive endif -INCDIR = -I$(PS2SDK)/ports/include -I$(PS2DEV)/gsKit/include -I$(PS2SDK)/iop/include -I$(PS2SDK)/ee/include -I$(PS2SDK)/common/include +INCDIR = -I$(PS2DEV)/gsKit/include -I$(PS2SDK)/ports/include INCDIR += -Ips2 -Ips2/include -Ilibretro-common/include INCDIR += -Ideps -Ideps/stb -Ideps/libz -Ideps/7zip -Ideps/pthreads -Ideps/pthreads/platform/ps2 -Ideps/pthreads/platform/helper GPVAL = -G0 @@ -37,10 +37,9 @@ RARCH_DEFINES += -DPS2 -DUSE_IOP_CTYPE_MACRO -D_MIPS_ARCH_R5900 -DHAVE_ZLIB -DHA RARCH_DEFINES += -DHAVE_GRIFFIN=1 -DRARCH_INTERNAL -DRARCH_CONSOLE -DHAVE_MENU -DHAVE_RGUI -DHAVE_FILTERS_BUILTIN -DHAVE_IMAGEVIEWER -DHAVE_7ZIP -DHAVE_CC_RESAMPLER LIBDIR = -LDFLAGS = -L$(PS2SDK)/ports/lib -L$(PS2DEV)/gsKit/lib -L$(PS2SDK)/ee/lib -L. -#LIBS = $(WHOLE_START) -lretro_ps2 $(WHOLE_END) -lstdc++ -lm -lz -lgskit -ldmakit -lpng -laudsrv -lpad -lcdvd -lmad -lfileXio -lpatches +LDFLAGS = -L$(PS2SDK)/ports/lib -L$(PS2DEV)/gsKit/lib -L$(PS2SDK)/ee/lib -L. -s LIBS += $(WHOLE_START) -lretro_ps2 $(WHOLE_END) -LIBS += -lgskit -lpad -lsdl -lm -lz -lfileXio -laudsrv -lpatches -lpoweroff +LIBS += -lgskit -ldmakit -lpad -lmc -lhdd -lsdl -lc -lfileXio -lpatches -lpoweroff -ldebug -lc #IRX modules # IRX modules - modules have to be in IRX_DIR @@ -104,9 +103,9 @@ include $(PS2SDK)/samples/Makefile.pref include $(PS2SDK)/samples/Makefile.eeglobal -# $(EE_BIN): $(EE_OBJS) $(PS2SDK)/ee/startup/crt0.o -# $(EE_CXX) $(EE_NO_CRT) -T$(PS2SDK)/ee/startup/linkfile $(EE_CXXFLAGS) \ -# -o $(EE_BIN) $(PS2SDK)/ee/startup/crt0.o $(CRTI_OBJ) $(CRTBEGIN_OBJ) $(EE_OBJS) $(CRTEND_OBJ) $(CRTN_OBJ) $(EE_LDFLAGS) $(EE_LIBS) +$(EE_BIN): $(EE_OBJS) $(PS2SDK)/ee/startup/crt0.o + $(EE_CXX) $(EE_NO_CRT) -T$(PS2SDK)/ee/startup/linkfile $(EE_CXXFLAGS) \ + -o $(EE_BIN) $(PS2SDK)/ee/startup/crt0.o $(CRTI_OBJ) $(CRTBEGIN_OBJ) $(EE_OBJS) $(CRTEND_OBJ) $(CRTN_OBJ) $(EE_LDFLAGS) $(EE_LIBS) \ No newline at end of file diff --git a/gfx/drivers/ps2_gfx.c b/gfx/drivers/ps2_gfx.c index a25c9c8239..5080fde489 100644 --- a/gfx/drivers/ps2_gfx.c +++ b/gfx/drivers/ps2_gfx.c @@ -18,7 +18,6 @@ #include "../../driver.h" #include "../../verbosity.h" -#include #include #include #include diff --git a/libretro-common/file/config_file.c b/libretro-common/file/config_file.c index 846fa2c6fc..fcf95de2e9 100644 --- a/libretro-common/file/config_file.c +++ b/libretro-common/file/config_file.c @@ -986,8 +986,10 @@ bool config_file_write(config_file_t *conf, const char *path) return false; /* TODO: this is only useful for a few platforms, find which and add ifdef */ +#if !defined(PS2) buf = calloc(1, 0x4000); setvbuf(file, (char*)buf, _IOFBF, 0x4000); +#endif config_file_dump(conf, file); diff --git a/libretro-common/vfs/vfs_implementation.c b/libretro-common/vfs/vfs_implementation.c index 0213c06091..4721e7259e 100644 --- a/libretro-common/vfs/vfs_implementation.c +++ b/libretro-common/vfs/vfs_implementation.c @@ -294,8 +294,10 @@ libretro_vfs_implementation_file *retro_vfs_file_open_impl(const char *path, uns */ /* TODO: this is only useful for a few platforms, find which and add ifdef */ stream->fp = fp; +#if !defined(PS2) stream->buf = (char*)calloc(1, 0x4000); setvbuf(stream->fp, stream->buf, _IOFBF, 0x4000); +#endif } else {