diff --git a/README.md b/README.md index df93c9f961..559eea40ab 100644 --- a/README.md +++ b/README.md @@ -91,3 +91,18 @@ other than microsoft's, but `NMake Makefiles` works fine. "https://github.com/hrydgard/ppsspp" [ppsspp-devel]: "http://www.ppsspp.org/development.html" + +Building for Blackberry +----------------------- + +To build for Blackberry, you must first have the latest Native SDK installed from developer.blackberry.com/native and have compiled the SDL port available from github.com/blackberry/SDL to your NDK workspace. Then checkout the latest version of PPSSPP to your NDK workspace. + +To set up your environment for cross-compiling you must then use: + source ~/bbndk/bbndk-env.sh + +Finally, you are ready to compile. Change directory to ppsspp/SDL and run: + ./blackberry_build.sh + +If you are on Windows, you will need GNU tools and CMake to run the bash script. + +Currently SDL is required for sound output. EGL is used for the GLES2 interface, which is identical to the Android one. There are plans to move to a Qt interface and a different sound library (such as asound) in future. diff --git a/SDL/CMakeLists.txt b/SDL/CMakeLists.txt deleted file mode 100644 index 30761fe47f..0000000000 --- a/SDL/CMakeLists.txt +++ /dev/null @@ -1,111 +0,0 @@ -cmake_minimum_required(VERSION 2.6) - -project (PPSSPP) - -find_package(PkgConfig) -find_package(PNG REQUIRED) -pkg_check_modules(SDL sdl) - -if (APPLE) - find_library(OGL_LIBRARY OpenGL) - include_directories(/usr/X11/include) -endif() - -# TODO: Rely on compiler define instead. __QNX__ __QNXNTO__ ? -if (BLACKBERRY) - add_definitions(-DBLACKBERRY) - if (NOT BLACKBERRY LESS 10.0) - add_definitions(-DBLACKBERRY10) - endif() -endif() - -# TODO: Desktop can use GLES too. -D USING_GLES2 ? -if (NOT ARM) - include(FindOpenGL) -endif() - -include(FindSDL) - -#add_definitions(-O2) -add_definitions(-g) -add_definitions(-DUSE_PROFILER) -add_definitions(-D_DEBUG) -add_definitions(-DSDL) - -# Apple can't build the SDL .m file with -std=gnu++0x -if (UNIX AND NOT APPLE) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x") -endif() - -include_directories(..) -include_directories(../Common) -include_directories(../native) -include_directories(../native/ext/libzip) -include_directories(${SDL_INCLUDE_DIR}) -include_directories(${PNG_INCLUDE_DIR}) - -if (UNIX AND NOT ARM) - include_directories(/opt/local/include /usr/local/include) - link_directories(/usr/local/lib /opt/local/lib /usr/X11/lib) -endif() - -add_subdirectory(../native/base base) -add_subdirectory(../native/gfx gfx) -add_subdirectory(../native/profiler profiler) -add_subdirectory(../native/gfx_es2 gfx_es2) -add_subdirectory(../native/file file) -add_subdirectory(../native/image image) -add_subdirectory(../native/json jsonwriter) -add_subdirectory(../native/audio audio) -add_subdirectory(../native/math math) -add_subdirectory(../native/net net) -add_subdirectory(../native/ui ui) -add_subdirectory(../native/ext/libzip libzip) -add_subdirectory(../native/ext/etcpack etcpack) -add_subdirectory(../native/ext/vjson vjson) -add_subdirectory(../native/ext/stb_vorbis stb_vorbis) -add_subdirectory(../native/ext/stb_image stb_image) -add_subdirectory(../native/ext/sha1 sha1) -add_subdirectory(../ext/libkirk kirk) -add_subdirectory(../Common Common) -add_subdirectory(../GPU GPU) -add_subdirectory(../Core Core) - -set(LIBS ${LIBS} ${SDL_LIBRARY} ${PNG_LIBRARY} z gfx gfx_es2 mixer net ui profiler timeutil file zip base lin vjson stb_vorbis sha1 jsonwriter core common gpu kirk image stb_image) - -if(BLACKBERRY) - set(LIBS ${LIBS} bps screen socket EGL GLESv2) -else() - set(LIBS ${LIBS} ${OPENGL_LIBRARIES} GLEW etcdec) -endif() - -# TODO: Why is cross-platform UI in ../android/jni? -set(FILES - ../android/jni/NativeApp.cpp - ../android/jni/EmuScreen.cpp - ../android/jni/MenuScreens.cpp - ../android/jni/GamepadEmu.cpp - ../android/jni/UIShader.cpp - ../android/jni/ui_atlas.cpp - ) - -# Platform setup -if(BLACKBERRY) - set(FILES ${FILES} ../native/base/BlackberryMain.cpp) -else() - set(FILES ${FILES} ../native/base/PCMain.cpp) - if(APPLE) - set(FILES ${FILES} SDLMain.m) - endif(APPLE) -endif() - -add_executable(ppsspp ${FILES}) - -target_link_libraries(ppsspp ${LIBS}) - -set(FILES ../headless/Headless.cpp) - -add_executable(ppsspp-headless ${FILES}) - -target_link_libraries(ppsspp-headless ${LIBS}) - diff --git a/SDL/bar-descriptor.xml b/SDL/bar-descriptor.xml index 7bbb7d9a98..25c2f82a77 100644 --- a/SDL/bar-descriptor.xml +++ b/SDL/bar-descriptor.xml @@ -16,12 +16,18 @@ none false + + PPSSPPBlackberry + icon-114.png + assets + lib/libSDL12.so + lib/libTouchControlOverlay.so core.games icon-114.png - + run_native diff --git a/SDL/blackberry_build.sh b/SDL/blackberry_build.sh index bc6516b05f..5ef80f155d 100755 --- a/SDL/blackberry_build.sh +++ b/SDL/blackberry_build.sh @@ -7,14 +7,10 @@ if [ -z "$BB_OS" ]; then fi echo "Building for Blackberry ${BB_OS}" - -if [ -z "$PPSSPP_ROOT" ]; then - PPSSPP_ROOT=${PWD}/.. -fi +PPSSPP_ROOT=${PWD}/.. if [ -z "$PROJECT_ROOT" ]; then PROJECT_ROOT=${PPSSPP_ROOT}/.. fi - if [ -z "$SDL_PROJECT" ]; then SDL_PROJECT="$PROJECT_ROOT/SDL" fi @@ -25,18 +21,16 @@ fi while true; do case "$1" in -h | --help ) - echo "Build script for BlackBerry PlayBook" + echo "Build script for BlackBerry" echo echo "Options: " 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 roots parent)" + echo " -p, --project-root PATH Specify the root directory containing all projects. (default is PPSSPP's parent)" 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 PATH SDL 1.2 project directory (default is SDL)" + echo " --tco PATH TouchControlOverlay project directory (default is TouchControlOverlay)" exit 0 ;; - -r | --root ) PPSSPP_ROOT="$2"; shift 2 ;; -p | --project-root ) PROJECT_ROOT="$2"; shift 2 ;; --sdl ) SDL_PROJECT="$2"; shift 2 ;; --tco ) TCO_PROJECT="$2"; shift 2 ;; @@ -51,6 +45,8 @@ cmake \ -DSDL_INCLUDE_DIR="${SDL_PROJECT}/include" \ -DSDL_LIBRARY="${SDL_PROJECT}/Device-Release/libSDL12.so;${TCO_PROJECT}/Device-Release/libTouchControlOverlay.so" \ -DBLACKBERRY=${BB_OS} \ -.. +${PPSSPP_ROOT} -make -j4 +# Compile and create unsigned PPSSPP.bar with debugtoken +DEBUG="-devMode -debugToken ${HOME}/debugtoken.bar" +make -j4 && blackberry-nativepackager -package PPSSPP.bar bar-descriptor.xml $DEBUG diff --git a/SDL/blackberry_package.sh b/SDL/blackberry_package.sh deleted file mode 100755 index ecc905fadd..0000000000 --- a/SDL/blackberry_package.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -TYPE=Device-Release -DEBUG="-devMode -debugToken ${HOME}/debugtoken.bar" -PPSSPP_ROOT=${PWD}/.. -WORKSPACE=${PPSSPP_ROOT}/.. -blackberry-nativepackager -package PPSSPP.bar bar-descriptor.xml PPSSPPBlackberry \ --e icon-114.png icon-114.png $DEBUG \ --e ../android/assets assets \ --e ${WORKSPACE}/SDL12/${TYPE}/libSDL12.so lib/libSDL12.so \ --e ${WORKSPACE}/TouchControlOverlay/${TYPE}/libTouchControlOverlay.so lib/libTouchControlOverlay.so