mirror of
https://github.com/shagr4th/droid48
synced 2025-01-30 20:34:41 +01:00
Removed posix signal handlers from the original X48 emulator, which
seems to crash the SGS2 when main activity is paused
This commit is contained in:
parent
c4e57f0b87
commit
ad6da42290
3 changed files with 10 additions and 43 deletions
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="org.ab.x48" android:installLocation="auto" android:versionName="1.29" android:versionCode="29">
|
package="org.ab.x48" android:installLocation="auto" android:versionCode="30" android:versionName="1.30">
|
||||||
<application android:icon="@drawable/icon" android:label="@string/app_name">
|
<application android:icon="@drawable/icon" android:label="@string/app_name">
|
||||||
<activity android:name=".X48"
|
<activity android:name=".X48"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
|
|
|
@ -2413,7 +2413,7 @@ schedule()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
schedule_event--;
|
schedule_event--;
|
||||||
|
/*
|
||||||
if (got_alarm) {
|
if (got_alarm) {
|
||||||
got_alarm = 0;
|
got_alarm = 0;
|
||||||
#ifdef HAVE_XSHM
|
#ifdef HAVE_XSHM
|
||||||
|
@ -2422,9 +2422,9 @@ schedule()
|
||||||
GetEvent();
|
GetEvent();
|
||||||
//usleep(500);
|
//usleep(500);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
GetEvent();
|
||||||
// GetEvent();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
45
jni/main.c
45
jni/main.c
|
@ -87,30 +87,6 @@ saturn_t saturn;
|
||||||
int nb;
|
int nb;
|
||||||
int exit_state = 1;
|
int exit_state = 1;
|
||||||
|
|
||||||
void
|
|
||||||
#ifdef __FunctionProto__
|
|
||||||
signal_handler(int sig)
|
|
||||||
#else
|
|
||||||
signal_handler(sig)
|
|
||||||
int sig;
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
switch (sig) {
|
|
||||||
case SIGINT:
|
|
||||||
enter_debugger |= USER_INTERRUPT;
|
|
||||||
//LOGI("-sigint handler-");
|
|
||||||
break;
|
|
||||||
case SIGALRM:
|
|
||||||
got_alarm = 1;
|
|
||||||
break;
|
|
||||||
case SIGPIPE:
|
|
||||||
exit_x48(0);
|
|
||||||
exit (0);
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
#ifdef __FunctionProto__
|
#ifdef __FunctionProto__
|
||||||
save_options(int argc, char **argv)
|
save_options(int argc, char **argv)
|
||||||
|
@ -209,8 +185,6 @@ printf("%s\n", nl_langinfo(CODESET));*/
|
||||||
printf("0020\n");
|
printf("0020\n");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* install a handler for SIGALRM
|
|
||||||
*/
|
|
||||||
sigemptyset(&set);
|
sigemptyset(&set);
|
||||||
sigaddset(&set, SIGALRM);
|
sigaddset(&set, SIGALRM);
|
||||||
sa.sa_handler = signal_handler;
|
sa.sa_handler = signal_handler;
|
||||||
|
@ -220,9 +194,7 @@ printf("%s\n", nl_langinfo(CODESET));*/
|
||||||
#endif
|
#endif
|
||||||
sigaction(SIGALRM, &sa, (struct sigaction *)0);
|
sigaction(SIGALRM, &sa, (struct sigaction *)0);
|
||||||
|
|
||||||
/*
|
|
||||||
* install a handler for SIGINT
|
|
||||||
*/
|
|
||||||
sigemptyset(&set);
|
sigemptyset(&set);
|
||||||
sigaddset(&set, SIGINT);
|
sigaddset(&set, SIGINT);
|
||||||
sa.sa_handler = signal_handler;
|
sa.sa_handler = signal_handler;
|
||||||
|
@ -232,9 +204,7 @@ printf("%s\n", nl_langinfo(CODESET));*/
|
||||||
#endif
|
#endif
|
||||||
sigaction(SIGINT, &sa, (struct sigaction *)0);
|
sigaction(SIGINT, &sa, (struct sigaction *)0);
|
||||||
|
|
||||||
/*
|
|
||||||
* install a handler for SIGPIPE
|
|
||||||
*/
|
|
||||||
sigemptyset(&set);
|
sigemptyset(&set);
|
||||||
sigaddset(&set, SIGPIPE);
|
sigaddset(&set, SIGPIPE);
|
||||||
sa.sa_handler = signal_handler;
|
sa.sa_handler = signal_handler;
|
||||||
|
@ -244,15 +214,13 @@ printf("%s\n", nl_langinfo(CODESET));*/
|
||||||
#endif
|
#endif
|
||||||
sigaction(SIGPIPE, &sa, (struct sigaction *)0);
|
sigaction(SIGPIPE, &sa, (struct sigaction *)0);
|
||||||
|
|
||||||
/*
|
|
||||||
* set the real time interval timer
|
|
||||||
*/
|
|
||||||
it.it_interval.tv_sec = 0;
|
it.it_interval.tv_sec = 0;
|
||||||
it.it_interval.tv_usec = 20000;
|
it.it_interval.tv_usec = 20000;
|
||||||
it.it_value.tv_sec = 0;
|
it.it_value.tv_sec = 0;
|
||||||
it.it_value.tv_usec = 20000;
|
it.it_value.tv_usec = 20000;
|
||||||
setitimer(ITIMER_REAL, &it, (struct itimerval *)0);
|
setitimer(ITIMER_REAL, &it, (struct itimerval *)0);
|
||||||
|
*/
|
||||||
/*
|
/*
|
||||||
* Set stdin flags to not include O_NDELAY and O_NONBLOCK
|
* Set stdin flags to not include O_NDELAY and O_NONBLOCK
|
||||||
*/
|
*/
|
||||||
|
@ -263,7 +231,6 @@ printf("%s\n", nl_langinfo(CODESET));*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
|
||||||
if (!exec_flags)
|
if (!exec_flags)
|
||||||
|
@ -332,7 +299,7 @@ sigset_t set;
|
||||||
|
|
||||||
init_active_stuff();
|
init_active_stuff();
|
||||||
|
|
||||||
|
/*
|
||||||
sigemptyset(&set);
|
sigemptyset(&set);
|
||||||
sigaddset(&set, SIGALRM);
|
sigaddset(&set, SIGALRM);
|
||||||
sa.sa_handler = signal_handler;
|
sa.sa_handler = signal_handler;
|
||||||
|
@ -369,7 +336,7 @@ sigset_t set;
|
||||||
it.it_value.tv_sec = 0;
|
it.it_value.tv_sec = 0;
|
||||||
it.it_value.tv_usec = 20000;
|
it.it_value.tv_usec = 20000;
|
||||||
setitimer(ITIMER_REAL, &it, (struct itimerval *)0);
|
setitimer(ITIMER_REAL, &it, (struct itimerval *)0);
|
||||||
|
*/
|
||||||
|
|
||||||
flags = fcntl(STDIN_FILENO, F_GETFL, 0);
|
flags = fcntl(STDIN_FILENO, F_GETFL, 0);
|
||||||
flags &= ~O_NDELAY;
|
flags &= ~O_NDELAY;
|
||||||
|
|
Loading…
Add table
Reference in a new issue