diff --git a/.gitmodules b/.gitmodules
index d2de66eb4..28687649c 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,6 +1,3 @@
-[submodule "app/libraries/tinyxml2"]
- path = app/libraries/tinyxml2
- url = https://github.com/leethomason/tinyxml2
[submodule "app/libraries/fmt"]
path = app/libraries/fmt
url = https://github.com/fmtlib/fmt
@@ -17,3 +14,6 @@
[submodule "app/libraries/frozen"]
path = app/libraries/frozen
url = https://github.com/serge-sans-paille/frozen
+[submodule "app/libraries/pugixml"]
+ path = app/libraries/pugixml
+ url = https://github.com/zeux/pugixml.git
\ No newline at end of file
diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
index e34606ccd..69fd89f9c 100644
--- a/.idea/jarRepositories.xml
+++ b/.idea/jarRepositories.xml
@@ -26,5 +26,15 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml
index 478e49485..e52a6be74 100644
--- a/.idea/kotlinc.xml
+++ b/.idea/kotlinc.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/.idea/scopes/SkylineKotlin.xml b/.idea/scopes/SkylineKotlin.xml
index d5e42ffc8..02ac39fef 100644
--- a/.idea/scopes/SkylineKotlin.xml
+++ b/.idea/scopes/SkylineKotlin.xml
@@ -1,3 +1,3 @@
-
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
index 323530b14..3a13b456f 100644
--- a/.idea/vcs.xml
+++ b/.idea/vcs.xml
@@ -6,6 +6,7 @@
+
diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt
index 8df958745..d93d00282 100644
--- a/app/CMakeLists.txt
+++ b/app/CMakeLists.txt
@@ -1,11 +1,11 @@
-cmake_minimum_required(VERSION 3.8)
+cmake_minimum_required(VERSION 3.16)
project(Skyline LANGUAGES CXX ASM VERSION 0.3)
-set(BUILD_TESTS OFF)
-set(BUILD_TESTING OFF)
+set(BUILD_TESTS OFF CACHE BOOL "Build Tests" FORCE)
+set(BUILD_TESTING OFF CACHE BOOL "Build Testing" FORCE)
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build Shared Libraries" FORCE)
-set(CMAKE_CXX_STANDARD 17)
+set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
set(source_DIR ${CMAKE_SOURCE_DIR}/src/main/cpp)
@@ -13,18 +13,21 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing")
set(CMAKE_CXX_FLAGS_RELEASE "-Ofast -flto=full -fno-stack-protector -Wno-unused-command-line-argument")
if (uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE")
add_compile_definitions(NDEBUG)
+ set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
endif ()
-set(CMAKE_POLICY_DEFAULT_CMP0048 OLD)
-add_subdirectory("libraries/tinyxml2")
add_subdirectory("libraries/fmt")
+
add_subdirectory("libraries/oboe")
-add_subdirectory("libraries/lz4/contrib/cmake_unofficial")
-include_directories("libraries/lz4/lib")
include_directories("libraries/oboe/include")
+
+set(LZ4_BUILD_CLI OFF CACHE BOOL "Build LZ4 CLI" FORCE)
+add_subdirectory("libraries/lz4/build/cmake")
+include_directories("libraries/lz4/lib")
+
include_directories("libraries/vkhpp/include")
+include_directories("libraries/pugixml/src") # We use PugiXML in header-only mode
include_directories("libraries/frozen/include")
-set(CMAKE_POLICY_DEFAULT_CMP0048 NEW)
find_package(mbedtls REQUIRED CONFIG)
@@ -163,7 +166,5 @@ add_library(skyline SHARED
${source_DIR}/skyline/services/ssl/ISslContext.cpp
${source_DIR}/skyline/services/prepo/IPrepoService.cpp
)
-
-target_link_libraries(skyline vulkan android fmt tinyxml2 oboe lz4_static mbedtls::mbedcrypto)
-set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=c++2a")
-target_compile_options(skyline PRIVATE -Wno-c++17-extensions -Wall -Wno-reorder -Wno-missing-braces -Wno-unused-variable -Wno-unused-private-field)
+target_link_libraries(skyline vulkan android fmt lz4_static oboe mbedtls::mbedcrypto)
+target_compile_options(skyline PRIVATE -Wall -Wno-unknown-attributes -Wno-c++20-extensions -Wno-c++17-extensions -Wno-c99-designator -Wno-reorder -Wno-missing-braces -Wno-unused-variable -Wno-unused-private-field)
diff --git a/app/build.gradle b/app/build.gradle
index fb82c1be8..7a57355e4 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -4,23 +4,32 @@ apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 30
- buildToolsVersion '30.0.2'
+ buildToolsVersion '30.0.3'
defaultConfig {
applicationId "skyline.emu"
+
minSdkVersion 26
targetSdkVersion 30
+
versionCode 3
versionName "0.3"
+
ndk {
abiFilters "arm64-v8a"
}
}
- lintOptions {
- disable 'IconLocation'
+
+ /* JVM Bytecode Options */
+ def javaVersion = JavaVersion.VERSION_11
+ compileOptions {
+ sourceCompatibility = javaVersion
+ targetCompatibility = javaVersion
}
kotlinOptions {
- jvmTarget = "1.8"
+ jvmTarget = javaVersion.toString()
}
+
+ /* Build Options */
buildTypes {
release {
debuggable true
@@ -34,43 +43,57 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.debug
}
+
debug {
debuggable true
minifyEnabled false
shrinkResources false
}
}
+ buildFeatures {
+ prefab true
+ viewBinding false
+ }
+
+ /* Android Extensions */
androidExtensions {
+ /* TODO: Remove this after migrating to View Bindings */
experimental = true
}
+
+ /* Linting */
+ lintOptions {
+ disable 'IconLocation'
+ }
+
+ /* NDK */
+ ndkVersion '22.0.7026061'
externalNativeBuild {
cmake {
- version "3.10.2+"
+ version '3.18.1+'
path "CMakeLists.txt"
}
}
- compileOptions {
- sourceCompatibility = 1.8
- targetCompatibility = 1.8
- }
- ndkVersion '21.3.6528147'
}
dependencies {
- implementation fileTree(dir: 'libs', include: ['*.jar'])
+ /* Filetrees */
+ implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
+
+ /* Google */
implementation 'androidx.appcompat:appcompat:1.2.0'
- implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
+ implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.preference:preference:1.1.1'
- implementation 'com.google.android.material:material:1.3.0-alpha02'
- implementation "androidx.core:core-ktx:1.3.1"
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
+ implementation 'com.google.android.material:material:1.3.0-rc01'
implementation 'androidx.documentfile:documentfile:1.0.1'
- implementation 'info.debatty:java-string-similarity:1.2.1'
- implementation(name: 'mbedtls', ext: 'aar')
-}
-repositories {
- mavenCentral()
- flatDir {
- dirs 'libraries'
- }
+
+ /* Kotlin */
+ implementation "androidx.core:core-ktx:1.3.2"
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
+
+ /* Other Java */
+ implementation 'info.debatty:java-string-similarity:2.0.0'
+
+ /* NDK */
+ implementation files("libraries/mbedtls.aar")
}
diff --git a/app/libraries/fmt b/app/libraries/fmt
index 6a497e1d0..9c418bc46 160000
--- a/app/libraries/fmt
+++ b/app/libraries/fmt
@@ -1 +1 @@
-Subproject commit 6a497e1d061993cce54c2d71506a90155a3725e6
+Subproject commit 9c418bc468baf434a848010bff74663e1f820e79
diff --git a/app/libraries/frozen b/app/libraries/frozen
index 30b475274..e6ddc432d 160000
--- a/app/libraries/frozen
+++ b/app/libraries/frozen
@@ -1 +1 @@
-Subproject commit 30b475274c044f456c37b6d15de3d04c85112698
+Subproject commit e6ddc432d0ba4e42542b5867bdc932b5f6d1e08d
diff --git a/app/libraries/lz4 b/app/libraries/lz4
index c7ad96e29..416bc96fa 160000
--- a/app/libraries/lz4
+++ b/app/libraries/lz4
@@ -1 +1 @@
-Subproject commit c7ad96e299545330617e95eebc1369edd4e5fdf0
+Subproject commit 416bc96faca629abcef42e56ecd2e20d26b79934
diff --git a/app/libraries/oboe b/app/libraries/oboe
index 56854b88d..5eb2ea689 160000
--- a/app/libraries/oboe
+++ b/app/libraries/oboe
@@ -1 +1 @@
-Subproject commit 56854b88dd54a8bf7c511800ecf9f991e02cf3de
+Subproject commit 5eb2ea6899367f9cdc5a262f340c06e1a7c284b2
diff --git a/app/libraries/pugixml b/app/libraries/pugixml
new file mode 160000
index 000000000..08b343318
--- /dev/null
+++ b/app/libraries/pugixml
@@ -0,0 +1 @@
+Subproject commit 08b3433180727ea2f78fe02e860a08471db1e03c
diff --git a/app/libraries/tinyxml2 b/app/libraries/tinyxml2
deleted file mode 160000
index 61a4c7d50..000000000
--- a/app/libraries/tinyxml2
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 61a4c7d507322c9f494f5880d4c94b60e4ce9590
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index bbc6f2805..053c9acd1 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -12,9 +12,10 @@
GetStringUTFChars(appFilesPathJstring, nullptr)};
- auto logger{std::make_shared(std::string(appFilesPath) + "skyline.log", static_cast(std::stoi(settings->GetString("log_level"))))};
- //settings->List(logger); // (Uncomment when you want to print out all settings strings)
+ auto logger{std::make_shared(std::string(appFilesPath) + "skyline.log", static_cast(settings->logLevel))};
auto start{std::chrono::steady_clock::now()};
diff --git a/app/src/main/cpp/skyline/common.h b/app/src/main/cpp/skyline/common.h
index 4144db5c5..e9be34e3e 100644
--- a/app/src/main/cpp/skyline/common.h
+++ b/app/src/main/cpp/skyline/common.h
@@ -8,6 +8,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -292,8 +293,8 @@ namespace skyline {
using std::span::span;
using std::span::operator=;
- typedef typename std::span::element_type elementType;
- typedef typename std::span::index_type indexType;
+ typedef typename std::span::element_type element_type;
+ typedef typename std::span::size_type size_type;
constexpr span(const std::span &spn) : std::span(spn) {}
@@ -329,7 +330,7 @@ namespace skyline {
* @param amount The amount of elements that need to be copied (in terms of the supplied span), 0 will try to copy the entirety of the other span
*/
template
- constexpr void copy_from(const span spn, indexType amount = 0) {
+ constexpr void copy_from(const span spn, size_type amount = 0) {
auto size{amount ? amount * sizeof(In) : spn.size_bytes()};
if (span::size_bytes() < size)
throw exception("Data being copied is larger than this span");
@@ -340,7 +341,7 @@ namespace skyline {
* @brief Implicit type conversion for copy_from, this allows passing in std::vector/std::array in directly is automatically passed by reference which is important for any containers
*/
template
- constexpr void copy_from(const In &in, indexType amount = 0) {
+ constexpr void copy_from(const In &in, size_type amount = 0) {
copy_from(span::type>(in), amount);
}
@@ -355,11 +356,11 @@ namespace skyline {
return std::span::template last();
}
- constexpr span first(indexType count) const noexcept {
+ constexpr span first(size_type count) const noexcept {
return std::span::first(count);
}
- constexpr span last(indexType count) const noexcept {
+ constexpr span last(size_type count) const noexcept {
return std::span::last(count);
}
@@ -368,7 +369,7 @@ namespace skyline {
return std::span::template subspan();
}
- constexpr span subspan(indexType offset, indexType count = std::dynamic_extent) const noexcept {
+ constexpr span subspan(size_type offset, size_type count = std::dynamic_extent) const noexcept {
return std::span::subspan(offset, count);
}
};
diff --git a/app/src/main/cpp/skyline/common/settings.cpp b/app/src/main/cpp/skyline/common/settings.cpp
index 8c01eef9a..6fbdb078f 100644
--- a/app/src/main/cpp/skyline/common/settings.cpp
+++ b/app/src/main/cpp/skyline/common/settings.cpp
@@ -1,65 +1,52 @@
// SPDX-License-Identifier: MPL-2.0
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
-#include
-#include
+#define PUGIXML_HEADER_ONLY
+
+#include
#include "settings.h"
namespace skyline {
Settings::Settings(int fd) {
- tinyxml2::XMLDocument pref;
-
- auto fileDeleter = [](FILE *file) { fclose(file); };
- std::unique_ptr file{fdopen(fd, "r"), fileDeleter};
- if (pref.LoadFile(file.get()))
- throw exception("TinyXML2 Error: " + std::string(pref.ErrorStr()));
-
- tinyxml2::XMLElement *elem{pref.LastChild()->FirstChild()->ToElement()};
- while (elem) {
- switch (elem->Value()[0]) {
- case 's':
- stringMap[elem->FindAttribute("name")->Value()] = elem->GetText();
- break;
-
- case 'b':
- boolMap[elem->FindAttribute("name")->Value()] = elem->FindAttribute("value")->BoolValue();
- break;
-
- case 'i':
- intMap[elem->FindAttribute("name")->Value()] = elem->FindAttribute("value")->IntValue();
- break;
-
- default:
- __android_log_print(ANDROID_LOG_WARN, "emu-cpp", "Settings type is missing: %s for %s", elem->Value(), elem->FindAttribute("name")->Value());
- break;
- };
-
- if (elem->NextSibling())
- elem = elem->NextSibling()->ToElement();
- else
- break;
+ pugi::xml_document document;
+ auto result{document.load_file(fmt::format("/proc/self/fd/{}", fd).c_str())};
+ if (!result)
+ throw exception("PugiXML Error: {} at {}", result.description(), result.offset);
+
+ #define PREF_ELEM(name, memberName, rhs) std::make_pair(std::string(name), [](Settings &settings, const pugi::xml_node &element) { settings.memberName = rhs; })
+
+ std::tuple preferences{
+ PREF_ELEM("operation_mode", operationMode, element.attribute("value").as_bool()),
+ PREF_ELEM("username_value", username, element.text().as_string()),
+ PREF_ELEM("log_level", logLevel, element.attribute("value").as_int()),
+ };
+
+ std::bitset> preferencesSet{}; // A bitfield to keep track of all the preferences we've set
+ for (auto element{document.last_child().first_child()}; element; element = element.next_sibling()) {
+ std::string_view name{element.attribute("name").value()};
+ std::apply([&](auto... preferences) {
+ size_t index{};
+ ([&](auto preference) {
+ if (name.size() == preference.first.size() && name.starts_with(preference.first)) {
+ preference.second(*this, element);
+ preferencesSet.set(index);
+ }
+ index++;
+ }(preferences), ...);
+ }, preferences);
}
- pref.Clear();
- }
-
- std::string Settings::GetString(const std::string &key) {
- return stringMap.at(key);
- }
-
- bool Settings::GetBool(const std::string &key) {
- return boolMap.at(key);
- }
-
- int Settings::GetInt(const std::string &key) {
- return intMap.at(key);
- }
-
- void Settings::List(const std::shared_ptr &logger) {
- for (auto &iter : stringMap)
- logger->Info("{} = \"{}\"", iter.first, GetString(iter.first));
-
- for (auto &iter : boolMap)
- logger->Info("{} = {}", iter.first, GetBool(iter.first));
+ if (!preferencesSet.all()) {
+ std::string unsetPreferences;
+ std::apply([&](auto... preferences) {
+ size_t index{};
+ ([&](auto preference) {
+ if (!preferencesSet.test(index))
+ unsetPreferences += std::string("\n* ") + preference.first;
+ index++;
+ }(preferences), ...);
+ }, preferences);
+ throw exception("Cannot find the following preferences:{}", unsetPreferences);
+ }
}
}
diff --git a/app/src/main/cpp/skyline/common/settings.h b/app/src/main/cpp/skyline/common/settings.h
index 8ae006b19..5084b85c6 100644
--- a/app/src/main/cpp/skyline/common/settings.h
+++ b/app/src/main/cpp/skyline/common/settings.h
@@ -10,41 +10,14 @@ namespace skyline {
* @brief The Settings class is used to access preferences set in the Kotlin component of Skyline
*/
class Settings {
- private:
- std::unordered_map stringMap; //!< A mapping from all keys to their corresponding string value
- std::unordered_map boolMap; //!< A mapping from all keys to their corresponding boolean value
- std::unordered_map intMap; //!< A mapping from all keys to their corresponding integer value
-
public:
+ int logLevel; //!< The minimum level that logs need to be for them to be printed
+ bool operationMode; //!< If the emulated Switch should be handheld or docked
+ std::string username; //!< The name set by the user to be supplied to the guest
+
/**
* @param fd An FD to the preference XML file
*/
Settings(int fd);
-
- /**
- * @brief Retrieves a particular setting as a string
- * @param key The key of the setting
- * @return The string value of the setting
- */
- std::string GetString(const std::string &key);
-
- /**
- * @brief Retrieves a particular setting as a boolean
- * @param key The key of the setting
- * @return The boolean value of the setting
- */
- bool GetBool(const std::string &key);
-
- /**
- * @brief Retrieves a particular setting as a integer
- * @param key The key of the setting
- * @return The integer value of the setting
- */
- int GetInt(const std::string &key);
-
- /**
- * @brief Writes all settings keys and values to syslog, this function is for development purposes
- */
- void List(const std::shared_ptr &logger);
};
}
diff --git a/app/src/main/cpp/skyline/gpu/texture.h b/app/src/main/cpp/skyline/gpu/texture.h
index ebbf52a2e..25036f695 100644
--- a/app/src/main/cpp/skyline/gpu/texture.h
+++ b/app/src/main/cpp/skyline/gpu/texture.h
@@ -23,13 +23,7 @@ namespace skyline {
constexpr Dimensions(u32 width, u32 height, u32 depth) : width(width), height(height), depth(depth) {}
- constexpr bool operator==(const Dimensions &dimensions) {
- return (width == dimensions.width) && (height == dimensions.height) && (depth == dimensions.depth);
- }
-
- constexpr bool operator!=(const Dimensions &dimensions) {
- return (width != dimensions.width) || (height != dimensions.height) || (depth != dimensions.depth);
- }
+ auto operator<=>(const Dimensions &) const = default;
};
/**
diff --git a/app/src/main/cpp/skyline/input/npad_device.h b/app/src/main/cpp/skyline/input/npad_device.h
index 27e2d3988..18c325762 100644
--- a/app/src/main/cpp/skyline/input/npad_device.h
+++ b/app/src/main/cpp/skyline/input/npad_device.h
@@ -106,12 +106,7 @@ namespace skyline::input {
float amplitudeHigh;
float frequencyHigh;
- bool operator==(const NpadVibrationValue &other) const {
- return (amplitudeLow == other.amplitudeLow) &&
- (frequencyLow == other.frequencyLow) &&
- (amplitudeHigh == other.amplitudeHigh) &&
- (frequencyHigh == other.frequencyHigh);
- }
+ constexpr bool operator==(const NpadVibrationValue &) const = default;
};
static_assert(sizeof(NpadVibrationValue) == 0x10);
diff --git a/app/src/main/cpp/skyline/kernel/types/KProcess.cpp b/app/src/main/cpp/skyline/kernel/types/KProcess.cpp
index b6c646fb3..251bde732 100644
--- a/app/src/main/cpp/skyline/kernel/types/KProcess.cpp
+++ b/app/src/main/cpp/skyline/kernel/types/KProcess.cpp
@@ -44,7 +44,7 @@ namespace skyline::kernel::type {
void KProcess::InitializeHeapTls() {
constexpr size_t DefaultHeapSize{0x200000};
- heap = heap.make_shared(state, reinterpret_cast(state.process->memory.heap.address), DefaultHeapSize, memory::Permission{true, true, false}, memory::states::Heap);
+ heap = std::make_shared(state, reinterpret_cast(state.process->memory.heap.address), DefaultHeapSize, memory::Permission{true, true, false}, memory::states::Heap);
InsertItem(heap); // Insert it into the handle table so GetMemoryObject will contain it
tlsExceptionContext = AllocateTlsSlot();
}
@@ -67,7 +67,7 @@ namespace skyline::kernel::type {
if (disableThreadCreation)
return nullptr;
if (!stackTop && threads.empty()) { //!< Main thread stack is created by the kernel and owned by the process
- mainThreadStack = mainThreadStack.make_shared(state, reinterpret_cast(state.process->memory.stack.address), state.process->npdm.meta.mainThreadStackSize, memory::Permission{true, true, false}, memory::states::Stack);
+ mainThreadStack = std::make_shared(state, reinterpret_cast(state.process->memory.stack.address), state.process->npdm.meta.mainThreadStackSize, memory::Permission{true, true, false}, memory::states::Stack);
if (mprotect(mainThreadStack->ptr, PAGE_SIZE, PROT_NONE))
throw exception("Failed to create guard page for thread stack at 0x{:X}", mainThreadStack->ptr);
stackTop = mainThreadStack->ptr + mainThreadStack->size;
diff --git a/app/src/main/cpp/skyline/services/account/IAccountServiceForApplication.h b/app/src/main/cpp/skyline/services/account/IAccountServiceForApplication.h
index 6a41a278f..bfb95c97d 100644
--- a/app/src/main/cpp/skyline/services/account/IAccountServiceForApplication.h
+++ b/app/src/main/cpp/skyline/services/account/IAccountServiceForApplication.h
@@ -21,13 +21,9 @@ namespace skyline {
u64 upper; //!< The upper 64 bits of the user ID
u64 lower; //!< The lower 64 bits of the user ID
- constexpr bool operator==(const UserId &userId) {
- return upper == userId.upper && lower == userId.lower;
- }
+ constexpr bool operator==(const UserId &userId) const = default;
- constexpr bool operator!=(const UserId &userId) {
- return !(*this == userId);
- }
+ constexpr bool operator!=(const UserId &userId) const = default;
};
/**
@@ -39,7 +35,7 @@ namespace skyline {
/**
* @brief Writes a vector of 128-bit user IDs to an output buffer
*/
- Result WriteUserList(span buffer, std::vector userIds);
+ Result WriteUserList(span buffer, std::vector userIds);
public:
IAccountServiceForApplication(const DeviceState &state, ServiceManager &manager);
@@ -80,14 +76,16 @@ namespace skyline {
*/
Result GetBaasAccountManagerForApplication(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response);
- SERVICE_DECL(
- SFUNC(0x1, IAccountServiceForApplication, GetUserExistence),
- SFUNC(0x2, IAccountServiceForApplication, ListAllUsers),
- SFUNC(0x3, IAccountServiceForApplication, ListOpenUsers),
- SFUNC(0x4, IAccountServiceForApplication, GetLastOpenedUser),
- SFUNC(0x5, IAccountServiceForApplication, GetProfile),
- SFUNC(0x64, IAccountServiceForApplication, InitializeApplicationInfoV0),
- SFUNC(0x65, IAccountServiceForApplication, GetBaasAccountManagerForApplication)
+ SERVICE_DECL (
+ SFUNC(
+
+ 0x1, IAccountServiceForApplication, GetUserExistence),
+ SFUNC(0x2, IAccountServiceForApplication, ListAllUsers),
+ SFUNC(0x3, IAccountServiceForApplication, ListOpenUsers),
+ SFUNC(0x4, IAccountServiceForApplication, GetLastOpenedUser),
+ SFUNC(0x5, IAccountServiceForApplication, GetProfile),
+ SFUNC(0x64, IAccountServiceForApplication, InitializeApplicationInfoV0),
+ SFUNC(0x65, IAccountServiceForApplication, GetBaasAccountManagerForApplication)
)
};
}
diff --git a/app/src/main/cpp/skyline/services/account/IProfile.cpp b/app/src/main/cpp/skyline/services/account/IProfile.cpp
index c4129193d..9261c7bb2 100644
--- a/app/src/main/cpp/skyline/services/account/IProfile.cpp
+++ b/app/src/main/cpp/skyline/services/account/IProfile.cpp
@@ -31,9 +31,8 @@ namespace skyline::service::account {
.uid = userId,
};
- auto username{state.settings->GetString("username_value")};
- size_t usernameSize{std::min(accountProfileBase.nickname.size() - 1, username.size())};
- std::memcpy(accountProfileBase.nickname.data(), username.c_str(), usernameSize);
+ size_t usernameSize{std::min(accountProfileBase.nickname.size() - 1, state.settings->username.size())};
+ std::memcpy(accountProfileBase.nickname.data(), state.settings->username.c_str(), usernameSize);
response.Push(accountProfileBase);
diff --git a/app/src/main/cpp/skyline/services/am/controller/ICommonStateGetter.cpp b/app/src/main/cpp/skyline/services/am/controller/ICommonStateGetter.cpp
index 270285852..d98ed566a 100644
--- a/app/src/main/cpp/skyline/services/am/controller/ICommonStateGetter.cpp
+++ b/app/src/main/cpp/skyline/services/am/controller/ICommonStateGetter.cpp
@@ -12,7 +12,7 @@ namespace skyline::service::am {
}
ICommonStateGetter::ICommonStateGetter(const DeviceState &state, ServiceManager &manager) : messageEvent(std::make_shared(state, false)), BaseService(state, manager) {
- operationMode = static_cast(state.settings->GetBool("operation_mode"));
+ operationMode = static_cast(state.settings->operationMode);
state.logger->Info("Switch to mode: {}", static_cast(operationMode) ? "Docked" : "Handheld");
QueueMessage(Message::FocusStateChange);
}
diff --git a/app/src/main/cpp/skyline/services/nvdrv/driver.cpp b/app/src/main/cpp/skyline/services/nvdrv/driver.cpp
index 9d6d4ae66..061d49c7a 100644
--- a/app/src/main/cpp/skyline/services/nvdrv/driver.cpp
+++ b/app/src/main/cpp/skyline/services/nvdrv/driver.cpp
@@ -15,17 +15,17 @@ namespace skyline::service::nvdrv {
state.logger->Debug("Opening NVDRV device ({}): {}", fdIndex, path);
switch (util::Hash(path)) {
- #define NVDEVICE(type, name, devicePath) \
- case util::Hash(devicePath): { \
- std::shared_ptr device{}; \
- if (name.expired()) { \
- device = device.make_shared(state); \
- name = device; \
- } else { \
- device = name.lock(); \
- } \
- devices.push_back(device); \
- break; \
+ #define NVDEVICE(type, name, devicePath) \
+ case util::Hash(devicePath): { \
+ std::shared_ptr device{}; \
+ if (name.expired()) { \
+ device = std::make_shared(state); \
+ name = device; \
+ } else { \
+ device = name.lock(); \
+ } \
+ devices.push_back(device); \
+ break; \
}
NVDEVICE_LIST
#undef NVDEVICE
diff --git a/app/src/main/cpp/skyline/services/settings/ISystemSettingsServer.cpp b/app/src/main/cpp/skyline/services/settings/ISystemSettingsServer.cpp
index 228fcf406..0a5ee6eb4 100644
--- a/app/src/main/cpp/skyline/services/settings/ISystemSettingsServer.cpp
+++ b/app/src/main/cpp/skyline/services/settings/ISystemSettingsServer.cpp
@@ -7,7 +7,7 @@ namespace skyline::service::settings {
ISystemSettingsServer::ISystemSettingsServer(const DeviceState &state, ServiceManager &manager) : BaseService(state, manager) {}
Result ISystemSettingsServer::GetFirmwareVersion(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
- request.outputBuf.at(0).as() = {.major=9, .minor=0, .micro=0, .revMajor=4, .revMinor=0, .platform="NX", .verHash="4de65c071fd0869695b7629f75eb97b2551dbf2f", .dispVer="9.0.0", .dispTitle="NintendoSDK Firmware for NX 9.0.0-4.0"};
+ request.outputBuf.at(0).as() = {.major=5, .minor=0, .micro=0, .revMajor=4, .revMinor=0, .platform="NX", .verHash="4de65c071fd0869695b7629f75eb97b2551dbf2f", .dispVer="9.0.0", .dispTitle="NintendoSDK Firmware for NX 9.0.0-4.0"};
return {};
}
}
diff --git a/app/src/main/java/emu/skyline/EmulationActivity.kt b/app/src/main/java/emu/skyline/EmulationActivity.kt
index bb8304a29..96166e1e9 100644
--- a/app/src/main/java/emu/skyline/EmulationActivity.kt
+++ b/app/src/main/java/emu/skyline/EmulationActivity.kt
@@ -213,7 +213,7 @@ class EmulationActivity : AppCompatActivity(), SurfaceHolder.Callback, View.OnTo
}
@Suppress("DEPRECATION") val display = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) display!! else windowManager.defaultDisplay
- display?.supportedModes?.maxBy { it.refreshRate + (it.physicalHeight * it.physicalWidth) }?.let { window.attributes.preferredDisplayModeId = it.modeId }
+ display?.supportedModes?.maxByOrNull { it.refreshRate + (it.physicalHeight * it.physicalWidth) }?.let { window.attributes.preferredDisplayModeId = it.modeId }
game_view.setOnTouchListener(this)
diff --git a/build.gradle b/build.gradle
index 4dbf4f726..e1a4d831e 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,14 +1,13 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
- ext.kotlin_version = '1.3.61'
+ ext.kotlin_version = '1.4.21'
repositories {
google()
jcenter()
-
}
dependencies {
- classpath 'com.android.tools.build:gradle:4.0.1'
+ classpath 'com.android.tools.build:gradle:7.0.0-alpha04'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
@@ -17,7 +16,7 @@ buildscript {
}
plugins {
- id "com.github.ben-manes.versions" version "0.28.0"
+ id "com.github.ben-manes.versions" version "0.36.0"
}
allprojects {
diff --git a/gradle.properties b/gradle.properties
index cf4f33d7f..7c18d5211 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -19,7 +19,3 @@ org.gradle.daemon=true
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
-
-# Enables Prefab
-android.enablePrefab=true
-android.prefabVersion=1.1.0
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index b754edfe7..146698018 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,6 @@
+#Thu Jan 21 04:22:50 IST 2021
distributionBase=GRADLE_USER_HOME
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip
distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.1-all.zip
+zipStoreBase=GRADLE_USER_HOME