mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Merge pull request #94 from xsacha/master
CMakeLists cleanup; Improve portability to future platforms; iOS support
This commit is contained in:
commit
b3a6444f4b
29 changed files with 782 additions and 851 deletions
1431
CMakeLists.txt
1431
CMakeLists.txt
File diff suppressed because it is too large
Load diff
|
@ -25,7 +25,7 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#if defined(ARM)
|
||||
#define _M_ARM32
|
||||
#endif
|
||||
|
||||
|
|
|
@ -25,6 +25,10 @@
|
|||
#define SLEEP(x) usleep(x*1000)
|
||||
#endif
|
||||
|
||||
#ifdef IOS
|
||||
#include <signal.h>
|
||||
#endif
|
||||
|
||||
template <bool> struct CompileTimeAssert;
|
||||
template<> struct CompileTimeAssert<true> {};
|
||||
|
||||
|
@ -36,7 +40,8 @@ template<> struct CompileTimeAssert<true> {};
|
|||
#define ROUND_UP_POW2(x) (b32(x - 1) + 1)
|
||||
|
||||
#if defined __GNUC__ && !defined __SSSE3__
|
||||
#if !defined(ANDROID) && !defined(BLACKBERRY)
|
||||
// Assume !ARM = x86
|
||||
#if !defined(ARM)
|
||||
#include <emmintrin.h>
|
||||
static __inline __m128i __attribute__((__always_inline__))
|
||||
_mm_shuffle_epi8(__m128i a, __m128i mask)
|
||||
|
@ -63,7 +68,8 @@ _mm_shuffle_epi8(__m128i a, __m128i mask)
|
|||
#ifdef GEKKO
|
||||
#define Crash()
|
||||
#else
|
||||
#if !defined(ANDROID) && !defined(BLACKBERRY)
|
||||
// Assume !ARM = x86
|
||||
#if !defined(ARM)
|
||||
#define Crash() {asm ("int $3");}
|
||||
#else
|
||||
#define Crash() {kill( getpid(), SIGINT ) ; }
|
||||
|
|
|
@ -33,7 +33,8 @@
|
|||
#define INFINITE 0xffffffff
|
||||
#endif
|
||||
|
||||
#if !defined(ANDROID) && !defined(BLACKBERRY)
|
||||
// Assume !ARM = x86
|
||||
#if !defined(ARM)
|
||||
#include <xmmintrin.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include <map>
|
||||
|
||||
#include "Common.h"
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#if defined(ARM)
|
||||
#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.
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#if defined(ARM)
|
||||
class ThunkManager : public ArmGen::ARMXCodeBlock
|
||||
#else
|
||||
class ThunkManager : public Gen::XCodeBlock
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
#include "../../../Globals.h"
|
||||
#include "Asm.h"
|
||||
|
||||
#if !defined(ANDROID) && !defined(BLACKBERRY)
|
||||
#error DO NOT BUILD ARM JIT ON x86
|
||||
#if !defined(ARM)
|
||||
#error DO NOT BUILD ARM JIT ON NON-ARM
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#if defined(ARM)
|
||||
#include "../ARM/Jit.h"
|
||||
#else
|
||||
#include "../x86/Jit.h"
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include "../System.h"
|
||||
#include "../HLE/sceDisplay.h"
|
||||
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#if defined(ARM)
|
||||
#include "ARM/JitCache.h"
|
||||
#include "ARM/Jit.h"
|
||||
#else
|
||||
|
|
|
@ -21,11 +21,7 @@
|
|||
#include "MIPSTables.h"
|
||||
#include "MIPSDebugInterface.h"
|
||||
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#include "ARM/Jit.h"
|
||||
#else
|
||||
#include "x86/Jit.h"
|
||||
#endif
|
||||
#include "JitCommon/JitCommon.h"
|
||||
|
||||
#define _RS ((op>>21) & 0x1F)
|
||||
#define _RT ((op>>16) & 0x1F)
|
||||
|
|
|
@ -75,7 +75,7 @@ static inline void DelayBranchTo(u32 where)
|
|||
|
||||
int MIPS_SingleStep()
|
||||
{
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#if defined(ARM)
|
||||
u32 op = Memory::ReadUnchecked_U32(mipsr4k.pc);
|
||||
#else
|
||||
u32 op = Memory::Read_Opcode_JIT(mipsr4k.pc);
|
||||
|
|
|
@ -26,11 +26,6 @@
|
|||
#include "../../Core/CoreTiming.h"
|
||||
#include "../Debugger/Breakpoints.h"
|
||||
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#include "ARM/Jit.h"
|
||||
#else
|
||||
#include "x86/Jit.h"
|
||||
#endif
|
||||
#include "JitCommon/JitCommon.h"
|
||||
|
||||
enum MipsEncoding
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
#include "../../../Globals.h"
|
||||
#include "Asm.h"
|
||||
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#error DO NOT BUILD X86 JIT ON ANDROID
|
||||
#if defined(ARM)
|
||||
#error DO NOT BUILD X86 JIT ON ARM
|
||||
#endif
|
||||
|
||||
#include "x64Emitter.h"
|
||||
|
|
|
@ -19,11 +19,7 @@
|
|||
|
||||
#include "MIPS/MIPS.h"
|
||||
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#include "MIPS/ARM/Jit.h"
|
||||
#else
|
||||
#include "MIPS/x86/Jit.h"
|
||||
#endif
|
||||
#include "MIPS/JitCommon/JitCommon.h"
|
||||
|
||||
#include "System.h"
|
||||
// Bad dependency
|
||||
|
|
|
@ -15,19 +15,6 @@
|
|||
// Official git repository and contact information can be found at
|
||||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#include <GLES2/gl2.h>
|
||||
#include <GLES2/gl2ext.h>
|
||||
#else
|
||||
#include <GL/glew.h>
|
||||
#if defined(__APPLE__)
|
||||
#include <OpenGL/gl.h>
|
||||
#else
|
||||
#include <GL/gl.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#include "../../Core/MemMap.h"
|
||||
#include "../../Core/Host.h"
|
||||
#include "../../Core/Config.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/.
|
||||
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#if defined(USING_GLES2)
|
||||
#define GLSL_ES_1_0
|
||||
#else
|
||||
#define GLSL_1_3
|
||||
|
|
|
@ -15,18 +15,6 @@
|
|||
// Official git repository and contact information can be found at
|
||||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#include <GLES2/gl2.h>
|
||||
#include <GLES2/gl2ext.h>
|
||||
#else
|
||||
#include <GL/glew.h>
|
||||
#if defined(__APPLE__)
|
||||
#include <OpenGL/gl.h>
|
||||
#else
|
||||
#include <GL/gl.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "gfx_es2/glsl_program.h"
|
||||
#include "gfx_es2/gl_state.h"
|
||||
#include "math/lin/matrix4x4.h"
|
||||
|
@ -73,7 +61,7 @@ const char basic_vs[] =
|
|||
|
||||
void DisplayDrawer_Init()
|
||||
{
|
||||
#if !defined(ANDROID) && !defined(BLACKBERRY)
|
||||
#if !defined(USING_GLES2)
|
||||
// Old OpenGL stuff that probably has no effect
|
||||
|
||||
glPolygonMode (GL_FRONT_AND_BACK, GL_FILL); //GL_FILL);
|
||||
|
|
|
@ -15,18 +15,6 @@
|
|||
// Official git repository and contact information can be found at
|
||||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#include <GLES2/gl2.h>
|
||||
#include <GLES2/gl2ext.h>
|
||||
#else
|
||||
#include <GL/glew.h>
|
||||
#if defined(__APPLE__)
|
||||
#include <OpenGL/gl.h>
|
||||
#else
|
||||
#include <GL/gl.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "math/lin/matrix4x4.h"
|
||||
|
|
|
@ -31,7 +31,7 @@ const GLint eqLookup[] = {
|
|||
GL_FUNC_ADD,
|
||||
GL_FUNC_SUBTRACT,
|
||||
GL_FUNC_REVERSE_SUBTRACT,
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#if defined(USING_GLES2)
|
||||
GL_FUNC_ADD,
|
||||
GL_FUNC_ADD,
|
||||
#else
|
||||
|
@ -50,4 +50,4 @@ const GLuint ztests[] =
|
|||
{
|
||||
GL_NEVER, GL_ALWAYS, GL_EQUAL, GL_NOTEQUAL,
|
||||
GL_LESS, GL_LEQUAL, GL_GREATER, GL_GEQUAL,
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#if defined(USING_GLES2)
|
||||
#include <GLES2/gl2.h>
|
||||
#include <GLES2/gl2ext.h>
|
||||
#elif defined(IOS)
|
||||
#include <OpenGLES/ES2/gl.h>
|
||||
#include <OpenGLES/ES2/glext.h>
|
||||
typedef char GLchar;
|
||||
#else
|
||||
#include <GL/glew.h>
|
||||
#if defined(__APPLE__)
|
||||
|
@ -14,4 +18,4 @@ extern const GLint aLookup[];
|
|||
extern const GLint bLookup[];
|
||||
extern const GLint eqLookup[];
|
||||
extern const GLint cullingMode[];
|
||||
extern const GLuint ztests[];
|
||||
extern const GLuint ztests[];
|
||||
|
|
|
@ -15,18 +15,6 @@
|
|||
// Official git repository and contact information can be found at
|
||||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#include <GLES2/gl2.h>
|
||||
#include <GLES2/gl2ext.h>
|
||||
#else
|
||||
#include <GL/glew.h>
|
||||
#if defined(__APPLE__)
|
||||
#include <OpenGL/gl.h>
|
||||
#else
|
||||
#include <GL/gl.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "../../Core/MemMap.h"
|
||||
|
|
|
@ -16,10 +16,11 @@
|
|||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../Globals.h"
|
||||
|
||||
|
||||
void PSPSetTexture();
|
||||
void TextureCache_Clear(bool delete_them);
|
||||
void TextureCache_Decimate(); // Run this once per frame to get rid of old textures.
|
||||
int TextureCache_NumLoadedTextures();
|
||||
int TextureCache_NumLoadedTextures();
|
||||
|
|
|
@ -15,18 +15,6 @@
|
|||
// Official git repository and contact information can be found at
|
||||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#include <GLES2/gl2.h>
|
||||
#include <GLES2/gl2ext.h>
|
||||
#else
|
||||
#include <GL/glew.h>
|
||||
#if defined(__APPLE__)
|
||||
#include <OpenGL/gl.h>
|
||||
#else
|
||||
#include <GL/gl.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "../../Core/MemMap.h"
|
||||
#include "../../Core/Host.h"
|
||||
#include "../../Core/System.h"
|
||||
|
@ -248,9 +236,9 @@ void TransformAndDrawPrim(void *verts, void *inds, int prim, int vertexCount, Li
|
|||
|
||||
// TODO: Could use glDrawElements in some cases, see below.
|
||||
|
||||
// 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 GLES 2.0 where you can't guarantee support for more than 0x10000 verts.
|
||||
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#if defined(USING_GLES2)
|
||||
if (vertexCount > 0x10000/3)
|
||||
vertexCount = 0x10000/3;
|
||||
#endif
|
||||
|
|
|
@ -15,23 +15,10 @@
|
|||
// Official git repository and contact information can be found at
|
||||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#include <GLES2/gl2.h>
|
||||
#include <GLES2/gl2ext.h>
|
||||
#else
|
||||
#include <GL/glew.h>
|
||||
#if defined(__APPLE__)
|
||||
#include <OpenGL/gl.h>
|
||||
#else
|
||||
#include <GL/gl.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "math/lin/matrix4x4.h"
|
||||
|
||||
#include "../../Core/MemMap.h"
|
||||
#include "../ge_constants.h"
|
||||
#include "../GPUState.h"
|
||||
|
||||
#include "VertexDecoder.h"
|
||||
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../GPUState.h"
|
||||
#include "../Globals.h"
|
||||
#include "base/basictypes.h"
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ void WriteLight(char *p, int l) {
|
|||
char *GenerateVertexShader()
|
||||
{
|
||||
char *p = buffer;
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#if defined(USING_GLES2)
|
||||
WRITE("precision highp float;");
|
||||
#elif !defined(FORCE_OPENGL_2_0)
|
||||
WRITE("#version 130");
|
||||
|
|
|
@ -15,18 +15,6 @@
|
|||
// Official git repository and contact information can be found at
|
||||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#include <GLES2/gl2.h>
|
||||
#include <GLES2/gl2ext.h>
|
||||
#else
|
||||
#include <GL/glew.h>
|
||||
#if defined(__APPLE__)
|
||||
#include <OpenGL/gl.h>
|
||||
#else
|
||||
#include <GL/gl.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "ge_constants.h"
|
||||
#include "GPUState.h"
|
||||
#include "GLES/ShaderManager.h"
|
||||
|
|
|
@ -16,6 +16,21 @@
|
|||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#pragma once
|
||||
#if defined(USING_GLES2)
|
||||
#include <GLES2/gl2.h>
|
||||
#include <GLES2/gl2ext.h>
|
||||
#elif defined(IOS)
|
||||
#include <OpenGLES/ES2/gl.h>
|
||||
#include <OpenGLES/ES2/glext.h>
|
||||
typedef char GLchar;
|
||||
#else
|
||||
#include <GL/glew.h>
|
||||
#if defined(__APPLE__)
|
||||
#include <OpenGL/gl.h>
|
||||
#else
|
||||
#include <GL/gl.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "../Globals.h"
|
||||
#include "ge_constants.h"
|
||||
|
|
|
@ -15,19 +15,6 @@
|
|||
// Official git repository and contact information can be found at
|
||||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#include <GLES2/gl2.h>
|
||||
#include <GLES2/gl2ext.h>
|
||||
#else
|
||||
#include <GL/glew.h>
|
||||
#if defined(__APPLE__)
|
||||
#include <OpenGL/gl.h>
|
||||
#else
|
||||
#include <GL/gl.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#include "../../Core/MemMap.h"
|
||||
#include "../../Core/Host.h"
|
||||
|
||||
|
@ -224,7 +211,7 @@ void SetBlendModePSP(u32 data)
|
|||
GL_FUNC_ADD,
|
||||
GL_FUNC_SUBTRACT,
|
||||
GL_FUNC_REVERSE_SUBTRACT,
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#if defined(USING_GLES2)
|
||||
GL_FUNC_ADD,
|
||||
GL_FUNC_ADD,
|
||||
#else
|
||||
|
|
|
@ -49,7 +49,7 @@ EmuScreen::EmuScreen(const std::string &filename) : invalid_(true)
|
|||
|
||||
CoreParameter coreParam;
|
||||
coreParam.cpuCore = (CPUCore)g_Config.iCpuCore;
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#if defined(ARM)
|
||||
if (coreParam.cpuCore == CPU_JIT)
|
||||
coreParam.cpuCore = CPU_FASTINTERPRETER;
|
||||
#endif
|
||||
|
@ -185,10 +185,9 @@ void EmuScreen::render()
|
|||
|
||||
ui_draw2d.Begin(DBMODE_NORMAL);
|
||||
|
||||
// Don't want the gamepad on MacOSX and Linux
|
||||
// #ifdef ANDROID
|
||||
// Make this configurable.
|
||||
// if (coreParam.useTouchControls)
|
||||
DrawGamepad(ui_draw2d);
|
||||
// #endif
|
||||
|
||||
DrawWatermark();
|
||||
|
||||
|
@ -198,7 +197,7 @@ void EmuScreen::render()
|
|||
|
||||
|
||||
// Tiled renderers like PowerVR should benefit greatly from this. However - seems I can't call it?
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#if defined(USING_GLES2)
|
||||
bool hasDiscard = false; // TODO
|
||||
if (hasDiscard) {
|
||||
//glDiscardFramebuffer(GL_COLOR_EXT | GL_DEPTH_EXT | GL_STENCIL_EXT);
|
||||
|
|
Loading…
Add table
Reference in a new issue