Merge pull request #1337 from reicast/lk/abandoned
Android: Optimization, Cleanup, and Release Prep
This commit is contained in:
commit
e138241bce
|
@ -44,7 +44,7 @@ install:
|
|||
- test -z "$encrypted_c726d225a9d9_key" || mv debug.keystore ~/.android/debug.keystore
|
||||
before_script:
|
||||
script:
|
||||
- git fetch --depth 50
|
||||
- git fetch --depth 250
|
||||
- cd shell/android-studio
|
||||
- export NUMBER_OF_PROCESSORS=2
|
||||
- sudo chmod 755 travis-build.sh
|
||||
|
|
|
@ -246,12 +246,12 @@ void Write_SB_ADST(u32 addr, u32 data)
|
|||
SB_ADSTAR+=len;
|
||||
SB_ADSTAG+=len;
|
||||
total_bytes+=len;
|
||||
SB_ADST = settings.aica.InterruptHack ? 1 : 0x00000000;//dma done
|
||||
SB_ADST = settings.aica.DelayInterrupt ? 1 : 0x00000000;//dma done
|
||||
SB_ADLEN = 0x00000000;
|
||||
|
||||
aica_pending_dma = ((total_bytes * 200000000) / 65536) + 1;
|
||||
|
||||
if (!settings.aica.InterruptHack)
|
||||
if (!settings.aica.DelayInterrupt)
|
||||
asic_RaiseInterruptWait(holly_SPU_DMA);
|
||||
}
|
||||
}
|
||||
|
@ -334,4 +334,4 @@ void aica_sb_Reset(bool Manual)
|
|||
|
||||
void aica_sb_Term()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
@ -210,7 +210,7 @@ int AicaUpdate(int tag, int c, int j)
|
|||
//aica_sample_cycles-=AICA_SAMPLE_CYCLES;
|
||||
}
|
||||
|
||||
if (settings.aica.InterruptHack)
|
||||
if (settings.aica.DelayInterrupt)
|
||||
aica_periodical(3584);
|
||||
|
||||
return AICA_TICK;
|
||||
|
|
|
@ -298,7 +298,7 @@ void LoadSettings()
|
|||
settings.aica.LimitFPS = cfgLoadInt("config", "aica.LimitFPS", 1);
|
||||
settings.aica.NoBatch = cfgLoadInt("config", "aica.NoBatch", 0);
|
||||
settings.aica.NoSound = cfgLoadInt("config", "aica.NoSound", 0);
|
||||
settings.aica.InterruptHack = cfgLoadInt("config", "aica.InterruptHack", 0);
|
||||
settings.aica.DelayInterrupt = cfgLoadInt("config", "aica.DelayInterrupt", 0);
|
||||
settings.rend.UseMipmaps = cfgLoadInt("config", "rend.UseMipmaps", 1);
|
||||
settings.rend.WideScreen = cfgLoadInt("config", "rend.WideScreen", 0);
|
||||
settings.rend.ModifierVolumes = cfgLoadInt("config", "rend.ModifierVolumes", 1);
|
||||
|
@ -358,7 +358,7 @@ void LoadCustom()
|
|||
settings.dynarec.idleskip = cfgGameInt(reios_id,"Dynarec.idleskip", settings.dynarec.idleskip ? 1 : 0) != 0;
|
||||
settings.dynarec.unstable_opt = cfgGameInt(reios_id,"Dynarec.unstable-opt", settings.dynarec.unstable_opt);
|
||||
settings.dynarec.safemode = cfgGameInt(reios_id,"Dynarec.safemode", settings.dynarec.safemode);
|
||||
settings.aica.InterruptHack = cfgLoadInt(reios_id,"aica.InterruptHack", settings.aica.InterruptHack);
|
||||
settings.aica.DelayInterrupt = cfgLoadInt(reios_id,"aica.DelayInterrupt", settings.aica.DelayInterrupt);
|
||||
settings.rend.ModifierVolumes = cfgGameInt(reios_id,"rend.ModifierVolumes", settings.rend.ModifierVolumes);
|
||||
settings.rend.Clipping = cfgGameInt(reios_id,"rend.Clipping", settings.rend.Clipping);
|
||||
|
||||
|
|
|
@ -653,7 +653,7 @@ struct settings_t
|
|||
u32 DSPEnabled; //0 -> no, 1 -> yes
|
||||
u32 NoBatch;
|
||||
u32 NoSound; //0 ->sound, 1 -> no sound
|
||||
u32 InterruptHack;
|
||||
u32 DelayInterrupt;
|
||||
} aica;
|
||||
|
||||
#if USE_OMX
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH" />
|
||||
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_SERVICE" />
|
||||
|
||||
<uses-feature
|
||||
android:glEsVersion="0x00020000"
|
||||
|
@ -45,6 +44,8 @@
|
|||
android:hardwareAccelerated="true"
|
||||
android:isGame="true">
|
||||
|
||||
<meta-data android:name="android.max_aspect" android:value="2.1" />
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:configChanges="orientation|navigation|screenSize|screenLayout|uiMode|keyboard|keyboardHidden"
|
||||
|
|
|
@ -19,7 +19,7 @@ public class Emulator extends Application {
|
|||
public static final String pref_broadcast = "dc_broadcast";
|
||||
public static final String pref_limitfps = "limit_fps";
|
||||
public static final String pref_nosound = "sound_disabled";
|
||||
public static final String pref_interrupt = "interrupt_hack";
|
||||
public static final String pref_interrupt = "delay_interrupt";
|
||||
public static final String pref_mipmaps = "use_mipmaps";
|
||||
public static final String pref_widescreen = "stretch_view";
|
||||
public static final String pref_frameskip = "frame_skip";
|
||||
|
@ -94,7 +94,7 @@ public class Emulator extends Application {
|
|||
JNIdc.limitfps(Emulator.limitfps ? 1 : 0);
|
||||
JNIdc.nobatch(Emulator.nobatch ? 1 : 0);
|
||||
JNIdc.nosound(Emulator.nosound ? 1 : 0);
|
||||
JNIdc.interrupthack(Emulator.interrupt ? 1 : 0);
|
||||
JNIdc.delayinterrupt(Emulator.interrupt ? 1 : 0);
|
||||
JNIdc.mipmaps(Emulator.mipmaps ? 1 : 0);
|
||||
JNIdc.widescreen(Emulator.widescreen ? 1 : 0);
|
||||
JNIdc.subdivide(Emulator.subdivide ? 1 : 0);
|
||||
|
@ -113,7 +113,7 @@ public class Emulator extends Application {
|
|||
JNIdc.dynarec(mPrefs.getBoolean(pref_dynarecopt, dynarecopt) ? 1 : 0);
|
||||
JNIdc.unstable(mPrefs.getBoolean(pref_unstable, unstableopt) ? 1 : 0);
|
||||
JNIdc.safemode(mPrefs.getBoolean(pref_dynsafemode, dynsafemode) ? 1 : 0);
|
||||
JNIdc.interrupthack(mPrefs.getBoolean(pref_interrupt, interrupt) ? 1 : 0);
|
||||
JNIdc.delayinterrupt(mPrefs.getBoolean(pref_interrupt, interrupt) ? 1 : 0);
|
||||
JNIdc.frameskip(mPrefs.getInt(pref_frameskip, frameskip));
|
||||
JNIdc.pvrrender(mPrefs.getBoolean(pref_pvrrender, pvrrender) ? 1 : 0);
|
||||
JNIdc.syncedrender(mPrefs.getBoolean(pref_syncedrender, syncedrender) ? 1 : 0);
|
||||
|
|
|
@ -40,7 +40,6 @@ import com.reicast.emulator.debug.GenerateLogs;
|
|||
import com.reicast.emulator.emu.JNIdc;
|
||||
import com.reicast.emulator.periph.Gamepad;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.Thread.UncaughtExceptionHandler;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -215,29 +214,10 @@ public class MainActivity extends AppCompatActivity implements
|
|||
builder.show();
|
||||
}
|
||||
|
||||
public static boolean isBiosExisting(String home_directory) {
|
||||
return new File (home_directory, "data/dc_boot.bin").exists();
|
||||
}
|
||||
|
||||
public static boolean isFlashExisting(String home_directory) {
|
||||
return new File (home_directory, "data/dc_flash.bin").exists();
|
||||
}
|
||||
|
||||
public void onGameSelected(Uri uri) {
|
||||
String home_directory = mPrefs.getString(Config.pref_home,
|
||||
Environment.getExternalStorageDirectory().getAbsolutePath());
|
||||
|
||||
if (!mPrefs.getBoolean(Emulator.pref_usereios, false)) {
|
||||
if (!isBiosExisting(home_directory)) {
|
||||
launchBIOSdetection();
|
||||
return;
|
||||
}
|
||||
if (!isFlashExisting(home_directory)) {
|
||||
launchBIOSdetection();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
JNIdc.config(home_directory);
|
||||
|
||||
Emulator.nativeact = PreferenceManager.getDefaultSharedPreferences(
|
||||
|
@ -251,28 +231,6 @@ public class MainActivity extends AppCompatActivity implements
|
|||
}
|
||||
}
|
||||
|
||||
private void launchBIOSdetection() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle(R.string.bios_selection);
|
||||
builder.setPositiveButton(R.string.browse,
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
String home_directory = mPrefs.getString(Config.pref_home,
|
||||
Environment.getExternalStorageDirectory().getAbsolutePath());
|
||||
onMainBrowseSelected(false, home_directory, false, null);
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(R.string.gdrive,
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
showToastMessage(getString(R.string.require_bios),
|
||||
Snackbar.LENGTH_SHORT);
|
||||
}
|
||||
});
|
||||
builder.create();
|
||||
builder.show();
|
||||
}
|
||||
|
||||
public void onFolderSelected(Uri uri) {
|
||||
FileBrowser browserFrag = (FileBrowser) getSupportFragmentManager()
|
||||
.findFragmentByTag("MAIN_BROWSER");
|
||||
|
@ -327,6 +285,28 @@ public class MainActivity extends AppCompatActivity implements
|
|||
setTitle(R.string.browser);
|
||||
}
|
||||
|
||||
public void launchBIOSdetection() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle(R.string.bios_selection);
|
||||
builder.setPositiveButton(R.string.browse,
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
String home_directory = mPrefs.getString(Config.pref_home,
|
||||
Environment.getExternalStorageDirectory().getAbsolutePath());
|
||||
onMainBrowseSelected(false, home_directory, false, null);
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(R.string.gdrive,
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
showToastMessage(getString(R.string.require_bios),
|
||||
Snackbar.LENGTH_SHORT);
|
||||
}
|
||||
});
|
||||
builder.create();
|
||||
builder.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfigurationChanged(Configuration newConfig) {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
|
|
|
@ -33,10 +33,12 @@ import android.widget.Spinner;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.reicast.emulator.MainActivity;
|
||||
import com.reicast.emulator.Emulator;
|
||||
import com.reicast.emulator.R;
|
||||
import com.reicast.emulator.periph.Gamepad;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class InputFragment extends Fragment {
|
||||
private static final int PERMISSION_REQUEST = 1001;
|
||||
|
||||
|
@ -90,11 +92,7 @@ public class InputFragment extends Fragment {
|
|||
}
|
||||
});
|
||||
|
||||
String home_directory = mPrefs.getString(Config.pref_home,
|
||||
Environment.getExternalStorageDirectory().getAbsolutePath());
|
||||
|
||||
if (!MainActivity.isBiosExisting(home_directory) || !MainActivity.isFlashExisting(home_directory))
|
||||
buttonLaunchEditor.setEnabled(false);
|
||||
buttonLaunchEditor.setEnabled(isBIOSAvailable());
|
||||
|
||||
final TextView duration = (TextView) getView().findViewById(R.id.vibDuration_current);
|
||||
final LinearLayout vibLay = (LinearLayout) getView().findViewById(R.id.vibDuration_layout);
|
||||
|
@ -251,6 +249,13 @@ public class InputFragment extends Fragment {
|
|||
updateVibration();
|
||||
}
|
||||
|
||||
private boolean isBIOSAvailable() {
|
||||
String home_directory = mPrefs.getString(Config.pref_home,
|
||||
Environment.getExternalStorageDirectory().getAbsolutePath());
|
||||
return new File(home_directory, "data/dc_flash.bin").exists()
|
||||
|| mPrefs.getBoolean(Emulator.pref_usereios, false);
|
||||
}
|
||||
|
||||
private void updateVibration() {
|
||||
boolean touchVibrationEnabled = mPrefs.getBoolean(Config.pref_touchvibe, true);
|
||||
switchTouchVibrationEnabled.setChecked(touchVibrationEnabled);
|
||||
|
|
|
@ -71,6 +71,7 @@ public class OptionsFragment extends Fragment {
|
|||
// Container Activity must implement this interface
|
||||
public interface OnClickListener {
|
||||
void onMainBrowseSelected(boolean browse, String path_entry, boolean games, String query);
|
||||
void launchBIOSdetection();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -141,7 +142,7 @@ public class OptionsFragment extends Fragment {
|
|||
public void onClick(View view) {
|
||||
mPrefs.edit().remove(Config.pref_home).apply();
|
||||
hideSoftKeyBoard();
|
||||
mCallback.onMainBrowseSelected(false, home_directory, false, null);
|
||||
mCallback.launchBIOSdetection();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -474,14 +475,14 @@ public class OptionsFragment extends Fragment {
|
|||
modifier_volumes.setOnCheckedChangeListener(mod_volumes);
|
||||
|
||||
CompoundButton interrupt_opt = (CompoundButton) getView().findViewById(R.id.interrupt_option);
|
||||
OnCheckedChangeListener interrupthack = new OnCheckedChangeListener() {
|
||||
OnCheckedChangeListener delayinterrupt = new OnCheckedChangeListener() {
|
||||
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
mPrefs.edit().putBoolean(Emulator.pref_interrupt, isChecked).apply();
|
||||
}
|
||||
};
|
||||
interrupt_opt.setChecked(mPrefs.getBoolean(Emulator.pref_interrupt, false));
|
||||
interrupt_opt.setOnCheckedChangeListener(interrupthack);
|
||||
interrupt_opt.setOnCheckedChangeListener(delayinterrupt);
|
||||
|
||||
// final EditText bootdiskEdit = (EditText) getView().findViewById(R.id.boot_disk);
|
||||
// String disk = Emulator.bootdisk;
|
||||
|
|
|
@ -39,7 +39,7 @@ public final class JNIdc
|
|||
public static native void limitfps(int limiter);
|
||||
public static native void nobatch(int nobatch);
|
||||
public static native void nosound(int noaudio);
|
||||
public static native void interrupthack(int interrupt);
|
||||
public static native void delayinterrupt(int delayed);
|
||||
public static native void mipmaps(int mipmaps);
|
||||
public static native void widescreen(int stretch);
|
||||
public static native void subdivide(int subdivide);
|
||||
|
|
|
@ -54,7 +54,7 @@ JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_broadcast(JNIEnv *env
|
|||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_limitfps(JNIEnv *env,jobject obj, jint limiter) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_nobatch(JNIEnv *env,jobject obj, jint nobatch) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_nosound(JNIEnv *env,jobject obj, jint noaudio) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_interrupthack(JNIEnv *env,jobject obj, jint interrupt) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_delayinterrupt(JNIEnv *env,jobject obj, jint delayed) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_mipmaps(JNIEnv *env,jobject obj, jint mipmaps) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_widescreen(JNIEnv *env,jobject obj, jint stretch) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_subdivide(JNIEnv *env,jobject obj, jint subdivide) __attribute__((visibility("default")));
|
||||
|
@ -118,9 +118,9 @@ JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_nosound(JNIEnv *env,j
|
|||
settings.aica.NoSound = noaudio;
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_interrupthack(JNIEnv *env,jobject obj, jint interrupt)
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_delayinterrupt(JNIEnv *env,jobject obj, jint delayed)
|
||||
{
|
||||
settings.aica.InterruptHack = interrupt;
|
||||
settings.aica.DelayInterrupt = delayed;
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_mipmaps(JNIEnv *env,jobject obj, jint mipmaps)
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
<string name="select_syncrender">Synchronous Rendering</string>
|
||||
<string name="select_queuerender">Force Queue Rendering</string>
|
||||
<string name="select_modvols">Enable Modifier Volumes</string>
|
||||
<string name="select_interrupt">Enable Interrupt Hack</string>
|
||||
<string name="select_interrupt">Enable Delay Interrupt</string>
|
||||
<string name="select_fps">Show On-Screen FPS</string>
|
||||
<string name="select_software">Use Software Layer</string>
|
||||
<string name="select_sound">Disable Emulator Sound</string>
|
||||
|
|
Loading…
Reference in New Issue