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

PS3: update Makefile and remove obsolete variable #97

Merged
merged 1 commit into from
Feb 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 11 additions & 32 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -129,39 +129,18 @@ endif
CFLAGS += -DIOS -D__arm__ -DHAVE_POSIX_MEMALIGN=1
CC = cc -arch arm64 -isysroot $(IOSSDK)

# PS3
else ifeq ($(platform), ps3)
TARGET := $(TARGET_NAME)_libretro_$(platform).a
CC = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe
AR = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ar.exe
ENDIANNESS_DEFINES := -DMSB_FIRST
PLATFORM_DEFINES := -D__CELLOS_LV2__ -D__ppc__
HAVE_RZLIB := 1
STATIC_LINKING := 1

# PS3 (SNC)
else ifeq ($(platform), sncps3)
TARGET := $(TARGET_NAME)_libretro_ps3.a
CC = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe
AR = $(CELL_SDK)/host-win32/sn/bin/ps3snarl.exe
ENDIANNESS_DEFINES := -DMSB_FIRST
CFLAGS += -DWORDS_BIGENDIAN=1
GCC_DEFINES :=
PLATFORM_DEFINES := -D__CELLOS_LV2__ -D__ppc__
HAVE_RZLIB := 1
STATIC_LINKING := 1

# Lightweight PS3 Homebrew SDK
else ifeq ($(platform), psl1ght)
TARGET := $(TARGET_NAME)_libretro_$(platform).a
CC = $(PS3DEV)/ppu/bin/ppu-gcc$(EXE_EXT)
AR = $(PS3DEV)/ppu/bin/ppu-ar$(EXE_EXT)
ENDIANNESS_DEFINES := -DMSB_FIRST
CFLAGS += -DWORDS_BIGENDIAN=1
GCC_DEFINES :=
PLATFORM_DEFINES := -D__CELLOS_LV2__ -D__ppc__
HAVE_RZLIB := 1
STATIC_LINKING := 1
else ifneq (,$(filter $(platform), ps3 psl1ght))
TARGET := $(TARGET_NAME)_libretro_$(platform).a
CC = $(PS3DEV)/ppu/bin/ppu-$(COMMONLV)gcc$(EXE_EXT)
AR = $(PS3DEV)/ppu/bin/ppu-$(COMMONLV)ar$(EXE_EXT)
ENDIANNESS_DEFINES := -DMSB_FIRST
PLATFORM_DEFINES := -D__PS3__ -D__ppc__
ifeq ($(platform), psl1ght)
PLATFORM_DEFINES += -D__PSL1GHT__
endif
HAVE_RZLIB := 1
STATIC_LINKING := 1

# Xbox 360 (libxenon)
else ifeq ($(platform), xenon)
Expand Down
4 changes: 2 additions & 2 deletions src/libretro/libretro-common/file/config_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <ctype.h>
#include <errno.h>

#if !defined(_WIN32) && !defined(__CELLOS_LV2__) && !defined(_XBOX)
#if !defined(_WIN32) && !defined(__PS3__) && !defined(_XBOX)
#include <sys/param.h> /* PATH_MAX */
#elif defined(_WIN32) && !defined(_XBOX)
#define WIN32_LEAN_AND_MEAN
Expand Down Expand Up @@ -266,7 +266,7 @@ static void add_sub_conf(config_file_t *conf, char *path)
fill_pathname_resolve_relative(real_path, conf->path,
path, sizeof(real_path));
#else
#ifndef __CELLOS_LV2__
#ifndef __PS3__
if (*path == '~')
{
const char *home = getenv("HOME");
Expand Down
10 changes: 5 additions & 5 deletions src/libretro/libretro-common/file/file_path.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@
#include <kernel/image.h>
#endif

#if defined(__CELLOS_LV2__)
#if defined(__PS3__) && !defined(__PSL1GHT__)
#include <cell/cell_fs.h>
#endif

#if defined(VITA)
#define FIO_S_ISDIR SCE_S_ISDIR
#endif

#if (defined(__CELLOS_LV2__) && !defined(__PSL1GHT__)) || defined(__QNX__) || defined(PSP)
#if (defined(__PS3__) && !defined(__PSL1GHT__)) || defined(__QNX__) || defined(PSP)
#include <unistd.h> /* stat() is defined here */
#endif

Expand All @@ -109,7 +109,7 @@ static bool path_stat(const char *path, enum stat_mode mode, int32_t *size)
}
free(tmp);

#elif defined(__CELLOS_LV2__)
#elif defined(__PS3__) && !defined(__PSL1GHT__)
CellFsStat buf;
if (cellFsStat(path, &buf) < 0)
return false;
Expand All @@ -135,15 +135,15 @@ static bool path_stat(const char *path, enum stat_mode mode, int32_t *size)
case IS_DIRECTORY:
#if defined(VITA) || defined(PSP)
return FIO_S_ISDIR(buf.st_mode);
#elif defined(__CELLOS_LV2__)
#elif defined(__PS3__)
return ((buf.st_mode & S_IFMT) == S_IFDIR);
#elif defined(_WIN32)
return (file_info & FILE_ATTRIBUTE_DIRECTORY);
#else
return S_ISDIR(buf.st_mode);
#endif
case IS_CHARACTER_SPECIAL:
#if defined(VITA) || defined(PSP) || defined(__CELLOS_LV2__) || defined(_WIN32)
#if defined(VITA) || defined(PSP) || defined(__PS3__) || defined(_WIN32)
return false;
#else
return S_ISCHR(buf.st_mode);
Expand Down
18 changes: 9 additions & 9 deletions src/libretro/libretro-common/file/retro_dirent.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@
# include <unistd.h>
#endif

#ifdef __CELLOS_LV2__
#if defined(__PS3__) && !defined(__PSL1GHT__)
#include <cell/cell_fs.h>
#endif

#if (defined(__CELLOS_LV2__) && !defined(__PSL1GHT__)) || defined(__QNX__) || defined(PSP)
#if (defined(__Ps3__) && !defined(__PSL1GHT__)) || defined(__QNX__) || defined(PSP)
#include <unistd.h> /* stat() is defined here */
#endif

Expand All @@ -75,7 +75,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;
Expand Down Expand Up @@ -104,7 +104,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);
Expand All @@ -120,7 +120,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);
Expand All @@ -137,7 +137,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);
Expand All @@ -150,7 +150,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__)
return rdir->entry.d_name;
#else
return rdir->entry->d_name;
Expand Down Expand Up @@ -180,7 +180,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);
#else
Expand Down Expand Up @@ -220,7 +220,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)
Expand Down
4 changes: 2 additions & 2 deletions src/libretro/libretro-common/rthreads/rthreads.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#include "gx_pthread.h"
#elif defined(PSP) || defined(VITA)
#include "psp_pthread.h"
#elif defined(__CELLOS_LV2__)
#elif defined(__PS3__)
#include <pthread.h>
#include <sys/sys_time.h>
#else
Expand Down Expand Up @@ -442,7 +442,7 @@ bool scond_wait_timeout(scond_t *cond, slock_t *lock, int64_t timeout_us)
mach_port_deallocate(mach_task_self(), cclock);
now.tv_sec = mts.tv_sec;
now.tv_nsec = mts.tv_nsec;
#elif defined(__CELLOS_LV2__)
#elif defined(__PS3__)
sys_time_sec_t s;
sys_time_nsec_t n;

Expand Down