mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-09-24 10:36:55 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2495f7894d | |||
| 8f4e9d8c34 | |||
| cb73a4dcc7 | |||
| 278f411dad | |||
| 3d37a816c6 | |||
| a25e32676f | |||
| 38df54edfe |
+33
-21
@@ -1,32 +1,44 @@
|
|||||||
# User Handbook - Command Line
|
# User Handbook - Command Line
|
||||||
|
|
||||||
There are two main applications, an SDL-based app (`eden-cli`) and a Qt based app (`eden`); both accept command line arguments.
|
There are two main applications, an SDL-based app (`eden-cli`) and a Qt based app (`eden`); both accept the same command line arguments.
|
||||||
|
|
||||||
## eden
|
|
||||||
|
|
||||||
- `./eden <path>`: Running with a single argument and nothing else, will make the emulator look for the given file and load it, this behavior is similar to `eden-cli`; allows dragging and dropping games into the application.
|
- `./eden <path>`: Running with a single argument and nothing else, will make the emulator look for the given file and load it, this behavior is similar to `eden-cli`; allows dragging and dropping games into the application.
|
||||||
- `-g <path>`: Alternate way to specify what to load, overrides. However let it be noted that arguments that use `-` will be treated as options/ignored, if your game, for some reason, starts with `-`, in order to safely handle it you may need to specify it as an argument.
|
- `--debug/-d`: Enter debug mode, allow gdb stub at port `1234`
|
||||||
- `-f`: Use fullscreen.
|
- `--config/-c`: Specify alternate configuration file.
|
||||||
- `-u <number>`: Select the index of the user to load as.
|
- `--fullscreen/-f`: Use fullscreen.
|
||||||
- `-input-profile <name>`: Specifies input profile name to use (for player #0 only).
|
- `--help/-h`: Display help.
|
||||||
|
- `--game/-g <path>`: Alternate way to specify what to load, overrides. However let it be noted that arguments that use `-` will be treated as options/ignored, if your game, for some reason, starts with `-`, in order to safely handle it you may need to specify it as an argument.
|
||||||
|
- `--multiplayer/-m`: Specify multiplayer options.
|
||||||
|
- `--program/-p`: Specify the program arguments to pass (optional).
|
||||||
|
- `--user/-u <number>`: Specify the user index.
|
||||||
|
- `--version/-v`: Display version and quit.
|
||||||
|
- `--input-profile/-i <name>`: Specifies input profile name to use (for player #0 only).
|
||||||
|
- `--null-render/-n`: Forces the usage of the "Null" render backend irrespective of settings.
|
||||||
|
- `--filter/-x`: Sets the debug log filter irrespective of settings.
|
||||||
|
- `--singlecore/-s`: Forces single-core regardless of settings.
|
||||||
|
|
||||||
|
Only the Qt frontend supports the following arguments:
|
||||||
|
|
||||||
- `-qlaunch`: Launch QLaunch.
|
- `-qlaunch`: Launch QLaunch.
|
||||||
- `-hlaunch`: Launch homebrew launcher `nx-hbloader`.
|
- `-hlaunch`: Launch homebrew launcher `nx-hbloader`.
|
||||||
- Requires a copy of Atmosphere to be extracted onto `sdmc`.
|
- Requires a copy of Atmosphere to be extracted onto `sdmc`.
|
||||||
- This is a shorthand for `<eden folder>/sdmc/atmosphere/hbl.nsp`.
|
- This is a shorthand for `<eden folder>/sdmc/atmosphere/hbl.nsp`.
|
||||||
- `-setup`: Launch setup applet.
|
- `-setup`: Launch setup applet.
|
||||||
|
|
||||||
## eden-cli
|
`eden` (provided with `--room`), and `eden-room` supports the following options as well:
|
||||||
|
|
||||||
- `--debug/-d`: Enter debug mode, allow gdb stub at port `1234`
|
- `-n/--room-name`: The name of the room.
|
||||||
- `--config/-c`: Specify alternate configuration file.
|
- `-d/--room-description`: The room description.
|
||||||
- `--fullscreen/-f`: Set fullscreen.
|
- `-s/--bind-address`: The bind address for the room.
|
||||||
- `--help/-h`: Display help.
|
- `-p/--port`: The port used for the room.
|
||||||
- `--game/-g`: Specify the game to run.
|
- `-m/--max-members`: The maximum number of players for this room.
|
||||||
- `--multiplayer/-m`: Specify multiplayer options.
|
- `-w/--password`: The password for the room.
|
||||||
- `--program/-p`: Specify the program arguments to pass (optional).
|
- `-g/--preferred-game`: The preferred game for this room.
|
||||||
- `--user/-u`: Specify the user index.
|
- `-i/--preferred-game-id`: The preferred game-id for this room.
|
||||||
- `--version/-v`: Display version and quit.
|
- `-u/--username`: The username used for announce.
|
||||||
- `--input-profile/-i`: Specifies input profile name to use (for player #0 only).
|
- `-t/--token`: The token used for announce.
|
||||||
- `--null-render/-n`: Forces the usage of the "Null" render backend irrespective of settings.
|
- `-a/--web-api-url`: yuzu Web API url.
|
||||||
- `--filter/-x`: Sets the debug log filter irrespective of settings.
|
- `-b/--ban-list-file`: The file for storing the room ban list.
|
||||||
- `--singlecore/-s`: Forces single-core regardless of settings.
|
- `-l/--log-file`: The file for storing the room log.
|
||||||
|
- `-h/--help`: Display this help and exit.
|
||||||
|
- `-v/--version`: Output version information and exit.
|
||||||
|
|||||||
@@ -16,16 +16,12 @@ import java.io.FileOutputStream
|
|||||||
import java.security.KeyStore
|
import java.security.KeyStore
|
||||||
import javax.net.ssl.TrustManagerFactory
|
import javax.net.ssl.TrustManagerFactory
|
||||||
import javax.net.ssl.X509TrustManager
|
import javax.net.ssl.X509TrustManager
|
||||||
import android.content.res.Configuration
|
|
||||||
import android.os.LocaleList
|
|
||||||
import org.yuzu.yuzu_emu.features.settings.model.IntSetting
|
|
||||||
import org.yuzu.yuzu_emu.utils.DirectoryInitialization
|
import org.yuzu.yuzu_emu.utils.DirectoryInitialization
|
||||||
import org.yuzu.yuzu_emu.utils.DocumentsTree
|
import org.yuzu.yuzu_emu.utils.DocumentsTree
|
||||||
import org.yuzu.yuzu_emu.utils.GpuDriverHelper
|
import org.yuzu.yuzu_emu.utils.GpuDriverHelper
|
||||||
import org.yuzu.yuzu_emu.utils.Log
|
import org.yuzu.yuzu_emu.utils.Log
|
||||||
import org.yuzu.yuzu_emu.utils.PowerStateUpdater
|
import org.yuzu.yuzu_emu.utils.PowerStateUpdater
|
||||||
import org.yuzu.yuzu_emu.utils.ControllerNavigationGlobalHook
|
import org.yuzu.yuzu_emu.utils.ControllerNavigationGlobalHook
|
||||||
import java.util.Locale
|
|
||||||
|
|
||||||
fun Context.getPublicFilesDir(): File = getExternalFilesDir(null) ?: filesDir
|
fun Context.getPublicFilesDir(): File = getExternalFilesDir(null) ?: filesDir
|
||||||
|
|
||||||
@@ -84,38 +80,5 @@ class YuzuApplication : Application() {
|
|||||||
|
|
||||||
val appContext: Context
|
val appContext: Context
|
||||||
get() = application.applicationContext
|
get() = application.applicationContext
|
||||||
|
|
||||||
private val LANGUAGE_CODES = arrayOf(
|
|
||||||
"system", "en", "es", "fr", "de", "it", "pt", "pt-BR", "ru", "ja", "ko",
|
|
||||||
"zh-CN", "zh-TW", "pl", "cs", "nb", "hu", "uk", "vi", "id", "ar", "ckb", "fa", "he", "sr"
|
|
||||||
)
|
|
||||||
|
|
||||||
fun applyLanguage(context: Context): Context {
|
|
||||||
val languageIndex = IntSetting.APP_LANGUAGE.getInt()
|
|
||||||
val langCode = if (languageIndex in LANGUAGE_CODES.indices) {
|
|
||||||
LANGUAGE_CODES[languageIndex]
|
|
||||||
} else {
|
|
||||||
"system"
|
|
||||||
}
|
|
||||||
|
|
||||||
if (langCode == "system") {
|
|
||||||
return context
|
|
||||||
}
|
|
||||||
|
|
||||||
val locale = when {
|
|
||||||
langCode.contains("-") -> {
|
|
||||||
val parts = langCode.split("-")
|
|
||||||
Locale.Builder().setLanguage(parts[0]).setRegion(parts[1]).build()
|
|
||||||
}
|
|
||||||
else -> Locale.Builder().setLanguage(langCode).build()
|
|
||||||
}
|
|
||||||
|
|
||||||
Locale.setDefault(locale)
|
|
||||||
|
|
||||||
val config = Configuration(context.resources.configuration)
|
|
||||||
config.setLocales(LocaleList(locale))
|
|
||||||
|
|
||||||
return context.createConfigurationContext(config)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -115,10 +115,6 @@ class EmulationActivity : AppCompatActivity(), SensorEventListener, InputManager
|
|||||||
mainHandler.postDelayed(romSwapStopTimeoutRunnable, ROM_SWAP_STOP_TIMEOUT_MS)
|
mainHandler.postDelayed(romSwapStopTimeoutRunnable, ROM_SWAP_STOP_TIMEOUT_MS)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun attachBaseContext(base: Context) {
|
|
||||||
super.attachBaseContext(YuzuApplication.applyLanguage(base))
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
Log.gameLaunched = true
|
Log.gameLaunched = true
|
||||||
ThemeHelper.setTheme(this)
|
ThemeHelper.setTheme(this)
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ enum class IntSetting(override val key: String) : AbstractIntSetting {
|
|||||||
THEME("theme"),
|
THEME("theme"),
|
||||||
THEME_MODE("theme_mode"),
|
THEME_MODE("theme_mode"),
|
||||||
STATIC_THEME_COLOR("static_theme_color"),
|
STATIC_THEME_COLOR("static_theme_color"),
|
||||||
APP_LANGUAGE("app_language"),
|
|
||||||
OVERLAY_SCALE("control_scale"),
|
OVERLAY_SCALE("control_scale"),
|
||||||
OVERLAY_OPACITY("control_opacity"),
|
OVERLAY_OPACITY("control_opacity"),
|
||||||
LOCK_DRAWER("lock_drawer"),
|
LOCK_DRAWER("lock_drawer"),
|
||||||
|
|||||||
-9
@@ -997,15 +997,6 @@ abstract class SettingsItem(
|
|||||||
descriptionId = R.string.enable_qlaunch_button_description,
|
descriptionId = R.string.enable_qlaunch_button_description,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
put(
|
|
||||||
SingleChoiceSetting(
|
|
||||||
IntSetting.APP_LANGUAGE,
|
|
||||||
titleId = R.string.app_language,
|
|
||||||
descriptionId = R.string.app_language_description,
|
|
||||||
choicesId = R.array.appLanguageNames,
|
|
||||||
valuesId = R.array.appLanguageValues
|
|
||||||
)
|
|
||||||
)
|
|
||||||
put(
|
put(
|
||||||
SwitchSetting(
|
SwitchSetting(
|
||||||
BooleanSetting.RENDERER_DEBUG,
|
BooleanSetting.RENDERER_DEBUG,
|
||||||
|
|||||||
-17
@@ -6,8 +6,6 @@
|
|||||||
|
|
||||||
package org.yuzu.yuzu_emu.features.settings.ui
|
package org.yuzu.yuzu_emu.features.settings.ui
|
||||||
|
|
||||||
import android.content.Context
|
|
||||||
import org.yuzu.yuzu_emu.YuzuApplication
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup.MarginLayoutParams
|
import android.view.ViewGroup.MarginLayoutParams
|
||||||
@@ -29,7 +27,6 @@ import org.yuzu.yuzu_emu.features.input.NativeInput
|
|||||||
import org.yuzu.yuzu_emu.features.settings.utils.SettingsFile
|
import org.yuzu.yuzu_emu.features.settings.utils.SettingsFile
|
||||||
import org.yuzu.yuzu_emu.fragments.ResetSettingsDialogFragment
|
import org.yuzu.yuzu_emu.fragments.ResetSettingsDialogFragment
|
||||||
import org.yuzu.yuzu_emu.utils.*
|
import org.yuzu.yuzu_emu.utils.*
|
||||||
import org.yuzu.yuzu_emu.utils.collect
|
|
||||||
|
|
||||||
class SettingsActivity : AppCompatActivity() {
|
class SettingsActivity : AppCompatActivity() {
|
||||||
private lateinit var binding: ActivitySettingsBinding
|
private lateinit var binding: ActivitySettingsBinding
|
||||||
@@ -38,10 +35,6 @@ class SettingsActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
private val settingsViewModel: SettingsViewModel by viewModels()
|
private val settingsViewModel: SettingsViewModel by viewModels()
|
||||||
|
|
||||||
override fun attachBaseContext(base: Context) {
|
|
||||||
super.attachBaseContext(YuzuApplication.applyLanguage(base))
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
ThemeHelper.setTheme(this)
|
ThemeHelper.setTheme(this)
|
||||||
|
|
||||||
@@ -148,16 +141,6 @@ class SettingsActivity : AppCompatActivity() {
|
|||||||
NativeConfig.savePerGameConfig()
|
NativeConfig.savePerGameConfig()
|
||||||
NativeConfig.unloadPerGameConfig()
|
NativeConfig.unloadPerGameConfig()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (settingsViewModel.shouldRecreateForLanguageChange.value) {
|
|
||||||
settingsViewModel.setShouldRecreateForLanguageChange(false)
|
|
||||||
val relaunchIntent = packageManager?.getLaunchIntentForPackage(packageName)
|
|
||||||
if (relaunchIntent != null) {
|
|
||||||
relaunchIntent.addFlags(android.content.Intent.FLAG_ACTIVITY_CLEAR_TASK or android.content.Intent.FLAG_ACTIVITY_NEW_TASK)
|
|
||||||
startActivity(relaunchIntent)
|
|
||||||
android.os.Process.killProcess(android.os.Process.myPid())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
-8
@@ -482,14 +482,6 @@ class SettingsAdapter(
|
|||||||
position
|
position
|
||||||
).show(fragment.childFragmentManager, SettingsDialogFragment.TAG)
|
).show(fragment.childFragmentManager, SettingsDialogFragment.TAG)
|
||||||
|
|
||||||
// reset language if detected
|
|
||||||
if (item.setting.key == "app_language") {
|
|
||||||
// recreate page apply language change instantly
|
|
||||||
fragment.requireActivity().recreate()
|
|
||||||
|
|
||||||
settingsViewModel.setShouldRecreateForLanguageChange(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
-6
@@ -387,12 +387,6 @@ class SettingsDialogFragment : DialogFragment(), DialogInterface.OnClickListener
|
|||||||
) {
|
) {
|
||||||
settingsViewModel.setShouldReloadSettingsList(true)
|
settingsViewModel.setShouldReloadSettingsList(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scSetting.setting.key == "app_language") {
|
|
||||||
settingsViewModel.setShouldRecreateForLanguageChange(true)
|
|
||||||
// recreate page apply language change instantly
|
|
||||||
requireActivity().recreate()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
is StringSingleChoiceSetting -> {
|
is StringSingleChoiceSetting -> {
|
||||||
|
|||||||
+1
-3
@@ -1345,10 +1345,8 @@ class SettingsFragmentPresenter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
add(HeaderSetting(R.string.app_settings))
|
|
||||||
add(IntSetting.APP_LANGUAGE.key)
|
|
||||||
|
|
||||||
if (NativeLibrary.isUpdateCheckerEnabled()) {
|
if (NativeLibrary.isUpdateCheckerEnabled()) {
|
||||||
|
add(HeaderSetting(R.string.app_settings))
|
||||||
add(BooleanSetting.ENABLE_UPDATE_CHECKS.key)
|
add(BooleanSetting.ENABLE_UPDATE_CHECKS.key)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-8
@@ -1,4 +1,4 @@
|
|||||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
// SPDX-FileCopyrightText: 2023 yuzu Emulator Project
|
// SPDX-FileCopyrightText: 2023 yuzu Emulator Project
|
||||||
@@ -57,9 +57,6 @@ class SettingsViewModel : ViewModel() {
|
|||||||
private val _shouldShowResetInputDialog = MutableStateFlow(false)
|
private val _shouldShowResetInputDialog = MutableStateFlow(false)
|
||||||
val shouldShowResetInputDialog = _shouldShowResetInputDialog.asStateFlow()
|
val shouldShowResetInputDialog = _shouldShowResetInputDialog.asStateFlow()
|
||||||
|
|
||||||
private val _shouldRecreateForLanguageChange = MutableStateFlow(false)
|
|
||||||
val shouldRecreateForLanguageChange = _shouldRecreateForLanguageChange.asStateFlow()
|
|
||||||
|
|
||||||
private val _shouldShowPathPicker = MutableStateFlow(false)
|
private val _shouldShowPathPicker = MutableStateFlow(false)
|
||||||
val shouldShowPathPicker = _shouldShowPathPicker.asStateFlow()
|
val shouldShowPathPicker = _shouldShowPathPicker.asStateFlow()
|
||||||
|
|
||||||
@@ -118,10 +115,6 @@ class SettingsViewModel : ViewModel() {
|
|||||||
_shouldShowResetInputDialog.value = value
|
_shouldShowResetInputDialog.value = value
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setShouldRecreateForLanguageChange(value: Boolean) {
|
|
||||||
_shouldRecreateForLanguageChange.value = value
|
|
||||||
}
|
|
||||||
|
|
||||||
fun setShouldShowPathPicker(value: Boolean) {
|
fun setShouldShowPathPicker(value: Boolean) {
|
||||||
_shouldShowPathPicker.value = value
|
_shouldShowPathPicker.value = value
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
package org.yuzu.yuzu_emu.ui.main
|
package org.yuzu.yuzu_emu.ui.main
|
||||||
|
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.Context
|
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
@@ -71,10 +70,6 @@ class MainActivity : AppCompatActivity(), ThemeProvider {
|
|||||||
private val CHECKED_DECRYPTION = "CheckedDecryption"
|
private val CHECKED_DECRYPTION = "CheckedDecryption"
|
||||||
private var checkedDecryption = false
|
private var checkedDecryption = false
|
||||||
|
|
||||||
override fun attachBaseContext(base: Context) {
|
|
||||||
super.attachBaseContext(YuzuApplication.applyLanguage(base))
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
val splashScreen = installSplashScreen()
|
val splashScreen = installSplashScreen()
|
||||||
splashScreen.setKeepOnScreenCondition { !DirectoryInitialization.areDirectoriesReady }
|
splashScreen.setKeepOnScreenCondition { !DirectoryInitialization.areDirectoriesReady }
|
||||||
|
|||||||
@@ -59,7 +59,6 @@ namespace AndroidSettings {
|
|||||||
Settings::Setting<s32> static_theme_color{linkage, 0, "static_theme_color", Settings::Category::Android};
|
Settings::Setting<s32> static_theme_color{linkage, 0, "static_theme_color", Settings::Category::Android};
|
||||||
Settings::Setting<bool> black_backgrounds{linkage, false, "black_backgrounds",
|
Settings::Setting<bool> black_backgrounds{linkage, false, "black_backgrounds",
|
||||||
Settings::Category::Android};
|
Settings::Category::Android};
|
||||||
Settings::Setting<s32> app_language{linkage, 0, "app_language", Settings::Category::Android};
|
|
||||||
Settings::Setting<bool> enable_update_checks{linkage, true, "enable_update_checks",
|
Settings::Setting<bool> enable_update_checks{linkage, true, "enable_update_checks",
|
||||||
Settings::Category::Android};
|
Settings::Category::Android};
|
||||||
Settings::Setting<bool> enable_folder_button{linkage, true, "enable_folder_button",
|
Settings::Setting<bool> enable_folder_button{linkage, true, "enable_folder_button",
|
||||||
|
|||||||
@@ -409,62 +409,6 @@
|
|||||||
<item>2</item>
|
<item>2</item>
|
||||||
</integer-array>
|
</integer-array>
|
||||||
|
|
||||||
<string-array name="appLanguageNames">
|
|
||||||
<item>@string/app_language_system</item>
|
|
||||||
<item>@string/app_language_english</item>
|
|
||||||
<item>@string/app_language_spanish</item>
|
|
||||||
<item>@string/app_language_french</item>
|
|
||||||
<item>@string/app_language_german</item>
|
|
||||||
<item>@string/app_language_italian</item>
|
|
||||||
<item>@string/app_language_portuguese</item>
|
|
||||||
<item>@string/app_language_brazilian_portuguese</item>
|
|
||||||
<item>@string/app_language_russian</item>
|
|
||||||
<item>@string/app_language_japanese</item>
|
|
||||||
<item>@string/app_language_korean</item>
|
|
||||||
<item>@string/app_language_simplified_chinese</item>
|
|
||||||
<item>@string/app_language_traditional_chinese</item>
|
|
||||||
<item>@string/app_language_polish</item>
|
|
||||||
<item>@string/app_language_czech</item>
|
|
||||||
<item>@string/app_language_norwegian</item>
|
|
||||||
<item>@string/app_language_hungarian</item>
|
|
||||||
<item>@string/app_language_ukrainian</item>
|
|
||||||
<item>@string/app_language_vietnamese</item>
|
|
||||||
<item>@string/app_language_indonesian</item>
|
|
||||||
<item>@string/app_language_arabic</item>
|
|
||||||
<item>@string/app_language_central_kurdish</item>
|
|
||||||
<item>@string/app_language_persian</item>
|
|
||||||
<item>@string/app_language_hebrew</item>
|
|
||||||
<item>@string/app_language_serbian</item>
|
|
||||||
<item>@string/app_language_thai</item>
|
|
||||||
</string-array>
|
|
||||||
<integer-array name="appLanguageValues">
|
|
||||||
<item>0</item>
|
|
||||||
<item>1</item>
|
|
||||||
<item>2</item>
|
|
||||||
<item>3</item>
|
|
||||||
<item>4</item>
|
|
||||||
<item>5</item>
|
|
||||||
<item>6</item>
|
|
||||||
<item>7</item>
|
|
||||||
<item>8</item>
|
|
||||||
<item>9</item>
|
|
||||||
<item>10</item>
|
|
||||||
<item>11</item>
|
|
||||||
<item>12</item>
|
|
||||||
<item>13</item>
|
|
||||||
<item>14</item>
|
|
||||||
<item>15</item>
|
|
||||||
<item>16</item>
|
|
||||||
<item>17</item>
|
|
||||||
<item>18</item>
|
|
||||||
<item>19</item>
|
|
||||||
<item>20</item>
|
|
||||||
<item>21</item>
|
|
||||||
<item>22</item>
|
|
||||||
<item>23</item>
|
|
||||||
<item>24</item>
|
|
||||||
</integer-array>
|
|
||||||
|
|
||||||
<string-array name="outputEngineEntries">
|
<string-array name="outputEngineEntries">
|
||||||
<item>@string/auto</item>
|
<item>@string/auto</item>
|
||||||
<item>@string/sdl3</item>
|
<item>@string/sdl3</item>
|
||||||
|
|||||||
@@ -1275,42 +1275,6 @@
|
|||||||
<string name="use_black_backgrounds">Black backgrounds</string>
|
<string name="use_black_backgrounds">Black backgrounds</string>
|
||||||
<string name="use_black_backgrounds_description">When using the dark theme, apply black backgrounds.</string>
|
<string name="use_black_backgrounds_description">When using the dark theme, apply black backgrounds.</string>
|
||||||
|
|
||||||
<!-- Buttons -->
|
|
||||||
<string name="enable_folder_button">Folder</string>
|
|
||||||
<string name="enable_folder_button_description">Show the button to add game folders</string>
|
|
||||||
<string name="enable_qlaunch_button">QLaunch</string>
|
|
||||||
<string name="enable_qlaunch_button_description">Show the button to launch QLaunch</string>
|
|
||||||
|
|
||||||
<!-- App Language -->
|
|
||||||
<string name="app_language">App Language</string>
|
|
||||||
<string name="app_language_description">Change the language of the app interface</string>
|
|
||||||
<string name="app_language_system">Follow System</string>
|
|
||||||
<string name="app_language_english" translatable="false">English</string>
|
|
||||||
<string name="app_language_spanish" translatable="false">Español</string>
|
|
||||||
<string name="app_language_french" translatable="false">Français</string>
|
|
||||||
<string name="app_language_german" translatable="false">Deutsch</string>
|
|
||||||
<string name="app_language_italian" translatable="false">Italiano</string>
|
|
||||||
<string name="app_language_portuguese" translatable="false">Português</string>
|
|
||||||
<string name="app_language_brazilian_portuguese" translatable="false">Português do Brasil</string>
|
|
||||||
<string name="app_language_russian" translatable="false">Русский</string>
|
|
||||||
<string name="app_language_japanese" translatable="false">日本語</string>
|
|
||||||
<string name="app_language_korean" translatable="false">한국어</string>
|
|
||||||
<string name="app_language_simplified_chinese" translatable="false">简体中文</string>
|
|
||||||
<string name="app_language_traditional_chinese" translatable="false">繁體中文</string>
|
|
||||||
<string name="app_language_polish" translatable="false">Polski</string>
|
|
||||||
<string name="app_language_czech" translatable="false">Čeština</string>
|
|
||||||
<string name="app_language_norwegian" translatable="false">Norsk bokmål</string>
|
|
||||||
<string name="app_language_hungarian" translatable="false">Magyar</string>
|
|
||||||
<string name="app_language_ukrainian" translatable="false">Українська</string>
|
|
||||||
<string name="app_language_vietnamese" translatable="false">Tiếng Việt</string>
|
|
||||||
<string name="app_language_indonesian" translatable="false">Bahasa Indonesia</string>
|
|
||||||
<string name="app_language_arabic" translatable="false">العربية</string>
|
|
||||||
<string name="app_language_central_kurdish" translatable="false">کوردیی ناوەندی</string>
|
|
||||||
<string name="app_language_persian" translatable="false">فارسی</string>
|
|
||||||
<string name="app_language_hebrew" translatable="false">עברית</string>
|
|
||||||
<string name="app_language_serbian" translatable="false">Српски</string>
|
|
||||||
<string name="app_language_thai" translatable="false">แบบไทย</string>
|
|
||||||
|
|
||||||
<!-- Static Themes -->
|
<!-- Static Themes -->
|
||||||
<string name="static_theme_color">Theme Color</string>
|
<string name="static_theme_color">Theme Color</string>
|
||||||
<string name="eden_theme">Eden</string>
|
<string name="eden_theme">Eden</string>
|
||||||
|
|||||||
@@ -96,6 +96,21 @@ bool CommitVectorPage(uintptr_t addr, bool write) noexcept {
|
|||||||
#ifndef MAP_NOCORE
|
#ifndef MAP_NOCORE
|
||||||
#define MAP_NOCORE 0
|
#define MAP_NOCORE 0
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef MADV_FREE
|
||||||
|
#define MADV_FREE MADV_DONTNEED
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void DecommitVectorPage(uintptr_t base) noexcept {
|
||||||
|
#if defined(_WIN32)
|
||||||
|
VirtualFree(reinterpret_cast<LPVOID>(base), HostPageSize, MEM_DECOMMIT);
|
||||||
|
#elif defined(__linux__)
|
||||||
|
// Linux's MADV_DONTNEED zeros out pages for us
|
||||||
|
madvise(reinterpret_cast<void*>(base), HostPageSize, MADV_DONTNEED);
|
||||||
|
#else
|
||||||
|
madvise(reinterpret_cast<void*>(base), HostPageSize, MADV_FREE);
|
||||||
|
std::memset(reinterpret_cast<void*>(base), 0, HostPageSize);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void* AllocateMemoryPages(std::size_t size) noexcept {
|
void* AllocateMemoryPages(std::size_t size) noexcept {
|
||||||
if (auto page = HostPageSize; size % page != 0) {
|
if (auto page = HostPageSize; size % page != 0) {
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ const u64 HostPageMask = ~(HostPageSize - 1);
|
|||||||
|
|
||||||
void* AllocateMemoryPages(std::size_t size) noexcept;
|
void* AllocateMemoryPages(std::size_t size) noexcept;
|
||||||
void FreeMemoryPages(void* base, std::size_t size) noexcept;
|
void FreeMemoryPages(void* base, std::size_t size) noexcept;
|
||||||
|
void DecommitVectorPage(uintptr_t base) noexcept;
|
||||||
|
|
||||||
/// A large page-aligned buffer that has optimized memory usage for zero-writes.
|
/// A large page-aligned buffer that has optimized memory usage for zero-writes.
|
||||||
template <typename T>
|
template <typename T>
|
||||||
@@ -114,7 +115,7 @@ public:
|
|||||||
const u64 end_page = AlignUp(base, HostPageSize);
|
const u64 end_page = AlignUp(base, HostPageSize);
|
||||||
const u64 first_size = (std::min)(end_page, end) - base;
|
const u64 first_size = (std::min)(end_page, end) - base;
|
||||||
|
|
||||||
if (IsCommittedPage(start / sizeof(T))) {
|
if (IsCommittedPage(start)) {
|
||||||
std::memset(reinterpret_cast<void*>(base), 0, first_size);
|
std::memset(reinterpret_cast<void*>(base), 0, first_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,11 +125,16 @@ public:
|
|||||||
base = end_page;
|
base = end_page;
|
||||||
|
|
||||||
for (u64 page = base; page < end; page += HostPageSize) {
|
for (u64 page = base; page < end; page += HostPageSize) {
|
||||||
if (!IsCommittedPage((page - reinterpret_cast<u64>(base_ptr)) / sizeof(T))) {
|
auto index = (page - reinterpret_cast<u64>(base_ptr)) / sizeof(T);
|
||||||
|
if (!IsCommittedPage(index)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::memset(reinterpret_cast<void*>(page), 0, (std::min)( HostPageSize, end - page));
|
if (end - page >= HostPageSize) {
|
||||||
|
DecommitPage(index);
|
||||||
|
} else {
|
||||||
|
std::memset(reinterpret_cast<void*>(page), 0, end - page);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,6 +189,14 @@ private:
|
|||||||
committed_pages[page_index >> 6].fetch_or(1ULL << (page_index & 63), std::memory_order_release);
|
committed_pages[page_index >> 6].fetch_or(1ULL << (page_index & 63), std::memory_order_release);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constexpr void DecommitPage(std::size_t index) noexcept {
|
||||||
|
auto page_index = (index * sizeof(T)) >> HostPageBits;
|
||||||
|
auto page = reinterpret_cast<uintptr_t>(base_ptr + index) & HostPageMask;
|
||||||
|
|
||||||
|
committed_pages[page_index >> 6].fetch_and(~(1ULL << (page_index & 63)), std::memory_order_release);
|
||||||
|
DecommitVectorPage(page);
|
||||||
|
}
|
||||||
|
|
||||||
std::size_t alloc_size{};
|
std::size_t alloc_size{};
|
||||||
T* base_ptr{};
|
T* base_ptr{};
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ add_library(core STATIC
|
|||||||
core_timing.h
|
core_timing.h
|
||||||
cpu_manager.cpp
|
cpu_manager.cpp
|
||||||
cpu_manager.h
|
cpu_manager.h
|
||||||
|
launch_params.cpp
|
||||||
|
launch_params.h
|
||||||
crypto/aes_util.cpp
|
crypto/aes_util.cpp
|
||||||
crypto/aes_util.h
|
crypto/aes_util.h
|
||||||
crypto/ctr_encryption_layer.cpp
|
crypto/ctr_encryption_layer.cpp
|
||||||
@@ -1203,6 +1205,9 @@ endif()
|
|||||||
|
|
||||||
target_include_directories(core PRIVATE ${OPUS_INCLUDE_DIRS})
|
target_include_directories(core PRIVATE ${OPUS_INCLUDE_DIRS})
|
||||||
target_link_libraries(core PUBLIC common PRIVATE audio_core hid_core network video_core nx_tzdb tz)
|
target_link_libraries(core PUBLIC common PRIVATE audio_core hid_core network video_core nx_tzdb tz)
|
||||||
|
if (MSVC)
|
||||||
|
target_link_libraries(core PRIVATE getopt)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (BOOST_NO_HEADERS)
|
if (BOOST_NO_HEADERS)
|
||||||
target_link_libraries(core PUBLIC Boost::container Boost::heap Boost::asio Boost::process Boost::crc)
|
target_link_libraries(core PUBLIC Boost::container Boost::heap Boost::asio Boost::process Boost::crc)
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ void LoopProcess(Core::System& system) {
|
|||||||
server_manager->RegisterNamedService("audout:d", std::make_shared<IAudioOutManagerForDebugger>(system), 30);
|
server_manager->RegisterNamedService("audout:d", std::make_shared<IAudioOutManagerForDebugger>(system), 30);
|
||||||
server_manager->RegisterNamedService("audin:d", std::make_shared<IAudioInManagerForDebugger>(system), 30);
|
server_manager->RegisterNamedService("audin:d", std::make_shared<IAudioInManagerForDebugger>(system), 30);
|
||||||
server_manager->RegisterNamedService("audrec:d", std::make_shared<IFinalOutputRecorderManagerForDebugger>(system), 30);
|
server_manager->RegisterNamedService("audrec:d", std::make_shared<IFinalOutputRecorderManagerForDebugger>(system), 30);
|
||||||
server_manager->RegisterNamedService("audren:d", std::make_shared<IAudioInManager>(system), 30);
|
server_manager->RegisterNamedService("audren:d", std::make_shared<IAudioRendererManagerForDebugger>(system), 30);
|
||||||
|
|
||||||
server_manager->RegisterNamedService("audin:u", std::make_shared<IAudioInManager>(system), 30);
|
server_manager->RegisterNamedService("audin:u", std::make_shared<IAudioInManager>(system), 30);
|
||||||
server_manager->RegisterNamedService("audin:a", std::make_shared<IAudioInManagerForApplet>(system), 30);
|
server_manager->RegisterNamedService("audin:a", std::make_shared<IAudioInManagerForApplet>(system), 30);
|
||||||
|
|||||||
@@ -0,0 +1,205 @@
|
|||||||
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
#include <regex>
|
||||||
|
#include <cctype>
|
||||||
|
|
||||||
|
#include "common/assert.h"
|
||||||
|
#include "common/logging.h"
|
||||||
|
#include "common/settings.h"
|
||||||
|
#include "common/string_util.h"
|
||||||
|
#include "common/scm_rev.h"
|
||||||
|
#include "core/core.h"
|
||||||
|
#include "core/hle/service/acc/profile_manager.h"
|
||||||
|
#include "core/launch_params.h"
|
||||||
|
|
||||||
|
#undef _UNICODE
|
||||||
|
#include <getopt.h>
|
||||||
|
#ifndef _MSC_VER
|
||||||
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace Core {
|
||||||
|
LaunchParams ParseLaunchParams(Core::System& system, int argc, char *argv[], wchar_t *argv_w[]) noexcept {
|
||||||
|
LaunchParams p{};
|
||||||
|
|
||||||
|
int option_index = 0;
|
||||||
|
static struct option long_options[] = {
|
||||||
|
// clang-format off
|
||||||
|
{"debug", no_argument, 0, 'd'},
|
||||||
|
{"config", required_argument, 0, 'c'},
|
||||||
|
{"fullscreen", no_argument, 0, 'f'},
|
||||||
|
{"help", no_argument, 0, 'h'},
|
||||||
|
{"game", required_argument, 0, 'g'},
|
||||||
|
{"multiplayer", required_argument, 0, 'm'},
|
||||||
|
{"program", optional_argument, 0, 'p'},
|
||||||
|
{"user", required_argument, 0, 'u'},
|
||||||
|
{"version", no_argument, 0, 'v'},
|
||||||
|
{"input-profile", no_argument, 0, 'i'},
|
||||||
|
{"null-render", no_argument, 0, 'n'},
|
||||||
|
{"singlecore", no_argument, 0, 's'},
|
||||||
|
{"filter", no_argument, 0, 'x'},
|
||||||
|
{0, 0, 0, 0},
|
||||||
|
// clang-format on
|
||||||
|
};
|
||||||
|
|
||||||
|
while (optind < argc) {
|
||||||
|
if (int arg = getopt_long(argc, argv, "dc:fhg:m:p:u:vinsx", long_options, &option_index); arg != -1) {
|
||||||
|
switch (char(arg)) {
|
||||||
|
case 'd':
|
||||||
|
p.override_gdb_port = uint16_t(atoi(optarg));
|
||||||
|
break;
|
||||||
|
case 'c':
|
||||||
|
p.config_path = optarg;
|
||||||
|
break;
|
||||||
|
case 'f':
|
||||||
|
p.fullscreen = true;
|
||||||
|
LOG_INFO(Frontend, "Starting in fullscreen mode...");
|
||||||
|
break;
|
||||||
|
case 'h':
|
||||||
|
p.print_help = true;
|
||||||
|
break;
|
||||||
|
case 'g':
|
||||||
|
p.filepath = std::string(optarg);
|
||||||
|
break;
|
||||||
|
case 'i': {
|
||||||
|
p.input_profile = std::string(optarg);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'm': {
|
||||||
|
p.use_multiplayer = true;
|
||||||
|
const std::string str_arg(optarg);
|
||||||
|
// regex to check if the format is nickname:password@ip:port
|
||||||
|
// with optional :password
|
||||||
|
const std::regex re("^([^:]+)(?::(.+))?@([^:]+)(?::([0-9]+))?$");
|
||||||
|
if (std::regex_match(str_arg, re)) {
|
||||||
|
std::smatch match;
|
||||||
|
std::regex_search(str_arg, match, re);
|
||||||
|
ASSERT(match.size() == 5);
|
||||||
|
p.nickname = match[1];
|
||||||
|
p.password = match[2];
|
||||||
|
p.address = match[3];
|
||||||
|
if (!match[4].str().empty()) {
|
||||||
|
p.port = u16(std::strtoul(match[4].str().c_str(), nullptr, 0));
|
||||||
|
}
|
||||||
|
std::regex nickname_re("^[a-zA-Z0-9._\\- ]+$");
|
||||||
|
ASSERT(std::regex_match(p.nickname, nickname_re) && "Nickname is not valid. Must be 4 to 20 alphanumeric characters");
|
||||||
|
ASSERT(!p.address.empty() && "Address is empty");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'p':
|
||||||
|
p.program_args = argv[optind];
|
||||||
|
++optind;
|
||||||
|
break;
|
||||||
|
case 'u': {
|
||||||
|
// Launch game with a specific user
|
||||||
|
bool argument_ok = isdigit(optarg[0]);
|
||||||
|
p.selected_user = atoi(optarg);
|
||||||
|
if (!argument_ok) {
|
||||||
|
// try to look it up by username, only finds the first username that matches.
|
||||||
|
auto const user_idx = system.GetProfileManager().GetUserIndex(optarg);
|
||||||
|
if (user_idx != std::nullopt) {
|
||||||
|
p.selected_user = user_idx.value();
|
||||||
|
} else {
|
||||||
|
LOG_ERROR(Frontend, "Invalid user argument '{}'", optarg);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (system.GetProfileManager().UserExistsIndex(*p.selected_user)) {
|
||||||
|
Settings::values.current_user = s32(*p.selected_user);
|
||||||
|
} else {
|
||||||
|
LOG_ERROR(Frontend, "Selected user {} doesn't exist", *p.selected_user);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'v':
|
||||||
|
p.print_version = true;
|
||||||
|
break;
|
||||||
|
case 'n':
|
||||||
|
p.force_null_render = true;
|
||||||
|
break;
|
||||||
|
case 's':
|
||||||
|
p.force_single_core = true;
|
||||||
|
break;
|
||||||
|
case 'x':
|
||||||
|
p.log_filter = argv[optind];
|
||||||
|
++optind;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// only kept due to shortcuts made by Qt frontend which use "-qlaunch"
|
||||||
|
if (strcmp(argv[optind], "-hlaunch") == 0) {
|
||||||
|
p.launch_hlaunch = true;
|
||||||
|
} else if (strcmp(argv[optind], "-qlaunch") == 0) {
|
||||||
|
p.launch_qlaunch = true;
|
||||||
|
} else if (strcmp(argv[optind], "-setup") == 0) {
|
||||||
|
p.launch_setup = true;
|
||||||
|
} else {
|
||||||
|
// qt feeds utf8 data, sdl frontend feeds raw utf16 data
|
||||||
|
#ifdef _WIN32
|
||||||
|
p.filepath = argv_w != nullptr
|
||||||
|
? Common::UTF16ToUTF8(argv_w[optind])
|
||||||
|
: argv[optind];
|
||||||
|
#else
|
||||||
|
p.filepath = argv[optind];
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
optind++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
p.argv0 = argv[0];
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ApplyLaunchParams(LaunchParams const& lp) noexcept {
|
||||||
|
// apply the log_filter setting
|
||||||
|
// the logger was initialized before and doesn't pick up the filter on its own
|
||||||
|
Common::Log::Filter filter{};
|
||||||
|
filter.ParseFilterString(lp.log_filter.value_or(Settings::values.log_filter.GetValue()));
|
||||||
|
Common::Log::SetGlobalFilter(filter);
|
||||||
|
|
||||||
|
if (!lp.program_args.empty()) {
|
||||||
|
Settings::values.program_args = lp.program_args;
|
||||||
|
}
|
||||||
|
if (!lp.input_profile.empty()) {
|
||||||
|
auto& players = Settings::values.players.GetValue();
|
||||||
|
players[0].profile_name = lp.input_profile;
|
||||||
|
}
|
||||||
|
if (lp.selected_user.has_value()) {
|
||||||
|
Settings::values.current_user = std::clamp(*lp.selected_user, 0, 7);
|
||||||
|
}
|
||||||
|
if (lp.override_gdb_port.has_value()) {
|
||||||
|
Settings::values.use_gdbstub = true;
|
||||||
|
Settings::values.gdbstub_port = *lp.override_gdb_port;
|
||||||
|
}
|
||||||
|
if (lp.force_single_core) {
|
||||||
|
Settings::values.use_multi_core = false;
|
||||||
|
}
|
||||||
|
if (lp.force_null_render) {
|
||||||
|
Settings::values.renderer_backend = Settings::RendererBackend::Null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lp.print_version) {
|
||||||
|
LOG_INFO(Frontend, "Eden {} {}", Common::g_scm_branch, Common::g_scm_desc);
|
||||||
|
}
|
||||||
|
if (lp.print_help) {
|
||||||
|
LOG_INFO(Frontend,
|
||||||
|
"Usage: {}"
|
||||||
|
" [options] <filename>\n"
|
||||||
|
"-c, --config Load the specified configuration file\n"
|
||||||
|
"-f, --fullscreen Start in fullscreen mode\n"
|
||||||
|
"-g, --game File path of the game to load\n"
|
||||||
|
"-h, --help Display this help and exit\n"
|
||||||
|
"-m, --multiplayer=nick:password@address:port"
|
||||||
|
" Nickname, password, address and port for multiplayer\n"
|
||||||
|
"-p, --program Pass following string as arguments to executable\n"
|
||||||
|
"-u, --user Select a specific user profile from 0 to 7\n"
|
||||||
|
"-d, --debug Run the GDB stub on a port from 1 to 65535\n"
|
||||||
|
"-v, --version Output version information and exit\n",
|
||||||
|
lp.argv0
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <optional>
|
||||||
|
#include "common/common_types.h"
|
||||||
|
#include "network/room.h"
|
||||||
|
|
||||||
|
namespace Core {
|
||||||
|
|
||||||
|
class System;
|
||||||
|
struct LaunchParams {
|
||||||
|
std::string argv0{};
|
||||||
|
std::string filepath{};
|
||||||
|
std::string nickname{};
|
||||||
|
std::string password{};
|
||||||
|
std::string address{};
|
||||||
|
std::string input_profile{};
|
||||||
|
std::string program_args{};
|
||||||
|
std::optional<std::string> config_path{};
|
||||||
|
std::optional<int> selected_user{};
|
||||||
|
std::optional<u16> override_gdb_port{};
|
||||||
|
std::optional<std::string> log_filter{};
|
||||||
|
u16 port = Network::DefaultRoomPort;
|
||||||
|
bool use_multiplayer = false;
|
||||||
|
bool fullscreen = false;
|
||||||
|
bool force_null_render = false;
|
||||||
|
bool force_single_core = false;
|
||||||
|
// print
|
||||||
|
bool print_version = false;
|
||||||
|
bool print_help = false;
|
||||||
|
// qt
|
||||||
|
bool launch_hlaunch = false;
|
||||||
|
bool launch_qlaunch = false;
|
||||||
|
bool launch_setup = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
LaunchParams ParseLaunchParams(Core::System& system, int argc, char *argv[], wchar_t *argv_w[]) noexcept;
|
||||||
|
void ApplyLaunchParams(LaunchParams const& lp) noexcept;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
@@ -28,11 +31,6 @@ struct FuncTraits<ReturnType_ (*)(Args...)> {
|
|||||||
using ArgType = std::tuple_element_t<I, std::tuple<Args...>>;
|
using ArgType = std::tuple_element_t<I, std::tuple<Args...>>;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <auto func, typename... Args>
|
|
||||||
void SetDefinition(EmitContext& ctx, IR::Inst* inst, Args... args) {
|
|
||||||
inst->SetDefinition<Id>(func(ctx, std::forward<Args>(args)...));
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename ArgType>
|
template <typename ArgType>
|
||||||
auto Arg(EmitContext& ctx, const IR::Value& arg) {
|
auto Arg(EmitContext& ctx, const IR::Value& arg) {
|
||||||
if constexpr (std::is_same_v<ArgType, std::string_view>) {
|
if constexpr (std::is_same_v<ArgType, std::string_view>) {
|
||||||
@@ -53,21 +51,10 @@ auto Arg(EmitContext& ctx, const IR::Value& arg) {
|
|||||||
template <auto func, bool is_first_arg_inst, size_t... I>
|
template <auto func, bool is_first_arg_inst, size_t... I>
|
||||||
void Invoke(EmitContext& ctx, IR::Inst* inst, std::index_sequence<I...>) {
|
void Invoke(EmitContext& ctx, IR::Inst* inst, std::index_sequence<I...>) {
|
||||||
using Traits = FuncTraits<decltype(func)>;
|
using Traits = FuncTraits<decltype(func)>;
|
||||||
if constexpr (std::is_same_v<typename Traits::ReturnType, Id>) {
|
if constexpr (is_first_arg_inst) {
|
||||||
if constexpr (is_first_arg_inst) {
|
func(ctx, *inst, Arg<typename Traits::template ArgType<I + 2>>(ctx, inst->Arg(I))...);
|
||||||
SetDefinition<func>(
|
|
||||||
ctx, inst, *inst,
|
|
||||||
Arg<typename Traits::template ArgType<I + 2>>(ctx, inst->Arg(I))...);
|
|
||||||
} else {
|
|
||||||
SetDefinition<func>(
|
|
||||||
ctx, inst, Arg<typename Traits::template ArgType<I + 1>>(ctx, inst->Arg(I))...);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if constexpr (is_first_arg_inst) {
|
func(ctx, Arg<typename Traits::template ArgType<I + 1>>(ctx, inst->Arg(I))...);
|
||||||
func(ctx, *inst, Arg<typename Traits::template ArgType<I + 2>>(ctx, inst->Arg(I))...);
|
|
||||||
} else {
|
|
||||||
func(ctx, Arg<typename Traits::template ArgType<I + 1>>(ctx, inst->Arg(I))...);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -98,7 +98,10 @@ void Layer::ConfigureDraw(const Device& device, PresentPushConstants* out_push_c
|
|||||||
RefreshResources(device, framebuffer);
|
RefreshResources(device, framebuffer);
|
||||||
SetAntiAliasPass(device);
|
SetAntiAliasPass(device);
|
||||||
#ifdef HAS_RESHADE
|
#ifdef HAS_RESHADE
|
||||||
SetPostProcessPass(device);
|
const bool is_applet =
|
||||||
|
(framebuffer.layer_stack_mask & Service::Nvnflinger::LayerStackBit(
|
||||||
|
Service::Nvnflinger::LayerStackId::Recording)) == 0;
|
||||||
|
SetPostProcessPass(device, is_applet);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Finish any pending renderpass
|
// Finish any pending renderpass
|
||||||
@@ -228,7 +231,11 @@ void Layer::SetAntiAliasPass(const Device& device) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAS_RESHADE
|
#ifdef HAS_RESHADE
|
||||||
void Layer::SetPostProcessPass(const Device& device) {
|
void Layer::SetPostProcessPass(const Device& device, bool is_applet) {
|
||||||
|
if (is_applet) {
|
||||||
|
post_process.reset();
|
||||||
|
return;
|
||||||
|
}
|
||||||
const VkExtent2D render_area{
|
const VkExtent2D render_area{
|
||||||
.width = Settings::values.resolution_info.ScaleUp(raw_width),
|
.width = Settings::values.resolution_info.ScaleUp(raw_width),
|
||||||
.height = Settings::values.resolution_info.ScaleUp(raw_height),
|
.height = Settings::values.resolution_info.ScaleUp(raw_height),
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ private:
|
|||||||
void RefreshResources(const Device& device, const Tegra::FramebufferConfig& framebuffer);
|
void RefreshResources(const Device& device, const Tegra::FramebufferConfig& framebuffer);
|
||||||
void SetAntiAliasPass(const Device& device);
|
void SetAntiAliasPass(const Device& device);
|
||||||
#ifdef HAS_RESHADE
|
#ifdef HAS_RESHADE
|
||||||
void SetPostProcessPass(const Device& device);
|
void SetPostProcessPass(const Device& device, bool is_applet);
|
||||||
#endif
|
#endif
|
||||||
void ReleaseRawImages();
|
void ReleaseRawImages();
|
||||||
|
|
||||||
|
|||||||
+18
-68
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
// Static Qt on macOS doesn't use Vulkan
|
// Static Qt on macOS doesn't use Vulkan
|
||||||
// Other platforms do, and thus have conflicting VulkanMemoryAllocator symbols
|
// Other platforms do, and thus have conflicting VulkanMemoryAllocator symbols
|
||||||
|
#include "core/launch_params.h"
|
||||||
#if defined(QT_STATICPLUGIN) && !defined(__APPLE__)
|
#if defined(QT_STATICPLUGIN) && !defined(__APPLE__)
|
||||||
#undef VMA_IMPLEMENTATION
|
#undef VMA_IMPLEMENTATION
|
||||||
#endif
|
#endif
|
||||||
@@ -515,79 +516,28 @@ MainWindow::MainWindow(bool has_broken_vulkan)
|
|||||||
// to prevent the UI from blowing up.
|
// to prevent the UI from blowing up.
|
||||||
UpdateUITheme();
|
UpdateUITheme();
|
||||||
|
|
||||||
QStringList args = QApplication::arguments();
|
if (QStringList args = QApplication::arguments(); args.size() >= 2) {
|
||||||
|
QList<QByteArray> qba{};
|
||||||
|
for (auto const& e : args)
|
||||||
|
qba.push_back(e.toUtf8());
|
||||||
|
std::vector<char*> args_cstr{};
|
||||||
|
for (auto& e : qba)
|
||||||
|
args_cstr.push_back(e.data());
|
||||||
|
|
||||||
if (args.size() < 2) {
|
auto const lp = Core::ParseLaunchParams(*QtCommon::system, args_cstr.size(), args_cstr.data(), nullptr);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString game_path;
|
// Override fullscreen setting if gamepath or argument is provided
|
||||||
bool should_launch_qlaunch = false;
|
if (!lp.filepath.empty() || lp.fullscreen) {
|
||||||
bool should_launch_hlaunch = false;
|
ui->action_Fullscreen->setChecked(lp.fullscreen);
|
||||||
bool should_launch_setup = false;
|
|
||||||
bool has_gamepath = false;
|
|
||||||
bool is_fullscreen = false;
|
|
||||||
|
|
||||||
// Preserves drag/drop functionality
|
|
||||||
for (int i = 1; i < args.size(); ++i) {
|
|
||||||
if (args[i] == QStringLiteral("-f")) {
|
|
||||||
// Launch game in fullscreen mode
|
|
||||||
is_fullscreen = true;
|
|
||||||
} else if (args[i] == QStringLiteral("-u") && i < args.size() - 1) {
|
|
||||||
// Launch game with a specific user
|
|
||||||
int user_arg_idx = ++i;
|
|
||||||
bool argument_ok;
|
|
||||||
std::size_t selected_user = args[user_arg_idx].toUInt(&argument_ok);
|
|
||||||
if (!argument_ok) {
|
|
||||||
// try to look it up by username, only finds the first username that matches.
|
|
||||||
std::string const user_arg_str = args[user_arg_idx].toStdString();
|
|
||||||
auto const user_idx =
|
|
||||||
QtCommon::system->GetProfileManager().GetUserIndex(user_arg_str);
|
|
||||||
if (user_idx != std::nullopt) {
|
|
||||||
selected_user = user_idx.value();
|
|
||||||
} else {
|
|
||||||
LOG_ERROR(Frontend, "Invalid user argument '{}'", user_arg_str);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (QtCommon::system->GetProfileManager().UserExistsIndex(selected_user)) {
|
|
||||||
Settings::values.current_user = s32(selected_user);
|
|
||||||
user_flag_cmd_line = true;
|
|
||||||
} else {
|
|
||||||
LOG_ERROR(Frontend, "Selected user {} doesn't exist", selected_user);
|
|
||||||
}
|
|
||||||
} else if (args[i] == QStringLiteral("-g") && i < args.size() - 1) {
|
|
||||||
// Launch game at path
|
|
||||||
game_path = args[++i];
|
|
||||||
has_gamepath = true;
|
|
||||||
} else if (args[i] == QStringLiteral("-input-profile") && i < args.size() - 1) {
|
|
||||||
auto& players = Settings::values.players.GetValue();
|
|
||||||
players[0].profile_name = args[++i].toStdString();
|
|
||||||
} else if (args[i] == QStringLiteral("-qlaunch")) {
|
|
||||||
should_launch_qlaunch = true;
|
|
||||||
} else if (args[i] == QStringLiteral("-hlaunch")) {
|
|
||||||
should_launch_hlaunch = true;
|
|
||||||
} else if (args[i] == QStringLiteral("-setup")) {
|
|
||||||
should_launch_setup = true;
|
|
||||||
} else {
|
|
||||||
game_path = args[i];
|
|
||||||
has_gamepath = true;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Override fullscreen setting if gamepath or argument is provided
|
if (!lp.filepath.empty()) {
|
||||||
if (has_gamepath || is_fullscreen) {
|
BootGame(QString::fromStdString(lp.filepath), ApplicationAppletParameters());
|
||||||
ui->action_Fullscreen->setChecked(is_fullscreen);
|
} else if (lp.launch_setup) {
|
||||||
}
|
LaunchFirmwareApplet(u64(Service::AM::AppletProgramId::Starter), std::nullopt);
|
||||||
|
} else if (lp.launch_qlaunch) {
|
||||||
if (should_launch_setup) {
|
|
||||||
LaunchFirmwareApplet(u64(Service::AM::AppletProgramId::Starter), std::nullopt);
|
|
||||||
} else {
|
|
||||||
if (!game_path.isEmpty()) {
|
|
||||||
BootGame(game_path, ApplicationAppletParameters());
|
|
||||||
} else if (should_launch_qlaunch) {
|
|
||||||
LaunchFirmwareApplet(u64(Service::AM::AppletProgramId::QLaunch), std::nullopt);
|
LaunchFirmwareApplet(u64(Service::AM::AppletProgramId::QLaunch), std::nullopt);
|
||||||
} else if (should_launch_hlaunch) {
|
} else if (lp.launch_hlaunch) {
|
||||||
std::filesystem::path const sd_dir =
|
std::filesystem::path const sd_dir =
|
||||||
Common::FS::GetEdenPathString(Common::FS::EdenPath::SDMCDir);
|
Common::FS::GetEdenPathString(Common::FS::EdenPath::SDMCDir);
|
||||||
auto const hbl_path = (sd_dir / "atmosphere" / "hbl.nsp").string();
|
auto const hbl_path = (sd_dir / "atmosphere" / "hbl.nsp").string();
|
||||||
|
|||||||
@@ -42,9 +42,6 @@ target_link_libraries(yuzu-cmd PRIVATE common core input_common frontend_common
|
|||||||
if (ENABLE_OPENGL)
|
if (ENABLE_OPENGL)
|
||||||
target_link_libraries(yuzu-cmd PRIVATE glad)
|
target_link_libraries(yuzu-cmd PRIVATE glad)
|
||||||
endif()
|
endif()
|
||||||
if (MSVC)
|
|
||||||
target_link_libraries(yuzu-cmd PRIVATE getopt)
|
|
||||||
endif()
|
|
||||||
target_link_libraries(yuzu-cmd PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads)
|
target_link_libraries(yuzu-cmd PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads)
|
||||||
|
|
||||||
create_resource("../../dist/eden.bmp" "yuzu_cmd/yuzu_icon.h" "yuzu_icon")
|
create_resource("../../dist/eden.bmp" "yuzu_cmd/yuzu_icon.h" "yuzu_icon")
|
||||||
|
|||||||
+15
-189
@@ -10,6 +10,7 @@
|
|||||||
#include <regex>
|
#include <regex>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "common/settings_enums.h"
|
#include "common/settings_enums.h"
|
||||||
|
#include "core/launch_params.h"
|
||||||
#ifdef __EMSCRIPTEN__
|
#ifdef __EMSCRIPTEN__
|
||||||
#include <emscripten.h>
|
#include <emscripten.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -52,12 +53,6 @@
|
|||||||
#include "common/windows/timer_resolution.h"
|
#include "common/windows/timer_resolution.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#undef _UNICODE
|
|
||||||
#include <getopt.h>
|
|
||||||
#ifndef _MSC_VER
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
extern "C" {
|
extern "C" {
|
||||||
// tells Nvidia and AMD drivers to use the dedicated GPU by default on laptops with switchable
|
// tells Nvidia and AMD drivers to use the dedicated GPU by default on laptops with switchable
|
||||||
@@ -67,25 +62,6 @@ __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void PrintHelp(const char* argv0) {
|
|
||||||
std::cout << "Usage: " << argv0
|
|
||||||
<< " [options] <filename>\n"
|
|
||||||
"-c, --config Load the specified configuration file\n"
|
|
||||||
"-f, --fullscreen Start in fullscreen mode\n"
|
|
||||||
"-g, --game File path of the game to load\n"
|
|
||||||
"-h, --help Display this help and exit\n"
|
|
||||||
"-m, --multiplayer=nick:password@address:port"
|
|
||||||
" Nickname, password, address and port for multiplayer\n"
|
|
||||||
"-p, --program Pass following string as arguments to executable\n"
|
|
||||||
"-u, --user Select a specific user profile from 0 to 7\n"
|
|
||||||
"-d, --debug Run the GDB stub on a port from 1 to 65535\n"
|
|
||||||
"-v, --version Output version information and exit\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
static void PrintVersion() {
|
|
||||||
std::cout << "Eden " << Common::g_scm_branch << " " << Common::g_scm_desc << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void OnStateChanged(const Network::RoomMember::State& state) {
|
static void OnStateChanged(const Network::RoomMember::State& state) {
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case Network::RoomMember::State::Idle:
|
case Network::RoomMember::State::Idle:
|
||||||
@@ -208,168 +184,18 @@ extern "C" SDL_AppResult SDL_AppInit(void **appstate, int argc, char **argv) {
|
|||||||
LOG_CRITICAL(Frontend, "Failed to get command line arguments");
|
LOG_CRITICAL(Frontend, "Failed to get command line arguments");
|
||||||
return SDL_APP_FAILURE;
|
return SDL_APP_FAILURE;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
std::string filepath;
|
|
||||||
std::optional<std::string> config_path{};
|
|
||||||
std::string program_args;
|
|
||||||
std::optional<int> selected_user{};
|
|
||||||
std::optional<u16> override_gdb_port{};
|
|
||||||
bool use_multiplayer = false;
|
|
||||||
bool fullscreen = false;
|
|
||||||
bool force_null_render = false;
|
|
||||||
bool force_single_core = false;
|
|
||||||
std::string nickname{};
|
|
||||||
std::string password{};
|
|
||||||
std::string address{};
|
|
||||||
std::string input_profile{};
|
|
||||||
std::optional<std::string> log_filter{};
|
|
||||||
u16 port = Network::DefaultRoomPort;
|
|
||||||
|
|
||||||
static struct option long_options[] = {
|
|
||||||
// clang-format off
|
|
||||||
{"debug", no_argument, 0, 'd'},
|
|
||||||
{"config", required_argument, 0, 'c'},
|
|
||||||
{"fullscreen", no_argument, 0, 'f'},
|
|
||||||
{"help", no_argument, 0, 'h'},
|
|
||||||
{"game", required_argument, 0, 'g'},
|
|
||||||
{"multiplayer", required_argument, 0, 'm'},
|
|
||||||
{"program", optional_argument, 0, 'p'},
|
|
||||||
{"user", required_argument, 0, 'u'},
|
|
||||||
{"version", no_argument, 0, 'v'},
|
|
||||||
{"input-profile", no_argument, 0, 'i'},
|
|
||||||
{"null-render", no_argument, 0, 'n'},
|
|
||||||
{"singlecore", no_argument, 0, 's'},
|
|
||||||
{"filter", no_argument, 0, 'x'},
|
|
||||||
{0, 0, 0, 0},
|
|
||||||
// clang-format on
|
|
||||||
};
|
|
||||||
|
|
||||||
while (optind < argc) {
|
|
||||||
int arg = getopt_long(argc, argv, "g:fhvcip::c:u:d:", long_options, &option_index);
|
|
||||||
if (arg != -1) {
|
|
||||||
switch (char(arg)) {
|
|
||||||
case 'd':
|
|
||||||
override_gdb_port = uint16_t(atoi(optarg));
|
|
||||||
break;
|
|
||||||
case 'c':
|
|
||||||
config_path = optarg;
|
|
||||||
break;
|
|
||||||
case 'f':
|
|
||||||
fullscreen = true;
|
|
||||||
LOG_INFO(Frontend, "Starting in fullscreen mode...");
|
|
||||||
break;
|
|
||||||
case 'h':
|
|
||||||
PrintHelp(argv[0]);
|
|
||||||
return SDL_APP_FAILURE;
|
|
||||||
case 'g':
|
|
||||||
filepath = std::string(optarg);
|
|
||||||
break;
|
|
||||||
case 'i': {
|
|
||||||
input_profile = std::string(optarg);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'm': {
|
|
||||||
use_multiplayer = true;
|
|
||||||
const std::string str_arg(optarg);
|
|
||||||
// regex to check if the format is nickname:password@ip:port
|
|
||||||
// with optional :password
|
|
||||||
const std::regex re("^([^:]+)(?::(.+))?@([^:]+)(?::([0-9]+))?$");
|
|
||||||
if (!std::regex_match(str_arg, re)) {
|
|
||||||
std::cout << "Wrong format for option --multiplayer\n";
|
|
||||||
PrintHelp(argv[0]);
|
|
||||||
return SDL_APP_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::smatch match;
|
|
||||||
std::regex_search(str_arg, match, re);
|
|
||||||
ASSERT(match.size() == 5);
|
|
||||||
nickname = match[1];
|
|
||||||
password = match[2];
|
|
||||||
address = match[3];
|
|
||||||
if (!match[4].str().empty()) {
|
|
||||||
port = u16(std::strtoul(match[4].str().c_str(), nullptr, 0));
|
|
||||||
}
|
|
||||||
std::regex nickname_re("^[a-zA-Z0-9._\\- ]+$");
|
|
||||||
if (!std::regex_match(nickname, nickname_re)) {
|
|
||||||
LOG_ERROR(Frontend, "Nickname is not valid. Must be 4 to 20 alphanumeric characters");
|
|
||||||
return SDL_APP_FAILURE;
|
|
||||||
}
|
|
||||||
if (address.empty()) {
|
|
||||||
LOG_ERROR(Frontend, "Address to room must not be empty");
|
|
||||||
return SDL_APP_FAILURE;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'p':
|
|
||||||
program_args = argv[optind];
|
|
||||||
++optind;
|
|
||||||
break;
|
|
||||||
case 'u':
|
|
||||||
selected_user = atoi(optarg);
|
|
||||||
break;
|
|
||||||
case 'v':
|
|
||||||
PrintVersion();
|
|
||||||
return SDL_APP_FAILURE;
|
|
||||||
case 'n':
|
|
||||||
force_null_render = true;
|
|
||||||
break;
|
|
||||||
case 's':
|
|
||||||
force_single_core = true;
|
|
||||||
break;
|
|
||||||
case 'x':
|
|
||||||
log_filter = argv[optind];
|
|
||||||
++optind;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
#ifdef _WIN32
|
|
||||||
filepath = Common::UTF16ToUTF8(argv_w[optind]);
|
|
||||||
#else
|
#else
|
||||||
filepath = argv[optind];
|
wchar_t **argv_w = nullptr;
|
||||||
#endif
|
#endif
|
||||||
optind++;
|
Core::LaunchParams lp = Core::ParseLaunchParams(state->system, argc, argv, argv_w);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SdlConfig config{config_path};
|
|
||||||
|
|
||||||
// apply the log_filter setting
|
|
||||||
// the logger was initialized before and doesn't pick up the filter on its own
|
|
||||||
Common::Log::Filter filter;
|
|
||||||
filter.ParseFilterString(log_filter.value_or(Settings::values.log_filter.GetValue()));
|
|
||||||
Common::Log::SetGlobalFilter(filter);
|
|
||||||
|
|
||||||
if (!program_args.empty()) {
|
|
||||||
Settings::values.program_args = program_args;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!input_profile.empty()) {
|
|
||||||
auto& players = Settings::values.players.GetValue();
|
|
||||||
players[0].profile_name = input_profile;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (selected_user.has_value()) {
|
|
||||||
Settings::values.current_user = std::clamp(*selected_user, 0, 7);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (override_gdb_port.has_value()) {
|
|
||||||
Settings::values.use_gdbstub = true;
|
|
||||||
Settings::values.gdbstub_port = *override_gdb_port;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (force_single_core) {
|
|
||||||
Settings::values.use_multi_core = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (force_null_render) {
|
|
||||||
Settings::values.renderer_backend = Settings::RendererBackend::Null;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
LocalFree(argv_w);
|
LocalFree(argv_w);
|
||||||
#endif
|
#endif
|
||||||
|
SdlConfig config{lp.config_path};
|
||||||
|
|
||||||
if (filepath.empty()) {
|
Core::ApplyLaunchParams(lp);
|
||||||
|
|
||||||
|
if (lp.filepath.empty()) {
|
||||||
LOG_CRITICAL(Frontend, "Failed to load ROM: No ROM specified");
|
LOG_CRITICAL(Frontend, "Failed to load ROM: No ROM specified");
|
||||||
return SDL_APP_FAILURE;
|
return SDL_APP_FAILURE;
|
||||||
}
|
}
|
||||||
@@ -386,14 +212,14 @@ extern "C" SDL_AppResult SDL_AppInit(void **appstate, int argc, char **argv) {
|
|||||||
case Settings::RendererBackend::OpenGL_GLSL:
|
case Settings::RendererBackend::OpenGL_GLSL:
|
||||||
case Settings::RendererBackend::OpenGL_GLASM:
|
case Settings::RendererBackend::OpenGL_GLASM:
|
||||||
case Settings::RendererBackend::OpenGL_SPIRV:
|
case Settings::RendererBackend::OpenGL_SPIRV:
|
||||||
state->emu_window = std::make_unique<EmuWindow_SDL3_GL>(&input_subsystem, state->system, fullscreen);
|
state->emu_window = std::make_unique<EmuWindow_SDL3_GL>(&input_subsystem, state->system, lp.fullscreen);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case Settings::RendererBackend::Vulkan:
|
case Settings::RendererBackend::Vulkan:
|
||||||
state->emu_window = std::make_unique<EmuWindow_SDL3_VK>(&input_subsystem, state->system, fullscreen);
|
state->emu_window = std::make_unique<EmuWindow_SDL3_VK>(&input_subsystem, state->system, lp.fullscreen);
|
||||||
break;
|
break;
|
||||||
case Settings::RendererBackend::Null:
|
case Settings::RendererBackend::Null:
|
||||||
state->emu_window = std::make_unique<EmuWindow_SDL3_Null>(&input_subsystem, state->system, fullscreen);
|
state->emu_window = std::make_unique<EmuWindow_SDL3_Null>(&input_subsystem, state->system, lp.fullscreen);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOG_CRITICAL(Frontend, "Invalid renderer backend");
|
LOG_CRITICAL(Frontend, "Invalid renderer backend");
|
||||||
@@ -413,12 +239,12 @@ extern "C" SDL_AppResult SDL_AppInit(void **appstate, int argc, char **argv) {
|
|||||||
Service::AM::FrontendAppletParameters load_parameters{
|
Service::AM::FrontendAppletParameters load_parameters{
|
||||||
.applet_id = Service::AM::AppletId::Application,
|
.applet_id = Service::AM::AppletId::Application,
|
||||||
};
|
};
|
||||||
const Core::SystemResultStatus load_result = state->system.Load(*state->emu_window, filepath, load_parameters);
|
const Core::SystemResultStatus load_result = state->system.Load(*state->emu_window, lp.filepath, load_parameters);
|
||||||
switch (load_result) {
|
switch (load_result) {
|
||||||
case Core::SystemResultStatus::Success:
|
case Core::SystemResultStatus::Success:
|
||||||
break; // Expected case
|
break; // Expected case
|
||||||
case Core::SystemResultStatus::ErrorGetLoader:
|
case Core::SystemResultStatus::ErrorGetLoader:
|
||||||
LOG_CRITICAL(Frontend, "Failed to obtain loader for {}!", filepath);
|
LOG_CRITICAL(Frontend, "Failed to obtain loader for {}!", lp.filepath);
|
||||||
return SDL_APP_FAILURE;
|
return SDL_APP_FAILURE;
|
||||||
case Core::SystemResultStatus::ErrorLoader:
|
case Core::SystemResultStatus::ErrorLoader:
|
||||||
LOG_CRITICAL(Frontend, "Failed to load ROM!");
|
LOG_CRITICAL(Frontend, "Failed to load ROM!");
|
||||||
@@ -440,14 +266,14 @@ extern "C" SDL_AppResult SDL_AppInit(void **appstate, int argc, char **argv) {
|
|||||||
return SDL_APP_FAILURE;
|
return SDL_APP_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (use_multiplayer) {
|
if (lp.use_multiplayer) {
|
||||||
if (auto member = Network::GetRoomMember().lock()) {
|
if (auto member = Network::GetRoomMember().lock()) {
|
||||||
member->BindOnChatMessageReceived(OnMessageReceived);
|
member->BindOnChatMessageReceived(OnMessageReceived);
|
||||||
member->BindOnStatusMessageReceived(OnStatusMessageReceived);
|
member->BindOnStatusMessageReceived(OnStatusMessageReceived);
|
||||||
member->BindOnStateChanged(OnStateChanged);
|
member->BindOnStateChanged(OnStateChanged);
|
||||||
member->BindOnError(OnNetworkError);
|
member->BindOnError(OnNetworkError);
|
||||||
LOG_DEBUG(Network, "Start connection to {}:{} with nickname {}", address, port, nickname);
|
LOG_DEBUG(Network, "Start connection to {}:{} with nickname {}", lp.address, lp.port, lp.nickname);
|
||||||
member->Join(nickname, address.c_str(), port, 0, Network::NoPreferredIP, password);
|
member->Join(lp.nickname, lp.address.c_str(), lp.port, 0, Network::NoPreferredIP, lp.password);
|
||||||
} else {
|
} else {
|
||||||
LOG_ERROR(Network, "Could not access RoomMember");
|
LOG_ERROR(Network, "Could not access RoomMember");
|
||||||
return SDL_APP_FAILURE;
|
return SDL_APP_FAILURE;
|
||||||
|
|||||||
Reference in New Issue
Block a user