Skip to content

Commit 7fd97d8

Browse files
committed
Updates for psl1ght
1 parent a9bf389 commit 7fd97d8

5 files changed

Lines changed: 22 additions & 16 deletions

File tree

features/features_cpu.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939
#include <windows.h>
4040
#endif
4141

42+
#ifdef __PSL1GHT__
43+
#include <lv2/systime.h>
44+
#endif
45+
4246
#if defined(__CELLOS_LV2__) || ( defined(__OpenBSD__) && defined(__powerpc__) )
4347
#ifndef _PPU_INTRINSICS_H
4448
#include <ppu_intrinsics.h>
@@ -181,7 +185,7 @@ retro_perf_tick_t cpu_features_get_perf_counter(void)
181185
time_ticks = (retro_perf_tick_t)a | ((retro_perf_tick_t)d << 32);
182186
#elif defined(__ARM_ARCH_6__)
183187
__asm__ volatile( "mrc p15, 0, %0, c9, c13, 0" : "=r"(time_ticks) );
184-
#elif defined(__CELLOS_LV2__) || defined(_XBOX360) || defined(__powerpc__) || defined(__ppc__) || defined(__POWERPC__)
188+
#elif defined(__CELLOS_LV2__) || defined(_XBOX360) || defined(__powerpc__) || defined(__ppc__) || defined(__POWERPC__) || defined(__PSL1GHT__)
185189
time_ticks = __mftb();
186190
#elif defined(GEKKO)
187191
time_ticks = gettime();
@@ -226,6 +230,8 @@ retro_time_t cpu_features_get_time_usec(void)
226230
if (!QueryPerformanceCounter(&count))
227231
return 0;
228232
return (count.QuadPart / freq.QuadPart * 1000000) + (count.QuadPart % freq.QuadPart * 1000000 / freq.QuadPart);
233+
#elif defined(__PSL1GHT__)
234+
return sysGetSystemTime();
229235
#elif defined(__CELLOS_LV2__)
230236
return sys_time_get_system_time();
231237
#elif defined(GEKKO)
@@ -492,7 +498,7 @@ unsigned cpu_features_get_core_amount(void)
492498
return sysinfo.dwNumberOfProcessors;
493499
#elif defined(GEKKO)
494500
return 1;
495-
#elif defined(PSP) || defined(PS2)
501+
#elif defined(PSP) || defined(PS2) || defined(__CELLOS_LV2__)
496502
return 1;
497503
#elif defined(VITA)
498504
return 4;

file/file_path.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
#include <fileXio.h>
8686
#endif
8787

88-
#if defined(__CELLOS_LV2__)
88+
#if defined(__CELLOS_LV2__) && !defined(__PSL1GHT__)
8989
#include <cell/cell_fs.h>
9090
#endif
9191

file/file_path_io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
#include <fileXio.h>
8888
#endif
8989

90-
#if defined(__CELLOS_LV2__)
90+
#if defined(__CELLOS_LV2__) && !defined(__PSL1GHT__)
9191
#include <cell/cell_fs.h>
9292
#endif
9393

include/retro_miscellaneous.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#include <Xtl.h>
4040
#endif
4141

42-
#if defined(__CELLOS_LV2__)
42+
#if defined(__CELLOS_LV2__) && !defined(__PSL1GHT__)
4343
#include <sys/fs_external.h>
4444
#endif
4545

@@ -75,7 +75,7 @@ static INLINE bool bits_any_set(uint32_t* ptr, uint32_t count)
7575
}
7676

7777
#ifndef PATH_MAX_LENGTH
78-
#if defined(__CELLOS_LV2__)
78+
#if defined(__CELLOS_LV2__) && !defined(__PSL1GHT__)
7979
#define PATH_MAX_LENGTH CELL_FS_MAX_FS_PATH_LENGTH
8080
#elif defined(_XBOX1) || defined(_3DS) || defined(PSP) || defined(PS2) || defined(GEKKO)|| defined(WIIU) || defined(ORBIS)
8181
#define PATH_MAX_LENGTH 512

vfs/vfs_implementation.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
# endif
6969
#endif
7070

71-
#ifdef __CELLOS_LV2__
71+
#if defined (__CELLOS_LV2__) && !defined(__PSL1GHT__)
7272
#include <cell/cell_fs.h>
7373
#define O_RDONLY CELL_FS_O_RDONLY
7474
#define O_WRONLY CELL_FS_O_WRONLY
@@ -151,7 +151,7 @@
151151
#include <fileXio.h>
152152
#endif
153153

154-
#if defined(__CELLOS_LV2__)
154+
#if defined (__CELLOS_LV2__) && !defined(__PSL1GHT__)
155155
#include <cell/cell_fs.h>
156156
#endif
157157

@@ -949,7 +949,7 @@ int retro_vfs_stat_impl(const char *path, int32_t *size)
949949

950950
return RETRO_VFS_STAT_IS_VALID | (is_dir ? RETRO_VFS_STAT_IS_DIRECTORY : 0) | (is_character_special ? RETRO_VFS_STAT_IS_CHARACTER_SPECIAL : 0);
951951

952-
#elif defined(__CELLOS_LV2__)
952+
#elif defined(__CELLOS_LV2__) && !defined(__PSL1GHT__)
953953
/* CellOS Lv2 */
954954
bool is_dir;
955955
bool is_character_special = false;
@@ -1095,7 +1095,7 @@ struct libretro_vfs_implementation_dir
10951095
#elif defined(PS2)
10961096
int directory;
10971097
iox_dirent_t entry;
1098-
#elif defined(__CELLOS_LV2__)
1098+
#elif defined(__CELLOS_LV2__) && !defined(__PSL1GHT__)
10991099
CellFsErrno error;
11001100
int directory;
11011101
CellFsDirent entry;
@@ -1114,7 +1114,7 @@ static bool dirent_check_error(libretro_vfs_implementation_dir *rdir)
11141114
return (rdir->directory == INVALID_HANDLE_VALUE);
11151115
#elif defined(VITA) || defined(PSP) || defined(PS2) || defined(ORBIS)
11161116
return (rdir->directory < 0);
1117-
#elif defined(__CELLOS_LV2__)
1117+
#elif defined(__CELLOS_LV2__) && !defined(__PSL1GHT__)
11181118
return (rdir->error != CELL_FS_SUCCEEDED);
11191119
#else
11201120
return !(rdir->directory);
@@ -1181,7 +1181,7 @@ libretro_vfs_implementation_dir *retro_vfs_opendir_impl(
11811181
#elif defined(_3DS)
11821182
rdir->directory = !string_is_empty(name) ? opendir(name) : NULL;
11831183
rdir->entry = NULL;
1184-
#elif defined(__CELLOS_LV2__)
1184+
#elif defined(__CELLOS_LV2__) && !defined(__PSL1GHT__)
11851185
rdir->error = cellFsOpendir(name, &rdir->directory);
11861186
#elif defined(ORBIS)
11871187
rdir->directory = orbisDopen(name);
@@ -1223,7 +1223,7 @@ bool retro_vfs_readdir_impl(libretro_vfs_implementation_dir *rdir)
12231223
int ret = ps2fileXioDread(rdir->directory, &record);
12241224
rdir->entry = record;
12251225
return ( ret > 0);
1226-
#elif defined(__CELLOS_LV2__)
1226+
#elif defined(__CELLOS_LV2__) && !defined(__PSL1GHT__)
12271227
uint64_t nread;
12281228
rdir->error = cellFsReaddir(rdir->directory, &rdir->entry, &nread);
12291229
return (nread != 0);
@@ -1257,7 +1257,7 @@ const char *retro_vfs_dirent_get_name_impl(libretro_vfs_implementation_dir *rdir
12571257
}
12581258
#endif
12591259
return (char*)rdir->entry.cFileName;
1260-
#elif defined(VITA) || defined(PSP) || defined(__CELLOS_LV2__) || defined(ORBIS)
1260+
#elif defined(VITA) || defined(PSP) || (defined(__CELLOS_LV2__) && !defined(__PSL1GHT__)) || defined(ORBIS)
12611261
return rdir->entry.d_name;
12621262
#elif defined(PS2)
12631263
return rdir->entry.name;
@@ -1283,7 +1283,7 @@ bool retro_vfs_dirent_is_dir_impl(libretro_vfs_implementation_dir *rdir)
12831283
#elif defined(PS2)
12841284
const iox_dirent_t *entry = (const iox_dirent_t*)&rdir->entry;
12851285
return FIO_S_ISDIR(entry->stat.mode);
1286-
#elif defined(__CELLOS_LV2__)
1286+
#elif defined(__CELLOS_LV2__) && !defined(__PSL1GHT__)
12871287
CellFsDirent *entry = (CellFsDirent*)&rdir->entry;
12881288
return (entry->d_type == CELL_FS_TYPE_DIRECTORY);
12891289
#elif defined(ORBIS)
@@ -1324,7 +1324,7 @@ int retro_vfs_closedir_impl(libretro_vfs_implementation_dir *rdir)
13241324
sceIoDclose(rdir->directory);
13251325
#elif defined(PS2)
13261326
ps2fileXioDclose(rdir->directory);
1327-
#elif defined(__CELLOS_LV2__)
1327+
#elif defined(__CELLOS_LV2__) && !defined(__PSL1GHT__)
13281328
rdir->error = cellFsClosedir(rdir->directory);
13291329
#elif defined(ORBIS)
13301330
orbisDclose(rdir->directory);

0 commit comments

Comments
 (0)