From b9e19ccc0e34a44e6bce7de8e95302700cead07e Mon Sep 17 00:00:00 2001 From: CrystalCT Date: Mon, 17 Jan 2022 12:47:03 +0100 Subject: [PATCH] PS3: update Mafile.libretro and remove obsolete variable --- Makefile.libretro | 38 ++++++++--------------------- Src/Board/Machine.c | 2 +- Src/Libretro/File.c | 2 +- Src/Libretro/Glob.c | 2 +- Src/Libretro/Timer.c | 4 +-- Src/Libretro/psp/diet-glob.c | 2 +- libretro-common/file/retro_dirent.c | 20 +++++++-------- libretro-common/include/libretro.h | 2 +- 8 files changed, 27 insertions(+), 45 deletions(-) diff --git a/Makefile.libretro b/Makefile.libretro index 0e8b073..46e4d03 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -267,39 +267,21 @@ else ifeq ($(platform), qnx) AR = QCC -Vgcc_ntoarmv7le PLATFORM_DEFINES := -D__BLACKBERRY_QNX__ -fexceptions -marm -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=softfp -# PS3 -else ifeq ($(platform), ps3) - TARGET := $(TARGET_NAME)_libretro_$(platform).a - CC = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe - CC_AS = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe - CXX = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-g++.exe - AR = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ar.exe - PLATFORM_DEFINES := -D__CELLOS_LV2__ - STATIC_LINKING = 1 - HAVE_COMPAT = 1 - -# sncps3 -else ifeq ($(platform), sncps3) - TARGET := $(TARGET_NAME)_libretro_ps3.a - CC = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe - CC_AS = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe - CXX = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe - AR = $(CELL_SDK)/host-win32/sn/bin/ps3snarl.exe - PLATFORM_DEFINES := -D__CELLOS_LV2__ - STATIC_LINKING = 1 - HAVE_COMPAT = 1 - # Lightweight PS3 Homebrew SDK -else ifeq ($(platform), psl1ght) +else ifneq (,$(filter $(platform), ps3 psl1ght)) TARGET := $(TARGET_NAME)_libretro_$(platform).a - CC = $(PS3DEV)/ppu/bin/ppu-gcc$(EXE_EXT) - CC_AS = $(PS3DEV)/ppu/bin/ppu-gcc$(EXE_EXT) - CXX = $(PS3DEV)/ppu/bin/ppu-g++$(EXE_EXT) - AR = $(PS3DEV)/ppu/bin/ppu-ar$(EXE_EXT) - PLATFORM_DEFINES := -D__CELLOS_LV2__ -D__PSL1GHT__ + PLATFORM_DEFINES += -D__PS3__ + ifeq ($(platform), psl1ght) + PLATFORM_DEFINES += -D__PSL1GHT__ + endif STATIC_LINKING = 1 HAVE_COMPAT = 1 + CC = $(PS3DEV)/ppu/bin/ppu-$(COMMONLV)gcc$(EXE_EXT) + CC_AS = $(PS3DEV)/ppu/bin/ppu-$(COMMONLV)gcc$(EXE_EXT) + CXX = $(PS3DEV)/ppu/bin/ppu-$(COMMONLV)g++$(EXE_EXT) + AR = $(PS3DEV)/ppu/bin/ppu-$(COMMONLV)ar$(EXE_EXT) + # PS2 else ifeq ($(platform), ps2) TARGET := $(TARGET_NAME)_libretro_$(platform).a diff --git a/Src/Board/Machine.c b/Src/Board/Machine.c index b0af7df..c30a82c 100644 --- a/Src/Board/Machine.c +++ b/Src/Board/Machine.c @@ -217,7 +217,7 @@ char *strcasestr(const char *str1, const char *str2) #endif -#if defined(__CELLOS_LV2__) || defined(PS2) +#if defined(__PS3__) || defined(PS2) char *strcasestr(const char *h, const char *n) { size_t l = strlen(n); diff --git a/Src/Libretro/File.c b/Src/Libretro/File.c index 439d178..306c05d 100644 --- a/Src/Libretro/File.c +++ b/Src/Libretro/File.c @@ -38,7 +38,7 @@ #include -#if defined(__CELLOS_LV2__) +#if defined(__PS3__) char* getcwd( char* buf, size_t size ) { if ( buf != NULL && size >= 2 ) diff --git a/Src/Libretro/Glob.c b/Src/Libretro/Glob.c index 45a5108..a304bef 100644 --- a/Src/Libretro/Glob.c +++ b/Src/Libretro/Glob.c @@ -109,7 +109,7 @@ void archGlobFree(ArchGlob* globHandle) #else #include "ArchGlob.h" -#if defined(PSP) || defined(__CELLOS_LV2__) || defined(ANDROID) || defined(WIIU) || defined(_XBOX) || defined(VITA) || defined(PS2) || defined(_3DS) || defined(__SWITCH__) +#if defined(PSP) || defined(__PS3__) || defined(ANDROID) || defined(WIIU) || defined(_XBOX) || defined(VITA) || defined(PS2) || defined(_3DS) || defined(__SWITCH__) /* TODO/FIXME - might want to turn this into more generic define that we * flick on for consoles/portables */ #include "psp/diet-glob.h" diff --git a/Src/Libretro/Timer.c b/Src/Libretro/Timer.c index b935f50..6f27ff1 100644 --- a/Src/Libretro/Timer.c +++ b/Src/Libretro/Timer.c @@ -20,7 +20,7 @@ UInt32 archGetSystemUpTime(UInt32 frequency) return (rtc_tick / frequency); } -#elif defined(__PSL1GHT__) +#elif defined(__PS3__) #include @@ -31,7 +31,7 @@ UInt32 archGetSystemUpTime(UInt32 frequency) return (rtc_tick / frequency); } -#elif defined(__CELLOS_LV2__) +#elif defined(__PS3__) && !defined(__PSL1GHT__) #include diff --git a/Src/Libretro/psp/diet-glob.c b/Src/Libretro/psp/diet-glob.c index 70b0a48..ed349be 100644 --- a/Src/Libretro/psp/diet-glob.c +++ b/Src/Libretro/psp/diet-glob.c @@ -30,7 +30,7 @@ // already in the PSPSDK so the name is changed #include "diet-glob.h" -#ifdef __CELLOS_LV2__ +#ifdef __PS3__ #define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR) #endif diff --git a/libretro-common/file/retro_dirent.c b/libretro-common/file/retro_dirent.c index c21b2d6..e298397 100644 --- a/libretro-common/file/retro_dirent.c +++ b/libretro-common/file/retro_dirent.c @@ -56,11 +56,11 @@ # include #endif -#ifdef __CELLOS_LV2__ +#ifdef defined(__PS3__) && !defined(__PSL1GHT__) #include #endif -#if (defined(__CELLOS_LV2__) && !defined(__PSL1GHT__)) || defined(__QNX__) || defined(PSP) +#if (defined(__PS3__) && !defined(__PSL1GHT__)) || defined(__QNX__) || defined(PSP) #include /* stat() is defined here */ #endif @@ -74,7 +74,7 @@ struct RDIR #elif defined(VITA) || defined(PSP) SceUID directory; SceIoDirent entry; -#elif defined(__CELLOS_LV2__) +#elif defined(__PS3__) && !defined(__PSL1GHT__) CellFsErrno error; int directory; CellFsDirent entry; @@ -103,7 +103,7 @@ struct RDIR *retro_opendir(const char *name) #elif defined(_3DS) rdir->directory = (name && *name)? opendir(name) : NULL; rdir->entry = NULL; -#elif defined(__CELLOS_LV2__) +#elif defined(__PS3__) && !defined(__PSL1GHT__) rdir->error = cellFsOpendir(name, &rdir->directory); #else rdir->directory = opendir(name); @@ -119,7 +119,7 @@ bool retro_dirent_error(struct RDIR *rdir) return (rdir->directory == INVALID_HANDLE_VALUE); #elif defined(VITA) || defined(PSP) return (rdir->directory < 0); -#elif defined(__CELLOS_LV2__) +#elif defined(__PS3__) && !defined(__PSL1GHT__) return (rdir->error != CELL_FS_SUCCEEDED); #else return !(rdir->directory); @@ -136,7 +136,7 @@ int retro_readdir(struct RDIR *rdir) return (rdir->directory != INVALID_HANDLE_VALUE); #elif defined(VITA) || defined(PSP) return (sceIoDread(rdir->directory, &rdir->entry) > 0); -#elif defined(__CELLOS_LV2__) +#elif defined(__PS3__) && !defined(__PSL1GHT__) uint64_t nread; rdir->error = cellFsReaddir(rdir->directory, &rdir->entry, &nread); return (nread != 0); @@ -149,7 +149,7 @@ const char *retro_dirent_get_name(struct RDIR *rdir) { #if defined(_WIN32) return rdir->entry.cFileName; -#elif defined(VITA) || defined(PSP) || defined(__CELLOS_LV2__) +#elif defined(VITA) || defined(PSP) || (defined(__PS3__) && !defined(__PSL1GHT__)) return rdir->entry.d_name; #else return rdir->entry->d_name; @@ -173,7 +173,7 @@ static bool path_is_directory_internal(const char *path) free(tmp); return FIO_S_ISDIR(buf.st_mode); -#elif defined(__CELLOS_LV2__) +#elif defined(__PS3__) && !defined(__PSL1GHT__) CellFsStat buf; if (cellFsStat(path, &buf) < 0) return false; @@ -218,7 +218,7 @@ bool retro_dirent_is_dir(struct RDIR *rdir, const char *path) #elif defined(VITA) return SCE_S_ISDIR(entry->d_stat.st_mode); #endif -#elif defined(__CELLOS_LV2__) +#elif defined(__PS3__) && !defined(__PSL1GHT__) CellFsDirent *entry = (CellFsDirent*)&rdir->entry; return (entry->d_type == CELL_FS_TYPE_DIRECTORY); #elif defined(DT_DIR) @@ -255,7 +255,7 @@ void retro_closedir(struct RDIR *rdir) FindClose(rdir->directory); #elif defined(VITA) || defined(PSP) sceIoDclose(rdir->directory); -#elif defined(__CELLOS_LV2__) +#elif defined(__PS3__) && !defined(__PSL1GHT__) rdir->error = cellFsClosedir(rdir->directory); #else if (rdir->directory) diff --git a/libretro-common/include/libretro.h b/libretro-common/include/libretro.h index 1fd2f5b..aa3bdf5 100644 --- a/libretro-common/include/libretro.h +++ b/libretro-common/include/libretro.h @@ -69,7 +69,7 @@ extern "C" { # endif # endif # else -# if defined(__GNUC__) && __GNUC__ >= 4 && !defined(__CELLOS_LV2__) +# if defined(__GNUC__) && __GNUC__ >= 4 && !defined(__PS3__) # define RETRO_API RETRO_CALLCONV __attribute__((__visibility__("default"))) # else # define RETRO_API RETRO_CALLCONV