Merge 'master' into shader-uids-awesome.
Conflicts: Source/Core/VideoCommon/Src/BPMemory.h Source/Core/VideoCommon/Src/LightingShaderGen.cpp Source/Core/VideoCommon/Src/PixelShaderGen.cpp Source/Core/VideoCommon/Src/PixelShaderGen.h Source/Core/VideoCommon/Src/PixelShaderManager.cpp Source/Core/VideoCommon/Src/VertexShaderGen.cpp Source/Core/VideoCommon/Src/VertexShaderGen.h
8
Source/Android/.classpath
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
|
||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="src" path="gen"/>
|
||||
<classpathentry kind="output" path="bin/classes"/>
|
||||
</classpath>
|
||||
7
Source/Android/.gitignore
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
gen
|
||||
obj
|
||||
#ui_atlas.zim
|
||||
ui_atlas.zim.png
|
||||
#assets/ui_atlas.zim
|
||||
#jni/ui_atlas.cpp
|
||||
#jni/ui_atlas.h
|
||||
33
Source/Android/.project
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>dolphinemulator</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
4
Source/Android/.settings/org.eclipse.jdt.core.prefs
Normal file
@@ -0,0 +1,4 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
|
||||
org.eclipse.jdt.core.compiler.compliance=1.5
|
||||
org.eclipse.jdt.core.compiler.source=1.5
|
||||
42
Source/Android/AndroidManifest.xml
Normal file
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.dolphinemu.dolphinemu"
|
||||
android:versionCode="2"
|
||||
android:versionName="0.2" >
|
||||
|
||||
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="14"/>
|
||||
|
||||
<uses-feature android:glEsVersion="0x00020000"></uses-feature>
|
||||
<uses-feature android:name="android.hardware.screen.landscape" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
||||
|
||||
<application
|
||||
android:icon="@drawable/launcher"
|
||||
android:label="@string/app_name">
|
||||
<activity
|
||||
android:name=".DolphinEmulator"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
|
||||
android:screenOrientation="landscape"
|
||||
android:configChanges="locale|keyboard|keyboardHidden|navigation|fontScale|uiMode" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name="org.dolphinemu.dolphinemu.GameListView"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@android:style/Theme"
|
||||
android:configChanges="orientation|locale|keyboard|keyboardHidden|navigation|fontScale|uiMode" >
|
||||
</activity>
|
||||
<activity
|
||||
android:name="org.dolphinemu.dolphinemu.FolderBrowser"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@android:style/Theme"
|
||||
android:configChanges="orientation|locale|keyboard|keyboardHidden|navigation|fontScale|uiMode" >
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
1632
Source/Android/android.toolchain.cmake
Normal file
BIN
Source/Android/assets/ButtonA.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
Source/Android/assets/ButtonB.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
Source/Android/assets/ButtonStart.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
29
Source/Android/assets/GCPadNew.ini
Normal file
@@ -0,0 +1,29 @@
|
||||
[GCPad1]
|
||||
Device = Android/0/Touchscreen
|
||||
Buttons/A = Button 0
|
||||
Buttons/B = Button 1
|
||||
Buttons/X = C
|
||||
Buttons/Y = S
|
||||
Buttons/Z = D
|
||||
Buttons/Start = Button 2
|
||||
Main Stick/Up = Up
|
||||
Main Stick/Down = Down
|
||||
Main Stick/Left = Left
|
||||
Main Stick/Right = Right
|
||||
Main Stick/Modifier = Shift_L
|
||||
Main Stick/Modifier/Range = 50.000000
|
||||
C-Stick/Up = I
|
||||
C-Stick/Down = K
|
||||
C-Stick/Left = J
|
||||
C-Stick/Right = L
|
||||
C-Stick/Modifier = Control_L
|
||||
C-Stick/Modifier/Range = 50.000000
|
||||
Triggers/L = Q
|
||||
Triggers/R = W
|
||||
D-Pad/Up = T
|
||||
D-Pad/Down = G
|
||||
D-Pad/Left = F
|
||||
D-Pad/Right = H
|
||||
[GCPad2]
|
||||
[GCPad3]
|
||||
[GCPad4]
|
||||
BIN
Source/Android/assets/NoBanner.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
92
Source/Android/build.xml
Normal file
@@ -0,0 +1,92 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="Dolphin Emulator" default="help">
|
||||
|
||||
<!-- The local.properties file is created and updated by the 'android' tool.
|
||||
It contains the path to the SDK. It should *NOT* be checked into
|
||||
Version Control Systems. -->
|
||||
<property file="local.properties" />
|
||||
|
||||
<!-- The ant.properties file can be created by you. It is only edited by the
|
||||
'android' tool to add properties to it.
|
||||
This is the place to change some Ant specific build properties.
|
||||
Here are some properties you may want to change/update:
|
||||
|
||||
source.dir
|
||||
The name of the source directory. Default is 'src'.
|
||||
out.dir
|
||||
The name of the output directory. Default is 'bin'.
|
||||
|
||||
For other overridable properties, look at the beginning of the rules
|
||||
files in the SDK, at tools/ant/build.xml
|
||||
|
||||
Properties related to the SDK location or the project target should
|
||||
be updated using the 'android' tool with the 'update' action.
|
||||
|
||||
This file is an integral part of the build system for your
|
||||
application and should be checked into Version Control Systems.
|
||||
|
||||
-->
|
||||
<property file="ant.properties" />
|
||||
|
||||
<!-- if sdk.dir was not set from one of the property file, then
|
||||
get it from the ANDROID_HOME env var.
|
||||
This must be done before we load project.properties since
|
||||
the proguard config can use sdk.dir -->
|
||||
<property environment="env" />
|
||||
<condition property="sdk.dir" value="${env.ANDROID_HOME}">
|
||||
<isset property="env.ANDROID_HOME" />
|
||||
</condition>
|
||||
|
||||
<!-- The project.properties file is created and updated by the 'android'
|
||||
tool, as well as ADT.
|
||||
|
||||
This contains project specific properties such as project target, and library
|
||||
dependencies. Lower level build properties are stored in ant.properties
|
||||
(or in .classpath for Eclipse projects).
|
||||
|
||||
This file is an integral part of the build system for your
|
||||
application and should be checked into Version Control Systems. -->
|
||||
<loadproperties srcFile="project.properties" />
|
||||
|
||||
<!-- quick check on sdk.dir -->
|
||||
<fail
|
||||
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
|
||||
unless="sdk.dir"
|
||||
/>
|
||||
|
||||
<!--
|
||||
Import per project custom build rules if present at the root of the project.
|
||||
This is the place to put custom intermediary targets such as:
|
||||
-pre-build
|
||||
-pre-compile
|
||||
-post-compile (This is typically used for code obfuscation.
|
||||
Compiled code location: ${out.classes.absolute.dir}
|
||||
If this is not done in place, override ${out.dex.input.absolute.dir})
|
||||
-post-package
|
||||
-post-build
|
||||
-pre-clean
|
||||
-->
|
||||
<import file="custom_rules.xml" optional="true" />
|
||||
|
||||
<!-- Import the actual build file.
|
||||
|
||||
To customize existing targets, there are two options:
|
||||
- Customize only one target:
|
||||
- copy/paste the target into this file, *before* the
|
||||
<import> task.
|
||||
- customize it to your needs.
|
||||
- Customize the whole content of build.xml
|
||||
- copy/paste the content of the rules files (minus the top node)
|
||||
into this file, replacing the <import> task.
|
||||
- customize to your needs.
|
||||
|
||||
***********************
|
||||
****** IMPORTANT ******
|
||||
***********************
|
||||
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
|
||||
in order to avoid having your file be overridden by tools such as "android update project"
|
||||
-->
|
||||
<!-- version-tag: 1 -->
|
||||
<import file="${sdk.dir}/tools/ant/build.xml" />
|
||||
|
||||
</project>
|
||||
19
Source/Android/custom_rules.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="Dolphin" default="help">
|
||||
<property name="ndkbuildopt" value=""/>
|
||||
<target name="-pre-build">
|
||||
<exec executable="${ndk.dir}/ndk-build" failonerror="true">
|
||||
<arg line="-j4 ${ndkbuildopt}"/>
|
||||
</exec>
|
||||
<copy todir="${jar.libs.dir}/armeabi-v7a">
|
||||
<fileset
|
||||
dir="../../libs/armeabi-v7a"
|
||||
includes="libdolphin-emu-nogui.so" />
|
||||
</copy>
|
||||
</target>
|
||||
<target name="clean" depends="android_rules.clean">
|
||||
<exec executable="${ndk.dir}/ndk-build" failonerror="true">
|
||||
<arg value="clean"/>
|
||||
</exec>
|
||||
</target>
|
||||
</project>
|
||||
0
Source/Android/jni/Android.mk
Normal file
4
Source/Android/jni/Application.mk
Normal file
@@ -0,0 +1,4 @@
|
||||
APP_STL := stlport_static
|
||||
APP_ABI := armeabi-v7a
|
||||
|
||||
#APP_ABI := armeabi-v7a
|
||||
15
Source/Android/project.properties
Normal file
@@ -0,0 +1,15 @@
|
||||
# This file is automatically generated by Android Tools.
|
||||
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
|
||||
#
|
||||
# This file must be checked in Version Control Systems.
|
||||
#
|
||||
# To customize properties used by the Ant build system edit
|
||||
# "ant.properties", and override values to adapt the script to your
|
||||
# project structure.
|
||||
#
|
||||
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
|
||||
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
|
||||
|
||||
# Project target.
|
||||
target=android-17
|
||||
android.library.reference.1=../../Externals/android-menudrawer/library
|
||||
BIN
Source/Android/res/drawable-hdpi/launcher.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
Source/Android/res/drawable-mdpi/launcher.png
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
Source/Android/res/drawable-xhdpi/launcher.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
Source/Android/res/drawable-xxhdpi/launcher.png
Normal file
|
After Width: | Height: | Size: 80 KiB |
44
Source/Android/res/layout/folderbrowser.xml
Normal file
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/TextView01"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dip"
|
||||
android:layout_marginTop="5dip"
|
||||
android:singleLine="true"
|
||||
android:text="@+id/TextView01"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/TextView02"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dip"
|
||||
android:text="@+id/TextView02" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
7
Source/Android/res/layout/folderbrowserfooter.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical" >
|
||||
|
||||
</LinearLayout>
|
||||
42
Source/Android/res/layout/main.xml
Normal file
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView1"
|
||||
android:layout_width="96dp"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/TextView01"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dip"
|
||||
android:layout_marginTop="5dip"
|
||||
android:singleLine="true"
|
||||
android:text="@+id/TextView01"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/TextView02"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dip"
|
||||
android:text="@+id/TextView02" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
31
Source/Android/res/layout/sidemenu.xml
Normal file
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:gravity="left"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/TextView01"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dip"
|
||||
android:layout_marginTop="5dip"
|
||||
android:singleLine="true"
|
||||
android:text="@+id/TextView01"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
6
Source/Android/res/values/strings.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="app_name">Dolphin Emulator</string>
|
||||
|
||||
</resources>
|
||||
@@ -0,0 +1,177 @@
|
||||
package org.dolphinemu.dolphinemu;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import net.simonvt.menudrawer.MenuDrawer;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.Log;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.WindowManager;
|
||||
|
||||
public class DolphinEmulator<MainActivity> extends Activity
|
||||
{
|
||||
static private NativeGLSurfaceView GLview = null;
|
||||
static private boolean Running = false;
|
||||
|
||||
private float screenWidth;
|
||||
private float screenHeight;
|
||||
|
||||
public static native void onTouchEvent(int Action, float X, float Y);
|
||||
|
||||
static
|
||||
{
|
||||
try
|
||||
{
|
||||
System.loadLibrary("dolphin-emu-nogui");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.w("me", ex.toString());
|
||||
}
|
||||
}
|
||||
private void CopyAsset(String asset, String output) {
|
||||
InputStream in = null;
|
||||
OutputStream out = null;
|
||||
try {
|
||||
in = getAssets().open(asset);
|
||||
out = new FileOutputStream(output);
|
||||
copyFile(in, out);
|
||||
in.close();
|
||||
in = null;
|
||||
out.flush();
|
||||
out.close();
|
||||
out = null;
|
||||
} catch(IOException e) {
|
||||
Log.e("tag", "Failed to copy asset file: " + asset, e);
|
||||
}
|
||||
}
|
||||
private void copyFile(InputStream in, OutputStream out) throws IOException {
|
||||
byte[] buffer = new byte[1024];
|
||||
int read;
|
||||
while((read = in.read(buffer)) != -1){
|
||||
out.write(buffer, 0, read);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop()
|
||||
{
|
||||
super.onStop();
|
||||
if (Running)
|
||||
NativeGLSurfaceView.StopEmulation();
|
||||
}
|
||||
@Override
|
||||
public void onPause()
|
||||
{
|
||||
super.onPause();
|
||||
if (Running)
|
||||
NativeGLSurfaceView.PauseEmulation();
|
||||
}
|
||||
@Override
|
||||
public void onResume()
|
||||
{
|
||||
super.onResume();
|
||||
if (Running)
|
||||
NativeGLSurfaceView.UnPauseEmulation();
|
||||
}
|
||||
|
||||
/** Called when the activity is first created. */
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
if (savedInstanceState == null)
|
||||
{
|
||||
|
||||
Intent ListIntent = new Intent(this, GameListView.class);
|
||||
startActivityForResult(ListIntent, 1);
|
||||
|
||||
// Make the assets directory
|
||||
String strDir = Environment.getExternalStorageDirectory()+File.separator+"dolphin-emu";
|
||||
File directory = new File(strDir);
|
||||
directory.mkdirs();
|
||||
|
||||
strDir += File.separator+"Config";
|
||||
directory = new File(strDir);
|
||||
directory.mkdirs();
|
||||
|
||||
// Copy assets if needed
|
||||
java.io.File file = new java.io.File(
|
||||
Environment.getExternalStorageDirectory()+File.separator+"dolphin-emu" + File.separator + "NoBanner.png");
|
||||
if(!file.exists())
|
||||
{
|
||||
CopyAsset("ButtonA.png",
|
||||
Environment.getExternalStorageDirectory()+File.separator+
|
||||
"dolphin-emu" + File.separator + "ButtonA.png");
|
||||
CopyAsset("ButtonB.png",
|
||||
Environment.getExternalStorageDirectory()+File.separator+
|
||||
"dolphin-emu" + File.separator + "ButtonB.png");
|
||||
CopyAsset("ButtonStart.png",
|
||||
Environment.getExternalStorageDirectory()+File.separator+
|
||||
"dolphin-emu" + File.separator + "ButtonStart.png");
|
||||
CopyAsset("NoBanner.png",
|
||||
Environment.getExternalStorageDirectory()+File.separator+
|
||||
"dolphin-emu" + File.separator + "NoBanner.png");
|
||||
CopyAsset("GCPadNew.ini",
|
||||
Environment.getExternalStorageDirectory()+File.separator+
|
||||
"dolphin-emu" + File.separator +"Config"+ File.separator +"GCPadNew.ini");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data)
|
||||
{
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
|
||||
if (resultCode == Activity.RESULT_OK)
|
||||
{
|
||||
DisplayMetrics displayMetrics = new DisplayMetrics();
|
||||
WindowManager wm = (WindowManager) getApplicationContext().getSystemService(Context.WINDOW_SERVICE); // the results will be higher than using the activity context object or the getWindowManager() shortcut
|
||||
wm.getDefaultDisplay().getMetrics(displayMetrics);
|
||||
screenWidth = displayMetrics.widthPixels;
|
||||
screenHeight = displayMetrics.heightPixels;
|
||||
|
||||
String FileName = data.getStringExtra("Select");
|
||||
GLview = new NativeGLSurfaceView(this);
|
||||
//this.getWindow().setUiOptions(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN, View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN);
|
||||
GLview.SetDimensions(screenWidth, screenHeight);
|
||||
GLview.SetFileName(FileName);
|
||||
setContentView(GLview);
|
||||
Running = true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent event)
|
||||
{
|
||||
float X, Y;
|
||||
int Action;
|
||||
X = event.getX();
|
||||
Y = event.getY();
|
||||
Action = event.getActionMasked();
|
||||
|
||||
// Converts button locations 0 - 1 to OGL screen coords -1.0 - 1.0
|
||||
float ScreenX = ((X / screenWidth) * 2.0f) - 1.0f;
|
||||
float ScreenY = ((Y / screenHeight) * -2.0f) + 1.0f;
|
||||
|
||||
onTouchEvent(Action, ScreenX, ScreenY);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean overrideKeys()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package org.dolphinemu.dolphinemu;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.simonvt.menudrawer.MenuDrawer;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.ListActivity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.AdapterView.OnItemLongClickListener;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ListView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
public class FolderBrowser extends ListActivity {
|
||||
private GameListAdapter adapter;
|
||||
private static File currentDir = null;
|
||||
private void Fill(File f)
|
||||
{
|
||||
File[]dirs = f.listFiles();
|
||||
this.setTitle("Current Dir: " + f.getName());
|
||||
List<GameListItem>dir = new ArrayList<GameListItem>();
|
||||
List<GameListItem>fls = new ArrayList<GameListItem>();
|
||||
|
||||
try
|
||||
{
|
||||
for(File ff: dirs)
|
||||
{
|
||||
if (ff.getName().charAt(0) != '.')
|
||||
if(ff.isDirectory())
|
||||
dir.add(new GameListItem(getApplicationContext(), ff.getName(),"Folder",ff.getAbsolutePath()));
|
||||
else
|
||||
if (ff.getName().toLowerCase().contains(".gcm") ||
|
||||
ff.getName().toLowerCase().contains(".iso") ||
|
||||
ff.getName().toLowerCase().contains(".wbfs") ||
|
||||
ff.getName().toLowerCase().contains(".gcz") ||
|
||||
ff.getName().toLowerCase().contains(".dol") ||
|
||||
ff.getName().toLowerCase().contains(".elf"))
|
||||
fls.add(new GameListItem(getApplicationContext(), ff.getName(),"File Size: "+ff.length(),ff.getAbsolutePath()));
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
}
|
||||
|
||||
Collections.sort(dir);
|
||||
Collections.sort(fls);
|
||||
dir.addAll(fls);
|
||||
if (!f.getName().equalsIgnoreCase("sdcard"))
|
||||
dir.add(0, new GameListItem(getApplicationContext(), "..", "Parent Directory", f.getParent()));
|
||||
|
||||
adapter = new GameListAdapter(this,R.layout.folderbrowser,dir);
|
||||
this.setListAdapter(adapter);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onListItemClick(ListView l, View v, int position, long id) {
|
||||
// TODO Auto-generated method stub
|
||||
super.onListItemClick(l, v, position, id);
|
||||
GameListItem o = adapter.getItem(position);
|
||||
if(o.getData().equalsIgnoreCase("folder")||o.getData().equalsIgnoreCase("parent directory")){
|
||||
currentDir = new File(o.getPath());
|
||||
Fill(currentDir);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
if(currentDir == null)
|
||||
currentDir = new File(Environment.getExternalStorageDirectory().getPath());
|
||||
Fill(currentDir);
|
||||
}
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra("Select", currentDir.getPath());
|
||||
setResult(Activity.RESULT_OK, intent);
|
||||
|
||||
this.finish();
|
||||
super.onBackPressed();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package org.dolphinemu.dolphinemu;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
public class GameListAdapter extends ArrayAdapter<GameListItem>{
|
||||
|
||||
private Context c;
|
||||
private int id;
|
||||
private List<GameListItem>items;
|
||||
|
||||
public GameListAdapter(Context context, int textViewResourceId,
|
||||
List<GameListItem> objects) {
|
||||
super(context, textViewResourceId, objects);
|
||||
c = context;
|
||||
id = textViewResourceId;
|
||||
items = objects;
|
||||
}
|
||||
public GameListItem getItem(int i)
|
||||
{
|
||||
return items.get(i);
|
||||
}
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
View v = convertView;
|
||||
if (v == null) {
|
||||
LayoutInflater vi = (LayoutInflater)c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
v = vi.inflate(id, null);
|
||||
}
|
||||
final GameListItem o = items.get(position);
|
||||
if (o != null) {
|
||||
TextView t1 = (TextView) v.findViewById(R.id.TextView01);
|
||||
TextView t2 = (TextView) v.findViewById(R.id.TextView02);
|
||||
ImageView v1 = (ImageView) v.findViewById(R.id.imageView1);
|
||||
|
||||
if(t1!=null)
|
||||
t1.setText(o.getName());
|
||||
if(t2!=null)
|
||||
t2.setText(o.getData());
|
||||
if(v1!=null)
|
||||
v1.setImageBitmap(o.getImage());
|
||||
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
package org.dolphinemu.dolphinemu;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.util.Log;
|
||||
|
||||
public class GameListItem implements Comparable<GameListItem>{
|
||||
private String name;
|
||||
private String data;
|
||||
private String path;
|
||||
private Bitmap image;
|
||||
public static native int[] GetBanner(String filename);
|
||||
public static native String GetTitle(String filename);
|
||||
static
|
||||
{
|
||||
try
|
||||
{
|
||||
System.loadLibrary("dolphin-emu-nogui");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.w("me", ex.toString());
|
||||
}
|
||||
}
|
||||
|
||||
public GameListItem(Context ctx, String n,String d,String p)
|
||||
{
|
||||
name = n;
|
||||
data = d;
|
||||
path = p;
|
||||
File file = new File(path);
|
||||
if (!file.isDirectory())
|
||||
{
|
||||
int[] Banner = GetBanner(path);
|
||||
if (Banner[0] == 0)
|
||||
{
|
||||
try {
|
||||
InputStream path = ctx.getAssets().open("NoBanner.png");
|
||||
image = BitmapFactory.decodeStream(path);
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
image = Bitmap.createBitmap(Banner, 96, 32, Bitmap.Config.ARGB_8888);
|
||||
name = GetTitle(path);
|
||||
}
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getData()
|
||||
{
|
||||
return data;
|
||||
}
|
||||
|
||||
public String getPath()
|
||||
{
|
||||
return path;
|
||||
}
|
||||
public Bitmap getImage()
|
||||
{
|
||||
return image;
|
||||
}
|
||||
|
||||
public int compareTo(GameListItem o)
|
||||
{
|
||||
if(this.name != null)
|
||||
return this.name.toLowerCase().compareTo(o.getName().toLowerCase());
|
||||
else
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
|
||||
181
Source/Android/src/org/dolphinemu/dolphinemu/GameListView.java
Normal file
@@ -0,0 +1,181 @@
|
||||
package org.dolphinemu.dolphinemu;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.simonvt.menudrawer.MenuDrawer;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.ListActivity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.Surface;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.ListView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
public class GameListView extends ListActivity {
|
||||
private GameListAdapter adapter;
|
||||
private static File currentDir = null;
|
||||
private MenuDrawer mDrawer;
|
||||
|
||||
private SideMenuAdapter mAdapter;
|
||||
private ListView mList;
|
||||
private static GameListView me;
|
||||
public static native String GetConfig(String Key, String Value, String Default);
|
||||
public static native void SetConfig(String Key, String Value, String Default);
|
||||
|
||||
private void Fill(File f)
|
||||
{
|
||||
File[]dirs = f.listFiles();
|
||||
this.setTitle("Game List");
|
||||
List<GameListItem>dir = new ArrayList<GameListItem>();
|
||||
List<GameListItem>fls = new ArrayList<GameListItem>();
|
||||
|
||||
try
|
||||
{
|
||||
for(File ff: dirs)
|
||||
{
|
||||
if (ff.getName().charAt(0) != '.')
|
||||
if(!ff.isDirectory())
|
||||
if (ff.getName().toLowerCase().contains(".gcm") ||
|
||||
ff.getName().toLowerCase().contains(".iso") ||
|
||||
ff.getName().toLowerCase().contains(".wbfs") ||
|
||||
ff.getName().toLowerCase().contains(".gcz") ||
|
||||
ff.getName().toLowerCase().contains(".dol") ||
|
||||
ff.getName().toLowerCase().contains(".elf"))
|
||||
fls.add(new GameListItem(getApplicationContext(), ff.getName(),"File Size: "+ff.length(),ff.getAbsolutePath()));
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
}
|
||||
|
||||
Collections.sort(dir);
|
||||
Collections.sort(fls);
|
||||
dir.addAll(fls);
|
||||
|
||||
adapter = new GameListAdapter(this,R.layout.main,dir);
|
||||
this.setListAdapter(adapter);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onListItemClick(ListView l, View v, int position, long id) {
|
||||
// TODO Auto-generated method stub
|
||||
super.onListItemClick(l, v, position, id);
|
||||
GameListItem o = adapter.getItem(position);
|
||||
if(o.getData().equalsIgnoreCase("folder")||o.getData().equalsIgnoreCase("parent directory")){
|
||||
}
|
||||
else
|
||||
{
|
||||
onFileClick(o.getPath());
|
||||
}
|
||||
}
|
||||
|
||||
private void onFileClick(String o)
|
||||
{
|
||||
Toast.makeText(this, "File Clicked: " + o, Toast.LENGTH_SHORT).show();
|
||||
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra("Select", o);
|
||||
setResult(Activity.RESULT_OK, intent);
|
||||
|
||||
this.finish();
|
||||
}
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data)
|
||||
{
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
|
||||
if (resultCode == Activity.RESULT_OK)
|
||||
{
|
||||
String FileName = data.getStringExtra("Select");
|
||||
Toast.makeText(this, "Folder Selected: " + FileName, Toast.LENGTH_SHORT).show();
|
||||
SetConfig("General", "GCMPathes", "1");
|
||||
SetConfig("General", "GCMPaths0", FileName);
|
||||
|
||||
currentDir = new File(FileName);
|
||||
Fill(currentDir);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
me = this;
|
||||
|
||||
mDrawer = MenuDrawer.attach(this, MenuDrawer.MENU_DRAG_CONTENT);
|
||||
|
||||
String BrowseDir = GetConfig("General", "GCMPaths0", "");
|
||||
if(currentDir == null)
|
||||
currentDir = new File(BrowseDir);
|
||||
Fill(currentDir);
|
||||
|
||||
List<SideMenuItem>dir = new ArrayList<SideMenuItem>();
|
||||
dir.add(new SideMenuItem("Browse Folder", 0));
|
||||
|
||||
mList = new ListView(this);
|
||||
mAdapter = new SideMenuAdapter(this,R.layout.sidemenu,dir);
|
||||
mList.setAdapter(mAdapter);
|
||||
mList.setOnItemClickListener(mItemClickListener);
|
||||
|
||||
mDrawer.setMenuView(mList);
|
||||
}
|
||||
private AdapterView.OnItemClickListener mItemClickListener = new AdapterView.OnItemClickListener() {
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
SideMenuItem o = mAdapter.getItem(position);
|
||||
|
||||
switch(o.getID())
|
||||
{
|
||||
case 0:
|
||||
Toast.makeText(me, "Loading up the browser", Toast.LENGTH_SHORT).show();
|
||||
Intent ListIntent = new Intent(me, FolderBrowser.class);
|
||||
startActivityForResult(ListIntent, 1);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
mDrawer.closeMenu();
|
||||
}
|
||||
};
|
||||
@Override
|
||||
public void setContentView(int layoutResID) {
|
||||
// This override is only needed when using MENU_DRAG_CONTENT.
|
||||
mDrawer.setContentView(layoutResID);
|
||||
onContentChanged();
|
||||
}
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case android.R.id.home:
|
||||
mDrawer.toggleMenu();
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
final int drawerState = mDrawer.getDrawerState();
|
||||
if (drawerState == MenuDrawer.STATE_OPEN || drawerState == MenuDrawer.STATE_OPENING) {
|
||||
mDrawer.closeMenu();
|
||||
return;
|
||||
}
|
||||
|
||||
super.onBackPressed();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package org.dolphinemu.dolphinemu;
|
||||
|
||||
import android.content.Context;
|
||||
import android.opengl.GLSurfaceView;
|
||||
import android.util.Log;
|
||||
import android.view.Surface;
|
||||
import android.view.SurfaceHolder;
|
||||
import android.view.SurfaceView;
|
||||
|
||||
public class NativeGLSurfaceView extends SurfaceView {
|
||||
static private String FileName;
|
||||
static private Thread myRun;
|
||||
static private boolean Running = false;
|
||||
static private boolean Created = false;
|
||||
static private float width;
|
||||
static private float height;
|
||||
|
||||
public static native void main(String File, Surface surf, int width, int height);
|
||||
public static native void UnPauseEmulation();
|
||||
public static native void PauseEmulation();
|
||||
public static native void StopEmulation();
|
||||
|
||||
static
|
||||
{
|
||||
try
|
||||
{
|
||||
System.loadLibrary("dolphin-emu-nogui");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.w("me", ex.toString());
|
||||
}
|
||||
}
|
||||
|
||||
public NativeGLSurfaceView(Context context) {
|
||||
super(context);
|
||||
if (!Created)
|
||||
{
|
||||
myRun = new Thread()
|
||||
{
|
||||
@Override
|
||||
public void run() {
|
||||
main(FileName, getHolder().getSurface(), (int)width, (int)height);
|
||||
}
|
||||
};
|
||||
getHolder().addCallback(new SurfaceHolder.Callback() {
|
||||
public void surfaceCreated(SurfaceHolder holder) {
|
||||
// TODO Auto-generated method stub
|
||||
if (!Running)
|
||||
{
|
||||
myRun.start();
|
||||
Running = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void surfaceChanged(SurfaceHolder arg0, int arg1,
|
||||
int arg2, int arg3) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
public void surfaceDestroyed(SurfaceHolder arg0) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
});
|
||||
Created = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetFileName(String file)
|
||||
{
|
||||
FileName = file;
|
||||
}
|
||||
|
||||
public void SetDimensions(float screenWidth, float screenHeight)
|
||||
{
|
||||
width = screenWidth;
|
||||
height = screenHeight;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package org.dolphinemu.dolphinemu;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.TextView;
|
||||
|
||||
public class SideMenuAdapter extends ArrayAdapter<SideMenuItem>{
|
||||
|
||||
private Context c;
|
||||
private int id;
|
||||
private List<SideMenuItem>items;
|
||||
|
||||
public SideMenuAdapter(Context context, int textViewResourceId,
|
||||
List<SideMenuItem> objects) {
|
||||
super(context, textViewResourceId, objects);
|
||||
c = context;
|
||||
id = textViewResourceId;
|
||||
items = objects;
|
||||
}
|
||||
public SideMenuItem getItem(int i)
|
||||
{
|
||||
return items.get(i);
|
||||
}
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
View v = convertView;
|
||||
if (v == null) {
|
||||
LayoutInflater vi = (LayoutInflater)c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
v = vi.inflate(id, null);
|
||||
}
|
||||
final SideMenuItem o = items.get(position);
|
||||
if (o != null) {
|
||||
TextView t1 = (TextView) v.findViewById(R.id.TextView01);
|
||||
|
||||
if(t1!=null)
|
||||
t1.setText(o.getName());
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package org.dolphinemu.dolphinemu;
|
||||
|
||||
public class SideMenuItem implements Comparable<SideMenuItem>{
|
||||
private String m_name;
|
||||
private int m_id;
|
||||
|
||||
public SideMenuItem(String n, int id)
|
||||
{
|
||||
m_name = n;
|
||||
m_id = id;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return m_name;
|
||||
}
|
||||
public int getID()
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
|
||||
public int compareTo(SideMenuItem o)
|
||||
{
|
||||
if(this.m_name != null)
|
||||
return this.m_name.toLowerCase().compareTo(o.getName().toLowerCase());
|
||||
else
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <functional>
|
||||
#include <string.h>
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#ifndef _AOSOUNDSTREAM_H_
|
||||
#define _AOSOUNDSTREAM_H_
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "AudioCommon.h"
|
||||
#include "FileUtil.h"
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#ifndef _AUDIO_COMMON_H_
|
||||
#define _AUDIO_COMMON_H_
|
||||
|
||||
@@ -1,24 +1,11 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
// Dolby Pro Logic 2 decoder from ffdshow-tryout
|
||||
// * Copyright 2001 Anders Johansson ajh@atri.curtin.edu.au
|
||||
// * Copyright (c) 2004-2006 Milan Cutka
|
||||
// * based on mplayer HRTF plugin by ylai
|
||||
// * based on mplayer HRTF plugin by ylai
|
||||
|
||||
#include <functional>
|
||||
#include <vector>
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#ifndef _DPL2DECODER_H_
|
||||
#define _DPL2DECODER_H_
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <cmath>
|
||||
#include <functional>
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#ifndef _DSOUNDSTREAM_H_
|
||||
#define _DSOUNDSTREAM_H_
|
||||
|
||||
@@ -1,20 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "Atomic.h"
|
||||
#include "Mixer.h"
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#ifndef _MIXER_H_
|
||||
#define _MIXER_H_
|
||||
@@ -76,7 +63,7 @@ public:
|
||||
g_wave_writer.SetSkipSilence(false);
|
||||
NOTICE_LOG(DSPHLE, "Starting Audio logging");
|
||||
} else {
|
||||
WARN_LOG(DSPHLE, "Audio logging already started");
|
||||
WARN_LOG(DSPHLE, "Audio logging has already been started");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +73,7 @@ public:
|
||||
g_wave_writer.Stop();
|
||||
NOTICE_LOG(DSPHLE, "Stopping Audio logging");
|
||||
} else {
|
||||
WARN_LOG(DSPHLE, "Audio logging already stopped");
|
||||
WARN_LOG(DSPHLE, "Audio logging has already been stopped");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "AudioCommon.h"
|
||||
#include "NullSoundStream.h"
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#ifndef _NULLSOUNDSTREAM_H_
|
||||
#define _NULLSOUNDSTREAM_H_
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "aldlist.h"
|
||||
#include "OpenALStream.h"
|
||||
@@ -72,7 +59,7 @@ bool OpenALStream::Start()
|
||||
PanicAlertT("OpenAL: can't find sound devices");
|
||||
}
|
||||
|
||||
// Initialise DPL2 parameters
|
||||
// Initialize DPL2 parameters
|
||||
dpl2reset();
|
||||
|
||||
soundTouch.clear();
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#ifndef _OPENALSTREAM_H_
|
||||
#define _OPENALSTREAM_H_
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#ifndef _SOUNDSTREAM_H_
|
||||
#define _SOUNDSTREAM_H_
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "Common.h"
|
||||
#include "WaveFile.h"
|
||||
@@ -73,7 +60,7 @@ bool WaveFileWriter::Start(const char *filename, unsigned int HLESampleRate)
|
||||
|
||||
// We are now at offset 44
|
||||
if (file.Tell() != 44)
|
||||
PanicAlert("wrong offset: %lld", (long long)file.Tell());
|
||||
PanicAlert("Wrong offset: %lld", (long long)file.Tell());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
// ---------------------------------------------------------------------------------
|
||||
// Class: WaveFileWriter
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "AudioCommon.h"
|
||||
#include "XAudio2Stream.h"
|
||||
@@ -107,7 +94,7 @@ bool XAudio2::Start()
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
// callback dosent seem to run on a speecific cpu anyways
|
||||
// callback doesn't seem to run on a specific cpu anyways
|
||||
IXAudio2* xaudptr;
|
||||
if (FAILED(hr = XAudio2Create(&xaudptr, 0, XAUDIO2_DEFAULT_PROCESSOR)))
|
||||
{
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#ifndef _XAUDIO2STREAM_H_
|
||||
#define _XAUDIO2STREAM_H_
|
||||
|
||||
@@ -83,6 +83,40 @@ bool TryMakeOperand2_AllowNegation(s32 imm, Operand2 &op2, bool *negated)
|
||||
}
|
||||
}
|
||||
|
||||
Operand2 AssumeMakeOperand2(u32 imm) {
|
||||
Operand2 op2;
|
||||
bool result = TryMakeOperand2(imm, op2);
|
||||
_dbg_assert_msg_(JIT, result, "Could not make assumed Operand2.");
|
||||
return op2;
|
||||
}
|
||||
|
||||
bool ARMXEmitter::TrySetValue_TwoOp(ARMReg reg, u32 val)
|
||||
{
|
||||
int ops = 0;
|
||||
for (int i = 0; i < 16; i++)
|
||||
{
|
||||
if ((val >> (i*2)) & 0x3)
|
||||
{
|
||||
ops++;
|
||||
i+=3;
|
||||
}
|
||||
}
|
||||
if (ops > 2)
|
||||
return false;
|
||||
|
||||
bool first = true;
|
||||
for (int i = 0; i < 16; i++, val >>=2) {
|
||||
if (val & 0x3) {
|
||||
first ? MOV(reg, Operand2((u8)val, (u8)((16-i) & 0xF)))
|
||||
: ORR(reg, reg, Operand2((u8)val, (u8)((16-i) & 0xF)));
|
||||
first = false;
|
||||
i+=3;
|
||||
val >>= 6;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void ARMXEmitter::MOVI2F(ARMReg dest, float val, ARMReg tempReg)
|
||||
{
|
||||
union {float f; u32 u;} conv;
|
||||
@@ -93,6 +127,21 @@ void ARMXEmitter::MOVI2F(ARMReg dest, float val, ARMReg tempReg)
|
||||
// Otherwise, use a literal pool and VLDR directly (+- 1020)
|
||||
}
|
||||
|
||||
void ARMXEmitter::ADDI2R(ARMReg rd, ARMReg rs, u32 val, ARMReg scratch)
|
||||
{
|
||||
Operand2 op2;
|
||||
bool negated;
|
||||
if (TryMakeOperand2_AllowNegation(val, op2, &negated)) {
|
||||
if (!negated)
|
||||
ADD(rd, rs, op2);
|
||||
else
|
||||
SUB(rd, rs, op2);
|
||||
} else {
|
||||
MOVI2R(scratch, val);
|
||||
ADD(rd, rs, scratch);
|
||||
}
|
||||
}
|
||||
|
||||
void ARMXEmitter::ANDI2R(ARMReg rd, ARMReg rs, u32 val, ARMReg scratch)
|
||||
{
|
||||
Operand2 op2;
|
||||
@@ -109,6 +158,21 @@ void ARMXEmitter::ANDI2R(ARMReg rd, ARMReg rs, u32 val, ARMReg scratch)
|
||||
}
|
||||
}
|
||||
|
||||
void ARMXEmitter::CMPI2R(ARMReg rs, u32 val, ARMReg scratch)
|
||||
{
|
||||
Operand2 op2;
|
||||
bool negated;
|
||||
if (TryMakeOperand2_AllowNegation(val, op2, &negated)) {
|
||||
if (!negated)
|
||||
CMP(rs, op2);
|
||||
else
|
||||
CMN(rs, op2);
|
||||
} else {
|
||||
MOVI2R(scratch, val);
|
||||
CMP(rs, scratch);
|
||||
}
|
||||
}
|
||||
|
||||
void ARMXEmitter::ORI2R(ARMReg rd, ARMReg rs, u32 val, ARMReg scratch)
|
||||
{
|
||||
Operand2 op2;
|
||||
@@ -173,7 +237,7 @@ void ARMXEmitter::MOVI2R(ARMReg reg, u32 val, bool optimize)
|
||||
MOVW(reg, val & 0xFFFF);
|
||||
if(val & 0xFFFF0000)
|
||||
MOVT(reg, val, true);
|
||||
} else {
|
||||
} else if (!TrySetValue_TwoOp(reg,val)) {
|
||||
// Use literal pool for ARMv6.
|
||||
AddNewLit(val);
|
||||
LDR(reg, _PC); // To be backpatched later
|
||||
@@ -190,9 +254,7 @@ void ARMXEmitter::SetCodePtr(u8 *ptr)
|
||||
{
|
||||
code = ptr;
|
||||
startcode = code;
|
||||
#ifdef IOS
|
||||
lastCacheFlushEnd = ptr;
|
||||
#endif
|
||||
}
|
||||
|
||||
const u8 *ARMXEmitter::GetCodePtr() const
|
||||
@@ -236,14 +298,15 @@ void ARMXEmitter::FlushIcacheSection(u8 *start, u8 *end)
|
||||
#elif defined(BLACKBERRY)
|
||||
msync(start, end - start, MS_SYNC | MS_INVALIDATE_ICACHE);
|
||||
#elif defined(IOS)
|
||||
if (start != NULL)
|
||||
sys_cache_control(kCacheFunctionPrepareForExecution, start, end - start);
|
||||
// Header file says this is equivalent to: sys_icache_invalidate(start, end - start);
|
||||
sys_cache_control(kCacheFunctionPrepareForExecution, start, end - start);
|
||||
#elif !defined(_WIN32)
|
||||
#ifndef ANDROID
|
||||
start = startcode; // Should be Linux Only
|
||||
#endif
|
||||
#ifdef __clang__
|
||||
__clear_cache(start, end);
|
||||
#else
|
||||
__builtin___clear_cache(start, end);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void ARMXEmitter::SetCC(CCFlags cond)
|
||||
@@ -628,38 +691,40 @@ void ARMXEmitter::SVC(Operand2 op)
|
||||
|
||||
// IMM, REG, IMMSREG, RSR
|
||||
// -1 for invalid if the instruction doesn't support that
|
||||
const s32 LoadStoreOps[][4] = { {0x40, 0x60, 0x60, -1}, // STR
|
||||
{0x41, 0x61, 0x61, -1}, // LDR
|
||||
{0x44, 0x64, 0x64, -1}, // STRB
|
||||
{0x45, 0x65, 0x65, -1}, // LDRB
|
||||
// Special encodings
|
||||
{ 0x4, 0x0, -1, -1}, // STRH
|
||||
{ 0x5, 0x1, -1, -1}, // LDRH
|
||||
{ 0x5, 0x1, -1, -1}, // LDRSB
|
||||
{ 0x5, 0x1, -1, -1}, // LDRSH
|
||||
};
|
||||
const char *LoadStoreNames[] = { "STR",
|
||||
"LDR",
|
||||
"STRB",
|
||||
"LDRB",
|
||||
"STRH",
|
||||
"LDRH",
|
||||
"LDRSB",
|
||||
"LDRSH",
|
||||
};
|
||||
const s32 LoadStoreOps[][4] = {
|
||||
{0x40, 0x60, 0x60, -1}, // STR
|
||||
{0x41, 0x61, 0x61, -1}, // LDR
|
||||
{0x44, 0x64, 0x64, -1}, // STRB
|
||||
{0x45, 0x65, 0x65, -1}, // LDRB
|
||||
// Special encodings
|
||||
{ 0x4, 0x0, -1, -1}, // STRH
|
||||
{ 0x5, 0x1, -1, -1}, // LDRH
|
||||
{ 0x5, 0x1, -1, -1}, // LDRSB
|
||||
{ 0x5, 0x1, -1, -1}, // LDRSH
|
||||
};
|
||||
const char *LoadStoreNames[] = {
|
||||
"STR",
|
||||
"LDR",
|
||||
"STRB",
|
||||
"LDRB",
|
||||
"STRH",
|
||||
"LDRH",
|
||||
"LDRSB",
|
||||
"LDRSH",
|
||||
};
|
||||
|
||||
void ARMXEmitter::WriteStoreOp(u32 Op, ARMReg Rt, ARMReg Rn, Operand2 Rm, bool RegAdd)
|
||||
{
|
||||
s32 op = LoadStoreOps[Op][Rm.GetType()]; // Type always decided by last operand
|
||||
u32 Data;
|
||||
|
||||
|
||||
// Qualcomm chipsets get /really/ angry if you don't use index, even if the offset is zero.
|
||||
// Some of these encodings require Index at all times anyway. Doesn't really matter.
|
||||
// bool Index = op2 != 0 ? true : false;
|
||||
bool Index = true;
|
||||
bool Add = false;
|
||||
bool Add = false;
|
||||
|
||||
// Special Encoding
|
||||
// Special Encoding (misc addressing mode)
|
||||
bool SpecialOp = false;
|
||||
bool Half = false;
|
||||
bool SignedLoad = false;
|
||||
@@ -699,10 +764,13 @@ void ARMXEmitter::WriteStoreOp(u32 Op, ARMReg Rt, ARMReg Rn, Operand2 Rm, bool R
|
||||
// The offset is encoded differently on this one.
|
||||
if (SpecialOp)
|
||||
Data = (Data & 0xF0 << 4) | (Data & 0xF);
|
||||
if (Temp >= 0) Add = true;
|
||||
if (Temp >= 0) Add = true;
|
||||
}
|
||||
break;
|
||||
case TYPE_REG:
|
||||
Data = Rm.GetData();
|
||||
Add = RegAdd;
|
||||
break;
|
||||
case TYPE_IMMSREG:
|
||||
if (!SpecialOp)
|
||||
{
|
||||
@@ -710,17 +778,18 @@ void ARMXEmitter::WriteStoreOp(u32 Op, ARMReg Rt, ARMReg Rn, Operand2 Rm, bool R
|
||||
Add = RegAdd;
|
||||
break;
|
||||
}
|
||||
// Intentional fallthrough: TYPE_IMMSREG not supported for misc addressing.
|
||||
default:
|
||||
// RSR not supported for any of these
|
||||
// We already have the warning above
|
||||
BKPT(0x2);
|
||||
return;
|
||||
break;
|
||||
break;
|
||||
}
|
||||
if (SpecialOp)
|
||||
{
|
||||
// Add SpecialOp things
|
||||
Data = (0x5 << 4) | (SignedLoad << 6) | (Half << 5) | Data;
|
||||
Data = (0x9 << 4) | (SignedLoad << 6) | (Half << 5) | Data;
|
||||
}
|
||||
Write32(condition | (op << 20) | (Index << 24) | (Add << 23) | (Rn << 16) | (Rt << 12) | Data);
|
||||
}
|
||||
@@ -947,7 +1016,6 @@ void ARMXEmitter::VLDR(ARMReg Dest, ARMReg Base, s16 offset)
|
||||
{
|
||||
Write32(condition | (0xD << 24) | (Add << 23) | ((Dest & 0x1) << 22) | (1 << 20) | (Base << 16) \
|
||||
| ((Dest & 0x1E) << 11) | (10 << 8) | (imm >> 2));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -320,6 +320,9 @@ bool TryMakeOperand2(u32 imm, Operand2 &op2);
|
||||
bool TryMakeOperand2_AllowInverse(u32 imm, Operand2 &op2, bool *inverse);
|
||||
bool TryMakeOperand2_AllowNegation(s32 imm, Operand2 &op2, bool *negated);
|
||||
|
||||
// Use this only when you know imm can be made into an Operand2.
|
||||
Operand2 AssumeMakeOperand2(u32 imm);
|
||||
|
||||
inline Operand2 R(ARMReg Reg) { return Operand2(Reg, TYPE_REG); }
|
||||
inline Operand2 IMM(u32 Imm) { return Operand2(Imm, TYPE_IMM); }
|
||||
inline Operand2 Mem(void *ptr) { return Operand2((u32)ptr, TYPE_IMM); }
|
||||
@@ -394,6 +397,7 @@ public:
|
||||
|
||||
void FlushLitPool();
|
||||
void AddNewLit(u32 val);
|
||||
bool TrySetValue_TwoOp(ARMReg reg, u32 val);
|
||||
|
||||
CCFlags GetCC() { return CCFlags(condition >> 28); }
|
||||
void SetCC(CCFlags cond = CC_AL);
|
||||
@@ -562,7 +566,9 @@ public:
|
||||
void MOVI2R(ARMReg reg, u32 val, bool optimize = true);
|
||||
void MOVI2F(ARMReg dest, float val, ARMReg tempReg);
|
||||
|
||||
void ADDI2R(ARMReg rd, ARMReg rs, u32 val, ARMReg scratch);
|
||||
void ANDI2R(ARMReg rd, ARMReg rs, u32 val, ARMReg scratch);
|
||||
void CMPI2R(ARMReg rs, u32 val, ARMReg scratch);
|
||||
void ORI2R(ARMReg rd, ARMReg rs, u32 val, ARMReg scratch);
|
||||
|
||||
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#ifndef _ATOMIC_H_
|
||||
#define _ATOMIC_H_
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#ifndef _ATOMIC_GCC_H_
|
||||
#define _ATOMIC_GCC_H_
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#ifndef _ATOMIC_WIN32_H_
|
||||
#define _ATOMIC_WIN32_H_
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "Common.h"
|
||||
#include "DebugInterface.h"
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#ifndef _DEBUGGER_BREAKPOINTS_H
|
||||
#define _DEBUGGER_BREAKPOINTS_H
|
||||
|
||||
@@ -1,19 +1,7 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
// Detect the cpu, so we'll know which optimizations to use
|
||||
#ifndef _CPUDETECT_H_
|
||||
|
||||
@@ -1,19 +1,7 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#ifndef _POINTERWRAP_H_
|
||||
#define _POINTERWRAP_H_
|
||||
@@ -32,6 +20,7 @@
|
||||
#include <list>
|
||||
#include <deque>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
|
||||
#include "Common.h"
|
||||
#include "FileUtil.h"
|
||||
@@ -139,11 +128,17 @@ public:
|
||||
template <typename T>
|
||||
void Do(T& x)
|
||||
{
|
||||
// TODO: Bad, Do(some_non_POD) will compile and fail at runtime
|
||||
// type_traits are not fully supported everywhere yet
|
||||
// Ideally this would be std::is_trivially_copyable, but not enough support yet
|
||||
static_assert(std::is_pod<T>::value, "Only sane for POD types");
|
||||
|
||||
DoVoid((void*)&x, sizeof(x));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void DoPOD(T& x)
|
||||
{
|
||||
DoVoid((void*)&x, sizeof(x));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void DoPointer(T*& x, T* const base)
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "Common.h"
|
||||
#include "ColorUtil.h"
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#ifndef _COLORUTIL_H_
|
||||
#define _COLORUTIL_H_
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#ifndef _COMMON_H_
|
||||
#define _COMMON_H_
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#ifndef _COMMONFUNCS_H_
|
||||
#define _COMMONFUNCS_H_
|
||||
@@ -66,23 +53,26 @@ _mm_shuffle_epi8(__m128i a, __m128i mask)
|
||||
#define Crash() {asm ("int $3");}
|
||||
#endif
|
||||
#define ARRAYSIZE(A) (sizeof(A)/sizeof((A)[0]))
|
||||
|
||||
// GCC 4.8 defines all the rotate functions now
|
||||
// Small issue with GCC's lrotl/lrotr intrinsics is they are still 32bit while we require 64bit
|
||||
#ifndef _rotl
|
||||
inline u32 _rotl(u32 x, int shift) {
|
||||
shift &= 31;
|
||||
if (!shift) return x;
|
||||
return (x << shift) | (x >> (32 - shift));
|
||||
}
|
||||
|
||||
inline u64 _rotl64(u64 x, unsigned int shift){
|
||||
unsigned int n = shift % 64;
|
||||
return (x << n) | (x >> (64 - n));
|
||||
}
|
||||
|
||||
inline u32 _rotr(u32 x, int shift) {
|
||||
shift &= 31;
|
||||
if (!shift) return x;
|
||||
return (x >> shift) | (x << (32 - shift));
|
||||
}
|
||||
#endif
|
||||
|
||||
inline u64 _rotl64(u64 x, unsigned int shift){
|
||||
unsigned int n = shift % 64;
|
||||
return (x << n) | (x >> (64 - n));
|
||||
}
|
||||
|
||||
inline u64 _rotr64(u64 x, unsigned int shift){
|
||||
unsigned int n = shift % 64;
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#ifndef _COMMON_PATHS_H_
|
||||
#define _COMMON_PATHS_H_
|
||||
@@ -57,6 +44,7 @@
|
||||
DIR_SEP USERDATA_DIR DIR_SEP
|
||||
#elif defined ANDROID
|
||||
#define SYSDATA_DIR "/sdcard/dolphin-emu"
|
||||
#define SHARED_USER_DIR SYSDATA_DIR
|
||||
#else
|
||||
#ifdef DATA_DIR
|
||||
#define SYSDATA_DIR DATA_DIR "sys"
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
|
||||
// This header contains type definitions that are shared between the Dolphin core and
|
||||
|
||||
@@ -1,20 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <algorithm> // min
|
||||
#include <string> // System: To be able to add strings with "+"
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#ifndef _CONSOLELISTENER_H
|
||||
#define _CONSOLELISTENER_H
|
||||
|
||||
@@ -36,15 +36,16 @@ public:
|
||||
return (0 == m_size);
|
||||
}
|
||||
|
||||
const T& Front() const
|
||||
T& Front() const
|
||||
{
|
||||
return *m_read_ptr->current;
|
||||
}
|
||||
|
||||
void Push(const T& t)
|
||||
template <typename Arg>
|
||||
void Push(Arg&& t)
|
||||
{
|
||||
// create the element, add it to the queue
|
||||
m_write_ptr->current = new T(t);
|
||||
m_write_ptr->current = new T(std::forward<Arg>(t));
|
||||
// set the next pointer to a new element ptr
|
||||
// then advance the write pointer
|
||||
m_write_ptr = m_write_ptr->next = new ElementPtr();
|
||||
@@ -67,7 +68,7 @@ public:
|
||||
if (Empty())
|
||||
return false;
|
||||
|
||||
t = Front();
|
||||
t = std::move(Front());
|
||||
Pop();
|
||||
|
||||
return true;
|
||||
|
||||
@@ -1,19 +1,7 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "Common.h"
|
||||
#include "CommonPaths.h"
|
||||
|
||||
@@ -1,19 +1,7 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#ifndef _FILESEARCH_H_
|
||||
#define _FILESEARCH_H_
|
||||
|
||||
@@ -1,19 +1,7 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "Common.h"
|
||||
#include "CommonPaths.h"
|
||||
@@ -124,7 +112,7 @@ bool Delete(const std::string &filename)
|
||||
// being there, not the actual delete.
|
||||
if (!Exists(filename))
|
||||
{
|
||||
WARN_LOG(COMMON, "Delete: %s does not exists", filename.c_str());
|
||||
WARN_LOG(COMMON, "Delete: %s does not exist", filename.c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -216,7 +204,7 @@ bool CreateFullPath(const std::string &fullPath)
|
||||
panicCounter--;
|
||||
if (panicCounter <= 0)
|
||||
{
|
||||
ERROR_LOG(COMMON, "CreateFullPath: directory structure too deep");
|
||||
ERROR_LOG(COMMON, "CreateFullPath: directory structure is too deep");
|
||||
return false;
|
||||
}
|
||||
position++;
|
||||
@@ -324,7 +312,7 @@ bool Copy(const std::string &srcFilename, const std::string &destFilename)
|
||||
goto bail;
|
||||
}
|
||||
}
|
||||
// close flushs
|
||||
// close files
|
||||
fclose(input);
|
||||
fclose(output);
|
||||
return true;
|
||||
@@ -669,7 +657,7 @@ std::string GetSysDirectory()
|
||||
|
||||
// Returns a string with a Dolphin data dir or file in the user's home
|
||||
// directory. To be used in "multi-user" mode (that is, installed).
|
||||
std::string &GetUserPath(const unsigned int DirIDX, const std::string &newPath)
|
||||
const std::string& GetUserPath(const unsigned int DirIDX, const std::string &newPath)
|
||||
{
|
||||
static std::string paths[NUM_PATH_INDICES];
|
||||
|
||||
@@ -723,11 +711,11 @@ std::string &GetUserPath(const unsigned int DirIDX, const std::string &newPath)
|
||||
if (!newPath.empty())
|
||||
{
|
||||
if(DirIDX != D_WIIROOT_IDX)
|
||||
PanicAlert("trying to change user path other than wii root");
|
||||
PanicAlert("Trying to change user path other than Wii root");
|
||||
|
||||
if (!File::IsDirectory(newPath))
|
||||
{
|
||||
WARN_LOG(COMMON, "Invalid path specified %s, wii user path will be set to default", newPath.c_str());
|
||||
WARN_LOG(COMMON, "Invalid path specified %s, Wii user path will be set to default", newPath.c_str());
|
||||
paths[D_WIIROOT_IDX] = paths[D_USER_IDX] + WII_USER_DIR;
|
||||
}
|
||||
else
|
||||
@@ -742,6 +730,19 @@ std::string &GetUserPath(const unsigned int DirIDX, const std::string &newPath)
|
||||
return paths[DirIDX];
|
||||
}
|
||||
|
||||
std::string GetThemeDir(const std::string& theme_name)
|
||||
{
|
||||
std::string dir = File::GetUserPath(D_THEMES_IDX) + theme_name + "/";
|
||||
|
||||
#if !defined(_WIN32)
|
||||
// If theme does not exist in user's dir load from shared directory
|
||||
if (!File::Exists(dir))
|
||||
dir = SHARED_USER_DIR THEMES_DIR "/" + theme_name + "/";
|
||||
#endif
|
||||
|
||||
return dir;
|
||||
}
|
||||
|
||||
bool WriteStringToFile(bool text_file, const std::string &str, const char *filename)
|
||||
{
|
||||
return File::IOFile(filename, text_file ? "w" : "wb").WriteBytes(str.data(), str.size());
|
||||
|
||||
@@ -1,19 +1,7 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#ifndef _FILEUTIL_H_
|
||||
#define _FILEUTIL_H_
|
||||
@@ -132,7 +120,10 @@ bool SetCurrentDir(const std::string &directory);
|
||||
|
||||
// Returns a pointer to a string with a Dolphin data dir in the user's home
|
||||
// directory. To be used in "multi-user" mode (that is, installed).
|
||||
std::string &GetUserPath(const unsigned int DirIDX, const std::string &newPath="");
|
||||
const std::string& GetUserPath(const unsigned int DirIDX, const std::string &newPath="");
|
||||
|
||||
// probably doesn't belong here
|
||||
std::string GetThemeDir(const std::string& theme_name);
|
||||
|
||||
// Returns the path to where the sys file are
|
||||
std::string GetSysDirectory();
|
||||
|
||||
@@ -1,19 +1,7 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#ifndef _FIXED_SIZE_QUEUE_H_
|
||||
#define _FIXED_SIZE_QUEUE_H_
|
||||
|
||||
@@ -1,19 +1,7 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "Hash.h"
|
||||
#if _M_SSE >= 0x402
|
||||
@@ -55,7 +43,7 @@ u32 HashFletcher(const u8* data_u8, size_t length)
|
||||
|
||||
|
||||
// Implementation from Wikipedia
|
||||
// Slightly slower than Fletcher above, but slighly more reliable.
|
||||
// Slightly slower than Fletcher above, but slightly more reliable.
|
||||
#define MOD_ADLER 65521
|
||||
// data: Pointer to the data to be summed; len is in bytes
|
||||
u32 HashAdler32(const u8* data, size_t len)
|
||||
|
||||
@@ -1,19 +1,7 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#ifndef _HASH_H_
|
||||
#define _HASH_H_
|
||||
|
||||
@@ -1,19 +1,8 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// see IniFile.h
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -1,19 +1,7 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#ifndef _INIFILE_H_
|
||||
#define _INIFILE_H_
|
||||
|
||||
@@ -1,19 +1,7 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#ifndef _LINEAR_DISKCACHE
|
||||
#define _LINEAR_DISKCACHE
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#ifndef _LOG_H_
|
||||
#define _LOG_H_
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
@@ -116,6 +103,7 @@ LogManager::~LogManager()
|
||||
|
||||
delete m_fileLog;
|
||||
delete m_consoleLog;
|
||||
delete m_debuggerLog;
|
||||
}
|
||||
|
||||
void LogManager::Log(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type,
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#ifndef _LOGMANAGER_H_
|
||||
#define _LOGMANAGER_H_
|
||||
@@ -46,7 +33,7 @@ public:
|
||||
|
||||
void Log(LogTypes::LOG_LEVELS, const char *msg);
|
||||
|
||||
bool IsValid() { return (m_logfile != NULL); }
|
||||
bool IsValid() { return (bool)m_logfile; }
|
||||
bool IsEnabled() const { return m_enable; }
|
||||
void SetEnable(bool enable) { m_enable = enable; }
|
||||
|
||||
|
||||
@@ -1,19 +1,7 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "Common.h"
|
||||
#include "MathUtil.h"
|
||||
|
||||
@@ -1,19 +1,7 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#ifndef _MATH_UTIL_H_
|
||||
#define _MATH_UTIL_H_
|
||||
|
||||
@@ -1,19 +1,7 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "Common.h"
|
||||
#include "MemoryUtil.h"
|
||||
@@ -153,7 +141,12 @@ u8* MemArena::Find4GBBase()
|
||||
}
|
||||
return base;
|
||||
#else
|
||||
void* base = mmap(0, 0x31000000, PROT_NONE, MAP_ANON | MAP_PRIVATE, -1, 0);
|
||||
#ifdef ANDROID
|
||||
const u32 MemSize = 0x04000000;
|
||||
#else
|
||||
const u32 MemSize = 0x31000000;
|
||||
#endif
|
||||
void* base = mmap(0, MemSize, PROT_NONE, MAP_ANON | MAP_PRIVATE, -1, 0);
|
||||
if (base == MAP_FAILED) {
|
||||
PanicAlert("Failed to map 1 GB of memory space: %s", strerror(errno));
|
||||
return 0;
|
||||
|
||||
@@ -1,19 +1,7 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#ifndef _MEMARENA_H_
|
||||
#define _MEMARENA_H_
|
||||
@@ -25,7 +13,7 @@
|
||||
#include "Common.h"
|
||||
|
||||
// This class lets you create a block of anonymous RAM, and then arbitrarily map views into it.
|
||||
// Multiple views can mirror the same section of the block, which makes it very convient for emulating
|
||||
// Multiple views can mirror the same section of the block, which makes it very convenient for emulating
|
||||
// memory mirrors.
|
||||
|
||||
class MemArena
|
||||
|
||||
@@ -1,19 +1,7 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "Common.h"
|
||||
#include "MemoryUtil.h"
|
||||
|
||||
@@ -1,19 +1,7 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#ifndef _MEMORYUTIL_H
|
||||
#define _MEMORYUTIL_H
|
||||
|
||||
@@ -1,23 +1,11 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "Common.h"
|
||||
|
||||
#ifdef __APPLE__
|
||||
// Neither Android nor OS X support TLS
|
||||
#if defined(__APPLE__) || (ANDROID && __clang__)
|
||||
#define __thread
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,20 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <stdio.h> // System
|
||||
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#ifndef _MSGHANDLER_H_
|
||||
#define _MSGHANDLER_H_
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2010 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "CommonPaths.h"
|
||||
#include "FileUtil.h"
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2010 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#ifndef __NANDPATHS_H__
|
||||
#define __NANDPATHS_H__
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// Official Git repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "Common.h"
|
||||
|
||||
@@ -5,9 +5,26 @@
|
||||
#define GCC_VER(x,y,z) ((x) * 10000 + (y) * 100 + (z))
|
||||
#define GCC_VERSION GCC_VER(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__)
|
||||
|
||||
#ifndef __has_include
|
||||
#define __has_include(s) 0
|
||||
#endif
|
||||
|
||||
#if GCC_VERSION >= GCC_VER(4,4,0) && __GXX_EXPERIMENTAL_CXX0X__ && !ANDROID
|
||||
|
||||
// GCC 4.4 provides <condition_variable>
|
||||
#include <condition_variable>
|
||||
|
||||
#elif __has_include(<condition_variable>) && !ANDROID
|
||||
|
||||
// clang and libc++ provide <condition_variable> on OSX. However, the version
|
||||
// of libc++ bundled with OSX 10.7 and 10.8 is buggy: it uses _ as a variable.
|
||||
//
|
||||
// We work around this issue by undefining and redefining _.
|
||||
|
||||
#undef _
|
||||
#include <condition_variable>
|
||||
#define _(s) wxGetTranslation((s))
|
||||
|
||||
#else
|
||||
|
||||
// partial std::condition_variable implementation for win32/pthread
|
||||
|
||||
@@ -5,9 +5,16 @@
|
||||
#define GCC_VER(x,y,z) ((x) * 10000 + (y) * 100 + (z))
|
||||
#define GCC_VERSION GCC_VER(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__)
|
||||
|
||||
#ifndef __has_include
|
||||
#define __has_include(s) 0
|
||||
#endif
|
||||
|
||||
#if GCC_VERSION >= GCC_VER(4,4,0) && __GXX_EXPERIMENTAL_CXX0X__ && !ANDROID
|
||||
// GCC 4.4 provides <mutex>
|
||||
#include <mutex>
|
||||
#elif __has_include(<mutex>) && !ANDROID
|
||||
// Clang + libc++
|
||||
#include <mutex>
|
||||
#else
|
||||
|
||||
// partial <mutex> implementation for win32/pthread
|
||||
|
||||
@@ -5,12 +5,19 @@
|
||||
#define GCC_VER(x,y,z) ((x) * 10000 + (y) * 100 + (z))
|
||||
#define GCC_VERSION GCC_VER(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__)
|
||||
|
||||
#ifndef __has_include
|
||||
#define __has_include(s) 0
|
||||
#endif
|
||||
|
||||
#if GCC_VERSION >= GCC_VER(4,4,0) && __GXX_EXPERIMENTAL_CXX0X__ && !ANDROID
|
||||
// GCC 4.4 provides <thread>
|
||||
#ifndef _GLIBCXX_USE_SCHED_YIELD
|
||||
#define _GLIBCXX_USE_SCHED_YIELD
|
||||
#endif
|
||||
#include <thread>
|
||||
#elif __has_include(<thread>) && !ANDROID
|
||||
// Clang + libc++
|
||||
#include <thread>
|
||||
#else
|
||||
|
||||
// partial std::thread implementation for win32/pthread
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
@@ -437,8 +424,7 @@ std::string CodeToUTF8(const char* fromcode, const std::basic_string<T>& input)
|
||||
std::string result;
|
||||
|
||||
#if defined(ANDROID)
|
||||
result = "Not implemented on Android!";
|
||||
|
||||
result = (char*)input.c_str();
|
||||
#else
|
||||
iconv_t const conv_desc = iconv_open("UTF-8", fromcode);
|
||||
if ((iconv_t)-1 == conv_desc)
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#ifndef _STRINGUTIL_H_
|
||||
#define _STRINGUTIL_H_
|
||||
|
||||