From 3403928a75dc50ed903d4ae7fd14e7476d02b372 Mon Sep 17 00:00:00 2001 From: Sacha Date: Sat, 2 Nov 2013 04:31:06 +1000 Subject: [PATCH] Blackberry: Support receiving invocations from system. Set as a default application for ISO, CSO, PBP and PRX. Check in NativeInit if the system has requested for us to start a specific file. --- Blackberry/bar-descriptor.xml | 12 ++++++++++++ UI/NativeApp.cpp | 24 ++++++++++++++++++++++++ native | 2 +- 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/Blackberry/bar-descriptor.xml b/Blackberry/bar-descriptor.xml index 4a01a46b36..64123f1788 100644 --- a/Blackberry/bar-descriptor.xml +++ b/Blackberry/bar-descriptor.xml @@ -31,6 +31,18 @@ icon-114.png + + Open PSP ROM + application + icon-114.png + + bb.action.OPEN + * + + + + + run_native diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index e0b9804a40..48d14ca9fd 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -85,6 +85,11 @@ static UI::Theme ui_theme; #include "ios/iOSCoreAudio.h" #endif +#ifdef BLACKBERRY +#include +#include +#endif + Texture *uiTexture; ScreenManager *screenManager; @@ -415,6 +420,25 @@ void NativeInit(int argc, const char *argv[], screenManager = new ScreenManager(); +#ifdef BLACKBERRY + // Check if the system has sent us any messages at runtime + while (true) { + bps_event_t *event = NULL; + bps_get_event(&event, 0); + if (event == NULL) + break; + // Were we opened to run a specific ROM? + if (bps_event_get_domain(event) == navigator_get_domain() && + bps_event_get_code(event) == 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:// + skipLogo = true; + } + } + } +#endif + if (skipLogo) { screenManager->switchScreen(new EmuScreen(boot_filename)); } else { diff --git a/native b/native index 4c8922d9e7..f5121df3be 160000 --- a/native +++ b/native @@ -1 +1 @@ -Subproject commit 4c8922d9e70cbebc54c2d5a36d52e79339feeff0 +Subproject commit f5121df3be55ea9049164607e64a7c7d7bd2a7dd