Merge branch 'master' of github.com:hrydgard/ppsspp

This commit is contained in:
Henrik Rydgard 2012-11-05 14:36:39 +01:00
commit b96859828f
38 changed files with 243 additions and 62 deletions

View File

@ -23,6 +23,8 @@
#include "Common.h" #include "Common.h"
#include "MemoryUtil.h" #include "MemoryUtil.h"
#undef _SP
namespace ArmGen namespace ArmGen
{ {

View File

@ -1,7 +1,5 @@
set(SRCS set(SRCS
ABI.cpp
Action.cpp Action.cpp
CPUDetect.cpp
ColorUtil.cpp ColorUtil.cpp
ConsoleListener.cpp ConsoleListener.cpp
ExtendedTrace.cpp ExtendedTrace.cpp
@ -11,23 +9,20 @@ set(SRCS
Hash.cpp Hash.cpp
IniFile.cpp IniFile.cpp
LogManager.cpp LogManager.cpp
MathUtil.cpp
MemArena.cpp MemArena.cpp
MemoryUtil.cpp MemoryUtil.cpp
Misc.cpp Misc.cpp
MsgHandler.cpp MsgHandler.cpp
StringUtil.cpp StringUtil.cpp
Thread.cpp Thread.cpp
Thunk.cpp
Timer.cpp Timer.cpp
x64Analyzer.cpp
x64Emitter.cpp
x86Disasm.cpp
) )
# TODO # TODO
if (ARM) if (ARM)
set(SRCS ${SRCS} ArmEmitter.cpp ArmABI.cpp) 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) endif (ARM)
set(SRCS ${SRCS}) set(SRCS ${SRCS})
@ -35,6 +30,6 @@ set(SRCS ${SRCS})
add_library(common STATIC ${SRCS}) add_library(common STATIC ${SRCS})
if(UNIX) if(UNIX)
add_definitions(-fPIC) add_definitions(-fPIC)
endif(UNIX) endif(UNIX)

View File

@ -25,7 +25,7 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#ifdef ANDROID #if defined(ANDROID) || defined(BLACKBERRY)
#define _M_ARM32 #define _M_ARM32
#endif #endif

View File

@ -36,7 +36,7 @@ template<> struct CompileTimeAssert<true> {};
#define ROUND_UP_POW2(x) (b32(x - 1) + 1) #define ROUND_UP_POW2(x) (b32(x - 1) + 1)
#if defined __GNUC__ && !defined __SSSE3__ #if defined __GNUC__ && !defined __SSSE3__
#ifndef ANDROID #if !defined(ANDROID) && !defined(BLACKBERRY)
#include <emmintrin.h> #include <emmintrin.h>
static __inline __m128i __attribute__((__always_inline__)) static __inline __m128i __attribute__((__always_inline__))
_mm_shuffle_epi8(__m128i a, __m128i mask) _mm_shuffle_epi8(__m128i a, __m128i mask)
@ -63,7 +63,7 @@ _mm_shuffle_epi8(__m128i a, __m128i mask)
#ifdef GEKKO #ifdef GEKKO
#define Crash() #define Crash()
#else #else
#ifndef ANDROID #if !defined(ANDROID) && !defined(BLACKBERRY)
#define Crash() {asm ("int $3");} #define Crash() {asm ("int $3");}
#else #else
#define Crash() {kill( getpid(), SIGINT ) ; } #define Crash() {kill( getpid(), SIGINT ) ; }

View File

@ -27,6 +27,38 @@
#include "Common.h" #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, ...); std::string StringFromFormat(const char* format, ...);
// Cheap! // Cheap!
bool CharArrayFromFormatV(char* out, int outsize, const char* format, va_list args); bool CharArrayFromFormatV(char* out, int outsize, const char* format, va_list args);

View File

@ -33,7 +33,7 @@
#define INFINITE 0xffffffff #define INFINITE 0xffffffff
#endif #endif
#ifndef ANDROID #if !defined(ANDROID) && !defined(BLACKBERRY)
#include <xmmintrin.h> #include <xmmintrin.h>
#endif #endif

View File

@ -21,7 +21,7 @@
#include <map> #include <map>
#include "Common.h" #include "Common.h"
#ifdef ANDROID #if defined(ANDROID) || defined(BLACKBERRY)
#include "ArmEmitter.h" #include "ArmEmitter.h"
#else #else
#include "x64Emitter.h" #include "x64Emitter.h"
@ -38,7 +38,7 @@
// we don't want to pollute the stack, so we store away regs somewhere global. // 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. // NOT THREAD SAFE. This may only be used from the CPU thread.
// Any other thread using this stuff will be FATAL. // Any other thread using this stuff will be FATAL.
#ifdef ANDROID #if defined(ANDROID) || defined(BLACKBERRY)
class ThunkManager : public ArmGen::ARMXCodeBlock class ThunkManager : public ArmGen::ARMXCodeBlock
#else #else
class ThunkManager : public Gen::XCodeBlock class ThunkManager : public Gen::XCodeBlock

View File

@ -1,7 +1,7 @@
// X86 disassembler - 95% ripped from some GNU source if I remember // X86 disassembler - 95% ripped from some GNU source if I remember
// correctly, probably GCC or some GCC tool // correctly, probably GCC or some GCC tool
#ifdef ANDROID #if defined(ANDROID) || defined(BLACKBERRY)
#error DO NOT COMPILE THIS INTO ANDROID BUILDS #error DO NOT COMPILE THIS INTO ANDROID BUILDS
#endif #endif

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#ifdef ANDROID #if defined(ANDROID) || defined(BLACKBERRY)
#error DO NOT COMPILE THIS INTO ANDROID BUILDS #error DO NOT COMPILE THIS INTO ANDROID BUILDS
#endif #endif

View File

@ -12,14 +12,6 @@ set(SRCS
MIPS/MIPSTables.cpp MIPS/MIPSTables.cpp
MIPS/MIPSVFPUUtils.cpp MIPS/MIPSVFPUUtils.cpp
MIPS/JitCommon/JitCommon.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 ELF/ElfReader.cpp
HLE/HLE.cpp HLE/HLE.cpp
HLE/HLETables.cpp HLE/HLETables.cpp
@ -73,6 +65,28 @@ set(SRCS
Core.cpp 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}) set(SRCS ${SRCS})
add_library(core STATIC ${SRCS}) add_library(core STATIC ${SRCS})

View File

@ -15,7 +15,7 @@
// Official git repository and contact information can be found at // Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#ifdef ANDROID #if defined(ANDROID) || defined(BLACKBERRY)
#include <GLES2/gl2.h> #include <GLES2/gl2.h>
#include <GLES2/gl2ext.h> #include <GLES2/gl2ext.h>
#else #else

View File

@ -16,9 +16,9 @@
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include "ABI.h" #include "ABI.h"
#include "ARMEmitter.h" #include <ArmEmitter.h>
#include "../../Memmap.h" #include "../../MemMap.h"
#include "../MIPS.h" #include "../MIPS.h"
#include "../../CoreTiming.h" #include "../../CoreTiming.h"

View File

@ -18,7 +18,7 @@
#ifndef _JIT64ASM_H #ifndef _JIT64ASM_H
#define _JIT64ASM_H #define _JIT64ASM_H
#include "ArmEmitter.h" #include <ArmEmitter.h>
#include "../MIPS.h" #include "../MIPS.h"
// In PPSSPP, we don't use inline assembly. Instead, we generate all machine-near // In PPSSPP, we don't use inline assembly. Instead, we generate all machine-near

View File

@ -17,7 +17,7 @@
#include "Jit.h" #include "Jit.h"
#include "RegCache.h" #include "RegCache.h"
#include "ArmEmitter.h" #include <ArmEmitter.h>
using namespace MIPSAnalyst; using namespace MIPSAnalyst;
#define _RS ((op>>21) & 0x1F) #define _RS ((op>>21) & 0x1F)

View File

@ -24,7 +24,7 @@
#include "Jit.h" #include "Jit.h"
#include "RegCache.h" #include "RegCache.h"
#include "JitCache.h" #include "JitCache.h"
#include "ArmEmitter.h" #include <ArmEmitter.h>
#define _RS ((op>>21) & 0x1F) #define _RS ((op>>21) & 0x1F)
#define _RT ((op>>16) & 0x1F) #define _RT ((op>>16) & 0x1F)
@ -353,4 +353,4 @@ void Jit::Comp_Syscall(u32 op)
} }
} // namespace Mipscomp } // namespace Mipscomp

View File

@ -20,12 +20,12 @@
#include "../../../Globals.h" #include "../../../Globals.h"
#include "Asm.h" #include "Asm.h"
#ifndef ANDROID #if !defined(ANDROID) && !defined(BLACKBERRY)
#error DO NOT BUILD ARM JIT ON x86 #error DO NOT BUILD ARM JIT ON x86
#endif #endif
#include "ArmEmitter.h" #include <ArmEmitter.h>
#include "JitCache.h" #include "JitCache.h"
#include "RegCache.h" #include "RegCache.h"

View File

@ -34,7 +34,7 @@
#include "Asm.h" #include "Asm.h"
// #include "JitBase.h" // #include "JitBase.h"
#include "ArmEmitter.h" #include <ArmEmitter.h>
#if defined USE_OPROFILE && USE_OPROFILE #if defined USE_OPROFILE && USE_OPROFILE
#include <opagent.h> #include <opagent.h>

View File

@ -18,7 +18,7 @@
#pragma once #pragma once
#include "../MIPSAnalyst.h" #include "../MIPSAnalyst.h"
#include "ArmEmitter.h" #include <ArmEmitter.h>
using namespace ArmGen; using namespace ArmGen;
enum FlushMode enum FlushMode

View File

@ -17,7 +17,7 @@
#pragma once #pragma once
#ifdef ANDROID #if defined(ANDROID) || defined(BLACKBERRY)
#include "../ARM/Jit.h" #include "../ARM/Jit.h"
#else #else
#include "../x86/Jit.h" #include "../x86/Jit.h"

View File

@ -23,7 +23,7 @@
#include "../System.h" #include "../System.h"
#include "../Debugger/Breakpoints.h" #include "../Debugger/Breakpoints.h"
#ifdef ANDROID #if defined(ANDROID) || defined(BLACKBERRY)
#include "ARM/JitCache.h" #include "ARM/JitCache.h"
#include "ARM/Jit.h" #include "ARM/Jit.h"
#else #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 // Don't subvert this by setting useJIT to true - other places also check the coreparameter
bool useJIT = PSP_CoreParameter().cpuCore == CPU_JIT; bool useJIT = PSP_CoreParameter().cpuCore == CPU_JIT;
#ifdef ANDROID #if defined(ANDROID) || defined(BLACKBERRY)
useJIT = false; useJIT = false;
#endif #endif

View File

@ -21,7 +21,7 @@
#include "MIPSTables.h" #include "MIPSTables.h"
#include "MIPSDebugInterface.h" #include "MIPSDebugInterface.h"
#ifdef ANDROID #if defined(ANDROID) || defined(BLACKBERRY)
#include "ARM/Jit.h" #include "ARM/Jit.h"
#else #else
#include "x86/Jit.h" #include "x86/Jit.h"

View File

@ -55,7 +55,7 @@ void DelayBranchTo(u32 where)
int MIPS_SingleStep() int MIPS_SingleStep()
{ {
#ifdef ANDROID #if defined(ANDROID) || defined(BLACKBERRY)
u32 op = Memory::ReadUnchecked_U32(mipsr4k.pc); u32 op = Memory::ReadUnchecked_U32(mipsr4k.pc);
#else #else
u32 op = Memory::Read_Opcode_JIT(mipsr4k.pc); u32 op = Memory::Read_Opcode_JIT(mipsr4k.pc);

View File

@ -24,7 +24,7 @@
#include "MIPSIntVFPU.h" #include "MIPSIntVFPU.h"
#include "MIPSCodeUtils.h" #include "MIPSCodeUtils.h"
#ifdef ANDROID #if defined(ANDROID) || defined(BLACKBERRY)
#include "ARM/Jit.h" #include "ARM/Jit.h"
#else #else
#include "x86/Jit.h" #include "x86/Jit.h"

View File

@ -20,7 +20,7 @@
#include "../../../Globals.h" #include "../../../Globals.h"
#include "Asm.h" #include "Asm.h"
#ifdef ANDROID #if defined(ANDROID) || defined(BLACKBERRY)
#error DO NOT BUILD X86 JIT ON ANDROID #error DO NOT BUILD X86 JIT ON ANDROID
#endif #endif

View File

@ -19,7 +19,7 @@
#include "MIPS/MIPS.h" #include "MIPS/MIPS.h"
#ifdef ANDROID #if defined(ANDROID) || defined(BLACKBERRY)
#include "MIPS/ARM/Jit.h" #include "MIPS/ARM/Jit.h"
#else #else
#include "MIPS/x86/Jit.h" #include "MIPS/x86/Jit.h"

View File

@ -15,7 +15,7 @@
// Official git repository and contact information can be found at // Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#ifdef ANDROID #if defined(ANDROID) || defined(BLACKBERRY)
#include <GLES2/gl2.h> #include <GLES2/gl2.h>
#include <GLES2/gl2ext.h> #include <GLES2/gl2ext.h>
#else #else
@ -224,7 +224,7 @@ void SetBlendModePSP(u32 data)
GL_FUNC_ADD, GL_FUNC_ADD,
GL_FUNC_SUBTRACT, GL_FUNC_SUBTRACT,
GL_FUNC_REVERSE_SUBTRACT, GL_FUNC_REVERSE_SUBTRACT,
#ifdef ANDROID #if defined(ANDROID) || defined(BLACKBERRY)
GL_FUNC_ADD, GL_FUNC_ADD,
GL_FUNC_ADD, GL_FUNC_ADD,
#else #else

View File

@ -15,7 +15,7 @@
// Official git repository and contact information can be found at // Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#ifdef ANDROID #if defined(ANDROID) || defined(BLACKBERRY)
#define GLSL_ES_1_0 #define GLSL_ES_1_0
#else #else
#define GLSL_1_3 #define GLSL_1_3

View File

@ -15,7 +15,7 @@
// Official git repository and contact information can be found at // Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#ifdef ANDROID #if defined(ANDROID) || defined(BLACKBERRY)
#include <GLES2/gl2.h> #include <GLES2/gl2.h>
#include <GLES2/gl2ext.h> #include <GLES2/gl2ext.h>
#else #else
@ -72,7 +72,7 @@ const char basic_vs[] =
void DisplayDrawer_Init() void DisplayDrawer_Init()
{ {
#ifndef ANDROID #if !defined(ANDROID) && !defined(BLACKBERRY)
// Old OpenGL stuff that probably has no effect // Old OpenGL stuff that probably has no effect
glPolygonMode (GL_FRONT_AND_BACK, GL_FILL); //GL_FILL); glPolygonMode (GL_FRONT_AND_BACK, GL_FILL); //GL_FILL);

View File

@ -15,7 +15,7 @@
// Official git repository and contact information can be found at // Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#ifdef ANDROID #if defined(ANDROID) || defined(BLACKBERRY)
#include <GLES2/gl2.h> #include <GLES2/gl2.h>
#include <GLES2/gl2ext.h> #include <GLES2/gl2ext.h>
#else #else

View File

@ -15,7 +15,7 @@
// Official git repository and contact information can be found at // Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#ifdef ANDROID #if defined(ANDROID) || defined(BLACKBERRY)
#include <GLES2/gl2.h> #include <GLES2/gl2.h>
#include <GLES2/gl2ext.h> #include <GLES2/gl2ext.h>
#else #else

View File

@ -15,7 +15,7 @@
// Official git repository and contact information can be found at // Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#ifdef ANDROID #if defined(ANDROID) || defined(BLACKBERRY)
#include <GLES2/gl2.h> #include <GLES2/gl2.h>
#include <GLES2/gl2ext.h> #include <GLES2/gl2ext.h>
#else #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. // TODO: Split up into multiple draw calls for Android where you can't guarantee support for more than 0x10000 verts.
int i = 0; int i = 0;
#ifdef ANDROID #if defined(ANDROID) || defined(BLACKBERRY)
if (vertexCount > 0x10000/3) if (vertexCount > 0x10000/3)
vertexCount = 0x10000/3; vertexCount = 0x10000/3;
#endif #endif

View File

@ -15,7 +15,7 @@
// Official git repository and contact information can be found at // Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#ifdef ANDROID #if defined(ANDROID) || defined(BLACKBERRY)
#include <GLES2/gl2.h> #include <GLES2/gl2.h>
#include <GLES2/gl2ext.h> #include <GLES2/gl2ext.h>
#else #else

View File

@ -53,7 +53,7 @@ void WriteLight(char *p, int l) {
char *GenerateVertexShader() char *GenerateVertexShader()
{ {
char *p = buffer; char *p = buffer;
#if defined(ANDROID) #if defined(ANDROID) || defined(BLACKBERRY)
WRITE("precision highp float;"); WRITE("precision highp float;");
#elif !defined(FORCE_OPENGL_2_0) #elif !defined(FORCE_OPENGL_2_0)
WRITE("#version 130"); WRITE("#version 130");

View File

@ -15,7 +15,7 @@
// Official git repository and contact information can be found at // Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#ifdef ANDROID #if defined(ANDROID) || defined(BLACKBERRY)
#include <GLES2/gl2.h> #include <GLES2/gl2.h>
#include <GLES2/gl2ext.h> #include <GLES2/gl2ext.h>
#else #else

View File

@ -17,6 +17,7 @@
#pragma once #pragma once
#include <cstdio>
#include <vector> #include <vector>
#include <string> #include <string>

View File

@ -12,6 +12,11 @@ if (APPLE)
include_directories(/usr/X11/include) include_directories(/usr/X11/include)
endif() endif()
# TODO: Rely on compiler define instead. __BLACKBERRY__ ?
if (BLACKBERRY)
add_definitions(-DBLACKBERRY)
endif()
include(FindOpenGL) include(FindOpenGL)
include(FindSDL) include(FindSDL)
@ -23,11 +28,13 @@ add_definitions(-DSDL)
add_definitions(-Wno-multichar) add_definitions(-Wno-multichar)
add_definitions(-fno-strict-aliasing) add_definitions(-fno-strict-aliasing)
add_definitions(-DUSE_PROFILER) add_definitions(-DUSE_PROFILER)
add_definitions(-D_DEBUG) if (NOT BLACKBERRY)
add_definitions(-D_DEBUG)
endif()
if (UNIX) if (UNIX)
if (NOT APPLE) # can't build the SDL .m file with -std=gnu++0x if (NOT APPLE) # can't build the SDL .m file with -std=gnu++0x
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")
endif() endif()
endif() endif()
@ -65,7 +72,15 @@ add_subdirectory(../Common Common)
add_subdirectory(../GPU GPU) add_subdirectory(../GPU GPU)
add_subdirectory(../Core Core) 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 set(FILES
../android/jni/NativeApp.cpp ../android/jni/NativeApp.cpp
../android/jni/EmuScreen.cpp ../android/jni/EmuScreen.cpp
@ -76,9 +91,9 @@ set(FILES
../native/base/PCMain.cpp ../native/base/PCMain.cpp
) )
if (APPLE) if(APPLE)
SET(FILES ${FILES} SDLMain.m) set(FILES ${FILES} SDLMain.m)
endif (APPLE) endif(APPLE)
add_executable(ppsspp ${FILES}) add_executable(ppsspp ${FILES})

122
SDL/build_for_playbook.sh Normal file
View 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

View File

@ -1,6 +1,6 @@
// NOTE: Apologies for the quality of this code, this is really from pre-opensource Dolphin - that is, 2003. // 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/gl2.h>
#include <GLES2/gl2ext.h> #include <GLES2/gl2ext.h>
#else #else