blackberry: Remove!
This commit is contained in:
parent
fef8847a58
commit
373db56a16
47 changed files with 25 additions and 1183 deletions
|
@ -1,52 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<qnx xmlns="http://www.qnx.com/schemas/application/1.0">
|
||||
<id>com.Qtness.PPSSPP</id>
|
||||
<name>PPSSPP</name>
|
||||
<filename>PPSSPPBlackberry</filename>
|
||||
<versionNumber>1.3.0</versionNumber>
|
||||
<buildId>1</buildId>
|
||||
<description>Playstation Portable emulator.</description>
|
||||
|
||||
<author>Qtness</author>
|
||||
<authorId>gYAAgGE4qaHzBnzEAu8JKe4G1OI</authorId>
|
||||
|
||||
<initialWindow>
|
||||
<aspectRatio>landscape</aspectRatio>
|
||||
<autoOrients>false</autoOrients>
|
||||
<systemChrome>none</systemChrome>
|
||||
</initialWindow>
|
||||
|
||||
<asset path="PPSSPPBlackberry" entry="true" type="Qnx/Elf">PPSSPPBlackberry</asset>
|
||||
<asset path="../assets/icon-114.png">icon-114.png</asset>
|
||||
<asset path="../assets" dest="assets">
|
||||
<include name="*.png"/>
|
||||
<include name="*.ini"/>
|
||||
<include name="*atlas.zim"/>
|
||||
</asset>
|
||||
<asset path="../lang">assets/lang</asset>
|
||||
<asset path="../flash0">assets/flash0</asset>
|
||||
|
||||
<category>core.games</category>
|
||||
<icon>
|
||||
<image>icon-114.png</image>
|
||||
</icon>
|
||||
|
||||
<invoke-target id="com.Qtness.PPSSPP.openrom2">
|
||||
<invoke-target-name>Open PSP ROM</invoke-target-name>
|
||||
<invoke-target-type>application</invoke-target-type>
|
||||
<icon><image>icon-114.png</image></icon>
|
||||
<filter>
|
||||
<action>bb.action.OPEN</action>
|
||||
<mime-type>*</mime-type>
|
||||
<property var="uris" value="file://"/>
|
||||
<property var="exts" value="iso,cso,pbp,prx"/>
|
||||
</filter>
|
||||
</invoke-target>
|
||||
|
||||
<env var="LD_LIBRARY_PATH" value="app/native/lib:/usr/lib/qt4/lib/:/accounts/1000/shared/misc/"/>
|
||||
|
||||
<permission system="true">run_native</permission>
|
||||
<permission>access_shared</permission>
|
||||
<permission>use_gamepad</permission>
|
||||
<permission>play_audio</permission>
|
||||
</qnx>
|
|
@ -1,42 +0,0 @@
|
|||
# Standard settings
|
||||
set (CMAKE_SYSTEM_NAME QNX)
|
||||
set (CMAKE_SYSTEM_VERSION 1)
|
||||
set (CMAKE_PREFIX_PATH $ENV{QNX_TARGET}/usr)
|
||||
set (CMAKE_INCLUDE_PATH $ENV{QNX_TARGET}/usr/include)
|
||||
if (SIMULATOR)
|
||||
set (CMAKE_SYSTEM_PROCESSOR x86)
|
||||
set (CMAKE_LIBRARY_PATH $ENV{QNX_TARGET}/x86 $ENV{QNX_TARGET}/x86/usr)
|
||||
else()
|
||||
set (CMAKE_SYSTEM_PROCESSOR armv7)
|
||||
set (CMAKE_LIBRARY_PATH $ENV{QNX_TARGET}/armle-v7 $ENV{QNX_TARGET}/armle-v7/usr)
|
||||
endif()
|
||||
set (UNIX True)
|
||||
set (CMAKE_DL_LIBS)
|
||||
|
||||
set (CMAKE_FIND_ROOT_PATH ${CMAKE_PREFIX_PATH} ${CMAKE_LIBRARY_PATH} CACHE string "Blackberry find search path root")
|
||||
set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
|
||||
include (CMakeForceCompiler)
|
||||
CMAKE_FORCE_C_COMPILER (nto${CMAKE_SYSTEM_PROCESSOR}-gcc nto${CMAKE_SYSTEM_PROCESSOR}-gcc)
|
||||
CMAKE_FORCE_CXX_COMPILER (nto${CMAKE_SYSTEM_PROCESSOR}-g++ nto${CMAKE_SYSTEM_PROCESSOR}-g++)
|
||||
set (CMAKE_COMPILER_IS_GNUCXX True)
|
||||
execute_process( COMMAND nto${CMAKE_SYSTEM_PROCESSOR}-gcc --version
|
||||
OUTPUT_VARIABLE GCC_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE )
|
||||
string( REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" GCC_VERSION "${GCC_VERSION}" )
|
||||
set (CMAKE_C_COMPILER_VERSION ${GCC_VERSION})
|
||||
set (CMAKE_CXX_COMPILER_VERSION ${GCC_VERSION})
|
||||
|
||||
# Skip the platform compiler checks for cross compiling
|
||||
set (CMAKE_CROSSCOMPILING TRUE)
|
||||
set (CMAKE_C_COMPILER_WORKS TRUE)
|
||||
set (CMAKE_CXX_COMPILER_WORKS TRUE)
|
||||
|
||||
add_definitions(-D_QNX_SOURCE -D__STDC_CONSTANT_MACROS)
|
||||
|
||||
if( CMAKE_BINARY_DIR AND EXISTS "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake" )
|
||||
# really dirty hack
|
||||
# it is not possible to change CMAKE_SYSTEM_PROCESSOR after the first run...
|
||||
file( APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake" "SET(CMAKE_SYSTEM_PROCESSOR \"${CMAKE_SYSTEM_PROCESSOR}\")\n" )
|
||||
endif()
|
||||
|
|
@ -158,7 +158,7 @@ if(MAEMO)
|
|||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
|
||||
endif()
|
||||
|
||||
if (NOT BLACKBERRY AND NOT ANDROID AND NOT IOS)
|
||||
if (NOT ANDROID AND NOT IOS)
|
||||
include(FindSDL2)
|
||||
endif()
|
||||
include(FindThreads)
|
||||
|
@ -180,9 +180,6 @@ endif()
|
|||
if(ANDROID)
|
||||
add_definitions(-DANDROID)
|
||||
endif()
|
||||
if(BLACKBERRY)
|
||||
add_definitions(-DBLACKBERRY=${BLACKBERRY})
|
||||
endif()
|
||||
if(IOS)
|
||||
add_definitions(-DIOS)
|
||||
endif()
|
||||
|
@ -250,11 +247,6 @@ if(NOT MSVC)
|
|||
add_definitions(-msse2)
|
||||
endif()
|
||||
|
||||
if (BLACKBERRY AND ARM)
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=armv7-a -mfpu=neon -mcpu=cortex-a9")
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=armv7-a -mfpu=neon -mcpu=cortex-a9")
|
||||
endif()
|
||||
|
||||
if(IOS)
|
||||
add_definitions(-DGL_ETC1_RGB8_OES=0)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -U__STRICT_ANSI__")
|
||||
|
@ -271,11 +263,7 @@ if(NOT MSVC)
|
|||
if (NOT CMAKE_C_COMPILER_ID STREQUAL "Intel" AND NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||
add_definitions(-Wno-psabi)
|
||||
endif()
|
||||
if (BLACKBERRY)
|
||||
add_definitions(-D_XOPEN_SOURCE=600)
|
||||
else()
|
||||
add_definitions(-D_XOPEN_SOURCE=700)
|
||||
endif()
|
||||
add_definitions(-D_XOPEN_SOURCE=700)
|
||||
add_definitions(-D_XOPEN_SOURCE_EXTENDED -D__BSD_VISIBLE=1)
|
||||
add_definitions(-D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64)
|
||||
endif()
|
||||
|
@ -459,8 +447,6 @@ if(USE_FFMPEG)
|
|||
elseif(X86)
|
||||
set(PLATFORM_ARCH "android/x86")
|
||||
endif()
|
||||
elseif(BLACKBERRY)
|
||||
set(PLATFORM_ARCH "blackberry/armv7")
|
||||
elseif(IOS)
|
||||
set(PLATFORM_ARCH "ios/universal")
|
||||
elseif(MACOSX)
|
||||
|
|
|
@ -20,9 +20,6 @@
|
|||
#include "CPUDetect.h"
|
||||
#include "StringUtils.h"
|
||||
#include "FileUtil.h"
|
||||
#ifdef BLACKBERRY
|
||||
#include <bps/deviceinfo.h>
|
||||
#endif
|
||||
|
||||
// Only Linux platforms have /proc/cpuinfo
|
||||
#if defined(__linux__)
|
||||
|
@ -208,15 +205,6 @@ void CPUInfo::Detect()
|
|||
#endif
|
||||
strcpy(brand_string, "Apple A");
|
||||
num_cores = 2;
|
||||
#elif defined(BLACKBERRY)
|
||||
isVFP3 = true;
|
||||
deviceinfo_details_t* details;
|
||||
deviceinfo_get_details(&details);
|
||||
num_cores = deviceinfo_details_get_processor_core_count(details);
|
||||
strcpy(brand_string, deviceinfo_details_get_processor_name(details));
|
||||
if (!strncmp(brand_string, "MSM", 3))
|
||||
isVFP4 = true;
|
||||
deviceinfo_free_details(&details);
|
||||
#elif defined(__SYMBIAN32__)
|
||||
strcpy(brand_string, "Samsung ARMv6");
|
||||
num_cores = 1;
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
// For cache flushing on Symbian/iOS/Blackberry
|
||||
// For cache flushing on Symbian/iOS
|
||||
#ifdef __SYMBIAN32__
|
||||
#include <e32std.h>
|
||||
#endif
|
||||
|
@ -34,10 +34,6 @@
|
|||
#include <sys/mman.h>
|
||||
#endif
|
||||
|
||||
#ifdef BLACKBERRY
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
|
||||
#include "MemoryUtil.h"
|
||||
#include "ArmEmitter.h"
|
||||
#include "CPUDetect.h"
|
||||
|
@ -634,8 +630,6 @@ void ARMXEmitter::FlushIcacheSection(u8 *start, u8 *end)
|
|||
{
|
||||
#ifdef __SYMBIAN32__
|
||||
User::IMB_Range(start, end);
|
||||
#elif defined(BLACKBERRY)
|
||||
msync(start, end - start, MS_SYNC | MS_INVALIDATE_ICACHE);
|
||||
#elif defined(IOS)
|
||||
// Header file says this is equivalent to: sys_icache_invalidate(start, end - start);
|
||||
sys_cache_control(kCacheFunctionPrepareForExecution, start, end - start);
|
||||
|
|
|
@ -235,12 +235,8 @@ bool CreateDir(const std::string &path)
|
|||
}
|
||||
ERROR_LOG(COMMON, "CreateDir: CreateDirectory failed on %s: %i", path.c_str(), error);
|
||||
return false;
|
||||
#else
|
||||
#ifdef BLACKBERRY
|
||||
if (mkdir(path.c_str(), 0775) == 0)
|
||||
#else
|
||||
if (mkdir(path.c_str(), 0755) == 0)
|
||||
#endif
|
||||
return true;
|
||||
|
||||
int err = errno;
|
||||
|
|
|
@ -183,32 +183,8 @@ static const DefMappingStruct defaultShieldKeyMap[] = {
|
|||
{VIRTKEY_PAUSE, NKCODE_BACK },
|
||||
};
|
||||
|
||||
static const DefMappingStruct defaultBlackberryQWERTYKeyMap[] = {
|
||||
{CTRL_SQUARE, NKCODE_J},
|
||||
{CTRL_TRIANGLE, NKCODE_I},
|
||||
{CTRL_CIRCLE, NKCODE_L},
|
||||
{CTRL_CROSS, NKCODE_K},
|
||||
{CTRL_LTRIGGER, NKCODE_Q},
|
||||
{CTRL_RTRIGGER, NKCODE_W},
|
||||
{CTRL_START, NKCODE_SPACE},
|
||||
{CTRL_SELECT, NKCODE_ENTER},
|
||||
{CTRL_UP , NKCODE_W},
|
||||
{CTRL_DOWN , NKCODE_S},
|
||||
{CTRL_LEFT , NKCODE_A},
|
||||
{CTRL_RIGHT, NKCODE_D},
|
||||
{VIRTKEY_AXIS_Y_MAX, NKCODE_W},
|
||||
{VIRTKEY_AXIS_Y_MIN, NKCODE_S},
|
||||
{VIRTKEY_AXIS_X_MIN, NKCODE_A},
|
||||
{VIRTKEY_AXIS_X_MAX, NKCODE_D},
|
||||
{VIRTKEY_RAPID_FIRE , NKCODE_SHIFT_LEFT},
|
||||
{VIRTKEY_UNTHROTTLE , NKCODE_TAB},
|
||||
{VIRTKEY_SPEED_TOGGLE, NKCODE_GRAVE},
|
||||
{VIRTKEY_PAUSE , NKCODE_ESCAPE},
|
||||
{VIRTKEY_REWIND , NKCODE_DEL},
|
||||
};
|
||||
|
||||
static const DefMappingStruct defaultPadMap[] = {
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#if defined(ANDROID)
|
||||
{CTRL_CROSS , NKCODE_BUTTON_A},
|
||||
{CTRL_CIRCLE , NKCODE_BUTTON_B},
|
||||
{CTRL_SQUARE , NKCODE_BUTTON_X},
|
||||
|
@ -405,10 +381,6 @@ void SetDefaultKeyMap(DefaultMaps dmap, bool replace) {
|
|||
case DEFAULT_MAPPING_SHIELD:
|
||||
SetDefaultKeyMap(DEVICE_ID_PAD_0, defaultShieldKeyMap, ARRAY_SIZE(defaultShieldKeyMap), replace);
|
||||
break;
|
||||
case DEFAULT_MAPPING_BLACKBERRY_QWERTY:
|
||||
SetDefaultKeyMap(DEVICE_ID_KEYBOARD, defaultBlackberryQWERTYKeyMap, ARRAY_SIZE(defaultBlackberryQWERTYKeyMap), replace);
|
||||
replace = false;
|
||||
// Intentional fallthrough.
|
||||
case DEFAULT_MAPPING_PAD:
|
||||
SetDefaultKeyMap(DEVICE_ID_PAD_0, defaultPadMap, ARRAY_SIZE(defaultPadMap), replace);
|
||||
break;
|
||||
|
@ -875,13 +847,6 @@ void RestoreDefault() {
|
|||
} else {
|
||||
SetDefaultKeyMap(DEFAULT_MAPPING_PAD, true);
|
||||
}
|
||||
#elif defined(BLACKBERRY)
|
||||
std::string name = System_GetProperty(SYSPROP_NAME);
|
||||
if (IsBlackberryQWERTY(name)) {
|
||||
SetDefaultKeyMap(DEFAULT_MAPPING_BLACKBERRY_QWERTY, true);
|
||||
} else {
|
||||
SetDefaultKeyMap(DEFAULT_MAPPING_PAD, true);
|
||||
}
|
||||
#else
|
||||
SetDefaultKeyMap(DEFAULT_MAPPING_KEYBOARD, true);
|
||||
SetDefaultKeyMap(DEFAULT_MAPPING_PAD, false);
|
||||
|
@ -957,12 +922,8 @@ bool IsXperiaPlay(const std::string &name) {
|
|||
return name == "Sony Ericsson:R800a" || name == "Sony Ericsson:R800i" || name == "Sony Ericsson:R800x" || name == "Sony Ericsson:R800at" || name == "Sony Ericsson:SO-01D" || name == "Sony Ericsson:zeus";
|
||||
}
|
||||
|
||||
bool IsBlackberryQWERTY(const std::string &name) {
|
||||
return name == "Blackberry:QWERTY";
|
||||
}
|
||||
|
||||
bool HasBuiltinController(const std::string &name) {
|
||||
return IsOuya(name) || IsXperiaPlay(name) || IsNvidiaShield(name) || IsBlackberryQWERTY(name);
|
||||
return IsOuya(name) || IsXperiaPlay(name) || IsNvidiaShield(name);
|
||||
}
|
||||
|
||||
void NotifyPadConnected(const std::string &name) {
|
||||
|
|
|
@ -60,7 +60,6 @@ enum DefaultMaps {
|
|||
DEFAULT_MAPPING_PAD,
|
||||
DEFAULT_MAPPING_X360,
|
||||
DEFAULT_MAPPING_SHIELD,
|
||||
DEFAULT_MAPPING_BLACKBERRY_QWERTY,
|
||||
DEFAULT_MAPPING_OUYA,
|
||||
DEFAULT_MAPPING_XPERIA_PLAY,
|
||||
};
|
||||
|
@ -132,7 +131,6 @@ namespace KeyMap {
|
|||
void NotifyPadConnected(const std::string &name);
|
||||
bool IsNvidiaShield(const std::string &name);
|
||||
bool IsNvidiaShieldTV(const std::string &name);
|
||||
bool IsBlackberryQWERTY(const std::string &name);
|
||||
bool IsXperiaPlay(const std::string &name);
|
||||
bool IsOuya(const std::string &name);
|
||||
bool HasBuiltinController(const std::string &name);
|
||||
|
|
|
@ -199,9 +199,7 @@ void *MemArena::CreateView(s64 offset, size_t size, void *base)
|
|||
#else
|
||||
void *retval = mmap(base, size, PROT_READ | PROT_WRITE, MAP_SHARED |
|
||||
// Do not sync memory to underlying file. Linux has this by default.
|
||||
#ifdef BLACKBERRY
|
||||
MAP_NOSYNCFILE |
|
||||
#elif defined(__DragonFly__) || defined(__FreeBSD__)
|
||||
#if defined(__DragonFly__) || defined(__FreeBSD__)
|
||||
MAP_NOSYNC |
|
||||
#endif
|
||||
((base == 0) ? 0 : MAP_FIXED), fd, offset);
|
||||
|
|
|
@ -22,10 +22,6 @@
|
|||
#endif
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef BLACKBERRY
|
||||
using std::size_t;
|
||||
#endif
|
||||
|
||||
// Returns true if we need to avoid setting both writable and executable at the same time (W^X)
|
||||
bool PlatformIsWXExclusive();
|
||||
|
||||
|
|
|
@ -39,10 +39,6 @@ u32 Timer::GetTimeMs()
|
|||
return GetTickCount();
|
||||
#elif defined(_WIN32)
|
||||
return timeGetTime();
|
||||
#elif defined(BLACKBERRY)
|
||||
struct timespec time;
|
||||
clock_gettime(CLOCK_MONOTONIC, &time);
|
||||
return (u32)(time.tv_sec * 1000 + time.tv_nsec / 1000000);
|
||||
#else
|
||||
// REALTIME is probably not a good idea for measuring updates.
|
||||
struct timeval t;
|
||||
|
|
|
@ -403,15 +403,7 @@ static int DefaultInternalResolution() {
|
|||
}
|
||||
|
||||
static int DefaultZoomType() {
|
||||
#ifdef BLACKBERRY
|
||||
if (pixel_xres < 1.3 * pixel_yres) {
|
||||
return 1;
|
||||
} else {
|
||||
return 2;
|
||||
}
|
||||
#else
|
||||
return 2;
|
||||
#endif
|
||||
}
|
||||
|
||||
static bool DefaultTimerHack() {
|
||||
|
@ -946,7 +938,7 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) {
|
|||
// Sometimes the download may not be finished when the main screen shows (if the user dismisses the
|
||||
// splash screen quickly), but then we'll just show the notification next time instead, we store the
|
||||
// upgrade number in the ini.
|
||||
#if !defined(ARMEABI) // blackberry and stuff? why do we still keep this check?
|
||||
#if !defined(ARMEABI) // which platforms? why do we still keep this check?
|
||||
if (iRunCount % 10 == 0 && bCheckForNewVersion) {
|
||||
std::shared_ptr<http::Download> dl = g_DownloadManager.StartDownloadWithCallback(
|
||||
"http://www.ppsspp.org/version.json", "", &DownloadCompletedCallback);
|
||||
|
|
|
@ -36,10 +36,6 @@
|
|||
|
||||
#include <algorithm>
|
||||
|
||||
#ifdef BLACKBERRY
|
||||
using std::strnlen;
|
||||
#endif
|
||||
|
||||
static const std::string ICON0_FILENAME = "ICON0.PNG";
|
||||
static const std::string ICON1_FILENAME = "ICON1.PMF";
|
||||
static const std::string PIC1_FILENAME = "PIC1.PNG";
|
||||
|
|
|
@ -24,10 +24,6 @@
|
|||
#include "Core/HLE/sceKernelMemory.h"
|
||||
#include "Core/HLE/sceKernelModule.h"
|
||||
|
||||
#ifdef BLACKBERRY
|
||||
using std::strnlen;
|
||||
#endif
|
||||
|
||||
const char *ElfReader::GetSectionName(int section) const {
|
||||
if (sections[section].sh_type == SHT_NULL)
|
||||
return 0;
|
||||
|
|
|
@ -43,10 +43,6 @@
|
|||
#include "Core/HLE/sceKernelInterrupt.h"
|
||||
#include "Core/HLE/HLE.h"
|
||||
|
||||
#ifdef BLACKBERRY
|
||||
using std::strnlen;
|
||||
#endif
|
||||
|
||||
enum
|
||||
{
|
||||
// Do nothing after the syscall.
|
||||
|
|
|
@ -60,10 +60,6 @@
|
|||
#include "GPU/GPUInterface.h"
|
||||
#include "GPU/GPUState.h"
|
||||
|
||||
#ifdef BLACKBERRY
|
||||
using std::strnlen;
|
||||
#endif
|
||||
|
||||
enum {
|
||||
PSP_THREAD_ATTR_USER = 0x80000000
|
||||
};
|
||||
|
|
|
@ -97,7 +97,7 @@ time_t rtc_timegm(struct tm *tm)
|
|||
return _mkgmtime(tm);
|
||||
}
|
||||
|
||||
#elif (defined(__GLIBC__) && !defined(ANDROID)) || defined(BLACKBERRY) || defined(__SYMBIAN32__)
|
||||
#elif (defined(__GLIBC__) && !defined(ANDROID)) || defined(__SYMBIAN32__)
|
||||
#define rtc_timegm timegm
|
||||
#else
|
||||
|
||||
|
|
|
@ -44,10 +44,6 @@ enum RegMIPSLoc {
|
|||
ML_MEM,
|
||||
};
|
||||
|
||||
// These collide with something on Blackberry.
|
||||
#undef MAP_NOINIT
|
||||
#undef MAP_READ
|
||||
|
||||
// Initing is the default so the flag is reversed.
|
||||
enum {
|
||||
MAP_DIRTY = 1,
|
||||
|
|
|
@ -25,10 +25,6 @@
|
|||
#include "Core/MIPS/MIPSVFPUUtils.h"
|
||||
#include "Common/ArmEmitter.h"
|
||||
|
||||
// These collide with something on Blackberry.
|
||||
#undef MAP_NOINIT
|
||||
#undef MAP_READ
|
||||
|
||||
namespace ArmJitConstants {
|
||||
|
||||
enum {
|
||||
|
|
|
@ -46,10 +46,6 @@ enum RegMIPSLoc {
|
|||
ML_MEM,
|
||||
};
|
||||
|
||||
// These collide with something on Blackberry.
|
||||
#undef MAP_NOINIT
|
||||
#undef MAP_READ
|
||||
|
||||
// Initing is the default so the flag is reversed.
|
||||
enum {
|
||||
MAP_DIRTY = 1,
|
||||
|
|
|
@ -25,10 +25,6 @@
|
|||
#include "Core/MIPS/MIPSVFPUUtils.h"
|
||||
#include "Common/Arm64Emitter.h"
|
||||
|
||||
// These collide with something on Blackberry.
|
||||
#undef MAP_NOINIT
|
||||
#undef MAP_READ
|
||||
|
||||
namespace Arm64JitConstants {
|
||||
|
||||
enum {
|
||||
|
|
|
@ -262,8 +262,6 @@ namespace Reporting
|
|||
return "Mac";
|
||||
#elif defined(__SYMBIAN32__)
|
||||
return "Symbian";
|
||||
#elif defined(BLACKBERRY)
|
||||
return "Blackberry";
|
||||
#elif defined(LOONGSON)
|
||||
return "Loongson";
|
||||
#elif defined(MAEMO)
|
||||
|
|
|
@ -8,7 +8,6 @@ maemo5|contains(MEEGO_EDITION,harmattan): CONFIG += maemo
|
|||
PLATFORM_NAME="generic"
|
||||
win32: PLATFORM_NAME="Windows"
|
||||
unix: PLATFORM_NAME="linux"
|
||||
qnx: PLATFORM_NAME="blackberry"
|
||||
mac: PLATFORM_NAME="macosx"
|
||||
ios: PLATFORM_NAME="ios"
|
||||
maemo: PLATFORM_NAME="maemo"
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
# Use a mkspec that allows g++
|
||||
DEFINES += BLACKBERRY "_QNX_SOURCE=1" "_C99=1"
|
||||
|
||||
!contains(CONFIG, staticlib) {
|
||||
# Executable
|
||||
LIBS += -lscreen -liconv
|
||||
}
|
|
@ -357,9 +357,6 @@ void GameSettingsScreen::CreateViews() {
|
|||
graphicsSettings->Add(new ItemHeader(gr->T("Overlay Information")));
|
||||
static const char *fpsChoices[] = {
|
||||
"None", "Speed", "FPS", "Both"
|
||||
#ifdef BLACKBERRY
|
||||
, "Statistics"
|
||||
#endif
|
||||
};
|
||||
graphicsSettings->Add(new PopupMultiChoice(&g_Config.iShowFPSCounter, gr->T("Show FPS Counter"), fpsChoices, 0, ARRAY_SIZE(fpsChoices), gr->GetName(), screenManager()));
|
||||
graphicsSettings->Add(new CheckBox(&g_Config.bShowDebugStats, gr->T("Show Debug Statistics")))->OnClick.Handle(this, &GameSettingsScreen::OnJitAffectingSetting);
|
||||
|
|
|
@ -435,8 +435,6 @@ UI::EventReturn GameBrowser::HomeClick(UI::EventParams &e) {
|
|||
if (!folder.size())
|
||||
return UI::EVENT_DONE;
|
||||
path_.SetPath(folder);
|
||||
#elif defined(BLACKBERRY)
|
||||
path_.SetPath(std::string(getenv("PERIMETER_HOME")) + "/shared/misc");
|
||||
#else
|
||||
path_.SetPath(getenv("HOME"));
|
||||
#endif
|
||||
|
|
|
@ -631,8 +631,6 @@ void CreditsScreen::render() {
|
|||
cr->T("tools", "Free tools used:"),
|
||||
#ifdef ANDROID
|
||||
"Android SDK + NDK",
|
||||
#elif defined(BLACKBERRY)
|
||||
"Blackberry NDK",
|
||||
#endif
|
||||
#if defined(USING_QT_UI)
|
||||
"Qt",
|
||||
|
|
|
@ -317,7 +317,7 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch
|
|||
// We want this to be FIRST.
|
||||
#ifdef USING_QT_UI
|
||||
VFSRegister("", new AssetsAssetReader());
|
||||
#elif defined(BLACKBERRY) || defined(IOS)
|
||||
#elif defined(IOS)
|
||||
// Packed assets are included in app
|
||||
VFSRegister("", new DirectoryAssetReader(external_dir));
|
||||
#elif !defined(MOBILE_DEVICE) && !defined(_WIN32)
|
||||
|
@ -340,7 +340,7 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch
|
|||
// most sense.
|
||||
g_Config.memStickDirectory = std::string(external_dir) + "/";
|
||||
g_Config.flash0Directory = std::string(external_dir) + "/flash0/";
|
||||
#elif defined(BLACKBERRY) || defined(__SYMBIAN32__) || defined(MAEMO) || defined(IOS)
|
||||
#elif defined(__SYMBIAN32__) || defined(MAEMO) || defined(IOS)
|
||||
g_Config.memStickDirectory = user_data_path;
|
||||
g_Config.flash0Directory = std::string(external_dir) + "/flash0/";
|
||||
#elif !defined(_WIN32)
|
||||
|
@ -450,7 +450,7 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch
|
|||
if (g_Config.currentDirectory == "") {
|
||||
#if defined(ANDROID)
|
||||
g_Config.currentDirectory = external_dir;
|
||||
#elif defined(BLACKBERRY) || defined(__SYMBIAN32__) || defined(MAEMO) || defined(IOS) || defined(_WIN32)
|
||||
#elif defined(__SYMBIAN32__) || defined(MAEMO) || defined(IOS) || defined(_WIN32)
|
||||
g_Config.currentDirectory = savegame_dir;
|
||||
#else
|
||||
if (getenv("HOME") != NULL)
|
||||
|
|
|
@ -42,7 +42,7 @@ inline float clamp(float f) {
|
|||
|
||||
Tilt TiltEventProcessor::NormalizeTilt(const Tilt &tilt){
|
||||
// Normalise the accelerometer manually per-platform, to 'g'
|
||||
#if defined(ANDROID) || defined(BLACKBERRY) || defined(__SYMBIAN32__)
|
||||
#if defined(ANDROID) || defined(__SYMBIAN32__)
|
||||
// Values are in metres per second. Divide by 9.8 to get 'g' value
|
||||
float maxX = 9.8f, maxY = 9.8f;
|
||||
#else
|
||||
|
|
19
b.sh
19
b.sh
|
@ -1,13 +1,5 @@
|
|||
#!/bin/bash
|
||||
CMAKE=1
|
||||
# Check Blackberry NDK
|
||||
BB_OS=`cat ${QNX_TARGET}/etc/qversion 2>/dev/null`
|
||||
if [ ! -z "$BB_OS" ]; then
|
||||
CMAKE_ARGS="-DCMAKE_TOOLCHAIN_FILE=Blackberry/bb.toolchain.cmake -DBLACKBERRY=${BB_OS} ${CMAKE_ARGS}"
|
||||
DEBUG_ARGS="-devMode -debugToken ${QNX_CONFIGURATION}/../debugtoken.bar"
|
||||
PACKAGE=1
|
||||
TARGET_OS=Blackberry
|
||||
fi
|
||||
|
||||
# Check Symbian NDK
|
||||
if [ ! -z "$EPOCROOT" ]; then
|
||||
|
@ -57,12 +49,6 @@ do
|
|||
--no-package) echo "Packaging disabled"
|
||||
PACKAGE=0
|
||||
;;
|
||||
--release-package) echo "Blackberry release package enabled"
|
||||
if [ ! -f "Blackberry/build.txt" ]; then
|
||||
echo "1" > "Blackberry/build.txt"
|
||||
fi
|
||||
DEBUG_ARGS="-buildId ../Blackberry/build.txt"
|
||||
;;
|
||||
--*) echo "Bad option: $1"
|
||||
exit 1
|
||||
;;
|
||||
|
@ -103,10 +89,7 @@ fi
|
|||
make -j4 $MAKE_OPT
|
||||
|
||||
if [ "$PACKAGE" == "1" ]; then
|
||||
if [ "$TARGET_OS" == "Blackberry" ]; then
|
||||
cp ../Blackberry/bar-descriptor.xml .
|
||||
blackberry-nativepackager -package PPSSPP.bar bar-descriptor.xml $DEBUG_ARGS
|
||||
elif [ "$TARGET_OS" == "Symbian" ]; then
|
||||
if [ "$TARGET_OS" == "Symbian" ]; then
|
||||
make sis
|
||||
elif [ "$TARGET_OS" == "iOS" ]; then
|
||||
xcodebuild -configuration Release
|
||||
|
|
|
@ -1,86 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2013 Sacha Refshauge
|
||||
*
|
||||
*/
|
||||
// Blackberry implementation of the framework.
|
||||
#ifndef BLACKBERRYAUDIO_H
|
||||
#define BLACKBERRYAUDIO_H
|
||||
|
||||
#include <AL/al.h>
|
||||
#include <AL/alc.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "base/NativeApp.h"
|
||||
|
||||
#define AUDIO_FREQ 44100
|
||||
#define SAMPLE_SIZE 2048
|
||||
class BlackberryAudio
|
||||
{
|
||||
public:
|
||||
BlackberryAudio()
|
||||
{
|
||||
alcDevice = alcOpenDevice(NULL);
|
||||
if (alContext = alcCreateContext(alcDevice, NULL))
|
||||
alcMakeContextCurrent(alContext);
|
||||
alGenSources(1, &source);
|
||||
alGenBuffers(1, &buffer);
|
||||
pthread_attr_t attr;
|
||||
pthread_attr_init(&attr);
|
||||
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
|
||||
pthread_create(&thread_handle, &attr, &BlackberryAudio::staticThreadProc, this);
|
||||
}
|
||||
~BlackberryAudio()
|
||||
{
|
||||
pthread_cancel(thread_handle);
|
||||
alcMakeContextCurrent(NULL);
|
||||
if (alContext)
|
||||
{
|
||||
alcDestroyContext(alContext);
|
||||
alContext = NULL;
|
||||
}
|
||||
if (alcDevice)
|
||||
{
|
||||
alcCloseDevice(alcDevice);
|
||||
alcDevice = NULL;
|
||||
}
|
||||
}
|
||||
static void* staticThreadProc(void* arg)
|
||||
{
|
||||
return reinterpret_cast<BlackberryAudio*>(arg)->RunAudio();
|
||||
}
|
||||
private:
|
||||
void* RunAudio()
|
||||
{
|
||||
while(true)
|
||||
{
|
||||
size_t frames_ready;
|
||||
alGetSourcei(source, AL_SOURCE_STATE, &state);
|
||||
if (state != AL_PLAYING) {
|
||||
frames_ready = NativeMix((short*)stream, 5*SAMPLE_SIZE);
|
||||
}
|
||||
else
|
||||
frames_ready = 0;
|
||||
if (frames_ready > 0)
|
||||
{
|
||||
const size_t bytes_ready = frames_ready * sizeof(short) * 2;
|
||||
alSourcei(source, AL_BUFFER, 0);
|
||||
alBufferData(buffer, AL_FORMAT_STEREO16, stream, bytes_ready, AUDIO_FREQ);
|
||||
alSourcei(source, AL_BUFFER, buffer);
|
||||
alSourcePlay(source);
|
||||
// TODO: Maybe this could get behind?
|
||||
usleep((1000000 * SAMPLE_SIZE) / AUDIO_FREQ);
|
||||
}
|
||||
else
|
||||
usleep(10000);
|
||||
}
|
||||
}
|
||||
ALCdevice *alcDevice;
|
||||
ALCcontext *alContext;
|
||||
ALenum state;
|
||||
ALuint buffer;
|
||||
ALuint source;
|
||||
char stream[20*SAMPLE_SIZE];
|
||||
pthread_t thread_handle;
|
||||
};
|
||||
#endif
|
||||
|
|
@ -1,175 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2013 Sacha Refshauge
|
||||
*
|
||||
*/
|
||||
// Blackberry implementation of the framework.
|
||||
#include "BlackberryMain.h"
|
||||
|
||||
const char* BlackberryMain::displayTypeString(int type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case SCREEN_DISPLAY_TYPE_INTERNAL:
|
||||
return "Internal"; break;
|
||||
case SCREEN_DISPLAY_TYPE_COMPOSITE:
|
||||
return "Composite"; break;
|
||||
case SCREEN_DISPLAY_TYPE_DVI:
|
||||
return "DVI"; break;
|
||||
case SCREEN_DISPLAY_TYPE_HDMI:
|
||||
return "HDMI"; break;
|
||||
case SCREEN_DISPLAY_TYPE_DISPLAYPORT:
|
||||
return "DisplayPort"; break;
|
||||
case SCREEN_DISPLAY_TYPE_OTHER:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return "Unknown Port";
|
||||
}
|
||||
|
||||
void BlackberryMain::startDisplays() {
|
||||
int num_configs;
|
||||
EGLint attrib_list[]= {
|
||||
EGL_RED_SIZE, 8,
|
||||
EGL_GREEN_SIZE, 8,
|
||||
EGL_BLUE_SIZE, 8,
|
||||
EGL_DEPTH_SIZE, 24,
|
||||
EGL_STENCIL_SIZE, 8,
|
||||
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
|
||||
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
|
||||
EGL_NONE};
|
||||
|
||||
const EGLint attributes[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE };
|
||||
|
||||
screen_get_context_property_iv(screen_cxt, SCREEN_PROPERTY_DISPLAY_COUNT, &ndisplays);
|
||||
egl_disp = (EGLDisplay*)calloc(ndisplays, sizeof(EGLDisplay));
|
||||
egl_surf = (EGLSurface*)calloc(ndisplays, sizeof(EGLSurface));
|
||||
displays = (dispdata_t*)calloc(ndisplays, sizeof(dispdata_t));
|
||||
screen_win = (screen_window_t *)calloc(ndisplays, sizeof(screen_window_t ));
|
||||
screen_dpy = (screen_display_t*)calloc(ndisplays, sizeof(screen_display_t));
|
||||
screen_get_context_property_pv(screen_cxt, SCREEN_PROPERTY_DISPLAYS, (void **)screen_dpy);
|
||||
|
||||
// Common data
|
||||
int usage = SCREEN_USAGE_ROTATION | SCREEN_USAGE_OPENGL_ES2;
|
||||
int format = SCREEN_FORMAT_RGBX8888;
|
||||
int sensitivity = SCREEN_SENSITIVITY_ALWAYS;
|
||||
|
||||
// Initialise every display
|
||||
for (int i = 0; i < ndisplays; i++) {
|
||||
screen_get_display_property_iv(screen_dpy[i], SCREEN_PROPERTY_TYPE, &(displays[i].type));
|
||||
screen_get_display_property_iv(screen_dpy[i], SCREEN_PROPERTY_ATTACHED, &(displays[i].attached));
|
||||
|
||||
screen_create_window(&screen_win[i], screen_cxt);
|
||||
screen_set_window_property_iv(screen_win[i], SCREEN_PROPERTY_FORMAT, &format);
|
||||
screen_set_window_property_iv(screen_win[i], SCREEN_PROPERTY_USAGE, &usage);
|
||||
screen_set_window_property_iv(screen_win[i], SCREEN_PROPERTY_SENSITIVITY, &sensitivity);
|
||||
screen_set_window_property_pv(screen_win[i], SCREEN_PROPERTY_DISPLAY, (void **)&screen_dpy[i]);
|
||||
|
||||
egl_disp[i] = eglGetDisplay((EGLNativeDisplayType)i);
|
||||
eglInitialize(egl_disp[i], NULL, NULL);
|
||||
if (egl_cont == EGL_NO_CONTEXT) {
|
||||
eglChooseConfig(egl_disp[0], attrib_list, &egl_conf, 1, &num_configs);
|
||||
egl_cont = eglCreateContext(egl_disp[0], egl_conf, EGL_NO_CONTEXT, attributes);
|
||||
}
|
||||
|
||||
fprintf(stderr, "Display %i: %s, %s\n", i, displayTypeString(displays[i].type), displays[i].attached ? "Attached" : "Detached");
|
||||
if (displays[i].attached)
|
||||
realiseDisplay(i);
|
||||
}
|
||||
#ifdef ARM
|
||||
screen_get_display_property_iv(screen_dpy[0], SCREEN_PROPERTY_DPI, &dpi); // Only internal display has DPI
|
||||
// We only use dpi to calculate the width. Smaller aspect ratios have giant text despite high DPI.
|
||||
dpi = dpi * (((float)displays[0].width/(float)displays[0].height) / (16.0/9.0)); // Adjust to 16:9
|
||||
#else
|
||||
dpi = 340.0f;
|
||||
#endif
|
||||
g_dpi_scale = 210.0f / dpi;
|
||||
switchDisplay(screen_ui);
|
||||
}
|
||||
|
||||
void BlackberryMain::realiseDisplay(int idx) {
|
||||
const EGLint egl_surfaceAttr[] = { EGL_RENDER_BUFFER, EGL_BACK_BUFFER, EGL_NONE };
|
||||
int size[2] = { atoi(getenv("WIDTH")), atoi(getenv("HEIGHT")) };
|
||||
if (idx != 0)
|
||||
screen_get_display_property_iv(screen_dpy[idx], SCREEN_PROPERTY_SIZE, size);
|
||||
|
||||
displays[idx].width = size[0];
|
||||
displays[idx].height = size[1];
|
||||
screen_set_window_property_iv(screen_win[idx], SCREEN_PROPERTY_BUFFER_SIZE, size);
|
||||
screen_create_window_buffers(screen_win[idx], 2); // Double buffered
|
||||
fprintf(stderr, "Display %i realised with %ix%i\n", idx, size[0], size[1]);
|
||||
|
||||
egl_surf[idx] = eglCreateWindowSurface(egl_disp[idx], egl_conf, screen_win[idx], egl_surfaceAttr);
|
||||
|
||||
// Only enable for devices with hardware QWERTY, 1:1 aspect ratio
|
||||
if ((pixel_xres == pixel_yres) && displays[idx].type != SCREEN_DISPLAY_TYPE_INTERNAL)
|
||||
{
|
||||
screen_emu = idx;
|
||||
if (emulating)
|
||||
switchDisplay(idx);
|
||||
}
|
||||
|
||||
displays[idx].realised = true;
|
||||
}
|
||||
|
||||
void BlackberryMain::unrealiseDisplay(int idx) {
|
||||
if (displays[idx].type != SCREEN_DISPLAY_TYPE_INTERNAL) // Always true, only external can unrealise
|
||||
{
|
||||
screen_emu = screen_ui;
|
||||
if (emulating)
|
||||
switchDisplay(screen_ui);
|
||||
}
|
||||
killDisplay(idx, false);
|
||||
displays[idx].realised = false;
|
||||
}
|
||||
|
||||
void BlackberryMain::switchDisplay(int idx) {
|
||||
static int screen_curr = -1;
|
||||
if (idx != screen_curr) {
|
||||
pixel_xres = displays[idx].width;
|
||||
pixel_yres = displays[idx].height;
|
||||
dp_xres = (int)(pixel_xres * g_dpi_scale);
|
||||
dp_yres = (int)(pixel_yres * g_dpi_scale);
|
||||
screen_curr = idx;
|
||||
eglMakeCurrent(egl_disp[idx], egl_surf[idx], egl_surf[idx], egl_cont);
|
||||
}
|
||||
if (emulating) {
|
||||
PSP_CoreParameter().pixelWidth = pixel_xres;
|
||||
PSP_CoreParameter().pixelHeight = pixel_yres;
|
||||
}
|
||||
}
|
||||
|
||||
void BlackberryMain::killDisplays() {
|
||||
for (int i = 0; i < ndisplays; i++) {
|
||||
killDisplay(i, true);
|
||||
}
|
||||
if (egl_cont != EGL_NO_CONTEXT) {
|
||||
eglDestroyContext(egl_disp[0], egl_cont);
|
||||
egl_cont = EGL_NO_CONTEXT;
|
||||
}
|
||||
free(egl_disp);
|
||||
free(egl_surf);
|
||||
eglReleaseThread();
|
||||
free(screen_dpy);
|
||||
}
|
||||
|
||||
void BlackberryMain::killDisplay(int idx, bool killContext) {
|
||||
if (egl_disp[idx] != EGL_NO_DISPLAY) {
|
||||
if (killContext)
|
||||
eglMakeCurrent(egl_disp[idx], EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
||||
if (egl_surf[idx] != EGL_NO_SURFACE) {
|
||||
eglDestroySurface(egl_disp[idx], egl_surf[idx]);
|
||||
egl_surf[idx] = EGL_NO_SURFACE;
|
||||
}
|
||||
if (killContext)
|
||||
{
|
||||
eglTerminate(egl_disp[idx]);
|
||||
egl_disp[idx] = EGL_NO_DISPLAY;
|
||||
}
|
||||
}
|
||||
if (killContext && screen_win[idx] != NULL) {
|
||||
screen_destroy_window(screen_win[idx]);
|
||||
screen_win[idx] = NULL;
|
||||
}
|
||||
screen_destroy_window_buffers(screen_win[idx]);
|
||||
}
|
||||
|
|
@ -1,377 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2013 Sacha Refshauge
|
||||
*
|
||||
*/
|
||||
// Blackberry implementation of the framework.
|
||||
|
||||
#include <pwd.h>
|
||||
#include <unistd.h>
|
||||
#include <string>
|
||||
#include <string.h>
|
||||
|
||||
#include <bps/locale.h> // Get locale
|
||||
#include <bps/navigator_invoke.h> // Receive invocation messages
|
||||
#include "BlackberryMain.h"
|
||||
#include "base/NKCodeFromBlackberry.h"
|
||||
#include "gfx_es2/gpu_features.h"
|
||||
#include "thin3d/thin3d.h"
|
||||
|
||||
#include "Core/System.h"
|
||||
#include "Core/Config.h"
|
||||
#include "Core/Core.h"
|
||||
#include "UI/MiscScreens.h"
|
||||
#include "Common/GraphicsContext.h"
|
||||
|
||||
static GraphicsContext *graphicsContext;
|
||||
|
||||
class GLDummyGraphicsContext : public DummyGraphicsContext {
|
||||
public:
|
||||
Thin3DContext *CreateThin3DContext() override {
|
||||
CheckGLExtensions();
|
||||
return T3DCreateGLContext();
|
||||
}
|
||||
};
|
||||
|
||||
static bool g_quitRequested = false;
|
||||
|
||||
// Simple implementations of System functions
|
||||
|
||||
std::string System_GetProperty(SystemProperty prop) {
|
||||
switch (prop) {
|
||||
case SYSPROP_NAME: {
|
||||
std::string name = "Blackberry:";
|
||||
#ifdef ARM
|
||||
return name + ((pixel_xres != pixel_yres) ? "Touch" : "QWERTY");
|
||||
#else
|
||||
return name + "Simulator";
|
||||
#endif
|
||||
}
|
||||
case SYSPROP_LANGREGION: {
|
||||
char *locale = 0;
|
||||
locale_get_locale(&locale);
|
||||
return std::string(locale);
|
||||
}
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
int System_GetPropertyInt(SystemProperty prop) {
|
||||
switch (prop) {
|
||||
case SYSPROP_AUDIO_SAMPLE_RATE:
|
||||
return 44100;
|
||||
case SYSPROP_DISPLAY_REFRESH_RATE:
|
||||
return 60000;
|
||||
case SYSPROP_DEVICE_TYPE:
|
||||
return DEVICE_TYPE_MOBILE;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
void System_SendMessage(const char *command, const char *parameter) {
|
||||
if (!strcmp(command, "finish")) {
|
||||
g_quitRequested = true;
|
||||
}
|
||||
}
|
||||
|
||||
void System_AskForPermission(SystemPermission permission) {}
|
||||
PermissionStatus System_GetPermissionStatus(SystemPermission permission) { return PERMISSION_STATUS_GRANTED; }
|
||||
|
||||
void SystemToast(const char *text) {
|
||||
dialog_instance_t dialog = 0;
|
||||
dialog_create_toast(&dialog);
|
||||
dialog_set_toast_message_text(dialog, text);
|
||||
dialog_set_toast_position(dialog, DIALOG_POSITION_TOP_CENTER);
|
||||
dialog_show(dialog);
|
||||
}
|
||||
|
||||
void ShowAd(int x, int y, bool center_x) {
|
||||
}
|
||||
|
||||
void ShowKeyboard() {
|
||||
virtualkeyboard_show();
|
||||
}
|
||||
|
||||
void Vibrate(int length_ms) {
|
||||
// Vibration: intensity strength(1-100), duration ms(0-5000)
|
||||
// Intensity: LOW = 1, MEDIUM = 10, HIGH = 100
|
||||
switch (length_ms) {
|
||||
case -1: // Keyboard Tap
|
||||
vibration_request(VIBRATION_INTENSITY_LOW, 50);
|
||||
break;
|
||||
case -2: // Virtual Key
|
||||
vibration_request(VIBRATION_INTENSITY_LOW, 25);
|
||||
break;
|
||||
case -3: // Long Press
|
||||
vibration_request(VIBRATION_INTENSITY_LOW, 50);
|
||||
break;
|
||||
default:
|
||||
vibration_request(VIBRATION_INTENSITY_LOW, length_ms);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void LaunchBrowser(const char *url)
|
||||
{
|
||||
char* error;
|
||||
navigator_invoke(url, &error);
|
||||
}
|
||||
|
||||
void LaunchMarket(const char *url)
|
||||
{
|
||||
char* error;
|
||||
navigator_invoke(url, &error);
|
||||
}
|
||||
|
||||
void LaunchEmail(const char *email_address)
|
||||
{
|
||||
char* error;
|
||||
navigator_invoke((std::string("mailto:") + email_address).c_str(), &error);
|
||||
}
|
||||
|
||||
InputState input_state;
|
||||
|
||||
void BlackberryMain::handleInput(screen_event_t screen_event)
|
||||
{
|
||||
TouchInput input;
|
||||
KeyInput key;
|
||||
int val, buttons, pointerId;
|
||||
int pair[2];
|
||||
screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_TYPE, &val);
|
||||
screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_SOURCE_POSITION, pair);
|
||||
|
||||
input_state.mouse_valid = true;
|
||||
switch(val)
|
||||
{
|
||||
// Touchscreen
|
||||
case SCREEN_EVENT_MTOUCH_TOUCH:
|
||||
case SCREEN_EVENT_MTOUCH_RELEASE: // Up, down
|
||||
screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_TOUCH_ID, &pointerId);
|
||||
input_state.pointer_down[pointerId] = (val == SCREEN_EVENT_MTOUCH_TOUCH);
|
||||
input_state.pointer_x[pointerId] = pair[0] * g_dpi_scale;
|
||||
input_state.pointer_y[pointerId] = pair[1] * g_dpi_scale;
|
||||
|
||||
input.x = pair[0] * g_dpi_scale;
|
||||
input.y = pair[1] * g_dpi_scale;
|
||||
input.flags = (val == SCREEN_EVENT_MTOUCH_TOUCH) ? TOUCH_DOWN : TOUCH_UP;
|
||||
input.id = pointerId;
|
||||
NativeTouch(input);
|
||||
break;
|
||||
case SCREEN_EVENT_MTOUCH_MOVE:
|
||||
screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_TOUCH_ID, &pointerId);
|
||||
input_state.pointer_x[pointerId] = pair[0] * g_dpi_scale;
|
||||
input_state.pointer_y[pointerId] = pair[1] * g_dpi_scale;
|
||||
|
||||
input.x = pair[0] * g_dpi_scale;
|
||||
input.y = pair[1] * g_dpi_scale;
|
||||
input.flags = TOUCH_MOVE;
|
||||
input.id = pointerId;
|
||||
NativeTouch(input);
|
||||
break;
|
||||
// Mouse, Simulator
|
||||
case SCREEN_EVENT_POINTER:
|
||||
screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_BUTTONS, &buttons);
|
||||
if (buttons == SCREEN_LEFT_MOUSE_BUTTON) { // Down
|
||||
input_state.pointer_x[0] = pair[0] * g_dpi_scale;
|
||||
input_state.pointer_y[0] = pair[1] * g_dpi_scale;
|
||||
input_state.pointer_down[0] = true;
|
||||
|
||||
input.x = pair[0] * g_dpi_scale;
|
||||
input.y = pair[1] * g_dpi_scale;
|
||||
input.flags = TOUCH_DOWN;
|
||||
input.id = 0;
|
||||
NativeTouch(input);
|
||||
} else if (input_state.pointer_down[0]) { // Up
|
||||
input_state.pointer_x[0] = pair[0] * g_dpi_scale;
|
||||
input_state.pointer_y[0] = pair[1] * g_dpi_scale;
|
||||
input_state.pointer_down[0] = false;
|
||||
|
||||
input.x = pair[0] * g_dpi_scale;
|
||||
input.y = pair[1] * g_dpi_scale;
|
||||
input.flags = TOUCH_UP;
|
||||
input.id = 0;
|
||||
NativeTouch(input);
|
||||
}
|
||||
break;
|
||||
// Keyboard
|
||||
case SCREEN_EVENT_KEYBOARD:
|
||||
int flags, value;
|
||||
screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_KEY_FLAGS, &flags);
|
||||
screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_KEY_SYM, &value);
|
||||
NativeKey(KeyInput(DEVICE_ID_KEYBOARD, KeyMapRawBlackberrytoNative.find(value)->second, (flags & KEY_DOWN) ? KEY_DOWN : KEY_UP));
|
||||
break;
|
||||
// Gamepad
|
||||
case SCREEN_EVENT_GAMEPAD:
|
||||
case SCREEN_EVENT_JOYSTICK:
|
||||
int analog0[3];
|
||||
screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_BUTTONS, &buttons);
|
||||
for (int i = 0; i < 32; i++) {
|
||||
int mask = 1 << i;
|
||||
if ((old_buttons & mask) != (buttons & mask))
|
||||
NativeKey(KeyInput(DEVICE_ID_PAD_0, KeyMapPadBlackberrytoNative.find(mask)->second, (buttons & mask) ? KEY_DOWN : KEY_UP));
|
||||
}
|
||||
if (!screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_ANALOG0, analog0)) {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
AxisInput axis;
|
||||
axis.axisId = JOYSTICK_AXIS_X + i;
|
||||
// 1.2 to try to approximate the PSP's clamped rectangular range.
|
||||
axis.value = 1.2 * analog0[i] / 128.0f;
|
||||
if (axis.value > 1.0f) axis.value = 1.0f;
|
||||
if (axis.value < -1.0f) axis.value = -1.0f;
|
||||
axis.deviceId = DEVICE_ID_PAD_0;
|
||||
axis.flags = 0;
|
||||
NativeAxis(axis);
|
||||
}
|
||||
}
|
||||
old_buttons = buttons;
|
||||
break;
|
||||
case SCREEN_EVENT_DISPLAY:
|
||||
screen_display_t new_dpy = NULL;
|
||||
screen_get_event_property_pv(screen_event, SCREEN_PROPERTY_DISPLAY, (void **)&new_dpy);
|
||||
for (int i = 0; i < ndisplays; i++) {
|
||||
if (new_dpy != screen_dpy[i])
|
||||
continue;
|
||||
int active = 0;
|
||||
screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_ATTACHED, &active);
|
||||
if (active) {
|
||||
int size[2];
|
||||
screen_get_display_property_iv(screen_dpy[i], SCREEN_PROPERTY_SIZE, size);
|
||||
if (size[0] == 0 || size[1] == 0)
|
||||
active = 0;
|
||||
}
|
||||
if (active && !displays[i].attached)
|
||||
realiseDisplay(i);
|
||||
else if (!active && displays[i].attached && displays[i].realised)
|
||||
unrealiseDisplay(i);
|
||||
displays[i].attached = active;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void BlackberryMain::startMain(int argc, char *argv[]) {
|
||||
g_quitRequested = false;
|
||||
// Receive events from window manager
|
||||
screen_create_context(&screen_cxt, 0);
|
||||
// Initialise Blackberry Platform Services
|
||||
bps_initialize();
|
||||
// TODO: Enable/disable based on setting
|
||||
sensor_set_rate(SENSOR_TYPE_ACCELEROMETER, 25000);
|
||||
sensor_request_events(SENSOR_TYPE_ACCELEROMETER);
|
||||
|
||||
net::Init();
|
||||
startDisplays();
|
||||
screen_request_events(screen_cxt);
|
||||
navigator_request_events(0);
|
||||
dialog_request_events(0);
|
||||
vibration_request_events(0);
|
||||
NativeInit(argc, (const char **)argv, "/accounts/1000/shared/misc/", "app/native/assets/", nullptr);
|
||||
graphicsContext = new GLDummyGraphicsContext();
|
||||
NativeInitGraphics(graphicsContext);
|
||||
audio = new BlackberryAudio();
|
||||
runMain();
|
||||
}
|
||||
|
||||
void BlackberryMain::runMain() {
|
||||
bool running = true;
|
||||
while (running && !g_quitRequested) {
|
||||
input_state.mouse_valid = false;
|
||||
input_state.accelerometer_valid = false;
|
||||
while (true) {
|
||||
// Handle Blackberry events
|
||||
bps_event_t *event = NULL;
|
||||
bps_get_event(&event, 0);
|
||||
if (event == NULL)
|
||||
break; // Ran out of events
|
||||
int domain = bps_event_get_domain(event);
|
||||
if (domain == screen_get_domain()) {
|
||||
handleInput(screen_event_get_event(event));
|
||||
} else if (domain == navigator_get_domain()) {
|
||||
switch(bps_event_get_code(event))
|
||||
{
|
||||
case NAVIGATOR_INVOKE_TARGET:
|
||||
{
|
||||
const navigator_invoke_invocation_t *invoke = navigator_invoke_event_get_invocation(event);
|
||||
if(invoke) {
|
||||
boot_filename = navigator_invoke_invocation_get_uri(invoke)+7; // Remove file://
|
||||
}
|
||||
}
|
||||
break;
|
||||
case NAVIGATOR_ORIENTATION:
|
||||
sensor_remap_coordinates(navigator_event_get_orientation_angle(event));
|
||||
break;
|
||||
case NAVIGATOR_WINDOW_STATE:
|
||||
Core_NotifyWindowHidden(navigator_event_get_window_state(event) != NAVIGATOR_WINDOW_FULLSCREEN);
|
||||
break;
|
||||
case NAVIGATOR_BACK:
|
||||
case NAVIGATOR_SWIPE_DOWN:
|
||||
NativeKey(KeyInput(DEVICE_ID_KEYBOARD, NKCODE_BACK, KEY_DOWN));
|
||||
break;
|
||||
case NAVIGATOR_EXIT:
|
||||
return;
|
||||
}
|
||||
} else if (domain == sensor_get_domain()) {
|
||||
if (SENSOR_ACCELEROMETER_READING == bps_event_get_code(event)) {
|
||||
sensor_event_get_xyz(event, &(input_state.acc.y), &(input_state.acc.x), &(input_state.acc.z));
|
||||
AxisInput axis;
|
||||
axis.deviceId = DEVICE_ID_ACCELEROMETER;
|
||||
axis.flags = 0;
|
||||
|
||||
axis.axisId = JOYSTICK_AXIS_ACCELEROMETER_X;
|
||||
axis.value = input_state.acc.x;
|
||||
NativeAxis(axis);
|
||||
|
||||
axis.axisId = JOYSTICK_AXIS_ACCELEROMETER_Y;
|
||||
axis.value = input_state.acc.y;
|
||||
NativeAxis(axis);
|
||||
|
||||
axis.axisId = JOYSTICK_AXIS_ACCELEROMETER_Z;
|
||||
axis.value = input_state.acc.z;
|
||||
NativeAxis(axis);
|
||||
}
|
||||
}
|
||||
}
|
||||
UpdateInputState(&input_state);
|
||||
// Work in Progress
|
||||
// Currently: Render to HDMI port (eg. 1080p) when in game. Render to device when in menu.
|
||||
// Idea: Render to all displays. Controls go to internal, game goes to external(s).
|
||||
if (GetUIState() == UISTATE_INGAME && !emulating) {
|
||||
emulating = true;
|
||||
switchDisplay(screen_emu);
|
||||
if (g_Config.iShowFPSCounter == 4) {
|
||||
int options = SCREEN_DEBUG_STATISTICS;
|
||||
screen_set_window_property_iv(screen_win[0], SCREEN_PROPERTY_DEBUG, &options);
|
||||
}
|
||||
} else if (GetUIState() != UISTATE_INGAME && emulating) {
|
||||
emulating = false;
|
||||
switchDisplay(screen_ui);
|
||||
}
|
||||
time_update();
|
||||
UpdateRunLoop(&input_state);
|
||||
// This handles VSync
|
||||
if (emulating)
|
||||
eglSwapBuffers(egl_disp[screen_emu], egl_surf[screen_emu]);
|
||||
else
|
||||
eglSwapBuffers(egl_disp[screen_ui], egl_surf[screen_ui]);
|
||||
}
|
||||
}
|
||||
|
||||
void BlackberryMain::endMain() {
|
||||
screen_stop_events(screen_cxt);
|
||||
bps_shutdown();
|
||||
NativeShutdownGraphics();
|
||||
delete audio;
|
||||
graphicsContext->Shutdown();
|
||||
delete graphicsContext;
|
||||
NativeShutdown();
|
||||
killDisplays();
|
||||
net::Shutdown();
|
||||
screen_destroy_context(screen_cxt);
|
||||
}
|
||||
|
||||
// Entry Point
|
||||
int main(int argc, char *argv[]) {
|
||||
delete new BlackberryMain(argc, argv);
|
||||
return 0;
|
||||
}
|
|
@ -1,93 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2013 Sacha Refshauge
|
||||
*
|
||||
*/
|
||||
// Blackberry implementation of the framework.
|
||||
#ifndef BLACKBERRYMAIN_H
|
||||
#define BLACKBERRYMAIN_H
|
||||
|
||||
// Blackberry specific
|
||||
#include <bps/bps.h> // Blackberry Platform Services
|
||||
#include <bps/screen.h> // Blackberry Window Manager
|
||||
#include <bps/navigator.h> // Invoke Service
|
||||
#include <bps/virtualkeyboard.h>// Keyboard Service
|
||||
#include <bps/sensor.h> // Accelerometer
|
||||
#include <bps/dialog.h> // Dialog Service (Toast=BB10)
|
||||
#include <bps/vibration.h> // Vibrate Service (BB10)
|
||||
#include "sys/keycodes.h"
|
||||
#include "input/keycodes.h"
|
||||
|
||||
// Display
|
||||
#include <EGL/egl.h>
|
||||
#include <screen/screen.h>
|
||||
#include <sys/platform.h>
|
||||
#include <GLES2/gl2.h>
|
||||
#include "Core/System.h"
|
||||
|
||||
// Native
|
||||
#include "base/timeutil.h"
|
||||
#include "gfx_es2/glsl_program.h"
|
||||
#include "file/zip_read.h"
|
||||
#include "base/NativeApp.h"
|
||||
#include "input/input_state.h"
|
||||
#include "net/resolve.h"
|
||||
#include "base/display.h"
|
||||
|
||||
#include "BlackberryAudio.h"
|
||||
|
||||
struct dispdata_t {
|
||||
int attached;
|
||||
int type;
|
||||
bool realised;
|
||||
int width, height;
|
||||
};
|
||||
|
||||
class BlackberryMain
|
||||
{
|
||||
public:
|
||||
BlackberryMain(int argc, char *argv[]) :
|
||||
emulating(false),
|
||||
screen_ui(0), screen_emu(0),
|
||||
old_buttons(0),
|
||||
egl_cont(EGL_NO_CONTEXT)
|
||||
{
|
||||
startMain(argc, argv);
|
||||
}
|
||||
~BlackberryMain() {
|
||||
endMain();
|
||||
}
|
||||
void startMain(int argc, char *argv[]);
|
||||
|
||||
private:
|
||||
void runMain();
|
||||
void endMain();
|
||||
|
||||
void handleInput(screen_event_t screen_event);
|
||||
|
||||
const char* displayTypeString(int type);
|
||||
void startDisplays();
|
||||
void* startDisplay(int idx);
|
||||
void realiseDisplay(int idx);
|
||||
void unrealiseDisplay(int idx);
|
||||
void switchDisplay(int idx);
|
||||
void killDisplays();
|
||||
void killDisplay(int idx, bool killContext);
|
||||
|
||||
BlackberryAudio* audio;
|
||||
dispdata_t *displays;
|
||||
int dpi;
|
||||
int ndisplays;
|
||||
int screen_ui, screen_emu;
|
||||
bool emulating;
|
||||
int old_buttons;
|
||||
EGLDisplay* egl_disp;
|
||||
EGLSurface* egl_surf;
|
||||
EGLContext egl_cont;
|
||||
EGLConfig egl_conf;
|
||||
screen_context_t screen_cxt;
|
||||
screen_display_t *screen_dpy;
|
||||
screen_window_t *screen_win;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,100 +0,0 @@
|
|||
#include <map>
|
||||
#include "util/const_map.h"
|
||||
|
||||
static const std::map<int, int> KeyMapPadBlackberrytoNative = InitConstMap<int, int>
|
||||
(SCREEN_A_GAME_BUTTON, NKCODE_BUTTON_A)
|
||||
(SCREEN_B_GAME_BUTTON, NKCODE_BUTTON_B)
|
||||
(SCREEN_C_GAME_BUTTON, NKCODE_BUTTON_C)
|
||||
(SCREEN_X_GAME_BUTTON, NKCODE_BUTTON_X)
|
||||
(SCREEN_Y_GAME_BUTTON, NKCODE_BUTTON_Y)
|
||||
(SCREEN_Z_GAME_BUTTON, NKCODE_BUTTON_Z)
|
||||
(SCREEN_MENU1_GAME_BUTTON, NKCODE_BUTTON_START)
|
||||
(SCREEN_MENU2_GAME_BUTTON, NKCODE_BUTTON_SELECT)
|
||||
(SCREEN_MENU3_GAME_BUTTON, NKCODE_MENU)
|
||||
(SCREEN_MENU4_GAME_BUTTON, NKCODE_BACK)
|
||||
(SCREEN_L1_GAME_BUTTON, NKCODE_BUTTON_L1)
|
||||
(SCREEN_L2_GAME_BUTTON, NKCODE_BUTTON_L2)
|
||||
(SCREEN_L3_GAME_BUTTON, NKCODE_OUYA_BUTTON_L3)
|
||||
(SCREEN_R1_GAME_BUTTON, NKCODE_BUTTON_R1)
|
||||
(SCREEN_R2_GAME_BUTTON, NKCODE_BUTTON_R2)
|
||||
(SCREEN_R3_GAME_BUTTON, NKCODE_OUYA_BUTTON_R3)
|
||||
(SCREEN_DPAD_UP_GAME_BUTTON, NKCODE_DPAD_UP)
|
||||
(SCREEN_DPAD_DOWN_GAME_BUTTON, NKCODE_DPAD_DOWN)
|
||||
(SCREEN_DPAD_LEFT_GAME_BUTTON, NKCODE_DPAD_LEFT)
|
||||
(SCREEN_DPAD_RIGHT_GAME_BUTTON, NKCODE_DPAD_RIGHT);
|
||||
|
||||
// TODO: Add any missing keys
|
||||
static const std::map<int, int> KeyMapRawBlackberrytoNative = InitConstMap<int, int>
|
||||
(KEYCODE_P, NKCODE_P)
|
||||
(KEYCODE_O, NKCODE_O)
|
||||
(KEYCODE_I, NKCODE_I)
|
||||
(KEYCODE_U, NKCODE_U)
|
||||
(KEYCODE_Y, NKCODE_Y)
|
||||
(KEYCODE_T, NKCODE_T)
|
||||
(KEYCODE_R, NKCODE_R)
|
||||
(KEYCODE_E, NKCODE_E)
|
||||
(KEYCODE_W, NKCODE_W)
|
||||
(KEYCODE_Q, NKCODE_Q)
|
||||
(KEYCODE_L, NKCODE_L)
|
||||
(KEYCODE_K, NKCODE_K)
|
||||
(KEYCODE_J, NKCODE_J)
|
||||
(KEYCODE_H, NKCODE_H)
|
||||
(KEYCODE_G, NKCODE_G)
|
||||
(KEYCODE_F, NKCODE_F)
|
||||
(KEYCODE_D, NKCODE_D)
|
||||
(KEYCODE_S, NKCODE_S)
|
||||
(KEYCODE_A, NKCODE_A)
|
||||
(KEYCODE_M, NKCODE_M)
|
||||
(KEYCODE_N, NKCODE_N)
|
||||
(KEYCODE_B, NKCODE_B)
|
||||
(KEYCODE_V, NKCODE_V)
|
||||
(KEYCODE_C, NKCODE_C)
|
||||
(KEYCODE_X, NKCODE_X)
|
||||
(KEYCODE_Z, NKCODE_Z)
|
||||
(KEYCODE_COMMA, NKCODE_COMMA)
|
||||
(KEYCODE_PERIOD, NKCODE_PERIOD)
|
||||
(KEYCODE_LEFT_ALT, NKCODE_ALT_LEFT)
|
||||
(KEYCODE_RIGHT_ALT, NKCODE_ALT_RIGHT)
|
||||
(KEYCODE_LEFT_SHIFT, NKCODE_SHIFT_LEFT)
|
||||
(KEYCODE_RIGHT_SHIFT, NKCODE_SHIFT_RIGHT)
|
||||
(KEYCODE_TAB, NKCODE_TAB)
|
||||
(KEYCODE_SPACE, NKCODE_SPACE)
|
||||
(KEYCODE_RETURN, NKCODE_ENTER)
|
||||
(KEYCODE_MINUS, NKCODE_MINUS)
|
||||
(KEYCODE_EQUAL, NKCODE_EQUALS)
|
||||
(KEYCODE_LEFT_BRACKET, NKCODE_LEFT_BRACKET)
|
||||
(KEYCODE_RIGHT_BRACKET, NKCODE_RIGHT_BRACKET)
|
||||
(KEYCODE_BACK_SLASH, NKCODE_BACKSLASH)
|
||||
(KEYCODE_SEMICOLON, NKCODE_SEMICOLON)
|
||||
(KEYCODE_APOSTROPHE, NKCODE_APOSTROPHE)
|
||||
(KEYCODE_SLASH, NKCODE_SLASH)
|
||||
(KEYCODE_AT, NKCODE_AT)
|
||||
(KEYCODE_PLUS, NKCODE_PLUS)
|
||||
(KEYCODE_ESCAPE, NKCODE_ESCAPE)
|
||||
(KEYCODE_DELETE, NKCODE_FORWARD_DEL)
|
||||
(KEYCODE_LEFT_CTRL, NKCODE_CTRL_LEFT)
|
||||
(KEYCODE_RIGHT_CTRL, NKCODE_CTRL_RIGHT)
|
||||
(KEYCODE_CAPS_LOCK, NKCODE_CAPS_LOCK)
|
||||
(KEYCODE_HOME, NKCODE_MOVE_HOME)
|
||||
(KEYCODE_END, NKCODE_MOVE_END)
|
||||
(KEYCODE_INSERT, NKCODE_INSERT)
|
||||
(KEYCODE_ZERO, NKCODE_0)
|
||||
(KEYCODE_ONE, NKCODE_1)
|
||||
(KEYCODE_TWO, NKCODE_2)
|
||||
(KEYCODE_THREE, NKCODE_3)
|
||||
(KEYCODE_FOUR, NKCODE_4)
|
||||
(KEYCODE_FIVE, NKCODE_5)
|
||||
(KEYCODE_SIX, NKCODE_6)
|
||||
(KEYCODE_SEVEN, NKCODE_7)
|
||||
(KEYCODE_EIGHT, NKCODE_8)
|
||||
(KEYCODE_NINE, NKCODE_9)
|
||||
(KEYCODE_KP_DIVIDE, NKCODE_NUMPAD_DIVIDE)
|
||||
(KEYCODE_KP_MULTIPLY, NKCODE_NUMPAD_MULTIPLY)
|
||||
(KEYCODE_KP_MINUS, NKCODE_NUMPAD_SUBTRACT)
|
||||
(KEYCODE_KP_PLUS, NKCODE_NUMPAD_ADD)
|
||||
(KEYCODE_KP_ENTER, NKCODE_NUMPAD_ENTER)
|
||||
(KEYCODE_LEFT, NKCODE_DPAD_LEFT)
|
||||
(KEYCODE_UP, NKCODE_DPAD_UP)
|
||||
(KEYCODE_RIGHT, NKCODE_DPAD_RIGHT)
|
||||
(KEYCODE_DOWN, NKCODE_DPAD_DOWN);
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
*/
|
||||
// Qt 4.7+ / 5.0+ implementation of the framework.
|
||||
// Currently supports: Android, Symbian, Blackberry, Maemo/Meego, Linux, Windows, Mac OSX
|
||||
// Currently supports: Android, Symbian, Maemo/Meego, Linux, Windows, Mac OSX
|
||||
|
||||
#include <QApplication>
|
||||
#include <QUrl>
|
||||
|
@ -49,8 +49,6 @@ std::string System_GetProperty(SystemProperty prop) {
|
|||
case SYSPROP_NAME:
|
||||
#ifdef __SYMBIAN32__
|
||||
return "Qt:Symbian";
|
||||
#elif defined(BLACKBERRY)
|
||||
return "Qt:Blackberry";
|
||||
#elif defined(MAEMO)
|
||||
return "Qt:Maemo";
|
||||
#elif defined(ANDROID)
|
||||
|
@ -80,8 +78,6 @@ int System_GetPropertyInt(SystemProperty prop) {
|
|||
case SYSPROP_DEVICE_TYPE:
|
||||
#ifdef __SYMBIAN32__
|
||||
return DEVICE_TYPE_MOBILE;
|
||||
#elif defined(BLACKBERRY)
|
||||
return DEVICE_TYPE_MOBILE;
|
||||
#elif defined(MAEMO)
|
||||
return DEVICE_TYPE_MOBILE;
|
||||
#elif defined(ANDROID)
|
||||
|
@ -480,9 +476,6 @@ int main(int argc, char *argv[])
|
|||
#elif defined(__SYMBIAN32__)
|
||||
savegame_dir = "E:/PPSSPP";
|
||||
assets_dir = "E:/PPSSPP";
|
||||
#elif defined(BLACKBERRY)
|
||||
savegame_dir = "/accounts/1000/shared/misc";
|
||||
assets_dir = "app/native/assets";
|
||||
#elif defined(MAEMO)
|
||||
savegame_dir = "/home/user/MyDocs/PPSSPP";
|
||||
assets_dir = "/opt/PPSSPP";
|
||||
|
|
|
@ -15,42 +15,6 @@
|
|||
#define strncasecmp _strnicmp
|
||||
#endif
|
||||
|
||||
#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)
|
||||
{
|
||||
free(result);
|
||||
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
|
||||
|
||||
// Dumb wrapper around itoa, providing a buffer. Declare this on the stack.
|
||||
class ITOA {
|
||||
public:
|
||||
|
|
|
@ -36,12 +36,6 @@ double real_time_now() {
|
|||
return elapsed * frequencyMult;
|
||||
}
|
||||
|
||||
#elif defined(BLACKBERRY)
|
||||
double real_time_now() {
|
||||
struct timespec time;
|
||||
clock_gettime(CLOCK_MONOTONIC, &time); // Linux must use CLOCK_MONOTONIC_RAW due to time warps
|
||||
return time.tv_sec + time.tv_nsec / 1.0e9;
|
||||
}
|
||||
#else
|
||||
|
||||
uint64_t _frequency = 0;
|
||||
|
|
|
@ -27,13 +27,7 @@ public:
|
|||
}
|
||||
std::string GetFriendlyPath() {
|
||||
std::string str = GetPath();
|
||||
#if defined(BLACKBERRY)
|
||||
char *home = getenv("PERIMETER_HOME");
|
||||
if (home != NULL && !strncmp(str.c_str(), home, strlen(home))) {
|
||||
str = str.substr(strlen(home));
|
||||
str.insert(0, 1, '~');
|
||||
}
|
||||
#elif defined(ANDROID)
|
||||
#if defined(ANDROID)
|
||||
// Do nothing
|
||||
#elif defined(__linux)
|
||||
char *home = getenv("HOME");
|
||||
|
|
|
@ -36,7 +36,7 @@ typedef char GLchar;
|
|||
#define GL_MAX_EXT 0x8008
|
||||
#endif
|
||||
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#if defined(ANDROID)
|
||||
#include <EGL/egl.h>
|
||||
// Additional extensions not included in GLES2/gl2ext.h from the NDK
|
||||
|
||||
|
@ -75,7 +75,6 @@ extern PFNGLISVERTEXARRAYOESPROC glIsVertexArrayOES;
|
|||
|
||||
#endif
|
||||
|
||||
#if !defined(BLACKBERRY)
|
||||
#ifndef GL_READ_FRAMEBUFFER
|
||||
#define GL_READ_FRAMEBUFFER GL_FRAMEBUFFER
|
||||
#define GL_DRAW_FRAMEBUFFER GL_FRAMEBUFFER
|
||||
|
@ -83,7 +82,6 @@ extern PFNGLISVERTEXARRAYOESPROC glIsVertexArrayOES;
|
|||
#ifndef GL_DEPTH_COMPONENT24
|
||||
#define GL_DEPTH_COMPONENT24 GL_DEPTH_COMPONENT24_OES
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef GL_RGBA8
|
||||
#define GL_RGBA8 GL_RGBA
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#endif
|
||||
|
||||
#if defined(USING_GLES2)
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#if defined(ANDROID)
|
||||
PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC eglGetSystemTimeFrequencyNV;
|
||||
PFNEGLGETSYSTEMTIMENVPROC eglGetSystemTimeNV;
|
||||
PFNGLDRAWTEXTURENVPROC glDrawTextureNV;
|
||||
|
@ -279,7 +279,7 @@ void CheckGLExtensions() {
|
|||
gl_extensions.NV_shader_framebuffer_fetch = strstr(extString, "GL_NV_shader_framebuffer_fetch") != 0;
|
||||
gl_extensions.ARM_shader_framebuffer_fetch = strstr(extString, "GL_ARM_shader_framebuffer_fetch") != 0;
|
||||
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#if defined(ANDROID)
|
||||
// On Android, incredibly, this is not consistently non-zero! It does seem to have the same value though.
|
||||
// https://twitter.com/ID_AA_Carmack/status/387383037794603008
|
||||
#ifdef _DEBUG
|
||||
|
@ -329,7 +329,7 @@ void CheckGLExtensions() {
|
|||
gl_extensions.EXT_unpack_subimage = true;
|
||||
}
|
||||
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
#if defined(ANDROID)
|
||||
if (gl_extensions.OES_mapbuffer) {
|
||||
glMapBuffer = (PFNGLMAPBUFFERPROC)eglGetProcAddress("glMapBufferOES");
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ enum {
|
|||
PAD_BUTTON_MENU = 4096,
|
||||
PAD_BUTTON_BACK = 8192,
|
||||
|
||||
// For Blackberry and Qt
|
||||
// For Qt
|
||||
PAD_BUTTON_JOY_UP = 1<<14,
|
||||
PAD_BUTTON_JOY_DOWN = 1<<15,
|
||||
PAD_BUTTON_JOY_LEFT = 1<<16,
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#endif
|
||||
|
||||
// QNX can only use RunFast mode and it is already the default.
|
||||
#if defined(__ARM_ARCH_7A__) && !defined(BLACKBERRY) && !defined(__SYMBIAN32__)
|
||||
#if defined(__ARM_ARCH_7A__) && !defined(__SYMBIAN32__)
|
||||
// Enables 'RunFast' VFP mode.
|
||||
void EnableFZ() {
|
||||
int x;
|
||||
|
|
|
@ -288,12 +288,6 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="base\backtrace.cpp" />
|
||||
<ClCompile Include="base\BlackberryMain.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="base\buffer.cpp" />
|
||||
<ClCompile Include="base\colorutil.cpp" />
|
||||
<ClCompile Include="base\compat.cpp" />
|
||||
|
|
|
@ -421,9 +421,6 @@
|
|||
<ClCompile Include="ui\ui_context.cpp">
|
||||
<Filter>ui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="base\BlackberryMain.cpp">
|
||||
<Filter>base</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="gfx_es2\gpu_features.cpp">
|
||||
<Filter>gfx</Filter>
|
||||
</ClCompile>
|
||||
|
@ -736,9 +733,6 @@
|
|||
<ClCompile Include="base\compat.cpp">
|
||||
<Filter>base</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="base\BlackberryMain.cpp">
|
||||
<Filter>base</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="base\PCMain.cpp">
|
||||
<Filter>base</Filter>
|
||||
</ClCompile>
|
||||
|
|
|
@ -79,9 +79,7 @@ bool DNSResolve(const std::string &host, const std::string &service, addrinfo **
|
|||
addrinfo hints = {0};
|
||||
// TODO: Might be uses to lookup other values.
|
||||
hints.ai_socktype = SOCK_STREAM;
|
||||
#ifdef BLACKBERRY
|
||||
hints.ai_flags = 0;
|
||||
#elif ANDROID
|
||||
#if ANDROID
|
||||
hints.ai_flags = AI_ADDRCONFIG;
|
||||
#else
|
||||
// AI_V4MAPPED seems to have issues on some platforms, not sure we should include it:
|
||||
|
|
|
@ -358,8 +358,7 @@ int main(int argc, const char* argv[])
|
|||
InitSysDirectories();
|
||||
#endif
|
||||
|
||||
#if defined(ANDROID)
|
||||
#elif defined(BLACKBERRY) || defined(__SYMBIAN32__)
|
||||
#if defined(ANDROID) || defined(__SYMBIAN32__)
|
||||
#elif !defined(_WIN32)
|
||||
g_Config.memStickDirectory = std::string(getenv("HOME")) + "/.ppsspp/";
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue