AR = arm-vita-eabi-ar$(EXE_EXT)
CFLAGS += -DVITA
CFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -marm
+ CFLAGS += -I$(VITASDK)/include -Ifrontend/vita
+ CFLAGS += -DNO_SOCKET -DNO_OS -DNO_DYLIB
ASFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon
+
+# CFLAGS += -U__ARM_NEON__
HAVE_NEON = 1
BUILTIN_GPU = neon
+# USE_DYNAREC = 1
+# DRC_CACHE_BASE = 0
+
+ ARCH = arm
+ STATIC_LINKING = 1
+
# CTR(3DS)
else ifeq ($(platform), ctr)
TARGET := $(TARGET_NAME)_libretro_ctr.a
CC = $(DEVKITARM)/bin/arm-none-eabi-gcc$(EXE_EXT)
CXX = $(DEVKITARM)/bin/arm-none-eabi-g++$(EXE_EXT)
AR = $(DEVKITARM)/bin/arm-none-eabi-ar$(EXE_EXT)
- CFLAGS += -DARM11 -D_3DS -DNO_OS
+ CFLAGS += -DARM11 -D_3DS -DNO_OS -DNO_DYLIB
CFLAGS += -march=armv6k -mtune=mpcore -mfloat-abi=hard -marm -mfpu=vfp
CFLAGS += -Wall -mword-relocations
CFLAGS += -fomit-frame-pointer -ffast-math
# QNX
else ifeq ($(platform), qnx)
TARGET := $(TARGET_NAME)_libretro_qnx.so
+ fpic := -fPIC
CC = qcc -Vgcc_ntoarmv7le
CC_AS = $(CC)
HAVE_NEON = 1
else ifneq (,$(findstring armv,$(platform)))
TARGET := $(TARGET_NAME)_libretro.so
SHARED := -shared -Wl,--no-undefined
+ fpic := -fPIC
DRC_CACHE_BASE = 0
ifneq (,$(findstring cortexa8,$(platform)))
CFLAGS += -marm -mcpu=cortex-a8
ASFLAGS += -mfloat-abi=hard
endif
ARCH = arm
- USE_DYNAREC = 1
+ USE_DYNAREC = 1
# Windows
else
MMAP_WIN32=1
endif
-CFLAGS += -fPIC
+CFLAGS += $(fpic)
ifeq ($(platform),win)
MAIN_LDLIBS += -lws2_32
else ifneq ($(platform),qnx)
return true;
}
-#if 1
+#ifndef VITA
#include <sys/types.h>
#include <dirent.h>
exit(1);
}
-#if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200112L)
+#if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200112L) && !defined(VITA)
posix_memalign(&vout_buf, 16, VOUT_MAX_WIDTH * VOUT_MAX_HEIGHT * 2);
#else
vout_buf = malloc(VOUT_MAX_WIDTH * VOUT_MAX_HEIGHT * 2);
free(vout_buf);
vout_buf = NULL;
}
+
+#ifdef VITA
+#include <psp2/kernel/threadmgr.h>
+int usleep (unsigned long us)
+{
+ sceKernelDelayThread(us);
+}
+#endif
#include <unistd.h>
#include <signal.h>
#include <time.h>
-#if !defined(_WIN32) && !defined(_3DS)
+#if !defined(_WIN32) && !defined(NO_DYLIB)
#include <dlfcn.h>
#endif
return (void *)(long)(PLUGIN_DL_BASE + builtin_plugin_ids[i]);
}
-#if !defined(_WIN32) && !defined(_3DS)
+#if !defined(_WIN32) && !defined(NO_DYLIB)
ret = dlopen(lib, RTLD_NOW);
if (ret == NULL)
SysMessage("dlopen: %s", dlerror());
if (PLUGIN_DL_BASE <= plugid && plugid < PLUGIN_DL_BASE + ARRAY_SIZE(builtin_plugins))
return plugin_link(plugid - PLUGIN_DL_BASE, sym);
-#if !defined(_WIN32) && !defined(_3DS)
+#if !defined(_WIN32) && !defined(NO_DYLIB)
return dlsym(lib, sym);
#else
return NULL;
}
const char *SysLibError() {
-#if defined(_3DS)
+#if defined(NO_DYLIB)
return NULL;
#elif !defined(_WIN32)
return dlerror();
if (PLUGIN_DL_BASE <= plugid && plugid < PLUGIN_DL_BASE + ARRAY_SIZE(builtin_plugins))
return;
-#if !defined(_WIN32) && !defined(_3DS)
+#if !defined(_WIN32) && !defined(NO_DYLIB)
dlclose(lib);
#endif
}
#endif
#include "arm_features.h"
-#if !BASE_ADDR_FIXED
+#ifdef VITA
+char* translation_cache = 0;
+#elif !BASE_ADDR_FIXED
char translation_cache[1 << TARGET_SIZE_2] __attribute__((aligned(4096)));
#endif
// "round" address helpful for debug
#define BASE_ADDR 0x1000000
#else
+#if defined(VITA)
+extern char* translation_cache;
+#else
extern char translation_cache[1 << TARGET_SIZE_2];
+#endif
#define BASE_ADDR (u_int)translation_cache
#endif
#ifdef DRC_DISABLE
unsigned int address;
int pending_exception, stop;
-unsigned int next_interupt;
+u32 next_interupt;
int new_dynarec_did_compile;
int cycle_multiplier;
int new_dynarec_hacks;
* along with this program; if not, see <http://www.gnu.org/licenses>.
*/
+#ifdef NO_SOCKET
+
+int StartServer() { return 0;}
+void StopServer() {}
+void GetClient() {}
+void CloseClient() {}
+int HasClient() { return 0;}
+int ReadSocket(char * buffer, int len) { return 0;}
+int RawReadSocket(char * buffer, int len) { return 0;}
+void WriteSocket(char * buffer, int len) {}
+
+void SetsBlock() {}
+void SetsNonblock() {}
+
+#else // NO_SOCKET
+
#ifdef _WIN32
#include <winsock2.h>
#endif
fcntl(server_socket, F_SETFL, flags | O_NONBLOCK);
#endif
}
+#endif // NO_SOCKET
#include <zlib.h>
#ifndef _WIN32
#define CALLBACK
-#ifndef _3DS
+#ifndef NO_DYLIB
#include <dlfcn.h>
#endif
#else
return -1;
}
}
-#if !defined(_WIN32) && !defined(_3DS)
+#if !defined(_WIN32) && !defined(NO_DYLIB)
if (pBZ2_bzBuffToBuffDecompress == NULL) {
void *h = dlopen("/usr/lib/libbz2.so.1", RTLD_LAZY);
if (h == NULL)