mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Revert "Audit uses of IsRunning and GetState"
This reverts commit 72cf2bdb87
.
SYSCONF settings are getting cleared when they shouldn't be. Let's
revert the change until I get proper time to figure out why it's broken.
This commit is contained in:
@ -381,15 +381,9 @@ public final class NativeLibrary
|
||||
*/
|
||||
public static native boolean IsRunning();
|
||||
|
||||
/**
|
||||
* Returns true if emulation is running and not paused.
|
||||
*/
|
||||
public static native boolean IsRunningAndUnpaused();
|
||||
public static native boolean IsRunningAndStarted();
|
||||
|
||||
/**
|
||||
* Returns true if emulation is fully shut down.
|
||||
*/
|
||||
public static native boolean IsUninitialized();
|
||||
public static native boolean IsRunningAndUnpaused();
|
||||
|
||||
/**
|
||||
* Writes out the JitBlock Cache log dump
|
||||
|
@ -36,7 +36,7 @@ class Settings : Closeable {
|
||||
|
||||
if (isGameSpecific) {
|
||||
// Loading game INIs while the core is running will mess with the game INIs loaded by the core
|
||||
check(NativeLibrary.IsUninitialized()) { "Attempted to load game INI while emulating" }
|
||||
check(!NativeLibrary.IsRunning()) { "Attempted to load game INI while emulating" }
|
||||
NativeConfig.loadGameInis(gameId, revision)
|
||||
}
|
||||
}
|
||||
|
@ -20,5 +20,5 @@ class RunRunnable(
|
||||
override val setting: AbstractSetting? = null
|
||||
|
||||
override val isEditable: Boolean
|
||||
get() = worksDuringEmulation || NativeLibrary.IsUninitialized()
|
||||
get() = worksDuringEmulation || !NativeLibrary.IsRunning()
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ abstract class SettingsItem {
|
||||
|
||||
open val isEditable: Boolean
|
||||
get() {
|
||||
if (NativeLibrary.IsUninitialized()) return true
|
||||
if (!NativeLibrary.IsRunning()) return true
|
||||
val setting = setting
|
||||
return setting != null && setting.isRuntimeEditable
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ class SettingsFragmentPresenter(
|
||||
} else if (
|
||||
menuTag == MenuTag.GRAPHICS
|
||||
&& this.gameId.isNullOrEmpty()
|
||||
&& NativeLibrary.IsUninitialized()
|
||||
&& !NativeLibrary.IsRunning()
|
||||
&& GpuDriverHelper.supportsCustomDriverLoading()
|
||||
) {
|
||||
this.gpuDriver =
|
||||
@ -1303,7 +1303,7 @@ class SettingsFragmentPresenter(
|
||||
|
||||
if (
|
||||
this.gpuDriver != null && this.gameId.isNullOrEmpty()
|
||||
&& NativeLibrary.IsUninitialized()
|
||||
&& !NativeLibrary.IsRunning()
|
||||
&& GpuDriverHelper.supportsCustomDriverLoading()
|
||||
) {
|
||||
sl.add(
|
||||
|
@ -180,11 +180,11 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
|
||||
|
||||
private fun run(isActivityRecreated: Boolean) {
|
||||
if (isActivityRecreated) {
|
||||
if (NativeLibrary.IsUninitialized()) {
|
||||
loadPreviousTemporaryState = true
|
||||
} else {
|
||||
if (NativeLibrary.IsRunning()) {
|
||||
loadPreviousTemporaryState = false
|
||||
deleteFile(temporaryStateFilePath)
|
||||
} else {
|
||||
loadPreviousTemporaryState = true
|
||||
}
|
||||
} else {
|
||||
Log.debug("[EmulationFragment] activity resumed or fresh start")
|
||||
@ -203,7 +203,7 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
|
||||
|
||||
private fun runWithValidSurface() {
|
||||
runWhenSurfaceIsValid = false
|
||||
if (NativeLibrary.IsUninitialized()) {
|
||||
if (!NativeLibrary.IsRunning()) {
|
||||
NativeLibrary.SetIsBooting()
|
||||
val emulationThread = Thread({
|
||||
if (loadPreviousTemporaryState) {
|
||||
|
@ -83,7 +83,7 @@ class InputOverlay(context: Context?, attrs: AttributeSet?) : SurfaceView(contex
|
||||
|
||||
fun initTouchPointer() {
|
||||
// Check if we have all the data we need yet
|
||||
val aspectRatioAvailable = NativeLibrary.IsRunning()
|
||||
val aspectRatioAvailable = NativeLibrary.IsRunningAndStarted()
|
||||
if (!aspectRatioAvailable || surfacePosition == null)
|
||||
return
|
||||
|
||||
|
Reference in New Issue
Block a user