Update RetroArch

This commit is contained in:
Jean-André Santoni 2015-03-28 17:04:13 +01:00
parent e20517902b
commit eb0f4e9a5e
11 changed files with 242 additions and 161 deletions

View File

@ -19,7 +19,7 @@
################################################################################
PKG_NAME="retroarch"
PKG_VERSION="f6d0a80"
PKG_VERSION="be01cae"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPLv3"
@ -76,7 +76,7 @@ pre_configure_target() {
}
make_target() {
make
make V=1
make -C gfx/video_filters compiler=$CC extra_flags="$CFLAGS"
make -C audio/audio_filters compiler=$CC extra_flags="$CFLAGS"
}
@ -97,7 +97,6 @@ makeinstall_target() {
# General configuration
sed -i -e "s/# libretro_path = \"\/path\/to\/libretro.so\"/libretro_path = \"\/usr\/lib\/libretro\"/" $INSTALL/etc/retroarch.cfg
sed -i -e "s/# rgui_browser_directory =/rgui_browser_directory =\/storage\/roms/" $INSTALL/etc/retroarch.cfg
sed -i -e "s/# content_directory =/content_directory =\/storage\/roms/" $INSTALL/etc/retroarch.cfg
sed -i -e "s/# savefile_directory =/savefile_directory =\/storage\/savefiles/" $INSTALL/etc/retroarch.cfg
sed -i -e "s/# savestate_directory =/savestate_directory =\/storage\/savestates/" $INSTALL/etc/retroarch.cfg
sed -i -e "s/# system_directory =/system_directory =\/storage\/system/" $INSTALL/etc/retroarch.cfg
@ -105,7 +104,7 @@ makeinstall_target() {
sed -i -e "s/# video_shader_dir =/video_shader_dir =\/usr\/share\/common-shaders/" $INSTALL/etc/retroarch.cfg
sed -i -e "s/# rgui_show_start_screen = true/rgui_show_start_screen = false/" $INSTALL/etc/retroarch.cfg
sed -i -e "s/# assets_directory =/assets_directory =\/usr\/share\/retroarch/" $INSTALL/etc/retroarch.cfg
sed -i -e "s/# menu_driver = \"rgui\"/menu_driver = \"lakka\"/" $INSTALL/etc/retroarch.cfg
sed -i -e "s/# menu_driver = \"rgui\"/menu_driver = \"xmb\"/" $INSTALL/etc/retroarch.cfg
# Video
sed -i -e "s/# video_fullscreen = false/video_fullscreen = true/" $INSTALL/etc/retroarch.cfg

View File

@ -0,0 +1,155 @@
diff --git a/retroarch.c b/retroarch.c
index f569928..ec7e950 100644
--- a/retroarch.c
+++ b/retroarch.c
@@ -2660,6 +2660,10 @@ bool rarch_main_command(unsigned cmd)
case RARCH_CMD_QUIT_RETROARCH:
rarch_main_set_state(RARCH_ACTION_STATE_FORCE_QUIT);
break;
+ case RARCH_CMD_SHUTDOWN:
+ rarch_main_set_state(RARCH_ACTION_STATE_FORCE_QUIT);
+ system("shutdown -P now");
+ break;
case RARCH_CMD_RESUME:
rarch_main_set_state(RARCH_ACTION_STATE_MENU_RUNNING_FINISHED);
break;
diff --git a/retroarch.h b/retroarch.h
index d1fef79..25c6906 100644
--- a/retroarch.h
+++ b/retroarch.h
@@ -113,6 +113,7 @@ enum basic_event
RARCH_CMD_RESTART_RETROARCH,
/* Force-quit RetroArch. */
RARCH_CMD_QUIT_RETROARCH,
+ RARCH_CMD_SHUTDOWN,
/* Resume RetroArch when in menu. */
RARCH_CMD_RESUME,
/* Toggles pause. */
diff --git a/settings.c b/settings.c
index e87565f..6b6cb7c 100644
--- a/settings.c
+++ b/settings.c
@@ -3319,6 +3319,7 @@ static bool setting_append_list_main_menu_options(
START_GROUP(group_info, "Main Menu");
START_SUB_GROUP(list, list_info, "State", group_info.name, subgroup_info);
+/*
#if defined(HAVE_DYNAMIC) || defined(HAVE_LIBRETRO_MANAGEMENT)
CONFIG_ACTION(
"core_list",
@@ -3405,7 +3406,8 @@ static bool setting_append_list_main_menu_options(
"options",
"Options",
group_info.name,
- subgroup_info.name);
+ subgroup_info.name);*/
+
CONFIG_ACTION(
"settings",
@@ -3422,7 +3424,7 @@ static bool setting_append_list_main_menu_options(
subgroup_info.name);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_ADVANCED);
}
- if (global->main_is_init && !global->libretro_dummy)
+ /*if (global->main_is_init && !global->libretro_dummy)
{
CONFIG_ACTION(
"savestate",
@@ -3495,19 +3497,26 @@ static bool setting_append_list_main_menu_options(
"help",
"Help",
group_info.name,
- subgroup_info.name);
+ subgroup_info.name);*/
#if !defined(IOS)
/* Apple rejects iOS apps that lets you forcibly quit an application. */
CONFIG_ACTION(
"quit_retroarch",
- "Quit RetroArch",
+ "Restart RetroArch",
group_info.name,
subgroup_info.name);
settings_list_current_add_cmd(list, list_info, RARCH_CMD_QUIT_RETROARCH);
#endif
+ CONFIG_ACTION(
+ "shutdown",
+ "Shutdown",
+ group_info.name,
+ subgroup_info.name);
+ settings_list_current_add_cmd(list, list_info, RARCH_CMD_SHUTDOWN);
+
END_SUB_GROUP(list, list_info);
END_GROUP(list, list_info);
@@ -6346,7 +6355,7 @@ rarch_setting_t *setting_new(unsigned mask)
goto error;
}
- if (mask & SL_FLAG_OVERLAY_OPTIONS)
+ /*if (mask & SL_FLAG_OVERLAY_OPTIONS)
{
if (!setting_append_list_overlay_options(&list, list_info))
goto error;
@@ -6356,7 +6365,7 @@ rarch_setting_t *setting_new(unsigned mask)
{
if (!setting_append_list_osk_overlay_options(&list, list_info))
goto error;
- }
+ }*/
if (mask & SL_FLAG_MENU_OPTIONS)
{
@@ -6364,7 +6373,7 @@ rarch_setting_t *setting_new(unsigned mask)
goto error;
}
- if (mask & SL_FLAG_UI_OPTIONS)
+ /*if (mask & SL_FLAG_UI_OPTIONS)
{
if (!setting_append_list_ui_options(&list, list_info))
goto error;
@@ -6388,7 +6397,7 @@ rarch_setting_t *setting_new(unsigned mask)
{
if (!setting_append_list_core_updater_options(&list, list_info))
goto error;
- }
+ }*/
if (mask & SL_FLAG_NETPLAY_OPTIONS)
{
@@ -6396,7 +6405,7 @@ rarch_setting_t *setting_new(unsigned mask)
goto error;
}
- if (mask & SL_FLAG_ARCHIVE_OPTIONS)
+ /*if (mask & SL_FLAG_ARCHIVE_OPTIONS)
{
if (!setting_append_list_archive_options(&list, list_info))
goto error;
@@ -6406,7 +6415,7 @@ rarch_setting_t *setting_new(unsigned mask)
{
if (!setting_append_list_user_options(&list, list_info))
goto error;
- }
+ }*/
if (mask & SL_FLAG_PATH_OPTIONS)
{
@@ -6414,11 +6423,11 @@ rarch_setting_t *setting_new(unsigned mask)
goto error;
}
- if (mask & SL_FLAG_PRIVACY_OPTIONS)
+ /*if (mask & SL_FLAG_PRIVACY_OPTIONS)
{
if (!setting_append_list_privacy_options(&list, list_info))
goto error;
- }
+ }*/
if (!(settings_list_append(&list, list_info, terminator)))
goto error;

View File

@ -1,23 +1,28 @@
diff -Naur RetroArch/input/input_joypad.c RetroArch.patch/input/input_joypad.c
--- RetroArch/input/input_joypad.c 2015-01-11 13:54:38.050151366 +0100
+++ RetroArch.patch/input/input_joypad.c 2015-01-11 13:57:50.586625615 +0100
@@ -127,9 +127,19 @@
diff --git a/input/input_joypad.c b/input/input_joypad.c
index ee5d785..a8302bc 100644
--- a/input/input_joypad.c
+++ b/input/input_joypad.c
@@ -80,6 +80,7 @@ bool input_joypad_set_rumble(const rarch_joypad_driver_t *drv,
* Returns: true (1) if key was pressed, otherwise
* false (0).
**/
+static bool hack_l3, hack_r3;
bool input_joypad_pressed(const rarch_joypad_driver_t *drv,
unsigned port, const struct retro_keybind *binds, unsigned key)
{
bool input_joypad_pressed(
const rarch_joypad_driver_t *drv,
unsigned port,
@@ -106,6 +107,15 @@ bool input_joypad_pressed(
if (joykey == NO_BTN)
joykey = auto_binds[key].joykey;
+ if (key == RETRO_DEVICE_ID_JOYPAD_L3)
+ hack_l3 = input_joypad_is_pressed(drv, port, binds, key);
+ hack_l3 = drv->button(joy_idx, (uint16_t)joykey);
+
+ if (key == RETRO_DEVICE_ID_JOYPAD_R3)
+ hack_r3 = input_joypad_is_pressed(drv, port, binds, key);
+ hack_r3 = drv->button(joy_idx, (uint16_t)joykey);
+
+ if (key == RARCH_MENU_TOGGLE && hack_r3 && hack_l3)
+ return true;
+
if (!drv || !binds[key].valid ||
!input_joypad_is_pressed(drv, port, binds, key))
return false;
if (drv->button(joy_idx, (uint16_t)joykey))
return true;

View File

@ -1,15 +0,0 @@
diff -Naur retroarch/driver.c retroarch.patch/driver.c
--- retroarch/driver.c 2015-01-20 22:59:49.399213333 +0100
+++ retroarch.patch/driver.c 2015-01-20 23:27:44.278020291 +0100
@@ -538,9 +538,9 @@
g_extern.frame_cache.pitch = 8;
g_extern.frame_cache.data = &dummy_pixels;
- if (driver.video_poke && driver.video_poke->set_texture_frame)
+ /*if (driver.video_poke && driver.video_poke->set_texture_frame)
driver.video_poke->set_texture_frame(driver.video_data,
- &dummy_pixels, false, 1, 1, 1.0f);
+ &dummy_pixels, false, 1, 1, 1.0f);*/
}
/**

View File

@ -1,7 +1,7 @@
diff -Naur RetroArch/libretro-sdk/file/file_path.c RetroArch.patch/libretro-sdk/file/file_path.c
--- RetroArch/libretro-sdk/file/file_path.c 2014-11-05 14:53:08.061844355 +0100
+++ RetroArch.patch/libretro-sdk/file/file_path.c 2014-11-05 14:54:26.267597891 +0100
@@ -117,7 +117,7 @@
diff -Naur retroarch.git/libretro-common/file/file_path.c retroarch.patch/libretro-common/file/file_path.c
--- retroarch.git/libretro-common/file/file_path.c 2015-03-12 22:19:55.856710512 +0100
+++ retroarch.patch/libretro-common/file/file_path.c 2015-03-12 22:20:51.161993115 +0100
@@ -169,7 +169,7 @@
if (strcmp(file_ext,"7z") == 0)
return true;
#endif

View File

@ -0,0 +1,12 @@
diff -Naur retroarch.git/menu/menu_entries.c retroarch.patch/menu/menu_entries.c
--- retroarch.git/menu/menu_entries.c 2015-03-25 18:23:48.254217179 +0100
+++ retroarch.patch/menu/menu_entries.c 2015-03-25 18:44:52.231622865 +0100
@@ -213,7 +213,7 @@
menu_list_clear(list);
- menu_entries_push_cores_list(list, info, settings->core_assets_directory, true);
+ menu_entries_push_cores_list(list, info, settings->menu_content_directory, true);
menu_list_populate_generic(list, path, label, menu_type);

View File

@ -1,100 +0,0 @@
diff -Naur retroarch/menu/drivers_display/lakka.c retroarch.patch/menu/drivers_display/lakka.c
--- retroarch/menu/drivers_display/lakka.c 2015-03-07 19:57:54.520973734 +0100
+++ retroarch.patch/menu/drivers_display/lakka.c 2015-03-07 20:00:25.672479321 +0100
@@ -591,7 +591,7 @@
active_item = (menu_item_t*)
&active_category->items[active_category->active_item];
- update_tweens(0.002);
+ update_tweens(driver.menu->dt / IDEAL_DT);
#if defined(HAVE_FBO) && defined(LAKKA_EFFECTS)
glBindFramebuffer(GL_FRAMEBUFFER, lakka->fbo);
diff -Naur retroarch/menu/drivers_display/lakka.h retroarch.patch/menu/drivers_display/lakka.h
--- retroarch/menu/drivers_display/lakka.h 2015-03-07 19:57:54.520973734 +0100
+++ retroarch.patch/menu/drivers_display/lakka.h 2015-03-07 19:59:39.859416298 +0100
@@ -25,7 +25,7 @@
#define THEME "monochrome" // flatui or monochrome themes are available
#ifndef LAKKA_DELAY
-#define LAKKA_DELAY 0.02
+#define LAKKA_DELAY 10
#endif
enum
diff -Naur retroarch/menu/menu.c retroarch.patch/menu/menu.c
--- retroarch/menu/menu.c 2015-03-07 19:57:54.492973086 +0100
+++ retroarch.patch/menu/menu.c 2015-03-07 20:08:08.395211872 +0100
@@ -20,6 +20,7 @@
#include "../dynamic.h"
#include "../frontend/frontend.h"
#include "../../retroarch.h"
+#include "../../performance.h"
#include <file/file_path.h>
/**
@@ -436,6 +437,14 @@
if (!driver.menu)
return -1;
+ driver.menu->cur_time = rarch_get_time_usec();
+ driver.menu->dt = driver.menu->cur_time - driver.menu->old_time;
+ if (driver.menu->dt >= IDEAL_DT * 4)
+ driver.menu->dt = IDEAL_DT * 4;
+ if (driver.menu->dt <= IDEAL_DT / 4)
+ driver.menu->dt = IDEAL_DT / 4;
+ driver.menu->old_time = driver.menu->cur_time;
+
driver.retro_ctx.poll_cb();
if (input & input_repeat)
@@ -465,7 +474,7 @@
driver.menu->mouse.enable = g_settings.menu.mouse_enable;
- driver.menu->delay_count++;
+ driver.menu->delay_count += driver.menu->dt / IDEAL_DT;
if (driver.block_input)
trigger_input = 0;
diff -Naur retroarch/menu/menu_driver.h retroarch.patch/menu/menu_driver.h
--- retroarch/menu/menu_driver.h 2015-03-07 19:57:54.508973457 +0100
+++ retroarch.patch/menu/menu_driver.h 2015-03-07 20:06:44.549267343 +0100
@@ -23,6 +23,7 @@
#include <retro_miscellaneous.h>
#include "menu_list.h"
#include "../settings_list.h"
+#include "../../libretro.h"
#ifdef __cplusplus
extern "C" {
@@ -70,9 +71,14 @@
{
void *userdata;
+ /* Delta timing */
+ float dt;
+ retro_time_t cur_time;
+ retro_time_t old_time;
+
/* Used for key repeat */
- unsigned delay_timer;
- unsigned delay_count;
+ float delay_timer;
+ float delay_count;
unsigned width;
unsigned height;
diff -Naur retroarch/menu/menu.h retroarch.patch/menu/menu.h
--- retroarch/menu/menu.h 2015-03-07 19:57:54.508973457 +0100
+++ retroarch.patch/menu/menu.h 2015-03-07 20:04:54.726718994 +0100
@@ -46,6 +46,9 @@
#define MENU_SETTINGS_CORE_OPTION_NONE 0xffff
#define MENU_SETTINGS_CORE_OPTION_START 0x10000
+#ifndef IDEAL_DT
+#define IDEAL_DT (1.0 / 60.0 * 1000000.0)
+#endif
#define MENU_KEYBOARD_BIND_TIMEOUT_SECONDS 5

View File

@ -0,0 +1,12 @@
diff -Naur retroarch.git/gfx/drivers/gl.c retroarch.patch/gfx/drivers/gl.c
--- retroarch.git/gfx/drivers/gl.c 2015-03-25 18:23:48.226216528 +0100
+++ retroarch.patch/gfx/drivers/gl.c 2015-03-25 23:20:21.455106006 +0100
@@ -1867,7 +1867,7 @@
unsigned gles_major = 0, gles_minor = 0;
/* There are both APPLE and EXT variants. */
- if (gl_query_extension(gl, "BGRA8888"))
+ if (0)//(gl_query_extension(gl, "BGRA8888"))
RARCH_LOG("[GL]: BGRA8888 extension found for GLES.\n");
else
{

View File

@ -0,0 +1,12 @@
diff -Naur retroarch.git/gfx/drivers/gl.c retroarch.patch/gfx/drivers/gl.c
--- retroarch.git/gfx/drivers/gl.c 2015-03-25 18:23:48.226216528 +0100
+++ retroarch.patch/gfx/drivers/gl.c 2015-03-25 23:20:21.455106006 +0100
@@ -1867,7 +1867,7 @@
unsigned gles_major = 0, gles_minor = 0;
/* There are both APPLE and EXT variants. */
- if (gl_query_extension(gl, "BGRA8888"))
+ if (0)//(gl_query_extension(gl, "BGRA8888"))
RARCH_LOG("[GL]: BGRA8888 extension found for GLES.\n");
else
{

View File

@ -0,0 +1,27 @@
diff -Naur retroarch.git/input/input_joypad.c retroarch.patch/input/input_joypad.c
--- retroarch.git/input/input_joypad.c 2015-03-25 18:23:48.234216714 +0100
+++ retroarch.patch/input/input_joypad.c 2015-03-26 22:33:08.795861021 +0100
@@ -80,6 +80,7 @@
* Returns: true (1) if key was pressed, otherwise
* false (0).
**/
+static bool hack_l3, hack_r3;
bool input_joypad_pressed(
const rarch_joypad_driver_t *drv,
unsigned port,
@@ -106,6 +107,15 @@
if (joykey == NO_BTN)
joykey = auto_binds[key].joykey;
+ if (key == RETRO_DEVICE_ID_JOYPAD_L3)
+ hack_l3 = input_joypad_pressed(drv, port, binds, key);
+
+ if (key == RETRO_DEVICE_ID_JOYPAD_R3)
+ hack_r3 = input_joypad_pressed(drv, port, binds, key);
+
+ if (key == RARCH_MENU_TOGGLE && hack_r3 && hack_l3)
+ return true;
+
if (drv->button(joy_idx, (uint16_t)joykey))
return true;

View File

@ -1,26 +0,0 @@
diff -Naur retroarch/menu/drivers_display/lakka.c retroarch.patch/menu/drivers_display/lakka.c
--- retroarch/menu/drivers_display/lakka.c 2015-02-06 23:55:07.052391369 +0100
+++ retroarch.patch/menu/drivers_display/lakka.c 2015-02-06 23:56:30.998328580 +0100
@@ -641,8 +641,11 @@
GLuint texture = 0;
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D, texture);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, ti.width, ti.height, 0,
- GL_RGBA, GL_UNSIGNED_BYTE, ti.pixels);
+ glTexImage2D(GL_TEXTURE_2D, 0, driver.gfx_use_rgba ?
+ GL_RGBA : RARCH_GL_INTERNAL_FORMAT32,
+ ti.width, ti.height, 0,
+ driver.gfx_use_rgba ? GL_RGBA : RARCH_GL_TEXTURE_TYPE32,
+ RARCH_GL_FORMAT32, ti.pixels);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glGenerateMipmap(GL_TEXTURE_2D);
@@ -921,8 +924,6 @@
lakka_fbo_reset(lakka);
#endif
- driver.gfx_use_rgba = true;
-
fill_pathname_join(mediapath, g_settings.assets_directory,
"lakka", sizeof(mediapath));
fill_pathname_join(themepath, mediapath, THEME, sizeof(themepath));