Squash changes from andoidui into single commit

Integrate previously locked settings with valid user warning

Put a note about the beta compile link in the README.md

Add a super fancy about that supports Github commit logs

Revise about with git log, Highlight current build in commits

Check for a null value when getting the current commit sha

Chinese Simplified Translation from @weihan1102

Rename Simplified Chinese res folder for proper complie

Add links to the website and beta compile site from about

Add option for custom mapping to set joystick to non-dpad

Fix a missing check for the user saved value of the A button

The Moga only operates one way, there is no variation test

Add region values, Set cable to match formatting of others

Reduce the number of random string array calls, jsCompat

It was unnecessary to keep getting the array, It was even less
necessary to keep getting the preference values. The port
identification letters are set multi-lingual values.

Label the about links to prevent any confusion (Not mirrors)

Missing a check on the motion events to determine compat

Add a check to verify Kitkat, Remove the standard override

The new API verification complains about the Override, so this is a
preventative step for if and when it is updated. It may also prevent
some issues with compatibility.

Run organize imports to reduce the amount of excess code

Add a controller option to go to custom layout from selection

Prevent a leak where multiple items were highlighted in list

@AndroidGX French Translation resources
This commit is contained in:
TwistedUmbrella 2014-01-27 10:52:23 -05:00
parent 3beb22b25c
commit ae5394f6b6
44 changed files with 1496 additions and 440 deletions

2
.gitignore vendored
View File

@ -8,3 +8,5 @@ obj/
newdc/android/libnewdc/bin/libnewdc.jar
newdc/android/libnewdc/bin/classes/com/example/newdc/JNIdc.class
shell/android/assets/build

View File

@ -32,6 +32,10 @@ ndk-build -j 4
ant debug
```
Beta versions
-------------------
Compiled test versions are available at reicast.loungekatt.com
Donations and stuff
-------------------
Well, glad you liked the project so far!

View File

@ -216,7 +216,7 @@ void LoadSettings()
settings.dynarec.Enable = cfgLoadInt("config","Dynarec.Enabled", 1)!=0;
settings.dynarec.idleskip = cfgLoadInt("config","Dynarec.idleskip",1)!=0;
settings.dynarec.unstable_opt = cfgLoadInt("config","Dynarec.unstable-opt",0);
settings.dreamcast.cable = cfgLoadInt("config","Dreamcast.Cable", 3);
settings.dreamcast.cable = cfgLoadInt("config","Dreamcast.Cable",3);
settings.dreamcast.RTC = cfgLoadInt("config","Dreamcast.RTC",GetRTC_now());
settings.dreamcast.region = cfgLoadInt("config","Dreamcast.Region",3);
settings.dreamcast.broadcast = cfgLoadInt("config","Dreamcast.Broadcast",4);

View File

@ -7,10 +7,11 @@
android:minSdkVersion="8"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.VIBRATE"></uses-permission>
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-feature android:glEsVersion="0x00020000" android:required="false" />
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false"/>
<application

View File

@ -0,0 +1 @@
382f2e5c19c85627f23bdc8e6cc2c59c97262bc3

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Selector style for listrow -->
<item android:drawable="@drawable/gradient_bg" android:state_pressed="false" android:state_selected="false"/>
<item android:drawable="@drawable/gradient_bg_hover" android:state_pressed="true"/>
<item android:drawable="@drawable/gradient_bg_hover" android:state_pressed="false" android:state_selected="true"/>
</selector>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<!-- Gradient Bg for listrow -->
<gradient
android:angle="270"
android:centerColor="#e7e7e8"
android:endColor="#cfcfcf"
android:startColor="#f1f1f2" />
</shape>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<!-- Gradient BgColor for listrow Selected -->
<gradient
android:angle="270"
android:centerColor="#16cedb"
android:endColor="#09adb9"
android:startColor="#18d7e5" />
</shape>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape android:shape="rectangle" >
<stroke
android:width="1dp"
android:color="#dbdbdc" />
<solid android:color="#FFFFFF" />
</shape>
</item>
</layer-list>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Selector style for listrow -->
<item android:drawable="@drawable/gradient_bg" android:state_pressed="false" android:state_selected="false"/>
<item android:drawable="@drawable/gradient_bg_hover" android:state_pressed="true"/>
<item android:drawable="@drawable/gradient_bg_hover" android:state_pressed="false" android:state_selected="true"/>
</selector>

View File

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical" >
<TextView
android:id="@+id/about_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="6dp"
android:layout_marginTop="10dp"
android:ems="12"
android:gravity="center"
android:text="@string/about_text" />
<TextView
android:id="@+id/site_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="6dp"
android:layout_marginTop="10dp"
android:ems="12"
android:gravity="center"
android:text="@string/app_site" />
<TextView
android:id="@+id/beta_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="6dp"
android:layout_marginTop="10dp"
android:ems="12"
android:gravity="center"
android:text="@string/beta_site" />
<SlidingDrawer
android:id="@+id/slidingGithub"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:content="@+id/changelist"
android:handle="@+id/handle"
android:topOffset="40dp" >
<Button
android:id="@+id/handle"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@drawable/ic_github" >
</Button>
<RelativeLayout
android:id="@+id/changelist"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ListView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="#b5b5b5"
android:dividerHeight="1dp"
android:listSelector="@drawable/list_selector" />
</RelativeLayout>
</SlidingDrawer>
</LinearLayout>

View File

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/change"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/list_selector"
android:orientation="horizontal"
android:padding="5dip" >
<!-- ListRow Left Thumbnail image -->
<LinearLayout
android:id="@+id/thumbnail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginRight="5dip"
android:background="@drawable/image_bg"
android:padding="3dip" >
<ImageView
android:id="@+id/avatar"
android:layout_width="60dip"
android:layout_height="60dip"
android:gravity="center"
android:src="@drawable/ic_github" />
</LinearLayout>
<!-- Main Commit Content -->
<TextView
android:id="@+id/committer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dip"
android:layout_toRightOf="@+id/thumbnail"
android:text="GitHub Committer"
android:textColor="#040404"
android:textSize="14sp"
android:textStyle="bold"
android:typeface="sans" />
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/committer"
android:layout_marginTop="2dip"
android:layout_toRightOf="@+id/thumbnail"
android:text="GitHub Commit Message"
android:textColor="#343434"
android:textSize="12sp" />
<!-- Right Date -->
<TextView
android:id="@+id/date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignTop="@id/thumbnail"
android:layout_marginRight="5dip"
android:gravity="right"
android:text="January 25, 2012"
android:textColor="#10bcc9"
android:textSize="12sp"
android:textStyle="bold" />
</RelativeLayout>

View File

@ -7,38 +7,12 @@
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:stretchColumns="*" >
android:stretchColumns="*"
android:layout_marginLeft="6dp" >
<!--
TableRow android:gravity="center_vertical"
android:layout_marginTop="10dp" >
<TextView
android:id="@+id/dynarec_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:ems="10"
android:gravity="center_vertical|left"
android:text="@string/select_dynarec" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:orientation="vertical" >
<de.ankri.views.Switch
android:id="@+id/dynarec_option"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</TableRow
-->
<TableRow android:gravity="center_vertical"
android:layout_marginTop="10dp" >
<TableRow
android:layout_marginTop="10dp"
android:gravity="center_vertical" >
<TextView
android:id="@+id/unstable_text"
@ -63,64 +37,9 @@
</LinearLayout>
</TableRow>
<!--
LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="10dp" >
<TextView
android:id="@+id/region_text"
android:layout_width="wrap_content"
android:layout_height="0dip"
android:layout_weight="1"
android:text="@string/select_region" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Spinner
android:id="@+id/region_spinner"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10" >
</Spinner>
</LinearLayout>
</LinearLayout
-->
<TableRow android:gravity="center_vertical"
android:layout_marginTop="10dp" >
<TextView
android:id="@+id/limitfps_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:ems="10"
android:gravity="center_vertical|left"
android:text="@string/select_limitfps" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:orientation="vertical" >
<de.ankri.views.Switch
android:id="@+id/limitfps_option"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</TableRow>
<TableRow android:gravity="center_vertical"
android:layout_marginTop="10dp" >
<TableRow
android:layout_marginTop="10dp"
android:gravity="center_vertical" >
<TextView
android:id="@+id/mipmaps_text"
@ -145,8 +64,9 @@
</LinearLayout>
</TableRow>
<TableRow android:gravity="center_vertical"
android:layout_marginTop="10dp" >
<TableRow
android:layout_marginTop="10dp"
android:gravity="center_vertical" >
<TextView
android:id="@+id/stretch_text"
@ -174,8 +94,8 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="10dp" >
android:layout_marginTop="10dp"
android:orientation="vertical" >
<TextView
android:id="@+id/frameskip_text"
@ -207,40 +127,134 @@
</LinearLayout>
</LinearLayout>
<!--
TableRow android:gravity="center_vertical"
android:layout_marginTop="10dp" >
<TableRow
android:layout_marginTop="10dp"
android:gravity="center_vertical" >
<TextView
android:id="@+id/render_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:ems="10"
android:gravity="center_vertical|left"
android:text="@string/select_render" />
android:id="@+id/experimental_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:gravity="center_vertical"
android:text="@string/experimental_opts" />
</TableRow>
<TableRow
android:layout_marginTop="10dp"
android:gravity="center_vertical" >
<TextView
android:id="@+id/dynarec_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:ems="10"
android:gravity="center_vertical|left"
android:text="@string/select_dynarec" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:orientation="vertical" >
<de.ankri.views.Switch
android:id="@+id/render_option"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</TableRow
-->
<de.ankri.views.Switch
android:id="@+id/dynarec_option"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</TableRow>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="10dp" >
android:layout_marginTop="10dp"
android:orientation="vertical" >
<TextView
android:id="@+id/region_text"
android:layout_width="wrap_content"
android:layout_height="0dip"
android:layout_weight="1"
android:text="@string/select_region" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Spinner
android:id="@+id/region_spinner"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10" >
</Spinner>
</LinearLayout>
</LinearLayout>
<TableRow
android:layout_marginTop="10dp"
android:gravity="center_vertical" >
<TextView
android:id="@+id/limitfps_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:ems="10"
android:gravity="center_vertical|left"
android:text="@string/select_limitfps" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:orientation="vertical" >
<de.ankri.views.Switch
android:id="@+id/limitfps_option"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</TableRow>
<TableRow
android:layout_marginTop="10dp"
android:gravity="center_vertical" >
<TextView
android:id="@+id/render_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:ems="10"
android:gravity="center_vertical|left"
android:text="@string/select_render" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:orientation="vertical" >
<de.ankri.views.Switch
android:id="@+id/render_option"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</TableRow>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="vertical" >
<TextView
android:id="@+id/cheatdisk_text"
@ -265,8 +279,9 @@
</LinearLayout>
</LinearLayout>
<TableRow android:gravity="center_vertical"
android:layout_marginTop="10dp" >
<TableRow
android:layout_marginTop="10dp"
android:gravity="center_vertical" >
<Button
android:id="@+id/debug_button"

View File

@ -424,6 +424,32 @@
android:text="@string/remove" />
</LinearLayout>
</TableRow>
<TableRow
android:layout_marginTop="25dp"
android:gravity="center_vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:ems="10"
android:gravity="center_vertical|left"
android:text="@string/dpad_joystick" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:orientation="vertical" >
<de.ankri.views.Switch
android:id="@+id/dpad_js_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</TableRow>
<TableRow
android:layout_marginTop="25dp"

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:orientation="vertical" >
<WebView
android:id="@+id/webframe"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scrollbars="none" />
</LinearLayout>

View File

@ -52,7 +52,6 @@
<string name="moga_pro_connect">MOGA Pro Connected!</string>
<string name="moga_connect">MOGA Connected!</string>
<string name="about_title">About reicast</string>
<string name="about_text">reicast is a dreamcast emulator\n\nVersion: %1$s</string>
<string-array name="controllers">

View File

@ -51,7 +51,6 @@
<string name="moga_pro_connect">MOGA Pro conectado!</string>
<string name="moga_connect">MOGA conectado!</string>
<string name="about_title">Acerca reicast</string>
<string name="about_text">reicast es un emulador de Dreamcast\n\nVersion: %1$s</string>
<string-array name="controllers">

View File

@ -0,0 +1,116 @@
<resources>
<string name="app_name">reicast</string>
<string name="menu_settings">Réglages</string>
<string name="title_activity_main">reicast</string>
<string name="system_path">Répertoire système (emplacement du répertoire \'data\' comprenant les fichiers \'dc_boot.bin\' et \'dc_flash.bin\')</string>
<string name="browser_path">Répertoire système par défaut</string>
<string name="games_path">Répertoire des jeux (emplacement de vos fichiers images au format gdi, chd ou cdi)</string>
<string name="game_path">Répertoire des jeux par défaut</string>
<string name="boot_bios">Démarrer le bios Dreamcast</string>
<string name="missing_bios">Il manque le fichier BIOS. Le fichier BIOS de la Dreamcast est indispensable pour faire fonctionner cet émulateur. Celui-ci doit être placé dans %1$s/data/dc_boot.bin</string>
<string name="missing_flash">Il manque le fichier FLASH. Le fichier FLASH de la Dreamcast est indispensable pour faire fonctionner cet émulateur. Celui-ci doit être placé dans %1$s/data/dc_flash.bin</string>
<string name="require_bios">Vous devez fournir un fichier BIOS</string>
<string name="folder_bios">DEMARRER LE BIOS</string>
<string name="folder_select">SELECTIONNER LE DOSSIER ACTUEL</string>
<string name="experimental_opts">Experimental (peut causer un crash)</string>
<string name="select_dynarec">Options du Dynarec</string>
<string name="select_unstable">Optimisations instables</string>
<string name="select_region">Région du bios</string>
<string name="select_limitfps">Limiter le nombre de FPS</string>
<string name="select_mipmaps">Rendu Mipmaps (correction pour l\'ancien SGX540)</string>
<string name="select_stretch">Mode portrait (écran large)</string>
<string name="set_frameskip">Valeur de saut des images</string>
<string name="select_render">Rendu PVR (ne fonctionne pas pour le moment)</string>
<string name="default_disk">Régler le disc par défaut</string>
<string name="games_listing">Liste des jeux disponibles</string>
<string name="customize_touch_controls">Personnaliser les contrôles tactiles</string>
<string name="launch_editor">Lancer l\'éditeur</string>
<string name="touch_vibration">Vibrations</string>
<string name="controller_a">Manette A</string>
<string name="controller_b">Manette B</string>
<string name="controller_c">Manette C</string>
<string name="controller_d">Manette D</string>
<string name="controller_not_connected">Manette non connectée</string>
<string name="controller_none_selected">Aucune manette selectionnée</string>
<string name="select">Choisir</string>
<string name="remove">Supprimer</string>
<string name="select_controller_title">Choisir manette</string>
<string name="select_controller_message">Pressez une touche de la manette %1$s pour attribuer</string>
<string name="controller_already_in_use">Cette manette est déjà utilisé !</string>
<string name="modified_layout">Activer la fonction de disposition des touches</string>
<string name="controller_compat">Activer le mode de compatibilité</string>
<string name="dpad_joystick">Joystick utilisant la disposition du pad directionnel</string>
<string name="customize_physical_controls">Customiser les touches physiques</string>
<string name="map_keycode_title">Modifier la manette</string>
<string name="map_keycode_message">Pressez une nouvelle touche pour %1$s</string>
<string name="moga_pro_connect">MOGA Pro connecté</string>
<string name="moga_connect">MOGA connecté</string>
<string name="about_text">reicast est un émulateur dreamcast\n\nVersion: %1$s</string>
<string name="app_site">Site web officiel: http://reicast.com</string>
<string name="beta_site">Bétas: http://reicast.loungekatt.com</string>
<string name="git_api">https://api.github.com/repos/NoblesseOblige/reicast-emulator/commits</string>
<string-array name="controllers">
<item>Manette A</item>
<item>Manette B</item>
<item>Manette C</item>
<item>Manette D</item>
</string-array>
<string-array name="images">
<item>cdi</item>
<item>chd</item>
<item>gdi</item>
</string-array>
<string-array name="region">
<item>E - Etats-Unis</item>
<item>J - Japon</item>
<item>U - Europe</item>
<item>R - Sans région</item>
</string-array>
<string name="drawer_open">Menu curseur ouvert</string>
<string name="drawer_close">Menu curseur fermé</string>
<!-- Nav Drawer Menu Items -->
<string-array name="nav_drawer_items">
<item>Navigateur</item>
<item>Réglages</item>
<item>Chemins</item>
<item>Configurer manette</item>
<item>A propos</item>
<item>Evaluez-nous</item>
</string-array>
<!-- Nav Drawer List Item Icons -->
<!-- Matched to Nav Drawer Menu Items -->
<array name="nav_drawer_icons">
<item>@drawable/disk_unknown</item>
<item>@drawable/config</item>
<item>@drawable/open_folder</item>
<item>@drawable/input</item>
<item>@drawable/question</item>
<item>@drawable/star</item>
</array>
<!-- Content Description -->
<string name="desc_list_item_icon">Icône de l\'élément</string>
<string name="textOn">ALLUME</string>
<string name="textOff">ETEINT</string>
<string name="platform">Identifié %1$s</string>
<string name="menu_debug">Sauvegarde des logs d\'erreurs</string>
</resources>

View File

@ -51,7 +51,6 @@
<string name="moga_pro_connect">MOGAプロ接続!</string>
<string name="moga_connect">MOGA接続!</string>
<string name="about_title">reicastについて</string>
<string name="about_text">reicastはドリームキャストエミュレータです\n\nバージョン: %1$s</string>
<string-array name="controllers">

View File

@ -52,7 +52,6 @@
<string name="moga_pro_connect">MOGA Pro Connected!</string>
<string name="moga_connect">MOGA Connected!</string>
<string name="about_title">About reicast</string>
<string name="about_text">reicast is a dreamcast emulator\n\nVersion: %1$s</string>
<string-array name="controllers">

View File

@ -44,7 +44,7 @@
<string name="map_keycode_message">Pressione o novo botão para o controlador %1$s</string>
<string name="moga_pro_connect">MOGA Pro Conectado!</string>
<string name="moga_connect">MOGA Conectado!</string>
<string name="about_title">Sobre o reicast</string>
<string name="about_text">reicast é um emulador de Dreamcast\n\nVersão :%1$s</string>
<string-array name="controllers">

View File

@ -52,7 +52,6 @@
<string name="moga_pro_connect">MOGA Pro Connected!</string>
<string name="moga_connect">MOGA Connected!</string>
<string name="about_title">About reicast</string>
<string name="about_text">reicast is a dreamcast emulator\n\nVersion: %1$s</string>
<string-array name="controllers">

View File

@ -0,0 +1,111 @@
<resources>
<string name="app_name">reicast</string>
<string name="hello_world">Hello world!</string>
<string name="menu_settings">设置</string>
<string name="title_activity_main">reicast</string>
<string name="system_path">系统路径 (dc_boot.bin/dc_flash.bin 所在的路径)</string>
<string name="browser_path">默认系统路径</string>
<string name="games_path">储存路径 (.gdi, .chd 或 .cdi 镜像所在的路径)</string>
<string name="game_path">默认储存路径</string>
<string name="boot_bios">启动Dreamcast Bios</string>
<string name="missing_bios">找不到BIOS. 需要Dreamcast BIOS才能让模拟器运行.请把 BIOS文件放置在 %1$s/data/dc_boot.bin</string>
<string name="missing_flash">找不到Flash. 需要 Dreamcast Flash才能让模拟器运行. 请把 Flash文件放置在 %1$s/data/dc_flash.bin</string>
<string name="require_bios">你需要提供BIOS</string>
<string name="folder_bios">启动BIOS</string>
<string name="folder_select">选择当前路径</string>
<string name="select_dynarec">Dynarec设置</string>
<string name="select_unstable">不稳定优化</string>
<string name="select_region">DC区域</string>
<string name="select_limitfps">帧数限制</string>
<string name="select_mipmaps">使用Mipmaps (修复SGX540)</string>
<string name="select_stretch">宽屏模式</string>
<string name="set_frameskip">跳帧值</string>
<string name="select_render">PVR 渲染 (目前没有任何效果)</string>
<string name="default_disk">设置默认光盘</string>
<string name="games_listing">可用的Dreamcast游戏</string>
<string name="customize_touch_controls">自定义触屏控制</string>
<string name="launch_editor">启动编辑器</string>
<string name="touch_vibration">按键振动</string>
<string name="controller_a">控制器A</string>
<string name="controller_b">控制器B</string>
<string name="controller_c">控制器C</string>
<string name="controller_d">控制器D</string>
<string name="controller_not_connected">控制器未连接</string>
<string name="controller_none_selected">未选择任何控制器</string>
<string name="select">选择</string>
<string name="remove">移除</string>
<string name="select_controller_title">选择控制器</string>
<string name="select_controller_message">按控制器 %1$s 上的任意键来分配控制器</string>
<string name="controller_already_in_use">该控制器已被使用!</string>
<string name="modified_layout">启用自定义按键布局</string>
<string name="controller_compat">启用兼容模式</string>
<string name="customize_physical_controls">自定义物理控制</string>
<string name="map_keycode_title">修改控制器</string>
<string name="map_keycode_message">按下控制器按钮来映射 %1$s</string>
<string name="moga_pro_connect">MOGA Pro已连接!</string>
<string name="moga_connect">MOGA已连接</string>
<string name="about_title">关于 reicast</string>
<string name="about_text">reicast是一款dreamcast模拟器 \n\n版本: %1$s</string>
<string-array name="controllers">
<item>控制器A</item>
<item>控制器B</item>
<item>控制器C</item>
<item>控制器D</item>
</string-array>
<string-array name="images">
<item>cdi</item>
<item>chd</item>
<item>gdi</item>
</string-array>
<string-array name="region">
<item></item>
<item></item>
<item></item>
<item>(Default)</item>
</string-array>
<string name="drawer_open">Slider Menu Opened</string>
<string name="drawer_close">Slider Menu Closed</string>
<!-- Nav Drawer Menu Items -->
<string-array name="nav_drawer_items">
<item>浏览器</item>
<item>设置</item>
<item>路径</item>
<item>输入</item>
<item>关于</item>
<item>评分</item>
</string-array>
<!-- Nav Drawer List Item Icons -->
<!-- Matched to Nav Drawer Menu Items -->
<array name="nav_drawer_icons">
<item>@drawable/disk_unknown</item>
<item>@drawable/config</item>
<item>@drawable/open_folder</item>
<item>@drawable/input</item>
<item>@drawable/question</item>
<item>@drawable/star</item>
</array>
<!-- Content Description -->
<string name="desc_list_item_icon">Item Icon</string>
<string name="textOn"></string>
<string name="textOff"></string>
<string name="menu_debug">保存出错日志</string>
</resources>

View File

@ -16,6 +16,7 @@
<string name="folder_bios">BOOT BIOS</string>
<string name="folder_select">SELECT CURRENT FOLDER</string>
<string name="experimental_opts">Experimental (May cause widespread panic)</string>
<string name="select_dynarec">Dynarec Options</string>
<string name="select_unstable">Unstable Optimisations</string>
<string name="select_region">DC Region</string>
@ -44,6 +45,7 @@
<string name="controller_already_in_use">This controller is already in use!</string>
<string name="modified_layout">Enable Custom Key Layout</string>
<string name="controller_compat">Enable Compatibility Mode</string>
<string name="dpad_joystick">Joystick Uses DPAD Layout</string>
<string name="customize_physical_controls">Customize Physical Controls</string>
<string name="map_keycode_title">Modify Controller</string>
@ -52,8 +54,10 @@
<string name="moga_pro_connect">MOGA Pro Connected!</string>
<string name="moga_connect">MOGA Connected!</string>
<string name="about_title">About reicast</string>
<string name="about_text">reicast is a dreamcast emulator\n\nVersion: %1$s</string>
<string name="app_site">Homepage: http://reicast.com</string>
<string name="beta_site">Betas: http://reicast.loungekatt.com</string>
<string name="git_api">https://api.github.com/repos/NoblesseOblige/reicast-emulator/commits</string>
<string-array name="controllers">
<item>Controller A</item>
@ -69,10 +73,10 @@
</string-array>
<string-array name="region">
<item></item>
<item></item>
<item></item>
<item>(Default)</item>
<item>E - United States</item>
<item>J - Japanese</item>
<item>U - European</item>
<item>R - Region Free</item>
</string-array>
<string name="drawer_open">Slider Menu Opened</string>
@ -104,6 +108,8 @@
<string name="textOn">ON</string>
<string name="textOff">OFF</string>
<string name="platform">Identified %1$s</string>
<string name="menu_debug">Save Error Logs</string>

View File

@ -0,0 +1,318 @@
/* ====================================================================
* Copyright (c) 2012-2013 Lounge Katt Entertainment. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by Lounge Katt" unless
* otherwise displayed by public repository entries.
*
* 4. The names "Lounge Katt", "TwistedUmbrella", and "LiveLog"
* must not be used to endorse or promote products derived from this
* software without prior written permission. For written permission,
* please contact admin@loungekatt.com.
*
* 5. Products derived from this software may not be called "LiveLog"
* nor may "LiveLog" appear in their names without prior written
* permission of Lounge Katt Entertainment.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by Lounge Katt" unless
* otherwise displayed by tagged repository entries.
*
* THIS SOFTWARE IS PROVIDED BY Lounge Katt ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* The license and distribution terms for any publicly available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution license
* [including the GNU Public License.] Content not subject to these terms is
* subject to to the terms and conditions of the Apache License, Version 2.0.
*/
package com.reicast.emulator;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.StatusLine;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import android.app.Activity;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.app.Fragment;
import android.text.util.Linkify;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import android.widget.SlidingDrawer;
import android.widget.SlidingDrawer.OnDrawerOpenListener;
import android.widget.TextView;
import android.widget.Toast;
public class AboutFragment extends Fragment {
SlidingDrawer slidingGithub;
private ListView list;
private GitAdapter adapter;
private Handler handler;
private Activity parentActivity;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.about_fragment, container, false);
}
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
parentActivity = getActivity();
handler = new Handler();
try {
String versionName = parentActivity.getPackageManager()
.getPackageInfo(parentActivity.getPackageName(), 0).versionName;
int versionCode = parentActivity.getPackageManager()
.getPackageInfo(parentActivity.getPackageName(), 0).versionCode;
TextView version = (TextView) getView().findViewById(
R.id.about_text);
version.setText(parentActivity.getString(R.string.about_text,
versionName + "(" + String.valueOf(versionCode) + ")"));
} catch (NameNotFoundException e) {
e.printStackTrace();
}
TextView website = (TextView) getView().findViewById(
R.id.site_text);
Linkify.addLinks(website, Linkify.ALL);
TextView compiled = (TextView) getView().findViewById(
R.id.beta_text);
Linkify.addLinks(compiled, Linkify.ALL);
slidingGithub = (SlidingDrawer) getView().findViewById(
R.id.slidingGithub);
slidingGithub.setOnDrawerOpenListener(new OnDrawerOpenListener() {
public void onDrawerOpened() {
String git = parentActivity.getString(R.string.git_api);
retrieveGitTask queryGithub = new retrieveGitTask();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
queryGithub.executeOnExecutor(
AsyncTask.THREAD_POOL_EXECUTOR, git);
} else {
queryGithub.execute(git);
}
}
});
slidingGithub.open();
}
public class retrieveGitTask extends
AsyncTask<String, Integer, ArrayList<HashMap<String, String>>> {
private String buildId = "";
@Override
protected void onPreExecute() {
try {
InputStream file = parentActivity.getAssets().open("build");
if (file != null) {
BufferedReader reader = new BufferedReader(
new InputStreamReader(file));
buildId = reader.readLine();
file.close();
}
} catch (IOException ioe) {
ioe.printStackTrace();
}
}
@Override
protected ArrayList<HashMap<String, String>> doInBackground(
String... paths) {
ArrayList<HashMap<String, String>> commitList = new ArrayList<HashMap<String, String>>();
try {
JSONArray gitObject = getContent(paths[0]);
for (int i = 0; i < gitObject.length(); i++) {
JSONObject jsonObject = gitObject.getJSONObject(i);
JSONObject commitArray = jsonObject.getJSONObject("commit");
String date = commitArray.getJSONObject("committer")
.getString("date").replace("T", " ")
.replace("Z", "");
String author = commitArray.getJSONObject("author")
.getString("name");
String committer = commitArray.getJSONObject("committer")
.getString("name");
String avatar = null;
if (!jsonObject.getString("committer").equals("null")) {
avatar = jsonObject.getJSONObject("committer")
.getString("avatar_url");
committer = committer
+ " ("
+ jsonObject.getJSONObject("committer")
.getString("login") + ")";
if (avatar.equals("null")) {
avatar = "https://github.com/apple-touch-icon-144.png";
}
} else {
avatar = "https://github.com/apple-touch-icon-144.png";
}
if (!jsonObject.getString("author").equals("null")) {
author = author
+ " ("
+ jsonObject.getJSONObject("author").getString(
"login") + ")";
}
String sha = jsonObject.getString("sha");
String curl = jsonObject
.getString("url")
.replace("https://api.github.com/repos",
"https://github.com")
.replace("commits", "commit");
String title = "No commit heading attached";
String message = "No commit message attached";
if (commitArray.getString("message").contains("\n\n")) {
String fullOutput = commitArray.getString("message");
title = fullOutput.substring(0,
fullOutput.indexOf("\n\n"));
message = fullOutput.substring(
fullOutput.indexOf("\n\n") + 1,
fullOutput.length());
} else {
title = commitArray.getString("message");
}
HashMap<String, String> map = new HashMap<String, String>();
map.put("Date", date);
map.put("Committer", committer);
map.put("Title", title);
map.put("Message", message);
map.put("Sha", sha);
map.put("Url", curl);
map.put("Author", author);
map.put("Avatar", avatar);
map.put("Build", buildId);
commitList.add(map);
}
} catch (JSONException e) {
handler.post(new Runnable() {
public void run() {
Toast.makeText(parentActivity,
"GitHub Native Unavailable!", Toast.LENGTH_LONG)
.show();
slidingGithub.close();
}
});
e.printStackTrace();
} catch (Exception e) {
handler.post(new Runnable() {
public void run() {
Toast.makeText(parentActivity,
"GitHub Native Unavailable!", Toast.LENGTH_LONG)
.show();
slidingGithub.close();
}
});
e.printStackTrace();
}
return commitList;
}
@Override
protected void onPostExecute(
ArrayList<HashMap<String, String>> commitList) {
if (commitList != null && commitList.size() > 0) {
list = (ListView) getView().findViewById(R.id.list);
list.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
adapter = new GitAdapter(parentActivity, commitList);
// Set adapter as specified collection
list.setAdapter(adapter);
list.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
}
});
}
}
}
private JSONArray getContent(String urlString) throws IOException,
JSONException {
StringBuilder builder = new StringBuilder();
HttpClient client = new DefaultHttpClient();
HttpGet httpGet = new HttpGet(urlString);
try {
HttpResponse response = client.execute(httpGet);
StatusLine statusLine = response.getStatusLine();
int statusCode = statusLine.getStatusCode();
if (statusCode == 200) {
HttpEntity entity = response.getEntity();
InputStream content = entity.getContent();
BufferedReader reader = new BufferedReader(
new InputStreamReader(content));
String line;
while ((line = reader.readLine()) != null) {
builder.append(line);
}
} else {
}
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return new JSONArray(builder.toString());
}
}

View File

@ -12,9 +12,6 @@ import java.util.Scanner;
import org.apache.commons.lang3.StringUtils;
import de.ankri.views.Switch;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.SharedPreferences;
import android.os.Build;
@ -28,21 +25,26 @@ import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.Toast;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.EditText;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import de.ankri.views.Switch;
public class ConfigureFragment extends Fragment {
Activity parentActivity;
TextView mainFrames;
OnClickListener mCallback;
boolean dynarecopt = true;
boolean unstableopt = false;
int dcregion = 3;
@ -53,6 +55,9 @@ public class ConfigureFragment extends Fragment {
boolean pvrrender = false;
String cheatdisk = "null";
boolean tegra = false;
boolean qualcomm = false;
private SharedPreferences mPrefs;
private File sdcard = Environment.getExternalStorageDirectory();
private String home_directory = sdcard + "/dc";
@ -99,6 +104,19 @@ public class ConfigureFragment extends Fragment {
mPrefs = PreferenceManager.getDefaultSharedPreferences(parentActivity);
home_directory = mPrefs.getString("home_directory", home_directory);
String platform = readOutput("/system/bin/getprop ro.board.platform");
if (platform != null && !platform.equals(null)) {
Toast.makeText(parentActivity,
parentActivity.getString(R.string.platform, platform),
Toast.LENGTH_SHORT).show();
if (platform.contains("msm")) {
qualcomm = true;
}
if (platform.contains("tegra")) {
tegra = true;
}
}
try {
File config = new File(home_directory, "emu.cfg");
if (config.exists()) {
@ -106,26 +124,32 @@ public class ConfigureFragment extends Fragment {
String currentLine;
while (scanner.hasNextLine()) {
currentLine = scanner.nextLine();
// Check if the existing emu.cfg has the setting and get current value
/*if (StringUtils.containsIgnoreCase(currentLine, "Dynarec.Enabled")) {
// Check if the existing emu.cfg has the setting and get
// current value
if (StringUtils.containsIgnoreCase(currentLine,
"Dynarec.Enabled")) {
dynarecopt = Boolean.valueOf(currentLine.replace(
"Dynarec.Enabled=", ""));
}*/
if (StringUtils.containsIgnoreCase(currentLine, "Dynarec.unstable-opt")) {
}
if (StringUtils.containsIgnoreCase(currentLine,
"Dynarec.unstable-opt")) {
unstableopt = Boolean.valueOf(currentLine.replace(
"Dynarec.unstable-opt=", ""));
}
/*if (StringUtils.containsIgnoreCase(currentLine, "Dreamcast.Region")) {
if (StringUtils.containsIgnoreCase(currentLine,
"Dreamcast.Region")) {
dcregion = Integer.valueOf(currentLine.replace(
"Dreamcast.Region=", ""));
}*/
if (StringUtils.containsIgnoreCase(currentLine, "aica.LimitFPS")) {
}
if (StringUtils.containsIgnoreCase(currentLine,
"aica.LimitFPS")) {
limitfps = Boolean.valueOf(currentLine.replace(
"aica.LimitFPS=", ""));
}
if (StringUtils.containsIgnoreCase(currentLine, "rend.UseMipmaps")) {
if (StringUtils.containsIgnoreCase(currentLine,
"rend.UseMipmaps")) {
mipmaps = Boolean.valueOf(currentLine.replace(
"rend.UseMipmaps=", ""));
}
@ -138,23 +162,24 @@ public class ConfigureFragment extends Fragment {
frameskip = Integer.valueOf(currentLine.replace(
"ta.skip=", ""));
}
/*if (StringUtils.containsIgnoreCase(currentLine, "pvr.rend")) {
if (StringUtils.containsIgnoreCase(currentLine, "pvr.rend")) {
pvrrender = Boolean.valueOf(currentLine.replace(
"pvr.rend=", ""));
}*/
}
if (StringUtils.containsIgnoreCase(currentLine, "image")) {
cheatdisk = currentLine.replace("image=", "");
}
}
scanner.close();
}
} catch (Exception e) {
Log.d("reicast", "Exception: " + e);
}
// Generate the menu options and fill in existing settings
/*OnCheckedChangeListener dynarec_options = new OnCheckedChangeListener() {
OnCheckedChangeListener dynarec_options = new OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView,
boolean isChecked) {
@ -166,16 +191,16 @@ public class ConfigureFragment extends Fragment {
}
}
};
Switch dynarec_opt = (Switch) getView().findViewById(
R.id.dynarec_option);
boolean dynarec = mPrefs.getBoolean("dynarec_opt", dynarecopt);
if (dynarec) {
dynarec_opt.setChecked(true);
} else {
dynarec_opt.setChecked(false);
}
dynarec_opt.setOnCheckedChangeListener(dynarec_options);*/
Switch dynarec_opt = (Switch) getView().findViewById(
R.id.dynarec_option);
boolean dynarec = mPrefs.getBoolean("dynarec_opt", dynarecopt);
if (dynarec) {
dynarec_opt.setChecked(true);
} else {
dynarec_opt.setChecked(false);
}
dynarec_opt.setOnCheckedChangeListener(dynarec_options);
OnCheckedChangeListener unstable_option = new OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView,
@ -197,8 +222,9 @@ public class ConfigureFragment extends Fragment {
unstable_opt.setChecked(false);
}
unstable_opt.setOnCheckedChangeListener(unstable_option);
/*String[] regions = parentActivity.getResources().getStringArray(R.array.region);
String[] regions = parentActivity.getResources().getStringArray(
R.array.region);
Spinner region_spnr = (Spinner) getView().findViewById(
R.id.region_spinner);
@ -207,7 +233,7 @@ public class ConfigureFragment extends Fragment {
localeAdapter
.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
region_spnr.setAdapter(localeAdapter);
int dc_region = mPrefs.getInt("dc_region", dcregion);
region_spnr.setSelection(dc_region, true);
@ -225,11 +251,11 @@ public class ConfigureFragment extends Fragment {
}
public void onNothingSelected(AdapterView<?> arg0) {
mPrefs.edit().putInt("dc_region", 3).commit();
mPrefs.edit().putInt("dc_region", dcregion).commit();
}
});*/
});
OnCheckedChangeListener limitfps_option = new OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView,
@ -251,7 +277,7 @@ public class ConfigureFragment extends Fragment {
limit_fps.setChecked(false);
}
limit_fps.setOnCheckedChangeListener(limitfps_option);
OnCheckedChangeListener mipmaps_option = new OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView,
@ -295,7 +321,7 @@ public class ConfigureFragment extends Fragment {
stretch_view.setChecked(false);
}
stretch_view.setOnCheckedChangeListener(full_screen);
mainFrames = (TextView) getView().findViewById(R.id.current_frames);
mainFrames.setText(String.valueOf(frameskip));
@ -328,7 +354,7 @@ public class ConfigureFragment extends Fragment {
}
});
/*OnCheckedChangeListener pvr_rendering = new OnCheckedChangeListener() {
OnCheckedChangeListener pvr_rendering = new OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView,
boolean isChecked) {
@ -347,7 +373,7 @@ public class ConfigureFragment extends Fragment {
} else {
pvr_render.setChecked(false);
}
pvr_render.setOnCheckedChangeListener(pvr_rendering);*/
pvr_render.setOnCheckedChangeListener(pvr_rendering);
final EditText cheatEdit = (EditText) getView().findViewById(
R.id.cheat_disk);
@ -372,7 +398,7 @@ public class ConfigureFragment extends Fragment {
int count) {
}
});
Button debug_button = (Button) getView()
.findViewById(R.id.debug_button);
debug_button.setOnClickListener(new View.OnClickListener() {
@ -495,9 +521,9 @@ public class ConfigureFragment extends Fragment {
File config = new File(home_directory, "emu.cfg");
if (config.exists()) {
try {
// Read existing emu.cfg and substitute new setting value
StringBuilder rebuildFile = new StringBuilder();
Scanner scanner = new Scanner(config);
String currentLine;
@ -533,23 +559,27 @@ public class ConfigureFragment extends Fragment {
if (config.exists()) {
config.delete();
}
// Write new emu.cfg using current display values
StringBuilder rebuildFile = new StringBuilder();
rebuildFile.append("[config]" + "\n");
rebuildFile.append("Dynarec.Enabled=" + String.valueOf(dynarecopt ? 1 : 0) + "\n");
rebuildFile.append("Dynarec.Enabled="
+ String.valueOf(dynarecopt ? 1 : 0) + "\n");
rebuildFile.append("Dynarec.idleskip=1" + "\n");
rebuildFile.append("Dynarec.unstable-opt=" + String.valueOf(unstableopt ? 1 : 0) + "\n");
rebuildFile.append("Dynarec.unstable-opt="
+ String.valueOf(unstableopt ? 1 : 0) + "\n");
rebuildFile.append("Dreamcast.Cable=3" + "\n");
rebuildFile.append("Dreamcast.RTC="
+ String.valueOf(System.currentTimeMillis()) + "\n");
rebuildFile.append("Dreamcast.Region=" + String.valueOf(dcregion)
+ "\n");
rebuildFile.append("Dreamcast.Broadcast=4" + "\n");
rebuildFile.append("aica.LimitFPS=" + String.valueOf(limitfps ? 1 : 0) + "\n");
rebuildFile.append("aica.LimitFPS="
+ String.valueOf(limitfps ? 1 : 0) + "\n");
rebuildFile.append("aica.NoBatch=0" + "\n");
rebuildFile.append("rend.UseMipmaps=" + String.valueOf(mipmaps ? 1 : 0) + "\n");
rebuildFile.append("rend.UseMipmaps="
+ String.valueOf(mipmaps ? 1 : 0) + "\n");
rebuildFile.append("rend.WideScreen="
+ String.valueOf(widescreen ? 1 : 0) + "\n");
rebuildFile.append("pvr.Subdivide=0" + "\n");

View File

@ -1,16 +1,11 @@
package com.reicast.emulator;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.view.Gravity;
import android.view.InputDevice;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;

View File

@ -15,13 +15,8 @@ import java.util.Locale;
import org.apache.commons.lang3.StringUtils;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.net.Uri;
@ -120,7 +115,7 @@ public class FileBrowser extends Fragment {
if (!file.exists()) {
file.createNewFile();
OutputStream fo = new FileOutputStream(file);
InputStream png = parentActivity.getBaseContext().getAssets()
InputStream png = parentActivity.getAssets()
.open("buttons.png");
byte[] buffer = new byte[4096];

View File

@ -3,9 +3,6 @@ package com.reicast.emulator;
import java.util.Arrays;
import java.util.HashMap;
// Keeping a reference just in case it's needed
import com.reicast.emulator.GL2JNIView.EmuThread;
import tv.ouya.console.api.OuyaController;
import android.annotation.TargetApi;
import android.app.Activity;
@ -16,7 +13,6 @@ import android.content.res.Configuration;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.SystemClock;
import android.preference.PreferenceManager;
import android.util.Log;
import android.view.Gravity;
@ -40,8 +36,10 @@ public class GL2JNIActivity extends Activity {
LayoutParams params;
MOGAInput moga = new MOGAInput();
private SharedPreferences prefs;
static boolean[] custom = { false, false, false, false }, xbox = { false,
false, false, false }, nVidia = { false, false, false, false };
static String[] portId = { "_A", "_B", "_C", "_D" };
static boolean[] compat = { false, false, false, false }, custom = { false,
false, false, false }, jsCompat = { false, false, false, false };
static boolean[] xbox = { false, false, false, false }, nVidia = { false, false, false, false };
int[] name = { -1, -1, -1, -1 };
float[] globalLS_X = new float[4], globalLS_Y = new float[4],
previousLS_X = new float[4], previousLS_Y = new float[4];
@ -217,18 +215,18 @@ public class GL2JNIActivity extends Activity {
.get(deviceId_deviceDescriptor.get(joys[i]));
if (playerNum != null) {
String[] players = getResources().getStringArray(R.array.controllers);
String id = "_" + players[playerNum].substring(
players[playerNum].lastIndexOf(" ") + 1, players[playerNum].length());
boolean compat = prefs.getBoolean("controller_compat" + id, false);
if (!compat) {
if (prefs.getBoolean("modified_key_layout" + id, false)) {
String id = portId[playerNum];
custom[playerNum] = prefs.getBoolean("modified_key_layout" + id, false);
compat[playerNum] = prefs.getBoolean("controller_compat" + id, false);
jsCompat[playerNum] = prefs.getBoolean("dpad_js_layout" + id, false);
if (!compat[playerNum]) {
if (custom[playerNum]) {
map[playerNum] = setModifiedKeys(playerNum);
custom[playerNum] = true;
globalLS_X[playerNum] = previousLS_X[playerNum] = 0.0f;
globalLS_Y[playerNum] = previousLS_Y[playerNum] = 0.0f;
if (jsCompat[playerNum]) {
globalLS_X[playerNum] = previousLS_X[playerNum] = 0.0f;
globalLS_Y[playerNum] = previousLS_Y[playerNum] = 0.0f;
}
} else if (InputDevice.getDevice(joys[i]).getName()
.equals("Sony PLAYSTATION(R)3 Controller")) {
map[playerNum] = new int[] {
@ -324,7 +322,6 @@ public class GL2JNIActivity extends Activity {
// Create the actual GLES view
mView = new GL2JNIView(getApplication(), fileName, false, 24, 0, false);
setContentView(mView);
moga.setGL2View(mView);
Toast.makeText(getApplicationContext(),
"Press the back button for a menu", Toast.LENGTH_SHORT).show();
@ -332,11 +329,8 @@ public class GL2JNIActivity extends Activity {
private void runCompatibilityMode() {
for (int n = 0; n < 4; n++) {
String[] players = getResources().getStringArray(R.array.controllers);
String id = "_" + players[n].substring(
players[n].lastIndexOf(" ") + 1, players[n].length());
if (prefs.getBoolean("controller_compat" + id, false)) {
getCompatibilityMap(n, id);
if (compat[n]) {
getCompatibilityMap(n, portId[n]);
}
}
}
@ -345,17 +339,15 @@ public class GL2JNIActivity extends Activity {
name[playerNum] = prefs.getInt("controller" + id, -1);
if (name[playerNum] != -1) {
map[playerNum] = setModifiedKeys(playerNum);
custom[playerNum] = true;
}
globalLS_X[playerNum] = previousLS_X[playerNum] = 0.0f;
globalLS_Y[playerNum] = previousLS_Y[playerNum] = 0.0f;
if (jsCompat[playerNum]) {
globalLS_X[playerNum] = previousLS_X[playerNum] = 0.0f;
globalLS_Y[playerNum] = previousLS_Y[playerNum] = 0.0f;
}
}
private int[] setModifiedKeys(int player) {
String[] players = getResources().getStringArray(R.array.controllers);
String id = "_" + players[player].substring(
players[player].lastIndexOf(" ") + 1, players[player].length());
String id = portId[player];
return new int[] {
prefs.getInt("a_button" + id, OuyaController.BUTTON_O), key_CONT_A,
prefs.getInt("b_button" + id, OuyaController.BUTTON_A), key_CONT_B,
@ -378,13 +370,18 @@ public class GL2JNIActivity extends Activity {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
Integer playerNum = deviceDescriptor_PlayerNum
Integer playerNum = Arrays.asList(name).indexOf(event.getDeviceId());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD && playerNum == -1) {
playerNum = deviceDescriptor_PlayerNum
.get(deviceId_deviceDescriptor.get(event.getDeviceId()));
} else {
playerNum = -1;
}
if (playerNum == null)
if (playerNum == null || playerNum == -1)
return false;
if (!moga.isActive[playerNum] && !custom[playerNum]) {
if (!moga.isActive[playerNum] || compat[playerNum]) {
// TODO: Moga should handle this locally
// Joystick
@ -398,7 +395,7 @@ public class GL2JNIActivity extends Activity {
float L2 = event.getAxisValue(OuyaController.AXIS_L2);
float R2 = event.getAxisValue(OuyaController.AXIS_R2);
if (custom[playerNum] || xbox[playerNum] || nVidia[playerNum]) {
if (jsCompat[playerNum] || xbox[playerNum] || nVidia[playerNum]) {
previousLS_X[playerNum] = globalLS_X[playerNum];
previousLS_Y[playerNum] = globalLS_Y[playerNum];
globalLS_X[playerNum] = LS_X;
@ -414,7 +411,7 @@ public class GL2JNIActivity extends Activity {
}
if ((custom[playerNum] || xbox[playerNum] || nVidia[playerNum])
if ((jsCompat[playerNum] || xbox[playerNum] || nVidia[playerNum])
&& ((globalLS_X[playerNum] == previousLS_X[playerNum] && globalLS_Y[playerNum] == previousLS_Y[playerNum]) || (previousLS_X[playerNum] == 0.0f && previousLS_Y[playerNum] == 0.0f)))
// Only handle Left Stick on an Xbox 360 controller if there was
// some actual motion on the stick,
@ -522,11 +519,8 @@ public class GL2JNIActivity extends Activity {
}
if (playerNum != null && playerNum != -1) {
String[] players = getResources().getStringArray(R.array.controllers);
String id = "_" + players[playerNum].substring(
players[playerNum].lastIndexOf(" ") + 1, players[playerNum].length());
boolean compat = prefs.getBoolean("controller_compat" + id, false);
if (compat || custom[playerNum]) {
String id = portId[playerNum];
if (custom[playerNum]) {
if (keyCode == prefs.getInt("l_button" + id, OuyaController.BUTTON_L1)) {
GL2JNIView.lt[playerNum] = (int) (0.5 * 255);
GL2JNIView.lt[playerNum] = (int) (1.0 * 255);

View File

@ -8,13 +8,14 @@ import javax.microedition.khronos.egl.EGLDisplay;
import javax.microedition.khronos.opengles.GL10;
import android.content.Context;
import android.content.res.Configuration;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.graphics.PixelFormat;
import android.media.AudioFormat;
import android.media.AudioManager;
import android.media.AudioTrack;
import android.opengl.GLSurfaceView;
import android.os.Build;
import android.os.Vibrator;
import android.preference.PreferenceManager;
import android.util.Log;
@ -209,17 +210,18 @@ class GL2JNIView extends GLSurfaceView
this.editVjoyMode = editVjoyMode;
setKeepScreenOn(true);
setOnSystemUiVisibilityChangeListener (new OnSystemUiVisibilityChangeListener() {
@Override
public void onSystemUiVisibilityChange(int visibility) {
if ((visibility & SYSTEM_UI_FLAG_FULLSCREEN) == 0) {
GL2JNIView.this.setSystemUiVisibility(
SYSTEM_UI_FLAG_IMMERSIVE_STICKY
| SYSTEM_UI_FLAG_FULLSCREEN
| SYSTEM_UI_FLAG_HIDE_NAVIGATION);
}
}
});
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
setOnSystemUiVisibilityChangeListener (new OnSystemUiVisibilityChangeListener() {
public void onSystemUiVisibilityChange(int visibility) {
if ((visibility & SYSTEM_UI_FLAG_FULLSCREEN) == 0) {
GL2JNIView.this.setSystemUiVisibility(
SYSTEM_UI_FLAG_IMMERSIVE_STICKY
| SYSTEM_UI_FLAG_FULLSCREEN
| SYSTEM_UI_FLAG_HIDE_NAVIGATION);
}
}
});
}
vib=(Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);

View File

@ -0,0 +1,227 @@
/* ====================================================================
* Copyright (c) 2012-2013 Lounge Katt Entertainment. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by Lounge Katt" unless
* otherwise displayed by public repository entries.
*
* 4. The names "Lounge Katt", "TwistedUmbrella", and "LiveLog"
* must not be used to endorse or promote products derived from this
* software without prior written permission. For written permission,
* please contact admin@loungekatt.com.
*
* 5. Products derived from this software may not be called "LiveLog"
* nor may "LiveLog" appear in their names without prior written
* permission of Lounge Katt Entertainment.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by Lounge Katt" unless
* otherwise displayed by tagged repository entries.
*
* THIS SOFTWARE IS PROVIDED BY Lounge Katt ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* The license and distribution terms for any publicly available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution license
* [including the GNU Public License.] Content not subject to these terms is
* subject to to the terms and conditions of the Apache License, Version 2.0.
*/
package com.reicast.emulator;
import java.util.ArrayList;
import java.util.HashMap;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.PorterDuff;
import android.os.Build;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.webkit.CookieManager;
import android.webkit.CookieSyncManager;
import android.webkit.WebSettings;
import android.webkit.WebSettings.PluginState;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.webkit.WebViewDatabase;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
import com.nostra13.universalimageloader.core.assist.ImageScaleType;
public class GitAdapter extends BaseAdapter {
private Activity activity;
private ArrayList<HashMap<String, String>> data;
private LayoutInflater inflater = null;
private DisplayImageOptions options;
public GitAdapter(Activity a, ArrayList<HashMap<String, String>> d) {
this.activity = a;
this.data = d;
this.inflater = (LayoutInflater) activity
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
ImageLoaderConfiguration configicon = new ImageLoaderConfiguration.Builder(activity)
.memoryCacheExtraOptions(96, 96)
.build();
this.options = new DisplayImageOptions.Builder()
.showStubImage(R.drawable.ic_github)
.showImageForEmptyUri(R.drawable.ic_github)
.imageScaleType(ImageScaleType.EXACTLY_STRETCHED)
.build();
ImageLoader.getInstance().init(configicon);
}
public int getCount() {
return this.data.size();
}
public Object getItem(int position) {
return position;
}
public long getItemId(int position) {
return position;
}
public View getView(final int position, View convertView, ViewGroup parent) {
View vi = convertView;
if (convertView == null)
vi = this.inflater.inflate(R.layout.change_item, null);
TextView dateText = (TextView) vi.findViewById(R.id.date);
TextView committerText = (TextView) vi.findViewById(R.id.committer);
TextView titleText = (TextView) vi.findViewById(R.id.title);
ImageView avatarIcon = (ImageView) vi.findViewById(R.id.avatar);
final HashMap<String, String> commit = this.data.get(position);
final String date = commit.get("Date");
final String committer = commit.get("Committer");
final String title = commit.get("Title");
final String message = commit.get("Message");
final String sha = commit.get("Sha");
final String url = commit.get("Url");
final String author = commit.get("Author");
final String avatar = commit.get("Avatar");
final String current = commit.get("Build");
RelativeLayout item = (RelativeLayout) vi.findViewById(R.id.change);
if (current != null && !current.equals("") && current.equals(sha)) {
item.getBackground().setColorFilter(0xFF00FF00,
PorterDuff.Mode.MULTIPLY);
} else {
item.getBackground().setColorFilter(null);
}
dateText.setText(date);
committerText.setText(committer);
titleText.setText(title);
ImageLoader.getInstance().displayImage(avatar, avatarIcon, this.options);
vi.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
System.gc();
String output = message + "\n\n" + " - " + author;
displayCommit(sha, output, url, v.getContext());
}
});
// Handle clicking individual item from list
return vi;
}
public static void displayCommit(String title, String message, String url,
Context context) {
final AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setCancelable(true);
builder.setTitle(title);
builder.setMessage(message);
LayoutInflater infalter = LayoutInflater.from(context);
final View popWebView = infalter.inflate(R.layout.webview, null);
WebView mWebView = (WebView) popWebView.findViewById(R.id.webframe);
mWebView = configureWebview(url, context, mWebView);
builder.setView(popWebView);
builder.setPositiveButton("Close",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
return;
}
});
builder.create().show();
}
public static WebView configureWebview(String url, Context context,
WebView mWebView) {
mWebView.getSettings().setSupportZoom(true);
mWebView.getSettings().setBuiltInZoomControls(true);
if (Integer.parseInt(Build.VERSION.SDK) >= Build.VERSION_CODES.HONEYCOMB) {
mWebView.getSettings().setDisplayZoomControls(false);
}
mWebView.setInitialScale(1);
if (Integer.parseInt(Build.VERSION.SDK) >= Build.VERSION_CODES.ECLAIR) {
mWebView.getSettings().setUseWideViewPort(true);
}
if (Integer.parseInt(Build.VERSION.SDK) >= Build.VERSION_CODES.ECLAIR_MR1) {
mWebView.getSettings().setLoadWithOverviewMode(true);
}
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setPluginState(PluginState.ON);
mWebView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
mWebView.clearHistory();
mWebView.clearFormData();
mWebView.clearCache(true);
WebViewDatabase mDatabase = WebViewDatabase.getInstance(context);
mDatabase.clearUsernamePassword();
CookieSyncManager.createInstance(context);
CookieManager cookieManager = CookieManager.getInstance();
cookieManager.removeAllCookie();
CookieSyncManager.getInstance().stopSync();
mWebView.getSettings().setSavePassword(false);
mWebView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
});
mWebView.loadUrl(url);
return mWebView;
}
}

View File

@ -1,20 +1,11 @@
package com.reicast.emulator;
import com.bda.controller.Controller;
import com.bda.controller.ControllerListener;
import com.bda.controller.MotionEvent;
import com.bda.controller.StateEvent;
import com.reicast.emulator.MOGAInput.ExampleControllerListener;
import de.ankri.views.Switch;
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
@ -28,11 +19,18 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.ImageView;
import android.widget.TableLayout;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.CompoundButton.OnCheckedChangeListener;
import com.bda.controller.Controller;
import com.bda.controller.ControllerListener;
import com.bda.controller.MotionEvent;
import com.bda.controller.StateEvent;
import de.ankri.views.Switch;
public class InputFragment extends Fragment {
@ -305,13 +303,27 @@ public class InputFragment extends Fragment {
builder.setTitle(getString(R.string.select_controller_title));
builder.setMessage(getString(R.string.select_controller_message,
String.valueOf(listenForButton)));
builder.setNegativeButton("Cancel",
builder.setPositiveButton("Cancel",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
listenForButton = 0;
dialog.dismiss();
}
});
builder.setNegativeButton("Custom",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
InputModFragment inputModFrag = new InputModFragment();
Bundle args = new Bundle();
args.putInt("portNumber", listenForButton - 1);
inputModFrag.setArguments(args);
getActivity().getSupportFragmentManager()
.beginTransaction()
.replace(R.id.fragment_container, inputModFrag,
"INPUT_MOD_FRAG").addToBackStack(null).commit();
dialog.dismiss();
}
});
builder.setOnKeyListener(new Dialog.OnKeyListener() {
public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
return mapDevice(keyCode, event);

View File

@ -3,7 +3,6 @@ package com.reicast.emulator;
import java.io.IOException;
import java.io.InputStream;
import de.ankri.views.Switch;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
@ -14,7 +13,6 @@ import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v4.app.Fragment;
@ -23,14 +21,15 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.ImageView;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.CompoundButton.OnCheckedChangeListener;
import de.ankri.views.Switch;
public class InputModFragment extends Fragment {
@ -40,6 +39,7 @@ public class InputModFragment extends Fragment {
private Switch switchCompatibilityEnabled;
private String player = "_A";
private int sS = 2;
private int playerNum = -1;
// Container Activity must implement this interface
public interface OnClickListener {
@ -62,8 +62,13 @@ public class InputModFragment extends Fragment {
mPrefs = PreferenceManager.getDefaultSharedPreferences(parentActivity);
String[] controllers = parentActivity.getResources().getStringArray(
final String[] controllers = parentActivity.getResources().getStringArray(
R.array.controllers);
Bundle b = getArguments();
if (b != null) {
playerNum = b.getInt("portNumber", -1);
}
Spinner player_spnr = (Spinner) getView().findViewById(
R.id.player_spinner);
@ -73,7 +78,9 @@ public class InputModFragment extends Fragment {
playerAdapter
.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
player_spnr.setAdapter(playerAdapter);
if (playerNum != -1) {
player_spnr.setSelection(playerNum, true);
}
player_spnr.setOnItemSelectedListener(new OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> parent, View view,
@ -85,7 +92,9 @@ public class InputModFragment extends Fragment {
}
public void onNothingSelected(AdapterView<?> arg0) {
player = "_A";
if (playerNum != -1) {
player = controllers[playerNum];
}
}
});
@ -133,6 +142,7 @@ public class InputModFragment extends Fragment {
a_button_icon.setImageDrawable(getButtonImage(448 / sS, 0));
final TextView a_button_text = (TextView) getView().findViewById(
R.id.a_button_key);
getKeyCode("a_button", a_button_text);
Button a_button = (Button) getView().findViewById(R.id.a_button_edit);
a_button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
@ -260,6 +270,25 @@ public class InputModFragment extends Fragment {
joystick.setEnabled(false);
mPrefs.edit().remove("joystick").commit();
// Still needs better support for identifying the entire stick
OnCheckedChangeListener dpad_joystick = new OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView,
boolean isChecked) {
mPrefs.edit()
.putBoolean("dpad_js_layout" + player, isChecked)
.commit();
}
};
Switch dpad_js_layout = (Switch) getView().findViewById(
R.id.dpad_js_layout);
boolean joypad = mPrefs.getBoolean("dpad_js_layout" + player,
false);
if (joypad) {
dpad_js_layout.setChecked(true);
} else {
dpad_js_layout.setChecked(false);
}
dpad_js_layout.setOnCheckedChangeListener(dpad_joystick);
final TextView dpad_up_text = (TextView) getView().findViewById(
R.id.dpad_up_key);

View File

@ -7,7 +7,6 @@ import tv.ouya.console.api.OuyaController;
import android.app.Activity;
import android.content.SharedPreferences;
import android.os.Handler;
import android.os.SystemClock;
import android.preference.PreferenceManager;
import android.widget.Toast;
@ -36,7 +35,13 @@ public class MOGAInput
Controller mController = null;
private Handler handler;
private String notify;
private GL2JNIView mView;
static String[] portId = { "_A", "_B", "_C", "_D" };
static boolean[] custom = { false, false, false, false },
jsCompat = { false, false, false, false };
float[] globalLS_X = new float[4], globalLS_Y = new float[4],
previousLS_X = new float[4], previousLS_Y = new float[4];
public boolean isActive[] = { false, false, false, false };
public boolean isMogaPro[] = { false, false, false, false };
@ -101,16 +106,14 @@ public class MOGAInput
mMotions.put(MotionEvent.AXIS_RTRIGGER, new ExampleFloat("AXIS_RTRIGGER........."));
*/
}
public void setGL2View(GL2JNIView mView) {
this.mView = mView;
}
protected void onCreate(Activity act)
{
this.act = act;
handler = new Handler();
prefs = PreferenceManager
.getDefaultSharedPreferences(act.getApplicationContext());
mController = Controller.getInstance(act);
mController.init();
@ -156,12 +159,8 @@ public class MOGAInput
}
private void setModifiedKeys(int player) {
prefs = PreferenceManager
.getDefaultSharedPreferences(act.getApplicationContext());
String[] players = act.getResources().getStringArray(R.array.controllers);
String id = players[player].substring(
players[player].lastIndexOf(" "), players[player].length());
if (prefs.getBoolean("modified_key_layout" + id, false)) {
String id = portId[player];
if (custom[player]) {
map[player] = new int[] {
prefs.getInt("a_button" + id, KeyEvent.KEYCODE_BUTTON_A), key_CONT_A,
prefs.getInt("b_button" + id, KeyEvent.KEYCODE_BUTTON_B), key_CONT_B,
@ -176,6 +175,10 @@ public class MOGAInput
prefs.getInt("start_button" + id, KeyEvent.KEYCODE_BUTTON_START), key_CONT_START,
};
}
if (jsCompat[player]) {
globalLS_X[player] = previousLS_X[player] = 0.0f;
globalLS_Y[player] = previousLS_Y[player] = 0.0f;
}
}
class ExampleControllerListener implements ControllerListener
@ -187,35 +190,20 @@ public class MOGAInput
if (playerNum == null)
return;
String[] players = act.getResources().getStringArray(R.array.controllers);
String id = "_" + players[playerNum].substring(
players[playerNum].lastIndexOf(" ") + 1, players[playerNum].length());
if (prefs.getBoolean("modified_key_layout" + id, false)) {
float x = -1, y = -1;
if (event.getKeyCode() == prefs.getInt("l_button" + id, OuyaController.BUTTON_L1)) {
float LxC = prefs.getFloat("touch_x_shift_left_trigger", 0);
float LyC = prefs.getFloat("touch_y_shift_left_trigger", 0);
x = 440 + LxC + 1;
y = 200 + LyC + 1;
}
if (event.getKeyCode() == prefs.getInt("r_button" + id, OuyaController.BUTTON_R1)) {
float RxC = prefs.getFloat("touch_x_shift_right_trigger", 0);
float RyC = prefs.getFloat("touch_y_shift_right_trigger", 0);
x = 542 + RxC + 1;
y = 200 + RyC + 1;
}
if (mView != null && (x != -1 || y != -1)) {
JNIdc.show_osd();
long downTime = SystemClock.uptimeMillis();
long eventTime = SystemClock.uptimeMillis() + 100;
int metaState = 0;
android.view.MotionEvent motionEvent = android.view.MotionEvent.obtain(downTime, eventTime,
android.view.MotionEvent.ACTION_UP, x, y, metaState);
mView.dispatchTouchEvent(motionEvent);
if (playerNum == 0)
JNIdc.hide_osd();
return;
}
String id = portId[playerNum];
if (custom[playerNum]) {
if (event.getKeyCode() == prefs.getInt("l_button" + id, OuyaController.BUTTON_L1)) {
GL2JNIView.lt[playerNum] = (int) (0.5 * 255);
GL2JNIView.lt[playerNum] = (int) (1.0 * 255);
GL2JNIView.lt[playerNum] = (int) (0.5 * 255);
GL2JNIView.lt[playerNum] = 0;
}
if (event.getKeyCode() == prefs.getInt("r_button" + id, OuyaController.BUTTON_R1)) {
GL2JNIView.lt[playerNum] = (int) (0.5 * 255);
GL2JNIView.lt[playerNum] = (int) (1.0 * 255);
GL2JNIView.lt[playerNum] = (int) (0.5 * 255);
GL2JNIView.lt[playerNum] = 0;
}
}
if(playerNum == 0)
@ -246,6 +234,15 @@ public class MOGAInput
float LS_Y = event.getAxisValue(MotionEvent.AXIS_Y);
float L2 = event.getAxisValue(MotionEvent.AXIS_LTRIGGER);
float R2 = event.getAxisValue(MotionEvent.AXIS_RTRIGGER);
if (jsCompat[playerNum]) {
previousLS_X[playerNum] = globalLS_X[playerNum];
previousLS_Y[playerNum] = globalLS_Y[playerNum];
globalLS_X[playerNum] = LS_X;
globalLS_Y[playerNum] = LS_Y;
}
GL2JNIView.lt[playerNum] = (int) (L2 * 255);
GL2JNIView.rt[playerNum] = (int) (R2 * 255);
@ -271,6 +268,10 @@ public class MOGAInput
if(playerNum == 0)
JNIdc.hide_osd();
String id = portId[playerNum];
custom[playerNum] = prefs.getBoolean("modified_key_layout" + id, false);
jsCompat[playerNum] = prefs.getBoolean("dpad_js_layout" + id, false);
if (event.getState() == StateEvent.STATE_CONNECTION && event.getAction() == ACTION_CONNECTED) {
int mControllerVersion = mController.getState(Controller.STATE_CURRENT_PRODUCT_VERSION);

View File

@ -8,8 +8,6 @@ import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Configuration;
import android.content.res.TypedArray;
import android.net.Uri;
@ -232,46 +230,64 @@ public class MainActivity extends FragmentActivity implements
}
});
findViewById(R.id.about).setOnTouchListener(new OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
if (event.getActionMasked() == MotionEvent.ACTION_DOWN) {
// vib.vibrate(50);
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
MainActivity.this);
// set title
alertDialogBuilder.setTitle(getString(R.string.about_title));
String versionName = "";
try {
PackageInfo pInfo = getPackageManager()
.getPackageInfo(getPackageName(), 0);
versionName = pInfo.versionName;
} catch (NameNotFoundException e) {
e.printStackTrace();
findViewById(R.id.about).setOnClickListener(new OnClickListener() {
public void onClick(View view) {
AboutFragment aboutFrag = (AboutFragment) getSupportFragmentManager()
.findFragmentByTag("ABOUT_FRAG");
if (aboutFrag != null) {
if (aboutFrag.isVisible()) {
return;
}
alertDialogBuilder
.setMessage(getString(R.string.about_text, versionName))
.setCancelable(false)
.setPositiveButton("Dismiss",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.dismiss();
}
});
// create alert dialog
AlertDialog alertDialog = alertDialogBuilder.create();
// show it
alertDialog.show();
return true;
} else
return false;
}
aboutFrag = new AboutFragment();
getSupportFragmentManager()
.beginTransaction()
.replace(R.id.fragment_container, aboutFrag,
"ABOUT_FRAG").addToBackStack(null).commit();
}
});
// findViewById(R.id.about).setOnTouchListener(new OnTouchListener() {
// public boolean onTouch(View v, MotionEvent event) {
// if (event.getActionMasked() == MotionEvent.ACTION_DOWN) {
// // vib.vibrate(50);
// AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
// MainActivity.this);
//
// // set title
// alertDialogBuilder.setTitle(getString(R.string.about_title));
//
// String versionName = "";
// try {
// PackageInfo pInfo = getPackageManager()
// .getPackageInfo(getPackageName(), 0);
// versionName = pInfo.versionName;
// } catch (NameNotFoundException e) {
// e.printStackTrace();
// }
//
// alertDialogBuilder
// .setMessage(getString(R.string.about_text, versionName))
// .setCancelable(false)
// .setPositiveButton("Dismiss",
// new DialogInterface.OnClickListener() {
// public void onClick(DialogInterface dialog, int id) {
// dialog.dismiss();
// }
// });
//
// // create alert dialog
// AlertDialog alertDialog = alertDialogBuilder.create();
//
// // show it
// alertDialog.show();
// return true;
// } else
// return false;
// }
// });
findViewById(R.id.rate).setOnTouchListener(new OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
if (event.getActionMasked() == MotionEvent.ACTION_DOWN) {
@ -483,41 +499,52 @@ public class MainActivity extends FragmentActivity implements
frag_tag = "INPUT_FRAG";
break;
case 4:
fragment = null;
// vib.vibrate(50);
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
MainActivity.this);
// set title
alertDialogBuilder.setTitle(getString(R.string.about_title));
String versionName = "";
try {
PackageInfo pInfo = getPackageManager().getPackageInfo(
getPackageName(), 0);
versionName = pInfo.versionName;
} catch (NameNotFoundException e) {
e.printStackTrace();
fragment = (AboutFragment) getSupportFragmentManager()
.findFragmentByTag("ABOUT_FRAG");
if (fragment != null) {
if (fragment.isVisible()) {
return;
}
}
alertDialogBuilder
.setMessage(getString(R.string.about_text, versionName))
.setCancelable(false)
.setPositiveButton("Dismiss",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int id) {
dialog.dismiss();
}
});
// create alert dialog
AlertDialog alertDialog = alertDialogBuilder.create();
// show it
alertDialog.show();
fragment = new AboutFragment();
frag_tag = "ABOUT_FRAG";
break;
// fragment = null;
// // vib.vibrate(50);
// AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
// MainActivity.this);
//
// // set title
// alertDialogBuilder.setTitle(getString(R.string.about_title));
//
// String versionName = "";
// try {
// PackageInfo pInfo = getPackageManager().getPackageInfo(
// getPackageName(), 0);
// versionName = pInfo.versionName;
// } catch (NameNotFoundException e) {
// e.printStackTrace();
// }
//
// alertDialogBuilder
// .setMessage(getString(R.string.about_text, versionName))
// .setCancelable(false)
// .setPositiveButton("Dismiss",
// new DialogInterface.OnClickListener() {
// public void onClick(DialogInterface dialog,
// int id) {
// dialog.dismiss();
// }
// });
//
// // create alert dialog
// AlertDialog alertDialog = alertDialogBuilder.create();
//
// // show it
// alertDialog.show();
// break;
case 5:
startActivity(new Intent(Intent.ACTION_VIEW,
Uri.parse("market://details?id=" + getPackageName())));

View File

@ -1,7 +1,7 @@
package com.reicast.emulator;
import java.util.ArrayList;
import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;

View File

@ -1,8 +1,5 @@
package de.ankri.views;
import com.reicast.emulator.R;
import de.ankri.text.method.AllCapsTransformationMethod;
import de.ankri.text.method.TransformationMethodCompat2;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.ColorStateList;
@ -26,6 +23,11 @@ import android.view.View;
import android.view.ViewConfiguration;
import android.widget.CompoundButton;
import com.reicast.emulator.R;
import de.ankri.text.method.AllCapsTransformationMethod;
import de.ankri.text.method.TransformationMethodCompat2;
/**
* A Switch is a two-state toggle switch widget that can select between two options. The user may drag the "thumb" back and forth to choose the selected option, or simply tap to toggle as if it were a
* checkbox. The {@link #setText(CharSequence) text} property controls the text displayed in the label for the switch, whereas the {@link #setTextOff(CharSequence) off} and

View File

@ -34,9 +34,9 @@ import android.os.Parcelable;
import android.preference.Preference;
import android.util.AttributeSet;
import android.view.View;
import android.widget.TextView;
//import android.view.accessibility.AccessibilityEvent;
//import android.view.accessibility.AccessibilityManager;
import android.widget.TextView;
/**
* Common base class for preferences that have two selectable states, persist a

View File

@ -1,62 +0,0 @@
Settings
reicast
System Path (location of the data folder with dc_boot.bin/dc_flash.bin inside)
Default System Path
Storage Path (location of .gdi, .chd or .cdi images)
Default Game Storage
Boot Dreamcast Bios
BIOS Missing. The Dreamcast BIOS is required for this emulator to work. Place the BIOS file in ####/data/dc_boot.bin
Flash Missing. The Dreamcast Flash is required for this emulator to work. Place the Flash file in ####/data/dc_flash.bin
You have to provide the BIOS
BOOT BIOS
SELECT CURRENT FOLDER
Dynarec Options
Unstable Optimisations
DC Region
Limit FPS
Use Mipmaps (fix for old SGX540)
Widescreen Mode
Frameskip Value
PVR Rendering (does nothing for now)
Set Default Disk
Available Dreamcast Games
Customize Touch Controls
Launch Editor
Touch Vibration
Controller A
Controller B
Controller C
Controller D
Controller Not Connected
No Controller Selected
Select
Remove
Select Controller
Press any button on the controller #### to assign to port
This controller is already in use!
Enable Custom Key Layout
Enable Compatibility Mode
Customize Physical Controls
Modify Controller
Press the new controller button for ####
MOGA Pro Connected!
MOGA Connected!
About reicast
reicast is a dreamcast emulator\\n\\nVersion: ####
Controller A
Controller B
Controller C
Controller D
(Default)
Slider Menu Opened
Slider Menu Closed
Browser
Settings
Paths
Input
About
Rate Me
Item Icon
ON
OFF
Save Error Logs