238 changes: 133 additions & 105 deletions Source/Android/.idea/workspace.xml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Source/Android/AndroidManifest.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.dolphinemu.dolphinemu"
android:versionCode="7"
android:versionName="0.7" >
android:versionCode="9"
android:versionName="0.9" >

<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="14"/>

Expand Down
40 changes: 20 additions & 20 deletions Source/Android/assets/GCPadNew.ini
@@ -1,29 +1,29 @@
[GCPad1]
Device = Android/0/Touchscreen
Buttons/A = Button 0
Buttons/B = Button 1
Buttons/X = Button 3
Buttons/Y = Button 4
Buttons/Z = Button 5
Buttons/Start = Button 2
Main Stick/Up = Axis 10
Main Stick/Down = Axis 11
Main Stick/Left = Axis 12
Main Stick/Right = Axis 13
Buttons/A = `Button 0`
Buttons/B = `Button 1`
Buttons/X = `Button 3`
Buttons/Y = `Button 4`
Buttons/Z = `Button 5`
Buttons/Start = `Button 2`
Main Stick/Up = `Axis 10`
Main Stick/Down = `Axis 11`
Main Stick/Left = `Axis 12`
Main Stick/Right = `Axis 13`
Main Stick/Modifier = Shift_L
Main Stick/Modifier/Range = 50.000000
C-Stick/Up = Axis 14
C-Stick/Down = Axis 15
C-Stick/Left = Axis 16
C-Stick/Right = Axis 17
C-Stick/Up = `Axis 14`
C-Stick/Down = `Axis 15`
C-Stick/Left = `Axis 16`
C-Stick/Right = `Axis 17`
C-Stick/Modifier = Control_L
C-Stick/Modifier/Range = 50.000000
Triggers/L = Axis 18
Triggers/R = Axis 19
D-Pad/Up = Button 6
D-Pad/Down = Button 7
D-Pad/Left = Button 8
D-Pad/Right = Button 9
Triggers/L = `Axis 18`
Triggers/R = `Axis 19`
D-Pad/Up = `Button 6`
D-Pad/Down = `Button 7`
D-Pad/Left = `Button 8`
D-Pad/Right = `Button 9`
[GCPad2]
[GCPad3]
[GCPad4]
48 changes: 35 additions & 13 deletions Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java
Expand Up @@ -173,24 +173,46 @@ public boolean onTouchEvent(MotionEvent event)
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
int action = 0;
switch (event.getAction()) {
case KeyEvent.ACTION_DOWN:
action = 0;
break;
case KeyEvent.ACTION_UP:
action = 1;
break;
default:
break;

// Special catch for the back key
// Currently disabled because stopping and starting emulation is broken.
/*
if ( event.getSource() == InputDevice.SOURCE_KEYBOARD
&& event.getKeyCode() == KeyEvent.KEYCODE_BACK
&& event.getAction() == KeyEvent.ACTION_UP
)
{
if (Running)
NativeLibrary.StopEmulation();
Running = false;
Intent ListIntent = new Intent(this, GameListActivity.class);
startActivityForResult(ListIntent, 1);
return true;
}
InputDevice input = event.getDevice();
NativeLibrary.onGamePadEvent(input.getDescriptor(), event.getKeyCode(), action);
return true;
*/

if (Running)
{
switch (event.getAction()) {
case KeyEvent.ACTION_DOWN:
action = 0;
break;
case KeyEvent.ACTION_UP:
action = 1;
break;
default:
return false;
}
InputDevice input = event.getDevice();
NativeLibrary.onGamePadEvent(input.getDescriptor(), event.getKeyCode(), action);
return true;
}
return false;
}

@Override
public boolean dispatchGenericMotionEvent(MotionEvent event) {
if (((event.getSource() & InputDevice.SOURCE_CLASS_JOYSTICK) == 0)) {
if (((event.getSource() & InputDevice.SOURCE_CLASS_JOYSTICK) == 0) || !Running) {
return super.dispatchGenericMotionEvent(event);
}

Expand Down
19 changes: 12 additions & 7 deletions Source/Android/src/org/dolphinemu/dolphinemu/FolderBrowser.java
Expand Up @@ -60,10 +60,12 @@ private void Fill(File f)
protected void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
GameListItem o = adapter.getItem(position);
if(o.getData().equalsIgnoreCase("folder")||o.getData().equalsIgnoreCase("parent directory")){
if(o.getData().equalsIgnoreCase("folder") || o.getData().equalsIgnoreCase("parent directory")){
currentDir = new File(o.getPath());
Fill(currentDir);
}
else
FolderSelected();
}

@Override
Expand All @@ -83,11 +85,14 @@ public boolean onCreateOptionsMenu(Menu menu)
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
Intent intent = new Intent();
intent.putExtra("Select", currentDir.getPath());
setResult(Activity.RESULT_OK, intent);

this.finish();
return true;
FolderSelected();
return true;
}
private void FolderSelected()
{
Intent intent = new Intent();
intent.putExtra("Select", currentDir.getPath());
setResult(Activity.RESULT_OK, intent);
this.finish();
}
}