Replace all remaining Citra references with Lime3DS

Whereas previous efforts were focused on the user-facing side, this commit replaces Citra references which are present in the codebase itself. This should be the last time a change like this is ever necessary.
This commit is contained in:
Reg Tiangha 2024-08-21 14:02:46 -06:00 committed by GitHub
parent 14d0bb534e
commit 7e938fcdd9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
164 changed files with 652 additions and 627 deletions

View file

@ -7,7 +7,7 @@ if [ "$TARGET" = "appimage" ]; then
export EXTRA_PLATFORM_PLUGINS="libqwayland-egl.so;libqwayland-generic.so"
else
# For the linux-fresh verification target, verify compilation without PCH as well.
export EXTRA_CMAKE_FLAGS=(-DCITRA_USE_PRECOMPILED_HEADERS=OFF)
export EXTRA_CMAKE_FLAGS=(-DLIME3DS_USE_PRECOMPILED_HEADERS=OFF)
fi
mkdir build && cd build

View file

@ -85,12 +85,12 @@ option(USE_DISCORD_PRESENCE "Enables Discord Rich Presence" OFF)
# Compile options
CMAKE_DEPENDENT_OPTION(COMPILE_WITH_DWARF "Add DWARF debugging information" ${IS_DEBUG_BUILD} "MINGW" OFF)
option(ENABLE_LTO "Enable link time optimization" ${DEFAULT_ENABLE_LTO})
option(CITRA_USE_PRECOMPILED_HEADERS "Use precompiled headers" ON)
option(CITRA_WARNINGS_AS_ERRORS "Enable warnings as errors" ON)
option(LIME3DS_USE_PRECOMPILED_HEADERS "Use precompiled headers" ON)
option(LIME3DS_WARNINGS_AS_ERRORS "Enable warnings as errors" ON)
include(CitraHandleSystemLibs)
include(Lime3DSHandleSystemLibs)
if (CITRA_USE_PRECOMPILED_HEADERS)
if (LIME3DS_USE_PRECOMPILED_HEADERS)
message(STATUS "Using Precompiled Headers.")
set(CMAKE_PCH_INSTANTIATE_TEMPLATES ON)

View file

@ -11,7 +11,7 @@ endif()
set(BUILD_DIR "${CMAKE_BINARY_DIR}/installer")
set(DIST_DIR "${BUILD_DIR}/dist")
set(TARGET_FILE "${DIST_DIR}/citra-setup-${PLATFORM}")
set(TARGET_FILE "${DIST_DIR}/lime3ds-setup-${PLATFORM}")
file(MAKE_DIRECTORY "${BUILD_DIR}" "${DIST_DIR}")

View file

@ -1,7 +1,7 @@
Citra Qt Installer
Lime3DS Qt Installer
==================
This contains the configuration files for building Citra's installer.
This contains the configuration files for building Lime3DS's installer.
Installers can only be built on the platform that they are targeting.

View file

@ -1,19 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<Installer>
<Name>Citra</Name>
<Name>Lime3DS</Name>
<Version>1.0.0</Version>
<Title>Citra Updater</Title>
<Publisher>Citra Team</Publisher>
<!-- e.g. /home/<user>/.citra or /opt/citra if run as root -->
<TargetDir>@HomeDir@/.citra</TargetDir>
<AdminTargetDir>/opt/citra</AdminTargetDir>
<Title>Lime3DS Updater</Title>
<Publisher>Lime3DS Team</Publisher>
<!-- e.g. /home/<user>/.lime3ds or /opt/lime3ds if run as root -->
<TargetDir>@HomeDir@/.lime3ds</TargetDir>
<AdminTargetDir>/opt/lime3ds</AdminTargetDir>
<InstallerApplicationIcon>icon</InstallerApplicationIcon>
<InstallerWindowIcon>icon.png</InstallerWindowIcon>
<RemoteRepositories>
<Repository>
<Url>https://repo.citra-emu.org</Url>
<Enabled>1</Enabled>
<DisplayName>Official Citra Repository</DisplayName>
<DisplayName>Official Lime3DS Repository</DisplayName>
</Repository>
</RemoteRepositories>
</Installer>

View file

@ -1,18 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<Installer>
<Name>Citra</Name>
<Name>Lime3DS</Name>
<Version>1.0.0</Version>
<Title>Citra Updater</Title>
<Publisher>Citra Team</Publisher>
<!-- e.g. /Applications/Citra -->
<TargetDir>@ApplicationsDir@/Citra</TargetDir>
<Title>Lime3DS Updater</Title>
<Publisher>Lime3DS Team</Publisher>
<!-- e.g. /Applications/Lime3DS -->
<TargetDir>@ApplicationsDir@/Lime3DS</TargetDir>
<InstallerApplicationIcon>icon</InstallerApplicationIcon>
<InstallerWindowIcon>icon.png</InstallerWindowIcon>
<RemoteRepositories>
<Repository>
<Url>https://repo.citra-emu.org</Url>
<Enabled>1</Enabled>
<DisplayName>Official Citra Repository</DisplayName>
<DisplayName>Official Lime3DS Repository</DisplayName>
</Repository>
</RemoteRepositories>
</Installer>

View file

@ -1,19 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<Installer>
<Name>Citra</Name>
<Name>Lime3DS</Name>
<Version>1.0.0</Version>
<Title>Citra Updater</Title>
<Publisher>Citra Team</Publisher>
<StartMenuDir>Citra</StartMenuDir>
<!-- e.g. C:\home\<user>\AppData\Local\Citra -->
<TargetDir>@HomeDir@/AppData/Local/Citra</TargetDir>
<Title>Lime3DS Updater</Title>
<Publisher>Lime3DS Team</Publisher>
<StartMenuDir>Lime3DS</StartMenuDir>
<!-- e.g. C:\home\<user>\AppData\Local\Lime3DS -->
<TargetDir>@HomeDir@/AppData/Local/Lime3DS</TargetDir>
<InstallerApplicationIcon>icon</InstallerApplicationIcon>
<InstallerWindowIcon>icon.png</InstallerWindowIcon>
<RemoteRepositories>
<Repository>
<Url>https://repo.citra-emu.org</Url>
<Enabled>1</Enabled>
<DisplayName>Official Citra Repository</DisplayName>
<DisplayName>Official Lime3DS Repository</DisplayName>
</Repository>
</RemoteRepositories>
</Installer>

View file

@ -116,7 +116,7 @@ if ("x86_64" IN_LIST ARCHITECTURE OR "arm64" IN_LIST ARCHITECTURE)
else()
set(DYNARMIC_TESTS OFF CACHE BOOL "")
set(DYNARMIC_FRONTENDS "A32" CACHE STRING "")
set(DYNARMIC_USE_PRECOMPILED_HEADERS ${CITRA_USE_PRECOMPILED_HEADERS} CACHE BOOL "")
set(DYNARMIC_USE_PRECOMPILED_HEADERS ${LIME3DS_USE_PRECOMPILED_HEADERS} CACHE BOOL "")
add_subdirectory(dynarmic EXCLUDE_FROM_ALL)
endif()
endif()
@ -267,7 +267,7 @@ if (USE_SYSTEM_JSON)
target_link_libraries(json-headers INTERFACE nlohmann_json::nlohmann_json)
get_target_property(NLOHMANN_PREFIX nlohmann_json::nlohmann_json INTERFACE_INCLUDE_DIRECTORIES)
# The nlohmann-json3 package expects "#include <nlohmann/json.hpp>"
# Citra uses "#include <json.hpp>" so we have to add this manually
# Lime3DS uses "#include <json.hpp>" so we have to add this manually
target_include_directories(json-headers SYSTEM INTERFACE "${NLOHMANN_PREFIX}/nlohmann")
else()
target_include_directories(json-headers SYSTEM INTERFACE ./json)
@ -298,7 +298,7 @@ add_library(httplib INTERFACE)
if(USE_SYSTEM_CPP_HTTPLIB)
find_package(CppHttp 0.14.1)
# Detect if system cpphttplib is a shared library
# this breaks building as Citra relies on functions that are moved
# this breaks building as Lime3DS relies on functions that are moved
# into the shared object.
get_target_property(HTTP_LIBS httplib::httplib INTERFACE_LINK_LIBRARIES)
if(HTTP_LIBS)

View file

@ -1,6 +1,6 @@
#!/bin/sh
# Enforce citra's whitespace policy
# Enforce Lime3DS's whitespace policy
git config --local core.whitespace tab-in-indent,trailing-space
paths_to_check="src/ CMakeLists.txt"

View file

@ -85,14 +85,14 @@ if (MSVC)
/wd4324 # 'struct_name': structure was padded due to __declspec(align())
)
if (CITRA_WARNINGS_AS_ERRORS)
if (LIME3DS_WARNINGS_AS_ERRORS)
add_compile_options(/WX)
endif()
# Since MSVC's debugging information is not very deterministic, so we have to disable it
# when using ccache or other caching tools
if (CMAKE_C_COMPILER_LAUNCHER STREQUAL "ccache" OR CMAKE_CXX_COMPILER_LAUNCHER STREQUAL "ccache"
OR CITRA_USE_PRECOMPILED_HEADERS)
OR LIME3DS_USE_PRECOMPILED_HEADERS)
# Precompiled headers are deleted if not using /Z7. See https://github.com/nanoant/CMakePCHCompiler/issues/21
add_compile_options(/Z7)
else()
@ -120,7 +120,7 @@ else()
add_compile_options(-D_FORTIFY_SOURCE=2)
endif()
if (CITRA_WARNINGS_AS_ERRORS)
if (LIME3DS_WARNINGS_AS_ERRORS)
add_compile_options(-Werror)
endif()

View file

@ -29,7 +29,7 @@ import java.util.Date
/**
* Class which contains methods that interact
* with the native side of the Citra code.
* with the native side of the Lime3DS code.
*/
object NativeLibrary {
/**

View file

@ -89,7 +89,7 @@ class EmulationActivity : AppCompatActivity() {
// Set these options now so that the SurfaceView the game renders into is the right size.
enableFullscreenImmersive()
// Override Citra core INI with the one set by our in game menu
// Override Lime3DS core INI with the one set by our in game menu
NativeLibrary.swapScreens(
EmulationMenuSettings.swapScreens,
windowManager.defaultDisplay.rotation

View file

@ -42,14 +42,14 @@ class Settings {
fun loadSettings(view: SettingsActivityView? = null) {
sections = SettingsSectionMap()
loadCitraSettings(view)
loadLime3DSSettings(view)
if (!TextUtils.isEmpty(gameId)) {
loadCustomGameSettings(gameId!!, view)
}
isLoaded = true
}
private fun loadCitraSettings(view: SettingsActivityView?) {
private fun loadLime3DSSettings(view: SettingsActivityView?) {
for ((fileName) in configFileSectionsMap) {
sections.putAll(SettingsFile.readFile(fileName, view))
}

View file

@ -108,7 +108,7 @@ class InputBindingSetting(
}
/**
* Returns the Citra button code for the settings key.
* Returns the Lime3DS button code for the settings key.
*/
private val buttonCode: Int
get() =
@ -259,7 +259,7 @@ class InputBindingSetting(
private const val INPUT_MAPPING_PREFIX = "InputMapping"
/**
* Returns the settings key for the specified Citra button code.
* Returns the settings key for the specified Lime3DS button code.
*/
private fun getButtonKey(buttonCode: Int): String =
when (buttonCode) {

View file

@ -212,11 +212,11 @@ class SettingsActivity : AppCompatActivity(), SettingsActivityView {
// Set the root of the document tree before we create a new config file or the native code
// will fail when creating the file.
if (DirectoryInitialization.setCitraUserDirectory()) {
if (DirectoryInitialization.setLime3DSUserDirectory()) {
LimeApplication.documentsTree.setRoot(Uri.parse(DirectoryInitialization.userPath))
NativeLibrary.createConfigFile()
} else {
throw IllegalStateException("Citra directory unavailable when accessing config file!")
throw IllegalStateException("Lime3DS directory unavailable when accessing config file!")
}
// Set default values for system config file

View file

@ -46,7 +46,7 @@ class SettingsActivityPresenter(private val activityView: SettingsActivityView)
}
private fun prepareDirectoriesIfNeeded() {
if (!DirectoryInitialization.areCitraDirectoriesReady()) {
if (!DirectoryInitialization.areLime3DSDirectoriesReady()) {
DirectoryInitialization.start()
}
loadSettingsUI()

View file

@ -891,7 +891,7 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
)
// Disabled until custom texture implementation gets rewrite, current one overloads RAM
// and crashes Citra.
// and crashes Lime3DS.
// add(
// SwitchSetting(
// BooleanSetting.PRELOAD_TEXTURES,

View file

@ -27,7 +27,7 @@ import io.github.lime3ds.android.LimeApplication
import io.github.lime3ds.android.R
import io.github.lime3ds.android.databinding.DialogCopyDirBinding
import io.github.lime3ds.android.model.SetupCallback
import io.github.lime3ds.android.utils.CitraDirectoryHelper
import io.github.lime3ds.android.utils.Lime3DSDirectoryHelper
import io.github.lime3ds.android.utils.FileUtil
import io.github.lime3ds.android.utils.PermissionsHandler
import io.github.lime3ds.android.viewmodel.HomeViewModel
@ -79,7 +79,7 @@ class CopyDirProgressDialog : DialogFragment() {
if (it) {
homeViewModel.setUserDir(
requireActivity(),
PermissionsHandler.citraDirectory.path!!
PermissionsHandler.lime3dsDirectory.path!!
)
homeViewModel.copyInProgress = false
homeViewModel.setPickingUserDir(false)
@ -140,7 +140,7 @@ class CopyDirProgressDialog : DialogFragment() {
}
override fun onComplete() {
CitraDirectoryHelper.initializeCitraDirectory(path)
Lime3DSDirectoryHelper.initializeLime3DSDirectory(path)
callback?.onStepCompleted()
viewModel.setCopyComplete(true)
}

View file

@ -451,10 +451,10 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback, Choreographer.Fram
return
}
if (DirectoryInitialization.areCitraDirectoriesReady()) {
if (DirectoryInitialization.areLime3DSDirectoriesReady()) {
emulationState.run(emulationActivity.isActivityRecreated)
} else {
setupCitraDirectoriesThenStartEmulation()
setupLime3DSDirectoriesThenStartEmulation()
}
}
@ -471,10 +471,10 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback, Choreographer.Fram
super.onDetach()
}
private fun setupCitraDirectoriesThenStartEmulation() {
private fun setupLime3DSDirectoriesThenStartEmulation() {
val directoryInitializationState = DirectoryInitialization.start()
if (directoryInitializationState ===
DirectoryInitializationState.CITRA_DIRECTORIES_INITIALIZED
DirectoryInitializationState.LIME3DS_DIRECTORIES_INITIALIZED
) {
emulationState.run(emulationActivity.isActivityRecreated)
} else if (directoryInitializationState ===

View file

@ -156,10 +156,10 @@ class HomeSettingsFragment : Fragment() {
driverViewModel.selectedDriverMetadata
),
HomeSetting(
R.string.select_citra_user_folder,
R.string.select_citra_user_folder_home_description,
R.string.select_lime3ds_user_folder,
R.string.select_lime3ds_user_folder_home_description,
R.drawable.ic_home,
{ mainActivity.openCitraDirectory.launch(null) },
{ mainActivity.openLime3DSDirectory.launch(null) },
details = homeViewModel.userDir
),
HomeSetting(
@ -243,7 +243,7 @@ class HomeSettingsFragment : Fragment() {
private fun shareLog() {
val logDirectory = DocumentFile.fromTreeUri(
requireContext(),
PermissionsHandler.citraDirectory
PermissionsHandler.lime3dsDirectory
)?.findFile("log")
val currentLog = logDirectory?.findFile("lime3ds_log.txt")
val oldLog = logDirectory?.findFile("lime3ds_log.old.txt")

View file

@ -15,13 +15,13 @@ import androidx.fragment.app.activityViewModels
import androidx.lifecycle.ViewModelProvider
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import io.github.lime3ds.android.R
import io.github.lime3ds.android.databinding.DialogCitraDirectoryBinding
import io.github.lime3ds.android.databinding.DialogLime3dsDirectoryBinding
import io.github.lime3ds.android.ui.main.MainActivity
import io.github.lime3ds.android.utils.PermissionsHandler
import io.github.lime3ds.android.viewmodel.HomeViewModel
class CitraDirectoryDialogFragment : DialogFragment() {
private lateinit var binding: DialogCitraDirectoryBinding
class Lime3DSDirectoryDialogFragment : DialogFragment() {
private lateinit var binding: DialogLime3dsDirectoryBinding
private val homeViewModel: HomeViewModel by activityViewModels()
@ -30,12 +30,12 @@ class CitraDirectoryDialogFragment : DialogFragment() {
}
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
binding = DialogCitraDirectoryBinding.inflate(layoutInflater)
binding = DialogLime3dsDirectoryBinding.inflate(layoutInflater)
val path = Uri.parse(requireArguments().getString(PATH))
binding.checkBox.isChecked = savedInstanceState?.getBoolean(MOVE_DATE_ENABLE) ?: false
val oldPath = PermissionsHandler.citraDirectory
val oldPath = PermissionsHandler.lime3dsDirectory
if (!PermissionsHandler.hasWriteAccess(requireActivity()) ||
oldPath.toString() == path.toString()
) {
@ -47,7 +47,7 @@ class CitraDirectoryDialogFragment : DialogFragment() {
isCancelable = false
return MaterialAlertDialogBuilder(requireContext())
.setView(binding.root)
.setTitle(R.string.select_citra_user_folder)
.setTitle(R.string.select_lime3ds_user_folder)
.setPositiveButton(android.R.string.ok) { _: DialogInterface?, _: Int ->
homeViewModel.directoryListener?.onPressPositiveButton(
if (binding.checkBox.visibility != View.GONE) {
@ -60,7 +60,7 @@ class CitraDirectoryDialogFragment : DialogFragment() {
}
.setNegativeButton(android.R.string.cancel) { _: DialogInterface?, _: Int ->
if (!PermissionsHandler.hasWriteAccess(requireContext())) {
(requireActivity() as MainActivity).openCitraDirectory.launch(null)
(requireActivity() as MainActivity).openLime3DSDirectory.launch(null)
}
}
.show()
@ -72,7 +72,7 @@ class CitraDirectoryDialogFragment : DialogFragment() {
}
companion object {
const val TAG = "citra_directory_dialog_fragment"
const val TAG = "lime3ds_directory_dialog_fragment"
private const val MOVE_DATE_ENABLE = "IS_MODE_DATA_ENABLE"
private const val PATH = "path"
@ -80,8 +80,8 @@ class CitraDirectoryDialogFragment : DialogFragment() {
activity: FragmentActivity,
path: String,
listener: Listener
): CitraDirectoryDialogFragment {
val dialog = CitraDirectoryDialogFragment()
): Lime3DSDirectoryDialogFragment {
val dialog = Lime3DSDirectoryDialogFragment()
ViewModelProvider(activity)[HomeViewModel::class.java].directoryListener = listener
val args = Bundle()
args.putString(PATH, path)

View file

@ -23,10 +23,10 @@ class SelectUserDirectoryDialogFragment : DialogFragment() {
isCancelable = false
return MaterialAlertDialogBuilder(requireContext())
.setTitle(R.string.select_citra_user_folder)
.setTitle(R.string.select_lime3ds_user_folder)
.setMessage(R.string.cannot_skip_directory_description)
.setPositiveButton(android.R.string.ok) { _: DialogInterface, _: Int ->
mainActivity.openCitraDirectory.launch(null)
mainActivity.openLime3DSDirectory.launch(null)
}
.show()
}

View file

@ -39,7 +39,7 @@ import io.github.lime3ds.android.model.SetupCallback
import io.github.lime3ds.android.model.SetupPage
import io.github.lime3ds.android.model.StepState
import io.github.lime3ds.android.ui.main.MainActivity
import io.github.lime3ds.android.utils.CitraDirectoryHelper
import io.github.lime3ds.android.utils.Lime3DSDirectoryHelper
import io.github.lime3ds.android.utils.GameHelper
import io.github.lime3ds.android.utils.PermissionsHandler
import io.github.lime3ds.android.utils.ViewUtils
@ -207,14 +207,14 @@ class SetupFragment : Fragment() {
add(
SetupPage(
R.drawable.ic_home,
R.string.select_citra_user_folder,
R.string.select_citra_user_folder_description,
R.string.select_lime3ds_user_folder,
R.string.select_lime3ds_user_folder_description,
0,
true,
R.string.select,
{
userDirCallback = it
openCitraDirectory.launch(null)
openLime3DSDirectory.launch(null)
},
true,
true,
@ -396,14 +396,14 @@ class SetupFragment : Fragment() {
private lateinit var userDirCallback: SetupCallback
private val openCitraDirectory = registerForActivityResult<Uri, Uri>(
private val openLime3DSDirectory = registerForActivityResult<Uri, Uri>(
ActivityResultContracts.OpenDocumentTree()
) { result: Uri? ->
if (result == null) {
return@registerForActivityResult
}
CitraDirectoryHelper(requireActivity()).showCitraDirectoryDialog(result, userDirCallback)
Lime3DSDirectoryHelper(requireActivity()).showLime3DSDirectoryDialog(result, userDirCallback)
}
private lateinit var gamesDirCallback: SetupCallback

View file

@ -895,7 +895,7 @@ class InputOverlay(context: Context?, attrs: AttributeSet?) : SurfaceView(contex
*
*
* This has a few benefits over the conventional way of storing the values
* (ie. within the Citra ini file).
* (ie. within the Lime3DS ini file).
*
* * No native calls
* * Keeps Android-only values inside the Android environment

View file

@ -46,7 +46,7 @@ import io.github.lime3ds.android.features.settings.ui.SettingsActivity
import io.github.lime3ds.android.features.settings.utils.SettingsFile
import io.github.lime3ds.android.fragments.SelectUserDirectoryDialogFragment
import io.github.lime3ds.android.utils.CiaInstallWorker
import io.github.lime3ds.android.utils.CitraDirectoryHelper
import io.github.lime3ds.android.utils.Lime3DSDirectoryHelper
import io.github.lime3ds.android.utils.DirectoryInitialization
import io.github.lime3ds.android.utils.FileBrowserHelper
import io.github.lime3ds.android.utils.InsetsHelper
@ -67,12 +67,12 @@ class MainActivity : AppCompatActivity(), ThemeProvider {
override fun onCreate(savedInstanceState: Bundle?) {
val splashScreen = installSplashScreen()
splashScreen.setKeepOnScreenCondition {
!DirectoryInitialization.areCitraDirectoriesReady() &&
!DirectoryInitialization.areLime3DSDirectoriesReady() &&
PermissionsHandler.hasWriteAccess(this)
}
if (PermissionsHandler.hasWriteAccess(applicationContext) &&
DirectoryInitialization.areCitraDirectoriesReady()) {
DirectoryInitialization.areLime3DSDirectoriesReady()) {
settingsViewModel.settings.loadSettings()
}
@ -300,14 +300,14 @@ class MainActivity : AppCompatActivity(), ThemeProvider {
windowInsets
}
val openCitraDirectory = registerForActivityResult<Uri, Uri>(
val openLime3DSDirectory = registerForActivityResult<Uri, Uri>(
ActivityResultContracts.OpenDocumentTree()
) { result: Uri? ->
if (result == null) {
return@registerForActivityResult
}
CitraDirectoryHelper(this@MainActivity).showCitraDirectoryDialog(result)
Lime3DSDirectoryHelper(this@MainActivity).showLime3DSDirectoryDialog(result)
}
val ciaFileInstaller = registerForActivityResult(

View file

@ -20,7 +20,7 @@ import java.util.concurrent.atomic.AtomicBoolean
/**
* A service that spawns its own thread in order to copy several binary and shader files
* from the Citra APK to the external file system.
* from the Lime3DS APK to the external file system.
*/
object DirectoryInitialization {
private const val SYS_DIR_VERSION = "sysDirectoryVersion"
@ -30,25 +30,25 @@ object DirectoryInitialization {
var userPath: String? = null
val internalUserPath
get() = LimeApplication.appContext.getExternalFilesDir(null)!!.canonicalPath
private val isCitraDirectoryInitializationRunning = AtomicBoolean(false)
private val isLime3DSDirectoryInitializationRunning = AtomicBoolean(false)
val context: Context get() = LimeApplication.appContext
@JvmStatic
fun start(): DirectoryInitializationState? {
if (!isCitraDirectoryInitializationRunning.compareAndSet(false, true)) {
if (!isLime3DSDirectoryInitializationRunning.compareAndSet(false, true)) {
return null
}
if (directoryState != DirectoryInitializationState.CITRA_DIRECTORIES_INITIALIZED) {
if (directoryState != DirectoryInitializationState.LIME3DS_DIRECTORIES_INITIALIZED) {
directoryState = if (hasWriteAccess(context)) {
if (setCitraUserDirectory()) {
if (setLime3DSUserDirectory()) {
LimeApplication.documentsTree.setRoot(Uri.parse(userPath))
NativeLibrary.createLogFile()
NativeLibrary.logUserDirectory(userPath.toString())
NativeLibrary.createConfigFile()
GpuDriverHelper.initializeDriverParameters()
DirectoryInitializationState.CITRA_DIRECTORIES_INITIALIZED
DirectoryInitializationState.LIME3DS_DIRECTORIES_INITIALIZED
} else {
DirectoryInitializationState.CANT_FIND_EXTERNAL_STORAGE
}
@ -56,7 +56,7 @@ object DirectoryInitialization {
DirectoryInitializationState.EXTERNAL_STORAGE_PERMISSION_NEEDED
}
}
isCitraDirectoryInitializationRunning.set(false)
isLime3DSDirectoryInitializationRunning.set(false)
return directoryState
}
@ -70,13 +70,13 @@ object DirectoryInitialization {
}
@JvmStatic
fun areCitraDirectoriesReady(): Boolean {
return directoryState == DirectoryInitializationState.CITRA_DIRECTORIES_INITIALIZED
fun areLime3DSDirectoriesReady(): Boolean {
return directoryState == DirectoryInitializationState.LIME3DS_DIRECTORIES_INITIALIZED
}
fun resetCitraDirectoryState() {
fun resetLime3DSDirectoryState() {
directoryState = null
isCitraDirectoryInitializationRunning.compareAndSet(true, false)
isLime3DSDirectoryInitializationRunning.compareAndSet(true, false)
}
val userDirectory: String?
@ -84,17 +84,17 @@ object DirectoryInitialization {
checkNotNull(directoryState) {
"DirectoryInitialization has to run at least once!"
}
check(!isCitraDirectoryInitializationRunning.get()) {
check(!isLime3DSDirectoryInitializationRunning.get()) {
"DirectoryInitialization has to finish running first!"
}
return userPath
}
fun setCitraUserDirectory(): Boolean {
val dataPath = PermissionsHandler.citraDirectory
fun setLime3DSUserDirectory(): Boolean {
val dataPath = PermissionsHandler.lime3dsDirectory
if (dataPath.toString().isNotEmpty()) {
userPath = dataPath.toString()
android.util.Log.d("[Citra Frontend]", "[DirectoryInitialization] User Dir: $userPath")
android.util.Log.d("[Lime3DS Frontend]", "[DirectoryInitialization] User Dir: $userPath")
return true
}
return false
@ -156,7 +156,7 @@ object DirectoryInitialization {
}
enum class DirectoryInitializationState {
CITRA_DIRECTORIES_INITIALIZED,
LIME3DS_DIRECTORIES_INITIALIZED,
EXTERNAL_STORAGE_PERMISSION_NEEDED,
CANT_FIND_EXTERNAL_STORAGE
}

View file

@ -14,7 +14,7 @@ import java.util.StringTokenizer
import java.util.concurrent.ConcurrentHashMap
/**
* A cached document tree for Citra user directory.
* A cached document tree for Lime3DS user directory.
* For every filepath which is not startsWith "content://" will need to use this class to traverse.
* For example:
* C++ Lime3DS log file directory will be /log/lime3ds_log.txt.

View file

@ -8,21 +8,21 @@ import android.content.Intent
import android.net.Uri
import androidx.fragment.app.FragmentActivity
import androidx.lifecycle.ViewModelProvider
import io.github.lime3ds.android.fragments.CitraDirectoryDialogFragment
import io.github.lime3ds.android.fragments.Lime3DSDirectoryDialogFragment
import io.github.lime3ds.android.fragments.CopyDirProgressDialog
import io.github.lime3ds.android.model.SetupCallback
import io.github.lime3ds.android.viewmodel.HomeViewModel
/**
* Citra directory initialization ui flow controller.
* Lime3DS directory initialization ui flow controller.
*/
class CitraDirectoryHelper(private val fragmentActivity: FragmentActivity) {
fun showCitraDirectoryDialog(result: Uri, callback: SetupCallback? = null) {
val citraDirectoryDialog = CitraDirectoryDialogFragment.newInstance(
class Lime3DSDirectoryHelper(private val fragmentActivity: FragmentActivity) {
fun showLime3DSDirectoryDialog(result: Uri, callback: SetupCallback? = null) {
val lime3dsDirectoryDialog = Lime3DSDirectoryDialogFragment.newInstance(
fragmentActivity,
result.toString(),
CitraDirectoryDialogFragment.Listener { moveData: Boolean, path: Uri ->
val previous = PermissionsHandler.citraDirectory
Lime3DSDirectoryDialogFragment.Listener { moveData: Boolean, path: Uri ->
val previous = PermissionsHandler.lime3dsDirectory
// Do noting if user select the previous path.
if (path == previous) {
return@Listener
@ -35,7 +35,7 @@ class CitraDirectoryHelper(private val fragmentActivity: FragmentActivity) {
takeFlags
)
if (!moveData || previous.toString().isEmpty()) {
initializeCitraDirectory(path)
initializeLime3DSDirectory(path)
callback?.onStepCompleted()
val viewModel = ViewModelProvider(fragmentActivity)[HomeViewModel::class.java]
viewModel.setUserDir(fragmentActivity, path.path!!)
@ -47,16 +47,16 @@ class CitraDirectoryHelper(private val fragmentActivity: FragmentActivity) {
CopyDirProgressDialog.newInstance(fragmentActivity, previous, path, callback)
?.show(fragmentActivity.supportFragmentManager, CopyDirProgressDialog.TAG)
})
citraDirectoryDialog.show(
lime3dsDirectoryDialog.show(
fragmentActivity.supportFragmentManager,
CitraDirectoryDialogFragment.TAG
Lime3DSDirectoryDialogFragment.TAG
)
}
companion object {
fun initializeCitraDirectory(path: Uri) {
PermissionsHandler.setCitraDirectory(path.toString())
DirectoryInitialization.resetCitraDirectoryState()
fun initializeLime3DSDirectory(path: Uri) {
PermissionsHandler.setLime3DSDirectory(path.toString())
DirectoryInitialization.resetLime3DSDirectoryState()
DirectoryInitialization.start()
}
}

View file

@ -13,17 +13,17 @@ import androidx.documentfile.provider.DocumentFile
import io.github.lime3ds.android.LimeApplication
object PermissionsHandler {
const val CITRA_DIRECTORY = "CITRA_DIRECTORY"
const val LIME3DS_DIRECTORY = "LIME3DS_DIRECTORY"
val preferences: SharedPreferences =
PreferenceManager.getDefaultSharedPreferences(LimeApplication.appContext)
fun hasWriteAccess(context: Context): Boolean {
try {
if (citraDirectory.toString().isEmpty()) {
if (lime3dsDirectory.toString().isEmpty()) {
return false
}
val uri = citraDirectory
val uri = lime3dsDirectory
val takeFlags =
Intent.FLAG_GRANT_READ_URI_PERMISSION or Intent.FLAG_GRANT_WRITE_URI_PERMISSION
context.contentResolver.takePersistableUriPermission(uri, takeFlags)
@ -34,17 +34,17 @@ object PermissionsHandler {
context.contentResolver.releasePersistableUriPermission(uri, takeFlags)
} catch (e: Exception) {
Log.error("[PermissionsHandler]: Cannot check citra data directory permission, error: " + e.message)
Log.error("[PermissionsHandler]: Cannot check lime3ds data directory permission, error: " + e.message)
}
return false
}
val citraDirectory: Uri
val lime3dsDirectory: Uri
get() {
val directoryString = preferences.getString(CITRA_DIRECTORY, "")
val directoryString = preferences.getString(LIME3DS_DIRECTORY, "")
return Uri.parse(directoryString)
}
fun setCitraDirectory(uriString: String?) =
preferences.edit().putString(CITRA_DIRECTORY, uriString).apply()
fun setLime3DSDirectory(uriString: String?) =
preferences.edit().putString(LIME3DS_DIRECTORY, uriString).apply()
}

View file

@ -58,7 +58,7 @@ object ThemeUtil {
if (preferences.getBoolean(Settings.PREF_BLACK_BACKGROUNDS, false) &&
isNightMode(activity)
) {
activity.setTheme(R.style.ThemeOverlay_Citra_Dark)
activity.setTheme(R.style.ThemeOverlay_Lime3DS_Dark)
}
}

View file

@ -14,7 +14,7 @@ import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asStateFlow
import io.github.lime3ds.android.LimeApplication
import io.github.lime3ds.android.R
import io.github.lime3ds.android.fragments.CitraDirectoryDialogFragment
import io.github.lime3ds.android.fragments.Lime3DSDirectoryDialogFragment
import io.github.lime3ds.android.utils.GameHelper
import io.github.lime3ds.android.utils.PermissionsHandler
@ -32,7 +32,7 @@ class HomeViewModel : ViewModel() {
private val _userDir = MutableStateFlow(
Uri.parse(
PreferenceManager.getDefaultSharedPreferences(LimeApplication.appContext)
.getString(PermissionsHandler.CITRA_DIRECTORY, "")
.getString(PermissionsHandler.LIME3DS_DIRECTORY, "")
).path ?: ""
)
@ -44,7 +44,7 @@ class HomeViewModel : ViewModel() {
).path ?: ""
)
var directoryListener: CitraDirectoryDialogFragment.Listener? = null
var directoryListener: Lime3DSDirectoryDialogFragment.Listener? = null
val dirProgress get() = _dirProgress.asStateFlow()
private val _dirProgress = MutableStateFlow(0)

View file

@ -150,7 +150,8 @@ void Config::ReadValues() {
ReadSetting("Renderer", Settings::values.texture_filter);
ReadSetting("Renderer", Settings::values.texture_sampling);
// Work around to map Android setting for enabling the frame limiter to the format Citra expects
// Work around to map Android setting for enabling the frame limiter to the format Lime3DS
// expects
if (sdl2_config->GetBoolean("Renderer", "use_frame_limit", true)) {
ReadSetting("Renderer", Settings::values.frame_limit);
} else {
@ -281,8 +282,9 @@ void Config::ReadValues() {
// Web Service
NetSettings::values.web_api_url =
sdl2_config->GetString("WebService", "web_api_url", "https://api.citra-emu.org");
NetSettings::values.citra_username = sdl2_config->GetString("WebService", "citra_username", "");
NetSettings::values.citra_token = sdl2_config->GetString("WebService", "citra_token", "");
NetSettings::values.lime3ds_username =
sdl2_config->GetString("WebService", "lime3ds_username", "");
NetSettings::values.lime3ds_token = sdl2_config->GetString("WebService", "lime3ds_token", "");
}
void Config::Reload() {

View file

@ -74,7 +74,7 @@ touch_device= engine:emu_window
# Most desktop operating systems do not expose a way to poll the motion state of the controllers
# so as a way around it, cemuhook created a udp client/server protocol to broadcast the data directly
# from a controller device to the client program. Citra has a client that can connect and read
# from a controller device to the client program. Lime3DS has a client that can connect and read
# from any cemuhook compatible motion program.
# IPv4 address of the udp input server (Default "127.0.0.1")
@ -293,7 +293,7 @@ input_device =
use_virtual_sd =
[System]
# The system model that Citra will try to emulate
# The system model that Lime3DS will try to emulate
# 0: Old 3DS (default), 1: New 3DS
is_new_3ds =
@ -301,16 +301,16 @@ is_new_3ds =
# 0 (default): No, 1: Yes
lle_applets =
# The system region that Citra will use during emulation
# The system region that Lime3DS will use during emulation
# -1: Auto-select (default), 0: Japan, 1: USA, 2: Europe, 3: Australia, 4: China, 5: Korea, 6: Taiwan
region_value =
# The system language that Citra will use during emulation
# The system language that Lime3DS will use during emulation
# 0: Japanese, 1: English (default), 2: French, 3: German, 4: Italian, 5: Spanish,
# 6: Simplified Chinese, 7: Korean, 8: Dutch, 9: Portuguese, 10: Russian, 11: Traditional Chinese
language =
# The clock to use when citra starts
# The clock to use when lime3ds starts
# 0: System clock (default), 1: fixed time
init_clock =
@ -319,7 +319,7 @@ init_clock =
# Note: 3DS can only handle times later then Jan 1 2000
init_time =
# The system ticks count to use when citra starts
# The system ticks count to use when lime3ds starts
# 0: Random (default), 1: Fixed
init_ticks_type =
@ -382,9 +382,9 @@ gdbstub_port=24689
[WebService]
# URL for Web API
web_api_url = https://api.citra-emu.org
# Username and token for Citra Web Service
# Username and token for Lime3DS Web Service
# See https://profile.citra-emu.org/ for more info
citra_username =
citra_token =
lime3ds_username =
lime3ds_token =
)";
}

View file

@ -16,9 +16,9 @@
#include <core/hle/service/cfg/cfg.h>
#include "audio_core/dsp_interface.h"
#include "common/arch.h"
#if CITRA_ARCH(arm64)
#if LIME3DS_ARCH(arm64)
#include "common/aarch64/cpu_detect.h"
#elif CITRA_ARCH(x86_64)
#elif LIME3DS_ARCH(x86_64)
#include "common/x64/cpu_detect.h"
#endif
#include "common/common_paths.h"
@ -58,7 +58,7 @@
#include "video_core/gpu.h"
#include "video_core/renderer_base.h"
#if defined(ENABLE_VULKAN) && CITRA_ARCH(arm64)
#if defined(ENABLE_VULKAN) && LIME3DS_ARCH(arm64)
#include <adrenotools/driver.h>
#endif
@ -130,7 +130,7 @@ static bool CheckMicPermission() {
IDCache::GetRequestMicPermission());
}
static Core::System::ResultStatus RunCitra(const std::string& filepath) {
static Core::System::ResultStatus RunLime3DS(const std::string& filepath) {
// Lime3DS core only supports a single running instance
std::scoped_lock lock(running_mutex);
@ -258,7 +258,7 @@ static Core::System::ResultStatus RunCitra(const std::string& filepath) {
}
void EnableAdrenoTurboMode(bool enable) {
#if defined(ENABLE_VULKAN) && CITRA_ARCH(arm64)
#if defined(ENABLE_VULKAN) && LIME3DS_ARCH(arm64)
adrenotools_set_turbo(enable);
#endif
}
@ -266,7 +266,7 @@ void EnableAdrenoTurboMode(bool enable) {
void InitializeGpuDriver(const std::string& hook_lib_dir, const std::string& custom_driver_dir,
const std::string& custom_driver_name,
const std::string& file_redirect_dir) {
#if defined(ENABLE_VULKAN) && CITRA_ARCH(arm64)
#if defined(ENABLE_VULKAN) && LIME3DS_ARCH(arm64)
void* handle{};
const char* file_redirect_dir_{};
int featureFlags{};
@ -463,7 +463,7 @@ jobject Java_io_github_lime3ds_android_NativeLibrary_downloadTitleFromNus(
jboolean JNICALL Java_io_github_lime3ds_android_utils_GpuDriverHelper_supportsCustomDriverLoading(
JNIEnv* env, jobject instance) {
#ifdef CITRA_ARCH_arm64
#ifdef LIME3DS_ARCH_arm64
// If the KGSL device exists custom drivers can be loaded using adrenotools
return SupportsCustomDriver();
#else
@ -522,7 +522,7 @@ jboolean Java_io_github_lime3ds_android_NativeLibrary_onGamePadMoveEvent(
[[maybe_unused]] JNIEnv* env, [[maybe_unused]] jobject obj, [[maybe_unused]] jstring j_device,
jint axis, jfloat x, jfloat y) {
// Clamp joystick movement to supported minimum and maximum
// Citra uses an inverted y axis sent by the frontend
// Lime3DS uses an inverted y axis sent by the frontend
x = std::clamp(x, -1.f, 1.f);
y = std::clamp(-y, -1.f, 1.f);
@ -649,7 +649,7 @@ void Java_io_github_lime3ds_android_NativeLibrary_run__Ljava_lang_String_2(
running_cv.notify_all();
}
const Core::System::ResultStatus result{RunCitra(path)};
const Core::System::ResultStatus result{RunLime3DS(path)};
if (result != Core::System::ResultStatus::Success) {
env->CallStaticVoidMethod(IDCache::GetNativeLibraryClass(),
IDCache::GetExitEmulationActivity(), static_cast<int>(result));

View file

@ -72,7 +72,7 @@
android:layout_marginHorizontal="24dp"
android:layout_marginTop="6dp"
android:textAlignment="viewStart"
android:text="@string/citra_description" />
android:text="@string/lime3ds_description" />
</LinearLayout>

View file

@ -20,7 +20,7 @@
<string name="share_log_not_found">Keine Log-Datei gefunden</string>
<string name="select_games_folder">Spieleordner auswählen</string>
<string name="about">Über</string>
<string name="citra_description">Ein open-source 3DS-Emulator</string>
<string name="lime3ds_description">Ein open-source 3DS-Emulator</string>
<string name="theme_and_color_description">Das Aussehen der App verändern</string>
<string name="install_cia_title">CIA Installieren</string>

View file

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_disclaimer">Este software correrá juegos de la consola portátil Nintendo 3DS. No se incluye ningún juego.\n\nAntes de comenzar, elige una carpeta en donde guardar los datos de usuario de Lime3DS.\n\nQué es ésto:\n<a href='https://web.archive.org/web/20240304193549/https://github.com/citra-emu/citra/wiki/Citra-Android-user-data-and-storage'>Wiki - Datos de usuario de Lime3DS Android y almacenamiento</a></string>
<string name="app_notification_channel_description">Notificaciones del Emulador Lime3DS</string>
<string name="app_notification_running">Lime3DS está ejecutándose</string>
<string name="app_game_install_description">A continuación, tendrás que seleccionar una Carpeta de Juegos. Lime3DS mostrará todas las ROMs de 3DS en la carpeta seleccionada en la app.\n\nLas ROMs en CIA, actualizaciones y DLC tendrán que ser instaladas por separado al darle al icono de la carpeta y seleccionar Instalar CIA.</string>
@ -26,10 +25,10 @@
<string name="select_games_folder">Seleccionar Directorio de Juego</string>
<string name="select_games_folder_description">Permite que Lime3DS llene la lista de juegos</string>
<string name="about">Acerca de</string>
<string name="citra_description">Un emulador de 3DS de código abierto</string>
<string name="lime3ds_description">Un emulador de 3DS de código abierto</string>
<string name="about_description">Versión de compilación, créditos y más</string>
<string name="games_dir_selected">Directorio de juegos seleccionado</string>
<string name="select_citra_user_folder_home_description">Cambia los archivos que Lime3DS usa para cargar juegos</string>
<string name="select_lime3ds_user_folder_home_description">Cambia los archivos que Lime3DS usa para cargar juegos</string>
<string name="theme_and_color_description">Modifica el aspecto de la app</string>
<string name="install_cia_title">Instalar CIA</string>
@ -79,17 +78,13 @@
<string name="permission_denied">Permiso denegado</string>
<string name="add_games_warning">¿Saltarse la selección de la carpeta de juegos?</string>
<string name="add_games_warning_description">Los juegos no se mostrarán en la lista de juegos si no se selecciona una carpeta.</string>
<string name="add_games_warning_help">https://web.archive.org/web/20240304210021/https://citra-emu.org/wiki/dumping-game-cartridges/</string>
<string name="warning_help">Ayuda</string>
<string name="warning_skip">Saltar</string>
<string name="warning_cancel">Cancelar</string>
<string name="select_citra_user_folder">Seleccionar Carpeta de Usuario</string>
<string name="select_citra_user_folder_description"><![CDATA[Selecciona tu directorio con los <a href=\"https://web.archive.org/web/20240304193549/https://github.com/citra-emu/citra/wiki/Citra-Android-user-data-and-storage\">datos de usuario</a> con el botón de debajo.]]></string>
<string name="select_lime3ds_user_folder">Seleccionar Carpeta de Usuario</string>
<string name="select">Seleccionar</string>
<string name="cannot_skip">No puedes saltarte este paso</string>
<string name="cannot_skip_directory_description">Este paso es imprescindible para que así Lime3DS pueda funcionar. Por favor, seleccione un directorio y entonces podrás continuar.</string>
<string name="cannot_skip_directory_help">https://web.archive.org/web/20240304193549/https://github.com/citra-emu/citra/wiki/Citra-Android-user-data-and-storage</string>
<!-- Search Strings -->
<string name="search_and_filter_games">Buscar y Filtrar Juegos</string>
<string name="home_search_games">Buscar Juegos</string>
@ -132,7 +127,6 @@
<string name="download">Descargar</string>
<string name="start">Iniciar</string>
<string name="keys_missing">Lime3DS no tiene las claves para descargar los archivos de sistema.</string>
<string name="how_to_get_keys"><![CDATA[<a href=\"https://web.archive.org/web/20240304203412/https://citra-emu.org/wiki/aes-keys/\">¿Cómo obtener las claves?</a>]]></string>
<string name="show_home_apps">Mostrar las apps del menú HOME en la lista de juegos</string>
<string name="run_system_setup">Ejecutar la Configuración de la consola cuando se ejecute el Menú HOME</string>
<string name="system_type_minimal">Mínimo</string>
@ -250,8 +244,6 @@ Se esperan fallos gráficos temporales cuando ésta esté activado.</string>
<string name="use_shader_jit">Shader JIT</string>
<string name="use_disk_shader_cache">Caché de sombreador de disco</string>
<string name="use_disk_shader_cache_description">Reduce los parones al guardar y cargar shaders generados y almacenados. No puede ser usado sin Activar Hardware Shader.</string>
<string name="adreno_gpu_boost">Mejora Adreno GPU (Experimental)</string>
<string name="adreno_gpu_boost_description">Aumenta el rendimiento gráfico en dispositivos compatibles, mejorando así el rendimiento general. Puede provocar un incremento de la potencia usada y la temperatura, así como también problemas de estabilidad en algunos dispositivos.</string>
<string name="utility">Utilidades</string>
<string name="dump_textures">Volcar Texturas</string>
<string name="dump_textures_description">Las texturas han sido volcadas a dump/textures/[Title ID]/.</string>
@ -283,7 +275,6 @@ Se esperan fallos gráficos temporales cuando ésta esté activado.</string>
<string name="learn_more">Más Información</string>
<string name="close">Cerrar</string>
<string name="reset_to_default">Restablecer valores de fábrica</string>
<string name="redump_games"><![CDATA[Por favor, sigue las guías para volcar tus <a href=\"https://web.archive.org/web/20240304210021/https://citra-emu.org/wiki/dumping-game-cartridges/\">cartuchos de juego</a> y/o <a href=\"https://web.archive.org/web/20240304210011/https://citra-emu.org/wiki/dumping-installed-titles/\">títulos instalados</a>.]]></string>
<string name="option_default">Por defecto</string>
<string name="none">Ninguno</string>
<string name="auto">Auto</string>
@ -317,6 +308,7 @@ Se esperan fallos gráficos temporales cuando ésta esté activado.</string>
<string name="preferences_audio">Audio</string>
<string name="preferences_debug">Depuración</string>
<string name="preferences_theme">Tema y Color</string>
<!-- ROM loading errors -->
<string name="loader_error_encrypted">Tu ROM está encriptada</string>
<string name="loader_error_invalid_format">Formato de ROM no válido</string>
@ -350,6 +342,7 @@ Se esperan fallos gráficos temporales cuando ésta esté activado.</string>
<string name="emulation_screen_layout_single">Pantalla Única</string>
<string name="emulation_screen_layout_sidebyside">Conjunta</string>
<string name="emulation_screen_layout_hybrid">Pantallas híbridas</string>
<string name="emulation_cycle_landscape_layouts">Alternar Estilos de Pantalla Apaisados</string>
<string name="emulation_swap_screens">Intercambiar Pantallas</string>
<string name="emulation_touch_overlay_reset">Reiniciar Estilo</string>
<string name="emulation_show_overlay">Mostrar Estilo</string>
@ -417,13 +410,10 @@ Se esperan fallos gráficos temporales cuando ésta esté activado.</string>
<string name="fatal_error">Error Fatal</string>
<string name="fatal_error_message">Ha ocurrido un error fatal. Mira el registro para más detalles.\nSeguir con la emulación podría resultar en diversos cuelgues y bugs.</string>
<!-- Disk Shader Cache -->
<!-- Disk shader cache -->
<string name="preparing_shaders">Preparando shaders</string>
<string name="building_shaders">Construyendo shaders</string>
<!-- About Game Dialog -->
<string name="play">Jugar</string>
<!-- Cheats -->
<string name="cheats">Trucos</string>
<string name="cheats_add">Añadir trucos</string>
@ -701,8 +691,5 @@ Se esperan fallos gráficos temporales cuando ésta esté activado.</string>
<string name="artic_base_connect_description">Conectar con una consola real que esté ejecutando un servidor Artic Base</string>
<string name="artic_base_connect">Conectar con Artic Base</string>
<string name="artic_base_enter_address">Introduce la dirección del servidor Artic Base</string>
<string name="miscellaneous">Misceláneos</string>
<string name="use_artic_base_controller">Usar Artic Controller al estar conectado al servidor de Artic Base</string>
<string name="use_artic_base_controller_desc">Usa los controles dados por el Servidor de Artic Base al estar conectado a éste en vez de los controles del dispositivo configurado.</string>
</resources>

View file

@ -25,10 +25,10 @@
<string name="select_games_folder">Sélectionner le dossier des jeux</string>
<string name="select_games_folder_description">Permet à Lime3DS de remplir la liste des jeux</string>
<string name="about">À propos</string>
<string name="citra_description">Un émulateur 3DS open-source</string>
<string name="lime3ds_description">Un émulateur 3DS open-source</string>
<string name="about_description">Numéro de build, crédits et plus encore</string>
<string name="games_dir_selected">Répertoire de jeux sélectionné</string>
<string name="select_citra_user_folder_home_description">Modifie les fichiers que Lime3DS utilise pour charger les jeux</string>
<string name="select_lime3ds_user_folder_home_description">Modifie les fichiers que Lime3DS utilise pour charger les jeux</string>
<string name="theme_and_color_description">Modifier l\'apparence de l\'application</string>
<string name="install_cia_title">Installer un CIA</string>
@ -81,7 +81,7 @@
<string name="warning_help">Aide</string>
<string name="warning_skip">Sauter</string>
<string name="warning_cancel">Annuler</string>
<string name="select_citra_user_folder">Sélectionnez le dossier utilisateur
<string name="select_lime3ds_user_folder">Sélectionnez le dossier utilisateur
 </string>
<string name="select">Sélectionner</string>
<string name="cannot_skip">Vous ne pouvez pas sauter cette étape</string>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="ThemeOverlay.Citra.Dark" parent="">
<style name="ThemeOverlay.Lime3DS.Dark" parent="">
<item name="colorSurface">@android:color/black</item>
<item name="android:colorBackground">@android:color/black</item>
</style>

View file

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_disclaimer">Este software irá executar jogos feitos para o console portátil Nintendo 3DS. Nenhum jogo está incluído.\n\nAntes de começar a emulação, selecione uma pasta para armazenar os dados do usuário do Lime3DS.\n\nO que é isto:\n<a href='https://web.archive.org/web/20240304193549/https://github.com/citra-emu/citra/wiki/Citra-Android-user-data-and-storage'>Wiki - Dados e armazenamento do usuário do Lime3DS Android</a></string>
<string name="app_notification_channel_description">Notificações do emulador Lime3DS</string>
<string name="app_notification_running">Lime3DS está rodando</string>
<string name="app_game_install_description">Em seguida, você precisará selecionar uma pasta de jogo. O Lime3DS exibirá todas as ROMs 3DS dentro da pasta selecionada no aplicativo.\n\nROMs, atualizações e DLC no formato CIA precisarão ser instalados separadamente clicando no ícone da pasta e selecionando Instalar CIA.</string>
@ -26,10 +25,10 @@
<string name="select_games_folder">Selecione a pasta de jogos</string>
<string name="select_games_folder_description">Permitir que o Lime3DS preencha a lista de jogos</string>
<string name="about">Sobre</string>
<string name="citra_description">Um emulador de 3DS de código aberto</string>
<string name="lime3ds_description">Um emulador de 3DS de código aberto</string>
<string name="about_description">Versão de compilação, créditos e mais</string>
<string name="games_dir_selected">Diretório de jogos selecionado</string>
<string name="select_citra_user_folder_home_description">Altere os arquivos que o Lime3DS usa para carregar jogos</string>
<string name="select_lime3ds_user_folder_home_description">Altere os arquivos que o Lime3DS usa para carregar jogos</string>
<string name="theme_and_color_description">Modificar a aparência do aplicativo</string>
<string name="install_cia_title">Instale a CIA</string>
@ -79,17 +78,13 @@
<string name="permission_denied">Permissão negada</string>
<string name="add_games_warning">Pular 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 for selecionada.</string>
<string name="add_games_warning_help">https://citra-emulator.com/wiki/dumping-game-cartridges/</string>
<string name="warning_help">Ajuda</string>
<string name="warning_skip">Pular</string>
<string name="warning_cancel">Cancelar</string>
<string name="select_citra_user_folder">Selecione a pasta do usuário</string>
<string name="select_citra_user_folder_description"><![CDATA[Selecione o<a href=\"https://web.archive.org/web/20240304193549/https://github.com/citra-emu/citra/wiki/Citra-Android-user-data-and-storage\">diretório de dados de usuário</a> com o botão abaixo.]]></string>
<string name="select_lime3ds_user_folder">Selecione a pasta do usuário</string>
<string name="select">Selecionar</string>
<string name="cannot_skip">Você não pode pular esta etapa</string>
<string name="cannot_skip_directory_description">Este passo é necessário para permitir que o Lime3DS funcione. Por favor, selecione um diretório para continuar.</string>
<string name="cannot_skip_directory_help">https://web.archive.org/web/20240304193549/https://github.com/citra-emu/citra/wiki/Citra-Android-user-data-and-storage</string>
<!-- Search Strings -->
<string name="search_and_filter_games">Pesquisar e Filtrar Jogos</string>
<string name="home_search_games">Pesquisar Jogos</string>
@ -132,7 +127,6 @@
<string name="download">Baixar</string>
<string name="start">Iniciar</string>
<string name="keys_missing">Lime3DS está sem as keys necessárias para realizar o download do arquivo de sistemas.</string>
<string name="how_to_get_keys"><![CDATA[<a href=\"https://web.archive.org/web/20240304203412/https://citra-emu.org/wiki/aes-keys/\">Como obter as chaves?</a>]]></string>
<string name="show_home_apps">Mostrar aplicativos do MENU INICIAL na lista de jogos</string>
<string name="run_system_setup">Execute as configurações de sistema quando o Menu Principal for iniciado.</string>
<string name="system_type_minimal">Mínimo</string>
@ -249,8 +243,6 @@
<string name="use_shader_jit">Sombreador JIT</string>
<string name="use_disk_shader_cache">Cache de Sombreadores em Disco</string>
<string name="use_disk_shader_cache_description">Reduz as interrupções armazenando e carregando os sombreadores gerados no disco. Não pode ser usado sem ativar o Sombreador de Hardware.</string>
<string name="adreno_gpu_boost">Adreno GPU Boost (Experimental)</string>
<string name="adreno_gpu_boost_description">Aumenta o rendimento gráfico em dispositivos suportados, melhorando o desempenho. O uso desta configuração pode aumentar o uso de energia e a temperatura. Pode causar problemas de estabilidade em determinados dispositivos.</string>
<string name="utility">Utilitário</string>
<string name="dump_textures">Extrair Texturas</string>
<string name="dump_textures_description">As texturas são extraídas em dump/textures/[Title ID]/.</string>
@ -282,7 +274,6 @@
<string name="learn_more">Saber mais</string>
<string name="close">Fechar</string>
<string name="reset_to_default">Redefinir para o Padrão</string>
<string name="redump_games"><![CDATA[Por favor, siga os tutoriais para recarregar seus <a href=\"https://web.archive.org/web/20240304210021/https://citra-emu.org/wiki/dumping-game-cartridges/\">cartuchos de jogos</a> ou <a href=\"https://web.archive.org/web/20240304210011/https://citra-emu.org/wiki/dumping-installed-titles/\">títulos instalados</a>.]]></string>
<string name="option_default">Padrão</string>
<string name="none">Nenhum</string>
<string name="auto">Automático</string>
@ -316,6 +307,7 @@
<string name="preferences_audio">Áudio</string>
<string name="preferences_debug">Depuração</string>
<string name="preferences_theme">Tema e Cor</string>
<!-- ROM loading errors -->
<string name="loader_error_encrypted">Sua ROM está Criptografada</string>
<string name="loader_error_invalid_format">Formato inválido de ROM</string>
@ -349,6 +341,7 @@
<string name="emulation_screen_layout_single">Tela única</string>
<string name="emulation_screen_layout_sidebyside">Telas lado a lado</string>
<string name="emulation_screen_layout_hybrid">Telas Híbridas</string>
<string name="emulation_cycle_landscape_layouts">Ciclo de Layouts de Paisagem</string>
<string name="emulation_swap_screens">Trocar telas</string>
<string name="emulation_touch_overlay_reset">Redefinir sobreposição</string>
<string name="emulation_show_overlay">Mostrar sobreposição</string>
@ -416,13 +409,10 @@
<string name="fatal_error">Erro Fatal</string>
<string name="fatal_error_message">Ocorreu um erro fatal. Verifique o registro para obter detalhes.\nContinuar a emulação pode resultar em falhas e bugs.</string>
<!-- Disk Shader Cache -->
<!-- Disk shader cache -->
<string name="preparing_shaders">Preparando Shaders</string>
<string name="building_shaders">Construindo Shaders</string>
<!-- About Game Dialog -->
<string name="play">Jogar</string>
<!-- Cheats -->
<string name="cheats">Truques</string>
<string name="cheats_add">Adicionar Trapaça</string>
@ -694,8 +684,5 @@
<string name="artic_base_connect_description">Conecte-se a um console real que esteja executando um servidor Artic Base</string>
<string name="artic_base_connect">Conectar-se ao Artic Base</string>
<string name="artic_base_enter_address">Digite o endereço do servidor Artic Base</string>
<string name="miscellaneous">Diversos</string>
<string name="use_artic_base_controller">Use o Controle Artic quando conectado ao Servidor Artic Base</string>
<string name="use_artic_base_controller_desc">Use os controles fornecidos pelo Servidor Artic Base quando conectado a ele, em vez do dispositivo de entrada configurado.</string>
</resources>

View file

@ -25,10 +25,10 @@
<string name="select_games_folder">Выбор папки с играми</string>
<string name="select_games_folder_description">Позволяет Lime3DS формировать список игр</string>
<string name="about">О приложении</string>
<string name="citra_description">Эмулятор 3DS с открытым исходным кодом</string>
<string name="lime3ds_description">Эмулятор 3DS с открытым исходным кодом</string>
<string name="about_description">Версия сборки, разработчики и другое</string>
<string name="games_dir_selected">Папка с играми выбрана</string>
<string name="select_citra_user_folder_home_description">Изменение файлов, используемых Lime3DS для запуска игр</string>
<string name="select_lime3ds_user_folder_home_description">Изменение файлов, используемых Lime3DS для запуска игр</string>
<string name="theme_and_color_description">Настройка внешнего вида приложения</string>
<string name="install_cia_title">Установить CIA</string>
@ -81,7 +81,7 @@
<string name="warning_help">Помощь</string>
<string name="warning_skip">Пропустить</string>
<string name="warning_cancel">Отмена</string>
<string name="select_citra_user_folder">Выбор папки пользователя</string>
<string name="select_lime3ds_user_folder">Выбор папки пользователя</string>
<string name="select">Выбрать</string>
<string name="cannot_skip">Вы не можете пропустить данное действие</string>
<string name="cannot_skip_directory_description">Данный шаг требуется для работы Lime3DS. Пожалуйста, укажите папку, чтобы продолжить.</string>

View file

@ -25,10 +25,10 @@
<string name="select_games_folder">选择游戏文件夹</string>
<string name="select_games_folder_description">允许 Lime3DS 填充游戏列表</string>
<string name="about">关于</string>
<string name="citra_description">一款开源的任天堂 3DS 模拟器</string>
<string name="lime3ds_description">一款开源的任天堂 3DS 模拟器</string>
<string name="about_description">构建版本、贡献者以及更多</string>
<string name="games_dir_selected">已选择游戏文件夹</string>
<string name="select_citra_user_folder_home_description">更改 Lime3DS 用于加载游戏的相关文件</string>
<string name="select_lime3ds_user_folder_home_description">更改 Lime3DS 用于加载游戏的相关文件</string>
<string name="theme_and_color_description">更改应用程序的外观</string>
<string name="install_cia_title">安装 CIA</string>
@ -81,7 +81,7 @@
<string name="warning_help">帮助</string>
<string name="warning_skip">跳过</string>
<string name="warning_cancel">取消</string>
<string name="select_citra_user_folder">选择用户文件夹</string>
<string name="select_lime3ds_user_folder">选择用户文件夹</string>
<string name="select">选择</string>
<string name="cannot_skip">此步骤不可跳过</string>
<string name="cannot_skip_directory_description">运行 Lime3DS 的必需步骤。请选择一个文件夹,然后才可继续。</string>

View file

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="lime3ds_primary">#154FE2</color>
<color name="lime3ds_onPrimary">#FFFFFF</color>
<color name="lime3ds_primaryContainer">#DCE1FF</color>
<color name="lime3ds_onPrimaryContainer">#001551</color>
<color name="lime3ds_secondary">#595D72</color>
<color name="lime3ds_onSecondary">#FFFFFF</color>
<color name="lime3ds_secondaryContainer">#DEE1F9</color>
<color name="lime3ds_onSecondaryContainer">#161B2C</color>
<color name="lime3ds_tertiary">#75546F</color>
<color name="lime3ds_onTertiary">#FFFFFF</color>
<color name="lime3ds_tertiaryContainer">#FFD7F5</color>
<color name="lime3ds_onTertiaryContainer">#2C1229</color>
<color name="lime3ds_error">#BA1A1A</color>
<color name="lime3ds_errorContainer">#FFDAD6</color>
<color name="lime3ds_onError">#FFFFFF</color>
<color name="lime3ds_onErrorContainer">#410002</color>
<color name="lime3ds_background">#FEFBFF</color>
<color name="lime3ds_onBackground">#1B1B1F</color>
<color name="lime3ds_surface">#FEFBFF</color>
<color name="lime3ds_onSurface">#1B1B1F</color>
<color name="lime3ds_surfaceVariant">#E2E1EC</color>
<color name="lime3ds_onSurfaceVariant">#45464F</color>
<color name="lime3ds_outline">#767680</color>
<color name="lime3ds_inverseOnSurface">#F2F0F4</color>
<color name="lime3ds_inverseSurface">#303034</color>
<color name="lime3ds_inversePrimary">#B7C4FF</color>
<color name="lime3ds_shadow">#000000</color>
<color name="lime3ds_surfaceTint">#154FE2</color>
<color name="lime3ds_outlineVariant">#C6C5D0</color>
<color name="lime3ds_scrim">#000000</color>
</resources>

View file

@ -30,10 +30,10 @@
<string name="select_games_folder">Select Games Folder</string>
<string name="select_games_folder_description">Allows Lime3DS to populate the games list</string>
<string name="about">About</string>
<string name="citra_description">An open-source 3DS emulator</string>
<string name="lime3ds_description">An open-source 3DS emulator</string>
<string name="about_description">Build version, credits, and more</string>
<string name="games_dir_selected">Games directory selected</string>
<string name="select_citra_user_folder_home_description">Changes the files that Lime3DS uses to load games</string>
<string name="select_lime3ds_user_folder_home_description">Changes the files that Lime3DS uses to load games</string>
<string name="theme_and_color_description">Modify the look of the app</string>
<string name="install_cia_title">Install CIA</string>
@ -87,8 +87,8 @@
<string name="warning_help">Help</string>
<string name="warning_skip">Skip</string>
<string name="warning_cancel">Cancel</string>
<string name="select_citra_user_folder">Select User Folder</string>
<string name="select_citra_user_folder_description"><![CDATA[Select your <a href="https://web.archive.org/web/20240304193549/https://github.com/citra-emu/citra/wiki/Citra-Android-user-data-and-storage">user data</a> directory with the button below.]]></string>
<string name="select_lime3ds_user_folder">Select User Folder</string>
<string name="select_lime3ds_user_folder_description"><![CDATA[Select your <a href="https://web.archive.org/web/20240304193549/https://github.com/citra-emu/citra/wiki/Citra-Android-user-data-and-storage">user data</a> directory with the button below.]]></string>
<string name="select">Select</string>
<string name="cannot_skip">You can\'t skip this step</string>
<string name="cannot_skip_directory_description">This step is required to allow Lime3DS to work. Please select a directory and then you can continue.</string>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="CitraSlider" parent="Widget.Material3.Slider">
<style name="LimeSlider" parent="Widget.Material3.Slider">
<item name="tickVisible">false</item>
<item name="labelBehavior">gone</item>
</style>

View file

@ -15,7 +15,7 @@
<item name="colorOnErrorContainer">@color/lime_onErrorContainer</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="sliderStyle">@style/CitraSlider</item>
<item name="sliderStyle">@style/LimeSlider</item>
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
</style>

View file

@ -62,6 +62,6 @@ if(ENABLE_OPENAL)
add_definitions(-DAL_LIBTYPE_STATIC)
endif()
if (CITRA_USE_PRECOMPILED_HEADERS)
if (LIME3DS_USE_PRECOMPILED_HEADERS)
target_precompile_headers(audio_core PRIVATE precompiled_headers.h)
endif()

View file

@ -50,7 +50,7 @@ void CubebInput::StartSampling(const InputParameters& params) {
parameters = params;
impl->sample_size_in_bytes = params.sample_size / 8;
auto init_result = cubeb_init(&impl->ctx, "Citra Input", nullptr);
auto init_result = cubeb_init(&impl->ctx, "Lime3DS Input", nullptr);
if (init_result != CUBEB_OK) {
LOG_CRITICAL(Audio, "cubeb_init failed: {}", init_result);
return;
@ -91,8 +91,8 @@ void CubebInput::StartSampling(const InputParameters& params) {
}
auto stream_init_result = cubeb_stream_init(
impl->ctx, &impl->stream, "Citra Microphone", input_device, &input_params, nullptr, nullptr,
latency_frames, Impl::DataCallback, Impl::StateCallback, impl.get());
impl->ctx, &impl->stream, "Lime3DS Microphone", input_device, &input_params, nullptr,
nullptr, latency_frames, Impl::DataCallback, Impl::StateCallback, impl.get());
if (stream_init_result != CUBEB_OK) {
LOG_CRITICAL(Audio, "cubeb_stream_init failed: {}", stream_init_result);
StopSampling();
@ -184,7 +184,7 @@ std::vector<std::string> ListCubebInputDevices() {
std::vector<std::string> device_list;
cubeb* ctx;
if (cubeb_init(&ctx, "Citra Input Device Enumerator", nullptr) != CUBEB_OK) {
if (cubeb_init(&ctx, "Lime3DS Input Device Enumerator", nullptr) != CUBEB_OK) {
LOG_CRITICAL(Audio, "cubeb_init failed");
return {};
}

View file

@ -25,7 +25,7 @@ struct CubebSink::Impl {
};
CubebSink::CubebSink(std::string_view target_device_name) : impl(std::make_unique<Impl>()) {
if (cubeb_init(&impl->ctx, "Citra Output", nullptr) != CUBEB_OK) {
if (cubeb_init(&impl->ctx, "Lime3DS Output", nullptr) != CUBEB_OK) {
LOG_CRITICAL(Audio_Sink, "cubeb_init failed");
return;
}
@ -68,7 +68,7 @@ CubebSink::CubebSink(std::string_view target_device_name) : impl(std::make_uniqu
}
}
auto stream_err = cubeb_stream_init(impl->ctx, &impl->stream, "CitraAudio", nullptr, nullptr,
auto stream_err = cubeb_stream_init(impl->ctx, &impl->stream, "Lime3DSAudio", nullptr, nullptr,
output_device, &params, std::max(512u, minimum_latency),
&Impl::DataCallback, &Impl::StateCallback, impl.get());
if (stream_err != CUBEB_OK) {
@ -164,7 +164,7 @@ std::vector<std::string> ListCubebSinkDevices() {
std::vector<std::string> device_list;
cubeb* ctx;
if (cubeb_init(&ctx, "Citra Output Device Enumerator", nullptr) != CUBEB_OK) {
if (cubeb_init(&ctx, "Lime3DS Output Device Enumerator", nullptr) != CUBEB_OK) {
LOG_CRITICAL(Audio_Sink, "cubeb_init failed");
return {};
}

View file

@ -195,12 +195,12 @@ if ("arm64" IN_LIST ARCHITECTURE)
target_link_libraries(lime_common PRIVATE oaknut)
endif()
if (CITRA_USE_PRECOMPILED_HEADERS)
if (LIME3DS_USE_PRECOMPILED_HEADERS)
target_precompile_headers(lime_common PRIVATE precompiled_headers.h)
endif()
find_library(BACKTRACE_LIBRARY backtrace)
if (BACKTRACE_LIBRARY AND ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND CMAKE_CXX_COMPILER_ID STREQUAL GNU)
target_link_libraries(lime_common PRIVATE ${BACKTRACE_LIBRARY} dl)
target_compile_definitions(lime_common PRIVATE CITRA_LINUX_GCC_BACKTRACE)
target_compile_definitions(lime_common PRIVATE LIME3DS_LINUX_GCC_BACKTRACE)
endif()

View file

@ -3,7 +3,7 @@
// Refer to the license.txt file included.
#include "common/arch.h"
#if CITRA_ARCH(arm64)
#if LIME3DS_ARCH(arm64)
#include <cstring>
#include <fstream>
@ -114,4 +114,4 @@ const CPUCaps& GetCPUCaps() {
} // namespace Common
#endif // CITRA_ARCH(arm64)
#endif // LIME3DS_ARCH(arm64)

View file

@ -5,7 +5,7 @@
#pragma once
#include "common/arch.h"
#if CITRA_ARCH(arm64)
#if LIME3DS_ARCH(arm64)
#include <string>
@ -33,4 +33,4 @@ const CPUCaps& GetCPUCaps();
} // namespace Common
#endif // CITRA_ARCH(arm64)
#endif // LIME3DS_ARCH(arm64)

View file

@ -5,7 +5,7 @@
#pragma once
#include "common/arch.h"
#if CITRA_ARCH(arm64)
#if LIME3DS_ARCH(arm64)
#include <bitset>
#include <initializer_list>
@ -198,4 +198,4 @@ inline void ABI_PopRegisters(oaknut::CodeGenerator& code, std::bitset<64> regs,
} // namespace Common::A64
#endif // CITRA_ARCH(arm64)
#endif // LIME3DS_ARCH(arm64)

View file

@ -5,7 +5,7 @@
#pragma once
#include "common/arch.h"
#if CITRA_ARCH(arm64)
#if LIME3DS_ARCH(arm64)
#include <type_traits>
#include <oaknut/oaknut.hpp>
@ -40,4 +40,4 @@ inline void CallFarFunction(oaknut::CodeGenerator& code, const T f) {
} // namespace Common::A64
#endif // CITRA_ARCH(arm64)
#endif // LIME3DS_ARCH(arm64)

View file

@ -6,8 +6,8 @@
#include <boost/predef.h>
#define CITRA_ARCH(NAME) (CITRA_ARCH_##NAME)
#define LIME3DS_ARCH(NAME) (LIME3DS_ARCH_##NAME)
#define CITRA_ARCH_x86_64 BOOST_ARCH_X86_64
#define CITRA_ARCH_arm64 \
#define LIME3DS_ARCH_x86_64 BOOST_ARCH_X86_64
#define LIME3DS_ARCH_arm64 \
(BOOST_ARCH_ARM >= BOOST_VERSION_NUMBER(8, 0, 0) && BOOST_ARCH_WORD_BITS == 64)

View file

@ -16,7 +16,7 @@
#define ASSERT(_a_) \
do \
if (!(_a_)) [[unlikely]] { \
[]() CITRA_NO_INLINE CITRA_NO_RETURN { \
[]() LIME3DS_NO_INLINE LIME3DS_NO_RETURN { \
LOG_CRITICAL(Debug, "Assertion Failed!"); \
Common::Log::Stop(); \
Crash(); \
@ -28,7 +28,7 @@
#define ASSERT_MSG(_a_, ...) \
do \
if (!(_a_)) [[unlikely]] { \
[&]() CITRA_NO_INLINE CITRA_NO_RETURN { \
[&]() LIME3DS_NO_INLINE LIME3DS_NO_RETURN { \
LOG_CRITICAL(Debug, "Assertion Failed!\n" __VA_ARGS__); \
Common::Log::Stop(); \
Crash(); \
@ -38,7 +38,7 @@
while (0)
#define UNREACHABLE() \
([]() CITRA_NO_INLINE CITRA_NO_RETURN { \
([]() LIME3DS_NO_INLINE LIME3DS_NO_RETURN { \
LOG_CRITICAL(Debug, "Unreachable code!"); \
Common::Log::Stop(); \
Crash(); \
@ -46,7 +46,7 @@
}())
#define UNREACHABLE_MSG(...) \
([&]() CITRA_NO_INLINE CITRA_NO_RETURN { \
([&]() LIME3DS_NO_INLINE LIME3DS_NO_RETURN { \
LOG_CRITICAL(Debug, "Unreachable code!\n" __VA_ARGS__); \
Common::Log::Stop(); \
Crash(); \

View file

@ -24,15 +24,15 @@
#endif
#ifdef _MSC_VER
#define CITRA_NO_INLINE __declspec(noinline)
#define LIME3DS_NO_INLINE __declspec(noinline)
#else
#define CITRA_NO_INLINE __attribute__((noinline))
#define LIME3DS_NO_INLINE __attribute__((noinline))
#endif
#ifdef _MSC_VER
#define CITRA_NO_RETURN __declspec(noreturn)
#define LIME3DS_NO_RETURN __declspec(noreturn)
#else
#define CITRA_NO_RETURN __attribute__((noreturn))
#define LIME3DS_NO_RETURN __attribute__((noreturn))
#endif
#ifdef _MSC_VER

View file

@ -868,8 +868,8 @@ bool StringReplace(std::string& haystack, const std::string& a, const std::strin
std::string SerializePath(const std::string& input, bool is_saving) {
auto result = input;
StringReplace(result, "%CITRA_ROM_FILE%", g_currentRomPath, is_saving);
StringReplace(result, "%CITRA_USER_DIR%", GetUserPath(UserPath::UserDir), is_saving);
StringReplace(result, "%LIME3DS_ROM_FILE%", g_currentRomPath, is_saving);
StringReplace(result, "%LIME3DS_USER_DIR%", GetUserPath(UserPath::UserDir), is_saving);
return result;
}

View file

@ -191,11 +191,11 @@ void SetUserPath(const std::string& path = "");
void SetCurrentRomPath(const std::string& path);
// Returns a pointer to a string with a Citra data dir in the user's home
// Returns a pointer to a string with a Lime3DS data dir in the user's home
// directory. To be used in "multi-user" mode (that is, installed).
[[nodiscard]] const std::string& GetUserPath(UserPath path);
// Returns a pointer to a string with the default Citra data dir in the user's home
// Returns a pointer to a string with the default Lime3DS data dir in the user's home
// directory.
[[nodiscard]] const std::string& GetDefaultUserPath(UserPath path);
@ -278,8 +278,8 @@ public:
IOFile();
// flags is used for windows specific file open mode flags, which
// allows citra to open the logs in shared write mode, so that the file
// isn't considered "locked" while citra is open and people can open the log file and view it
// allows lime3ds to open the logs in shared write mode, so that the file
// isn't considered "locked" while lime3ds is open and people can open the log file and view it
IOFile(const std::string& filename, const char openmode[], int flags = 0);
~IOFile();

View file

@ -14,7 +14,7 @@
#endif
#include <boost/algorithm/string/replace.hpp>
#ifdef CITRA_LINUX_GCC_BACKTRACE
#ifdef LIME3DS_LINUX_GCC_BACKTRACE
#define BOOST_STACKTRACE_USE_BACKTRACE
#include <boost/stacktrace.hpp>
#undef BOOST_STACKTRACE_USE_BACKTRACE
@ -182,7 +182,7 @@ public:
bool initialization_in_progress_suppress_logging = true;
#ifdef CITRA_LINUX_GCC_BACKTRACE
#ifdef LIME3DS_LINUX_GCC_BACKTRACE
[[noreturn]] void SleepForever() {
while (true) {
pause();
@ -251,7 +251,7 @@ public:
private:
Impl(const std::string& file_backend_filename, const Filter& filter_)
: filter{filter_}, file_backend{file_backend_filename} {
#ifdef CITRA_LINUX_GCC_BACKTRACE
#ifdef LIME3DS_LINUX_GCC_BACKTRACE
int waker_pipefd[2];
int done_printing_pipefd[2];
if (pipe2(waker_pipefd, O_CLOEXEC) || pipe2(done_printing_pipefd, O_CLOEXEC)) {
@ -260,7 +260,7 @@ private:
backtrace_thread_waker_fd = waker_pipefd[1];
backtrace_done_printing_fd = done_printing_pipefd[0];
std::thread([this, wait_fd = waker_pipefd[0], done_fd = done_printing_pipefd[1]] {
Common::SetCurrentThreadName("citra:Crash");
Common::SetCurrentThreadName("lime3ds:Crash");
for (u8 ignore = 0; read(wait_fd, &ignore, 1) != 1;)
;
const int sig = received_signal;
@ -305,7 +305,7 @@ private:
}
~Impl() {
#ifdef CITRA_LINUX_GCC_BACKTRACE
#ifdef LIME3DS_LINUX_GCC_BACKTRACE
if (int zero_or_ignore = 0;
!received_signal.compare_exchange_strong(zero_or_ignore, SIGKILL)) {
SleepForever();
@ -315,7 +315,7 @@ private:
void StartBackendThread() {
backend_thread = std::jthread([this](std::stop_token stop_token) {
Common::SetCurrentThreadName("citra:Log");
Common::SetCurrentThreadName("lime3ds:Log");
Entry entry;
const auto write_logs = [this, &entry]() {
ForEachBackend([&entry](Backend& backend) { backend.Write(entry); });
@ -374,7 +374,7 @@ private:
delete ptr;
}
#ifdef CITRA_LINUX_GCC_BACKTRACE
#ifdef LIME3DS_LINUX_GCC_BACKTRACE
[[noreturn]] static void HandleSignal(int sig) {
signal(SIGABRT, SIG_DFL);
signal(SIGSEGV, SIG_DFL);
@ -418,7 +418,7 @@ private:
std::chrono::steady_clock::time_point time_origin{std::chrono::steady_clock::now()};
std::jthread backend_thread;
#ifdef CITRA_LINUX_GCC_BACKTRACE
#ifdef LIME3DS_LINUX_GCC_BACKTRACE
std::atomic_int received_signal{0};
std::array<u8, 4096> backtrace_storage{};
int backtrace_thread_waker_fd;

View file

@ -137,7 +137,7 @@ void PrintMessageToLogcat([[maybe_unused]] const Entry& entry) {
case Level::Count:
UNREACHABLE();
}
__android_log_print(android_log_priority, "CitraNative", "%s", str.c_str());
__android_log_print(android_log_priority, "Lime3DSNative", "%s", str.c_str());
#endif
}
} // namespace Common::Log

View file

@ -100,7 +100,7 @@ enum class Class : u8 {
Input, ///< Input emulation
Network, ///< Network emulation
Movie, ///< Movie (Input Recording) Playback
WebService, ///< Interface to Citra Web Services
WebService, ///< Interface to Lime3DS Web Services
RPC_Server, ///< RPC server
Count, ///< Total number of logging classes
};

View file

@ -8,7 +8,7 @@
// external sampling profilers like "Very Sleepy", and will improve performance somewhat.
// #define MICROPROFILE_ENABLED 0
// Customized Citra settings.
// Customized Lime3DS settings.
// This file wraps the MicroProfile header so that these are consistent everywhere.
#define MICROPROFILE_WEBSERVER 0
#define MICROPROFILE_GPU_TIMERS 0 // TODO: Implement timer queries when we upgrade to OpenGL 3.3

View file

@ -6,7 +6,7 @@
#include "common/microprofile.h"
// Customized Citra settings.
// Customized Lime3DS settings.
// This file wraps the MicroProfile header so that these are consistent everywhere.
#define MICROPROFILE_TEXT_WIDTH 6
#define MICROPROFILE_TEXT_HEIGHT 12

View file

@ -421,7 +421,7 @@ struct TouchFromButtonMap {
std::vector<std::string> buttons;
};
/// A special region value indicating that citra will automatically select a region
/// A special region value indicating that lime3ds will automatically select a region
/// value to fit the region lockout info of the game
static constexpr s32 REGION_VALUE_AUTO_SELECT = -1;

View file

@ -9,7 +9,7 @@
#include "common/scm_rev.h"
#include "common/telemetry.h"
#if CITRA_ARCH(x86_64)
#if LIME3DS_ARCH(x86_64)
#include "common/x64/cpu_detect.h"
#endif
@ -55,7 +55,7 @@ void AppendBuildInfo(FieldCollection& fc) {
}
void AppendCPUInfo(FieldCollection& fc) {
#if CITRA_ARCH(x86_64)
#if LIME3DS_ARCH(x86_64)
fc.AddField(FieldType::UserSystem, "CPU_Model", Common::GetCPUCaps().cpu_string);
fc.AddField(FieldType::UserSystem, "CPU_BrandString", Common::GetCPUCaps().brand_string);
fc.AddField(FieldType::UserSystem, "CPU_Extension_x64_AES", Common::GetCPUCaps().aes);

View file

@ -15,7 +15,7 @@ namespace Common::Telemetry {
/// Field type, used for grouping fields together in the final submitted telemetry log
enum class FieldType : u8 {
None = 0, ///< No specified field group
App, ///< Citra application fields (e.g. version, branch, etc.)
App, ///< Lime3DS application fields (e.g. version, branch, etc.)
Session, ///< Emulated session fields (e.g. title ID, log, etc.)
Performance, ///< Emulated performance (e.g. fps, emulated CPU speed, etc.)
UserFeedback, ///< User submitted feedback (e.g. star rating, user notes, etc.)

View file

@ -3,7 +3,7 @@
// Refer to the license.txt file included.
#include "common/arch.h"
#if CITRA_ARCH(x86_64)
#if LIME3DS_ARCH(x86_64)
#include <cstring>
#include "common/common_types.h"
@ -53,7 +53,7 @@ static CPUCaps Detect() {
CPUCaps caps = {};
// Assumes the CPU supports the CPUID instruction. Those that don't would likely not support
// Citra at all anyway
// Lime3DS at all anyway
int cpu_id[4];
std::memset(caps.brand_string, 0, sizeof(caps.brand_string));
@ -148,4 +148,4 @@ const CPUCaps& GetCPUCaps() {
} // namespace Common
#endif // CITRA_ARCH(x86_64)
#endif // LIME3DS_ARCH(x86_64)

View file

@ -5,7 +5,7 @@
#pragma once
#include "common/arch.h"
#if CITRA_ARCH(x86_64)
#if LIME3DS_ARCH(x86_64)
namespace Common {
@ -37,4 +37,4 @@ const CPUCaps& GetCPUCaps();
} // namespace Common
#endif // CITRA_ARCH(x86_64)
#endif // LIME3DS_ARCH(x86_64)

View file

@ -5,7 +5,7 @@
#pragma once
#include "common/arch.h"
#if CITRA_ARCH(x86_64)
#if LIME3DS_ARCH(x86_64)
#include <bitset>
#include <initializer_list>
@ -232,4 +232,4 @@ inline void ABI_PopRegistersAndAdjustStack(Xbyak::CodeGenerator& code, std::bits
} // namespace Common::X64
#endif // CITRA_ARCH(x86_64)
#endif // LIME3DS_ARCH(x86_64)

View file

@ -5,7 +5,7 @@
#pragma once
#include "common/arch.h"
#if CITRA_ARCH(x86_64)
#if LIME3DS_ARCH(x86_64)
#include <type_traits>
#include <xbyak/xbyak.h>
@ -49,4 +49,4 @@ inline void CallFarFunction(Xbyak::CodeGenerator& code, const T f) {
} // namespace Common::X64
#endif // CITRA_ARCH(x86_64)
#endif // LIME3DS_ARCH(x86_64)

View file

@ -522,6 +522,6 @@ if ("x86_64" IN_LIST ARCHITECTURE OR "arm64" IN_LIST ARCHITECTURE)
target_link_libraries(lime_core PRIVATE dynarmic)
endif()
if (CITRA_USE_PRECOMPILED_HEADERS)
if (LIME3DS_USE_PRECOMPILED_HEADERS)
target_precompile_headers(lime_core PRIVATE precompiled_headers.h)
endif()

View file

@ -2,7 +2,7 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#define CITRA_IGNORE_EXIT(x)
#define LIME3DS_IGNORE_EXIT(x)
#include <algorithm>
#include <cstdio>
@ -232,7 +232,7 @@ static unsigned int DPO(RotateRightByRegister)(ARMul_State* cpu, unsigned int sh
#define DEBUG_MSG \
LOG_DEBUG(Core_ARM11, "inst is {:x}", inst); \
CITRA_IGNORE_EXIT(0)
LIME3DS_IGNORE_EXIT(0)
#define LnSWoUB(s) glue(LnSWoUB, s)
#define MLnS(s) glue(MLnS, s)
@ -748,7 +748,7 @@ get_addr_fp_t GetAddressingOpLoadStoreT(unsigned int inst) {
// of this instruction, however the 3DS CPU doesn't
// support this variant (the 3DS CPU is only ARMv6K,
// while this variant is added in ARMv6T2).
// So it's sufficient for citra to not implement this.
// So it's sufficient for lime3ds to not implement this.
return nullptr;
}
@ -832,7 +832,7 @@ static unsigned int InterpreterTranslateInstruction(const ARMul_State* cpu, cons
inst);
LOG_ERROR(Core_ARM11, "cpsr={:#X}, cpu->TFlag={}, r15={:#010X}", cpu->Cpsr, cpu->TFlag,
cpu->Reg[15]);
CITRA_IGNORE_EXIT(-1);
LIME3DS_IGNORE_EXIT(-1);
}
inst_base = arm_instruction_trans[idx](inst, idx);
@ -1850,7 +1850,7 @@ BXJ_INST: {
// According to the ARM documentation on BXJ, if setting the J bit in the APSR
// fails, then BXJ functions identically like a regular BX instruction.
//
// This is sufficient for citra, as the CPU for the 3DS does not implement Jazelle.
// This is sufficient for lime3ds, as the CPU for the 3DS does not implement Jazelle.
if (inst_base->cond == ConditionCode::AL || CondPassed(cpu, inst_base->cond)) {
bx_inst* const inst_cream = (bx_inst*)inst_base->component;

View file

@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#include "common/arch.h"
#if CITRA_ARCH(x86_64) || CITRA_ARCH(arm64)
#if LIME3DS_ARCH(x86_64) || LIME3DS_ARCH(arm64)
#include "core/arm/dynarmic/arm_exclusive_monitor.h"
#endif
#include "common/settings.h"
@ -15,7 +15,7 @@ ExclusiveMonitor::~ExclusiveMonitor() = default;
std::unique_ptr<Core::ExclusiveMonitor> MakeExclusiveMonitor(Memory::MemorySystem& memory,
std::size_t num_cores) {
#if CITRA_ARCH(x86_64) || CITRA_ARCH(arm64)
#if LIME3DS_ARCH(x86_64) || LIME3DS_ARCH(arm64)
if (Settings::values.use_cpu_jit) {
return std::make_unique<Core::DynarmicExclusiveMonitor>(memory, num_cores);
}

View file

@ -455,7 +455,7 @@ std::string GatewayCheat::GetCode() const {
}
/// A special marker used to keep track of enabled cheats
static constexpr char EnabledText[] = "*citra_enabled";
static constexpr char EnabledText[] = "*lime3ds_enabled";
std::string GatewayCheat::ToString() const {
std::string result;

View file

@ -16,7 +16,7 @@
#include "core/hle/service/cam/cam.h"
#include "core/hle/service/hid/hid.h"
#include "core/hle/service/ir/ir_user.h"
#if CITRA_ARCH(x86_64) || CITRA_ARCH(arm64)
#if LIME3DS_ARCH(x86_64) || LIME3DS_ARCH(arm64)
#include "core/arm/dynarmic/arm_dynarmic.h"
#endif
#include "core/arm/dyncom/arm_dyncom.h"
@ -426,7 +426,7 @@ System::ResultStatus System::Init(Frontend::EmuWindow& emu_window,
exclusive_monitor = MakeExclusiveMonitor(*memory, num_cores);
cpu_cores.reserve(num_cores);
if (Settings::values.use_cpu_jit) {
#if CITRA_ARCH(x86_64) || CITRA_ARCH(arm64)
#if LIME3DS_ARCH(x86_64) || LIME3DS_ARCH(arm64)
for (u32 i = 0; i < num_cores; ++i) {
cpu_cores.push_back(std::make_shared<ARM_Dynarmic>(
*this, *memory, i, timing->GetTimer(i), *exclusive_monitor));

View file

@ -91,7 +91,7 @@ Loader::ResultStatus FileSys::Plugin3GXLoader::Load(
}
if (header.infos.flags.compatibility == static_cast<u32>(_3gx_Infos::Compatibility::CONSOLE)) {
LOG_ERROR(Service_PLGLDR, "Failed to load 3GX plugin. Not compatible with Citra: {}",
LOG_ERROR(Service_PLGLDR, "Failed to load 3GX plugin. Not compatible with Lime3DS: {}",
plg_context.plugin_path);
return Loader::ResultStatus::Error;
}

View file

@ -54,8 +54,8 @@ public:
u32_le exe_size; // Include sizeof(PluginHeader) + .text + .rodata + .data + .bss (0x1000
// aligned too)
u32_le is_default_plugin;
u32_le plgldr_event; ///< Used for synchronization, unused in citra
u32_le plgldr_reply; ///< Used for synchronization, unused in citra
u32_le plgldr_event; ///< Used for synchronization, unused in lime3ds
u32_le plgldr_reply; ///< Used for synchronization, unused in lime3ds
u32_le reserved[24];
u32_le config[32];
};
@ -79,7 +79,7 @@ private:
bool no_flash);
struct _3gx_Infos {
enum class Compatibility { CONSOLE = 0, CITRA = 1, CONSOLE_CITRA = 2 };
enum class Compatibility { CONSOLE = 0, LIME3DS = 1, CONSOLE_LIME3DS = 2 };
u32_le author_len;
u32_le author_msg_offset;
u32_le title_len;

View file

@ -141,10 +141,10 @@ Result TranslateCommandBuffer(Kernel::KernelSystem& kernel, Memory::MemorySystem
u32 size = static_cast<u32>(descInfo.size);
IPC::MappedBufferPermissions permissions = descInfo.perms;
VAddr page_start = Common::AlignDown(source_address, Memory::CITRA_PAGE_SIZE);
VAddr page_start = Common::AlignDown(source_address, Memory::LIME3DS_PAGE_SIZE);
u32 page_offset = source_address - page_start;
u32 num_pages = Common::AlignUp(page_offset + size, Memory::CITRA_PAGE_SIZE) >>
Memory::CITRA_PAGE_BITS;
u32 num_pages = Common::AlignUp(page_offset + size, Memory::LIME3DS_PAGE_SIZE) >>
Memory::LIME3DS_PAGE_BITS;
// Skip when the size is zero and num_pages == 0
if (size == 0) {
@ -174,8 +174,8 @@ Result TranslateCommandBuffer(Kernel::KernelSystem& kernel, Memory::MemorySystem
found->target_address, size);
}
VAddr prev_reserve = page_start - Memory::CITRA_PAGE_SIZE;
VAddr next_reserve = page_start + num_pages * Memory::CITRA_PAGE_SIZE;
VAddr prev_reserve = page_start - Memory::LIME3DS_PAGE_SIZE;
VAddr next_reserve = page_start + num_pages * Memory::LIME3DS_PAGE_SIZE;
auto& prev_vma = src_process->vm_manager.FindVMA(prev_reserve)->second;
auto& next_vma = src_process->vm_manager.FindVMA(next_reserve)->second;
@ -184,8 +184,8 @@ Result TranslateCommandBuffer(Kernel::KernelSystem& kernel, Memory::MemorySystem
// Unmap the buffer and guard pages from the source process
Result result =
src_process->vm_manager.UnmapRange(page_start - Memory::CITRA_PAGE_SIZE,
(num_pages + 2) * Memory::CITRA_PAGE_SIZE);
src_process->vm_manager.UnmapRange(page_start - Memory::LIME3DS_PAGE_SIZE,
(num_pages + 2) * Memory::LIME3DS_PAGE_SIZE);
ASSERT(result == ResultSuccess);
mapped_buffer_context.erase(found);
@ -200,9 +200,9 @@ Result TranslateCommandBuffer(Kernel::KernelSystem& kernel, Memory::MemorySystem
// Create a buffer which contains the mapped buffer and two additional guard pages.
std::shared_ptr<BackingMem> buffer =
std::make_shared<BufferMem>((num_pages + 2) * Memory::CITRA_PAGE_SIZE);
std::make_shared<BufferMem>((num_pages + 2) * Memory::LIME3DS_PAGE_SIZE);
memory.ReadBlock(*src_process, source_address,
buffer->GetPtr() + Memory::CITRA_PAGE_SIZE + page_offset, size);
buffer->GetPtr() + Memory::LIME3DS_PAGE_SIZE + page_offset, size);
// Map the guard pages and mapped pages at once.
target_address =
@ -214,19 +214,20 @@ Result TranslateCommandBuffer(Kernel::KernelSystem& kernel, Memory::MemorySystem
// Change the permissions and state of the guard pages.
const VAddr low_guard_address = target_address;
const VAddr high_guard_address =
low_guard_address + static_cast<VAddr>(buffer->GetSize()) - Memory::CITRA_PAGE_SIZE;
const VAddr high_guard_address = low_guard_address +
static_cast<VAddr>(buffer->GetSize()) -
Memory::LIME3DS_PAGE_SIZE;
ASSERT(dst_process->vm_manager.ChangeMemoryState(
low_guard_address, Memory::CITRA_PAGE_SIZE, Kernel::MemoryState::Shared,
low_guard_address, Memory::LIME3DS_PAGE_SIZE, Kernel::MemoryState::Shared,
Kernel::VMAPermission::ReadWrite, Kernel::MemoryState::Reserved,
Kernel::VMAPermission::None) == ResultSuccess);
ASSERT(dst_process->vm_manager.ChangeMemoryState(
high_guard_address, Memory::CITRA_PAGE_SIZE, Kernel::MemoryState::Shared,
high_guard_address, Memory::LIME3DS_PAGE_SIZE, Kernel::MemoryState::Shared,
Kernel::VMAPermission::ReadWrite, Kernel::MemoryState::Reserved,
Kernel::VMAPermission::None) == ResultSuccess);
// Get proper mapped buffer address and store it in the cmd buffer.
target_address += Memory::CITRA_PAGE_SIZE;
target_address += Memory::LIME3DS_PAGE_SIZE;
cmd_buf[i++] = target_address + page_offset;
mapped_buffer_context.push_back({permissions, size, source_address,

View file

@ -396,7 +396,7 @@ private:
/*
* Flags non system module main threads to wait a bit before running. On real hardware,
* system modules have plenty of time to load before the game is loaded, but on citra they
* system modules have plenty of time to load before the game is loaded, but on lime3ds they
* start at the same time as the game. The artificial wait gives system modules some time
* to load and setup themselves before the game starts.
*/

View file

@ -182,7 +182,7 @@ void Process::ParseKernelCaps(const u32* kernel_caps, std::size_t len) {
// Mapped memory page
AddressMapping mapping;
mapping.address = descriptor << 12;
mapping.size = Memory::CITRA_PAGE_SIZE;
mapping.size = Memory::LIME3DS_PAGE_SIZE;
mapping.read_only = false;
mapping.unk_flag = false;
@ -459,7 +459,7 @@ ResultVal<VAddr> Process::AllocateThreadLocalStorage() {
auto base_memory_region = kernel.GetMemoryRegion(MemoryRegion::BASE);
// Allocate some memory from the end of the linear heap for this region.
auto offset = base_memory_region->LinearAllocate(Memory::CITRA_PAGE_SIZE);
auto offset = base_memory_region->LinearAllocate(Memory::LIME3DS_PAGE_SIZE);
if (!offset) {
LOG_ERROR(Kernel_SVC,
"Not enough space in BASE linear region to allocate a new TLS page");
@ -467,17 +467,17 @@ ResultVal<VAddr> Process::AllocateThreadLocalStorage() {
}
holding_tls_memory +=
MemoryRegionInfo::Interval(*offset, *offset + Memory::CITRA_PAGE_SIZE);
memory_used += Memory::CITRA_PAGE_SIZE;
MemoryRegionInfo::Interval(*offset, *offset + Memory::LIME3DS_PAGE_SIZE);
memory_used += Memory::LIME3DS_PAGE_SIZE;
// The page is completely available at the start.
tls_slots.emplace_back(0);
// Map the page to the current process' address space.
auto tls_page_addr =
Memory::TLS_AREA_VADDR + static_cast<VAddr>(tls_page) * Memory::CITRA_PAGE_SIZE;
Memory::TLS_AREA_VADDR + static_cast<VAddr>(tls_page) * Memory::LIME3DS_PAGE_SIZE;
vm_manager.MapBackingMemory(tls_page_addr, kernel.memory.GetFCRAMRef(*offset),
Memory::CITRA_PAGE_SIZE, MemoryState::Locked);
Memory::LIME3DS_PAGE_SIZE, MemoryState::Locked);
LOG_DEBUG(Kernel, "Allocated TLS page at addr={:08X}", tls_page_addr);
} else {
@ -488,7 +488,7 @@ ResultVal<VAddr> Process::AllocateThreadLocalStorage() {
tls_slots[tls_page].set(tls_slot);
auto tls_address = Memory::TLS_AREA_VADDR +
static_cast<VAddr>(tls_page) * Memory::CITRA_PAGE_SIZE +
static_cast<VAddr>(tls_page) * Memory::LIME3DS_PAGE_SIZE +
static_cast<VAddr>(tls_slot) * Memory::TLS_ENTRY_SIZE;
kernel.memory.ZeroBlock(*this, tls_address, Memory::TLS_ENTRY_SIZE);

View file

@ -117,10 +117,10 @@ enum class SystemInfoType {
*/
NEW_3DS_INFO = 0x10001,
/**
* Gets citra related information. This parameter is not available on real systems,
* Gets lime3ds related information. This parameter is not available on real systems,
* but can be used by homebrew applications to get some emulator info.
*/
CITRA_INFORMATION = 0x20000,
LIME3DS_INFORMATION = 0x20000,
};
enum class ProcessInfoType {
@ -263,11 +263,11 @@ enum class SystemInfoMemUsageRegion {
};
/**
* Accepted by svcGetSystemInfo param with CITRA_INFORMATION type. Selects which information
* to fetch from Citra. Some string params don't fit in 7 bytes, so they are split.
* Accepted by svcGetSystemInfo param with LIME3DS_INFORMATION type. Selects which information
* to fetch from Lime3DS. Some string params don't fit in 7 bytes, so they are split.
*/
enum class SystemInfoCitraInformation {
IS_CITRA = 0, // Always set the output to 1, signaling the app is running on Citra.
enum class SystemInfoLime3DSInformation {
IS_LIME3DS = 0, // Always set the output to 1, signaling the app is running on Lime3DS.
BUILD_NAME = 10, // (ie: Nightly, Canary).
BUILD_VERSION = 11, // Build version.
BUILD_DATE_PART1 = 20, // Build date first 7 characters.
@ -459,9 +459,9 @@ Result SVC::ControlMemory(u32* out_addr, u32 addr0, u32 addr1, u32 size, u32 ope
"size=0x{:X}, permissions=0x{:08X}",
operation, addr0, addr1, size, permissions);
R_UNLESS((addr0 & Memory::CITRA_PAGE_MASK) == 0, ResultMisalignedAddress);
R_UNLESS((addr1 & Memory::CITRA_PAGE_MASK) == 0, ResultMisalignedAddress);
R_UNLESS((size & Memory::CITRA_PAGE_MASK) == 0, ResultMisalignedSize);
R_UNLESS((addr0 & Memory::LIME3DS_PAGE_MASK) == 0, ResultMisalignedAddress);
R_UNLESS((addr1 & Memory::LIME3DS_PAGE_MASK) == 0, ResultMisalignedAddress);
R_UNLESS((size & Memory::LIME3DS_PAGE_MASK) == 0, ResultMisalignedSize);
const u32 region = operation & MEMOP_REGION_MASK;
operation &= ~MEMOP_REGION_MASK;
@ -1582,7 +1582,7 @@ Result SVC::GetHandleInfo(s64* out, Handle handle, u32 type) {
/// Creates a memory block at the specified address with the specified permissions and size
Result SVC::CreateMemoryBlock(Handle* out_handle, u32 addr, u32 size, u32 my_permission,
u32 other_permission) {
R_UNLESS(size % Memory::CITRA_PAGE_SIZE == 0, ResultMisalignedSize);
R_UNLESS(size % Memory::LIME3DS_PAGE_SIZE == 0, ResultMisalignedSize);
std::shared_ptr<SharedMemory> shared_memory = nullptr;
@ -1735,51 +1735,51 @@ Result SVC::GetSystemInfo(s64* out, u32 type, s32 param) {
LOG_ERROR(Kernel_SVC, "unimplemented GetSystemInfo type=65537 param={}", param);
*out = 0;
return (system.GetNumCores() == 4) ? ResultSuccess : ResultInvalidEnumValue;
case SystemInfoType::CITRA_INFORMATION:
switch ((SystemInfoCitraInformation)param) {
case SystemInfoCitraInformation::IS_CITRA:
case SystemInfoType::LIME3DS_INFORMATION:
switch ((SystemInfoLime3DSInformation)param) {
case SystemInfoLime3DSInformation::IS_LIME3DS:
*out = 1;
break;
case SystemInfoCitraInformation::BUILD_NAME:
case SystemInfoLime3DSInformation::BUILD_NAME:
CopyStringPart(reinterpret_cast<char*>(out), Common::g_build_name, 0, sizeof(s64));
break;
case SystemInfoCitraInformation::BUILD_VERSION:
case SystemInfoLime3DSInformation::BUILD_VERSION:
CopyStringPart(reinterpret_cast<char*>(out), Common::g_build_version, 0, sizeof(s64));
break;
case SystemInfoCitraInformation::BUILD_DATE_PART1:
case SystemInfoLime3DSInformation::BUILD_DATE_PART1:
CopyStringPart(reinterpret_cast<char*>(out), Common::g_build_date,
(sizeof(s64) - 1) * 0, sizeof(s64));
break;
case SystemInfoCitraInformation::BUILD_DATE_PART2:
case SystemInfoLime3DSInformation::BUILD_DATE_PART2:
CopyStringPart(reinterpret_cast<char*>(out), Common::g_build_date,
(sizeof(s64) - 1) * 1, sizeof(s64));
break;
case SystemInfoCitraInformation::BUILD_DATE_PART3:
case SystemInfoLime3DSInformation::BUILD_DATE_PART3:
CopyStringPart(reinterpret_cast<char*>(out), Common::g_build_date,
(sizeof(s64) - 1) * 2, sizeof(s64));
break;
case SystemInfoCitraInformation::BUILD_DATE_PART4:
case SystemInfoLime3DSInformation::BUILD_DATE_PART4:
CopyStringPart(reinterpret_cast<char*>(out), Common::g_build_date,
(sizeof(s64) - 1) * 3, sizeof(s64));
break;
case SystemInfoCitraInformation::BUILD_GIT_BRANCH_PART1:
case SystemInfoLime3DSInformation::BUILD_GIT_BRANCH_PART1:
CopyStringPart(reinterpret_cast<char*>(out), Common::g_scm_branch,
(sizeof(s64) - 1) * 0, sizeof(s64));
break;
case SystemInfoCitraInformation::BUILD_GIT_BRANCH_PART2:
case SystemInfoLime3DSInformation::BUILD_GIT_BRANCH_PART2:
CopyStringPart(reinterpret_cast<char*>(out), Common::g_scm_branch,
(sizeof(s64) - 1) * 1, sizeof(s64));
break;
case SystemInfoCitraInformation::BUILD_GIT_DESCRIPTION_PART1:
case SystemInfoLime3DSInformation::BUILD_GIT_DESCRIPTION_PART1:
CopyStringPart(reinterpret_cast<char*>(out), Common::g_scm_desc, (sizeof(s64) - 1) * 0,
sizeof(s64));
break;
case SystemInfoCitraInformation::BUILD_GIT_DESCRIPTION_PART2:
case SystemInfoLime3DSInformation::BUILD_GIT_DESCRIPTION_PART2:
CopyStringPart(reinterpret_cast<char*>(out), Common::g_scm_desc, (sizeof(s64) - 1) * 1,
sizeof(s64));
break;
default:
LOG_ERROR(Kernel_SVC, "unknown GetSystemInfo citra info param={}", param);
LOG_ERROR(Kernel_SVC, "unknown GetSystemInfo lime3ds info param={}", param);
*out = 0;
break;
}
@ -1807,7 +1807,7 @@ Result SVC::GetProcessInfo(s64* out, Handle process_handle, u32 type) {
// TODO(yuriks): Type 0 returns a slightly higher number than type 2, but I'm not sure
// what's the difference between them.
*out = process->memory_used;
if (*out % Memory::CITRA_PAGE_SIZE != 0) {
if (*out % Memory::LIME3DS_PAGE_SIZE != 0) {
LOG_ERROR(Kernel_SVC, "called, memory size not page-aligned");
return ResultMisalignedSize;
}
@ -1935,7 +1935,7 @@ Result SVC::MapProcessMemoryEx(Handle dst_process_handle, u32 dst_address,
R_UNLESS(dst_process && src_process, ResultInvalidHandle);
if (size & 0xFFF) {
size = (size & ~0xFFF) + Memory::CITRA_PAGE_SIZE;
size = (size & ~0xFFF) + Memory::LIME3DS_PAGE_SIZE;
}
// Only linear memory supported
@ -1968,7 +1968,7 @@ Result SVC::UnmapProcessMemoryEx(Handle process, u32 dst_address, u32 size) {
R_UNLESS(dst_process, ResultInvalidHandle);
if (size & 0xFFF) {
size = (size & ~0xFFF) + Memory::CITRA_PAGE_SIZE;
size = (size & ~0xFFF) + Memory::LIME3DS_PAGE_SIZE;
}
// Only linear memory supported

View file

@ -109,9 +109,9 @@ void Thread::Stop() {
ReleaseThreadMutexes(this);
// Mark the TLS slot in the thread's page as free.
u32 tls_page = (tls_address - Memory::TLS_AREA_VADDR) / Memory::CITRA_PAGE_SIZE;
u32 tls_slot =
((tls_address - Memory::TLS_AREA_VADDR) % Memory::CITRA_PAGE_SIZE) / Memory::TLS_ENTRY_SIZE;
u32 tls_page = (tls_address - Memory::TLS_AREA_VADDR) / Memory::LIME3DS_PAGE_SIZE;
u32 tls_slot = ((tls_address - Memory::TLS_AREA_VADDR) % Memory::LIME3DS_PAGE_SIZE) /
Memory::TLS_ENTRY_SIZE;
if (auto process = owner_process.lock()) {
process->tls_slots[tls_page].reset(tls_slot);
process->resource_limit->Release(ResourceLimitType::Thread, 1);

View file

@ -253,8 +253,8 @@ VMManager::VMAIter VMManager::StripIterConstness(const VMAHandle& iter) {
}
ResultVal<VMManager::VMAIter> VMManager::CarveVMA(VAddr base, u32 size) {
ASSERT_MSG((size & Memory::CITRA_PAGE_MASK) == 0, "non-page aligned size: {:#10X}", size);
ASSERT_MSG((base & Memory::CITRA_PAGE_MASK) == 0, "non-page aligned base: {:#010X}", base);
ASSERT_MSG((size & Memory::LIME3DS_PAGE_MASK) == 0, "non-page aligned size: {:#10X}", size);
ASSERT_MSG((base & Memory::LIME3DS_PAGE_MASK) == 0, "non-page aligned base: {:#010X}", base);
VMAIter vma_handle = StripIterConstness(FindVMA(base));
if (vma_handle == vma_map.end()) {
@ -289,8 +289,9 @@ ResultVal<VMManager::VMAIter> VMManager::CarveVMA(VAddr base, u32 size) {
}
ResultVal<VMManager::VMAIter> VMManager::CarveVMARange(VAddr target, u32 size) {
ASSERT_MSG((size & Memory::CITRA_PAGE_MASK) == 0, "non-page aligned size: {:#10X}", size);
ASSERT_MSG((target & Memory::CITRA_PAGE_MASK) == 0, "non-page aligned base: {:#010X}", target);
ASSERT_MSG((size & Memory::LIME3DS_PAGE_MASK) == 0, "non-page aligned size: {:#10X}", size);
ASSERT_MSG((target & Memory::LIME3DS_PAGE_MASK) == 0, "non-page aligned base: {:#010X}",
target);
const VAddr target_end = target + size;
ASSERT(target_end >= target);

View file

@ -120,7 +120,7 @@ void Module::Interface::GetCurrentAPInfo(Kernel::HLERequestContext& ctx) {
return;
}
constexpr const char* citra_ap = "Citra_AP";
constexpr const char* lime3ds_ap = "Lime3DS_AP";
constexpr s16 good_signal_strength = 60;
constexpr u8 unknown1_value = 6;
constexpr u8 unknown2_value = 5;
@ -131,7 +131,7 @@ void Module::Interface::GetCurrentAPInfo(Kernel::HLERequestContext& ctx) {
SharedPage::MacAddress mac = shared_page.GetMacAddress();
APInfo info{
.ssid_len = static_cast<u32>(std::strlen(citra_ap)),
.ssid_len = static_cast<u32>(std::strlen(lime3ds_ap)),
.bssid = mac,
.padding = 0,
.signal_strength = good_signal_strength,
@ -141,7 +141,7 @@ void Module::Interface::GetCurrentAPInfo(Kernel::HLERequestContext& ctx) {
.unknown3 = unknown3_value,
.unknown4 = unknown4_value,
};
std::strncpy(info.ssid.data(), citra_ap, info.ssid.size());
std::strncpy(info.ssid.data(), lime3ds_ap, info.ssid.size());
std::vector<u8> out_info(len);
std::memcpy(out_info.data(), &info, std::min(len, static_cast<u32>(sizeof(info))));

View file

@ -1891,7 +1891,7 @@ void Module::Interface::BeginImportProgram(Kernel::HLERequestContext& ctx) {
}
// Create our CIAFile handle for the app to write to, and while the app writes
// Citra will store contents out to sdmc/nand
// Lime3DS will store contents out to sdmc/nand
const FileSys::Path cia_path = {};
auto file = std::make_shared<Service::FS::File>(
am->system.Kernel(), std::make_unique<CIAFile>(am->system, media_type), cia_path);
@ -1917,8 +1917,8 @@ void Module::Interface::BeginImportProgramTemporarily(Kernel::HLERequestContext&
// Note: This function should register the title in the temp_i.db database, but we can get away
// with not doing that because we traverse the file system to detect installed titles.
// Create our CIAFile handle for the app to write to, and while the app writes Citra will store
// contents out to sdmc/nand
// Create our CIAFile handle for the app to write to, and while the app writes Lime3DS will
// store contents out to sdmc/nand
const FileSys::Path cia_path = {};
auto file = std::make_shared<Service::FS::File>(
am->system.Kernel(), std::make_unique<CIAFile>(am->system, FS::MediaType::NAND), cia_path);
@ -2069,7 +2069,7 @@ void Module::Interface::GetProgramInfoFromCia(Kernel::HLERequestContext& ctx) {
// TODO(shinyquagsire23): Sizes allegedly depend on the mediatype, and will double
// on some mediatypes. Since this is more of a required install size we'll report
// what Citra needs, but it would be good to be more accurate here.
// what Lime3DS needs, but it would be good to be more accurate here.
title_info.tid = tmd.GetTitleID();
title_info.size = tmd.GetContentSizeByIndex(FileSys::TMDContentIndex::Main);
title_info.version = tmd.GetTitleVersion();
@ -2221,7 +2221,7 @@ void Module::Interface::GetRequiredSizeFromCia(Kernel::HLERequestContext& ctx) {
// TODO(shinyquagsire23): Sizes allegedly depend on the mediatype, and will double
// on some mediatypes. Since this is more of a required install size we'll report
// what Citra needs, but it would be good to be more accurate here.
// what Lime3DS needs, but it would be good to be more accurate here.
IPC::RequestBuilder rb = rp.MakeBuilder(3, 0);
rb.Push(ResultSuccess);
rb.Push(container.GetTitleMetadata().GetContentSizeByIndex(FileSys::TMDContentIndex::Main));

View file

@ -256,7 +256,7 @@ bool Module::LoadLegacySharedFont() {
// The expected format is a decrypted, uncompressed BCFNT file with the 0x80 byte header
// generated by the APT:U service. The best way to get is by dumping it from RAM. We've provided
// a homebrew app to do this: https://github.com/citra-emu/3dsutils. Put the resulting file
// "shared_font.bin" in the Citra "sysdata" directory.
// "shared_font.bin" in the Lime3DS "sysdata" directory.
std::string filepath = FileUtil::GetUserPath(FileUtil::UserPath::SysDataDir) + SHARED_FONT;
FileUtil::CreateFullPath(filepath); // Create path if not already created

View file

@ -193,7 +193,7 @@ static_assert(sizeof(CaptureState) == 0x8, "CaptureState structure size is wrong
void CSND_SND::Initialize(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx);
const u32 size = Common::AlignUp(rp.Pop<u32>(), Memory::CITRA_PAGE_SIZE);
const u32 size = Common::AlignUp(rp.Pop<u32>(), Memory::LIME3DS_PAGE_SIZE);
master_state_offset = rp.Pop<u32>();
channel_state_offset = rp.Pop<u32>();
capture_state_offset = rp.Pop<u32>();

View file

@ -560,7 +560,7 @@ void HTTP_C::BeginRequest(Kernel::HLERequestContext& ctx) {
Context& http_context = GetContext(context_handle);
// This should never happen in real hardware, but can happen on citra.
// This should never happen in real hardware, but can happen on lime3ds.
if (http_context.uses_default_client_cert && !http_context.clcert_data->init) {
LOG_ERROR(Service_HTTP, "Failed to begin HTTP request: client cert not found.");
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
@ -598,7 +598,7 @@ void HTTP_C::BeginRequestAsync(Kernel::HLERequestContext& ctx) {
Context& http_context = GetContext(context_handle);
// This should never happen in real hardware, but can happen on citra.
// This should never happen in real hardware, but can happen on lime3ds.
if (http_context.uses_default_client_cert && !http_context.clcert_data->init) {
LOG_ERROR(Service_HTTP, "Failed to begin HTTP request: client cert not found.");
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);

View file

@ -1500,7 +1500,7 @@ u32 CROHelper::Fix(u32 fix_level) {
}
}
fix_end = Common::AlignUp(fix_end, Memory::CITRA_PAGE_SIZE);
fix_end = Common::AlignUp(fix_end, Memory::LIME3DS_PAGE_SIZE);
u32 fixed_size = fix_end - module_address;
SetField(FixedSize, fixed_size);
@ -1523,8 +1523,8 @@ std::tuple<VAddr, u32> CROHelper::GetExecutablePages() const {
SegmentEntry entry;
GetEntry(system.Memory(), i, entry);
if (entry.type == SegmentType::Code && entry.size != 0) {
VAddr begin = Common::AlignDown(entry.offset, Memory::CITRA_PAGE_SIZE);
VAddr end = Common::AlignUp(entry.offset + entry.size, Memory::CITRA_PAGE_SIZE);
VAddr begin = Common::AlignDown(entry.offset, Memory::LIME3DS_PAGE_SIZE);
VAddr end = Common::AlignUp(entry.offset + entry.size, Memory::LIME3DS_PAGE_SIZE);
return std::make_tuple(begin, end - begin);
}
}

View file

@ -87,19 +87,19 @@ void RO::Initialize(Kernel::HLERequestContext& ctx) {
return;
}
if (crs_buffer_ptr & Memory::CITRA_PAGE_MASK) {
if (crs_buffer_ptr & Memory::LIME3DS_PAGE_MASK) {
LOG_ERROR(Service_LDR, "CRS original address is not aligned");
rb.Push(ERROR_MISALIGNED_ADDRESS);
return;
}
if (crs_address & Memory::CITRA_PAGE_MASK) {
if (crs_address & Memory::LIME3DS_PAGE_MASK) {
LOG_ERROR(Service_LDR, "CRS mapping address is not aligned");
rb.Push(ERROR_MISALIGNED_ADDRESS);
return;
}
if (crs_size & Memory::CITRA_PAGE_MASK) {
if (crs_size & Memory::LIME3DS_PAGE_MASK) {
LOG_ERROR(Service_LDR, "CRS size is not aligned");
rb.Push(ERROR_MISALIGNED_SIZE);
return;
@ -207,21 +207,21 @@ void RO::LoadCRO(Kernel::HLERequestContext& ctx, bool link_on_load_bug_fix) {
return;
}
if (cro_buffer_ptr & Memory::CITRA_PAGE_MASK) {
if (cro_buffer_ptr & Memory::LIME3DS_PAGE_MASK) {
LOG_ERROR(Service_LDR, "CRO original address is not aligned");
rb.Push(ERROR_MISALIGNED_ADDRESS);
rb.Push<u32>(0);
return;
}
if (cro_address & Memory::CITRA_PAGE_MASK) {
if (cro_address & Memory::LIME3DS_PAGE_MASK) {
LOG_ERROR(Service_LDR, "CRO mapping address is not aligned");
rb.Push(ERROR_MISALIGNED_ADDRESS);
rb.Push<u32>(0);
return;
}
if (cro_size & Memory::CITRA_PAGE_MASK) {
if (cro_size & Memory::LIME3DS_PAGE_MASK) {
LOG_ERROR(Service_LDR, "CRO size is not aligned");
rb.Push(ERROR_MISALIGNED_SIZE);
rb.Push<u32>(0);
@ -354,7 +354,7 @@ void RO::UnloadCRO(Kernel::HLERequestContext& ctx) {
return;
}
if (cro_address & Memory::CITRA_PAGE_MASK) {
if (cro_address & Memory::LIME3DS_PAGE_MASK) {
LOG_ERROR(Service_LDR, "CRO address is not aligned");
rb.Push(ERROR_MISALIGNED_ADDRESS);
return;
@ -421,7 +421,7 @@ void RO::LinkCRO(Kernel::HLERequestContext& ctx) {
return;
}
if (cro_address & Memory::CITRA_PAGE_MASK) {
if (cro_address & Memory::LIME3DS_PAGE_MASK) {
LOG_ERROR(Service_LDR, "CRO address is not aligned");
rb.Push(ERROR_MISALIGNED_ADDRESS);
return;
@ -461,7 +461,7 @@ void RO::UnlinkCRO(Kernel::HLERequestContext& ctx) {
return;
}
if (cro_address & Memory::CITRA_PAGE_MASK) {
if (cro_address & Memory::LIME3DS_PAGE_MASK) {
LOG_ERROR(Service_LDR, "CRO address is not aligned");
rb.Push(ERROR_MISALIGNED_ADDRESS);
return;

View file

@ -97,7 +97,7 @@ u16 NWM_UDS::GetNextAvailableNodeId() {
void NWM_UDS::BroadcastNodeMap() {
// Note: This is not how UDS on a 3ds does it but it shouldn't be
// necessary for citra
// necessary for lime3ds
Network::WifiPacket packet;
packet.channel = network_channel;
packet.type = Network::WifiPacket::PacketType::NodeMap;

View file

@ -29,7 +29,7 @@ constexpr u32 EncryptedDataSizeCutoff = 0xFA;
/**
* NWM Beacon data encryption key, taken from the NWM module code.
* We stub this with an all-zeros key as that is enough for Citra's purpose.
* We stub this with an all-zeros key as that is enough for Lime3DS's purpose.
* The real key can be used here to generate beacons that will be accepted by
* a real 3ds.
*/

View file

@ -128,13 +128,13 @@ ResultStatus Apploader_Artic::LoadExec(std::shared_ptr<Kernel::Process>& process
codeset->CodeSegment().offset = 0;
codeset->CodeSegment().addr = program_exheader.codeset_info.text.address;
codeset->CodeSegment().size =
program_exheader.codeset_info.text.num_max_pages * Memory::CITRA_PAGE_SIZE;
program_exheader.codeset_info.text.num_max_pages * Memory::LIME3DS_PAGE_SIZE;
codeset->RODataSegment().offset =
codeset->CodeSegment().offset + codeset->CodeSegment().size;
codeset->RODataSegment().addr = program_exheader.codeset_info.ro.address;
codeset->RODataSegment().size =
program_exheader.codeset_info.ro.num_max_pages * Memory::CITRA_PAGE_SIZE;
program_exheader.codeset_info.ro.num_max_pages * Memory::LIME3DS_PAGE_SIZE;
// TODO(yuriks): Not sure if the bss size is added to the page-aligned .data size or just
// to the regular size. Playing it safe for now.
@ -145,7 +145,7 @@ ResultStatus Apploader_Artic::LoadExec(std::shared_ptr<Kernel::Process>& process
codeset->RODataSegment().offset + codeset->RODataSegment().size;
codeset->DataSegment().addr = program_exheader.codeset_info.data.address;
codeset->DataSegment().size =
program_exheader.codeset_info.data.num_max_pages * Memory::CITRA_PAGE_SIZE +
program_exheader.codeset_info.data.num_max_pages * Memory::LIME3DS_PAGE_SIZE +
bss_page_size;
// Apply patches now that the entire codeset (including .bss) has been allocated
@ -387,9 +387,9 @@ ResultStatus Apploader_Artic::ReadCode(std::vector<u8>& buffer) {
if (!client_connected)
return ResultStatus::ErrorArtic;
size_t code_size = program_exheader.codeset_info.text.num_max_pages * Memory::CITRA_PAGE_SIZE;
code_size += program_exheader.codeset_info.ro.num_max_pages * Memory::CITRA_PAGE_SIZE;
code_size += program_exheader.codeset_info.data.num_max_pages * Memory::CITRA_PAGE_SIZE;
size_t code_size = program_exheader.codeset_info.text.num_max_pages * Memory::LIME3DS_PAGE_SIZE;
code_size += program_exheader.codeset_info.ro.num_max_pages * Memory::LIME3DS_PAGE_SIZE;
code_size += program_exheader.codeset_info.data.num_max_pages * Memory::LIME3DS_PAGE_SIZE;
size_t read_amount = 0;
buffer.clear();

View file

@ -120,13 +120,14 @@ ResultStatus AppLoader_NCCH::LoadExec(std::shared_ptr<Kernel::Process>& process)
codeset->CodeSegment().offset = 0;
codeset->CodeSegment().addr = overlay_ncch->exheader_header.codeset_info.text.address;
codeset->CodeSegment().size =
overlay_ncch->exheader_header.codeset_info.text.num_max_pages * Memory::CITRA_PAGE_SIZE;
overlay_ncch->exheader_header.codeset_info.text.num_max_pages *
Memory::LIME3DS_PAGE_SIZE;
codeset->RODataSegment().offset =
codeset->CodeSegment().offset + codeset->CodeSegment().size;
codeset->RODataSegment().addr = overlay_ncch->exheader_header.codeset_info.ro.address;
codeset->RODataSegment().size =
overlay_ncch->exheader_header.codeset_info.ro.num_max_pages * Memory::CITRA_PAGE_SIZE;
overlay_ncch->exheader_header.codeset_info.ro.num_max_pages * Memory::LIME3DS_PAGE_SIZE;
// TODO(yuriks): Not sure if the bss size is added to the page-aligned .data size or just
// to the regular size. Playing it safe for now.
@ -138,7 +139,7 @@ ResultStatus AppLoader_NCCH::LoadExec(std::shared_ptr<Kernel::Process>& process)
codeset->DataSegment().addr = overlay_ncch->exheader_header.codeset_info.data.address;
codeset->DataSegment().size =
overlay_ncch->exheader_header.codeset_info.data.num_max_pages *
Memory::CITRA_PAGE_SIZE +
Memory::LIME3DS_PAGE_SIZE +
bss_page_size;
// Apply patches now that the entire codeset (including .bss) has been allocated

View file

@ -54,24 +54,24 @@ public:
private:
bool* At(VAddr addr) {
if (addr >= VRAM_VADDR && addr < VRAM_VADDR_END) {
return &vram[(addr - VRAM_VADDR) / CITRA_PAGE_SIZE];
return &vram[(addr - VRAM_VADDR) / LIME3DS_PAGE_SIZE];
}
if (addr >= LINEAR_HEAP_VADDR && addr < LINEAR_HEAP_VADDR_END) {
return &linear_heap[(addr - LINEAR_HEAP_VADDR) / CITRA_PAGE_SIZE];
return &linear_heap[(addr - LINEAR_HEAP_VADDR) / LIME3DS_PAGE_SIZE];
}
if (addr >= NEW_LINEAR_HEAP_VADDR && addr < NEW_LINEAR_HEAP_VADDR_END) {
return &new_linear_heap[(addr - NEW_LINEAR_HEAP_VADDR) / CITRA_PAGE_SIZE];
return &new_linear_heap[(addr - NEW_LINEAR_HEAP_VADDR) / LIME3DS_PAGE_SIZE];
}
if (addr >= PLUGIN_3GX_FB_VADDR && addr < PLUGIN_3GX_FB_VADDR_END) {
return &plugin_fb[(addr - PLUGIN_3GX_FB_VADDR) / CITRA_PAGE_SIZE];
return &plugin_fb[(addr - PLUGIN_3GX_FB_VADDR) / LIME3DS_PAGE_SIZE];
}
return nullptr;
}
std::array<bool, VRAM_SIZE / CITRA_PAGE_SIZE> vram{};
std::array<bool, LINEAR_HEAP_SIZE / CITRA_PAGE_SIZE> linear_heap{};
std::array<bool, NEW_LINEAR_HEAP_SIZE / CITRA_PAGE_SIZE> new_linear_heap{};
std::array<bool, PLUGIN_3GX_FB_SIZE / CITRA_PAGE_SIZE> plugin_fb{};
std::array<bool, VRAM_SIZE / LIME3DS_PAGE_SIZE> vram{};
std::array<bool, LINEAR_HEAP_SIZE / LIME3DS_PAGE_SIZE> linear_heap{};
std::array<bool, NEW_LINEAR_HEAP_SIZE / LIME3DS_PAGE_SIZE> new_linear_heap{};
std::array<bool, PLUGIN_3GX_FB_SIZE / LIME3DS_PAGE_SIZE> plugin_fb{};
static_assert(sizeof(bool) == 1);
friend class boost::serialization::access;
@ -161,13 +161,14 @@ public:
auto& page_table = *process.vm_manager.page_table;
std::size_t remaining_size = size;
std::size_t page_index = src_addr >> CITRA_PAGE_BITS;
std::size_t page_offset = src_addr & CITRA_PAGE_MASK;
std::size_t page_index = src_addr >> LIME3DS_PAGE_BITS;
std::size_t page_offset = src_addr & LIME3DS_PAGE_MASK;
while (remaining_size > 0) {
const std::size_t copy_amount = std::min(CITRA_PAGE_SIZE - page_offset, remaining_size);
const std::size_t copy_amount =
std::min(LIME3DS_PAGE_SIZE - page_offset, remaining_size);
const VAddr current_vaddr =
static_cast<VAddr>((page_index << CITRA_PAGE_BITS) + page_offset);
static_cast<VAddr>((page_index << LIME3DS_PAGE_BITS) + page_offset);
switch (page_table.attributes[page_index]) {
case PageType::Unmapped: {
@ -210,13 +211,14 @@ public:
const void* src_buffer, const std::size_t size) {
auto& page_table = *process.vm_manager.page_table;
std::size_t remaining_size = size;
std::size_t page_index = dest_addr >> CITRA_PAGE_BITS;
std::size_t page_offset = dest_addr & CITRA_PAGE_MASK;
std::size_t page_index = dest_addr >> LIME3DS_PAGE_BITS;
std::size_t page_offset = dest_addr & LIME3DS_PAGE_MASK;
while (remaining_size > 0) {
const std::size_t copy_amount = std::min(CITRA_PAGE_SIZE - page_offset, remaining_size);
const std::size_t copy_amount =
std::min(LIME3DS_PAGE_SIZE - page_offset, remaining_size);
const VAddr current_vaddr =
static_cast<VAddr>((page_index << CITRA_PAGE_BITS) + page_offset);
static_cast<VAddr>((page_index << LIME3DS_PAGE_BITS) + page_offset);
switch (page_table.attributes[page_index]) {
case PageType::Unmapped: {
@ -393,10 +395,10 @@ void MemorySystem::RasterizerFlushVirtualRegion(VAddr start, u32 size, FlushMode
void MemorySystem::MapPages(PageTable& page_table, u32 base, u32 size, MemoryRef memory,
PageType type) {
LOG_DEBUG(HW_Memory, "Mapping {} onto {:08X}-{:08X}", (void*)memory.GetPtr(),
base * CITRA_PAGE_SIZE, (base + size) * CITRA_PAGE_SIZE);
base * LIME3DS_PAGE_SIZE, (base + size) * LIME3DS_PAGE_SIZE);
if (impl->system.IsPoweredOn()) {
RasterizerFlushVirtualRegion(base << CITRA_PAGE_BITS, size * CITRA_PAGE_SIZE,
RasterizerFlushVirtualRegion(base << LIME3DS_PAGE_BITS, size * LIME3DS_PAGE_SIZE,
FlushMode::FlushAndInvalidate);
}
@ -408,27 +410,28 @@ void MemorySystem::MapPages(PageTable& page_table, u32 base, u32 size, MemoryRef
page_table.pointers[base] = memory;
// If the memory to map is already rasterizer-cached, mark the page
if (type == PageType::Memory && impl->cache_marker.IsCached(base * CITRA_PAGE_SIZE)) {
if (type == PageType::Memory && impl->cache_marker.IsCached(base * LIME3DS_PAGE_SIZE)) {
page_table.attributes[base] = PageType::RasterizerCachedMemory;
page_table.pointers[base] = nullptr;
}
base += 1;
if (memory != nullptr && memory.GetSize() > CITRA_PAGE_SIZE)
memory += CITRA_PAGE_SIZE;
if (memory != nullptr && memory.GetSize() > LIME3DS_PAGE_SIZE)
memory += LIME3DS_PAGE_SIZE;
}
}
void MemorySystem::MapMemoryRegion(PageTable& page_table, VAddr base, u32 size, MemoryRef target) {
ASSERT_MSG((size & CITRA_PAGE_MASK) == 0, "non-page aligned size: {:08X}", size);
ASSERT_MSG((base & CITRA_PAGE_MASK) == 0, "non-page aligned base: {:08X}", base);
MapPages(page_table, base / CITRA_PAGE_SIZE, size / CITRA_PAGE_SIZE, target, PageType::Memory);
ASSERT_MSG((size & LIME3DS_PAGE_MASK) == 0, "non-page aligned size: {:08X}", size);
ASSERT_MSG((base & LIME3DS_PAGE_MASK) == 0, "non-page aligned base: {:08X}", base);
MapPages(page_table, base / LIME3DS_PAGE_SIZE, size / LIME3DS_PAGE_SIZE, target,
PageType::Memory);
}
void MemorySystem::UnmapRegion(PageTable& page_table, VAddr base, u32 size) {
ASSERT_MSG((size & CITRA_PAGE_MASK) == 0, "non-page aligned size: {:08X}", size);
ASSERT_MSG((base & CITRA_PAGE_MASK) == 0, "non-page aligned base: {:08X}", base);
MapPages(page_table, base / CITRA_PAGE_SIZE, size / CITRA_PAGE_SIZE, nullptr,
ASSERT_MSG((size & LIME3DS_PAGE_MASK) == 0, "non-page aligned size: {:08X}", size);
ASSERT_MSG((base & LIME3DS_PAGE_MASK) == 0, "non-page aligned base: {:08X}", base);
MapPages(page_table, base / LIME3DS_PAGE_SIZE, size / LIME3DS_PAGE_SIZE, nullptr,
PageType::Unmapped);
}
@ -449,11 +452,11 @@ void MemorySystem::UnregisterPageTable(std::shared_ptr<PageTable> page_table) {
template <typename T>
T MemorySystem::Read(const VAddr vaddr) {
const u8* page_pointer = impl->current_page_table->pointers[vaddr >> CITRA_PAGE_BITS];
const u8* page_pointer = impl->current_page_table->pointers[vaddr >> LIME3DS_PAGE_BITS];
if (page_pointer) {
// NOTE: Avoid adding any extra logic to this fast-path block
T value;
std::memcpy(&value, &page_pointer[vaddr & CITRA_PAGE_MASK], sizeof(T));
std::memcpy(&value, &page_pointer[vaddr & LIME3DS_PAGE_MASK], sizeof(T));
return value;
}
@ -472,7 +475,7 @@ T MemorySystem::Read(const VAddr vaddr) {
}
}
PageType type = impl->current_page_table->attributes[vaddr >> CITRA_PAGE_BITS];
PageType type = impl->current_page_table->attributes[vaddr >> LIME3DS_PAGE_BITS];
switch (type) {
case PageType::Unmapped:
LOG_ERROR(HW_Memory, "unmapped Read{} @ 0x{:08X} at PC 0x{:08X}", sizeof(T) * 8, vaddr,
@ -497,10 +500,10 @@ T MemorySystem::Read(const VAddr vaddr) {
template <typename T>
void MemorySystem::Write(const VAddr vaddr, const T data) {
u8* page_pointer = impl->current_page_table->pointers[vaddr >> CITRA_PAGE_BITS];
u8* page_pointer = impl->current_page_table->pointers[vaddr >> LIME3DS_PAGE_BITS];
if (page_pointer) {
// NOTE: Avoid adding any extra logic to this fast-path block
std::memcpy(&page_pointer[vaddr & CITRA_PAGE_MASK], &data, sizeof(T));
std::memcpy(&page_pointer[vaddr & LIME3DS_PAGE_MASK], &data, sizeof(T));
return;
}
@ -521,7 +524,7 @@ void MemorySystem::Write(const VAddr vaddr, const T data) {
}
}
PageType type = impl->current_page_table->attributes[vaddr >> CITRA_PAGE_BITS];
PageType type = impl->current_page_table->attributes[vaddr >> LIME3DS_PAGE_BITS];
switch (type) {
case PageType::Unmapped:
LOG_ERROR(HW_Memory, "unmapped Write{} 0x{:08X} @ 0x{:08X} at PC 0x{:08X}",
@ -542,15 +545,15 @@ void MemorySystem::Write(const VAddr vaddr, const T data) {
template <typename T>
bool MemorySystem::WriteExclusive(const VAddr vaddr, const T data, const T expected) {
u8* page_pointer = impl->current_page_table->pointers[vaddr >> CITRA_PAGE_BITS];
u8* page_pointer = impl->current_page_table->pointers[vaddr >> LIME3DS_PAGE_BITS];
if (page_pointer) {
const auto volatile_pointer =
reinterpret_cast<volatile T*>(&page_pointer[vaddr & CITRA_PAGE_MASK]);
reinterpret_cast<volatile T*>(&page_pointer[vaddr & LIME3DS_PAGE_MASK]);
return Common::AtomicCompareAndSwap(volatile_pointer, data, expected);
}
PageType type = impl->current_page_table->attributes[vaddr >> CITRA_PAGE_BITS];
PageType type = impl->current_page_table->attributes[vaddr >> LIME3DS_PAGE_BITS];
switch (type) {
case PageType::Unmapped:
LOG_ERROR(HW_Memory, "unmapped Write{} 0x{:08X} @ 0x{:08X} at PC 0x{:08X}",
@ -574,12 +577,12 @@ bool MemorySystem::WriteExclusive(const VAddr vaddr, const T data, const T expec
bool MemorySystem::IsValidVirtualAddress(const Kernel::Process& process, const VAddr vaddr) {
auto& page_table = *process.vm_manager.page_table;
auto page_pointer = page_table.pointers[vaddr >> CITRA_PAGE_BITS];
auto page_pointer = page_table.pointers[vaddr >> LIME3DS_PAGE_BITS];
if (page_pointer) {
return true;
}
if (page_table.attributes[vaddr >> CITRA_PAGE_BITS] == PageType::RasterizerCachedMemory) {
if (page_table.attributes[vaddr >> LIME3DS_PAGE_BITS] == PageType::RasterizerCachedMemory) {
return true;
}
@ -591,12 +594,12 @@ bool MemorySystem::IsValidPhysicalAddress(const PAddr paddr) const {
}
u8* MemorySystem::GetPointer(const VAddr vaddr) {
u8* page_pointer = impl->current_page_table->pointers[vaddr >> CITRA_PAGE_BITS];
u8* page_pointer = impl->current_page_table->pointers[vaddr >> LIME3DS_PAGE_BITS];
if (page_pointer) {
return page_pointer + (vaddr & CITRA_PAGE_MASK);
return page_pointer + (vaddr & LIME3DS_PAGE_MASK);
}
if (impl->current_page_table->attributes[vaddr >> CITRA_PAGE_BITS] ==
if (impl->current_page_table->attributes[vaddr >> LIME3DS_PAGE_BITS] ==
PageType::RasterizerCachedMemory) {
return GetPointerForRasterizerCache(vaddr);
}
@ -606,12 +609,12 @@ u8* MemorySystem::GetPointer(const VAddr vaddr) {
}
const u8* MemorySystem::GetPointer(const VAddr vaddr) const {
const u8* page_pointer = impl->current_page_table->pointers[vaddr >> CITRA_PAGE_BITS];
const u8* page_pointer = impl->current_page_table->pointers[vaddr >> LIME3DS_PAGE_BITS];
if (page_pointer) {
return page_pointer + (vaddr & CITRA_PAGE_MASK);
return page_pointer + (vaddr & LIME3DS_PAGE_MASK);
}
if (impl->current_page_table->attributes[vaddr >> CITRA_PAGE_BITS] ==
if (impl->current_page_table->attributes[vaddr >> LIME3DS_PAGE_BITS] ==
PageType::RasterizerCachedMemory) {
return GetPointerForRasterizerCache(vaddr);
}
@ -720,14 +723,14 @@ void MemorySystem::RasterizerMarkRegionCached(PAddr start, u32 size, bool cached
return;
}
u32 num_pages = ((start + size - 1) >> CITRA_PAGE_BITS) - (start >> CITRA_PAGE_BITS) + 1;
u32 num_pages = ((start + size - 1) >> LIME3DS_PAGE_BITS) - (start >> LIME3DS_PAGE_BITS) + 1;
PAddr paddr = start;
for (unsigned i = 0; i < num_pages; ++i, paddr += CITRA_PAGE_SIZE) {
for (unsigned i = 0; i < num_pages; ++i, paddr += LIME3DS_PAGE_SIZE) {
for (VAddr vaddr : PhysicalToVirtualAddressForRasterizer(paddr)) {
impl->cache_marker.Mark(vaddr, cached);
for (auto& page_table : impl->page_table_list) {
PageType& page_type = page_table->attributes[vaddr >> CITRA_PAGE_BITS];
PageType& page_type = page_table->attributes[vaddr >> LIME3DS_PAGE_BITS];
if (cached) {
// Switch page type to cached if now cached
@ -738,7 +741,7 @@ void MemorySystem::RasterizerMarkRegionCached(PAddr start, u32 size, bool cached
break;
case PageType::Memory:
page_type = PageType::RasterizerCachedMemory;
page_table->pointers[vaddr >> CITRA_PAGE_BITS] = nullptr;
page_table->pointers[vaddr >> LIME3DS_PAGE_BITS] = nullptr;
break;
default:
UNREACHABLE();
@ -752,8 +755,8 @@ void MemorySystem::RasterizerMarkRegionCached(PAddr start, u32 size, bool cached
break;
case PageType::RasterizerCachedMemory: {
page_type = PageType::Memory;
page_table->pointers[vaddr >> CITRA_PAGE_BITS] =
GetPointerForRasterizerCache(vaddr & ~CITRA_PAGE_MASK);
page_table->pointers[vaddr >> LIME3DS_PAGE_BITS] =
GetPointerForRasterizerCache(vaddr & ~LIME3DS_PAGE_MASK);
break;
}
default:
@ -838,13 +841,13 @@ void MemorySystem::ZeroBlock(const Kernel::Process& process, const VAddr dest_ad
const std::size_t size) {
auto& page_table = *process.vm_manager.page_table;
std::size_t remaining_size = size;
std::size_t page_index = dest_addr >> CITRA_PAGE_BITS;
std::size_t page_offset = dest_addr & CITRA_PAGE_MASK;
std::size_t page_index = dest_addr >> LIME3DS_PAGE_BITS;
std::size_t page_offset = dest_addr & LIME3DS_PAGE_MASK;
while (remaining_size > 0) {
const std::size_t copy_amount = std::min(CITRA_PAGE_SIZE - page_offset, remaining_size);
const std::size_t copy_amount = std::min(LIME3DS_PAGE_SIZE - page_offset, remaining_size);
const VAddr current_vaddr =
static_cast<VAddr>((page_index << CITRA_PAGE_BITS) + page_offset);
static_cast<VAddr>((page_index << LIME3DS_PAGE_BITS) + page_offset);
switch (page_table.attributes[page_index]) {
case PageType::Unmapped: {
@ -887,13 +890,13 @@ void MemorySystem::CopyBlock(const Kernel::Process& dest_process,
std::size_t size) {
auto& page_table = *src_process.vm_manager.page_table;
std::size_t remaining_size = size;
std::size_t page_index = src_addr >> CITRA_PAGE_BITS;
std::size_t page_offset = src_addr & CITRA_PAGE_MASK;
std::size_t page_index = src_addr >> LIME3DS_PAGE_BITS;
std::size_t page_offset = src_addr & LIME3DS_PAGE_MASK;
while (remaining_size > 0) {
const std::size_t copy_amount = std::min(CITRA_PAGE_SIZE - page_offset, remaining_size);
const std::size_t copy_amount = std::min(LIME3DS_PAGE_SIZE - page_offset, remaining_size);
const VAddr current_vaddr =
static_cast<VAddr>((page_index << CITRA_PAGE_BITS) + page_offset);
static_cast<VAddr>((page_index << LIME3DS_PAGE_BITS) + page_offset);
switch (page_table.attributes[page_index]) {
case PageType::Unmapped: {

Some files were not shown because too many files have changed in this diff Show more