mirror of
https://github.com/libretro/RetroArch
synced 2025-02-07 03:40:24 +00:00
Merge branch 'master' into rgui-search
This commit is contained in:
commit
ccc9112c61
@ -30,11 +30,11 @@
|
||||
<activity android:name="com.retroarch.browser.preferences.PreferenceActivity" android:theme="@style/Theme.AppCompat" />
|
||||
<activity android:name="com.retroarch.browser.coremanager.CoreManagerActivity" android:theme="@style/Theme.AppCompat"/>
|
||||
|
||||
<activity android:name="com.retroarch.browser.RetroActivityFuture" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:launchMode="singleInstance">
|
||||
<activity android:name="com.retroarch.browser.RetroActivityFuture" android:exported="true" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:launchMode="singleInstance">
|
||||
<meta-data android:name="android.app.lib_name" android:value="retroarch-activity" />
|
||||
<meta-data android:name="android.app.func_name" android:value="ANativeActivity_onCreate" />
|
||||
</activity>
|
||||
<activity android:name="com.retroarch.browser.RetroActivityPast" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:launchMode="singleInstance">
|
||||
<activity android:name="com.retroarch.browser.RetroActivityPast" android:exported="true" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:launchMode="singleInstance">
|
||||
<meta-data android:name="android.app.lib_name" android:value="retroarch-activity" />
|
||||
<meta-data android:name="android.app.func_name" android:value="ANativeActivity_onCreate" />
|
||||
</activity>
|
||||
|
@ -39,11 +39,14 @@ void apple_run_core(NSString* core, const char* file)
|
||||
if (!apple_is_running)
|
||||
{
|
||||
#ifndef OSX
|
||||
char basedir[256];
|
||||
fill_pathname_basedir(basedir, file, sizeof(basedir));
|
||||
if (file && access(basedir, R_OK | W_OK | X_OK))
|
||||
apple_display_alert(@"The directory containing the selected file has limited permissions. This may "
|
||||
"prevent zipped content from loading, and will cause some cores to not function.", 0);
|
||||
if (core && file)
|
||||
{
|
||||
char basedir[256];
|
||||
fill_pathname_basedir(basedir, file, sizeof(basedir));
|
||||
if (access(basedir, R_OK | W_OK | X_OK))
|
||||
apple_display_alert(@"The directory containing the selected file has limited permissions. This may "
|
||||
"prevent zipped content from loading, and will cause some cores to not function.", 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
[apple_platform loadingCore:core withFile:file];
|
||||
|
@ -67,8 +67,16 @@ const void* apple_get_frontend_settings(void)
|
||||
&apple_frontend_settings.logging_enabled, false);
|
||||
settings[3] = setting_data_bool_setting("ios_tv_mode", "TV Mode", &apple_use_tv_mode, false);
|
||||
settings[4] = setting_data_string_setting(ST_STRING, "ios_btmode", "Bluetooth Input Type", apple_frontend_settings.bluetooth_mode,
|
||||
sizeof(apple_frontend_settings.bluetooth_mode), "keyboard");
|
||||
settings[4].values = "icade|keyboard|btstack";
|
||||
sizeof(apple_frontend_settings.bluetooth_mode), "none");
|
||||
|
||||
// Set ios_btmode options based on runtime environment
|
||||
if (is_ios_7())
|
||||
settings[4].values = "none|icade";
|
||||
else if (btstack_try_load())
|
||||
settings[4].values = "none|icade|keyboard|btstack";
|
||||
else
|
||||
settings[4].values = "none|icade|keyboard";
|
||||
|
||||
settings[5] = setting_data_string_setting(ST_STRING, "ios_orientations", "Screen Orientations", apple_frontend_settings.orientations,
|
||||
sizeof(apple_frontend_settings.orientations), "both");
|
||||
settings[5].values = "both|landscape|portrait";
|
||||
@ -272,7 +280,6 @@ static void handle_touch_event(NSArray* touches)
|
||||
_isGameTop = [viewController isKindOfClass:[RAGameView class]];
|
||||
g_extern.is_paused = !_isGameTop;
|
||||
|
||||
|
||||
[[UIApplication sharedApplication] setStatusBarHidden:_isGameTop withAnimation:UIStatusBarAnimationNone];
|
||||
[[UIApplication sharedApplication] setIdleTimerDisabled:_isGameTop];
|
||||
|
||||
|
@ -30,6 +30,9 @@
|
||||
#include <libudev.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/input.h>
|
||||
#include <linux/kd.h>
|
||||
#include <termios.h>
|
||||
#include <signal.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../config.h"
|
||||
@ -610,6 +613,68 @@ static bool open_devices(udev_input_t *udev, const char *type, device_handle_cb
|
||||
return true;
|
||||
}
|
||||
|
||||
static long oldkbmd = 0xffff;
|
||||
static struct termios oldterm, newterm;
|
||||
|
||||
static void restore_terminal_input(void)
|
||||
{
|
||||
if (oldkbmd != 0xffff)
|
||||
{
|
||||
ioctl(0, KDSKBMODE, oldkbmd);
|
||||
tcsetattr(0, TCSAFLUSH, &oldterm);
|
||||
oldkbmd = 0xffff;
|
||||
}
|
||||
}
|
||||
|
||||
static void restore_terminal_signal(int sig)
|
||||
{
|
||||
restore_terminal_input();
|
||||
kill(getpid(), sig);
|
||||
}
|
||||
|
||||
static void disable_terminal_input(void)
|
||||
{
|
||||
struct sigaction sa;
|
||||
|
||||
// Avoid accidentally typing stuff
|
||||
if (!isatty(0) || oldkbmd != 0xffff)
|
||||
return;
|
||||
|
||||
if (tcgetattr(0, &oldterm) < 0)
|
||||
return;
|
||||
newterm = oldterm;
|
||||
newterm.c_lflag &= ~(ECHO | ICANON | ISIG);
|
||||
newterm.c_iflag &= ~(ISTRIP | IGNCR | ICRNL | INLCR | IXOFF | IXON);
|
||||
newterm.c_cc[VMIN] = 0;
|
||||
newterm.c_cc[VTIME] = 0;
|
||||
|
||||
// Be careful about recovering the terminal ...
|
||||
if (ioctl(0, KDGKBMODE, &oldkbmd) < 0)
|
||||
return;
|
||||
if (tcsetattr(0, TCSAFLUSH, &newterm) < 0)
|
||||
return;
|
||||
if (ioctl(0, KDSKBMODE, K_MEDIUMRAW) < 0)
|
||||
{
|
||||
tcsetattr(0, TCSAFLUSH, &oldterm);
|
||||
return;
|
||||
}
|
||||
|
||||
memset(&sa, 0, sizeof(sa));
|
||||
sa.sa_handler = restore_terminal_signal;
|
||||
sa.sa_flags = SA_RESTART | SA_RESETHAND;
|
||||
sigemptyset(&sa.sa_mask);
|
||||
|
||||
// Trap some fatal signals.
|
||||
sigaction(SIGABRT, &sa, NULL);
|
||||
sigaction(SIGBUS, &sa, NULL);
|
||||
sigaction(SIGFPE, &sa, NULL);
|
||||
sigaction(SIGILL, &sa, NULL);
|
||||
sigaction(SIGQUIT, &sa, NULL);
|
||||
sigaction(SIGSEGV, &sa, NULL);
|
||||
|
||||
atexit(restore_terminal_input);
|
||||
}
|
||||
|
||||
static void *udev_input_init(void)
|
||||
{
|
||||
udev_input_t *udev = (udev_input_t*)calloc(1, sizeof(*udev));
|
||||
@ -704,6 +769,8 @@ static void *udev_input_init(void)
|
||||
|
||||
udev->joypad = input_joypad_init_driver(g_settings.input.joypad_driver);
|
||||
input_init_keyboard_lut(rarch_key_map_linux);
|
||||
|
||||
disable_terminal_input();
|
||||
return udev;
|
||||
|
||||
error:
|
||||
|
@ -25,7 +25,7 @@ static inline void RARCH_LOG_V(const char *tag, const char *fmt, va_list ap)
|
||||
aslmsg msg = asl_new(ASL_TYPE_MSG);
|
||||
asl_set(msg, ASL_KEY_READ_UID, "-1");
|
||||
if (tag)
|
||||
asl_log(NULL, msg, ASL_LEVEL_NOTICE, tag);
|
||||
asl_log(NULL, msg, ASL_LEVEL_NOTICE, "%s", tag);
|
||||
asl_vlog(NULL, msg, ASL_LEVEL_NOTICE, fmt, ap);
|
||||
asl_free(msg);
|
||||
}
|
||||
@ -40,15 +40,7 @@ static inline void RARCH_LOG(const char *fmt, ...)
|
||||
|
||||
static inline void RARCH_LOG_OUTPUT_V(const char *tag, const char *fmt, va_list ap)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
aslmsg msg = asl_new(ASL_TYPE_MSG);
|
||||
asl_set(msg, ASL_KEY_READ_UID, "-1");
|
||||
if (tag)
|
||||
asl_log(NULL, msg, ASL_LEVEL_NOTICE, tag);
|
||||
asl_vlog(NULL, msg, ASL_LEVEL_NOTICE, fmt, ap);
|
||||
asl_free(msg);
|
||||
va_end(ap);
|
||||
RARCH_LOG_V(tag, fmt, ap);
|
||||
}
|
||||
|
||||
static inline void RARCH_LOG_OUTPUT(const char *fmt, ...)
|
||||
@ -59,17 +51,9 @@ static inline void RARCH_LOG_OUTPUT(const char *fmt, ...)
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
static inline void RARCH_WARN_V(const char *tag, const char *fmt, ...)
|
||||
static inline void RARCH_WARN_V(const char *tag, const char *fmt, va_list ap)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
aslmsg msg = asl_new(ASL_TYPE_MSG);
|
||||
asl_set(msg, ASL_KEY_READ_UID, "-1");
|
||||
if (tag)
|
||||
asl_log(NULL, msg, ASL_LEVEL_NOTICE, tag);
|
||||
asl_vlog(NULL, msg, ASL_LEVEL_NOTICE, fmt, ap);
|
||||
asl_free(msg);
|
||||
va_end(ap);
|
||||
RARCH_LOG_V(tag, fmt, ap);
|
||||
}
|
||||
|
||||
static inline void RARCH_WARN(const char *fmt, ...)
|
||||
@ -80,17 +64,9 @@ static inline void RARCH_WARN(const char *fmt, ...)
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
static inline void RARCH_ERR_V(const char *tag, const char *fmt, ...)
|
||||
static inline void RARCH_ERR_V(const char *tag, const char *fmt, va_list ap)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
aslmsg msg = asl_new(ASL_TYPE_MSG);
|
||||
asl_set(msg, ASL_KEY_READ_UID, "-1");
|
||||
if (tag)
|
||||
asl_log(NULL, msg, ASL_LEVEL_NOTICE, tag);
|
||||
asl_vlog(NULL, msg, ASL_LEVEL_NOTICE, fmt, ap);
|
||||
asl_free(msg);
|
||||
va_end(ap);
|
||||
RARCH_LOG_V(tag, fmt, ap);
|
||||
}
|
||||
|
||||
static inline void RARCH_ERR(const char *fmt, ...)
|
||||
|
Loading…
x
Reference in New Issue
Block a user