mirror of
https://git.citron-emu.org/citron/emulator
synced 2026-01-04 01:03:44 +00:00
chore: update project branding to Citron
Signed-off-by: Zephyron <zephyron@citron-emu.org>
This commit is contained in:
@@ -17,7 +17,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
|
||||
<application
|
||||
android:name="org.citron.citron_emu.YuzuApplication"
|
||||
android:name="org.citron.citron_emu.CitronApplication"
|
||||
android:label="@string/app_name_suffixed"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:allowBackup="true"
|
||||
@@ -36,7 +36,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
||||
<activity
|
||||
android:name="org.citron.citron_emu.ui.main.MainActivity"
|
||||
android:exported="true"
|
||||
android:theme="@style/Theme.Yuzu.Splash.Main">
|
||||
android:theme="@style/Theme.Citron.Splash.Main">
|
||||
|
||||
<!-- This intentfilter marks this Activity as the one that gets launched from Home screen. -->
|
||||
<intent-filter>
|
||||
@@ -49,12 +49,12 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
<activity
|
||||
android:name="org.citron.citron_emu.features.settings.ui.SettingsActivity"
|
||||
android:theme="@style/Theme.Yuzu.Main"
|
||||
android:theme="@style/Theme.Citron.Main"
|
||||
android:label="@string/preferences_settings"/>
|
||||
|
||||
<activity
|
||||
android:name="org.citron.citron_emu.activities.EmulationActivity"
|
||||
android:theme="@style/Theme.Yuzu.Main"
|
||||
android:theme="@style/Theme.Citron.Main"
|
||||
android:launchMode="singleTop"
|
||||
android:supportsPictureInPicture="true"
|
||||
android:configChanges="orientation|screenSize|smallestScreenSize|screenLayout|uiMode"
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.citron.citron_emu.model.GameVerificationResult
|
||||
|
||||
/**
|
||||
* Class which contains methods that interact
|
||||
* with the native side of the Yuzu code.
|
||||
* with the native side of the Citron code.
|
||||
*/
|
||||
object NativeLibrary {
|
||||
@JvmField
|
||||
@@ -42,7 +42,7 @@ object NativeLibrary {
|
||||
@JvmStatic
|
||||
fun openContentUri(path: String?, openmode: String?): Int {
|
||||
return if (DocumentsTree.isNativePath(path!!)) {
|
||||
YuzuApplication.documentsTree!!.openContentUri(path, openmode)
|
||||
CitronApplication.documentsTree!!.openContentUri(path, openmode)
|
||||
} else {
|
||||
FileUtil.openContentUri(path, openmode)
|
||||
}
|
||||
@@ -52,7 +52,7 @@ object NativeLibrary {
|
||||
@JvmStatic
|
||||
fun getSize(path: String?): Long {
|
||||
return if (DocumentsTree.isNativePath(path!!)) {
|
||||
YuzuApplication.documentsTree!!.getFileSize(path)
|
||||
CitronApplication.documentsTree!!.getFileSize(path)
|
||||
} else {
|
||||
FileUtil.getFileSize(path)
|
||||
}
|
||||
@@ -62,7 +62,7 @@ object NativeLibrary {
|
||||
@JvmStatic
|
||||
fun exists(path: String?): Boolean {
|
||||
return if (DocumentsTree.isNativePath(path!!)) {
|
||||
YuzuApplication.documentsTree!!.exists(path)
|
||||
CitronApplication.documentsTree!!.exists(path)
|
||||
} else {
|
||||
FileUtil.exists(path, suppressLog = true)
|
||||
}
|
||||
@@ -72,7 +72,7 @@ object NativeLibrary {
|
||||
@JvmStatic
|
||||
fun isDirectory(path: String?): Boolean {
|
||||
return if (DocumentsTree.isNativePath(path!!)) {
|
||||
YuzuApplication.documentsTree!!.isDirectory(path)
|
||||
CitronApplication.documentsTree!!.isDirectory(path)
|
||||
} else {
|
||||
FileUtil.isDirectory(path)
|
||||
}
|
||||
@@ -82,7 +82,7 @@ object NativeLibrary {
|
||||
@JvmStatic
|
||||
fun getParentDirectory(path: String): String =
|
||||
if (DocumentsTree.isNativePath(path)) {
|
||||
YuzuApplication.documentsTree!!.getParentDirectory(path)
|
||||
CitronApplication.documentsTree!!.getParentDirectory(path)
|
||||
} else {
|
||||
path
|
||||
}
|
||||
@@ -91,7 +91,7 @@ object NativeLibrary {
|
||||
@JvmStatic
|
||||
fun getFilename(path: String): String =
|
||||
if (DocumentsTree.isNativePath(path)) {
|
||||
YuzuApplication.documentsTree!!.getFilename(path)
|
||||
CitronApplication.documentsTree!!.getFilename(path)
|
||||
} else {
|
||||
FileUtil.getFilename(Uri.parse(path))
|
||||
}
|
||||
@@ -326,7 +326,7 @@ object NativeLibrary {
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs the Yuzu version, Android version and, CPU.
|
||||
* Logs the Citron version, Android version and, CPU.
|
||||
*/
|
||||
external fun logDeviceInfo()
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ import androidx.navigation.fragment.NavHostFragment
|
||||
import androidx.preference.PreferenceManager
|
||||
import org.citron.citron_emu.NativeLibrary
|
||||
import org.citron.citron_emu.R
|
||||
import org.citron.citron_emu.YuzuApplication
|
||||
import org.citron.citron_emu.CitronApplication
|
||||
import org.citron.citron_emu.databinding.ActivityEmulationBinding
|
||||
import org.citron.citron_emu.features.input.NativeInput
|
||||
import org.citron.citron_emu.features.settings.model.BooleanSetting
|
||||
@@ -123,7 +123,7 @@ class EmulationActivity : AppCompatActivity(), SensorEventListener {
|
||||
nfcReader = NfcReader(this)
|
||||
nfcReader.initialize()
|
||||
|
||||
val preferences = PreferenceManager.getDefaultSharedPreferences(YuzuApplication.appContext)
|
||||
val preferences = PreferenceManager.getDefaultSharedPreferences(CitronApplication.appContext)
|
||||
if (!preferences.getBoolean(Settings.PREF_MEMORY_WARNING_SHOWN, false)) {
|
||||
if (MemoryUtil.isLessThan(MemoryUtil.REQUIRED_MEMORY, MemoryUtil.totalMemory)) {
|
||||
Toast.makeText(
|
||||
|
||||
@@ -12,7 +12,7 @@ import androidx.navigation.findNavController
|
||||
import org.citron.citron_emu.HomeNavigationDirections
|
||||
import org.citron.citron_emu.NativeLibrary
|
||||
import org.citron.citron_emu.R
|
||||
import org.citron.citron_emu.YuzuApplication
|
||||
import org.citron.citron_emu.CitronApplication
|
||||
import org.citron.citron_emu.databinding.CardSimpleOutlinedBinding
|
||||
import org.citron.citron_emu.model.Applet
|
||||
import org.citron.citron_emu.model.AppletInfo
|
||||
@@ -64,7 +64,7 @@ class AppletAdapter(val activity: FragmentActivity, applets: List<Applet>) :
|
||||
|
||||
NativeLibrary.setCurrentAppletId(applet.appletInfo.appletId)
|
||||
val appletGame = Game(
|
||||
title = YuzuApplication.appContext.getString(applet.titleId),
|
||||
title = CitronApplication.appContext.getString(applet.titleId),
|
||||
path = appletPath
|
||||
)
|
||||
val action = HomeNavigationDirections.actionGlobalEmulationActivity(appletGame)
|
||||
|
||||
@@ -11,7 +11,7 @@ import androidx.navigation.fragment.findNavController
|
||||
import org.citron.citron_emu.HomeNavigationDirections
|
||||
import org.citron.citron_emu.NativeLibrary
|
||||
import org.citron.citron_emu.R
|
||||
import org.citron.citron_emu.YuzuApplication
|
||||
import org.citron.citron_emu.CitronApplication
|
||||
import org.citron.citron_emu.databinding.DialogListItemBinding
|
||||
import org.citron.citron_emu.model.CabinetMode
|
||||
import org.citron.citron_emu.adapters.CabinetLauncherDialogAdapter.CabinetModeViewHolder
|
||||
@@ -49,7 +49,7 @@ class CabinetLauncherDialogAdapter(val fragment: Fragment) :
|
||||
NativeLibrary.setCurrentAppletId(AppletInfo.Cabinet.appletId)
|
||||
NativeLibrary.setCabinetMode(mode.id)
|
||||
val appletGame = Game(
|
||||
title = YuzuApplication.appContext.getString(R.string.cabinet_applet),
|
||||
title = CitronApplication.appContext.getString(R.string.cabinet_applet),
|
||||
path = appletPath
|
||||
)
|
||||
val action = HomeNavigationDirections.actionGlobalEmulationActivity(appletGame)
|
||||
|
||||
@@ -21,7 +21,7 @@ import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import org.citron.citron_emu.HomeNavigationDirections
|
||||
import org.citron.citron_emu.R
|
||||
import org.citron.citron_emu.YuzuApplication
|
||||
import org.citron.citron_emu.CitronApplication
|
||||
import org.citron.citron_emu.databinding.CardGameBinding
|
||||
import org.citron.citron_emu.model.Game
|
||||
import org.citron.citron_emu.model.GamesViewModel
|
||||
@@ -51,12 +51,12 @@ class GameAdapter(private val activity: AppCompatActivity) :
|
||||
|
||||
fun onClick(game: Game) {
|
||||
val gameExists = DocumentFile.fromSingleUri(
|
||||
YuzuApplication.appContext,
|
||||
CitronApplication.appContext,
|
||||
Uri.parse(game.path)
|
||||
)?.exists() == true
|
||||
if (!gameExists) {
|
||||
Toast.makeText(
|
||||
YuzuApplication.appContext,
|
||||
CitronApplication.appContext,
|
||||
R.string.loader_error_file_not_found,
|
||||
Toast.LENGTH_LONG
|
||||
).show()
|
||||
@@ -66,7 +66,7 @@ class GameAdapter(private val activity: AppCompatActivity) :
|
||||
}
|
||||
|
||||
val preferences =
|
||||
PreferenceManager.getDefaultSharedPreferences(YuzuApplication.appContext)
|
||||
PreferenceManager.getDefaultSharedPreferences(CitronApplication.appContext)
|
||||
preferences.edit()
|
||||
.putLong(
|
||||
game.keyLastPlayedTime,
|
||||
@@ -77,12 +77,12 @@ class GameAdapter(private val activity: AppCompatActivity) :
|
||||
activity.lifecycleScope.launch {
|
||||
withContext(Dispatchers.IO) {
|
||||
val shortcut =
|
||||
ShortcutInfoCompat.Builder(YuzuApplication.appContext, game.path)
|
||||
ShortcutInfoCompat.Builder(CitronApplication.appContext, game.path)
|
||||
.setShortLabel(game.title)
|
||||
.setIcon(GameIconUtils.getShortcutIcon(activity, game))
|
||||
.setIntent(game.launchIntent)
|
||||
.build()
|
||||
ShortcutManagerCompat.pushDynamicShortcut(YuzuApplication.appContext, shortcut)
|
||||
ShortcutManagerCompat.pushDynamicShortcut(CitronApplication.appContext, shortcut)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import org.citron.citron_emu.utils.Log
|
||||
|
||||
fun Context.getPublicFilesDir(): File = getExternalFilesDir(null) ?: filesDir
|
||||
|
||||
class YuzuApplication : Application() {
|
||||
class CitronApplication : Application() {
|
||||
private fun createNotificationChannels() {
|
||||
val noticeChannel = NotificationChannel(
|
||||
getString(R.string.notice_notification_channel_id),
|
||||
@@ -47,7 +47,7 @@ class YuzuApplication : Application() {
|
||||
|
||||
companion object {
|
||||
var documentsTree: DocumentsTree? = null
|
||||
lateinit var application: YuzuApplication
|
||||
lateinit var application: CitronApplication
|
||||
|
||||
val appContext: Context
|
||||
get() = application.applicationContext
|
||||
|
||||
@@ -16,12 +16,12 @@ import android.webkit.MimeTypeMap
|
||||
import java.io.*
|
||||
import org.citron.citron_emu.BuildConfig
|
||||
import org.citron.citron_emu.R
|
||||
import org.citron.citron_emu.YuzuApplication
|
||||
import org.citron.citron_emu.CitronApplication
|
||||
import org.citron.citron_emu.getPublicFilesDir
|
||||
|
||||
class DocumentProvider : DocumentsProvider() {
|
||||
private val baseDirectory: File
|
||||
get() = File(YuzuApplication.application.getPublicFilesDir().canonicalPath)
|
||||
get() = File(CitronApplication.application.getPublicFilesDir().canonicalPath)
|
||||
|
||||
companion object {
|
||||
private val DEFAULT_ROOT_PROJECTION: Array<String> = arrayOf(
|
||||
|
||||
@@ -177,9 +177,9 @@ object NativeInput {
|
||||
|
||||
/**
|
||||
* Registers a controller to be used with mapping
|
||||
* @param device An [InputDevice] or the input overlay wrapped with [YuzuInputDevice]
|
||||
* @param device An [InputDevice] or the input overlay wrapped with [CitronInputDevice]
|
||||
*/
|
||||
external fun registerController(device: YuzuInputDevice)
|
||||
external fun registerController(device: CitronInputDevice)
|
||||
|
||||
/**
|
||||
* Gets the names of input devices that have been registered with the input subsystem via [registerController]
|
||||
|
||||
@@ -5,12 +5,12 @@ package org.citron.citron_emu.features.input
|
||||
|
||||
import android.view.InputDevice
|
||||
import androidx.annotation.Keep
|
||||
import org.citron.citron_emu.YuzuApplication
|
||||
import org.citron.citron_emu.CitronApplication
|
||||
import org.citron.citron_emu.R
|
||||
import org.citron.citron_emu.utils.InputHandler.getGUID
|
||||
|
||||
@Keep
|
||||
interface YuzuInputDevice {
|
||||
interface CitronInputDevice {
|
||||
fun getName(): String
|
||||
|
||||
fun getGUID(): String
|
||||
@@ -25,15 +25,15 @@ interface YuzuInputDevice {
|
||||
fun hasKeys(keys: IntArray): BooleanArray = BooleanArray(0)
|
||||
}
|
||||
|
||||
class YuzuPhysicalDevice(
|
||||
class CitronPhysicalDevice(
|
||||
private val device: InputDevice,
|
||||
private val port: Int,
|
||||
useSystemVibrator: Boolean
|
||||
) : YuzuInputDevice {
|
||||
) : CitronInputDevice {
|
||||
private val vibrator = if (useSystemVibrator) {
|
||||
YuzuVibrator.getSystemVibrator()
|
||||
CitronVibrator.getSystemVibrator()
|
||||
} else {
|
||||
YuzuVibrator.getControllerVibrator(device)
|
||||
CitronVibrator.getControllerVibrator(device)
|
||||
}
|
||||
|
||||
override fun getName(): String {
|
||||
@@ -60,14 +60,14 @@ class YuzuPhysicalDevice(
|
||||
override fun hasKeys(keys: IntArray): BooleanArray = device.hasKeys(*keys)
|
||||
}
|
||||
|
||||
class YuzuInputOverlayDevice(
|
||||
class CitronInputOverlayDevice(
|
||||
private val vibration: Boolean,
|
||||
private val port: Int
|
||||
) : YuzuInputDevice {
|
||||
private val vibrator = YuzuVibrator.getSystemVibrator()
|
||||
) : CitronInputDevice {
|
||||
private val vibrator = CitronVibrator.getSystemVibrator()
|
||||
|
||||
override fun getName(): String {
|
||||
return YuzuApplication.appContext.getString(R.string.input_overlay)
|
||||
return CitronApplication.appContext.getString(R.string.input_overlay)
|
||||
}
|
||||
|
||||
override fun getGUID(): String {
|
||||
|
||||
@@ -12,32 +12,32 @@ import android.os.VibratorManager
|
||||
import android.view.InputDevice
|
||||
import androidx.annotation.Keep
|
||||
import androidx.annotation.RequiresApi
|
||||
import org.citron.citron_emu.YuzuApplication
|
||||
import org.citron.citron_emu.CitronApplication
|
||||
|
||||
@Keep
|
||||
@Suppress("DEPRECATION")
|
||||
interface YuzuVibrator {
|
||||
interface CitronVibrator {
|
||||
fun supportsVibration(): Boolean
|
||||
|
||||
fun vibrate(intensity: Float)
|
||||
|
||||
companion object {
|
||||
fun getControllerVibrator(device: InputDevice): YuzuVibrator =
|
||||
fun getControllerVibrator(device: InputDevice): CitronVibrator =
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||
YuzuVibratorManager(device.vibratorManager)
|
||||
CitronVibratorManager(device.vibratorManager)
|
||||
} else {
|
||||
YuzuVibratorManagerCompat(device.vibrator)
|
||||
CitronVibratorManagerCompat(device.vibrator)
|
||||
}
|
||||
|
||||
fun getSystemVibrator(): YuzuVibrator =
|
||||
fun getSystemVibrator(): CitronVibrator =
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||
val vibratorManager = YuzuApplication.appContext
|
||||
val vibratorManager = CitronApplication.appContext
|
||||
.getSystemService(Context.VIBRATOR_MANAGER_SERVICE) as VibratorManager
|
||||
YuzuVibratorManager(vibratorManager)
|
||||
CitronVibratorManager(vibratorManager)
|
||||
} else {
|
||||
val vibrator = YuzuApplication.appContext
|
||||
val vibrator = CitronApplication.appContext
|
||||
.getSystemService(Context.VIBRATOR_SERVICE) as Vibrator
|
||||
YuzuVibratorManagerCompat(vibrator)
|
||||
CitronVibratorManagerCompat(vibrator)
|
||||
}
|
||||
|
||||
fun getVibrationEffect(intensity: Float): VibrationEffect? {
|
||||
@@ -53,24 +53,24 @@ interface YuzuVibrator {
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.S)
|
||||
class YuzuVibratorManager(private val vibratorManager: VibratorManager) : YuzuVibrator {
|
||||
class CitronVibratorManager(private val vibratorManager: VibratorManager) : CitronVibrator {
|
||||
override fun supportsVibration(): Boolean {
|
||||
return vibratorManager.vibratorIds.isNotEmpty()
|
||||
}
|
||||
|
||||
override fun vibrate(intensity: Float) {
|
||||
val vibration = YuzuVibrator.getVibrationEffect(intensity) ?: return
|
||||
val vibration = CitronVibrator.getVibrationEffect(intensity) ?: return
|
||||
vibratorManager.vibrate(CombinedVibration.createParallel(vibration))
|
||||
}
|
||||
}
|
||||
|
||||
class YuzuVibratorManagerCompat(private val vibrator: Vibrator) : YuzuVibrator {
|
||||
class CitronVibratorManagerCompat(private val vibrator: Vibrator) : CitronVibrator {
|
||||
override fun supportsVibration(): Boolean {
|
||||
return vibrator.hasVibrator()
|
||||
}
|
||||
|
||||
override fun vibrate(intensity: Float) {
|
||||
val vibration = YuzuVibrator.getVibrationEffect(intensity) ?: return
|
||||
val vibration = CitronVibrator.getVibrationEffect(intensity) ?: return
|
||||
vibrator.vibrate(vibration)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
package org.citron.citron_emu.features.settings.model
|
||||
|
||||
import org.citron.citron_emu.R
|
||||
import org.citron.citron_emu.YuzuApplication
|
||||
import org.citron.citron_emu.CitronApplication
|
||||
|
||||
object Settings {
|
||||
enum class MenuTag(val titleId: Int = 0) {
|
||||
@@ -26,7 +26,7 @@ object Settings {
|
||||
}
|
||||
|
||||
fun getPlayerString(player: Int): String =
|
||||
YuzuApplication.appContext.getString(R.string.preferences_player, player)
|
||||
CitronApplication.appContext.getString(R.string.preferences_player, player)
|
||||
|
||||
const val PREF_FIRST_APP_LAUNCH = "FirstApplicationLaunch"
|
||||
const val PREF_MEMORY_WARNING_SHOWN = "MemoryWarningShown"
|
||||
|
||||
@@ -5,7 +5,7 @@ package org.citron.citron_emu.features.settings.model.view
|
||||
|
||||
import androidx.annotation.StringRes
|
||||
import org.citron.citron_emu.R
|
||||
import org.citron.citron_emu.YuzuApplication
|
||||
import org.citron.citron_emu.CitronApplication
|
||||
import org.citron.citron_emu.features.input.NativeInput
|
||||
import org.citron.citron_emu.features.input.model.ButtonName
|
||||
import org.citron.citron_emu.features.input.model.InputType
|
||||
@@ -19,7 +19,7 @@ sealed class InputSetting(
|
||||
abstract val inputType: InputType
|
||||
abstract val playerIndex: Int
|
||||
|
||||
protected val context get() = YuzuApplication.appContext
|
||||
protected val context get() = CitronApplication.appContext
|
||||
|
||||
abstract fun getSelectedValue(): String
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ package org.citron.citron_emu.features.settings.model.view
|
||||
import androidx.annotation.StringRes
|
||||
import org.citron.citron_emu.NativeLibrary
|
||||
import org.citron.citron_emu.R
|
||||
import org.citron.citron_emu.YuzuApplication
|
||||
import org.citron.citron_emu.CitronApplication
|
||||
import org.citron.citron_emu.features.input.NativeInput
|
||||
import org.citron.citron_emu.features.input.model.NpadStyleIndex
|
||||
import org.citron.citron_emu.features.settings.model.AbstractBooleanSetting
|
||||
@@ -37,14 +37,14 @@ abstract class SettingsItem(
|
||||
|
||||
val title: String by lazy {
|
||||
if (titleId != 0) {
|
||||
return@lazy YuzuApplication.appContext.getString(titleId)
|
||||
return@lazy CitronApplication.appContext.getString(titleId)
|
||||
}
|
||||
return@lazy titleString
|
||||
}
|
||||
|
||||
val description: String by lazy {
|
||||
if (descriptionId != 0) {
|
||||
return@lazy YuzuApplication.appContext.getString(descriptionId)
|
||||
return@lazy CitronApplication.appContext.getString(descriptionId)
|
||||
}
|
||||
return@lazy descriptionString
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ package org.citron.citron_emu.features.settings.ui
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import org.citron.citron_emu.YuzuApplication
|
||||
import org.citron.citron_emu.CitronApplication
|
||||
import org.citron.citron_emu.adapters.AbstractListAdapter
|
||||
import org.citron.citron_emu.databinding.ListItemInputProfileBinding
|
||||
import org.citron.citron_emu.viewholder.AbstractViewHolder
|
||||
@@ -57,7 +57,7 @@ sealed interface ProfileItem {
|
||||
data class NewProfileItem(
|
||||
val createNewProfile: () -> Unit
|
||||
) : ProfileItem {
|
||||
override val name: String = YuzuApplication.appContext.getString(R.string.create_new_profile)
|
||||
override val name: String = CitronApplication.appContext.getString(R.string.create_new_profile)
|
||||
}
|
||||
|
||||
data class ExistingProfileItem(
|
||||
|
||||
@@ -8,7 +8,7 @@ import android.os.Build
|
||||
import android.widget.Toast
|
||||
import org.citron.citron_emu.NativeLibrary
|
||||
import org.citron.citron_emu.R
|
||||
import org.citron.citron_emu.YuzuApplication
|
||||
import org.citron.citron_emu.CitronApplication
|
||||
import org.citron.citron_emu.features.input.NativeInput
|
||||
import org.citron.citron_emu.features.input.model.AnalogDirection
|
||||
import org.citron.citron_emu.features.input.model.NativeAnalog
|
||||
@@ -35,7 +35,7 @@ class SettingsFragmentPresenter(
|
||||
) {
|
||||
private var settingsList = ArrayList<SettingsItem>()
|
||||
|
||||
private val context get() = YuzuApplication.appContext
|
||||
private val context get() = CitronApplication.appContext
|
||||
|
||||
// Extension for altering settings list based on each setting's properties
|
||||
fun ArrayList<SettingsItem>.add(key: String) {
|
||||
|
||||
@@ -8,7 +8,7 @@ import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
import kotlinx.coroutines.flow.asStateFlow
|
||||
import org.citron.citron_emu.R
|
||||
import org.citron.citron_emu.YuzuApplication
|
||||
import org.citron.citron_emu.CitronApplication
|
||||
import org.citron.citron_emu.features.settings.model.view.SettingsItem
|
||||
import org.citron.citron_emu.model.Game
|
||||
import org.citron.citron_emu.utils.InputHandler
|
||||
@@ -73,7 +73,7 @@ class SettingsViewModel : ViewModel() {
|
||||
fun setSliderTextValue(value: Float, units: String) {
|
||||
_sliderProgress.value = value.toInt()
|
||||
_sliderTextValue.value = String.format(
|
||||
YuzuApplication.appContext.getString(R.string.value_with_units),
|
||||
CitronApplication.appContext.getString(R.string.value_with_units),
|
||||
value.toInt().toString(),
|
||||
units
|
||||
)
|
||||
|
||||
@@ -11,7 +11,7 @@ import androidx.fragment.app.activityViewModels
|
||||
import androidx.preference.PreferenceManager
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import org.citron.citron_emu.R
|
||||
import org.citron.citron_emu.YuzuApplication
|
||||
import org.citron.citron_emu.CitronApplication
|
||||
import org.citron.citron_emu.model.AddonViewModel
|
||||
import org.citron.citron_emu.ui.main.MainActivity
|
||||
|
||||
@@ -19,7 +19,7 @@ class ContentTypeSelectionDialogFragment : DialogFragment() {
|
||||
private val addonViewModel: AddonViewModel by activityViewModels()
|
||||
|
||||
private val preferences get() =
|
||||
PreferenceManager.getDefaultSharedPreferences(YuzuApplication.appContext)
|
||||
PreferenceManager.getDefaultSharedPreferences(CitronApplication.appContext)
|
||||
|
||||
private var selectedItem = 0
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import org.citron.citron_emu.HomeNavigationDirections
|
||||
import org.citron.citron_emu.R
|
||||
import org.citron.citron_emu.YuzuApplication
|
||||
import org.citron.citron_emu.CitronApplication
|
||||
import org.citron.citron_emu.adapters.GamePropertiesAdapter
|
||||
import org.citron.citron_emu.databinding.FragmentGamePropertiesBinding
|
||||
import org.citron.citron_emu.features.settings.model.Settings
|
||||
@@ -224,7 +224,7 @@ class GamePropertiesFragment : Fragment() {
|
||||
negativeAction = {
|
||||
File(args.game.saveDir).deleteRecursively()
|
||||
Toast.makeText(
|
||||
YuzuApplication.appContext,
|
||||
CitronApplication.appContext,
|
||||
R.string.save_data_deleted_successfully,
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
@@ -263,7 +263,7 @@ class GamePropertiesFragment : Fragment() {
|
||||
positiveAction = {
|
||||
shaderCacheDir.deleteRecursively()
|
||||
Toast.makeText(
|
||||
YuzuApplication.appContext,
|
||||
CitronApplication.appContext,
|
||||
R.string.cleared_shaders_successfully,
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
@@ -374,7 +374,7 @@ class GamePropertiesFragment : Fragment() {
|
||||
return@withContext
|
||||
}
|
||||
Toast.makeText(
|
||||
YuzuApplication.appContext,
|
||||
CitronApplication.appContext,
|
||||
getString(R.string.save_file_imported_success),
|
||||
Toast.LENGTH_LONG
|
||||
).show()
|
||||
@@ -384,7 +384,7 @@ class GamePropertiesFragment : Fragment() {
|
||||
cacheSaveDir.deleteRecursively()
|
||||
} catch (e: Exception) {
|
||||
Toast.makeText(
|
||||
YuzuApplication.appContext,
|
||||
CitronApplication.appContext,
|
||||
getString(R.string.fatal_error),
|
||||
Toast.LENGTH_LONG
|
||||
).show()
|
||||
|
||||
@@ -31,7 +31,7 @@ import org.citron.citron_emu.BuildConfig
|
||||
import org.citron.citron_emu.HomeNavigationDirections
|
||||
import org.citron.citron_emu.NativeLibrary
|
||||
import org.citron.citron_emu.R
|
||||
import org.citron.citron_emu.YuzuApplication
|
||||
import org.citron.citron_emu.CitronApplication
|
||||
import org.citron.citron_emu.adapters.HomeSettingAdapter
|
||||
import org.citron.citron_emu.databinding.FragmentHomeSettingsBinding
|
||||
import org.citron.citron_emu.features.DocumentProvider
|
||||
@@ -180,7 +180,7 @@ class HomeSettingsFragment : Fragment() {
|
||||
)
|
||||
} else {
|
||||
val failedNames = result.joinToString("\n")
|
||||
val errorMessage = YuzuApplication.appContext.getString(
|
||||
val errorMessage = CitronApplication.appContext.getString(
|
||||
R.string.verification_failed_for,
|
||||
failedNames
|
||||
)
|
||||
|
||||
@@ -22,7 +22,7 @@ import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import org.citron.citron_emu.NativeLibrary
|
||||
import org.citron.citron_emu.R
|
||||
import org.citron.citron_emu.YuzuApplication
|
||||
import org.citron.citron_emu.CitronApplication
|
||||
import org.citron.citron_emu.adapters.InstallableAdapter
|
||||
import org.citron.citron_emu.databinding.FragmentInstallablesBinding
|
||||
import org.citron.citron_emu.model.HomeViewModel
|
||||
@@ -109,7 +109,7 @@ class InstallableFragment : Fragment() {
|
||||
)
|
||||
if (!oldSaveDataFolder.exists() && !futureSaveDataFolder.exists()) {
|
||||
Toast.makeText(
|
||||
YuzuApplication.appContext,
|
||||
CitronApplication.appContext,
|
||||
R.string.no_save_data_found,
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
@@ -262,7 +262,7 @@ class InstallableFragment : Fragment() {
|
||||
cacheSaveDir.deleteRecursively()
|
||||
} catch (e: Exception) {
|
||||
Toast.makeText(
|
||||
YuzuApplication.appContext,
|
||||
CitronApplication.appContext,
|
||||
getString(R.string.fatal_error),
|
||||
Toast.LENGTH_LONG
|
||||
).show()
|
||||
|
||||
@@ -22,7 +22,7 @@ import info.debatty.java.stringsimilarity.Jaccard
|
||||
import info.debatty.java.stringsimilarity.JaroWinkler
|
||||
import java.util.Locale
|
||||
import org.citron.citron_emu.R
|
||||
import org.citron.citron_emu.YuzuApplication
|
||||
import org.citron.citron_emu.CitronApplication
|
||||
import org.citron.citron_emu.adapters.GameAdapter
|
||||
import org.citron.citron_emu.databinding.FragmentSearchBinding
|
||||
import org.citron.citron_emu.layout.AutofitGridLayoutManager
|
||||
@@ -58,7 +58,7 @@ class SearchFragment : Fragment() {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
homeViewModel.setNavigationVisibility(visible = true, animated = true)
|
||||
homeViewModel.setStatusBarShadeVisibility(true)
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(YuzuApplication.appContext)
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(CitronApplication.appContext)
|
||||
|
||||
if (savedInstanceState != null) {
|
||||
binding.searchText.setText(savedInstanceState.getString(SEARCH_TEXT))
|
||||
|
||||
@@ -30,7 +30,7 @@ import kotlinx.coroutines.launch
|
||||
import org.citron.citron_emu.NativeLibrary
|
||||
import java.io.File
|
||||
import org.citron.citron_emu.R
|
||||
import org.citron.citron_emu.YuzuApplication
|
||||
import org.citron.citron_emu.CitronApplication
|
||||
import org.citron.citron_emu.adapters.SetupAdapter
|
||||
import org.citron.citron_emu.databinding.FragmentSetupBinding
|
||||
import org.citron.citron_emu.features.settings.model.Settings
|
||||
@@ -343,7 +343,7 @@ class SetupFragment : Fragment() {
|
||||
}
|
||||
|
||||
private fun finishSetup() {
|
||||
PreferenceManager.getDefaultSharedPreferences(YuzuApplication.appContext).edit()
|
||||
PreferenceManager.getDefaultSharedPreferences(CitronApplication.appContext).edit()
|
||||
.putBoolean(Settings.PREF_FIRST_APP_LAUNCH, false)
|
||||
.apply()
|
||||
mainActivity.finishSetup(binding.root.findNavController())
|
||||
|
||||
@@ -15,7 +15,7 @@ import kotlinx.coroutines.flow.stateIn
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import org.citron.citron_emu.R
|
||||
import org.citron.citron_emu.YuzuApplication
|
||||
import org.citron.citron_emu.CitronApplication
|
||||
import org.citron.citron_emu.features.settings.model.StringSetting
|
||||
import org.citron.citron_emu.features.settings.utils.SettingsFile
|
||||
import org.citron.citron_emu.model.Driver.Companion.toDriver
|
||||
@@ -70,7 +70,7 @@ class DriverViewModel : ViewModel() {
|
||||
val newDriverList = mutableListOf(
|
||||
Driver(
|
||||
selectedDriver == GpuDriverMetadata(),
|
||||
YuzuApplication.appContext.getString(R.string.system_gpu_driver),
|
||||
CitronApplication.appContext.getString(R.string.system_gpu_driver),
|
||||
systemDriverData?.get(0) ?: "",
|
||||
systemDriverData?.get(1) ?: ""
|
||||
)
|
||||
@@ -186,7 +186,7 @@ class DriverViewModel : ViewModel() {
|
||||
|
||||
private fun updateName() {
|
||||
_selectedDriverTitle.value = GpuDriverHelper.customDriverSettingData.name
|
||||
?: YuzuApplication.appContext.getString(R.string.system_gpu_driver)
|
||||
?: CitronApplication.appContext.getString(R.string.system_gpu_driver)
|
||||
}
|
||||
|
||||
private fun setDriverReady() {
|
||||
|
||||
@@ -11,7 +11,7 @@ import kotlinx.parcelize.Parcelize
|
||||
import kotlinx.serialization.Serializable
|
||||
import org.citron.citron_emu.NativeLibrary
|
||||
import org.citron.citron_emu.R
|
||||
import org.citron.citron_emu.YuzuApplication
|
||||
import org.citron.citron_emu.CitronApplication
|
||||
import org.citron.citron_emu.activities.EmulationActivity
|
||||
import org.citron.citron_emu.utils.DirectoryInitialization
|
||||
import org.citron.citron_emu.utils.FileUtil
|
||||
@@ -52,7 +52,7 @@ class Game(
|
||||
}
|
||||
|
||||
val saveZipName: String
|
||||
get() = "$title ${YuzuApplication.appContext.getString(R.string.save_data).lowercase()} - ${
|
||||
get() = "$title ${CitronApplication.appContext.getString(R.string.save_data).lowercase()} - ${
|
||||
LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"))
|
||||
}.zip"
|
||||
|
||||
@@ -64,7 +64,7 @@ class Game(
|
||||
get() = DirectoryInitialization.userDirectory + "/load/" + programIdHex + "/"
|
||||
|
||||
val launchIntent: Intent
|
||||
get() = Intent(YuzuApplication.appContext, EmulationActivity::class.java).apply {
|
||||
get() = Intent(CitronApplication.appContext, EmulationActivity::class.java).apply {
|
||||
action = Intent.ACTION_VIEW
|
||||
data = Uri.parse(path)
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ import kotlinx.coroutines.withContext
|
||||
import kotlinx.serialization.decodeFromString
|
||||
import kotlinx.serialization.json.Json
|
||||
import org.citron.citron_emu.NativeLibrary
|
||||
import org.citron.citron_emu.YuzuApplication
|
||||
import org.citron.citron_emu.CitronApplication
|
||||
import org.citron.citron_emu.utils.GameHelper
|
||||
import org.citron.citron_emu.utils.NativeConfig
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
@@ -94,7 +94,7 @@ class GamesViewModel : ViewModel() {
|
||||
if (firstStartup) {
|
||||
// Retrieve list of cached games
|
||||
val storedGames =
|
||||
PreferenceManager.getDefaultSharedPreferences(YuzuApplication.appContext)
|
||||
PreferenceManager.getDefaultSharedPreferences(CitronApplication.appContext)
|
||||
.getStringSet(GameHelper.KEY_GAMES, emptySet())
|
||||
if (storedGames!!.isNotEmpty()) {
|
||||
val deserializedGames = mutableSetOf<Game>()
|
||||
@@ -109,7 +109,7 @@ class GamesViewModel : ViewModel() {
|
||||
|
||||
val gameExists =
|
||||
DocumentFile.fromSingleUri(
|
||||
YuzuApplication.appContext,
|
||||
CitronApplication.appContext,
|
||||
Uri.parse(game.path)
|
||||
)?.exists()
|
||||
if (gameExists == true) {
|
||||
|
||||
@@ -5,7 +5,7 @@ package org.citron.citron_emu.overlay.model
|
||||
|
||||
import androidx.annotation.IntegerRes
|
||||
import org.citron.citron_emu.R
|
||||
import org.citron.citron_emu.YuzuApplication
|
||||
import org.citron.citron_emu.CitronApplication
|
||||
|
||||
enum class OverlayControl(
|
||||
val id: String,
|
||||
@@ -136,7 +136,7 @@ enum class OverlayControl(
|
||||
|
||||
fun getDefaultPositionForLayout(layout: OverlayLayout): Pair<Double, Double> {
|
||||
val rawResourcePair: Pair<Int, Int>
|
||||
YuzuApplication.appContext.resources.apply {
|
||||
CitronApplication.appContext.resources.apply {
|
||||
rawResourcePair = when (layout) {
|
||||
OverlayLayout.Landscape -> {
|
||||
Pair(
|
||||
|
||||
@@ -642,18 +642,18 @@ class MainActivity : AppCompatActivity(), ThemeProvider {
|
||||
) { progressCallback, _ ->
|
||||
val checkStream =
|
||||
ZipInputStream(BufferedInputStream(contentResolver.openInputStream(result)))
|
||||
var isYuzuBackup = false
|
||||
var isCitronBackup = false
|
||||
checkStream.use { stream ->
|
||||
var ze: ZipEntry? = null
|
||||
while (stream.nextEntry?.also { ze = it } != null) {
|
||||
val itemName = ze!!.name.trim()
|
||||
if (itemName == "/config/config.ini" || itemName == "config/config.ini") {
|
||||
isYuzuBackup = true
|
||||
isCitronBackup = true
|
||||
return@use
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!isYuzuBackup) {
|
||||
if (!isCitronBackup) {
|
||||
return@newInstance MessageDialogFragment.newInstance(
|
||||
this,
|
||||
titleId = R.string.invalid_citron_backup,
|
||||
|
||||
@@ -6,7 +6,7 @@ package org.citron.citron_emu.utils
|
||||
import androidx.preference.PreferenceManager
|
||||
import java.io.IOException
|
||||
import org.citron.citron_emu.NativeLibrary
|
||||
import org.citron.citron_emu.YuzuApplication
|
||||
import org.citron.citron_emu.CitronApplication
|
||||
import org.citron.citron_emu.features.settings.model.BooleanSetting
|
||||
import org.citron.citron_emu.features.settings.model.IntSetting
|
||||
import org.citron.citron_emu.features.settings.model.Settings
|
||||
@@ -38,7 +38,7 @@ object DirectoryInitialization {
|
||||
|
||||
private fun initializeInternalStorage() {
|
||||
try {
|
||||
userPath = YuzuApplication.appContext.getExternalFilesDir(null)!!.canonicalPath
|
||||
userPath = CitronApplication.appContext.getExternalFilesDir(null)!!.canonicalPath
|
||||
NativeLibrary.setAppDirectory(userPath!!)
|
||||
} catch (e: IOException) {
|
||||
e.printStackTrace()
|
||||
@@ -46,7 +46,7 @@ object DirectoryInitialization {
|
||||
}
|
||||
|
||||
private fun migrateSettings() {
|
||||
val preferences = PreferenceManager.getDefaultSharedPreferences(YuzuApplication.appContext)
|
||||
val preferences = PreferenceManager.getDefaultSharedPreferences(CitronApplication.appContext)
|
||||
var saveConfig = false
|
||||
val theme = preferences.migratePreference<Int>(Settings.PREF_THEME)
|
||||
if (theme != null) {
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.io.InputStream
|
||||
import java.net.URLDecoder
|
||||
import java.util.zip.ZipEntry
|
||||
import java.util.zip.ZipInputStream
|
||||
import org.citron.citron_emu.YuzuApplication
|
||||
import org.citron.citron_emu.CitronApplication
|
||||
import org.citron.citron_emu.model.MinimalDocumentFile
|
||||
import org.citron.citron_emu.model.TaskState
|
||||
import java.io.BufferedOutputStream
|
||||
@@ -31,7 +31,7 @@ object FileUtil {
|
||||
const val APPLICATION_OCTET_STREAM = "application/octet-stream"
|
||||
const val TEXT_PLAIN = "text/plain"
|
||||
|
||||
private val context get() = YuzuApplication.appContext
|
||||
private val context get() = CitronApplication.appContext
|
||||
|
||||
/**
|
||||
* Create a file from directory with filename.
|
||||
@@ -195,7 +195,7 @@ object FileUtil {
|
||||
* @return String display name
|
||||
*/
|
||||
fun getFilename(uri: Uri): String {
|
||||
val resolver = YuzuApplication.appContext.contentResolver
|
||||
val resolver = CitronApplication.appContext.contentResolver
|
||||
val columns = arrayOf(
|
||||
DocumentsContract.Document.COLUMN_DISPLAY_NAME
|
||||
)
|
||||
@@ -408,10 +408,10 @@ object FileUtil {
|
||||
val newFile = File(file, it.name!!)
|
||||
if (it.isDirectory) {
|
||||
newFile.mkdirs()
|
||||
DocumentFile.fromTreeUri(YuzuApplication.appContext, it.uri)?.copyFilesTo(newFile)
|
||||
DocumentFile.fromTreeUri(CitronApplication.appContext, it.uri)?.copyFilesTo(newFile)
|
||||
} else {
|
||||
val inputStream =
|
||||
YuzuApplication.appContext.contentResolver.openInputStream(it.uri)
|
||||
CitronApplication.appContext.contentResolver.openInputStream(it.uri)
|
||||
BufferedInputStream(inputStream).use { bos ->
|
||||
if (!newFile.exists()) {
|
||||
newFile.createNewFile()
|
||||
@@ -487,17 +487,17 @@ object FileUtil {
|
||||
String(stream.readBytes(), StandardCharsets.UTF_8)
|
||||
|
||||
fun DocumentFile.inputStream(): InputStream =
|
||||
YuzuApplication.appContext.contentResolver.openInputStream(uri)!!
|
||||
CitronApplication.appContext.contentResolver.openInputStream(uri)!!
|
||||
|
||||
fun DocumentFile.outputStream(): OutputStream =
|
||||
YuzuApplication.appContext.contentResolver.openOutputStream(uri)!!
|
||||
CitronApplication.appContext.contentResolver.openOutputStream(uri)!!
|
||||
|
||||
fun Uri.inputStream(): InputStream =
|
||||
YuzuApplication.appContext.contentResolver.openInputStream(this)!!
|
||||
CitronApplication.appContext.contentResolver.openInputStream(this)!!
|
||||
|
||||
fun Uri.outputStream(): OutputStream =
|
||||
YuzuApplication.appContext.contentResolver.openOutputStream(this)!!
|
||||
CitronApplication.appContext.contentResolver.openOutputStream(this)!!
|
||||
|
||||
fun Uri.asDocumentFile(): DocumentFile? =
|
||||
DocumentFile.fromSingleUri(YuzuApplication.appContext, this)
|
||||
DocumentFile.fromSingleUri(CitronApplication.appContext, this)
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import androidx.preference.PreferenceManager
|
||||
import kotlinx.serialization.encodeToString
|
||||
import kotlinx.serialization.json.Json
|
||||
import org.citron.citron_emu.NativeLibrary
|
||||
import org.citron.citron_emu.YuzuApplication
|
||||
import org.citron.citron_emu.CitronApplication
|
||||
import org.citron.citron_emu.model.Game
|
||||
import org.citron.citron_emu.model.GameDir
|
||||
import org.citron.citron_emu.model.MinimalDocumentFile
|
||||
@@ -22,7 +22,7 @@ object GameHelper {
|
||||
|
||||
fun getGames(): List<Game> {
|
||||
val games = mutableListOf<Game>()
|
||||
val context = YuzuApplication.appContext
|
||||
val context = CitronApplication.appContext
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
|
||||
val gameDirs = mutableListOf<GameDir>()
|
||||
|
||||
@@ -22,7 +22,7 @@ import coil.memory.MemoryCache
|
||||
import coil.request.ImageRequest
|
||||
import coil.request.Options
|
||||
import org.citron.citron_emu.R
|
||||
import org.citron.citron_emu.YuzuApplication
|
||||
import org.citron.citron_emu.CitronApplication
|
||||
import org.citron.citron_emu.model.Game
|
||||
|
||||
class GameIconFetcher(
|
||||
@@ -58,20 +58,20 @@ class GameIconKeyer : Keyer<Game> {
|
||||
}
|
||||
|
||||
object GameIconUtils {
|
||||
private val imageLoader = ImageLoader.Builder(YuzuApplication.appContext)
|
||||
private val imageLoader = ImageLoader.Builder(CitronApplication.appContext)
|
||||
.components {
|
||||
add(GameIconKeyer())
|
||||
add(GameIconFetcher.Factory())
|
||||
}
|
||||
.memoryCache {
|
||||
MemoryCache.Builder(YuzuApplication.appContext)
|
||||
MemoryCache.Builder(CitronApplication.appContext)
|
||||
.maxSizePercent(0.25)
|
||||
.build()
|
||||
}
|
||||
.build()
|
||||
|
||||
fun loadGameIcon(game: Game, imageView: ImageView) {
|
||||
val request = ImageRequest.Builder(YuzuApplication.appContext)
|
||||
val request = ImageRequest.Builder(CitronApplication.appContext)
|
||||
.data(game)
|
||||
.target(imageView)
|
||||
.error(R.drawable.default_icon)
|
||||
@@ -80,7 +80,7 @@ object GameIconUtils {
|
||||
}
|
||||
|
||||
suspend fun getGameIcon(lifecycleOwner: LifecycleOwner, game: Game): Bitmap {
|
||||
val request = ImageRequest.Builder(YuzuApplication.appContext)
|
||||
val request = ImageRequest.Builder(CitronApplication.appContext)
|
||||
.data(game)
|
||||
.lifecycle(lifecycleOwner)
|
||||
.error(R.drawable.default_icon)
|
||||
@@ -91,15 +91,15 @@ object GameIconUtils {
|
||||
|
||||
suspend fun getShortcutIcon(lifecycleOwner: LifecycleOwner, game: Game): IconCompat {
|
||||
val layerDrawable = ResourcesCompat.getDrawable(
|
||||
YuzuApplication.appContext.resources,
|
||||
CitronApplication.appContext.resources,
|
||||
R.drawable.shortcut,
|
||||
null
|
||||
) as LayerDrawable
|
||||
layerDrawable.setDrawableByLayerId(
|
||||
R.id.shortcut_foreground,
|
||||
getGameIcon(lifecycleOwner, game).toDrawable(YuzuApplication.appContext.resources)
|
||||
getGameIcon(lifecycleOwner, game).toDrawable(CitronApplication.appContext.resources)
|
||||
)
|
||||
val inset = YuzuApplication.appContext.resources
|
||||
val inset = CitronApplication.appContext.resources
|
||||
.getDimensionPixelSize(R.dimen.icon_inset)
|
||||
layerDrawable.setLayerInset(1, inset, inset, inset, inset)
|
||||
return IconCompat.createWithAdaptiveBitmap(
|
||||
|
||||
@@ -10,7 +10,7 @@ import android.view.Surface
|
||||
import java.io.File
|
||||
import java.io.IOException
|
||||
import org.citron.citron_emu.NativeLibrary
|
||||
import org.citron.citron_emu.YuzuApplication
|
||||
import org.citron.citron_emu.CitronApplication
|
||||
import org.citron.citron_emu.features.settings.model.StringSetting
|
||||
import java.io.FileNotFoundException
|
||||
import java.util.zip.ZipException
|
||||
@@ -27,11 +27,11 @@ object GpuDriverHelper {
|
||||
fun initializeDriverParameters() {
|
||||
try {
|
||||
// Initialize the file redirection directory.
|
||||
fileRedirectionPath = YuzuApplication.appContext
|
||||
fileRedirectionPath = CitronApplication.appContext
|
||||
.getExternalFilesDir(null)!!.canonicalPath + "/gpu/vk_file_redirect/"
|
||||
|
||||
// Initialize the driver installation directory.
|
||||
driverInstallationPath = YuzuApplication.appContext
|
||||
driverInstallationPath = CitronApplication.appContext
|
||||
.filesDir.canonicalPath + "/gpu_driver/"
|
||||
} catch (e: IOException) {
|
||||
throw RuntimeException(e)
|
||||
@@ -41,7 +41,7 @@ object GpuDriverHelper {
|
||||
initializeDirectories()
|
||||
|
||||
// Initialize hook libraries directory.
|
||||
hookLibPath = YuzuApplication.appContext.applicationInfo.nativeLibraryDir + "/"
|
||||
hookLibPath = CitronApplication.appContext.applicationInfo.nativeLibraryDir + "/"
|
||||
|
||||
// Initialize GPU driver.
|
||||
NativeLibrary.initializeGpuDriver(
|
||||
|
||||
@@ -7,11 +7,11 @@ import android.view.InputDevice
|
||||
import android.view.KeyEvent
|
||||
import android.view.MotionEvent
|
||||
import org.citron.citron_emu.features.input.NativeInput
|
||||
import org.citron.citron_emu.features.input.YuzuInputOverlayDevice
|
||||
import org.citron.citron_emu.features.input.YuzuPhysicalDevice
|
||||
import org.citron.citron_emu.features.input.CitronInputOverlayDevice
|
||||
import org.citron.citron_emu.features.input.CitronPhysicalDevice
|
||||
|
||||
object InputHandler {
|
||||
var androidControllers = mapOf<Int, YuzuPhysicalDevice>()
|
||||
var androidControllers = mapOf<Int, CitronPhysicalDevice>()
|
||||
var registeredControllers = mutableListOf<ParamPackage>()
|
||||
|
||||
fun dispatchKeyEvent(event: KeyEvent): Boolean {
|
||||
@@ -50,8 +50,8 @@ object InputHandler {
|
||||
return true
|
||||
}
|
||||
|
||||
fun getDevices(): Map<Int, YuzuPhysicalDevice> {
|
||||
val gameControllerDeviceIds = mutableMapOf<Int, YuzuPhysicalDevice>()
|
||||
fun getDevices(): Map<Int, CitronPhysicalDevice> {
|
||||
val gameControllerDeviceIds = mutableMapOf<Int, CitronPhysicalDevice>()
|
||||
val deviceIds = InputDevice.getDeviceIds()
|
||||
var port = 0
|
||||
val inputSettings = NativeConfig.getInputSettings(true)
|
||||
@@ -62,7 +62,7 @@ object InputHandler {
|
||||
sources and InputDevice.SOURCE_JOYSTICK == InputDevice.SOURCE_JOYSTICK
|
||||
) {
|
||||
if (!gameControllerDeviceIds.contains(controllerNumber)) {
|
||||
gameControllerDeviceIds[controllerNumber] = YuzuPhysicalDevice(
|
||||
gameControllerDeviceIds[controllerNumber] = CitronPhysicalDevice(
|
||||
this,
|
||||
port,
|
||||
inputSettings[port].useSystemVibrator
|
||||
@@ -82,7 +82,7 @@ object InputHandler {
|
||||
}
|
||||
|
||||
// Register the input overlay on a dedicated port for all player 1 vibrations
|
||||
NativeInput.registerController(YuzuInputOverlayDevice(androidControllers.isEmpty(), 100))
|
||||
NativeInput.registerController(CitronInputOverlayDevice(androidControllers.isEmpty(), 100))
|
||||
registeredControllers.clear()
|
||||
NativeInput.getInputDevices().forEach {
|
||||
registeredControllers.add(ParamPackage(it))
|
||||
|
||||
@@ -7,12 +7,12 @@ import android.app.ActivityManager
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
import org.citron.citron_emu.R
|
||||
import org.citron.citron_emu.YuzuApplication
|
||||
import org.citron.citron_emu.CitronApplication
|
||||
import java.util.Locale
|
||||
import kotlin.math.ceil
|
||||
|
||||
object MemoryUtil {
|
||||
private val context get() = YuzuApplication.appContext
|
||||
private val context get() = CitronApplication.appContext
|
||||
|
||||
private val Float.hundredths: String
|
||||
get() = String.format(Locale.ROOT, "%.2f", this)
|
||||
|
||||
@@ -23,12 +23,12 @@ object ThemeHelper {
|
||||
fun setTheme(activity: AppCompatActivity) {
|
||||
setThemeMode(activity)
|
||||
when (Theme.from(IntSetting.THEME.getInt())) {
|
||||
Theme.Default -> activity.setTheme(R.style.Theme_Yuzu_Main)
|
||||
Theme.Default -> activity.setTheme(R.style.Theme_Citron_Main)
|
||||
Theme.MaterialYou -> {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||
activity.setTheme(R.style.Theme_Yuzu_Main_MaterialYou)
|
||||
activity.setTheme(R.style.Theme_Citron_Main_MaterialYou)
|
||||
} else {
|
||||
activity.setTheme(R.style.Theme_Yuzu_Main)
|
||||
activity.setTheme(R.style.Theme_Citron_Main)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37,7 +37,7 @@ object ThemeHelper {
|
||||
// light app mode, dark system mode, and black backgrounds. Launching the settings activity
|
||||
// will then show light mode colors/navigation bars but with black backgrounds.
|
||||
if (BooleanSetting.BLACK_BACKGROUNDS.getBoolean() && isNightMode(activity)) {
|
||||
activity.setTheme(R.style.ThemeOverlay_Yuzu_Dark)
|
||||
activity.setTheme(R.style.ThemeOverlay_Citron_Dark)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -659,7 +659,7 @@ void Java_org_citron_citron_1emu_NativeLibrary_submitInlineKeyboardInput(JNIEnv*
|
||||
|
||||
void Java_org_citron_citron_1emu_NativeLibrary_initializeEmptyUserDirectory(JNIEnv* env,
|
||||
jobject instance) {
|
||||
const auto nand_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir);
|
||||
const auto nand_dir = Common::FS::GetCitronPath(Common::FS::CitronPath::NANDDir);
|
||||
auto vfs_nand_dir = EmulationSession::GetInstance().System().GetFilesystem()->OpenDirectory(
|
||||
Common::FS::PathToUTF8String(nand_dir), FileSys::OpenMode::Read);
|
||||
|
||||
@@ -831,7 +831,7 @@ jstring Java_org_citron_citron_1emu_NativeLibrary_getSavePath(JNIEnv* env, jobje
|
||||
const auto user_id = manager.GetUser(static_cast<std::size_t>(0));
|
||||
ASSERT(user_id);
|
||||
|
||||
const auto nandDir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir);
|
||||
const auto nandDir = Common::FS::GetCitronPath(Common::FS::CitronPath::NANDDir);
|
||||
auto vfsNandDir = system.GetFilesystem()->OpenDirectory(Common::FS::PathToUTF8String(nandDir),
|
||||
FileSys::OpenMode::Read);
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ bool IsProfileNameValid(std::string_view profile_name) {
|
||||
}
|
||||
|
||||
bool ProfileExistsInFilesystem(std::string_view profile_name) {
|
||||
return Common::FS::Exists(Common::FS::GetYuzuPath(Common::FS::YuzuPath::ConfigDir) / "input" /
|
||||
return Common::FS::Exists(Common::FS::GetCitronPath(Common::FS::CitronPath::ConfigDir) / "input" /
|
||||
fmt::format("{}.ini", profile_name));
|
||||
}
|
||||
|
||||
@@ -304,7 +304,7 @@ void Java_org_citron_citron_1emu_features_input_NativeInput_loadInputProfiles(JN
|
||||
jobject j_obj) {
|
||||
map_profiles.clear();
|
||||
const auto input_profile_loc =
|
||||
Common::FS::GetYuzuPath(Common::FS::YuzuPath::ConfigDir) / "input";
|
||||
Common::FS::GetCitronPath(Common::FS::CitronPath::ConfigDir) / "input";
|
||||
|
||||
if (Common::FS::IsDir(input_profile_loc)) {
|
||||
Common::FS::IterateDirEntries(
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
<string name="install_game_content_help_link">https://citron-emu.org/help/quickstart/#dumping-installed-updates</string>
|
||||
<string name="custom_driver_not_supported">Driver kustom tidak didukung</string>
|
||||
<string name="custom_driver_not_supported_description">Driver kustom saat ini tidak dapat digunakan pada perangkat ini. \nCek opsi ini lain waktu untuk mengetahui apakah dapat digunakan!</string>
|
||||
<string name="manage_citron_data">Kelola data Yuzu.</string>
|
||||
<string name="manage_citron_data">Kelola data Citron.</string>
|
||||
<string name="manage_citron_data_description">Impor/expor firmware, key, data pengguna, dan sebagainya!</string>
|
||||
<string name="share_save_file">Bagikan file simpanan.</string>
|
||||
<string name="export_save_failed">Gagal mengekspor simpanan.</string>
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
<string name="install_game_content_help_link">https://citron-emu.org/help/quickstart/#dumping-installed-updates</string>
|
||||
<string name="custom_driver_not_supported">I driver personalizzati non sono supportati.</string>
|
||||
<string name="custom_driver_not_supported_description">I driver personalizzati non sono attualmente supportati su questo dispositivo.\n Ricontrolla in futuro.</string>
|
||||
<string name="manage_citron_data">Gestisci i dati di Yuzu</string>
|
||||
<string name="manage_citron_data">Gestisci i dati di Citron</string>
|
||||
<string name="manage_citron_data_description">Importa/Esporta il firmware, le keys, i dati utente, e altro!</string>
|
||||
<string name="share_save_file">Condividi i tuoi dati di salvataggio</string>
|
||||
<string name="export_save_failed">Errore durante l\'esportazione del salvataggio</string>
|
||||
@@ -163,7 +163,7 @@
|
||||
<string name="exporting_user_data">Esportazione dei Dati Utente...</string>
|
||||
<string name="importing_user_data">Importazione dei Dati Utente...</string>
|
||||
<string name="import_user_data">Importa i Dati Utente</string>
|
||||
<string name="invalid_citron_backup">Backup di Yuzu Invalido</string>
|
||||
<string name="invalid_citron_backup">Backup di Citron Invalido</string>
|
||||
<string name="user_data_export_success">Dati Utente esportati con successo</string>
|
||||
<string name="user_data_import_success">Dati Utente importati con successo.</string>
|
||||
<string name="user_data_export_cancelled">Esportazione annullata</string>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="Theme.Yuzu.Main.MaterialYou" parent="Theme.Yuzu.Main">
|
||||
<style name="Theme.Citron.Main.MaterialYou" parent="Theme.Citron.Main">
|
||||
<item name="colorPrimary">@color/m3_sys_color_dynamic_dark_primary</item>
|
||||
<item name="colorOnPrimary">@color/m3_sys_color_dynamic_dark_on_primary</item>
|
||||
<item name="colorPrimaryContainer">@color/m3_sys_color_dynamic_dark_primary_container</item>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="ThemeOverlay.Yuzu.Dark" parent="">
|
||||
<style name="ThemeOverlay.Citron.Dark" parent="">
|
||||
<item name="colorSurface">@android:color/black</item>
|
||||
<item name="android:colorBackground">@android:color/black</item>
|
||||
</style>
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<string name="search_and_filter_games">Procura e filtra jogos</string>
|
||||
<string name="select_games_folder">Seleciona a pasta de jogos</string>
|
||||
<string name="manage_game_folders">Gerenciar pastas de jogos</string>
|
||||
<string name="select_games_folder_description">Permite que o Yuzu preencha a lista de jogos</string>
|
||||
<string name="select_games_folder_description">Permite que o Citron preencha a lista de jogos</string>
|
||||
<string name="add_games_warning">Ignorar a seleção da pasta de jogos?</string>
|
||||
<string name="add_games_warning_description">Os jogos não serão exibidos na lista de jogos se uma pasta não estiver selecionada.</string>
|
||||
<string name="add_games_warning_help">https://citron-emu.org/help/quickstart/#dumping-games</string>
|
||||
@@ -48,7 +48,7 @@
|
||||
<string name="notifications_description">Conceda a permissão de notificação com o botão abaixo.</string>
|
||||
<string name="give_permission">Conceder permissão</string>
|
||||
<string name="notification_warning">Ignorar a concessão da permissão de notificação?</string>
|
||||
<string name="notification_warning_description">O Yuzu não irá te notificar de informações importantes. </string>
|
||||
<string name="notification_warning_description">O Citron não irá te notificar de informações importantes. </string>
|
||||
<string name="permission_denied">Permissão negada</string>
|
||||
<string name="permission_denied_description">Você negou essa permissão muitas vezes e agora precisa concedê-la manualmente nas configurações do sistema.</string>
|
||||
<string name="about">Sobre</string>
|
||||
@@ -76,11 +76,11 @@
|
||||
<string name="search_recently_added">Adicionado recentemente</string>
|
||||
<string name="search_retail">Jogos comerciais</string>
|
||||
<string name="search_homebrew">Homebrew</string>
|
||||
<string name="open_user_folder">Abrir a pasta do Yuzu</string>
|
||||
<string name="open_user_folder_description">Gerencie os arquivos internos do Yuzu</string>
|
||||
<string name="open_user_folder">Abrir a pasta do Citron</string>
|
||||
<string name="open_user_folder_description">Gerencie os arquivos internos do Citron</string>
|
||||
<string name="theme_and_color_description">Altere a aparência do aplicativo</string>
|
||||
<string name="no_file_manager">Nenhum gerenciador de arquivos encontrado</string>
|
||||
<string name="notification_no_directory_link">Não foi possível abrir a pasta do Yuzu</string>
|
||||
<string name="notification_no_directory_link">Não foi possível abrir a pasta do Citron</string>
|
||||
<string name="notification_no_directory_link_description">Por favor localize manualmente a pasta do usuário, com o painel lateral do gerenciador de arquivos.</string>
|
||||
<string name="manage_save_data">Gerenciar os dados salvos dos jogos</string>
|
||||
<string name="manage_save_data_description">Dados salvos encontrados. Por favor selecione uma opção abaixo.</string>
|
||||
@@ -166,7 +166,7 @@
|
||||
<string name="copied_to_clipboard">Copiado para a área de transferência</string>
|
||||
<string name="about_app_description">Um emulador de Switch de código aberto</string>
|
||||
<string name="contributors">Colaboradores</string>
|
||||
<string name="contributors_description">Feito com \u2764 da equipe do Yuzu</string>
|
||||
<string name="contributors_description">Feito com \u2764 da equipe do Citron</string>
|
||||
<string name="contributors_link">https://github.com/citron-emu/citron/graphs/contributors</string>
|
||||
<string name="licenses_description">Projetos que tornam o citron para Android possível</string>
|
||||
<string name="build">Versão da Compilação</string>
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<string name="search_and_filter_games">Procura e filtra jogos.</string>
|
||||
<string name="select_games_folder">Seleciona a pasta de jogos.</string>
|
||||
<string name="manage_game_folders">Gerencie as pastas de jogos</string>
|
||||
<string name="select_games_folder_description">Permite que o Yuzu preencha a lista de jogos</string>
|
||||
<string name="select_games_folder_description">Permite que o Citron preencha a lista de jogos</string>
|
||||
<string name="add_games_warning">Ignorar a seleção da pasta de jogos?</string>
|
||||
<string name="add_games_warning_description">Os jogos não serão exibidos na lista de jogos se uma pasta não estiver selecionada.</string>
|
||||
<string name="add_games_warning_help">https://citron-emu.org/help/quickstart/#dumping-games</string>
|
||||
@@ -48,7 +48,7 @@
|
||||
<string name="notifications_description">Conceda a permissão de notificação com o botão abaixo.</string>
|
||||
<string name="give_permission">Conceda permissão</string>
|
||||
<string name="notification_warning">Saltar a concessão da permissão de notificação?</string>
|
||||
<string name="notification_warning_description">Yuzu não conseguirá te notificar de informações importantes. </string>
|
||||
<string name="notification_warning_description">Citron não conseguirá te notificar de informações importantes. </string>
|
||||
<string name="permission_denied">Permissão negada</string>
|
||||
<string name="permission_denied_description">Você negou essa permissão muitas vezes e agora precisa concedê-la manualmente nas configurações do sistema.</string>
|
||||
<string name="about">Sobre</string>
|
||||
@@ -76,11 +76,11 @@
|
||||
<string name="search_recently_added">Adicionado recentemente</string>
|
||||
<string name="search_retail">Jogos comerciais</string>
|
||||
<string name="search_homebrew">Homebrew</string>
|
||||
<string name="open_user_folder">Abre a pasta Yuzu</string>
|
||||
<string name="open_user_folder_description">Gere os ficheiro internos do Yuzu</string>
|
||||
<string name="open_user_folder">Abre a pasta Citron</string>
|
||||
<string name="open_user_folder_description">Gere os ficheiro internos do Citron</string>
|
||||
<string name="theme_and_color_description">Modifica a aparência da App</string>
|
||||
<string name="no_file_manager">Nenhum gestor de ficheiros encontrado</string>
|
||||
<string name="notification_no_directory_link">Impossível abrir pasta Yuzu</string>
|
||||
<string name="notification_no_directory_link">Impossível abrir pasta Citron</string>
|
||||
<string name="notification_no_directory_link_description">Localiza a pasta de utilizador manualmente com o painel lateral do gestor de ficheiros.</string>
|
||||
<string name="manage_save_data">Gerir dados guardados</string>
|
||||
<string name="manage_save_data_description">Dados não encontrados. Por favor seleciona uma opção abaixo.</string>
|
||||
@@ -166,7 +166,7 @@
|
||||
<string name="copied_to_clipboard">Copiado para a área de transferência</string>
|
||||
<string name="about_app_description">Um emulador Switch de código aberto</string>
|
||||
<string name="contributors">Contribuidores</string>
|
||||
<string name="contributors_description">Feito com \u2764 da equipa do Yuzu</string>
|
||||
<string name="contributors_description">Feito com \u2764 da equipa do Citron</string>
|
||||
<string name="contributors_link">https://github.com/citron-emu/citron/graphs/contributors</string>
|
||||
<string name="licenses_description">Projetos que tornam o citron para Android possível</string>
|
||||
<string name="build">Versão</string>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="Theme.Yuzu.Main.MaterialYou" parent="Theme.Yuzu.Main">
|
||||
<style name="Theme.Citron.Main.MaterialYou" parent="Theme.Citron.Main">
|
||||
<item name="colorPrimary">@color/m3_sys_color_dynamic_light_primary</item>
|
||||
<item name="colorOnPrimary">@color/m3_sys_color_dynamic_light_on_primary</item>
|
||||
<item name="colorPrimaryContainer">@color/m3_sys_color_dynamic_light_primary_container</item>
|
||||
|
||||
@@ -13,22 +13,22 @@
|
||||
<item name="android:paddingRight">32dp</item>
|
||||
</style>
|
||||
|
||||
<style name="YuzuSlider" parent="Widget.Material3.Slider">
|
||||
<style name="CitronSlider" parent="Widget.Material3.Slider">
|
||||
<item name="tickVisible">false</item>
|
||||
<item name="labelBehavior">gone</item>
|
||||
</style>
|
||||
|
||||
<style name="YuzuMaterialDialog" parent="ThemeOverlay.Material3.MaterialAlertDialog">
|
||||
<style name="CitronMaterialDialog" parent="ThemeOverlay.Material3.MaterialAlertDialog">
|
||||
<item name="colorPrimary">@color/citron_primaryContainer</item>
|
||||
<item name="colorSurface">@color/citron_primaryContainer</item>
|
||||
<item name="colorSecondary">@color/citron_primary</item>
|
||||
<item name="android:textColorLink">@color/citron_primary</item>
|
||||
<item name="buttonBarPositiveButtonStyle">@style/YuzuButton</item>
|
||||
<item name="buttonBarNegativeButtonStyle">@style/YuzuButton</item>
|
||||
<item name="buttonBarNeutralButtonStyle">@style/YuzuButton</item>
|
||||
<item name="buttonBarPositiveButtonStyle">@style/CitronButton</item>
|
||||
<item name="buttonBarNegativeButtonStyle">@style/CitronButton</item>
|
||||
<item name="buttonBarNeutralButtonStyle">@style/CitronButton</item>
|
||||
</style>
|
||||
|
||||
<style name="YuzuButton" parent="Widget.Material3.Button.TextButton.Dialog">
|
||||
<style name="CitronButton" parent="Widget.Material3.Button.TextButton.Dialog">
|
||||
<item name="android:textColor">@color/citron_primary</item>
|
||||
<item name="rippleColor">@color/citron_inversePrimary</item>
|
||||
</style>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="Theme.Yuzu.Splash.Main" parent="Theme.SplashScreen">
|
||||
<style name="Theme.Citron.Splash.Main" parent="Theme.SplashScreen">
|
||||
<item name="windowSplashScreenBackground">@color/citron_surface</item>
|
||||
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_citron</item>
|
||||
<item name="postSplashScreenTheme">@style/Theme.Yuzu.Main</item>
|
||||
<item name="postSplashScreenTheme">@style/Theme.Citron.Main</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Yuzu.Main" parent="Theme.Material3.DayNight.NoActionBar">
|
||||
<style name="Theme.Citron.Main" parent="Theme.Material3.DayNight.NoActionBar">
|
||||
<item name="colorPrimary">@color/citron_primary</item>
|
||||
<item name="colorOnPrimary">@color/citron_onPrimary</item>
|
||||
<item name="colorPrimaryContainer">@color/citron_primaryContainer</item>
|
||||
@@ -39,8 +39,8 @@
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||
|
||||
<item name="sliderStyle">@style/YuzuSlider</item>
|
||||
<item name="materialAlertDialogTheme">@style/YuzuMaterialDialog</item>
|
||||
<item name="sliderStyle">@style/CitronSlider</item>
|
||||
<item name="materialAlertDialogTheme">@style/CitronMaterialDialog</item>
|
||||
|
||||
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
|
||||
|
||||
|
||||
@@ -386,7 +386,7 @@ bool IsCubebSuitable() {
|
||||
// Test opening a device with standard parameters
|
||||
cubeb_devid output_device{0};
|
||||
cubeb_devid input_device{0};
|
||||
std::string name{"Yuzu test"};
|
||||
std::string name{"Citron test"};
|
||||
cubeb_stream* stream{nullptr};
|
||||
|
||||
if (cubeb_stream_init(ctx, &stream, name.c_str(), input_device, nullptr, output_device, ¶ms,
|
||||
|
||||
@@ -449,7 +449,7 @@ if (WIN32 AND QT_VERSION VERSION_GREATER_EQUAL 6)
|
||||
endif()
|
||||
|
||||
if (YUZU_USE_BUNDLED_QT AND QT_VERSION VERSION_LESS 6)
|
||||
include(CopyYuzuQt5Deps)
|
||||
include(CopyCitronQt5Deps)
|
||||
copy_citron_Qt5_deps(citron)
|
||||
endif()
|
||||
|
||||
@@ -459,8 +459,8 @@ if (ENABLE_SDL2)
|
||||
endif()
|
||||
|
||||
if (MSVC)
|
||||
include(CopyYuzuSDLDeps)
|
||||
include(CopyYuzuFFmpegDeps)
|
||||
include(CopyCitronSDLDeps)
|
||||
include(CopyCitronFFmpegDeps)
|
||||
copy_citron_SDL_deps(citron)
|
||||
copy_citron_FFmpeg_deps(citron)
|
||||
endif()
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="labelYuzu">
|
||||
<widget class="QLabel" name="labelCitron">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
|
||||
@@ -30,7 +30,7 @@ QString FormatUserEntryText(const QString& username, Common::UUID uuid) {
|
||||
|
||||
QString GetImagePath(Common::UUID uuid) {
|
||||
const auto path =
|
||||
Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) /
|
||||
Common::FS::GetCitronPath(Common::FS::CitronPath::NANDDir) /
|
||||
fmt::format("system/save/8000000000000010/su/avators/{}.jpg", uuid.FormattedString());
|
||||
return QString::fromStdString(Common::FS::PathToUTF8String(path));
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ QtNXWebEngineView::QtNXWebEngineView(QWidget* parent, Core::System& system,
|
||||
default_profile{QWebEngineProfile::defaultProfile()}, global_settings{
|
||||
default_profile->settings()} {
|
||||
default_profile->setPersistentStoragePath(QString::fromStdString(Common::FS::PathToUTF8String(
|
||||
Common::FS::GetYuzuPath(Common::FS::YuzuPath::YuzuDir) / "qtwebengine")));
|
||||
Common::FS::GetCitronPath(Common::FS::CitronPath::CitronDir) / "qtwebengine")));
|
||||
|
||||
QWebEngineScript gamepad;
|
||||
QWebEngineScript window_nx;
|
||||
@@ -336,7 +336,7 @@ void QtNXWebEngineView::LoadExtractedFonts() {
|
||||
QWebEngineScript load_nx_font;
|
||||
|
||||
auto fonts_dir_str = Common::FS::PathToUTF8String(
|
||||
Common::FS::GetYuzuPath(Common::FS::YuzuPath::CacheDir) / "fonts/");
|
||||
Common::FS::GetCitronPath(Common::FS::CitronPath::CacheDir) / "fonts/");
|
||||
|
||||
std::replace(fonts_dir_str.begin(), fonts_dir_str.end(), '\\', '/');
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ static void PruneDumpDirectory(const std::filesystem::path& dump_path) {
|
||||
|
||||
void InstallCrashHandler() {
|
||||
// Write crash dumps to profile directory.
|
||||
const auto dump_path = GetYuzuPath(Common::FS::YuzuPath::CrashDumpsDir);
|
||||
const auto dump_path = GetCitronPath(Common::FS::CitronPath::CrashDumpsDir);
|
||||
PruneDumpDirectory(dump_path);
|
||||
|
||||
#if defined(_WIN32)
|
||||
|
||||
@@ -21,7 +21,7 @@ ConfigureDebug::ConfigureDebug(const Core::System& system_, QWidget* parent)
|
||||
|
||||
connect(ui->open_log_button, &QPushButton::clicked, []() {
|
||||
const auto path =
|
||||
QString::fromStdString(Common::FS::GetYuzuPathString(Common::FS::YuzuPath::LogDir));
|
||||
QString::fromStdString(Common::FS::GetCitronPathString(Common::FS::CitronPath::LogDir));
|
||||
QDesktopServices::openUrl(QUrl::fromLocalFile(path));
|
||||
});
|
||||
|
||||
|
||||
@@ -47,15 +47,15 @@ void ConfigureFilesystem::changeEvent(QEvent* event) {
|
||||
|
||||
void ConfigureFilesystem::SetConfiguration() {
|
||||
ui->nand_directory_edit->setText(
|
||||
QString::fromStdString(Common::FS::GetYuzuPathString(Common::FS::YuzuPath::NANDDir)));
|
||||
QString::fromStdString(Common::FS::GetCitronPathString(Common::FS::CitronPath::NANDDir)));
|
||||
ui->sdmc_directory_edit->setText(
|
||||
QString::fromStdString(Common::FS::GetYuzuPathString(Common::FS::YuzuPath::SDMCDir)));
|
||||
QString::fromStdString(Common::FS::GetCitronPathString(Common::FS::CitronPath::SDMCDir)));
|
||||
ui->gamecard_path_edit->setText(
|
||||
QString::fromStdString(Settings::values.gamecard_path.GetValue()));
|
||||
ui->dump_path_edit->setText(
|
||||
QString::fromStdString(Common::FS::GetYuzuPathString(Common::FS::YuzuPath::DumpDir)));
|
||||
QString::fromStdString(Common::FS::GetCitronPathString(Common::FS::CitronPath::DumpDir)));
|
||||
ui->load_path_edit->setText(
|
||||
QString::fromStdString(Common::FS::GetYuzuPathString(Common::FS::YuzuPath::LoadDir)));
|
||||
QString::fromStdString(Common::FS::GetCitronPathString(Common::FS::CitronPath::LoadDir)));
|
||||
|
||||
ui->gamecard_inserted->setChecked(Settings::values.gamecard_inserted.GetValue());
|
||||
ui->gamecard_current_game->setChecked(Settings::values.gamecard_current_game.GetValue());
|
||||
@@ -68,13 +68,13 @@ void ConfigureFilesystem::SetConfiguration() {
|
||||
}
|
||||
|
||||
void ConfigureFilesystem::ApplyConfiguration() {
|
||||
Common::FS::SetYuzuPath(Common::FS::YuzuPath::NANDDir,
|
||||
Common::FS::SetCitronPath(Common::FS::CitronPath::NANDDir,
|
||||
ui->nand_directory_edit->text().toStdString());
|
||||
Common::FS::SetYuzuPath(Common::FS::YuzuPath::SDMCDir,
|
||||
Common::FS::SetCitronPath(Common::FS::CitronPath::SDMCDir,
|
||||
ui->sdmc_directory_edit->text().toStdString());
|
||||
Common::FS::SetYuzuPath(Common::FS::YuzuPath::DumpDir,
|
||||
Common::FS::SetCitronPath(Common::FS::CitronPath::DumpDir,
|
||||
ui->dump_path_edit->text().toStdString());
|
||||
Common::FS::SetYuzuPath(Common::FS::YuzuPath::LoadDir,
|
||||
Common::FS::SetCitronPath(Common::FS::CitronPath::LoadDir,
|
||||
ui->load_path_edit->text().toStdString());
|
||||
|
||||
Settings::values.gamecard_inserted = ui->gamecard_inserted->isChecked();
|
||||
@@ -126,12 +126,12 @@ void ConfigureFilesystem::SetDirectory(DirectoryTarget target, QLineEdit* edit)
|
||||
}
|
||||
|
||||
void ConfigureFilesystem::ResetMetadata() {
|
||||
if (!Common::FS::Exists(Common::FS::GetYuzuPath(Common::FS::YuzuPath::CacheDir) /
|
||||
if (!Common::FS::Exists(Common::FS::GetCitronPath(Common::FS::CitronPath::CacheDir) /
|
||||
"game_list/")) {
|
||||
QMessageBox::information(this, tr("Reset Metadata Cache"),
|
||||
tr("The metadata cache is already empty."));
|
||||
} else if (Common::FS::RemoveDirRecursively(
|
||||
Common::FS::GetYuzuPath(Common::FS::YuzuPath::CacheDir) / "game_list")) {
|
||||
Common::FS::GetCitronPath(Common::FS::CitronPath::CacheDir) / "game_list")) {
|
||||
QMessageBox::information(this, tr("Reset Metadata Cache"),
|
||||
tr("The operation completed successfully."));
|
||||
UISettings::values.is_game_list_reload_pending.exchange(true);
|
||||
|
||||
@@ -80,7 +80,7 @@ void ConfigurePerGameAddons::ApplyConfiguration() {
|
||||
std::sort(disabled_addons.begin(), disabled_addons.end());
|
||||
std::sort(current.begin(), current.end());
|
||||
if (disabled_addons != current) {
|
||||
Common::FS::RemoveFile(Common::FS::GetYuzuPath(Common::FS::YuzuPath::CacheDir) /
|
||||
Common::FS::RemoveFile(Common::FS::GetCitronPath(Common::FS::CitronPath::CacheDir) /
|
||||
"game_list" / fmt::format("{:016X}.pv.txt", title_id));
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ constexpr std::array<u8, 107> backup_jpeg{
|
||||
|
||||
QString GetImagePath(const Common::UUID& uuid) {
|
||||
const auto path =
|
||||
Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) /
|
||||
Common::FS::GetCitronPath(Common::FS::CitronPath::NANDDir) /
|
||||
fmt::format("system/save/8000000000000010/su/avators/{}.jpg", uuid.FormattedString());
|
||||
return QString::fromStdString(Common::FS::PathToUTF8String(path));
|
||||
}
|
||||
@@ -288,7 +288,7 @@ void ConfigureProfileManager::SetUserImage() {
|
||||
}
|
||||
|
||||
const auto raw_path = QString::fromStdString(Common::FS::PathToUTF8String(
|
||||
Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / "system/save/8000000000000010"));
|
||||
Common::FS::GetCitronPath(Common::FS::CitronPath::NANDDir) / "system/save/8000000000000010"));
|
||||
const QFileInfo raw_info{raw_path};
|
||||
if (raw_info.exists() && !raw_info.isDir() && !QFile::remove(raw_path)) {
|
||||
QMessageBox::warning(this, tr("Error deleting file"),
|
||||
|
||||
@@ -28,14 +28,14 @@ ConfigureTasDialog::~ConfigureTasDialog() = default;
|
||||
|
||||
void ConfigureTasDialog::LoadConfiguration() {
|
||||
ui->tas_path_edit->setText(
|
||||
QString::fromStdString(Common::FS::GetYuzuPathString(Common::FS::YuzuPath::TASDir)));
|
||||
QString::fromStdString(Common::FS::GetCitronPathString(Common::FS::CitronPath::TASDir)));
|
||||
ui->tas_enable->setChecked(Settings::values.tas_enable.GetValue());
|
||||
ui->tas_loop_script->setChecked(Settings::values.tas_loop.GetValue());
|
||||
ui->tas_pause_on_load->setChecked(Settings::values.pause_tas_on_load.GetValue());
|
||||
}
|
||||
|
||||
void ConfigureTasDialog::ApplyConfiguration() {
|
||||
Common::FS::SetYuzuPath(Common::FS::YuzuPath::TASDir, ui->tas_path_edit->text().toStdString());
|
||||
Common::FS::SetCitronPath(Common::FS::CitronPath::TASDir, ui->tas_path_edit->text().toStdString());
|
||||
Settings::values.tas_enable.SetValue(ui->tas_enable->isChecked());
|
||||
Settings::values.tas_loop.SetValue(ui->tas_loop_script->isChecked());
|
||||
Settings::values.pause_tas_on_load.SetValue(ui->tas_pause_on_load->isChecked());
|
||||
|
||||
@@ -144,8 +144,8 @@ ConfigureUi::ConfigureUi(Core::System& system_, QWidget* parent)
|
||||
connect(ui->screenshot_path_button, &QToolButton::pressed, this, [this] {
|
||||
auto dir =
|
||||
QFileDialog::getExistingDirectory(this, tr("Select Screenshots Path..."),
|
||||
QString::fromStdString(Common::FS::GetYuzuPathString(
|
||||
Common::FS::YuzuPath::ScreenshotsDir)));
|
||||
QString::fromStdString(Common::FS::GetCitronPathString(
|
||||
Common::FS::CitronPath::ScreenshotsDir)));
|
||||
if (!dir.isEmpty()) {
|
||||
if (dir.back() != QChar::fromLatin1('/')) {
|
||||
dir.append(QChar::fromLatin1('/'));
|
||||
@@ -176,7 +176,7 @@ void ConfigureUi::ApplyConfiguration() {
|
||||
UISettings::values.row_2_text_id = ui->row_2_text_combobox->currentData().toUInt();
|
||||
|
||||
UISettings::values.enable_screenshot_save_as = ui->enable_screenshot_save_as->isChecked();
|
||||
Common::FS::SetYuzuPath(Common::FS::YuzuPath::ScreenshotsDir,
|
||||
Common::FS::SetCitronPath(Common::FS::CitronPath::ScreenshotsDir,
|
||||
ui->screenshot_path_edit->text().toStdString());
|
||||
|
||||
const u32 height = ScreenshotDimensionToInt(ui->screenshot_height->currentText());
|
||||
@@ -208,7 +208,7 @@ void ConfigureUi::SetConfiguration() {
|
||||
ui->enable_screenshot_save_as->setChecked(
|
||||
UISettings::values.enable_screenshot_save_as.GetValue());
|
||||
ui->screenshot_path_edit->setText(QString::fromStdString(
|
||||
Common::FS::GetYuzuPathString(Common::FS::YuzuPath::ScreenshotsDir)));
|
||||
Common::FS::GetCitronPathString(Common::FS::CitronPath::ScreenshotsDir)));
|
||||
|
||||
const auto height = UISettings::values.screenshot_height.GetValue();
|
||||
if (height == 0) {
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<property name="title">
|
||||
<string>citron Web Service</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayoutYuzuWebService">
|
||||
<layout class="QVBoxLayout" name="verticalLayoutCitronWebService">
|
||||
<item>
|
||||
<widget class="QLabel" name="web_credentials_disclaimer">
|
||||
<property name="text">
|
||||
@@ -33,7 +33,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayoutYuzuUsername">
|
||||
<layout class="QGridLayout" name="gridLayoutCitronUsername">
|
||||
<item row="2" column="3">
|
||||
<widget class="QPushButton" name="button_verify_login">
|
||||
<property name="sizePolicy">
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace FS = Common::FS;
|
||||
namespace {
|
||||
|
||||
bool ProfileExistsInFilesystem(std::string_view profile_name) {
|
||||
return FS::Exists(FS::GetYuzuPath(FS::YuzuPath::ConfigDir) / "input" /
|
||||
return FS::Exists(FS::GetCitronPath(FS::CitronPath::ConfigDir) / "input" /
|
||||
fmt::format("{}.ini", profile_name));
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ std::filesystem::path GetNameWithoutExtension(std::filesystem::path filename) {
|
||||
} // namespace
|
||||
|
||||
InputProfiles::InputProfiles() {
|
||||
const auto input_profile_loc = FS::GetYuzuPath(FS::YuzuPath::ConfigDir) / "input";
|
||||
const auto input_profile_loc = FS::GetCitronPath(FS::CitronPath::ConfigDir) / "input";
|
||||
|
||||
if (!FS::IsDir(input_profile_loc)) {
|
||||
return;
|
||||
|
||||
@@ -38,7 +38,7 @@ QString GetGameListCachedObject(const std::string& filename, const std::string&
|
||||
}
|
||||
|
||||
const auto path =
|
||||
Common::FS::PathToUTF8String(Common::FS::GetYuzuPath(Common::FS::YuzuPath::CacheDir) /
|
||||
Common::FS::PathToUTF8String(Common::FS::GetCitronPath(Common::FS::CitronPath::CacheDir) /
|
||||
"game_list" / fmt::format("{}.{}", filename, ext));
|
||||
|
||||
void(Common::FS::CreateParentDirs(path));
|
||||
@@ -70,7 +70,7 @@ std::pair<std::vector<u8>, std::string> GetGameListCachedObject(
|
||||
}
|
||||
|
||||
const auto game_list_dir =
|
||||
Common::FS::GetYuzuPath(Common::FS::YuzuPath::CacheDir) / "game_list";
|
||||
Common::FS::GetCitronPath(Common::FS::CitronPath::CacheDir) / "game_list";
|
||||
const auto jpeg_name = fmt::format("{}.jpeg", filename);
|
||||
const auto app_name = fmt::format("{}.appname.txt", filename);
|
||||
|
||||
|
||||
@@ -223,7 +223,7 @@ void GMainWindow::ShowTelemetryCallout() {
|
||||
const int GMainWindow::max_recent_files_item;
|
||||
|
||||
static void RemoveCachedContents() {
|
||||
const auto cache_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::CacheDir);
|
||||
const auto cache_dir = Common::FS::GetCitronPath(Common::FS::CitronPath::CacheDir);
|
||||
const auto offline_fonts = cache_dir / "fonts";
|
||||
const auto offline_manual = cache_dir / "offline_web_applet_manual";
|
||||
const auto offline_legal_information = cache_dir / "offline_web_applet_legal_information";
|
||||
@@ -1600,7 +1600,7 @@ void GMainWindow::ConnectMenuEvents() {
|
||||
connect_menu(ui->action_Configure_Tas, &GMainWindow::OnConfigureTas);
|
||||
|
||||
// Help
|
||||
connect_menu(ui->action_Open_citron_Folder, &GMainWindow::OnOpenYuzuFolder);
|
||||
connect_menu(ui->action_Open_citron_Folder, &GMainWindow::OnOpenCitronFolder);
|
||||
connect_menu(ui->action_Verify_installed_contents, &GMainWindow::OnVerifyInstalledContents);
|
||||
connect_menu(ui->action_Install_Firmware, &GMainWindow::OnInstallFirmware);
|
||||
connect_menu(ui->action_Install_Keys, &GMainWindow::OnInstallDecryptionKeys);
|
||||
@@ -2288,7 +2288,7 @@ void GMainWindow::OnGameListOpenFolder(u64 program_id, GameListOpenTarget target
|
||||
switch (target) {
|
||||
case GameListOpenTarget::SaveData: {
|
||||
open_target = tr("Save Data");
|
||||
const auto nand_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir);
|
||||
const auto nand_dir = Common::FS::GetCitronPath(Common::FS::CitronPath::NANDDir);
|
||||
auto vfs_nand_dir =
|
||||
vfs->OpenDirectory(Common::FS::PathToUTF8String(nand_dir), FileSys::OpenMode::Read);
|
||||
|
||||
@@ -2344,7 +2344,7 @@ void GMainWindow::OnGameListOpenFolder(u64 program_id, GameListOpenTarget target
|
||||
}
|
||||
case GameListOpenTarget::ModData: {
|
||||
open_target = tr("Mod Data");
|
||||
path = Common::FS::GetYuzuPath(Common::FS::YuzuPath::LoadDir) /
|
||||
path = Common::FS::GetCitronPath(Common::FS::CitronPath::LoadDir) /
|
||||
fmt::format("{:016X}", program_id);
|
||||
break;
|
||||
}
|
||||
@@ -2366,7 +2366,7 @@ void GMainWindow::OnGameListOpenFolder(u64 program_id, GameListOpenTarget target
|
||||
}
|
||||
|
||||
void GMainWindow::OnTransferableShaderCacheOpenFile(u64 program_id) {
|
||||
const auto shader_cache_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::ShaderDir);
|
||||
const auto shader_cache_dir = Common::FS::GetCitronPath(Common::FS::CitronPath::ShaderDir);
|
||||
const auto shader_cache_folder_path{shader_cache_dir / fmt::format("{:016x}", program_id)};
|
||||
if (!Common::FS::CreateDirs(shader_cache_folder_path)) {
|
||||
QMessageBox::warning(this, tr("Error Opening Transferable Shader Cache"),
|
||||
@@ -2485,7 +2485,7 @@ void GMainWindow::OnGameListRemoveInstalledEntry(u64 program_id, InstalledEntryT
|
||||
RemoveAddOnContent(program_id, type);
|
||||
break;
|
||||
}
|
||||
Common::FS::RemoveDirRecursively(Common::FS::GetYuzuPath(Common::FS::YuzuPath::CacheDir) /
|
||||
Common::FS::RemoveDirRecursively(Common::FS::GetCitronPath(Common::FS::CitronPath::CacheDir) /
|
||||
"game_list");
|
||||
game_list->PopulateAsync(UISettings::values.game_dirs);
|
||||
}
|
||||
@@ -2591,7 +2591,7 @@ void GMainWindow::RemoveTransferableShaderCache(u64 program_id, GameListRemoveTa
|
||||
return "";
|
||||
}
|
||||
}();
|
||||
const auto shader_cache_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::ShaderDir);
|
||||
const auto shader_cache_dir = Common::FS::GetCitronPath(Common::FS::CitronPath::ShaderDir);
|
||||
const auto shader_cache_folder_path = shader_cache_dir / fmt::format("{:016x}", program_id);
|
||||
const auto target_file = shader_cache_folder_path / target_file_name;
|
||||
|
||||
@@ -2612,7 +2612,7 @@ void GMainWindow::RemoveTransferableShaderCache(u64 program_id, GameListRemoveTa
|
||||
void GMainWindow::RemoveVulkanDriverPipelineCache(u64 program_id) {
|
||||
static constexpr std::string_view target_file_name = "vulkan_pipelines.bin";
|
||||
|
||||
const auto shader_cache_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::ShaderDir);
|
||||
const auto shader_cache_dir = Common::FS::GetCitronPath(Common::FS::CitronPath::ShaderDir);
|
||||
const auto shader_cache_folder_path = shader_cache_dir / fmt::format("{:016x}", program_id);
|
||||
const auto target_file = shader_cache_folder_path / target_file_name;
|
||||
|
||||
@@ -2626,7 +2626,7 @@ void GMainWindow::RemoveVulkanDriverPipelineCache(u64 program_id) {
|
||||
}
|
||||
|
||||
void GMainWindow::RemoveAllTransferableShaderCaches(u64 program_id) {
|
||||
const auto shader_cache_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::ShaderDir);
|
||||
const auto shader_cache_dir = Common::FS::GetCitronPath(Common::FS::CitronPath::ShaderDir);
|
||||
const auto program_shader_cache_dir = shader_cache_dir / fmt::format("{:016x}", program_id);
|
||||
|
||||
if (!Common::FS::Exists(program_shader_cache_dir)) {
|
||||
@@ -2649,7 +2649,7 @@ void GMainWindow::RemoveCustomConfiguration(u64 program_id, const std::string& g
|
||||
program_id == 0 ? Common::FS::PathToUTF8String(file_path.filename()).append(".ini")
|
||||
: fmt::format("{:016X}.ini", program_id);
|
||||
const auto custom_config_file_path =
|
||||
Common::FS::GetYuzuPath(Common::FS::YuzuPath::ConfigDir) / "custom" / config_file_name;
|
||||
Common::FS::GetCitronPath(Common::FS::CitronPath::ConfigDir) / "custom" / config_file_name;
|
||||
|
||||
if (!Common::FS::Exists(custom_config_file_path)) {
|
||||
QMessageBox::warning(this, tr("Error Removing Custom Configuration"),
|
||||
@@ -2667,7 +2667,7 @@ void GMainWindow::RemoveCustomConfiguration(u64 program_id, const std::string& g
|
||||
}
|
||||
|
||||
void GMainWindow::RemoveCacheStorage(u64 program_id) {
|
||||
const auto nand_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir);
|
||||
const auto nand_dir = Common::FS::GetCitronPath(Common::FS::CitronPath::NANDDir);
|
||||
auto vfs_nand_dir =
|
||||
vfs->OpenDirectory(Common::FS::PathToUTF8String(nand_dir), FileSys::OpenMode::Read);
|
||||
|
||||
@@ -2725,8 +2725,8 @@ void GMainWindow::OnGameListDumpRomFS(u64 program_id, const std::string& game_pa
|
||||
const auto base_romfs = base_nca->GetRomFS();
|
||||
const auto dump_dir =
|
||||
target == DumpRomFSTarget::Normal
|
||||
? Common::FS::GetYuzuPath(Common::FS::YuzuPath::DumpDir)
|
||||
: Common::FS::GetYuzuPath(Common::FS::YuzuPath::SDMCDir) / "atmosphere" / "contents";
|
||||
? Common::FS::GetCitronPath(Common::FS::CitronPath::DumpDir)
|
||||
: Common::FS::GetCitronPath(Common::FS::CitronPath::SDMCDir) / "atmosphere" / "contents";
|
||||
const auto romfs_dir = fmt::format("{:016X}/romfs", title_id);
|
||||
|
||||
const auto path = Common::FS::PathToUTF8String(dump_dir / romfs_dir);
|
||||
@@ -2981,10 +2981,10 @@ bool GMainWindow::CreateShortcutMessagesGUI(QWidget* parent, int imsg, const QSt
|
||||
|
||||
bool GMainWindow::MakeShortcutIcoPath(const u64 program_id, const std::string_view game_file_name,
|
||||
std::filesystem::path& out_icon_path) {
|
||||
// Get path to Yuzu icons directory & icon extension
|
||||
// Get path to Citron icons directory & icon extension
|
||||
std::string ico_extension = "png";
|
||||
#if defined(_WIN32)
|
||||
out_icon_path = Common::FS::GetYuzuPath(Common::FS::YuzuPath::IconsDir);
|
||||
out_icon_path = Common::FS::GetCitronPath(Common::FS::CitronPath::IconsDir);
|
||||
ico_extension = "ico";
|
||||
#elif defined(__linux__) || defined(__FreeBSD__)
|
||||
out_icon_path = Common::FS::GetDataDirectory("XDG_DATA_HOME") / "icons/hicolor/256x256";
|
||||
@@ -3107,13 +3107,13 @@ void GMainWindow::OnGameListOpenDirectory(const QString& directory) {
|
||||
std::filesystem::path fs_path;
|
||||
if (directory == QStringLiteral("SDMC")) {
|
||||
fs_path =
|
||||
Common::FS::GetYuzuPath(Common::FS::YuzuPath::SDMCDir) / "Nintendo/Contents/registered";
|
||||
Common::FS::GetCitronPath(Common::FS::CitronPath::SDMCDir) / "Nintendo/Contents/registered";
|
||||
} else if (directory == QStringLiteral("UserNAND")) {
|
||||
fs_path =
|
||||
Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / "user/Contents/registered";
|
||||
Common::FS::GetCitronPath(Common::FS::CitronPath::NANDDir) / "user/Contents/registered";
|
||||
} else if (directory == QStringLiteral("SysNAND")) {
|
||||
fs_path =
|
||||
Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / "system/Contents/registered";
|
||||
Common::FS::GetCitronPath(Common::FS::CitronPath::NANDDir) / "system/Contents/registered";
|
||||
} else {
|
||||
fs_path = directory.toStdString();
|
||||
}
|
||||
@@ -3339,7 +3339,7 @@ void GMainWindow::OnMenuInstallToNAND() {
|
||||
: tr("%n file(s) failed to install\n", "", failed_files.size()));
|
||||
|
||||
QMessageBox::information(this, tr("Install Results"), install_results);
|
||||
Common::FS::RemoveDirRecursively(Common::FS::GetYuzuPath(Common::FS::YuzuPath::CacheDir) /
|
||||
Common::FS::RemoveDirRecursively(Common::FS::GetCitronPath(Common::FS::CitronPath::CacheDir) /
|
||||
"game_list");
|
||||
game_list->PopulateAsync(UISettings::values.game_dirs);
|
||||
ui->action_Install_File_NAND->setEnabled(true);
|
||||
@@ -3759,11 +3759,11 @@ void GMainWindow::OnConfigure() {
|
||||
LOG_WARNING(Frontend, "Failed to remove configuration file");
|
||||
}
|
||||
if (!Common::FS::RemoveDirContentsRecursively(
|
||||
Common::FS::GetYuzuPath(Common::FS::YuzuPath::ConfigDir) / "custom")) {
|
||||
Common::FS::GetCitronPath(Common::FS::CitronPath::ConfigDir) / "custom")) {
|
||||
LOG_WARNING(Frontend, "Failed to remove custom configuration files");
|
||||
}
|
||||
if (!Common::FS::RemoveDirRecursively(
|
||||
Common::FS::GetYuzuPath(Common::FS::YuzuPath::CacheDir) / "game_list")) {
|
||||
Common::FS::GetCitronPath(Common::FS::CitronPath::CacheDir) / "game_list")) {
|
||||
LOG_WARNING(Frontend, "Failed to remove game metadata cache files");
|
||||
}
|
||||
|
||||
@@ -4119,9 +4119,9 @@ void GMainWindow::LoadAmiibo(const QString& filename) {
|
||||
}
|
||||
}
|
||||
|
||||
void GMainWindow::OnOpenYuzuFolder() {
|
||||
void GMainWindow::OnOpenCitronFolder() {
|
||||
QDesktopServices::openUrl(QUrl::fromLocalFile(
|
||||
QString::fromStdString(Common::FS::GetYuzuPathString(Common::FS::YuzuPath::YuzuDir))));
|
||||
QString::fromStdString(Common::FS::GetCitronPathString(Common::FS::CitronPath::CitronDir))));
|
||||
}
|
||||
|
||||
void GMainWindow::OnVerifyInstalledContents() {
|
||||
@@ -4336,7 +4336,7 @@ void GMainWindow::OnInstallDecryptionKeys() {
|
||||
return;
|
||||
}
|
||||
|
||||
const auto citron_keys_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::KeysDir);
|
||||
const auto citron_keys_dir = Common::FS::GetCitronPath(Common::FS::CitronPath::KeysDir);
|
||||
for (auto key_file : source_key_files) {
|
||||
std::filesystem::path destination_key_file = citron_keys_dir / key_file.filename();
|
||||
if (!std::filesystem::copy_file(key_file, destination_key_file,
|
||||
@@ -4489,7 +4489,7 @@ void GMainWindow::OnCaptureScreenshot() {
|
||||
|
||||
const u64 title_id = system->GetApplicationProcessProgramID();
|
||||
const auto screenshot_path =
|
||||
QString::fromStdString(Common::FS::GetYuzuPathString(Common::FS::YuzuPath::ScreenshotsDir));
|
||||
QString::fromStdString(Common::FS::GetCitronPathString(Common::FS::CitronPath::ScreenshotsDir));
|
||||
const auto date =
|
||||
QDateTime::currentDateTime().toString(QStringLiteral("yyyy-MM-dd_hh-mm-ss-zzz"));
|
||||
QString filename = QStringLiteral("%1/%2_%3.png")
|
||||
@@ -4517,7 +4517,7 @@ void GMainWindow::OnCaptureScreenshot() {
|
||||
|
||||
// TODO: Written 2020-10-01: Remove per-game config migration code when it is irrelevant
|
||||
void GMainWindow::MigrateConfigFiles() {
|
||||
const auto config_dir_fs_path = Common::FS::GetYuzuPath(Common::FS::YuzuPath::ConfigDir);
|
||||
const auto config_dir_fs_path = Common::FS::GetCitronPath(Common::FS::CitronPath::ConfigDir);
|
||||
const QDir config_dir =
|
||||
QDir(QString::fromStdString(Common::FS::PathToUTF8String(config_dir_fs_path)));
|
||||
const QStringList config_dir_list = config_dir.entryList(QStringList(QStringLiteral("*.ini")));
|
||||
|
||||
@@ -377,7 +377,7 @@ private slots:
|
||||
void OnToggleAdaptingFilter();
|
||||
void OnConfigurePerGame();
|
||||
void OnLoadAmiibo();
|
||||
void OnOpenYuzuFolder();
|
||||
void OnOpenCitronFolder();
|
||||
void OnVerifyInstalledContents();
|
||||
void OnInstallFirmware();
|
||||
void OnInstallDecryptionKeys();
|
||||
|
||||
@@ -26,7 +26,7 @@ std::optional<std::filesystem::path> GetCurrentUserPlayTimePath(
|
||||
if (!uuid.has_value()) {
|
||||
return std::nullopt;
|
||||
}
|
||||
return Common::FS::GetYuzuPath(Common::FS::YuzuPath::PlayTimeDir) /
|
||||
return Common::FS::GetCitronPath(Common::FS::CitronPath::PlayTimeDir) /
|
||||
uuid->RawString().append(".bin");
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ u32 CalculateWidth(u32 height, Settings::AspectRatio ratio) {
|
||||
|
||||
void SaveWindowState() {
|
||||
const auto window_state_config_loc =
|
||||
FS::PathToUTF8String(FS::GetYuzuPath(FS::YuzuPath::ConfigDir) / "window_state.ini");
|
||||
FS::PathToUTF8String(FS::GetCitronPath(FS::CitronPath::ConfigDir) / "window_state.ini");
|
||||
|
||||
void(FS::CreateParentDir(window_state_config_loc));
|
||||
QSettings config(QString::fromStdString(window_state_config_loc), QSettings::IniFormat);
|
||||
@@ -73,12 +73,12 @@ void SaveWindowState() {
|
||||
|
||||
void RestoreWindowState(std::unique_ptr<QtConfig>& qtConfig) {
|
||||
const auto window_state_config_loc =
|
||||
FS::PathToUTF8String(FS::GetYuzuPath(FS::YuzuPath::ConfigDir) / "window_state.ini");
|
||||
FS::PathToUTF8String(FS::GetCitronPath(FS::CitronPath::ConfigDir) / "window_state.ini");
|
||||
|
||||
// Migrate window state from old location
|
||||
if (!FS::Exists(window_state_config_loc) && qtConfig->Exists("UI", "UILayout\\geometry")) {
|
||||
const auto config_loc =
|
||||
FS::PathToUTF8String(FS::GetYuzuPath(FS::YuzuPath::ConfigDir) / "qt-config.ini");
|
||||
FS::PathToUTF8String(FS::GetCitronPath(FS::CitronPath::ConfigDir) / "qt-config.ini");
|
||||
QSettings config(QString::fromStdString(config_loc), QSettings::IniFormat);
|
||||
|
||||
config.beginGroup(QStringLiteral("UI"));
|
||||
|
||||
@@ -54,7 +54,7 @@ if(WIN32)
|
||||
endif()
|
||||
|
||||
if (MSVC)
|
||||
include(CopyYuzuSDLDeps)
|
||||
include(CopyCitronSDLDeps)
|
||||
copy_citron_SDL_deps(citron-cmd)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -356,35 +356,35 @@ jfieldID GetPlayerInputUseSystemVibratorField() {
|
||||
return s_player_input_use_system_vibrator_field;
|
||||
}
|
||||
|
||||
jclass GetYuzuInputDeviceInterface() {
|
||||
jclass GetCitronInputDeviceInterface() {
|
||||
return s_citron_input_device_interface;
|
||||
}
|
||||
|
||||
jmethodID GetYuzuDeviceGetName() {
|
||||
jmethodID GetCitronDeviceGetName() {
|
||||
return s_citron_input_device_get_name;
|
||||
}
|
||||
|
||||
jmethodID GetYuzuDeviceGetGUID() {
|
||||
jmethodID GetCitronDeviceGetGUID() {
|
||||
return s_citron_input_device_get_guid;
|
||||
}
|
||||
|
||||
jmethodID GetYuzuDeviceGetPort() {
|
||||
jmethodID GetCitronDeviceGetPort() {
|
||||
return s_citron_input_device_get_port;
|
||||
}
|
||||
|
||||
jmethodID GetYuzuDeviceGetSupportsVibration() {
|
||||
jmethodID GetCitronDeviceGetSupportsVibration() {
|
||||
return s_citron_input_device_get_supports_vibration;
|
||||
}
|
||||
|
||||
jmethodID GetYuzuDeviceVibrate() {
|
||||
jmethodID GetCitronDeviceVibrate() {
|
||||
return s_citron_input_device_vibrate;
|
||||
}
|
||||
|
||||
jmethodID GetYuzuDeviceGetAxes() {
|
||||
jmethodID GetCitronDeviceGetAxes() {
|
||||
return s_citron_input_device_get_axes;
|
||||
}
|
||||
|
||||
jmethodID GetYuzuDeviceHasKeys() {
|
||||
jmethodID GetCitronDeviceHasKeys() {
|
||||
return s_citron_input_device_has_keys;
|
||||
}
|
||||
|
||||
@@ -531,7 +531,7 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved) {
|
||||
env->DeleteLocalRef(player_input_class);
|
||||
|
||||
const jclass citron_input_device_interface =
|
||||
env->FindClass("org/citron/citron_emu/features/input/YuzuInputDevice");
|
||||
env->FindClass("org/citron/citron_emu/features/input/CitronInputDevice");
|
||||
s_citron_input_device_interface =
|
||||
reinterpret_cast<jclass>(env->NewGlobalRef(citron_input_device_interface));
|
||||
s_citron_input_device_get_name =
|
||||
|
||||
@@ -100,13 +100,13 @@ jfieldID GetPlayerInputButtonColorRightField();
|
||||
jfieldID GetPlayerInputProfileNameField();
|
||||
jfieldID GetPlayerInputUseSystemVibratorField();
|
||||
|
||||
jclass GetYuzuInputDeviceInterface();
|
||||
jmethodID GetYuzuDeviceGetName();
|
||||
jmethodID GetYuzuDeviceGetGUID();
|
||||
jmethodID GetYuzuDeviceGetPort();
|
||||
jmethodID GetYuzuDeviceGetSupportsVibration();
|
||||
jmethodID GetYuzuDeviceVibrate();
|
||||
jmethodID GetYuzuDeviceGetAxes();
|
||||
jmethodID GetYuzuDeviceHasKeys();
|
||||
jclass GetCitronInputDeviceInterface();
|
||||
jmethodID GetCitronDeviceGetName();
|
||||
jmethodID GetCitronDeviceGetGUID();
|
||||
jmethodID GetCitronDeviceGetPort();
|
||||
jmethodID GetCitronDeviceGetSupportsVibration();
|
||||
jmethodID GetCitronDeviceVibrate();
|
||||
jmethodID GetCitronDeviceGetAxes();
|
||||
jmethodID GetCitronDeviceHasKeys();
|
||||
|
||||
} // namespace Common::Android
|
||||
|
||||
@@ -56,10 +56,10 @@ namespace fs = std::filesystem;
|
||||
|
||||
/**
|
||||
* The PathManagerImpl is a singleton allowing to manage the mapping of
|
||||
* YuzuPath enums to real filesystem paths.
|
||||
* This class provides 2 functions: GetYuzuPathImpl and SetYuzuPathImpl.
|
||||
* These are used by GetYuzuPath and SetYuzuPath respectively to get or modify
|
||||
* the path mapped by the YuzuPath enum.
|
||||
* CitronPath enums to real filesystem paths.
|
||||
* This class provides 2 functions: GetCitronPathImpl and SetCitronPathImpl.
|
||||
* These are used by GetCitronPath and SetCitronPath respectively to get or modify
|
||||
* the path mapped by the CitronPath enum.
|
||||
*/
|
||||
class PathManagerImpl {
|
||||
public:
|
||||
@@ -75,11 +75,11 @@ public:
|
||||
PathManagerImpl(PathManagerImpl&&) = delete;
|
||||
PathManagerImpl& operator=(PathManagerImpl&&) = delete;
|
||||
|
||||
[[nodiscard]] const fs::path& GetYuzuPathImpl(YuzuPath citron_path) {
|
||||
[[nodiscard]] const fs::path& GetCitronPathImpl(CitronPath citron_path) {
|
||||
return citron_paths.at(citron_path);
|
||||
}
|
||||
|
||||
void SetYuzuPathImpl(YuzuPath citron_path, const fs::path& new_path) {
|
||||
void SetCitronPathImpl(CitronPath citron_path, const fs::path& new_path) {
|
||||
citron_paths.insert_or_assign(citron_path, new_path);
|
||||
}
|
||||
|
||||
@@ -115,22 +115,22 @@ public:
|
||||
}
|
||||
#endif
|
||||
|
||||
GenerateYuzuPath(YuzuPath::YuzuDir, citron_path);
|
||||
GenerateYuzuPath(YuzuPath::AmiiboDir, citron_path / AMIIBO_DIR);
|
||||
GenerateYuzuPath(YuzuPath::CacheDir, citron_path_cache);
|
||||
GenerateYuzuPath(YuzuPath::ConfigDir, citron_path_config);
|
||||
GenerateYuzuPath(YuzuPath::CrashDumpsDir, citron_path / CRASH_DUMPS_DIR);
|
||||
GenerateYuzuPath(YuzuPath::DumpDir, citron_path / DUMP_DIR);
|
||||
GenerateYuzuPath(YuzuPath::KeysDir, citron_path / KEYS_DIR);
|
||||
GenerateYuzuPath(YuzuPath::LoadDir, citron_path / LOAD_DIR);
|
||||
GenerateYuzuPath(YuzuPath::LogDir, citron_path / LOG_DIR);
|
||||
GenerateYuzuPath(YuzuPath::NANDDir, citron_path / NAND_DIR);
|
||||
GenerateYuzuPath(YuzuPath::PlayTimeDir, citron_path / PLAY_TIME_DIR);
|
||||
GenerateYuzuPath(YuzuPath::ScreenshotsDir, citron_path / SCREENSHOTS_DIR);
|
||||
GenerateYuzuPath(YuzuPath::SDMCDir, citron_path / SDMC_DIR);
|
||||
GenerateYuzuPath(YuzuPath::ShaderDir, citron_path / SHADER_DIR);
|
||||
GenerateYuzuPath(YuzuPath::TASDir, citron_path / TAS_DIR);
|
||||
GenerateYuzuPath(YuzuPath::IconsDir, citron_path / ICONS_DIR);
|
||||
GenerateCitronPath(CitronPath::CitronDir, citron_path);
|
||||
GenerateCitronPath(CitronPath::AmiiboDir, citron_path / AMIIBO_DIR);
|
||||
GenerateCitronPath(CitronPath::CacheDir, citron_path_cache);
|
||||
GenerateCitronPath(CitronPath::ConfigDir, citron_path_config);
|
||||
GenerateCitronPath(CitronPath::CrashDumpsDir, citron_path / CRASH_DUMPS_DIR);
|
||||
GenerateCitronPath(CitronPath::DumpDir, citron_path / DUMP_DIR);
|
||||
GenerateCitronPath(CitronPath::KeysDir, citron_path / KEYS_DIR);
|
||||
GenerateCitronPath(CitronPath::LoadDir, citron_path / LOAD_DIR);
|
||||
GenerateCitronPath(CitronPath::LogDir, citron_path / LOG_DIR);
|
||||
GenerateCitronPath(CitronPath::NANDDir, citron_path / NAND_DIR);
|
||||
GenerateCitronPath(CitronPath::PlayTimeDir, citron_path / PLAY_TIME_DIR);
|
||||
GenerateCitronPath(CitronPath::ScreenshotsDir, citron_path / SCREENSHOTS_DIR);
|
||||
GenerateCitronPath(CitronPath::SDMCDir, citron_path / SDMC_DIR);
|
||||
GenerateCitronPath(CitronPath::ShaderDir, citron_path / SHADER_DIR);
|
||||
GenerateCitronPath(CitronPath::TASDir, citron_path / TAS_DIR);
|
||||
GenerateCitronPath(CitronPath::IconsDir, citron_path / ICONS_DIR);
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -140,13 +140,13 @@ private:
|
||||
|
||||
~PathManagerImpl() = default;
|
||||
|
||||
void GenerateYuzuPath(YuzuPath citron_path, const fs::path& new_path) {
|
||||
void GenerateCitronPath(CitronPath citron_path, const fs::path& new_path) {
|
||||
void(FS::CreateDir(new_path));
|
||||
|
||||
SetYuzuPathImpl(citron_path, new_path);
|
||||
SetCitronPathImpl(citron_path, new_path);
|
||||
}
|
||||
|
||||
std::unordered_map<YuzuPath, fs::path> citron_paths;
|
||||
std::unordered_map<CitronPath, fs::path> citron_paths;
|
||||
};
|
||||
|
||||
bool ValidatePath(const fs::path& path) {
|
||||
@@ -230,22 +230,22 @@ void SetAppDirectory(const std::string& app_directory) {
|
||||
PathManagerImpl::GetInstance().Reinitialize(app_directory);
|
||||
}
|
||||
|
||||
const fs::path& GetYuzuPath(YuzuPath citron_path) {
|
||||
return PathManagerImpl::GetInstance().GetYuzuPathImpl(citron_path);
|
||||
const fs::path& GetCitronPath(CitronPath citron_path) {
|
||||
return PathManagerImpl::GetInstance().GetCitronPathImpl(citron_path);
|
||||
}
|
||||
|
||||
std::string GetYuzuPathString(YuzuPath citron_path) {
|
||||
return PathToUTF8String(GetYuzuPath(citron_path));
|
||||
std::string GetCitronPathString(CitronPath citron_path) {
|
||||
return PathToUTF8String(GetCitronPath(citron_path));
|
||||
}
|
||||
|
||||
void SetYuzuPath(YuzuPath citron_path, const fs::path& new_path) {
|
||||
void SetCitronPath(CitronPath citron_path, const fs::path& new_path) {
|
||||
if (!FS::IsDir(new_path)) {
|
||||
LOG_ERROR(Common_Filesystem, "Filesystem object at new_path={} is not a directory",
|
||||
PathToUTF8String(new_path));
|
||||
return;
|
||||
}
|
||||
|
||||
PathManagerImpl::GetInstance().SetYuzuPathImpl(citron_path, new_path);
|
||||
PathManagerImpl::GetInstance().SetCitronPathImpl(citron_path, new_path);
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
|
||||
namespace Common::FS {
|
||||
|
||||
enum class YuzuPath {
|
||||
YuzuDir, // Where citron stores its data.
|
||||
enum class CitronPath {
|
||||
CitronDir, // Where citron stores its data.
|
||||
AmiiboDir, // Where Amiibo backups are stored.
|
||||
CacheDir, // Where cached filesystem data is stored.
|
||||
ConfigDir, // Where config files are stored.
|
||||
@@ -193,39 +193,39 @@ template <typename Path>
|
||||
void SetAppDirectory(const std::string& app_directory);
|
||||
|
||||
/**
|
||||
* Gets the filesystem path associated with the YuzuPath enum.
|
||||
* Gets the filesystem path associated with the CitronPath enum.
|
||||
*
|
||||
* @param citron_path YuzuPath enum
|
||||
* @param citron_path CitronPath enum
|
||||
*
|
||||
* @returns The filesystem path associated with the YuzuPath enum.
|
||||
* @returns The filesystem path associated with the CitronPath enum.
|
||||
*/
|
||||
[[nodiscard]] const std::filesystem::path& GetYuzuPath(YuzuPath citron_path);
|
||||
[[nodiscard]] const std::filesystem::path& GetCitronPath(CitronPath citron_path);
|
||||
|
||||
/**
|
||||
* Gets the filesystem path associated with the YuzuPath enum as a UTF-8 encoded std::string.
|
||||
* Gets the filesystem path associated with the CitronPath enum as a UTF-8 encoded std::string.
|
||||
*
|
||||
* @param citron_path YuzuPath enum
|
||||
* @param citron_path CitronPath enum
|
||||
*
|
||||
* @returns The filesystem path associated with the YuzuPath enum as a UTF-8 encoded std::string.
|
||||
* @returns The filesystem path associated with the CitronPath enum as a UTF-8 encoded std::string.
|
||||
*/
|
||||
[[nodiscard]] std::string GetYuzuPathString(YuzuPath citron_path);
|
||||
[[nodiscard]] std::string GetCitronPathString(CitronPath citron_path);
|
||||
|
||||
/**
|
||||
* Sets a new filesystem path associated with the YuzuPath enum.
|
||||
* Sets a new filesystem path associated with the CitronPath enum.
|
||||
* If the filesystem object at new_path is not a directory, this function will not do anything.
|
||||
*
|
||||
* @param citron_path YuzuPath enum
|
||||
* @param citron_path CitronPath enum
|
||||
* @param new_path New filesystem path
|
||||
*/
|
||||
void SetYuzuPath(YuzuPath citron_path, const std::filesystem::path& new_path);
|
||||
void SetCitronPath(CitronPath citron_path, const std::filesystem::path& new_path);
|
||||
|
||||
#ifdef _WIN32
|
||||
template <typename Path>
|
||||
void SetYuzuPath(YuzuPath citron_path, const Path& new_path) {
|
||||
void SetCitronPath(CitronPath citron_path, const Path& new_path) {
|
||||
if constexpr (IsChar<typename Path::value_type>) {
|
||||
SetYuzuPath(citron_path, ToU8String(new_path));
|
||||
SetCitronPath(citron_path, ToU8String(new_path));
|
||||
} else {
|
||||
SetYuzuPath(citron_path, std::filesystem::path{new_path});
|
||||
SetCitronPath(citron_path, std::filesystem::path{new_path});
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -288,11 +288,11 @@ enum class DirectorySeparator {
|
||||
};
|
||||
|
||||
// Splits the path on '/' or '\' and put the components into a vector
|
||||
// i.e. "C:\Users\Yuzu\Documents\save.bin" becomes {"C:", "Users", "Yuzu", "Documents", "save.bin" }
|
||||
// i.e. "C:\Users\Citron\Documents\save.bin" becomes {"C:", "Users", "Citron", "Documents", "save.bin" }
|
||||
[[nodiscard]] std::vector<std::string_view> SplitPathComponents(std::string_view filename);
|
||||
|
||||
// Splits the path on '/' or '\' and put the components into a vector
|
||||
// i.e. "C:\Users\Yuzu\Documents\save.bin" becomes {"C:", "Users", "Yuzu", "Documents", "save.bin" }
|
||||
// i.e. "C:\Users\Citron\Documents\save.bin" becomes {"C:", "Users", "Citron", "Documents", "save.bin" }
|
||||
[[nodiscard]] std::vector<std::string> SplitPathComponentsCopy(std::string_view filename);
|
||||
|
||||
// Removes trailing slash, makes all '\\' into '/', and removes duplicate '/'. Makes '/' into '\\'
|
||||
|
||||
@@ -195,7 +195,7 @@ public:
|
||||
return;
|
||||
}
|
||||
using namespace Common::FS;
|
||||
const auto& log_dir = GetYuzuPath(YuzuPath::LogDir);
|
||||
const auto& log_dir = GetCitronPath(CitronPath::LogDir);
|
||||
void(CreateDir(log_dir));
|
||||
Filter filter;
|
||||
filter.ParseFilterString(Settings::values.log_filter.GetValue());
|
||||
|
||||
@@ -138,7 +138,7 @@ void PrintMessageToLogcat(const Entry& entry) {
|
||||
case Level::Count:
|
||||
UNREACHABLE();
|
||||
}
|
||||
__android_log_print(android_log_priority, "YuzuNative", "%s", str.c_str());
|
||||
__android_log_print(android_log_priority, "CitronNative", "%s", str.c_str());
|
||||
#endif
|
||||
}
|
||||
} // namespace Common::Log
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Common {
|
||||
void ConfigureNvidiaEnvironmentFlags() {
|
||||
#ifdef _WIN32
|
||||
const auto nvidia_shader_dir =
|
||||
Common::FS::GetYuzuPath(Common::FS::YuzuPath::ShaderDir) / "nvidia";
|
||||
Common::FS::GetCitronPath(Common::FS::CitronPath::ShaderDir) / "nvidia";
|
||||
|
||||
if (!Common::FS::CreateDirs(nvidia_shader_dir)) {
|
||||
return;
|
||||
|
||||
@@ -130,11 +130,11 @@ void LogSettings() {
|
||||
log_setting(name, setting->Canonicalize());
|
||||
}
|
||||
}
|
||||
log_path("DataStorage_CacheDir", Common::FS::GetYuzuPath(Common::FS::YuzuPath::CacheDir));
|
||||
log_path("DataStorage_ConfigDir", Common::FS::GetYuzuPath(Common::FS::YuzuPath::ConfigDir));
|
||||
log_path("DataStorage_LoadDir", Common::FS::GetYuzuPath(Common::FS::YuzuPath::LoadDir));
|
||||
log_path("DataStorage_NANDDir", Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir));
|
||||
log_path("DataStorage_SDMCDir", Common::FS::GetYuzuPath(Common::FS::YuzuPath::SDMCDir));
|
||||
log_path("DataStorage_CacheDir", Common::FS::GetCitronPath(Common::FS::CitronPath::CacheDir));
|
||||
log_path("DataStorage_ConfigDir", Common::FS::GetCitronPath(Common::FS::CitronPath::ConfigDir));
|
||||
log_path("DataStorage_LoadDir", Common::FS::GetCitronPath(Common::FS::CitronPath::LoadDir));
|
||||
log_path("DataStorage_NANDDir", Common::FS::GetCitronPath(Common::FS::CitronPath::NANDDir));
|
||||
log_path("DataStorage_SDMCDir", Common::FS::GetCitronPath(Common::FS::CitronPath::SDMCDir));
|
||||
}
|
||||
|
||||
void UpdateGPUAccuracy() {
|
||||
|
||||
@@ -372,7 +372,7 @@ Key128 DeriveKeyblobMACKey(const Key128& keyblob_key, const Key128& mac_source)
|
||||
|
||||
std::optional<Key128> DeriveSDSeed() {
|
||||
const auto system_save_43_path =
|
||||
Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / "system/save/8000000000000043";
|
||||
Common::FS::GetCitronPath(Common::FS::CitronPath::NANDDir) / "system/save/8000000000000043";
|
||||
const Common::FS::IOFile save_43{system_save_43_path, Common::FS::FileAccessMode::Read,
|
||||
Common::FS::FileType::BinaryFile};
|
||||
|
||||
@@ -381,7 +381,7 @@ std::optional<Key128> DeriveSDSeed() {
|
||||
}
|
||||
|
||||
const auto sd_private_path =
|
||||
Common::FS::GetYuzuPath(Common::FS::YuzuPath::SDMCDir) / "Nintendo/Contents/private";
|
||||
Common::FS::GetCitronPath(Common::FS::CitronPath::SDMCDir) / "Nintendo/Contents/private";
|
||||
|
||||
const Common::FS::IOFile sd_private{sd_private_path, Common::FS::FileAccessMode::Read,
|
||||
Common::FS::FileType::BinaryFile};
|
||||
@@ -640,7 +640,7 @@ KeyManager::KeyManager() {
|
||||
|
||||
void KeyManager::ReloadKeys() {
|
||||
// Initialize keys
|
||||
const auto citron_keys_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::KeysDir);
|
||||
const auto citron_keys_dir = Common::FS::GetCitronPath(Common::FS::CitronPath::KeysDir);
|
||||
|
||||
if (!Common::FS::CreateDir(citron_keys_dir)) {
|
||||
LOG_ERROR(Core, "Failed to create the keys directory.");
|
||||
@@ -847,7 +847,7 @@ Key256 KeyManager::GetBISKey(u8 partition_id) const {
|
||||
template <size_t Size>
|
||||
void KeyManager::WriteKeyToFile(KeyCategory category, std::string_view keyname,
|
||||
const std::array<u8, Size>& key) {
|
||||
const auto citron_keys_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::KeysDir);
|
||||
const auto citron_keys_dir = Common::FS::GetCitronPath(Common::FS::CitronPath::KeysDir);
|
||||
|
||||
std::string filename = "title.keys_autogenerated";
|
||||
|
||||
@@ -869,7 +869,7 @@ void KeyManager::WriteKeyToFile(KeyCategory category, std::string_view keyname,
|
||||
|
||||
if (add_info_text) {
|
||||
void(file.WriteString(
|
||||
"# This file is autogenerated by Yuzu\n"
|
||||
"# This file is autogenerated by Citron\n"
|
||||
"# It serves to store keys that were automatically generated from the normal keys\n"
|
||||
"# If you are experiencing issues involving keys, it may help to delete this file\n"));
|
||||
}
|
||||
@@ -947,7 +947,7 @@ void KeyManager::SetKey(S256KeyType id, Key256 key, u64 field1, u64 field2) {
|
||||
}
|
||||
|
||||
bool KeyManager::KeyFileExists(bool title) {
|
||||
const auto citron_keys_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::KeysDir);
|
||||
const auto citron_keys_dir = Common::FS::GetCitronPath(Common::FS::CitronPath::KeysDir);
|
||||
|
||||
if (title) {
|
||||
return Common::FS::Exists(citron_keys_dir / "title.keys");
|
||||
@@ -1197,7 +1197,7 @@ void KeyManager::PopulateTickets() {
|
||||
std::vector<Ticket> tickets;
|
||||
|
||||
const auto system_save_e1_path =
|
||||
Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / "system/save/80000000000000e1";
|
||||
Common::FS::GetCitronPath(Common::FS::CitronPath::NANDDir) / "system/save/80000000000000e1";
|
||||
if (Common::FS::Exists(system_save_e1_path)) {
|
||||
const Common::FS::IOFile save_e1{system_save_e1_path, Common::FS::FileAccessMode::Read,
|
||||
Common::FS::FileType::BinaryFile};
|
||||
@@ -1206,7 +1206,7 @@ void KeyManager::PopulateTickets() {
|
||||
}
|
||||
|
||||
const auto system_save_e2_path =
|
||||
Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / "system/save/80000000000000e2";
|
||||
Common::FS::GetCitronPath(Common::FS::CitronPath::NANDDir) / "system/save/80000000000000e2";
|
||||
if (Common::FS::Exists(system_save_e2_path)) {
|
||||
const Common::FS::IOFile save_e2{system_save_e2_path, Common::FS::FileAccessMode::Read,
|
||||
Common::FS::FileType::BinaryFile};
|
||||
|
||||
@@ -83,7 +83,7 @@ VirtualFile BISFactory::OpenPartitionStorage(BisPartitionId id,
|
||||
VirtualFilesystem file_system) const {
|
||||
auto& keys = Core::Crypto::KeyManager::Instance();
|
||||
Core::Crypto::PartitionDataManager pdm{file_system->OpenDirectory(
|
||||
Common::FS::GetYuzuPathString(Common::FS::YuzuPath::NANDDir), OpenMode::Read)};
|
||||
Common::FS::GetCitronPathString(Common::FS::CitronPath::NANDDir), OpenMode::Read)};
|
||||
keys.PopulateFromPartitionData(pdm);
|
||||
|
||||
switch (id) {
|
||||
|
||||
@@ -437,7 +437,7 @@ void RegisteredCache::ProcessFiles(const std::vector<NcaID>& ids) {
|
||||
}
|
||||
}
|
||||
|
||||
void RegisteredCache::AccumulateYuzuMeta() {
|
||||
void RegisteredCache::AccumulateCitronMeta() {
|
||||
const auto meta_dir = dir->GetSubdirectory("citron_meta");
|
||||
if (meta_dir == nullptr) {
|
||||
return;
|
||||
@@ -460,7 +460,7 @@ void RegisteredCache::Refresh() {
|
||||
|
||||
const auto ids = AccumulateFiles();
|
||||
ProcessFiles(ids);
|
||||
AccumulateYuzuMeta();
|
||||
AccumulateCitronMeta();
|
||||
}
|
||||
|
||||
RegisteredCache::RegisteredCache(VirtualDir dir_, ContentProviderParsingFunction parsing_function)
|
||||
@@ -668,7 +668,7 @@ InstallResult RegisteredCache::InstallEntry(const NCA& nca, TitleType type,
|
||||
mbedtls_sha256_ret(data.data(), data.size(), c_rec.hash.data(), 0);
|
||||
std::memcpy(&c_rec.nca_id, &c_rec.hash, 16);
|
||||
const CNMT new_cnmt(header, opt_header, {c_rec}, {});
|
||||
if (!RawInstallYuzuMeta(new_cnmt)) {
|
||||
if (!RawInstallCitronMeta(new_cnmt)) {
|
||||
return InstallResult::ErrorMetaFailed;
|
||||
}
|
||||
return RawInstallNCA(nca, copy, overwrite_if_exists, c_rec.nca_id);
|
||||
@@ -693,7 +693,7 @@ InstallResult RegisteredCache::InstallEntry(const NCA& nca, const CNMTHeader& ba
|
||||
};
|
||||
const OptionalHeader opt_header{0, 0};
|
||||
const CNMT new_cnmt(header, opt_header, {base_record}, {});
|
||||
if (!RawInstallYuzuMeta(new_cnmt)) {
|
||||
if (!RawInstallCitronMeta(new_cnmt)) {
|
||||
return InstallResult::ErrorMetaFailed;
|
||||
}
|
||||
return RawInstallNCA(nca, copy, overwrite_if_exists, base_record.nca_id);
|
||||
@@ -802,7 +802,7 @@ InstallResult RegisteredCache::RawInstallNCA(const NCA& nca, const VfsCopyFuncti
|
||||
: InstallResult::ErrorCopyFailed;
|
||||
}
|
||||
|
||||
bool RegisteredCache::RawInstallYuzuMeta(const CNMT& cnmt) {
|
||||
bool RegisteredCache::RawInstallCitronMeta(const CNMT& cnmt) {
|
||||
// Reasoning behind this method can be found in the comment for InstallEntry, NCA overload.
|
||||
const auto meta_dir = dir->CreateDirectoryRelative("citron_meta");
|
||||
const auto filename = GetCNMTName(cnmt.GetType(), cnmt.GetTitleID());
|
||||
|
||||
@@ -184,13 +184,13 @@ private:
|
||||
std::function<bool(const CNMT&, const ContentRecord&)> filter) const;
|
||||
std::vector<NcaID> AccumulateFiles() const;
|
||||
void ProcessFiles(const std::vector<NcaID>& ids);
|
||||
void AccumulateYuzuMeta();
|
||||
void AccumulateCitronMeta();
|
||||
std::optional<NcaID> GetNcaIDFromMetadata(u64 title_id, ContentRecordType type) const;
|
||||
VirtualFile GetFileAtID(NcaID id) const;
|
||||
VirtualFile OpenFileOrDirectoryConcat(const VirtualDir& open_dir, std::string_view path) const;
|
||||
InstallResult RawInstallNCA(const NCA& nca, const VfsCopyFunction& copy,
|
||||
bool overwrite_if_exists, std::optional<NcaID> override_id = {});
|
||||
bool RawInstallYuzuMeta(const CNMT& cnmt);
|
||||
bool RawInstallCitronMeta(const CNMT& cnmt);
|
||||
|
||||
VirtualDir dir;
|
||||
ContentProviderParsingFunction parser;
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Service::Account {
|
||||
constexpr std::size_t THUMBNAIL_SIZE = 0x24000;
|
||||
|
||||
static std::filesystem::path GetImagePath(const Common::UUID& uuid) {
|
||||
return Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) /
|
||||
return Common::FS::GetCitronPath(Common::FS::CitronPath::NANDDir) /
|
||||
fmt::format("system/save/8000000000000010/su/avators/{}.jpg", uuid.FormattedString());
|
||||
}
|
||||
|
||||
@@ -833,7 +833,7 @@ Result Module::Interface::InitializeApplicationInfoBase() {
|
||||
case FileSys::StorageId::Host:
|
||||
case FileSys::StorageId::NandUser:
|
||||
case FileSys::StorageId::SdCard:
|
||||
case FileSys::StorageId::None: // Yuzu specific, differs from hardware
|
||||
case FileSys::StorageId::None: // Citron specific, differs from hardware
|
||||
application_info.application_type = ApplicationType::Digital;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -377,7 +377,7 @@ bool ProfileManager::SetProfileBaseAndData(Common::UUID uuid, const ProfileBase&
|
||||
}
|
||||
|
||||
void ProfileManager::ParseUserSaveFile() {
|
||||
const auto save_path(FS::GetYuzuPath(FS::YuzuPath::NANDDir) / ACC_SAVE_AVATORS_BASE_PATH /
|
||||
const auto save_path(FS::GetCitronPath(FS::CitronPath::NANDDir) / ACC_SAVE_AVATORS_BASE_PATH /
|
||||
"profiles.dat");
|
||||
const FS::IOFile save(save_path, FS::FileAccessMode::Read, FS::FileType::BinaryFile);
|
||||
|
||||
@@ -429,12 +429,12 @@ void ProfileManager::WriteUserSaveFile() {
|
||||
};
|
||||
}
|
||||
|
||||
const auto raw_path(FS::GetYuzuPath(FS::YuzuPath::NANDDir) / "system/save/8000000000000010");
|
||||
const auto raw_path(FS::GetCitronPath(FS::CitronPath::NANDDir) / "system/save/8000000000000010");
|
||||
if (FS::IsFile(raw_path) && !FS::RemoveFile(raw_path)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const auto save_path(FS::GetYuzuPath(FS::YuzuPath::NANDDir) / ACC_SAVE_AVATORS_BASE_PATH /
|
||||
const auto save_path(FS::GetCitronPath(FS::CitronPath::NANDDir) / ACC_SAVE_AVATORS_BASE_PATH /
|
||||
"profiles.dat");
|
||||
|
||||
if (!FS::CreateParentDirs(save_path)) {
|
||||
|
||||
@@ -155,7 +155,7 @@ void ExtractSharedFonts(Core::System& system) {
|
||||
"FontNintendoExtended2.ttf",
|
||||
};
|
||||
|
||||
const auto fonts_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::CacheDir) / "fonts";
|
||||
const auto fonts_dir = Common::FS::GetCitronPath(Common::FS::CitronPath::CacheDir) / "fonts";
|
||||
|
||||
for (std::size_t i = 0; i < NS::SHARED_FONTS.size(); ++i) {
|
||||
const auto font_file_path = fonts_dir / DECRYPTED_SHARED_FONTS[i];
|
||||
@@ -415,7 +415,7 @@ void WebBrowser::InitializeOffline() {
|
||||
"system_data",
|
||||
};
|
||||
|
||||
offline_cache_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::CacheDir) /
|
||||
offline_cache_dir = Common::FS::GetCitronPath(Common::FS::CitronPath::CacheDir) /
|
||||
fmt::format("offline_web_applet_{}/{:016X}",
|
||||
RESOURCE_TYPES[static_cast<u32>(document_kind) - 1], title_id);
|
||||
|
||||
|
||||
@@ -353,7 +353,7 @@ Result ISelfController::GetAccumulatedSuspendedTickValue(
|
||||
LOG_DEBUG(Service_AM, "called.");
|
||||
|
||||
// This command returns the total number of system ticks since ISelfController creation
|
||||
// where the game was suspended. Since Yuzu doesn't implement game suspension, this command
|
||||
// where the game was suspended. Since Citron doesn't implement game suspension, this command
|
||||
// can just always return 0 ticks.
|
||||
std::scoped_lock lk{m_applet->lock};
|
||||
*out_accumulated_suspended_tick_value = m_applet->suspended_ticks;
|
||||
|
||||
@@ -303,7 +303,7 @@ void AlbumManager::FindScreenshots() {
|
||||
album_files.clear();
|
||||
|
||||
// TODO: Swap this with a blocking operation.
|
||||
const auto screenshots_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::ScreenshotsDir);
|
||||
const auto screenshots_dir = Common::FS::GetCitronPath(Common::FS::CitronPath::ScreenshotsDir);
|
||||
Common::FS::IterateDirEntries(
|
||||
screenshots_dir,
|
||||
[this](const std::filesystem::path& full_path) {
|
||||
@@ -438,7 +438,7 @@ static void PNGToMemory(void* context, void* data, int len) {
|
||||
Result AlbumManager::SaveImage(ApplicationAlbumEntry& out_entry, std::span<const u8> image,
|
||||
u64 title_id, const AlbumFileDateTime& date) const {
|
||||
const auto screenshot_path =
|
||||
Common::FS::GetYuzuPathString(Common::FS::YuzuPath::ScreenshotsDir);
|
||||
Common::FS::GetCitronPathString(Common::FS::CitronPath::ScreenshotsDir);
|
||||
const std::string formatted_date =
|
||||
fmt::format("{:04}-{:02}-{:02}_{:02}-{:02}-{:02}-{:03}", date.year, date.month, date.day,
|
||||
date.hour, date.minute, date.second, 0);
|
||||
|
||||
@@ -66,7 +66,7 @@ enum class FatalType : u32 {
|
||||
static void GenerateErrorReport(Core::System& system, Result error_code, const FatalInfo& info) {
|
||||
const auto title_id = system.GetApplicationProcessProgramID();
|
||||
std::string crash_report = fmt::format(
|
||||
"Yuzu {}-{} crash report\n"
|
||||
"Citron {}-{} crash report\n"
|
||||
"Title ID: {:016x}\n"
|
||||
"Result: 0x{:X} ({:04}-{:04d})\n"
|
||||
"Set flags: 0x{:16X}\n"
|
||||
|
||||
@@ -346,12 +346,12 @@ std::shared_ptr<SaveDataController> FileSystemController::OpenSaveDataController
|
||||
|
||||
std::shared_ptr<FileSys::SaveDataFactory> FileSystemController::CreateSaveDataFactory(
|
||||
ProgramId program_id) {
|
||||
using YuzuPath = Common::FS::YuzuPath;
|
||||
using CitronPath = Common::FS::CitronPath;
|
||||
const auto rw_mode = FileSys::OpenMode::ReadWrite;
|
||||
|
||||
auto vfs = system.GetFilesystem();
|
||||
const auto nand_directory =
|
||||
vfs->OpenDirectory(Common::FS::GetYuzuPathString(YuzuPath::NANDDir), rw_mode);
|
||||
vfs->OpenDirectory(Common::FS::GetCitronPathString(CitronPath::NANDDir), rw_mode);
|
||||
return std::make_shared<FileSys::SaveDataFactory>(system, program_id,
|
||||
std::move(nand_directory));
|
||||
}
|
||||
@@ -683,20 +683,20 @@ void FileSystemController::CreateFactories(FileSys::VfsFilesystem& vfs, bool ove
|
||||
sdmc_factory = nullptr;
|
||||
}
|
||||
|
||||
using YuzuPath = Common::FS::YuzuPath;
|
||||
const auto sdmc_dir_path = Common::FS::GetYuzuPath(YuzuPath::SDMCDir);
|
||||
using CitronPath = Common::FS::CitronPath;
|
||||
const auto sdmc_dir_path = Common::FS::GetCitronPath(CitronPath::SDMCDir);
|
||||
const auto sdmc_load_dir_path = sdmc_dir_path / "atmosphere/contents";
|
||||
const auto rw_mode = FileSys::OpenMode::ReadWrite;
|
||||
|
||||
auto nand_directory =
|
||||
vfs.OpenDirectory(Common::FS::GetYuzuPathString(YuzuPath::NANDDir), rw_mode);
|
||||
vfs.OpenDirectory(Common::FS::GetCitronPathString(CitronPath::NANDDir), rw_mode);
|
||||
auto sd_directory = vfs.OpenDirectory(Common::FS::PathToUTF8String(sdmc_dir_path), rw_mode);
|
||||
auto load_directory = vfs.OpenDirectory(Common::FS::GetYuzuPathString(YuzuPath::LoadDir),
|
||||
auto load_directory = vfs.OpenDirectory(Common::FS::GetCitronPathString(CitronPath::LoadDir),
|
||||
FileSys::OpenMode::Read);
|
||||
auto sd_load_directory = vfs.OpenDirectory(Common::FS::PathToUTF8String(sdmc_load_dir_path),
|
||||
FileSys::OpenMode::Read);
|
||||
auto dump_directory =
|
||||
vfs.OpenDirectory(Common::FS::GetYuzuPathString(YuzuPath::DumpDir), rw_mode);
|
||||
vfs.OpenDirectory(Common::FS::GetCitronPathString(CitronPath::DumpDir), rw_mode);
|
||||
|
||||
if (bis_factory == nullptr) {
|
||||
bis_factory = std::make_unique<FileSys::BISFactory>(
|
||||
|
||||
@@ -109,7 +109,7 @@ protected:
|
||||
void SendPacket(const Network::LDNPacket& packet);
|
||||
|
||||
static const LanEventFunc empty_func;
|
||||
static constexpr Ssid fake_ssid{"YuzuFakeSsidForLdn"};
|
||||
static constexpr Ssid fake_ssid{"CitronFakeSsidForLdn"};
|
||||
|
||||
bool inited{};
|
||||
std::mutex packet_mutex;
|
||||
|
||||
@@ -22,9 +22,9 @@ DatabaseManager::DatabaseManager() {}
|
||||
Result DatabaseManager::MountSaveData() {
|
||||
if (!is_save_data_mounted) {
|
||||
system_save_dir =
|
||||
Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / "system/save/8000000000000030";
|
||||
Common::FS::GetCitronPath(Common::FS::CitronPath::NANDDir) / "system/save/8000000000000030";
|
||||
if (is_test_db) {
|
||||
system_save_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) /
|
||||
system_save_dir = Common::FS::GetCitronPath(Common::FS::CitronPath::NANDDir) /
|
||||
"system/save/8000000000000031";
|
||||
}
|
||||
|
||||
|
||||
@@ -271,7 +271,7 @@ void Cipher(const DerivedKeys& keys, const NTAG215File& in_data, NTAG215File& ou
|
||||
}
|
||||
|
||||
bool LoadKeys(InternalKey& locked_secret, InternalKey& unfixed_info) {
|
||||
const auto citron_keys_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::KeysDir);
|
||||
const auto citron_keys_dir = Common::FS::GetCitronPath(Common::FS::CitronPath::KeysDir);
|
||||
|
||||
const Common::FS::IOFile keys_file{citron_keys_dir / "key_retail.bin",
|
||||
Common::FS::FileAccessMode::Read,
|
||||
@@ -295,7 +295,7 @@ bool LoadKeys(InternalKey& locked_secret, InternalKey& unfixed_info) {
|
||||
}
|
||||
|
||||
bool IsKeyAvailable() {
|
||||
const auto citron_keys_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::KeysDir);
|
||||
const auto citron_keys_dir = Common::FS::GetCitronPath(Common::FS::CitronPath::KeysDir);
|
||||
return Common::FS::Exists(citron_keys_dir / "key_retail.bin");
|
||||
}
|
||||
|
||||
|
||||
@@ -1261,7 +1261,7 @@ Result NfcDevice::BreakTag(NFP::BreakType break_type) {
|
||||
Result NfcDevice::HasBackup(const UniqueSerialNumber& uid, std::size_t uuid_size) const {
|
||||
ASSERT_MSG(uuid_size < sizeof(UniqueSerialNumber), "Invalid UUID size");
|
||||
constexpr auto backup_dir = "backup";
|
||||
const auto citron_amiibo_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::AmiiboDir);
|
||||
const auto citron_amiibo_dir = Common::FS::GetCitronPath(Common::FS::CitronPath::AmiiboDir);
|
||||
const auto file_name =
|
||||
fmt::format("{0:02x}.bin", fmt::join(uid.begin(), uid.begin() + uuid_size, ""));
|
||||
|
||||
@@ -1282,7 +1282,7 @@ Result NfcDevice::ReadBackupData(const UniqueSerialNumber& uid, std::size_t uuid
|
||||
std::span<u8> data) const {
|
||||
ASSERT_MSG(uuid_size < sizeof(UniqueSerialNumber), "Invalid UUID size");
|
||||
constexpr auto backup_dir = "backup";
|
||||
const auto citron_amiibo_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::AmiiboDir);
|
||||
const auto citron_amiibo_dir = Common::FS::GetCitronPath(Common::FS::CitronPath::AmiiboDir);
|
||||
const auto file_name =
|
||||
fmt::format("{0:02x}.bin", fmt::join(uid.begin(), uid.begin() + uuid_size, ""));
|
||||
|
||||
@@ -1313,7 +1313,7 @@ Result NfcDevice::WriteBackupData(const UniqueSerialNumber& uid, std::size_t uui
|
||||
std::span<const u8> data) {
|
||||
ASSERT_MSG(uuid_size < sizeof(UniqueSerialNumber), "Invalid UUID size");
|
||||
constexpr auto backup_dir = "backup";
|
||||
const auto citron_amiibo_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::AmiiboDir);
|
||||
const auto citron_amiibo_dir = Common::FS::GetCitronPath(Common::FS::CitronPath::AmiiboDir);
|
||||
const auto file_name =
|
||||
fmt::format("{0:02x}.bin", fmt::join(uid.begin(), uid.begin() + uuid_size, ""));
|
||||
|
||||
|
||||
@@ -1308,25 +1308,25 @@ Result ISystemSettingsServer::SetPanelCrcMode(s32 panel_crc_mode) {
|
||||
|
||||
void ISystemSettingsServer::SetupSettings() {
|
||||
auto system_dir =
|
||||
Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / "system/save/8000000000000050";
|
||||
Common::FS::GetCitronPath(Common::FS::CitronPath::NANDDir) / "system/save/8000000000000050";
|
||||
if (!LoadSettingsFile(system_dir, []() { return DefaultSystemSettings(); })) {
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
auto private_dir =
|
||||
Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / "system/save/8000000000000052";
|
||||
Common::FS::GetCitronPath(Common::FS::CitronPath::NANDDir) / "system/save/8000000000000052";
|
||||
if (!LoadSettingsFile(private_dir, []() { return DefaultPrivateSettings(); })) {
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
auto device_dir =
|
||||
Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / "system/save/8000000000000053";
|
||||
Common::FS::GetCitronPath(Common::FS::CitronPath::NANDDir) / "system/save/8000000000000053";
|
||||
if (!LoadSettingsFile(device_dir, []() { return DefaultDeviceSettings(); })) {
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
auto appln_dir =
|
||||
Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / "system/save/8000000000000054";
|
||||
Common::FS::GetCitronPath(Common::FS::CitronPath::NANDDir) / "system/save/8000000000000054";
|
||||
if (!LoadSettingsFile(appln_dir, []() { return DefaultApplnSettings(); })) {
|
||||
ASSERT(false);
|
||||
}
|
||||
@@ -1334,25 +1334,25 @@ void ISystemSettingsServer::SetupSettings() {
|
||||
|
||||
void ISystemSettingsServer::StoreSettings() {
|
||||
auto system_dir =
|
||||
Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / "system/save/8000000000000050";
|
||||
Common::FS::GetCitronPath(Common::FS::CitronPath::NANDDir) / "system/save/8000000000000050";
|
||||
if (!StoreSettingsFile(system_dir, m_system_settings)) {
|
||||
LOG_ERROR(Service_SET, "Failed to store System settings");
|
||||
}
|
||||
|
||||
auto private_dir =
|
||||
Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / "system/save/8000000000000052";
|
||||
Common::FS::GetCitronPath(Common::FS::CitronPath::NANDDir) / "system/save/8000000000000052";
|
||||
if (!StoreSettingsFile(private_dir, m_private_settings)) {
|
||||
LOG_ERROR(Service_SET, "Failed to store Private settings");
|
||||
}
|
||||
|
||||
auto device_dir =
|
||||
Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / "system/save/8000000000000053";
|
||||
Common::FS::GetCitronPath(Common::FS::CitronPath::NANDDir) / "system/save/8000000000000053";
|
||||
if (!StoreSettingsFile(device_dir, m_device_settings)) {
|
||||
LOG_ERROR(Service_SET, "Failed to store Device settings");
|
||||
}
|
||||
|
||||
auto appln_dir =
|
||||
Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / "system/save/8000000000000054";
|
||||
Common::FS::GetCitronPath(Common::FS::CitronPath::NANDDir) / "system/save/8000000000000054";
|
||||
if (!StoreSettingsFile(appln_dir, m_appln_settings)) {
|
||||
LOG_ERROR(Service_SET, "Failed to store ApplLn settings");
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ static void OneTimeInit() {
|
||||
SCH_USE_STRONG_CRYPTO | // don't allow insecure protocols
|
||||
SCH_CRED_NO_SERVERNAME_CHECK | // don't validate server names
|
||||
SCH_CRED_NO_DEFAULT_CREDS; // don't automatically present a client certificate
|
||||
// ^ I'm assuming that nobody would want to connect Yuzu to a
|
||||
// ^ I'm assuming that nobody would want to connect Citron to a
|
||||
// service that requires some OS-provided corporate client
|
||||
// certificate, and presenting one to some arbitrary server
|
||||
// might be a privacy concern? Who knows, though.
|
||||
|
||||
@@ -39,7 +39,7 @@ PerfStats::~PerfStats() {
|
||||
std::copy(perf_history.begin() + IgnoreFrames, perf_history.begin() + current_index,
|
||||
std::ostream_iterator<double>(stream, "\n"));
|
||||
|
||||
const auto path = Common::FS::GetYuzuPath(Common::FS::YuzuPath::LogDir);
|
||||
const auto path = Common::FS::GetCitronPath(Common::FS::CitronPath::LogDir);
|
||||
// %F Date format expanded is "%Y-%m-%d"
|
||||
const auto filename = fmt::format("{:%F-%H-%M}_{:016X}.csv", *std::localtime(&t), title_id);
|
||||
const auto filepath = path / filename;
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
namespace {
|
||||
|
||||
std::filesystem::path GetPath(std::string_view type, u64 title_id, std::string_view timestamp) {
|
||||
return Common::FS::GetYuzuPath(Common::FS::YuzuPath::LogDir) / type /
|
||||
return Common::FS::GetCitronPath(Common::FS::CitronPath::LogDir) / type /
|
||||
fmt::format("{:016X}_{}.json", title_id, timestamp);
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ void SaveToFile(const json& json, const std::filesystem::path& filename) {
|
||||
file << std::setw(4) << json << std::endl;
|
||||
}
|
||||
|
||||
json GetYuzuVersionData() {
|
||||
json GetCitronVersionData() {
|
||||
return {
|
||||
{"scm_rev", std::string(Common::g_scm_rev)},
|
||||
{"scm_branch", std::string(Common::g_scm_branch)},
|
||||
@@ -112,7 +112,7 @@ json GetProcessorStateData(const std::string& architecture, u64 entry_point, u64
|
||||
json GetFullDataAuto(const std::string& timestamp, u64 title_id, Core::System& system) {
|
||||
json out;
|
||||
|
||||
out["citron_version"] = GetYuzuVersionData();
|
||||
out["citron_version"] = GetCitronVersionData();
|
||||
out["report_common"] = GetReportCommonData(title_id, ResultSuccess, timestamp);
|
||||
|
||||
return out;
|
||||
@@ -180,7 +180,7 @@ void Reporter::SaveCrashReport(u64 title_id, Result result, u64 set_flags, u64 e
|
||||
const auto timestamp = GetTimestamp();
|
||||
json out;
|
||||
|
||||
out["citron_version"] = GetYuzuVersionData();
|
||||
out["citron_version"] = GetCitronVersionData();
|
||||
out["report_common"] = GetReportCommonData(title_id, result, timestamp);
|
||||
|
||||
auto proc_out = GetProcessorStateData(arch, entry_point, sp, pc, pstate, registers, backtrace);
|
||||
@@ -291,7 +291,7 @@ void Reporter::SavePlayReport(PlayReportType type, u64 title_id,
|
||||
const auto timestamp = GetTimestamp();
|
||||
json out;
|
||||
|
||||
out["citron_version"] = GetYuzuVersionData();
|
||||
out["citron_version"] = GetCitronVersionData();
|
||||
out["report_common"] = GetReportCommonData(title_id, ResultSuccess, timestamp, user_id);
|
||||
|
||||
auto data_out = json::array();
|
||||
@@ -319,7 +319,7 @@ void Reporter::SaveErrorReport(u64 title_id, Result result,
|
||||
const auto timestamp = GetTimestamp();
|
||||
json out;
|
||||
|
||||
out["citron_version"] = GetYuzuVersionData();
|
||||
out["citron_version"] = GetCitronVersionData();
|
||||
out["report_common"] = GetReportCommonData(title_id, result, timestamp);
|
||||
|
||||
out["error_custom_text"] = {
|
||||
@@ -332,7 +332,7 @@ void Reporter::SaveErrorReport(u64 title_id, Result result,
|
||||
|
||||
void Reporter::SaveFSAccessLog(std::string_view log_message) const {
|
||||
const auto access_log_path =
|
||||
Common::FS::GetYuzuPath(Common::FS::YuzuPath::SDMCDir) / "FsAccessLog.txt";
|
||||
Common::FS::GetCitronPath(Common::FS::CitronPath::SDMCDir) / "FsAccessLog.txt";
|
||||
|
||||
void(Common::FS::AppendStringToFile(access_log_path, Common::FS::FileType::TextFile,
|
||||
log_message));
|
||||
@@ -352,7 +352,7 @@ void Reporter::SaveUserReport() const {
|
||||
|
||||
void Reporter::ClearFSAccessLog() const {
|
||||
const auto access_log_path =
|
||||
Common::FS::GetYuzuPath(Common::FS::YuzuPath::SDMCDir) / "FsAccessLog.txt";
|
||||
Common::FS::GetCitronPath(Common::FS::CitronPath::SDMCDir) / "FsAccessLog.txt";
|
||||
|
||||
Common::FS::IOFile access_log_file{access_log_path, Common::FS::FileAccessMode::Write,
|
||||
Common::FS::FileType::TextFile};
|
||||
|
||||
@@ -114,7 +114,7 @@ static constexpr const char* TranslateASTCDecodeMode(Settings::AstcDecodeMode mo
|
||||
|
||||
u64 GetTelemetryId() {
|
||||
u64 telemetry_id{};
|
||||
const auto filename = Common::FS::GetYuzuPath(Common::FS::YuzuPath::ConfigDir) / "telemetry_id";
|
||||
const auto filename = Common::FS::GetCitronPath(Common::FS::CitronPath::ConfigDir) / "telemetry_id";
|
||||
|
||||
bool generate_new_id = !Common::FS::Exists(filename);
|
||||
|
||||
@@ -156,7 +156,7 @@ u64 GetTelemetryId() {
|
||||
|
||||
u64 RegenerateTelemetryId() {
|
||||
const u64 new_telemetry_id{GenerateTelemetryId()};
|
||||
const auto filename = Common::FS::GetYuzuPath(Common::FS::YuzuPath::ConfigDir) / "telemetry_id";
|
||||
const auto filename = Common::FS::GetCitronPath(Common::FS::CitronPath::ConfigDir) / "telemetry_id";
|
||||
|
||||
Common::FS::IOFile file{filename, Common::FS::FileAccessMode::Write,
|
||||
Common::FS::FileType::BinaryFile};
|
||||
|
||||
@@ -72,7 +72,7 @@ static void PrintVersion() {
|
||||
}
|
||||
|
||||
/// The magic text at the beginning of a citron-room ban list file.
|
||||
static constexpr char BanListMagic[] = "YuzuRoom-BanList-1";
|
||||
static constexpr char BanListMagic[] = "CitronRoom-BanList-1";
|
||||
|
||||
static constexpr char token_delimiter{':'};
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ Config::Config(const ConfigType config_type)
|
||||
: type(config_type), global{config_type == ConfigType::GlobalConfig} {}
|
||||
|
||||
void Config::Initialize(const std::string& config_name) {
|
||||
const std::filesystem::path fs_config_loc = FS::GetYuzuPath(FS::YuzuPath::ConfigDir);
|
||||
const std::filesystem::path fs_config_loc = FS::GetCitronPath(FS::CitronPath::ConfigDir);
|
||||
const auto config_file = fmt::format("{}.ini", config_name);
|
||||
|
||||
switch (type) {
|
||||
@@ -51,7 +51,7 @@ void Config::Initialize(const std::string& config_name) {
|
||||
|
||||
void Config::Initialize(const std::optional<std::string> config_path) {
|
||||
const std::filesystem::path default_sdl_config_path =
|
||||
FS::GetYuzuPath(FS::YuzuPath::ConfigDir) / "sdl2-config.ini";
|
||||
FS::GetCitronPath(FS::CitronPath::ConfigDir) / "sdl2-config.ini";
|
||||
config_loc = config_path.value_or(FS::PathToUTF8String(default_sdl_config_path));
|
||||
void(FS::CreateParentDir(config_loc));
|
||||
SetUpIni();
|
||||
@@ -275,11 +275,11 @@ void Config::ReadCoreValues() {
|
||||
void Config::ReadDataStorageValues() {
|
||||
BeginGroup(Settings::TranslateCategory(Settings::Category::DataStorage));
|
||||
|
||||
FS::SetYuzuPath(FS::YuzuPath::NANDDir, ReadStringSetting(std::string("nand_directory")));
|
||||
FS::SetYuzuPath(FS::YuzuPath::SDMCDir, ReadStringSetting(std::string("sdmc_directory")));
|
||||
FS::SetYuzuPath(FS::YuzuPath::LoadDir, ReadStringSetting(std::string("load_directory")));
|
||||
FS::SetYuzuPath(FS::YuzuPath::DumpDir, ReadStringSetting(std::string("dump_directory")));
|
||||
FS::SetYuzuPath(FS::YuzuPath::TASDir, ReadStringSetting(std::string("tas_directory")));
|
||||
FS::SetCitronPath(FS::CitronPath::NANDDir, ReadStringSetting(std::string("nand_directory")));
|
||||
FS::SetCitronPath(FS::CitronPath::SDMCDir, ReadStringSetting(std::string("sdmc_directory")));
|
||||
FS::SetCitronPath(FS::CitronPath::LoadDir, ReadStringSetting(std::string("load_directory")));
|
||||
FS::SetCitronPath(FS::CitronPath::DumpDir, ReadStringSetting(std::string("dump_directory")));
|
||||
FS::SetCitronPath(FS::CitronPath::TASDir, ReadStringSetting(std::string("tas_directory")));
|
||||
|
||||
ReadCategory(Settings::Category::DataStorage);
|
||||
|
||||
@@ -371,7 +371,7 @@ void Config::ReadScreenshotValues() {
|
||||
BeginGroup(Settings::TranslateCategory(Settings::Category::Screenshots));
|
||||
|
||||
ReadCategory(Settings::Category::Screenshots);
|
||||
FS::SetYuzuPath(FS::YuzuPath::ScreenshotsDir,
|
||||
FS::SetCitronPath(FS::CitronPath::ScreenshotsDir,
|
||||
ReadStringSetting(std::string("screenshot_path")));
|
||||
|
||||
EndGroup();
|
||||
@@ -577,16 +577,16 @@ void Config::SaveCoreValues() {
|
||||
void Config::SaveDataStorageValues() {
|
||||
BeginGroup(Settings::TranslateCategory(Settings::Category::DataStorage));
|
||||
|
||||
WriteStringSetting(std::string("nand_directory"), FS::GetYuzuPathString(FS::YuzuPath::NANDDir),
|
||||
std::make_optional(FS::GetYuzuPathString(FS::YuzuPath::NANDDir)));
|
||||
WriteStringSetting(std::string("sdmc_directory"), FS::GetYuzuPathString(FS::YuzuPath::SDMCDir),
|
||||
std::make_optional(FS::GetYuzuPathString(FS::YuzuPath::SDMCDir)));
|
||||
WriteStringSetting(std::string("load_directory"), FS::GetYuzuPathString(FS::YuzuPath::LoadDir),
|
||||
std::make_optional(FS::GetYuzuPathString(FS::YuzuPath::LoadDir)));
|
||||
WriteStringSetting(std::string("dump_directory"), FS::GetYuzuPathString(FS::YuzuPath::DumpDir),
|
||||
std::make_optional(FS::GetYuzuPathString(FS::YuzuPath::DumpDir)));
|
||||
WriteStringSetting(std::string("tas_directory"), FS::GetYuzuPathString(FS::YuzuPath::TASDir),
|
||||
std::make_optional(FS::GetYuzuPathString(FS::YuzuPath::TASDir)));
|
||||
WriteStringSetting(std::string("nand_directory"), FS::GetCitronPathString(FS::CitronPath::NANDDir),
|
||||
std::make_optional(FS::GetCitronPathString(FS::CitronPath::NANDDir)));
|
||||
WriteStringSetting(std::string("sdmc_directory"), FS::GetCitronPathString(FS::CitronPath::SDMCDir),
|
||||
std::make_optional(FS::GetCitronPathString(FS::CitronPath::SDMCDir)));
|
||||
WriteStringSetting(std::string("load_directory"), FS::GetCitronPathString(FS::CitronPath::LoadDir),
|
||||
std::make_optional(FS::GetCitronPathString(FS::CitronPath::LoadDir)));
|
||||
WriteStringSetting(std::string("dump_directory"), FS::GetCitronPathString(FS::CitronPath::DumpDir),
|
||||
std::make_optional(FS::GetCitronPathString(FS::CitronPath::DumpDir)));
|
||||
WriteStringSetting(std::string("tas_directory"), FS::GetCitronPathString(FS::CitronPath::TASDir),
|
||||
std::make_optional(FS::GetCitronPathString(FS::CitronPath::TASDir)));
|
||||
|
||||
WriteCategory(Settings::Category::DataStorage);
|
||||
|
||||
@@ -679,7 +679,7 @@ void Config::SaveScreenshotValues() {
|
||||
BeginGroup(Settings::TranslateCategory(Settings::Category::Screenshots));
|
||||
|
||||
WriteStringSetting(std::string("screenshot_path"),
|
||||
FS::GetYuzuPathString(FS::YuzuPath::ScreenshotsDir));
|
||||
FS::GetCitronPathString(FS::CitronPath::ScreenshotsDir));
|
||||
WriteCategory(Settings::Category::Screenshots);
|
||||
|
||||
EndGroup();
|
||||
|
||||
@@ -28,8 +28,8 @@ void Android::RegisterController(jobject j_input_device) {
|
||||
auto env = Common::Android::GetEnvForThread();
|
||||
const std::string guid = Common::Android::GetJString(
|
||||
env, static_cast<jstring>(
|
||||
env->CallObjectMethod(j_input_device, Common::Android::GetYuzuDeviceGetGUID())));
|
||||
const s32 port = env->CallIntMethod(j_input_device, Common::Android::GetYuzuDeviceGetPort());
|
||||
env->CallObjectMethod(j_input_device, Common::Android::GetCitronDeviceGetGUID())));
|
||||
const s32 port = env->CallIntMethod(j_input_device, Common::Android::GetCitronDeviceGetPort());
|
||||
const auto identifier = GetIdentifier(guid, static_cast<size_t>(port));
|
||||
PreSetController(identifier);
|
||||
|
||||
@@ -81,7 +81,7 @@ bool Android::IsVibrationEnabled([[maybe_unused]] const PadIdentifier& identifie
|
||||
if (device != input_devices.end()) {
|
||||
return Common::Android::RunJNIOnFiber<bool>([&](JNIEnv* env) {
|
||||
return static_cast<bool>(env->CallBooleanMethod(
|
||||
device->second, Common::Android::GetYuzuDeviceGetSupportsVibration()));
|
||||
device->second, Common::Android::GetCitronDeviceGetSupportsVibration()));
|
||||
});
|
||||
}
|
||||
return false;
|
||||
@@ -92,7 +92,7 @@ std::vector<Common::ParamPackage> Android::GetInputDevices() const {
|
||||
auto env = Common::Android::GetEnvForThread();
|
||||
for (const auto& [key, value] : input_devices) {
|
||||
auto name_object = static_cast<jstring>(
|
||||
env->CallObjectMethod(value, Common::Android::GetYuzuDeviceGetName()));
|
||||
env->CallObjectMethod(value, Common::Android::GetCitronDeviceGetName()));
|
||||
const std::string name =
|
||||
fmt::format("{} {}", Common::Android::GetJString(env, name_object), key.port);
|
||||
devices.emplace_back(Common::ParamPackage{
|
||||
@@ -107,7 +107,7 @@ std::vector<Common::ParamPackage> Android::GetInputDevices() const {
|
||||
|
||||
std::set<s32> Android::GetDeviceAxes(JNIEnv* env, jobject& j_device) const {
|
||||
auto j_axes = static_cast<jobjectArray>(
|
||||
env->CallObjectMethod(j_device, Common::Android::GetYuzuDeviceGetAxes()));
|
||||
env->CallObjectMethod(j_device, Common::Android::GetCitronDeviceGetAxes()));
|
||||
std::set<s32> axes;
|
||||
for (int i = 0; i < env->GetArrayLength(j_axes); ++i) {
|
||||
jobject axis = env->GetObjectArrayElement(j_axes, i);
|
||||
@@ -215,7 +215,7 @@ ButtonMapping Android::GetButtonMappingForDevice(const Common::ParamPackage& par
|
||||
jintArray j_keys = env->NewIntArray(static_cast<int>(keycode_ids.size()));
|
||||
env->SetIntArrayRegion(j_keys, 0, static_cast<int>(keycode_ids.size()), keycode_ids.data());
|
||||
auto j_has_keys_object = static_cast<jbooleanArray>(
|
||||
env->CallObjectMethod(j_device, Common::Android::GetYuzuDeviceHasKeys(), j_keys));
|
||||
env->CallObjectMethod(j_device, Common::Android::GetCitronDeviceHasKeys(), j_keys));
|
||||
jboolean isCopy = false;
|
||||
jboolean* j_has_keys = env->GetBooleanArrayElements(j_has_keys_object, &isCopy);
|
||||
|
||||
@@ -359,7 +359,7 @@ void Android::SendVibrations(JNIEnv* env, std::stop_token token) {
|
||||
if (device != input_devices.end()) {
|
||||
float average_intensity = static_cast<float>(
|
||||
(request.vibration.high_amplitude + request.vibration.low_amplitude) / 2.0);
|
||||
env->CallVoidMethod(device->second, Common::Android::GetYuzuDeviceVibrate(),
|
||||
env->CallVoidMethod(device->second, Common::Android::GetCitronDeviceVibrate(),
|
||||
average_intensity);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ public:
|
||||
|
||||
/**
|
||||
* Registers controller number to accept new inputs.
|
||||
* @param j_input_device YuzuInputDevice object from the Android frontend to register.
|
||||
* @param j_input_device CitronInputDevice object from the Android frontend to register.
|
||||
*/
|
||||
void RegisterController(jobject j_input_device);
|
||||
|
||||
@@ -62,9 +62,9 @@ public:
|
||||
std::vector<Common::ParamPackage> GetInputDevices() const override;
|
||||
|
||||
/**
|
||||
* Gets the axes reported by the YuzuInputDevice.
|
||||
* Gets the axes reported by the CitronInputDevice.
|
||||
* @param env JNI environment pointer.
|
||||
* @param j_device YuzuInputDevice from the Android frontend.
|
||||
* @param j_device CitronInputDevice from the Android frontend.
|
||||
* @return Set of the axes reported by the underlying Android InputDevice
|
||||
*/
|
||||
std::set<s32> GetDeviceAxes(JNIEnv* env, jobject& j_device) const;
|
||||
|
||||
@@ -82,7 +82,7 @@ void Tas::LoadTasFile(size_t player_index, size_t file_index) {
|
||||
commands[player_index].clear();
|
||||
|
||||
std::string file = Common::FS::ReadStringFromFile(
|
||||
Common::FS::GetYuzuPath(Common::FS::YuzuPath::TASDir) /
|
||||
Common::FS::GetCitronPath(Common::FS::CitronPath::TASDir) /
|
||||
fmt::format("script{}-{}.txt", file_index, player_index + 1),
|
||||
Common::FS::FileType::BinaryFile);
|
||||
std::istringstream command_line(file);
|
||||
@@ -137,7 +137,7 @@ void Tas::WriteTasFile(std::u8string_view file_name) {
|
||||
WriteCommandAxis(line.l_axis), WriteCommandAxis(line.r_axis));
|
||||
}
|
||||
|
||||
const auto tas_file_name = Common::FS::GetYuzuPath(Common::FS::YuzuPath::TASDir) / file_name;
|
||||
const auto tas_file_name = Common::FS::GetCitronPath(Common::FS::CitronPath::TASDir) / file_name;
|
||||
const auto bytes_written =
|
||||
Common::FS::WriteStringToFile(tas_file_name, Common::FS::FileType::TextFile, output_text);
|
||||
if (bytes_written == output_text.size()) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user