Merge branch 'master' of github.com:reicast/reicast-emulator
This commit is contained in:
commit
4a917a003e
|
@ -41,7 +41,7 @@ void SetCurrentTARC(u32 addr)
|
||||||
|
|
||||||
bool TryDecodeTARC()
|
bool TryDecodeTARC()
|
||||||
{
|
{
|
||||||
verify((int)ta_ctx);
|
verify(ta_ctx != 0);
|
||||||
|
|
||||||
if (vd_ctx == 0)
|
if (vd_ctx == 0)
|
||||||
{
|
{
|
||||||
|
@ -62,7 +62,7 @@ bool TryDecodeTARC()
|
||||||
|
|
||||||
void VDecEnd()
|
void VDecEnd()
|
||||||
{
|
{
|
||||||
verify((int)vd_ctx);
|
verify(vd_ctx != 0);
|
||||||
|
|
||||||
vd_ctx->rend = vd_rc;
|
vd_ctx->rend = vd_rc;
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,13 @@
|
||||||
package="com.reicast.emulator"
|
package="com.reicast.emulator"
|
||||||
android:versionCode="7"
|
android:versionCode="7"
|
||||||
android:versionName="r7" >
|
android:versionName="r7" >
|
||||||
|
|
||||||
|
<supports-screens
|
||||||
|
android:anyDensity="true"
|
||||||
|
android:largeScreens="true"
|
||||||
|
android:normalScreens="true"
|
||||||
|
android:smallScreens="true"
|
||||||
|
android:xlargeScreens="true" />
|
||||||
|
|
||||||
<uses-sdk
|
<uses-sdk
|
||||||
android:minSdkVersion="8"
|
android:minSdkVersion="8"
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<solid android:color="#BBDDDDDD"/>
|
||||||
|
<corners android:radius="20dip"/>
|
||||||
|
</shape>
|
|
@ -47,7 +47,7 @@
|
||||||
android:id="@+id/settings_menu"
|
android:id="@+id/settings_menu"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="26dp"
|
android:layout_marginLeft="32dp"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:background="@drawable/game_selector"
|
android:background="@drawable/game_selector"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
|
@ -109,7 +109,7 @@
|
||||||
android:id="@+id/about_menu"
|
android:id="@+id/about_menu"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="26dp"
|
android:layout_marginLeft="32dp"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:background="@drawable/game_selector"
|
android:background="@drawable/game_selector"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
|
@ -170,7 +170,7 @@
|
||||||
android:id="@+id/cloud_menu"
|
android:id="@+id/cloud_menu"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="26dp"
|
android:layout_marginLeft="32dp"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:background="@drawable/game_selector"
|
android:background="@drawable/game_selector"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
|
|
|
@ -2,22 +2,23 @@
|
||||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/menuConfig"
|
android:id="@+id/menuConfig"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="280dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@android:color/transparent"
|
||||||
android:gravity="center_horizontal"
|
android:gravity="center_horizontal"
|
||||||
android:orientation="vertical" >
|
android:orientation="vertical" >
|
||||||
|
|
||||||
<TableLayout
|
<TableLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="280dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingRight="4dp"
|
android:background="@android:color/transparent"
|
||||||
android:stretchColumns="*" >
|
android:stretchColumns="*" >
|
||||||
|
|
||||||
<TableRow
|
<TableRow
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="72dp"
|
android:layout_height="72dp"
|
||||||
|
android:layout_margin="1dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="#66000000"
|
|
||||||
android:gravity="center" >
|
android:gravity="center" >
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
@ -25,6 +26,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/rounded"
|
||||||
android:ems="8"
|
android:ems="8"
|
||||||
android:text="@string/popup_button_back" />
|
android:text="@string/popup_button_back" />
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
@ -32,8 +34,8 @@
|
||||||
<TableRow
|
<TableRow
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="72dp"
|
android:layout_height="72dp"
|
||||||
|
android:layout_margin="1dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="#66000000"
|
|
||||||
android:gravity="center" >
|
android:gravity="center" >
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
@ -41,6 +43,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/rounded"
|
||||||
android:ems="8"
|
android:ems="8"
|
||||||
android:text="@string/popup_button_widescreen" />
|
android:text="@string/popup_button_widescreen" />
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
@ -48,8 +51,8 @@
|
||||||
<TableRow
|
<TableRow
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="72dp"
|
android:layout_height="72dp"
|
||||||
|
android:layout_margin="1dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="#66000000"
|
|
||||||
android:gravity="center" >
|
android:gravity="center" >
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
@ -57,6 +60,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/rounded"
|
||||||
android:ems="8"
|
android:ems="8"
|
||||||
android:text="@string/popup_button_frames_down" />
|
android:text="@string/popup_button_frames_down" />
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
@ -64,8 +68,8 @@
|
||||||
<TableRow
|
<TableRow
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="72dp"
|
android:layout_height="72dp"
|
||||||
|
android:layout_margin="1dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="#66000000"
|
|
||||||
android:gravity="center" >
|
android:gravity="center" >
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
@ -73,6 +77,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/rounded"
|
||||||
android:ems="8"
|
android:ems="8"
|
||||||
android:text="@string/popup_button_frames_up" />
|
android:text="@string/popup_button_frames_up" />
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
@ -80,8 +85,8 @@
|
||||||
<TableRow
|
<TableRow
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="72dp"
|
android:layout_height="72dp"
|
||||||
|
android:layout_margin="1dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="#66000000"
|
|
||||||
android:gravity="center" >
|
android:gravity="center" >
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
@ -89,6 +94,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/rounded"
|
||||||
android:ems="8"
|
android:ems="8"
|
||||||
android:text="@string/popup_button_frame_limit" />
|
android:text="@string/popup_button_frame_limit" />
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
@ -96,8 +102,8 @@
|
||||||
<TableRow
|
<TableRow
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="72dp"
|
android:layout_height="72dp"
|
||||||
|
android:layout_margin="1dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="#66000000"
|
|
||||||
android:gravity="center" >
|
android:gravity="center" >
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
@ -105,6 +111,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/rounded"
|
||||||
android:ems="8"
|
android:ems="8"
|
||||||
android:text="@string/popup_button_audio" />
|
android:text="@string/popup_button_audio" />
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
@ -112,8 +119,8 @@
|
||||||
<TableRow
|
<TableRow
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="72dp"
|
android:layout_height="72dp"
|
||||||
|
android:layout_margin="1dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="#66000000"
|
|
||||||
android:gravity="center" >
|
android:gravity="center" >
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
@ -121,6 +128,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/rounded"
|
||||||
android:ems="8"
|
android:ems="8"
|
||||||
android:text="@string/popup_button_turbo" />
|
android:text="@string/popup_button_turbo" />
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
|
@ -2,22 +2,23 @@
|
||||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/menuDebug"
|
android:id="@+id/menuDebug"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="280dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@android:color/transparent"
|
||||||
android:gravity="center_horizontal"
|
android:gravity="center_horizontal"
|
||||||
android:orientation="vertical" >
|
android:orientation="vertical" >
|
||||||
|
|
||||||
<TableLayout
|
<TableLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="280dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingRight="4dp"
|
android:background="@android:color/transparent"
|
||||||
android:stretchColumns="*" >
|
android:stretchColumns="*" >
|
||||||
|
|
||||||
<TableRow
|
<TableRow
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="72dp"
|
android:layout_height="72dp"
|
||||||
|
android:layout_margin="1dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="#66000000"
|
|
||||||
android:gravity="center" >
|
android:gravity="center" >
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
@ -25,6 +26,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/rounded"
|
||||||
android:ems="8"
|
android:ems="8"
|
||||||
android:text="@string/popup_button_back" />
|
android:text="@string/popup_button_back" />
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
@ -32,8 +34,8 @@
|
||||||
<TableRow
|
<TableRow
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="72dp"
|
android:layout_height="72dp"
|
||||||
|
android:layout_margin="1dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="#66000000"
|
|
||||||
android:gravity="center" >
|
android:gravity="center" >
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
@ -41,6 +43,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/rounded"
|
||||||
android:ems="8"
|
android:ems="8"
|
||||||
android:text="@string/popup_button_clear_cache" />
|
android:text="@string/popup_button_clear_cache" />
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
@ -48,8 +51,8 @@
|
||||||
<TableRow
|
<TableRow
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="72dp"
|
android:layout_height="72dp"
|
||||||
|
android:layout_margin="1dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="#66000000"
|
|
||||||
android:gravity="center" >
|
android:gravity="center" >
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
@ -57,6 +60,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/rounded"
|
||||||
android:ems="8"
|
android:ems="8"
|
||||||
android:text="@string/popup_button_profiler_one" />
|
android:text="@string/popup_button_profiler_one" />
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
@ -64,8 +68,8 @@
|
||||||
<TableRow
|
<TableRow
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="72dp"
|
android:layout_height="72dp"
|
||||||
|
android:layout_margin="1dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="#66000000"
|
|
||||||
android:gravity="center" >
|
android:gravity="center" >
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
@ -73,6 +77,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/rounded"
|
||||||
android:ems="8"
|
android:ems="8"
|
||||||
android:text="@string/popup_button_profiler_two" />
|
android:text="@string/popup_button_profiler_two" />
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
@ -80,8 +85,8 @@
|
||||||
<TableRow
|
<TableRow
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="72dp"
|
android:layout_height="72dp"
|
||||||
|
android:layout_margin="1dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="#66000000"
|
|
||||||
android:gravity="center" >
|
android:gravity="center" >
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
@ -89,6 +94,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/rounded"
|
||||||
android:ems="8"
|
android:ems="8"
|
||||||
android:text="@string/popup_button_print_stats" />
|
android:text="@string/popup_button_print_stats" />
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
|
@ -2,22 +2,23 @@
|
||||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/menuMain"
|
android:id="@+id/menuMain"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="280dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@android:color/transparent"
|
||||||
android:gravity="center_horizontal"
|
android:gravity="center_horizontal"
|
||||||
android:orientation="vertical" >
|
android:orientation="vertical" >
|
||||||
|
|
||||||
<TableLayout
|
<TableLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="280dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingRight="4dp"
|
android:background="@android:color/transparent"
|
||||||
android:stretchColumns="*" >
|
android:stretchColumns="*" >
|
||||||
|
|
||||||
<TableRow
|
<TableRow
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="72dp"
|
android:layout_height="72dp"
|
||||||
|
android:layout_margin="1dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="#66000000"
|
|
||||||
android:gravity="center" >
|
android:gravity="center" >
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
@ -30,8 +31,8 @@
|
||||||
<TableRow
|
<TableRow
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="72dp"
|
android:layout_height="72dp"
|
||||||
|
android:layout_margin="1dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="#66000000"
|
|
||||||
android:gravity="center" >
|
android:gravity="center" >
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
@ -39,6 +40,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/rounded"
|
||||||
android:ems="8"
|
android:ems="8"
|
||||||
android:text="@string/popup_button_disk" />
|
android:text="@string/popup_button_disk" />
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
@ -46,8 +48,8 @@
|
||||||
<TableRow
|
<TableRow
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="72dp"
|
android:layout_height="72dp"
|
||||||
|
android:layout_margin="1dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="#66000000"
|
|
||||||
android:gravity="center" >
|
android:gravity="center" >
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
@ -55,6 +57,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/rounded"
|
||||||
android:ems="8"
|
android:ems="8"
|
||||||
android:text="@string/popup_button_vmu_swap" />
|
android:text="@string/popup_button_vmu_swap" />
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
@ -62,8 +65,8 @@
|
||||||
<TableRow
|
<TableRow
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="72dp"
|
android:layout_height="72dp"
|
||||||
|
android:layout_margin="1dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="#66000000"
|
|
||||||
android:gravity="center" >
|
android:gravity="center" >
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
@ -71,6 +74,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/rounded"
|
||||||
android:ems="8"
|
android:ems="8"
|
||||||
android:text="@string/popup_button_options" />
|
android:text="@string/popup_button_options" />
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
@ -78,8 +82,8 @@
|
||||||
<TableRow
|
<TableRow
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="72dp"
|
android:layout_height="72dp"
|
||||||
|
android:layout_margin="1dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="#66000000"
|
|
||||||
android:gravity="center" >
|
android:gravity="center" >
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
@ -87,6 +91,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/rounded"
|
||||||
android:ems="8"
|
android:ems="8"
|
||||||
android:text="@string/popup_button_debugging" />
|
android:text="@string/popup_button_debugging" />
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
@ -94,8 +99,8 @@
|
||||||
<TableRow
|
<TableRow
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="72dp"
|
android:layout_height="72dp"
|
||||||
|
android:layout_margin="1dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="#66000000"
|
|
||||||
android:gravity="center" >
|
android:gravity="center" >
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
@ -103,6 +108,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/rounded"
|
||||||
android:ems="8"
|
android:ems="8"
|
||||||
android:text="@string/popup_button_screenshot" />
|
android:text="@string/popup_button_screenshot" />
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
@ -110,8 +116,8 @@
|
||||||
<TableRow
|
<TableRow
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="72dp"
|
android:layout_height="72dp"
|
||||||
|
android:layout_margin="1dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="#66000000"
|
|
||||||
android:gravity="center" >
|
android:gravity="center" >
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
@ -119,6 +125,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/rounded"
|
||||||
android:ems="8"
|
android:ems="8"
|
||||||
android:text="@string/popup_button_exit" />
|
android:text="@string/popup_button_exit" />
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
|
@ -101,7 +101,7 @@
|
||||||
<string name="input">Input</string>
|
<string name="input">Input</string>
|
||||||
<string name="about">About</string>
|
<string name="about">About</string>
|
||||||
<string name="rateme">Rate Me</string>
|
<string name="rateme">Rate Me</string>
|
||||||
<string name="messages">Test Suite</string>
|
<string name="messages">Send Logs</string>
|
||||||
<string name="cloud">Cloud VMU</string>
|
<string name="cloud">Cloud VMU</string>
|
||||||
|
|
||||||
<string name="textOn">ON</string>
|
<string name="textOn">ON</string>
|
||||||
|
|
|
@ -98,13 +98,7 @@ public class AboutFragment extends Fragment {
|
||||||
slidingGithub.setOnDrawerOpenListener(new OnDrawerOpenListener() {
|
slidingGithub.setOnDrawerOpenListener(new OnDrawerOpenListener() {
|
||||||
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
||||||
public void onDrawerOpened() {
|
public void onDrawerOpened() {
|
||||||
retrieveGitTask queryGithub = new retrieveGitTask();
|
new retrieveGitTask().execute(git_api);
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
|
||||||
queryGithub.executeOnExecutor(
|
|
||||||
AsyncTask.THREAD_POOL_EXECUTOR, git_api);
|
|
||||||
} else {
|
|
||||||
queryGithub.execute(git_api);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -195,21 +195,9 @@ public class FileBrowser extends Fragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ImgBrowse && !games) {
|
if (!ImgBrowse && !games) {
|
||||||
LocateGames mLocateGames = new LocateGames(R.array.flash);
|
new LocateGames(R.array.flash).execute(home_directory);
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
|
||||||
mLocateGames
|
|
||||||
.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, home_directory);
|
|
||||||
} else {
|
|
||||||
mLocateGames.execute(home_directory);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
LocateGames mLocateGames = new LocateGames(R.array.images);
|
new LocateGames(R.array.images).execute(game_directory);
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
|
||||||
mLocateGames
|
|
||||||
.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, game_directory);
|
|
||||||
} else {
|
|
||||||
mLocateGames.execute(game_directory);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -405,14 +393,13 @@ public class FileBrowser extends Fragment {
|
||||||
mCallback.onFolderSelected(game != null ? Uri
|
mCallback.onFolderSelected(game != null ? Uri
|
||||||
.fromFile(game) : Uri.EMPTY);
|
.fromFile(game) : Uri.EMPTY);
|
||||||
home_directory = game.getAbsolutePath().substring(0,
|
home_directory = game.getAbsolutePath().substring(0,
|
||||||
game.getAbsolutePath().lastIndexOf(File.separator));
|
game.getAbsolutePath().lastIndexOf(File.separator)).replace("/data", "");
|
||||||
if (!DataDirectoryBIOS()) {
|
if (!DataDirectoryBIOS()) {
|
||||||
MainActivity.showToastMessage(getActivity(),
|
MainActivity.showToastMessage(getActivity(),
|
||||||
getActivity().getString(R.string.config_data, home_directory),
|
getActivity().getString(R.string.config_data, home_directory),
|
||||||
Toast.LENGTH_LONG);
|
Toast.LENGTH_LONG);
|
||||||
}
|
}
|
||||||
mPrefs.edit().putString("home_directory",
|
mPrefs.edit().putString("home_directory", home_directory).commit();
|
||||||
home_directory.replace("/data", "")).commit();
|
|
||||||
JNIdc.config(home_directory.replace("/data", ""));
|
JNIdc.config(home_directory.replace("/data", ""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -504,7 +491,7 @@ public class FileBrowser extends Fragment {
|
||||||
.putString(Config.pref_games,
|
.putString(Config.pref_games,
|
||||||
heading).commit();
|
heading).commit();
|
||||||
} else {
|
} else {
|
||||||
home_directory = heading;
|
home_directory = heading.replace("/data", "");
|
||||||
mPrefs.edit()
|
mPrefs.edit()
|
||||||
.putString(Config.pref_home,
|
.putString(Config.pref_home,
|
||||||
heading).commit();
|
heading).commit();
|
||||||
|
@ -544,12 +531,18 @@ public class FileBrowser extends Fragment {
|
||||||
if (!data_directory.exists() || !data_directory.isDirectory()) {
|
if (!data_directory.exists() || !data_directory.isDirectory()) {
|
||||||
data_directory.mkdirs();
|
data_directory.mkdirs();
|
||||||
File bios = new File(home_directory, "dc_boot.bin");
|
File bios = new File(home_directory, "dc_boot.bin");
|
||||||
boolean success = bios.renameTo(new File(home_directory + "/data", "dc_boot.bin"));
|
boolean success = bios.renameTo(new File(home_directory, "data/dc_boot.bin"));
|
||||||
File flash = new File(home_directory, "dc_flash.bin");
|
File flash = new File(home_directory, "dc_flash.bin");
|
||||||
success = flash.renameTo(new File(home_directory + "/data", "dc_flash.bin"));
|
success = flash.renameTo(new File(home_directory, "data/dc_flash.bin"));
|
||||||
return success;
|
return success;
|
||||||
} else {
|
} else {
|
||||||
return true;
|
File bios = new File(home_directory, "data/dc_boot.bin");
|
||||||
|
File flash = new File(home_directory, "data/dc_flash.bin");
|
||||||
|
if (bios.exists() && flash.exists()) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,6 +96,7 @@ public class GL2JNIActivity extends Activity {
|
||||||
pad.deviceDescriptor_PlayerNum.remove(null);
|
pad.deviceDescriptor_PlayerNum.remove(null);
|
||||||
|
|
||||||
moga.onCreate(this, pad);
|
moga.onCreate(this, pad);
|
||||||
|
moga.mListener.setPlayerNum(1);
|
||||||
|
|
||||||
boolean controllerTwoConnected = false;
|
boolean controllerTwoConnected = false;
|
||||||
boolean controllerThreeConnected = false;
|
boolean controllerThreeConnected = false;
|
||||||
|
@ -314,7 +315,73 @@ public class GL2JNIActivity extends Activity {
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean motionEventHandler(Integer playerNum, com.bda.controller.MotionEvent event) {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
|
||||||
|
|
||||||
|
if (playerNum == null || playerNum == -1)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!pad.compat[playerNum]) {
|
||||||
|
|
||||||
|
// do other things with joystick
|
||||||
|
float LS_X = event.getAxisValue(OuyaController.AXIS_LS_X);
|
||||||
|
float LS_Y = event.getAxisValue(OuyaController.AXIS_LS_Y);
|
||||||
|
float RS_X = event.getAxisValue(OuyaController.AXIS_RS_X);
|
||||||
|
float RS_Y = event.getAxisValue(OuyaController.AXIS_RS_Y);
|
||||||
|
float L2 = event.getAxisValue(OuyaController.AXIS_L2);
|
||||||
|
float R2 = event.getAxisValue(OuyaController.AXIS_R2);
|
||||||
|
|
||||||
|
if (!pad.joystick[playerNum]) {
|
||||||
|
pad.previousLS_X[playerNum] = pad.globalLS_X[playerNum];
|
||||||
|
pad.previousLS_Y[playerNum] = pad.globalLS_Y[playerNum];
|
||||||
|
pad.globalLS_X[playerNum] = LS_X;
|
||||||
|
pad.globalLS_Y[playerNum] = LS_Y;
|
||||||
|
}
|
||||||
|
|
||||||
|
GL2JNIView.jx[playerNum] = (int) (LS_X * 126);
|
||||||
|
GL2JNIView.jy[playerNum] = (int) (LS_Y * 126);
|
||||||
|
|
||||||
|
GL2JNIView.lt[playerNum] = (int) (L2 * 255);
|
||||||
|
GL2JNIView.rt[playerNum] = (int) (R2 * 255);
|
||||||
|
|
||||||
|
if (prefs.getBoolean(Gamepad.pref_js_rbuttons + pad.portId[playerNum], true)) {
|
||||||
|
if (RS_Y > 0.25) {
|
||||||
|
handle_key(playerNum, pad.map[playerNum][0]/* A */, true);
|
||||||
|
pad.wasKeyStick[playerNum] = true;
|
||||||
|
} else if (RS_Y < 0.25) {
|
||||||
|
handle_key(playerNum, pad.map[playerNum][1]/* B */, true);
|
||||||
|
pad.wasKeyStick[playerNum] = true;
|
||||||
|
} else if (pad.wasKeyStick[playerNum]){
|
||||||
|
handle_key(playerNum, pad.map[playerNum][0], false);
|
||||||
|
handle_key(playerNum, pad.map[playerNum][1], false);
|
||||||
|
pad.wasKeyStick[playerNum] = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (RS_Y > 0.25) {
|
||||||
|
GL2JNIView.rt[playerNum] = (int) (RS_Y * 255);
|
||||||
|
GL2JNIView.lt[playerNum] = (int) (L2 * 255);
|
||||||
|
} else if (RS_Y < 0.25) {
|
||||||
|
GL2JNIView.rt[playerNum] = (int) (R2 * 255);
|
||||||
|
GL2JNIView.lt[playerNum] = (int) (-(RS_Y) * 255);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
mView.pushInput();
|
||||||
|
if (!pad.joystick[playerNum] && (pad.globalLS_X[playerNum] == pad.previousLS_X[playerNum] && pad.globalLS_Y[playerNum] == pad.previousLS_Y[playerNum])
|
||||||
|
|| (pad.previousLS_X[playerNum] == 0.0f && pad.previousLS_Y[playerNum] == 0.0f))
|
||||||
|
// Only handle Left Stick on an Xbox 360 controller if there was
|
||||||
|
// some actual motion on the stick,
|
||||||
|
// so otherwise the event can be handled as a DPAD event
|
||||||
|
return false;
|
||||||
|
else
|
||||||
|
return true;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean simulatedTouchEvent(int playerNum, float L2, float R2) {
|
public boolean simulatedTouchEvent(int playerNum, float L2, float R2) {
|
||||||
|
|
|
@ -98,6 +98,7 @@ public class GL2JNINative extends NativeActivity {
|
||||||
pad.deviceDescriptor_PlayerNum.remove(null);
|
pad.deviceDescriptor_PlayerNum.remove(null);
|
||||||
|
|
||||||
moga.onCreate(this, pad);
|
moga.onCreate(this, pad);
|
||||||
|
moga.mListener.setPlayerNum(1);
|
||||||
|
|
||||||
boolean controllerTwoConnected = false;
|
boolean controllerTwoConnected = false;
|
||||||
boolean controllerThreeConnected = false;
|
boolean controllerThreeConnected = false;
|
||||||
|
@ -320,6 +321,73 @@ public class GL2JNINative extends NativeActivity {
|
||||||
popUpConfig.update(LayoutParams.WRAP_CONTENT,
|
popUpConfig.update(LayoutParams.WRAP_CONTENT,
|
||||||
LayoutParams.WRAP_CONTENT);
|
LayoutParams.WRAP_CONTENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean motionEventHandler(Integer playerNum, com.bda.controller.MotionEvent event) {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
|
||||||
|
|
||||||
|
if (playerNum == null || playerNum == -1)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!pad.compat[playerNum]) {
|
||||||
|
|
||||||
|
// do other things with joystick
|
||||||
|
float LS_X = event.getAxisValue(OuyaController.AXIS_LS_X);
|
||||||
|
float LS_Y = event.getAxisValue(OuyaController.AXIS_LS_Y);
|
||||||
|
float RS_X = event.getAxisValue(OuyaController.AXIS_RS_X);
|
||||||
|
float RS_Y = event.getAxisValue(OuyaController.AXIS_RS_Y);
|
||||||
|
float L2 = event.getAxisValue(OuyaController.AXIS_L2);
|
||||||
|
float R2 = event.getAxisValue(OuyaController.AXIS_R2);
|
||||||
|
|
||||||
|
if (!pad.joystick[playerNum]) {
|
||||||
|
pad.previousLS_X[playerNum] = pad.globalLS_X[playerNum];
|
||||||
|
pad.previousLS_Y[playerNum] = pad.globalLS_Y[playerNum];
|
||||||
|
pad.globalLS_X[playerNum] = LS_X;
|
||||||
|
pad.globalLS_Y[playerNum] = LS_Y;
|
||||||
|
}
|
||||||
|
|
||||||
|
GL2JNIView.jx[playerNum] = (int) (LS_X * 126);
|
||||||
|
GL2JNIView.jy[playerNum] = (int) (LS_Y * 126);
|
||||||
|
|
||||||
|
GL2JNIView.lt[playerNum] = (int) (L2 * 255);
|
||||||
|
GL2JNIView.rt[playerNum] = (int) (R2 * 255);
|
||||||
|
|
||||||
|
if (prefs.getBoolean(Gamepad.pref_js_rbuttons + pad.portId[playerNum], true)) {
|
||||||
|
if (RS_Y > 0.25) {
|
||||||
|
handle_key(playerNum, pad.map[playerNum][0]/* A */, true);
|
||||||
|
pad.wasKeyStick[playerNum] = true;
|
||||||
|
} else if (RS_Y < 0.25) {
|
||||||
|
handle_key(playerNum, pad.map[playerNum][1]/* B */, true);
|
||||||
|
pad.wasKeyStick[playerNum] = true;
|
||||||
|
} else if (pad.wasKeyStick[playerNum]){
|
||||||
|
handle_key(playerNum, pad.map[playerNum][0], false);
|
||||||
|
handle_key(playerNum, pad.map[playerNum][1], false);
|
||||||
|
pad.wasKeyStick[playerNum] = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (RS_Y > 0.25) {
|
||||||
|
GL2JNIView.rt[playerNum] = (int) (RS_Y * 255);
|
||||||
|
GL2JNIView.lt[playerNum] = (int) (L2 * 255);
|
||||||
|
} else if (RS_Y < 0.25) {
|
||||||
|
GL2JNIView.rt[playerNum] = (int) (R2 * 255);
|
||||||
|
GL2JNIView.lt[playerNum] = (int) (-(RS_Y) * 255);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
mView.pushInput();
|
||||||
|
if (!pad.joystick[playerNum] && (pad.globalLS_X[playerNum] == pad.previousLS_X[playerNum] && pad.globalLS_Y[playerNum] == pad.previousLS_Y[playerNum])
|
||||||
|
|| (pad.previousLS_X[playerNum] == 0.0f && pad.previousLS_Y[playerNum] == 0.0f))
|
||||||
|
// Only handle Left Stick on an Xbox 360 controller if there was
|
||||||
|
// some actual motion on the stick,
|
||||||
|
// so otherwise the event can be handled as a DPAD event
|
||||||
|
return false;
|
||||||
|
else
|
||||||
|
return true;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onGenericMotionEvent(MotionEvent event) {
|
public boolean onGenericMotionEvent(MotionEvent event) {
|
||||||
|
@ -402,7 +470,7 @@ public class GL2JNINative extends NativeActivity {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean handle_key(Integer playerNum, int kc, boolean down) {
|
public boolean handle_key(Integer playerNum, int kc, boolean down) {
|
||||||
if (playerNum == null || playerNum == -1)
|
if (playerNum == null || playerNum == -1)
|
||||||
return false;
|
return false;
|
||||||
if (kc == pad.getSelectButtonCode()) {
|
if (kc == pad.getSelectButtonCode()) {
|
||||||
|
|
|
@ -106,11 +106,7 @@ public class MainActivity extends SlidingFragmentActivity implements
|
||||||
public void uncaughtException(Thread t, Throwable error) {
|
public void uncaughtException(Thread t, Throwable error) {
|
||||||
if (error != null) {
|
if (error != null) {
|
||||||
StringBuilder output = new StringBuilder();
|
StringBuilder output = new StringBuilder();
|
||||||
output.append("Thread:\n");
|
output.append("UncaughtException:\n");
|
||||||
for (StackTraceElement trace : t.getStackTrace()) {
|
|
||||||
output.append(trace.toString() + "\n");
|
|
||||||
}
|
|
||||||
output.append("\nError:\n");
|
|
||||||
for (StackTraceElement trace : error.getStackTrace()) {
|
for (StackTraceElement trace : error.getStackTrace()) {
|
||||||
output.append(trace.toString() + "\n");
|
output.append(trace.toString() + "\n");
|
||||||
}
|
}
|
||||||
|
@ -349,14 +345,7 @@ public class MainActivity extends SlidingFragmentActivity implements
|
||||||
}
|
}
|
||||||
|
|
||||||
public void generateErrorLog() {
|
public void generateErrorLog() {
|
||||||
GenerateLogs mGenerateLogs = new GenerateLogs(MainActivity.this);
|
new GenerateLogs(MainActivity.this).execute(getFilesDir().getAbsolutePath());
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
|
||||||
mGenerateLogs.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,
|
|
||||||
getFilesDir().getAbsolutePath());
|
|
||||||
} else {
|
|
||||||
mGenerateLogs.execute(getFilesDir().getAbsolutePath());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -196,12 +196,15 @@ public class XMLParser extends AsyncTask<String, Integer, String> {
|
||||||
|
|
||||||
public boolean isNetworkAvailable() {
|
public boolean isNetworkAvailable() {
|
||||||
ConnectivityManager connectivityManager = (ConnectivityManager) mContext
|
ConnectivityManager connectivityManager = (ConnectivityManager) mContext
|
||||||
.getSystemService(Context.CONNECTIVITY_SERVICE);
|
.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||||
// NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
|
|
||||||
NetworkInfo mWifi = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
|
NetworkInfo mWifi = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
|
||||||
NetworkInfo mMobile = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
|
NetworkInfo mMobile = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
|
||||||
// return activeNetworkInfo != null && activeNetworkInfo.isConnected();
|
NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
|
||||||
return mMobile.isAvailable() || mWifi.isAvailable();
|
if (mMobile != null && mWifi != null) {
|
||||||
|
return mMobile.isAvailable() || mWifi.isAvailable();
|
||||||
|
} else {
|
||||||
|
return activeNetworkInfo != null && activeNetworkInfo.isConnected();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Drawable getGameIcon() {
|
public Drawable getGameIcon() {
|
||||||
|
|
|
@ -71,6 +71,7 @@ public class InputFragment extends Fragment {
|
||||||
parentActivity = getActivity();
|
parentActivity = getActivity();
|
||||||
|
|
||||||
moga.onCreate(parentActivity, pad);
|
moga.onCreate(parentActivity, pad);
|
||||||
|
moga.mListener.setPlayerNum(1);
|
||||||
|
|
||||||
sharedPreferences = PreferenceManager
|
sharedPreferences = PreferenceManager
|
||||||
.getDefaultSharedPreferences(parentActivity);
|
.getDefaultSharedPreferences(parentActivity);
|
||||||
|
|
|
@ -14,12 +14,14 @@ import android.os.Handler;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import com.bda.controller.KeyEvent;
|
|
||||||
|
|
||||||
|
import com.bda.controller.KeyEvent;
|
||||||
import com.bda.controller.Controller;
|
import com.bda.controller.Controller;
|
||||||
import com.bda.controller.ControllerListener;
|
import com.bda.controller.ControllerListener;
|
||||||
import com.bda.controller.MotionEvent;
|
import com.bda.controller.MotionEvent;
|
||||||
import com.bda.controller.StateEvent;
|
import com.bda.controller.StateEvent;
|
||||||
|
import com.reicast.emulator.GL2JNIActivity;
|
||||||
|
import com.reicast.emulator.GL2JNINative;
|
||||||
import com.reicast.emulator.R;
|
import com.reicast.emulator.R;
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
@ -39,6 +41,7 @@ public final class MOGAInput
|
||||||
static final int ACTION_VERSION_MOGAPRO = Controller.ACTION_VERSION_MOGAPRO;
|
static final int ACTION_VERSION_MOGAPRO = Controller.ACTION_VERSION_MOGAPRO;
|
||||||
|
|
||||||
public Controller mController = null;
|
public Controller mController = null;
|
||||||
|
public ExampleControllerListener mListener;
|
||||||
private String notify;
|
private String notify;
|
||||||
private Gamepad pad;
|
private Gamepad pad;
|
||||||
|
|
||||||
|
@ -88,7 +91,8 @@ public final class MOGAInput
|
||||||
|
|
||||||
mController = Controller.getInstance(act);
|
mController = Controller.getInstance(act);
|
||||||
mController.init();
|
mController.init();
|
||||||
mController.setListener(new ExampleControllerListener(), new Handler());
|
mListener = new ExampleControllerListener();
|
||||||
|
mController.setListener(mListener, new Handler());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onDestroy()
|
public void onDestroy()
|
||||||
|
@ -129,19 +133,36 @@ public final class MOGAInput
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
class ExampleControllerListener implements ControllerListener
|
public class ExampleControllerListener implements ControllerListener
|
||||||
{
|
{
|
||||||
|
int playerNum;
|
||||||
|
|
||||||
|
public void setPlayerNum(int playerNum) {
|
||||||
|
this.playerNum = playerNum;
|
||||||
|
}
|
||||||
|
|
||||||
public void onKeyEvent(KeyEvent event)
|
public void onKeyEvent(KeyEvent event)
|
||||||
{
|
{
|
||||||
// Handled by the primary controller interface
|
boolean keydown = false;
|
||||||
// act.dispatchKeyEvent(new android.view.KeyEvent(0, 0, event.getAction(),
|
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||||
// event.getKeyCode(), 0));
|
keydown = true;
|
||||||
|
}
|
||||||
|
if (act instanceof GL2JNIActivity) {
|
||||||
|
((GL2JNIActivity) act).handle_key(playerNum, event.getKeyCode(), keydown);
|
||||||
|
}
|
||||||
|
if (act instanceof GL2JNINative) {
|
||||||
|
((GL2JNINative) act).handle_key(playerNum, event.getKeyCode(), keydown);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onMotionEvent(MotionEvent event)
|
public void onMotionEvent(MotionEvent event)
|
||||||
{
|
{
|
||||||
// Handled by the primary controller interface
|
if (act instanceof GL2JNIActivity) {
|
||||||
|
((GL2JNIActivity) act).motionEventHandler(playerNum, event);
|
||||||
|
}
|
||||||
|
if (act instanceof GL2JNINative) {
|
||||||
|
((GL2JNINative) act).motionEventHandler(playerNum, event);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getCompatibilityMap(int playerNum, String id) {
|
private void getCompatibilityMap(int playerNum, String id) {
|
||||||
|
|
Loading…
Reference in New Issue