Skip to content

Commit 2aab968

Browse files
committed
Update
1 parent 69c83f8 commit 2aab968

File tree

11 files changed

+43
-312
lines changed

11 files changed

+43
-312
lines changed

dynamic/dylib.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,20 @@
2525
#include <dynamic/dylib.h>
2626
#include <encodings/utf.h>
2727

28+
#if defined(ORBIS)
29+
#include <orbis/libkernel.h>
30+
#endif
31+
2832
#ifdef NEED_DYNAMIC
2933

3034
#ifdef _WIN32
3135
#include <compat/posix_string.h>
3236
#include <windows.h>
3337
#else
38+
#if !defined(ORBIS)
3439
#include <dlfcn.h>
3540
#endif
41+
#endif
3642

3743
/* Assume W-functions do not work below Win2K and Xbox platforms */
3844
#if defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0500 || defined(_XBOX)
@@ -118,6 +124,9 @@ dylib_t dylib_load(const char *path)
118124
return NULL;
119125
}
120126
last_dyn_error[0] = 0;
127+
#elif defined(ORBIS)
128+
int res;
129+
dylib_t lib = (dylib_t)sceKernelLoadStartModule(path, 0, NULL, 0, NULL, &res);
121130
#else
122131
dylib_t lib = dlopen(path, RTLD_LAZY | RTLD_LOCAL);
123132
#endif
@@ -161,6 +170,14 @@ function_t dylib_proc(dylib_t lib, const char *proc)
161170
return NULL;
162171
}
163172
last_dyn_error[0] = 0;
173+
#elif defined(ORBIS)
174+
void *ptr_sym = NULL;
175+
sym = NULL;
176+
177+
if (lib) {
178+
sceKernelDlsym((SceKernelModule)lib, proc, &ptr_sym);
179+
memcpy(&sym, &ptr_sym, sizeof(void*));
180+
}
164181
#else
165182
void *ptr_sym = NULL;
166183

@@ -196,6 +213,9 @@ void dylib_close(dylib_t lib)
196213
if (!FreeLibrary((HMODULE)lib))
197214
set_dl_error();
198215
last_dyn_error[0] = 0;
216+
#elif defined(ORBIS)
217+
int res;
218+
sceKernelStopUnloadModule((SceKernelModule)lib, 0, NULL, 0, NULL, &res);
199219
#else
200220
#ifndef NO_DLCLOSE
201221
dlclose(lib);

features/features_cpu.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@
7575
#include <psp2/rtc.h>
7676
#endif
7777

78+
#if defined(ORBIS)
79+
#include <orbis/libkernel.h>
80+
#endif
81+
7882
#if defined(PS2)
7983
#include <ps2sdkapi.h>
8084
#endif
@@ -195,6 +199,8 @@ retro_perf_tick_t cpu_features_get_perf_counter(void)
195199
__asm__ volatile( "mrs %0, cntvct_el0" : "=r"(time_ticks) );
196200
#elif defined(PSP) || defined(VITA)
197201
time_ticks = sceKernelGetSystemTimeWide();
202+
#elif defined(ORBIS)
203+
sceRtcGetCurrentTick((SceRtcTick*)&time_ticks);
198204
#elif defined(PS2)
199205
time_ticks = ps2_clock();
200206
#elif defined(_3DS)
@@ -255,6 +261,8 @@ retro_time_t cpu_features_get_time_usec(void)
255261
return sceKernelGetSystemTimeWide();
256262
#elif defined(DJGPP)
257263
return uclock() * 1000000LL / UCLOCKS_PER_SEC;
264+
#elif defined(ORBIS)
265+
return sceKernelGetProcessTime();
258266
#else
259267
#error "Your platform does not have a timer function implemented in cpu_features_get_time_usec(). Cannot continue."
260268
#endif

file/config_file.c

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@
2626
#include <ctype.h>
2727
#include <errno.h>
2828

29-
#ifdef ORBIS
30-
#include <sys/fcntl.h>
31-
#include <orbisFile.h>
32-
#endif
3329
#include <retro_miscellaneous.h>
3430
#include <compat/strl.h>
3531
#include <compat/posix_string.h>
@@ -1338,13 +1334,6 @@ bool config_file_write(config_file_t *conf, const char *path, bool sort)
13381334

13391335
if (!string_is_empty(path))
13401336
{
1341-
#ifdef ORBIS
1342-
int fd = orbisOpen(path,O_RDWR|O_CREAT,0644);
1343-
if (fd < 0)
1344-
return false;
1345-
config_file_dump_orbis(conf,fd);
1346-
orbisClose(fd);
1347-
#else
13481337
void* buf = NULL;
13491338
FILE *file = (FILE*)fopen_utf8(path, "wb");
13501339
if (!file)
@@ -1359,7 +1348,6 @@ bool config_file_write(config_file_t *conf, const char *path, bool sort)
13591348
fclose(file);
13601349
if (buf)
13611350
free(buf);
1362-
#endif
13631351

13641352
/* Only update modified flag if config file
13651353
* is actually written to disk */
@@ -1371,53 +1359,6 @@ bool config_file_write(config_file_t *conf, const char *path, bool sort)
13711359
return true;
13721360
}
13731361

1374-
#ifdef ORBIS
1375-
void config_file_dump_orbis(config_file_t *conf, int fd)
1376-
{
1377-
struct config_entry_list *list = NULL;
1378-
struct config_include_list *includes = conf->includes;
1379-
1380-
if (conf->reference)
1381-
{
1382-
pathname_make_slashes_portable(conf->reference);
1383-
fprintf(file, "#reference \"%s\"\n", conf->reference);
1384-
}
1385-
1386-
1387-
list = config_file_merge_sort_linked_list(
1388-
(struct config_entry_list*)conf->entries,
1389-
config_file_sort_compare_func);
1390-
conf->entries = list;
1391-
1392-
while (list)
1393-
{
1394-
if (!list->readonly && list->key)
1395-
{
1396-
char newlist[256];
1397-
snprintf(newlist, sizeof(newlist),
1398-
"%s = %s\n", list->key, list->value);
1399-
orbisWrite(fd, newlist, strlen(newlist));
1400-
}
1401-
list = list->next;
1402-
}
1403-
1404-
/* Config files are read from the top down - if
1405-
* duplicate entries are found then the topmost
1406-
* one in the list takes precedence. This means
1407-
* '#include' directives must go *after* individual
1408-
* config entries, otherwise they will override
1409-
* any custom-set values */
1410-
while (includes)
1411-
{
1412-
char cad[256];
1413-
snprintf(cad, sizeof(cad),
1414-
"#include %s\n", includes->path);
1415-
orbisWrite(fd, cad, strlen(cad));
1416-
includes = includes->next;
1417-
}
1418-
}
1419-
#endif
1420-
14211362
void config_file_dump(config_file_t *conf, FILE *file, bool sort)
14221363
{
14231364
struct config_entry_list *list = NULL;

file/nbio/nbio_intf.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@
3232
extern nbio_intf_t nbio_linux;
3333
extern nbio_intf_t nbio_mmap_unix;
3434
extern nbio_intf_t nbio_mmap_win32;
35-
#if defined(ORBIS)
36-
extern nbio_intf_t nbio_orbis;
37-
#endif
3835
extern nbio_intf_t nbio_stdio;
3936

4037
#ifndef _XBOX
@@ -61,8 +58,6 @@ static nbio_intf_t *internal_nbio = &nbio_linux;
6158
static nbio_intf_t *internal_nbio = &nbio_mmap_unix;
6259
#elif defined(HAVE_MMAP_WIN32)
6360
static nbio_intf_t *internal_nbio = &nbio_mmap_win32;
64-
#elif defined(ORBIS)
65-
static nbio_intf_t *internal_nbio = &nbio_orbis;
6661
#else
6762
static nbio_intf_t *internal_nbio = &nbio_stdio;
6863
#endif

include/file/config_file.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,6 @@ bool config_file_write(config_file_t *conf, const char *path, bool val);
214214
* Does not close the file. */
215215
void config_file_dump(config_file_t *conf, FILE *file, bool val);
216216

217-
#ifdef ORBIS
218-
void config_file_dump_orbis(config_file_t *conf, int fd);
219-
#endif
220-
221217
bool config_file_exists(const char *path);
222218

223219
RETRO_END_DECLS

include/net/net_compat.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@
5656

5757
#include <network.h>
5858

59+
#define setsockopt net_setsockopt
60+
5961
#elif defined(VITA)
6062

6163
#include <psp2/net/net.h>

include/retro_miscellaneous.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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(_XBOX1) || defined(_3DS) || defined(PSP) || defined(PS2) || defined(GEKKO)|| defined(WIIU) || defined(ORBIS) || defined(__PSL1GHT__) || defined(__PS3__)
78+
#if defined(_XBOX1) || defined(_3DS) || defined(PSP) || defined(PS2) || defined(GEKKO)|| defined(WIIU) || defined(__PSL1GHT__) || defined(__PS3__)
7979
#define PATH_MAX_LENGTH 512
8080
#else
8181
#define PATH_MAX_LENGTH 4096

net/net_compat.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ void network_deinit(void)
422422

423423
uint16_t inet_htons(uint16_t hostshort)
424424
{
425-
#if defined(VITA) || defined(__ORBIS__)
425+
#if defined(VITA)
426426
return sceNetHtons(hostshort);
427427
#else
428428
return htons(hostshort);
@@ -432,7 +432,7 @@ uint16_t inet_htons(uint16_t hostshort)
432432

433433
int inet_ptrton(int af, const char *src, void *dst)
434434
{
435-
#if defined(VITA) || defined(__ORBIS__)
435+
#if defined(VITA)
436436
return sceNetInetPton(af, src, dst);
437437
#elif defined(GEKKO) || defined(_WIN32)
438438
/* TODO/FIXME - should use InetPton on Vista and later */
@@ -597,7 +597,7 @@ static const char *isockaddr_ntop(int af,
597597

598598
const char *inet_ntop_compat(int af, const void *src, char *dst, socklen_t cnt)
599599
{
600-
#if defined(VITA) || defined(__ORBIS__)
600+
#if defined(VITA)
601601
return sceNetInetNtop(af,src,dst,cnt);
602602
#elif defined(WIIU)
603603
return inet_ntop(af, src, dst, cnt);

test/string/test_stdstring.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,9 @@ START_TEST (test_word_wrap)
184184
"adipiscing elit. Nam nec enim quis orci\n"
185185
"euismod efficitur at nec arcu. Vivamus\n"
186186
"imperdiet est feugiat massa rhoncus\n"
187-
"porttitor at vitae ante. Nunc a orci vel\n"
188-
"ipsum tempor posuere sed a lacus. Ut\n"
189-
"erat odio, ultrices vitae iaculis\n"
187+
"porttitor at vitae ante. Nunc a orci\n"
188+
"vel ipsum tempor posuere sed a lacus.\n"
189+
"Ut erat odio, ultrices vitae iaculis\n"
190190
"fringilla, iaculis ut eros.\n"
191191
"Sed facilisis viverra lectus et\n"
192192
"ullamcorper. "

0 commit comments

Comments
 (0)