mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
PPSSPP ported to Blackberry10
Now builds on Playbook and Dev Alpha Make emulator more compatible with other OS (case sensitivity, defines, includes) Uses Android's code paths and backend
This commit is contained in:
parent
6f85f02e25
commit
41f5abab31
38 changed files with 243 additions and 62 deletions
|
@ -23,6 +23,8 @@
|
|||
#include "Common.h"
|
||||
#include "MemoryUtil.h"
|
||||
|
||||
#undef _SP
|
||||
|
||||
namespace ArmGen
|
||||
{
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
set(SRCS
|
||||
ABI.cpp
|
||||
Action.cpp
|
||||
CPUDetect.cpp
|
||||
ColorUtil.cpp
|
||||
ConsoleListener.cpp
|
||||
ExtendedTrace.cpp
|
||||
|
@ -11,23 +9,20 @@ set(SRCS
|
|||
Hash.cpp
|
||||
IniFile.cpp
|
||||
LogManager.cpp
|
||||
MathUtil.cpp
|
||||
MemArena.cpp
|
||||
MemoryUtil.cpp
|
||||
Misc.cpp
|
||||
MsgHandler.cpp
|
||||
StringUtil.cpp
|
||||
Thread.cpp
|
||||
Thunk.cpp
|
||||
Timer.cpp
|
||||
x64Analyzer.cpp
|
||||
x64Emitter.cpp
|
||||
x86Disasm.cpp
|
||||
)
|
||||
|
||||
# TODO
|
||||
if (ARM)
|
||||
set(SRCS ${SRCS} ArmEmitter.cpp ArmABI.cpp)
|
||||
else()
|
||||
set(SRCS ${SRCS} CPUDetect.cpp MathUtil.cpp Thunk.cpp x64Analyzer.cpp x64Emitter.cpp x86Disasm.cpp ABI.cpp)
|
||||
endif (ARM)
|
||||
|
||||
set(SRCS ${SRCS})
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef ANDROID
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#define _M_ARM32
|
||||
#endif
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ template<> struct CompileTimeAssert<true> {};
|
|||
#define ROUND_UP_POW2(x) (b32(x - 1) + 1)
|
||||
|
||||
#if defined __GNUC__ && !defined __SSSE3__
|
||||
#ifndef ANDROID
|
||||
#if !defined(ANDROID) && !defined(BLACKBERRY)
|
||||
#include <emmintrin.h>
|
||||
static __inline __m128i __attribute__((__always_inline__))
|
||||
_mm_shuffle_epi8(__m128i a, __m128i mask)
|
||||
|
@ -63,7 +63,7 @@ _mm_shuffle_epi8(__m128i a, __m128i mask)
|
|||
#ifdef GEKKO
|
||||
#define Crash()
|
||||
#else
|
||||
#ifndef ANDROID
|
||||
#if !defined(ANDROID) && !defined(BLACKBERRY)
|
||||
#define Crash() {asm ("int $3");}
|
||||
#else
|
||||
#define Crash() {kill( getpid(), SIGINT ) ; }
|
||||
|
|
|
@ -27,6 +27,38 @@
|
|||
|
||||
#include "Common.h"
|
||||
|
||||
#ifdef BLACKBERRY
|
||||
// QNX Does not have an implementation of vasprintf
|
||||
static inline int vasprintf(char **rResult, const char *aFormat, va_list aAp)
|
||||
{
|
||||
int rVal;
|
||||
char *result;
|
||||
va_list ap;
|
||||
|
||||
result = (char *) malloc(16);
|
||||
if (result == NULL) return -1;
|
||||
|
||||
va_copy(ap, aAp);
|
||||
rVal = vsnprintf(result, 16, aFormat, ap);
|
||||
va_end(ap);
|
||||
|
||||
if (rVal == -1) return rVal;
|
||||
else if (rVal >= 16)
|
||||
{
|
||||
free(result);
|
||||
result = (char *) malloc(rVal + 1);
|
||||
if (result == NULL) return -1;
|
||||
|
||||
va_copy(ap, aAp);
|
||||
rVal = vsnprintf(result, rVal + 1, aFormat, aAp);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
*rResult = result;
|
||||
return rVal;
|
||||
}
|
||||
#endif
|
||||
|
||||
std::string StringFromFormat(const char* format, ...);
|
||||
// Cheap!
|
||||
bool CharArrayFromFormatV(char* out, int outsize, const char* format, va_list args);
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#define INFINITE 0xffffffff
|
||||
#endif
|
||||
|
||||
#ifndef ANDROID
|
||||
#if !defined(ANDROID) && !defined(BLACKBERRY)
|
||||
#include <xmmintrin.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include <map>
|
||||
|
||||
#include "Common.h"
|
||||
#ifdef ANDROID
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#include "ArmEmitter.h"
|
||||
#else
|
||||
#include "x64Emitter.h"
|
||||
|
@ -38,7 +38,7 @@
|
|||
// we don't want to pollute the stack, so we store away regs somewhere global.
|
||||
// NOT THREAD SAFE. This may only be used from the CPU thread.
|
||||
// Any other thread using this stuff will be FATAL.
|
||||
#ifdef ANDROID
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
class ThunkManager : public ArmGen::ARMXCodeBlock
|
||||
#else
|
||||
class ThunkManager : public Gen::XCodeBlock
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// X86 disassembler - 95% ripped from some GNU source if I remember
|
||||
// correctly, probably GCC or some GCC tool
|
||||
|
||||
#ifdef ANDROID
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#error DO NOT COMPILE THIS INTO ANDROID BUILDS
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#ifdef ANDROID
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#error DO NOT COMPILE THIS INTO ANDROID BUILDS
|
||||
#endif
|
||||
|
||||
|
|
|
@ -12,14 +12,6 @@ set(SRCS
|
|||
MIPS/MIPSTables.cpp
|
||||
MIPS/MIPSVFPUUtils.cpp
|
||||
MIPS/JitCommon/JitCommon.cpp
|
||||
MIPS/x86/Asm.cpp
|
||||
MIPS/x86/CompALU.cpp
|
||||
MIPS/x86/CompBranch.cpp
|
||||
MIPS/x86/CompLoadStore.cpp
|
||||
MIPS/x86/CompFPU.cpp
|
||||
MIPS/x86/Jit.cpp
|
||||
MIPS/x86/JitCache.cpp
|
||||
MIPS/x86/RegCache.cpp
|
||||
ELF/ElfReader.cpp
|
||||
HLE/HLE.cpp
|
||||
HLE/HLETables.cpp
|
||||
|
@ -73,6 +65,28 @@ set(SRCS
|
|||
Core.cpp
|
||||
)
|
||||
|
||||
if(ARM)
|
||||
set(SRCS ${SRCS} MIPS/ARM/Asm.cpp
|
||||
MIPS/ARM/CompALU.cpp
|
||||
MIPS/ARM/CompBranch.cpp
|
||||
MIPS/ARM/CompLoadStore.cpp
|
||||
MIPS/ARM/CompFPU.cpp
|
||||
MIPS/ARM/Jit.cpp
|
||||
MIPS/ARM/JitCache.cpp
|
||||
MIPS/ARM/RegCache.cpp
|
||||
)
|
||||
else()
|
||||
set(SRCS ${SRCS} MIPS/x86/Asm.cpp
|
||||
MIPS/x86/CompALU.cpp
|
||||
MIPS/x86/CompBranch.cpp
|
||||
MIPS/x86/CompLoadStore.cpp
|
||||
MIPS/x86/CompFPU.cpp
|
||||
MIPS/x86/Jit.cpp
|
||||
MIPS/x86/JitCache.cpp
|
||||
MIPS/x86/RegCache.cpp
|
||||
)
|
||||
endif(ARM)
|
||||
|
||||
set(SRCS ${SRCS})
|
||||
|
||||
add_library(core STATIC ${SRCS})
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
// Official git repository and contact information can be found at
|
||||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#ifdef ANDROID
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#include <GLES2/gl2.h>
|
||||
#include <GLES2/gl2ext.h>
|
||||
#else
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#include "ABI.h"
|
||||
#include "ARMEmitter.h"
|
||||
#include <ArmEmitter.h>
|
||||
|
||||
#include "../../Memmap.h"
|
||||
#include "../../MemMap.h"
|
||||
|
||||
#include "../MIPS.h"
|
||||
#include "../../CoreTiming.h"
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#ifndef _JIT64ASM_H
|
||||
#define _JIT64ASM_H
|
||||
|
||||
#include "ArmEmitter.h"
|
||||
#include <ArmEmitter.h>
|
||||
#include "../MIPS.h"
|
||||
|
||||
// In PPSSPP, we don't use inline assembly. Instead, we generate all machine-near
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
#include "Jit.h"
|
||||
#include "RegCache.h"
|
||||
#include "ArmEmitter.h"
|
||||
#include <ArmEmitter.h>
|
||||
|
||||
using namespace MIPSAnalyst;
|
||||
#define _RS ((op>>21) & 0x1F)
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include "Jit.h"
|
||||
#include "RegCache.h"
|
||||
#include "JitCache.h"
|
||||
#include "ArmEmitter.h"
|
||||
#include <ArmEmitter.h>
|
||||
|
||||
#define _RS ((op>>21) & 0x1F)
|
||||
#define _RT ((op>>16) & 0x1F)
|
||||
|
|
|
@ -20,12 +20,12 @@
|
|||
#include "../../../Globals.h"
|
||||
#include "Asm.h"
|
||||
|
||||
#ifndef ANDROID
|
||||
#if !defined(ANDROID) && !defined(BLACKBERRY)
|
||||
#error DO NOT BUILD ARM JIT ON x86
|
||||
#endif
|
||||
|
||||
|
||||
#include "ArmEmitter.h"
|
||||
#include <ArmEmitter.h>
|
||||
#include "JitCache.h"
|
||||
#include "RegCache.h"
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#include "Asm.h"
|
||||
// #include "JitBase.h"
|
||||
|
||||
#include "ArmEmitter.h"
|
||||
#include <ArmEmitter.h>
|
||||
|
||||
#if defined USE_OPROFILE && USE_OPROFILE
|
||||
#include <opagent.h>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "../MIPSAnalyst.h"
|
||||
#include "ArmEmitter.h"
|
||||
#include <ArmEmitter.h>
|
||||
|
||||
using namespace ArmGen;
|
||||
enum FlushMode
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifdef ANDROID
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#include "../ARM/Jit.h"
|
||||
#else
|
||||
#include "../x86/Jit.h"
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include "../System.h"
|
||||
#include "../Debugger/Breakpoints.h"
|
||||
|
||||
#ifdef ANDROID
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#include "ARM/JitCache.h"
|
||||
#include "ARM/Jit.h"
|
||||
#else
|
||||
|
@ -108,7 +108,7 @@ void MIPSState::RunLoopUntil(u64 globalTicks)
|
|||
{
|
||||
// Don't subvert this by setting useJIT to true - other places also check the coreparameter
|
||||
bool useJIT = PSP_CoreParameter().cpuCore == CPU_JIT;
|
||||
#ifdef ANDROID
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
useJIT = false;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "MIPSTables.h"
|
||||
#include "MIPSDebugInterface.h"
|
||||
|
||||
#ifdef ANDROID
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#include "ARM/Jit.h"
|
||||
#else
|
||||
#include "x86/Jit.h"
|
||||
|
|
|
@ -55,7 +55,7 @@ void DelayBranchTo(u32 where)
|
|||
|
||||
int MIPS_SingleStep()
|
||||
{
|
||||
#ifdef ANDROID
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
u32 op = Memory::ReadUnchecked_U32(mipsr4k.pc);
|
||||
#else
|
||||
u32 op = Memory::Read_Opcode_JIT(mipsr4k.pc);
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include "MIPSIntVFPU.h"
|
||||
#include "MIPSCodeUtils.h"
|
||||
|
||||
#ifdef ANDROID
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#include "ARM/Jit.h"
|
||||
#else
|
||||
#include "x86/Jit.h"
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include "../../../Globals.h"
|
||||
#include "Asm.h"
|
||||
|
||||
#ifdef ANDROID
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#error DO NOT BUILD X86 JIT ON ANDROID
|
||||
#endif
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
#include "MIPS/MIPS.h"
|
||||
|
||||
#ifdef ANDROID
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#include "MIPS/ARM/Jit.h"
|
||||
#else
|
||||
#include "MIPS/x86/Jit.h"
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
// Official git repository and contact information can be found at
|
||||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#ifdef ANDROID
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#include <GLES2/gl2.h>
|
||||
#include <GLES2/gl2ext.h>
|
||||
#else
|
||||
|
@ -224,7 +224,7 @@ void SetBlendModePSP(u32 data)
|
|||
GL_FUNC_ADD,
|
||||
GL_FUNC_SUBTRACT,
|
||||
GL_FUNC_REVERSE_SUBTRACT,
|
||||
#ifdef ANDROID
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
GL_FUNC_ADD,
|
||||
GL_FUNC_ADD,
|
||||
#else
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
// Official git repository and contact information can be found at
|
||||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#ifdef ANDROID
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#define GLSL_ES_1_0
|
||||
#else
|
||||
#define GLSL_1_3
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
// Official git repository and contact information can be found at
|
||||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#ifdef ANDROID
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#include <GLES2/gl2.h>
|
||||
#include <GLES2/gl2ext.h>
|
||||
#else
|
||||
|
@ -72,7 +72,7 @@ const char basic_vs[] =
|
|||
|
||||
void DisplayDrawer_Init()
|
||||
{
|
||||
#ifndef ANDROID
|
||||
#if !defined(ANDROID) && !defined(BLACKBERRY)
|
||||
// Old OpenGL stuff that probably has no effect
|
||||
|
||||
glPolygonMode (GL_FRONT_AND_BACK, GL_FILL); //GL_FILL);
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
// Official git repository and contact information can be found at
|
||||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#ifdef ANDROID
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#include <GLES2/gl2.h>
|
||||
#include <GLES2/gl2ext.h>
|
||||
#else
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
// Official git repository and contact information can be found at
|
||||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#ifdef ANDROID
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#include <GLES2/gl2.h>
|
||||
#include <GLES2/gl2ext.h>
|
||||
#else
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
// Official git repository and contact information can be found at
|
||||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#ifdef ANDROID
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#include <GLES2/gl2.h>
|
||||
#include <GLES2/gl2ext.h>
|
||||
#else
|
||||
|
@ -227,7 +227,7 @@ void TransformAndDrawPrim(void *verts, void *inds, int prim, int vertexCount, Li
|
|||
// TODO: Split up into multiple draw calls for Android where you can't guarantee support for more than 0x10000 verts.
|
||||
int i = 0;
|
||||
|
||||
#ifdef ANDROID
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
if (vertexCount > 0x10000/3)
|
||||
vertexCount = 0x10000/3;
|
||||
#endif
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
// Official git repository and contact information can be found at
|
||||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#ifdef ANDROID
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#include <GLES2/gl2.h>
|
||||
#include <GLES2/gl2ext.h>
|
||||
#else
|
||||
|
|
|
@ -53,7 +53,7 @@ void WriteLight(char *p, int l) {
|
|||
char *GenerateVertexShader()
|
||||
{
|
||||
char *p = buffer;
|
||||
#if defined(ANDROID)
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
WRITE("precision highp float;");
|
||||
#elif !defined(FORCE_OPENGL_2_0)
|
||||
WRITE("#version 130");
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
// Official git repository and contact information can be found at
|
||||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#ifdef ANDROID
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#include <GLES2/gl2.h>
|
||||
#include <GLES2/gl2ext.h>
|
||||
#else
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <cstdio>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
|
|
|
@ -12,6 +12,11 @@ if (APPLE)
|
|||
include_directories(/usr/X11/include)
|
||||
endif()
|
||||
|
||||
# TODO: Rely on compiler define instead. __BLACKBERRY__ ?
|
||||
if (BLACKBERRY)
|
||||
add_definitions(-DBLACKBERRY)
|
||||
endif()
|
||||
|
||||
|
||||
include(FindOpenGL)
|
||||
include(FindSDL)
|
||||
|
@ -23,7 +28,9 @@ add_definitions(-DSDL)
|
|||
add_definitions(-Wno-multichar)
|
||||
add_definitions(-fno-strict-aliasing)
|
||||
add_definitions(-DUSE_PROFILER)
|
||||
add_definitions(-D_DEBUG)
|
||||
if (NOT BLACKBERRY)
|
||||
add_definitions(-D_DEBUG)
|
||||
endif()
|
||||
|
||||
if (UNIX)
|
||||
if (NOT APPLE) # can't build the SDL .m file with -std=gnu++0x
|
||||
|
@ -65,7 +72,15 @@ add_subdirectory(../Common Common)
|
|||
add_subdirectory(../GPU GPU)
|
||||
add_subdirectory(../Core Core)
|
||||
|
||||
set(LIBS ${LIBS} ${SDL_LIBRARY} ${OPENGL_LIBRARIES} GLEW file lin ${PNG_LIBRARY} z gfx gfx_es2 etcdec image stb_image mixer net ui profiler timeutil file zip base lin vjson stb_vorbis sha1 jsonwriter common core gpu)
|
||||
set(LIBS ${LIBS} ${SDL_LIBRARY} ${OPENGL_LIBRARIES} file lin ${PNG_LIBRARY} z gfx gfx_es2 etcdec image stb_image mixer net ui profiler timeutil file zip base lin vjson stb_vorbis sha1 jsonwriter common core gpu)
|
||||
|
||||
# TODO: Blackberry specific libs (eg. TCO)
|
||||
if(BLACKBERRY)
|
||||
set(LIBS ${LIBS} socket)
|
||||
else()
|
||||
set(LIBS ${LIBS} GLEW)
|
||||
endif()
|
||||
|
||||
set(FILES
|
||||
../android/jni/NativeApp.cpp
|
||||
../android/jni/EmuScreen.cpp
|
||||
|
@ -76,9 +91,9 @@ set(FILES
|
|||
../native/base/PCMain.cpp
|
||||
)
|
||||
|
||||
if (APPLE)
|
||||
SET(FILES ${FILES} SDLMain.m)
|
||||
endif (APPLE)
|
||||
if(APPLE)
|
||||
set(FILES ${FILES} SDLMain.m)
|
||||
endif(APPLE)
|
||||
|
||||
add_executable(ppsspp ${FILES})
|
||||
|
||||
|
|
122
SDL/build_for_playbook.sh
Normal file
122
SDL/build_for_playbook.sh
Normal file
|
@ -0,0 +1,122 @@
|
|||
#!/bin/bash
|
||||
|
||||
BUILD_TYPE=Release
|
||||
if [ -z "$PPSSPP_ROOT" ]; then
|
||||
PPSSPP_ROOT=${PWD}/..
|
||||
fi
|
||||
if [ -z "$PROJECT_ROOT" ]; then
|
||||
PROJECT_ROOT=${PPSSPP_ROOT}/..
|
||||
fi
|
||||
PKG_CONFIG_PATH=${PROJECT_ROOT}/install/lib/pkgconfig
|
||||
PKG_CONFIG_LIBDIR=${PROJECT_ROOT}/install/lib/pkgconfig
|
||||
|
||||
SDL_PROJECT=${PROJECT_ROOT}/SDL
|
||||
SDLIMAGE_PROJECT=${PROJECT_ROOT}/SDL_image
|
||||
SDLMIXER_PROJECT=${PROJECT_ROOT}/SDL_mixer
|
||||
SDLNET_PROJECT=${PROJECT_ROOT}/SDL_net
|
||||
SDLTTF_PROJECT=${PROJECT_ROOT}/SDL_ttf
|
||||
|
||||
while true; do
|
||||
case "$1" in
|
||||
-h | --help )
|
||||
echo "Build script for BlackBerry PlayBook"
|
||||
echo "For normal usage, please use the NDK to build."
|
||||
echo
|
||||
echo "Options: "
|
||||
echo " -d, --debug Create a debug build. (default is release)"
|
||||
echo " -h, --help Show this help message."
|
||||
echo " -r, --root PATH Specify the root directory of PPSSPP. (default is PWD parent)"
|
||||
echo " -p, --project-root PATH Specify the root directory containing all projects. (default is root dirs parent)"
|
||||
echo " If specific projects are in different directories, you can specify them below."
|
||||
echo " --pkg-config PATH Specify the pkgconfig directory. (default is PPSSPP_ROOT/../install/lib/pkgconfig)"
|
||||
echo
|
||||
echo "Dependency Paths (defaults are under project root): "
|
||||
echo " --sdl PATH SDL 1.2 project directory (default is SDL)"
|
||||
echo " --tco PATH TouchControlOverlay project directory (default is TouchControlOverlay)"
|
||||
echo " --sdl_image PATH SDL_image project directory (default is SDL_image)"
|
||||
echo " --sdl_mixer PATH SDL_mixer project directory (default is SDL_mixer)"
|
||||
echo " --sdl_net PATH SDL_net project directory (default is SDL_net)"
|
||||
echo " --sdl_ttf PATH SDL_ttf project directory (default is SDL_ttf)"
|
||||
echo " --ogg PATH ogg project directory (default is ogg)"
|
||||
echo " --vorbis PATH vorbis project directory (default is vorbis)"
|
||||
exit 0
|
||||
;;
|
||||
-d | --debug ) BUILD_TYPE=Debug; shift ;;
|
||||
-r | --root ) PPSSPP_ROOT="$2"; shift 2 ;;
|
||||
-p | --project-root ) PROJECT_ROOT="$2"; shift 2 ;;
|
||||
--pkg-config ) PKG_CONFIG_PATH="$2"; PKG_CONFIG_LIBDIR="$2"; shift 2 ;;
|
||||
--sdl ) SDL_PROJECT="$2"; shift 2 ;;
|
||||
--sdl_image ) SDLIMAGE_PROJECT="$2"; shift 2 ;;
|
||||
--sdl_mixer ) SDLMIXER_PROJECT="$2"; shift 2 ;;
|
||||
--sdl_net ) SDLNET_PROJECT="$2"; shift 2 ;;
|
||||
--sdl_ttf ) SDLTTF_PROJECT="$2"; shift 2 ;;
|
||||
--tco ) TCO_PROJECT="$2"; shift 2 ;;
|
||||
--ogg ) OGG_PROJECT="$2"; shift 2 ;;
|
||||
--vorbis ) VORBIS_PROJECT="$2"; shift 2 ;;
|
||||
-- ) shift; break ;;
|
||||
* ) break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "$SDL_PROJECT" ]; then
|
||||
SDL_PROJECT="$PROJECT_ROOT/SDL"
|
||||
fi
|
||||
if [ -z "$SDLIMAGE_PROJECT" ]; then
|
||||
SDLIMAGE_PROJECT="$PROJECT_ROOT/SDL_image"
|
||||
fi
|
||||
if [ -z "$SDLMIXER_PROJECT" ]; then
|
||||
SDLMIXER_PROJECT="$PROJECT_ROOT/SDL_mixer"
|
||||
fi
|
||||
if [ -z "$SDLNET_PROJECT" ]; then
|
||||
SDLNET_PROJECT="$PROJECT_ROOT/SDL_net"
|
||||
fi
|
||||
if [ -z "$SDLTTF_PROJECT" ]; then
|
||||
SDLTTF_PROJECT="$PROJECT_ROOT/SDL_ttf"
|
||||
fi
|
||||
if [ -z "$TCO_PROJECT" ]; then
|
||||
TCO_PROJECT="$PROJECT_ROOT/TouchControlOverlay"
|
||||
fi
|
||||
if [ -z "$OGG_PROJECT" ]; then
|
||||
OGG_PROJECT="$PROJECT_ROOT/ogg"
|
||||
fi
|
||||
if [ -z "$VORBIS_PROJECT" ]; then
|
||||
VORBIS_PROJECT="$PROJECT_ROOT/vorbis"
|
||||
fi
|
||||
|
||||
export PKG_CONFIG_PATH
|
||||
export PKG_CONFIG_LIBDIR
|
||||
|
||||
echo "Build type: ${BUILD_TYPE}"
|
||||
|
||||
cmake \
|
||||
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
|
||||
-DCMAKE_SYSTEM_NAME=QNX \
|
||||
-DCMAKE_C_COMPILER="${QNX_HOST}/usr/bin/ntoarmv7-gcc" \
|
||||
-DCMAKE_CXX_COMPILER="${QNX_HOST}/usr/bin/ntoarmv7-g++" \
|
||||
-DTHREADS_PTHREAD_ARG="" \
|
||||
-DLIBINTL_INCLUDE_DIR="${QNX_TARGET}/usr/include" \
|
||||
-DLIBINTL_LIB_FOUND=TRUE \
|
||||
-DLIBINTL_LIBRARIES="${QNX_TARGET}/armle-v7/usr/lib/libintl.so" \
|
||||
-DLIBINTL_LIBC_HAS_DGETTEXT=FALSE \
|
||||
-DSDL_INCLUDE_DIR="${SDL_PROJECT}/include" \
|
||||
-DSDL_LIBRARY="${SDL_PROJECT}/Device-${BUILD_TYPE}/libSDL12.so;${TCO_PROJECT}/Device-${BUILD_TYPE}/libTouchControlOverlay.so" \
|
||||
-DSDL_FOUND=ON \
|
||||
-DSDLIMAGE_INCLUDE_DIR="${SDLIMAGE_PROJECT}" \
|
||||
-DSDLIMAGE_LIBRARY="${SDLIMAGE_PROJECT}/Device-${BUILD_TYPE}/libSDL_image.so" \
|
||||
-DSDLIMAGE_FOUND=ON \
|
||||
-DSDLMIXER_INCLUDE_DIR="${SDLMIXER_PROJECT}" \
|
||||
-DSDLMIXER_LIBRARY="${SDLMIXER_PROJECT}/Device-${BUILD_TYPE}/libSDL_mixer.so;${OGG_PROJECT}/Device-${BUILD_TYPE}/libogg.so;${VORBIS_PROJECT}/Device-${BUILD_TYPE}/libvorbis.so" \
|
||||
-DSDLMIXER_FOUND=ON \
|
||||
-DSDLNET_INCLUDE_DIR="${SDLNET_PROJECT}" \
|
||||
-DSDLNET_LIBRARY="${SDLNET_PROJECT}/Device-${BUILD_TYPE}/libSDL_net.so;${QNX_TARGET}/armle-v7/lib/libsocket.so" \
|
||||
-DSDLNET_FOUND=ON \
|
||||
-DSDLTTF_INCLUDE_DIR="${SDLTTF_PROJECT}" \
|
||||
-DSDLTTF_LIBRARY="${SDLTTF_PROJECT}/Device-${BUILD_TYPE}/libSDL_ttf.so" \
|
||||
-DSDLTTF_FOUND=ON \
|
||||
-DPNG_LIBRARY="${QNX_TARGET}/armle-v7/usr/lib/libpng.so" \
|
||||
-DPNG_PNG_INCLUDE_DIR="${QNX_TARGET}/usr/include" \
|
||||
-DBLACKBERRY=10.0.9 \
|
||||
-DARM=7 \
|
||||
${PWD}
|
||||
|
||||
make -j4
|
|
@ -1,6 +1,6 @@
|
|||
// NOTE: Apologies for the quality of this code, this is really from pre-opensource Dolphin - that is, 2003.
|
||||
|
||||
#ifdef ANDROID
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#include <GLES2/gl2.h>
|
||||
#include <GLES2/gl2ext.h>
|
||||
#else
|
||||
|
|
Loading…
Add table
Reference in a new issue