(BlackBerry) Add initial in-game RGUI support.

This commit is contained in:
CatalystG 2013-03-23 12:21:30 -04:00
parent 82d80cf24f
commit f6c2c2c57d
5 changed files with 95 additions and 29 deletions

View File

@ -30,14 +30,67 @@ int rarch_main(int argc, char *argv[])
g_extern.verbose = true;
#ifdef HAVE_RGUI
menu_init();
g_extern.lifecycle_mode_state |= 1ULL << MODE_INIT;
for (;;)
{
if (g_extern.lifecycle_mode_state & (1ULL << MODE_GAME))
{
while ((g_extern.is_paused && !g_extern.is_oneshot) ? rarch_main_idle_iterate() : rarch_main_iterate());
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_GAME);
}
else if (g_extern.lifecycle_mode_state & (1ULL << MODE_INIT))
{
if (g_extern.main_is_init)
rarch_main_deinit();
struct rarch_main_wrap args = {0};
args.verbose = g_extern.verbose;
args.sram_path = NULL;
args.state_path = NULL;
args.rom_path = "shared/documents/roms/snes9x-next/ChronoTrigger.smc";
args.libretro_path = "app/native/lib/test.so";
args.config_path = "app/native/retroarch.cfg";
int init_ret = rarch_main_init_wrap(&args);
if (init_ret == 0)
{
RARCH_LOG("rarch_main_init() succeeded.\n");
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
}
else
{
RARCH_ERR("rarch_main_init() failed.\n");
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU);
}
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_INIT);
}
else if (g_extern.lifecycle_mode_state & (1ULL << MODE_MENU))
{
g_extern.lifecycle_mode_state |= 1ULL << MODE_MENU_PREINIT;
while (menu_iterate());
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU);
}
else
break;
}
menu_free();
if (g_extern.main_is_init)
rarch_main_deinit();
#else
struct rarch_main_wrap args = {0};
args.verbose = g_extern.verbose;
args.sram_path = NULL;
args.state_path = NULL;
args.rom_path = "/accounts/1000/shared/documents/roms/quake/pak0.pak";
args.libretro_path = "/accounts/1000/appdata/com.RetroArch.testDev_m_RetroArch181dafc7/app/native/lib/test.so";
args.config_path = "/accounts/1000/appdata/com.RetroArch.testDev_m_RetroArch181dafc7/app/native/retroarch.cfg";
args.rom_path = "shared/documents/roms/snes9x-next/ChronoTrigger.smc";
args.libretro_path = "app/native/lib/test.so";
args.config_path = "app/native/retroarch.cfg";
rarch_init_msg_queue();
@ -46,6 +99,7 @@ int rarch_main(int argc, char *argv[])
while ((g_extern.is_paused && !g_extern.is_oneshot) ? rarch_main_idle_iterate() : rarch_main_iterate());
rarch_main_deinit();
#endif
rarch_deinit_msg_queue();

View File

@ -410,7 +410,9 @@ static void render_text(rgui_handle_t *rgui)
blit_line(rgui, TERM_START_X + 15, 15, title, true);
blit_line(rgui, TERM_START_X + 15, (TERM_HEIGHT * FONT_HEIGHT_STRIDE) + TERM_START_Y + 2, g_extern.title_buf, true);
#ifndef __BLACKBERRY_QNX__
blit_line(rgui, TERM_HEIGHT - 80, (TERM_HEIGHT * FONT_HEIGHT_STRIDE) + TERM_START_Y + 2, PACKAGE_VERSION, true);
#endif
unsigned x = TERM_START_X;
unsigned y = TERM_START_Y;

View File

@ -64,8 +64,6 @@ static void gfx_ctx_destroy(void)
eglMakeCurrent(g_egl_dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
eglDestroyContext(g_egl_dpy, g_egl_ctx);
eglDestroySurface(g_egl_dpy, g_egl_surf);
screen_destroy_window(screen_win);
screen_destroy_context(screen_ctx);
eglTerminate(g_egl_dpy);
eglReleaseThread();
@ -99,24 +97,27 @@ static bool gfx_ctx_init(void)
* create an EGL surface to receive libscreen events */
RARCH_LOG("Initializing screen context...\n");
screen_create_context(&screen_ctx, 0);
if (screen_request_events(screen_ctx) != BPS_SUCCESS)
if (!screen_ctx)
{
RARCH_ERR("screen_request_events failed.\n");
goto screen_error;
}
screen_create_context(&screen_ctx, 0);
if (navigator_request_events(0) != BPS_SUCCESS)
{
RARCH_ERR("navigator_request_events failed.\n");
goto screen_error;
}
if (screen_request_events(screen_ctx) != BPS_SUCCESS)
{
RARCH_ERR("screen_request_events failed.\n");
goto screen_error;
}
if (navigator_rotation_lock(false) != BPS_SUCCESS)
{
RARCH_ERR("navigator_location_lock failed.\n");
goto screen_error;
if (navigator_request_events(0) != BPS_SUCCESS)
{
RARCH_ERR("navigator_request_events failed.\n");
goto screen_error;
}
if (navigator_rotation_lock(false) != BPS_SUCCESS)
{
RARCH_ERR("navigator_location_lock failed.\n");
goto screen_error;
}
}
const EGLint attribs[] = {
@ -173,10 +174,13 @@ static bool gfx_ctx_init(void)
goto error;
}
if (screen_create_window(&screen_win, screen_ctx))
if(!screen_win)
{
RARCH_ERR("screen_create_window failed:.\n");
goto error;
if (screen_create_window(&screen_win, screen_ctx))
{
RARCH_ERR("screen_create_window failed:.\n");
goto error;
}
}
if (screen_set_window_property_iv(screen_win, SCREEN_PROPERTY_FORMAT, &format))

View File

@ -40,6 +40,7 @@
<listOptionValue builtIn="false" value="__LIBRETRO__"/>
<listOptionValue builtIn="false" value="HAVE_DYNAMIC"/>
<listOptionValue builtIn="false" value="HAVE_ZLIB"/>
<listOptionValue builtIn="false" value="HAVE_RGUI"/>
<listOptionValue builtIn="false" value="__BLACKBERRY_QNX__"/>
<listOptionValue builtIn="false" value="HAVE_OPENGLES"/>
<listOptionValue builtIn="false" value="PACKAGE_VERSION=\&quot;0.9.8.4\&quot;"/>
@ -143,7 +144,7 @@
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
</option>
<option id="com.qnx.qcc.option.compiler.security.421937377" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="false" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.security.421937377" name="Enhanced Security (-fstack-protector-strong)" superClass="com.qnx.qcc.option.compiler.security" value="false" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.defines.426935293" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
<listOptionValue builtIn="false" value="HAVE_NEON"/>
@ -259,7 +260,7 @@
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
</option>
<option id="com.qnx.qcc.option.compiler.security.1305803908" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.security.1305803908" name="Enhanced Security (-fstack-protector-strong)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.defines.213513124" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
<listOptionValue builtIn="false" value="HAVE_NEON"/>
@ -376,7 +377,7 @@
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
</option>
<option id="com.qnx.qcc.option.compiler.security.521807592" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.security.521807592" name="Enhanced Security (-fstack-protector-strong)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.defines.1725725626" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
<listOptionValue builtIn="false" value="HAVE_NEON"/>
@ -491,7 +492,7 @@
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
</option>
<option id="com.qnx.qcc.option.compiler.security.157472670" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.security.157472670" name="Enhanced Security (-fstack-protector-strong)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.defines.1166581028" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
<listOptionValue builtIn="false" value="HAVE_NEON"/>
@ -606,7 +607,7 @@
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
</option>
<option id="com.qnx.qcc.option.compiler.security.817746405" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.security.817746405" name="Enhanced Security (-fstack-protector-strong)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.defines.431450507" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
<listOptionValue builtIn="false" value="HAVE_NEON"/>
@ -722,7 +723,7 @@
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
</option>
<option id="com.qnx.qcc.option.compiler.security.733048683" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.security.733048683" name="Enhanced Security (-fstack-protector-strong)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.defines.252268326" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
<listOptionValue builtIn="false" value="HAVE_NEON"/>

View File

@ -16,6 +16,8 @@
#include "../general.h"
#include "../driver.h"
#include <screen/screen.h>
#include <bps/event.h>
#include <bps/navigator.h>
#define MAX_TOUCH 16
@ -136,6 +138,7 @@ static void handle_navigator_event(bps_event_t *event)
switch (bps_event_get_code(event))
{
case NAVIGATOR_SWIPE_DOWN:
g_extern.lifecycle_state ^= (1ULL << RARCH_MENU_TOGGLE);
break;
case NAVIGATOR_EXIT:
//Catch this in thumbnail loop
@ -193,6 +196,8 @@ static void qnx_input_poll(void *data)
int rc, domain;
g_extern.lifecycle_state &= ~(1ULL << RARCH_MENU_TOGGLE);
while(true)
{
bps_event_t *event = NULL;