mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-10-13 07:37:09 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| da391ca89b | |||
| b9ef5bb83b |
Vendored
+302
-310
File diff suppressed because it is too large
Load Diff
Vendored
+289
-298
File diff suppressed because it is too large
Load Diff
Vendored
+289
-298
File diff suppressed because it is too large
Load Diff
Vendored
+289
-298
File diff suppressed because it is too large
Load Diff
Vendored
+290
-298
File diff suppressed because it is too large
Load Diff
Vendored
+289
-298
File diff suppressed because it is too large
Load Diff
Vendored
+290
-298
File diff suppressed because it is too large
Load Diff
Vendored
+295
-304
File diff suppressed because it is too large
Load Diff
Vendored
+289
-298
File diff suppressed because it is too large
Load Diff
Vendored
+289
-298
File diff suppressed because it is too large
Load Diff
Vendored
+289
-298
File diff suppressed because it is too large
Load Diff
Vendored
+289
-298
File diff suppressed because it is too large
Load Diff
Vendored
+289
-298
File diff suppressed because it is too large
Load Diff
Vendored
+290
-298
File diff suppressed because it is too large
Load Diff
Vendored
+289
-298
File diff suppressed because it is too large
Load Diff
Vendored
+289
-298
File diff suppressed because it is too large
Load Diff
Vendored
+289
-298
File diff suppressed because it is too large
Load Diff
Vendored
+290
-298
File diff suppressed because it is too large
Load Diff
Vendored
+289
-298
File diff suppressed because it is too large
Load Diff
Vendored
+290
-298
File diff suppressed because it is too large
Load Diff
Vendored
+347
-355
File diff suppressed because it is too large
Load Diff
Vendored
+289
-298
File diff suppressed because it is too large
Load Diff
Vendored
+290
-298
File diff suppressed because it is too large
Load Diff
Vendored
+289
-298
File diff suppressed because it is too large
Load Diff
Vendored
+289
-298
File diff suppressed because it is too large
Load Diff
Vendored
+290
-298
File diff suppressed because it is too large
Load Diff
Vendored
+289
-298
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
# Design Overview
|
# Design Overview
|
||||||
|
|
||||||
Modern game consoles require heavy power to emulate. This is why the emulator uses an approach known as HLE (High-Level-Emulation), in a nutshell: Instead of accurately emulating every subsystem that forms part of a component, emulate the resulting visible output of said interface instead.
|
Modern game consoles require heavy power to be emulated appropriately. This is why the emulator uses an approach known as HLE (High-Level-Emulation), in a nutshell: Instead of accurately emulating every subsystem that forms part of a component, emulate the resulting visible I/O interface instead.
|
||||||
|
|
||||||
For example, take a disk write, instead of emulating a proper SD card we instead use the C++ standard library for I/O. Additionally we use the abstractions provided by the `fs` service to "lie" to programs about certain SD card properties. Notably this includes making up sizes for the fake SD card, giving "realistic" values or expected outputs for a given card, and so on. And instead of writing to an actual SD card, the emulator simply writes to a file.
|
For example, take a disk write, instead of emulating a proper SD card we instead use the C++ standard library for I/O. Additionally we use the abstractions provided by the `fs` service to "lie" to programs about certain SD card properties. Notably this includes making up sizes for the fake SD card, giving "realistic" values or expected outputs for a given card, and so on. And instead of writing to an actual SD card, the emulator simply writes to a file.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
# Subsystem: HLE
|
# HOS Kernel
|
||||||
|
|
||||||
## HOS Kernel
|
|
||||||
|
|
||||||
In brief, the HOS kernel is a microkernel, all services and programs run in userspace, the primary way to do communication between these is via `HIPC` (not covered here); otherwise most of the primitives reside in the forms of syscalls invoked via `svc #imm`. The kernel supports both 32-bit and 64-bit programs, and has the capacity to use 32, 36 and 39 bits of address space for spawned processes. Most of the networking stack is based off FreeBSD's network stack.
|
In brief, the HOS kernel is a microkernel, all services and programs run in userspace, the primary way to do communication between these is via `HIPC` (not covered here); otherwise most of the primitives reside in the forms of syscalls invoked via `svc #imm`. The kernel supports both 32-bit and 64-bit programs, and has the capacity to use 32, 36 and 39 bits of address space for spawned processes. Most of the networking stack is based off FreeBSD's network stack.
|
||||||
|
|
||||||
@@ -31,52 +29,3 @@ Every process keeps it's own tracking of the following structures:
|
|||||||
The emulator willingly restricts itself to only use 4 threads (to emulate 4 cores), this is because most existing applications do not benefit greatly from the added core count, and in fact can be detrimental due to extra contention. This translates equitatively to about 4 `ArmInterface` slots for each process, these are then redirected to whatever is the last `pc` of the last thread running on the core is meant to be; proceed to run it, then when returning (due to halt or interruption), proceed to reschedule the thread.
|
The emulator willingly restricts itself to only use 4 threads (to emulate 4 cores), this is because most existing applications do not benefit greatly from the added core count, and in fact can be detrimental due to extra contention. This translates equitatively to about 4 `ArmInterface` slots for each process, these are then redirected to whatever is the last `pc` of the last thread running on the core is meant to be; proceed to run it, then when returning (due to halt or interruption), proceed to reschedule the thread.
|
||||||
|
|
||||||
The scheduler as-is isn't 100% faithful to the original (for example the original is cooperative and not preemptive), and has great timing variance (especially due to the fact the emulator can run in systems with wildly different timings).
|
The scheduler as-is isn't 100% faithful to the original (for example the original is cooperative and not preemptive), and has great timing variance (especially due to the fact the emulator can run in systems with wildly different timings).
|
||||||
|
|
||||||
## Services
|
|
||||||
|
|
||||||
Consult [SwitchBrew](https://switchbrew.org/) for per-service methods, and implementation details.
|
|
||||||
|
|
||||||
All services are instatiated implicitly using `ServiceFramework`. To register a new interface or service, you can inherit from said class, providing additionally a template parameter that references `Self`, for example:
|
|
||||||
|
|
||||||
```c++
|
|
||||||
// Follows as:
|
|
||||||
// class MyInterface [final] : public ServiceFramework<MyInterface> { ... };
|
|
||||||
// [final] is optional, but should be used whenever there is no intention of this class itself being inherited.
|
|
||||||
class IFloatingRegistrationRequest final : public ServiceFramework<IFloatingRegistrationRequest> {
|
|
||||||
public:
|
|
||||||
// ctor, you can pass extra parameters here (if so required)
|
|
||||||
explicit IFloatingRegistrationRequest(Core::System& system_)
|
|
||||||
: ServiceFramework{system_, "IFloatingRegistrationRequest"}
|
|
||||||
{}
|
|
||||||
|
|
||||||
// Must be placed after all methods are defined (or declared).
|
|
||||||
// Define here your functions and methods, please order them.
|
|
||||||
// Use FindRequestTipc for TIPC handlers.
|
|
||||||
static constexpr auto functions = CreateStaticMap(
|
|
||||||
FunctionInfo{0, nullptr, "GetSessionId"},
|
|
||||||
FunctionInfo{12, nullptr, "GetAccountId"},
|
|
||||||
FunctionInfo{13, nullptr, "GetLinkedNintendoAccountId"},
|
|
||||||
FunctionInfo{14, nullptr, "GetNickname"},
|
|
||||||
FunctionInfo{15, nullptr, "GetProfileImage"},
|
|
||||||
FunctionInfo{16, nullptr, "GetProfileLargeImage", MakeVersionGate({18,0,0})},
|
|
||||||
FunctionInfo{21, nullptr, "LoadIdTokenCache"},
|
|
||||||
FunctionInfo{100, nullptr, "RegisterUser"},
|
|
||||||
FunctionInfo{101, nullptr, "RegisterUserWithUid"},
|
|
||||||
FunctionInfo{102, nullptr, "RegisterNetworkServiceAccountAsync", MakeVersionGate({4,0,0})},
|
|
||||||
FunctionInfo{103, nullptr, "RegisterNetworkServiceAccountWithUidAsync", MakeVersionGate({4,0,0})},
|
|
||||||
FunctionInfo{110, nullptr, "SetSystemProgramIdentification"},
|
|
||||||
FunctionInfo{111, nullptr, "EnsureIdTokenCacheAsync"}
|
|
||||||
);
|
|
||||||
std::optional<FunctionInfoBase> FindRequest(u32 key) override {
|
|
||||||
return HandlerTableGenerateWithFind(key, functions);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
Try to keep service structures local, that is, don't place them on header files if they're only going to be used by a specific service.
|
|
||||||
|
|
||||||
In each `.cpp` file that uses `D<...>/C<...>` CMIF wrapper helpers, remember to include the corresponding instancer, so you don't face linker errors:
|
|
||||||
```c++
|
|
||||||
#include "core/hle/service/cmif_serialization.h"
|
|
||||||
```
|
|
||||||
This will properly instatiate the corresponding wrappers and decompose the provided arguments in the wiring order.
|
|
||||||
+1
-1
@@ -21,7 +21,7 @@ This contains documentation created by developers, build instructions, guideline
|
|||||||
- Subsystems:
|
- Subsystems:
|
||||||
- **[Design Overview](./DesignOverview.md)**
|
- **[Design Overview](./DesignOverview.md)**
|
||||||
- **[Dynarmic](./dynarmic/README.md)**
|
- **[Dynarmic](./dynarmic/README.md)**
|
||||||
- **[Subsystem: HLE](./SubsystemHLE.md)**
|
- **[HOS Kernel](./HosKernel.md)**
|
||||||
- **[Settings](./Settings.md)**
|
- **[Settings](./Settings.md)**
|
||||||
|
|
||||||
## Policies
|
## Policies
|
||||||
|
|||||||
+1
@@ -27,6 +27,7 @@ enum class BooleanSetting(override val key: String) : AbstractBooleanSetting {
|
|||||||
RENDERER_USE_DISK_SHADER_CACHE("use_disk_shader_cache"),
|
RENDERER_USE_DISK_SHADER_CACHE("use_disk_shader_cache"),
|
||||||
RENDERER_FORCE_MAX_CLOCK("force_max_clock"),
|
RENDERER_FORCE_MAX_CLOCK("force_max_clock"),
|
||||||
RENDERER_ASYNCHRONOUS_GPU_EMULATION("use_asynchronous_gpu_emulation"),
|
RENDERER_ASYNCHRONOUS_GPU_EMULATION("use_asynchronous_gpu_emulation"),
|
||||||
|
RENDERER_ASYNC_PRESENTATION("async_presentation"),
|
||||||
RENDERER_ASYNCHRONOUS_SHADERS("use_asynchronous_shaders"),
|
RENDERER_ASYNCHRONOUS_SHADERS("use_asynchronous_shaders"),
|
||||||
RENDERER_REACTIVE_FLUSHING("use_reactive_flushing"),
|
RENDERER_REACTIVE_FLUSHING("use_reactive_flushing"),
|
||||||
ENABLE_BUFFER_HISTORY("enable_buffer_history"),
|
ENABLE_BUFFER_HISTORY("enable_buffer_history"),
|
||||||
|
|||||||
+7
@@ -753,6 +753,13 @@ abstract class SettingsItem(
|
|||||||
descriptionId = R.string.renderer_asynchronous_gpu_emulation_description
|
descriptionId = R.string.renderer_asynchronous_gpu_emulation_description
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
put(
|
||||||
|
SwitchSetting(
|
||||||
|
BooleanSetting.RENDERER_ASYNC_PRESENTATION,
|
||||||
|
titleId = R.string.renderer_async_presentation,
|
||||||
|
descriptionId = R.string.renderer_async_presentation_description
|
||||||
|
)
|
||||||
|
)
|
||||||
put(
|
put(
|
||||||
SingleChoiceSetting(
|
SingleChoiceSetting(
|
||||||
IntSetting.DMA_ACCURACY,
|
IntSetting.DMA_ACCURACY,
|
||||||
|
|||||||
+1
@@ -561,6 +561,7 @@ class SettingsFragmentPresenter(
|
|||||||
add(BooleanSetting.RENDERER_ASYNCHRONOUS_SHADERS.key)
|
add(BooleanSetting.RENDERER_ASYNCHRONOUS_SHADERS.key)
|
||||||
add(IntSetting.ANDROID_PIPELINE_WORKERS.key)
|
add(IntSetting.ANDROID_PIPELINE_WORKERS.key)
|
||||||
add(BooleanSetting.RENDERER_ASYNCHRONOUS_GPU_EMULATION.key)
|
add(BooleanSetting.RENDERER_ASYNCHRONOUS_GPU_EMULATION.key)
|
||||||
|
add(BooleanSetting.RENDERER_ASYNC_PRESENTATION.key)
|
||||||
add(SettingsItem.GPU_UNSWIZZLE_COMBINED)
|
add(SettingsItem.GPU_UNSWIZZLE_COMBINED)
|
||||||
|
|
||||||
add(HeaderSetting(R.string.extensions))
|
add(HeaderSetting(R.string.extensions))
|
||||||
|
|||||||
@@ -254,7 +254,7 @@
|
|||||||
<string name="emulator_data">إعداد بيانات المحاكي</string>
|
<string name="emulator_data">إعداد بيانات المحاكي</string>
|
||||||
<string name="emulator_data_description">يلزم وجود مفاتيح حتى يعمل المحاكي، ويوصى باستخدام الفيرموير ويكون ضروريًا لاستخدام تطبيق القائمة الرئيسية.</string>
|
<string name="emulator_data_description">يلزم وجود مفاتيح حتى يعمل المحاكي، ويوصى باستخدام الفيرموير ويكون ضروريًا لاستخدام تطبيق القائمة الرئيسية.</string>
|
||||||
<string name="permissions">منح الأذونات</string>
|
<string name="permissions">منح الأذونات</string>
|
||||||
<string name="permissions_description">منح أذونات اختيارية لاستخدام ميزات محددة في المحاكي</string>
|
<string name="permissions_description">منح أذونات اختيارية لاستخدام ميزات معينة للمحاكي</string>
|
||||||
<string name="install_firmware_warning_description">العديد من الألعاب تتطلب الوصول إلى الفيرموير لتشغيل بشكل صحيح.</string>
|
<string name="install_firmware_warning_description">العديد من الألعاب تتطلب الوصول إلى الفيرموير لتشغيل بشكل صحيح.</string>
|
||||||
<string name="install_firmware_warning_help">https://yuzu-mirror.github.io/help/quickstart/#guide-introduction</string>
|
<string name="install_firmware_warning_help">https://yuzu-mirror.github.io/help/quickstart/#guide-introduction</string>
|
||||||
<string name="notifications">الإشعارات</string>
|
<string name="notifications">الإشعارات</string>
|
||||||
@@ -574,6 +574,8 @@
|
|||||||
<string name="renderer_force_max_clock_description">يجبر وحدة معالجة الرسومات على العمل بأقصى سرعة ممكنة (سيظل يتم تطبيق القيود الحرارية).</string>
|
<string name="renderer_force_max_clock_description">يجبر وحدة معالجة الرسومات على العمل بأقصى سرعة ممكنة (سيظل يتم تطبيق القيود الحرارية).</string>
|
||||||
<string name="renderer_asynchronous_gpu_emulation">محاكاة غير متزامنة لوحدة معالجة الرسومات</string>
|
<string name="renderer_asynchronous_gpu_emulation">محاكاة غير متزامنة لوحدة معالجة الرسومات</string>
|
||||||
<string name="renderer_asynchronous_gpu_emulation_description">يمكن لهذه الحيلة أن تزيد الأداء عن طريق تشغيل محاكاة وحدة معالجة الرسومات بشكل غير متزامن على حساب مشاكل الرسومات وزيادة معدلات الأعطال بسبب العمليات المتعلقة بالتوقيت.</string>
|
<string name="renderer_asynchronous_gpu_emulation_description">يمكن لهذه الحيلة أن تزيد الأداء عن طريق تشغيل محاكاة وحدة معالجة الرسومات بشكل غير متزامن على حساب مشاكل الرسومات وزيادة معدلات الأعطال بسبب العمليات المتعلقة بالتوقيت.</string>
|
||||||
|
<string name="renderer_async_presentation">عرض غير متزامن</string>
|
||||||
|
<string name="renderer_async_presentation_description">يمكن لهذه الحيلة أن تزيد من الأداء عن طريق نقل عملية العرض إلى خيط معالجة منفصل على حساب مشاكل الرسوميات.</string>
|
||||||
<string name="renderer_reactive_flushing">استخدم التنظيف التفاعلي</string>
|
<string name="renderer_reactive_flushing">استخدم التنظيف التفاعلي</string>
|
||||||
<string name="renderer_reactive_flushing_description">يحسن دقة العرض في بعض الألعاب على حساب الأداء.</string>
|
<string name="renderer_reactive_flushing_description">يحسن دقة العرض في بعض الألعاب على حساب الأداء.</string>
|
||||||
<string name="enable_buffer_history">تفعيل سجل التخزين المؤقت</string>
|
<string name="enable_buffer_history">تفعيل سجل التخزين المؤقت</string>
|
||||||
@@ -587,10 +589,6 @@
|
|||||||
<string name="fast_gpu_time_description">يجعل اللعبة تعتقد أن عمل وحدة معالجة الرسومات ينتهي بشكل أسرع مما هو عليه في الواقع، لذلك تتوقف عن خفض الدقة ومسافة العرض لتتناسب مع سرعات جهاز Switch.</string>
|
<string name="fast_gpu_time_description">يجعل اللعبة تعتقد أن عمل وحدة معالجة الرسومات ينتهي بشكل أسرع مما هو عليه في الواقع، لذلك تتوقف عن خفض الدقة ومسافة العرض لتتناسب مع سرعات جهاز Switch.</string>
|
||||||
<string name="skip_cpu_inner_invalidation">تخطي إبطال صلاحية وحدة المعالجة المركزية الداخلية</string>
|
<string name="skip_cpu_inner_invalidation">تخطي إبطال صلاحية وحدة المعالجة المركزية الداخلية</string>
|
||||||
<string name="skip_cpu_inner_invalidation_description">يتخطى بعض عمليات إبطال ذاكرة التخزين المؤقتة من جانب وحدة المعالجة المركزية أثناء تحديثات الذاكرة، مما يقلل من استخدام وحدة المعالجة المركزية ويحسن أداءها. قد يتسبب ذلك في حدوث أعطال أو تعطل في بعض الألعاب.</string>
|
<string name="skip_cpu_inner_invalidation_description">يتخطى بعض عمليات إبطال ذاكرة التخزين المؤقتة من جانب وحدة المعالجة المركزية أثناء تحديثات الذاكرة، مما يقلل من استخدام وحدة المعالجة المركزية ويحسن أداءها. قد يتسبب ذلك في حدوث أعطال أو تعطل في بعض الألعاب.</string>
|
||||||
<string name="nce_invalidation_gpu_readback">إعادة قراءة وحدة معالجة الرسومات قبل إبطال صلاحية NCE</string>
|
|
||||||
<string name="nce_invalidation_gpu_readback_description">إصلاح مؤقت. يعالج مشكلة تعطل لعبة Ender Magnolia (وغيرها من ألعاب UE). قد يؤدي إلى انخفاض في الأداء. يجري العمل على تحسينه.</string>
|
|
||||||
<string name="nce_runtime_nro_patch">تصحيح حالات NRO في وقت التشغيل لـ NCE</string>
|
|
||||||
<string name="nce_runtime_nro_patch_description">حل مؤقت. إصلاح مشكلة تشغيل لعبة Biomutant. قد يؤثر ذلك على الأداء. يجري العمل على تحسينه.</string>
|
|
||||||
<string name="fix_bloom_effects">إصلاح تأثيرات التوهج</string>
|
<string name="fix_bloom_effects">إصلاح تأثيرات التوهج</string>
|
||||||
<string name="fix_bloom_effects_description">يقلل من ضبابية التوهج في LA/EOW (Adreno A6XX - A7XX/ Turnip)، ويزيل التوهج في Burnout. تحذير: قد يسبب تشوهات رسومية في ألعاب أخرى.</string>
|
<string name="fix_bloom_effects_description">يقلل من ضبابية التوهج في LA/EOW (Adreno A6XX - A7XX/ Turnip)، ويزيل التوهج في Burnout. تحذير: قد يسبب تشوهات رسومية في ألعاب أخرى.</string>
|
||||||
<string name="emulate_bgr565">محاكاة BGR565</string>
|
<string name="emulate_bgr565">محاكاة BGR565</string>
|
||||||
|
|||||||
@@ -518,6 +518,8 @@
|
|||||||
<string name="renderer_force_max_clock_description">Fuerza a la GPU a ejecutarse a la velocidad máxima de reloj posible (se seguirán aplicando restricciones térmicas).</string>
|
<string name="renderer_force_max_clock_description">Fuerza a la GPU a ejecutarse a la velocidad máxima de reloj posible (se seguirán aplicando restricciones térmicas).</string>
|
||||||
<string name="renderer_asynchronous_gpu_emulation">Emulación de GPU asíncrona</string>
|
<string name="renderer_asynchronous_gpu_emulation">Emulación de GPU asíncrona</string>
|
||||||
<string name="renderer_asynchronous_gpu_emulation_description">Este hack puede aumentar el rendimiento ejecutando la emulación de la GPU de forma asíncrona, a costa de problemas gráficos y un aumento en la tasa de fallos debido a operaciones relacionadas con la sincronización.</string>
|
<string name="renderer_asynchronous_gpu_emulation_description">Este hack puede aumentar el rendimiento ejecutando la emulación de la GPU de forma asíncrona, a costa de problemas gráficos y un aumento en la tasa de fallos debido a operaciones relacionadas con la sincronización.</string>
|
||||||
|
<string name="renderer_async_presentation">Presentación asíncrona</string>
|
||||||
|
<string name="renderer_async_presentation_description">Este hack puede aumentar el rendimiento al mover la presentación a un hilo independiente de la CPU a costa de problemas gráficos.</string>
|
||||||
<string name="renderer_reactive_flushing">Usar limpieza reactiva</string>
|
<string name="renderer_reactive_flushing">Usar limpieza reactiva</string>
|
||||||
<string name="renderer_reactive_flushing_description">Mejora la precisión de renderizado en algunos juegos, pero reduce el rendimiento.</string>
|
<string name="renderer_reactive_flushing_description">Mejora la precisión de renderizado en algunos juegos, pero reduce el rendimiento.</string>
|
||||||
<string name="enable_buffer_history">Activar el historial del búfer</string>
|
<string name="enable_buffer_history">Activar el historial del búfer</string>
|
||||||
|
|||||||
@@ -563,6 +563,8 @@
|
|||||||
<string name="renderer_force_max_clock_description">Заставляет ГПУ работать на максимально возможных тактовых частотах (тепловые ограничения все равно будут применяться).</string>
|
<string name="renderer_force_max_clock_description">Заставляет ГПУ работать на максимально возможных тактовых частотах (тепловые ограничения все равно будут применяться).</string>
|
||||||
<string name="renderer_asynchronous_gpu_emulation">Асинхронная эмуляция ГПУ</string>
|
<string name="renderer_asynchronous_gpu_emulation">Асинхронная эмуляция ГПУ</string>
|
||||||
<string name="renderer_asynchronous_gpu_emulation_description">Может повысить производительность за счёт асинхронного запуска эмуляции ГПУ, но ценой появления графических ошибок и увеличения частоты вылетов из-за операций, зависящих от синхронизации.</string>
|
<string name="renderer_asynchronous_gpu_emulation_description">Может повысить производительность за счёт асинхронного запуска эмуляции ГПУ, но ценой появления графических ошибок и увеличения частоты вылетов из-за операций, зависящих от синхронизации.</string>
|
||||||
|
<string name="renderer_async_presentation">Асинхронная презентация</string>
|
||||||
|
<string name="renderer_async_presentation_description">Может повысить производительность за счёт перемещения вывода кадров в отдельный поток ЦП, но ценой возникновения графических проблем.</string>
|
||||||
<string name="renderer_reactive_flushing">Реактивная очистка</string>
|
<string name="renderer_reactive_flushing">Реактивная очистка</string>
|
||||||
<string name="renderer_reactive_flushing_description">Повышение точности рендеринга в некоторых играх за счет снижения производительности.</string>
|
<string name="renderer_reactive_flushing_description">Повышение точности рендеринга в некоторых играх за счет снижения производительности.</string>
|
||||||
<string name="enable_buffer_history">Включить историю буфера</string>
|
<string name="enable_buffer_history">Включить историю буфера</string>
|
||||||
|
|||||||
@@ -481,6 +481,8 @@
|
|||||||
<string name="renderer_force_max_clock_description">Змушує GPU працювати на максимальній тактовій частоті.</string>
|
<string name="renderer_force_max_clock_description">Змушує GPU працювати на максимальній тактовій частоті.</string>
|
||||||
<string name="renderer_asynchronous_gpu_emulation">Асинхронна емуляція ГП</string>
|
<string name="renderer_asynchronous_gpu_emulation">Асинхронна емуляція ГП</string>
|
||||||
<string name="renderer_asynchronous_gpu_emulation_description">Це обхідне рішення може покращити продуктивність завдяки асинхронному виконанню емуляції ГП, але спричинить проблеми з графікою та збільшить частоту збоїв чутливих до таймінгів операцій.</string>
|
<string name="renderer_asynchronous_gpu_emulation_description">Це обхідне рішення може покращити продуктивність завдяки асинхронному виконанню емуляції ГП, але спричинить проблеми з графікою та збільшить частоту збоїв чутливих до таймінгів операцій.</string>
|
||||||
|
<string name="renderer_async_presentation">Асинхронне подання</string>
|
||||||
|
<string name="renderer_async_presentation_description">Це обхідне рішення може покращити продуктивність завдяки переміщенню подання на окремий потік ЦП, але спричинить проблеми з графікою.</string>
|
||||||
<string name="renderer_reactive_flushing">Реактивне очищення</string>
|
<string name="renderer_reactive_flushing">Реактивне очищення</string>
|
||||||
<string name="renderer_reactive_flushing_description">Покращує точність рендерингу в деяких іграх.</string>
|
<string name="renderer_reactive_flushing_description">Покращує точність рендерингу в деяких іграх.</string>
|
||||||
<string name="enable_buffer_history">Увімкнути історію буфера</string>
|
<string name="enable_buffer_history">Увімкнути історію буфера</string>
|
||||||
|
|||||||
@@ -564,6 +564,8 @@
|
|||||||
<string name="renderer_force_max_clock_description">强制 GPU 以最大时钟运行 (温控依然生效)。</string>
|
<string name="renderer_force_max_clock_description">强制 GPU 以最大时钟运行 (温控依然生效)。</string>
|
||||||
<string name="renderer_asynchronous_gpu_emulation">GPU 异步模拟</string>
|
<string name="renderer_asynchronous_gpu_emulation">GPU 异步模拟</string>
|
||||||
<string name="renderer_asynchronous_gpu_emulation_description">此技巧可通过异步运行 GPU 模拟来提升性能,但在执行与时序相关的操作时,可能带来图形显示问题以及增加崩溃概率。</string>
|
<string name="renderer_asynchronous_gpu_emulation_description">此技巧可通过异步运行 GPU 模拟来提升性能,但在执行与时序相关的操作时,可能带来图形显示问题以及增加崩溃概率。</string>
|
||||||
|
<string name="renderer_async_presentation">异步呈现</string>
|
||||||
|
<string name="renderer_async_presentation_description">此技巧通过将图形呈现移至独立的 CPU 线程来提升性能,但可能会带来图形显示问题。</string>
|
||||||
<string name="renderer_reactive_flushing">启用反应性刷新</string>
|
<string name="renderer_reactive_flushing">启用反应性刷新</string>
|
||||||
<string name="renderer_reactive_flushing_description">通过牺牲性能来提升某些游戏的渲染精度。</string>
|
<string name="renderer_reactive_flushing_description">通过牺牲性能来提升某些游戏的渲染精度。</string>
|
||||||
<string name="enable_buffer_history">启用缓冲区历史</string>
|
<string name="enable_buffer_history">启用缓冲区历史</string>
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
<string name="enable_stats_overlay_">啟用效能統計疊加層</string>
|
<string name="enable_stats_overlay_">啟用效能統計疊加層</string>
|
||||||
<string name="stats_overlay_options_description">設定疊加層中顯示的資訊</string>
|
<string name="stats_overlay_options_description">設定疊加層中顯示的資訊</string>
|
||||||
<string name="show_fps">顯示影格率</string>
|
<string name="show_fps">顯示影格率</string>
|
||||||
<string name="show_fps_description">顯示目前的影格率</string>
|
<string name="show_fps_description">顯示當前影格率</string>
|
||||||
<string name="show_frametime">顯示影格時間</string>
|
<string name="show_frametime">顯示影格時間</string>
|
||||||
<string name="show_app_ram_usage">顯示應用程式的記憶體用量</string>
|
<string name="show_app_ram_usage">顯示應用程式的記憶體用量</string>
|
||||||
<string name="show_app_ram_usage_description">顯示模擬器的記憶體用量</string>
|
<string name="show_app_ram_usage_description">顯示模擬器的記憶體用量</string>
|
||||||
@@ -143,7 +143,7 @@
|
|||||||
<string name="multiplayer_host_kicked">您已被房主踢出</string>
|
<string name="multiplayer_host_kicked">您已被房主踢出</string>
|
||||||
<string name="multiplayer_unknown_error">未知錯誤</string>
|
<string name="multiplayer_unknown_error">未知錯誤</string>
|
||||||
<string name="multiplayer_room_uninitialized">房間未初始化</string>
|
<string name="multiplayer_room_uninitialized">房間未初始化</string>
|
||||||
<string name="multiplayer_room_idle">房間閒置中</string>
|
<string name="multiplayer_room_idle">房間閒置</string>
|
||||||
<string name="multiplayer_room_joining">正在加入房間</string>
|
<string name="multiplayer_room_joining">正在加入房間</string>
|
||||||
<string name="multiplayer_room_joined">已加入房間</string>
|
<string name="multiplayer_room_joined">已加入房間</string>
|
||||||
<string name="multiplayer_room_moderator">房間管理員</string>
|
<string name="multiplayer_room_moderator">房間管理員</string>
|
||||||
@@ -185,8 +185,8 @@
|
|||||||
<string name="multiplayer_preferred_game_name">遊戲</string>
|
<string name="multiplayer_preferred_game_name">遊戲</string>
|
||||||
<string name="multiplayer_lobby_type">大廳類型</string>
|
<string name="multiplayer_lobby_type">大廳類型</string>
|
||||||
<string name="multiplayer_room_name_error">長度需為3-20個字元</string>
|
<string name="multiplayer_room_name_error">長度需為3-20個字元</string>
|
||||||
<string name="multiplayer_required">請填寫這個欄位</string>
|
<string name="multiplayer_required">必填</string>
|
||||||
<string name="multiplayer_token_required">需要 Web 令牌,請前往進階設定 -> 系統 -> 網路</string>
|
<string name="multiplayer_token_required">需要Web令牌,請前往進階設定 -> 系統 -> 網路</string>
|
||||||
<string name="multiplayer_ip_error">IP格式無效</string>
|
<string name="multiplayer_ip_error">IP格式無效</string>
|
||||||
<string name="multiplayer_username_error">必須介於4-20個字元之間,並且僅能使用英文字母、數字、句點、破折號、底線和空格(標點符號須為英文格式)</string>
|
<string name="multiplayer_username_error">必須介於4-20個字元之間,並且僅能使用英文字母、數字、句點、破折號、底線和空格(標點符號須為英文格式)</string>
|
||||||
<string name="multiplayer_nickname_invalid">使用者名稱無效,請在系統 -> 網路中檢查設定</string>
|
<string name="multiplayer_nickname_invalid">使用者名稱無效,請在系統 -> 網路中檢查設定</string>
|
||||||
@@ -383,12 +383,12 @@
|
|||||||
<string name="notification_no_directory_link">無法開啟Eden目錄</string>
|
<string name="notification_no_directory_link">無法開啟Eden目錄</string>
|
||||||
<string name="notification_no_directory_link_description">請使用檔案管理員的側邊面板手動定位到使用者資料夾</string>
|
<string name="notification_no_directory_link_description">請使用檔案管理員的側邊面板手動定位到使用者資料夾</string>
|
||||||
<string name="manage_save_data">管理儲存資料</string>
|
<string name="manage_save_data">管理儲存資料</string>
|
||||||
<string name="manage_save_data_description">匯入/匯出遊戲的儲存資料\n壓縮檔必須為.zip格式\n壓縮檔中首個子資料夾名稱必須為遊戲ID</string>
|
<string name="manage_save_data_description">導入/導出遊戲的儲存資料\n壓縮檔必須為.zip格式\n壓縮檔中首個子資料夾名稱必須為遊戲ID</string>
|
||||||
<string name="import_save_warning">匯入儲存資料</string>
|
<string name="import_save_warning">導入儲存資料</string>
|
||||||
<string name="import_save_warning_description">這將會以提供的檔案覆蓋現有的該遊戲儲存資料,您確定要繼續嗎?</string>
|
<string name="import_save_warning_description">這將會以提供的檔案覆寫現有的該遊戲儲存資料,您確定要繼續嗎?</string>
|
||||||
<string name="save_files_importing">正在匯入儲存資料…</string>
|
<string name="save_files_importing">正在導入儲存資料…</string>
|
||||||
<string name="save_files_exporting">正在匯出儲存資料…</string>
|
<string name="save_files_exporting">正在導出儲存資料…</string>
|
||||||
<string name="save_file_imported_success">已成功匯入</string>
|
<string name="save_file_imported_success">已成功導入</string>
|
||||||
<string name="save_file_invalid_zip_structure">無效的儲存目錄結構</string>
|
<string name="save_file_invalid_zip_structure">無效的儲存目錄結構</string>
|
||||||
<string name="save_file_invalid_zip_structure_description">首個子資料夾名稱必須為遊戲ID</string>
|
<string name="save_file_invalid_zip_structure_description">首個子資料夾名稱必須為遊戲ID</string>
|
||||||
<string name="install_firmware">安裝韌體</string>
|
<string name="install_firmware">安裝韌體</string>
|
||||||
@@ -478,13 +478,13 @@
|
|||||||
<string name="licenses_description">這些專案使Eden Android版成為可能</string>
|
<string name="licenses_description">這些專案使Eden Android版成為可能</string>
|
||||||
<string name="build">組建版本</string>
|
<string name="build">組建版本</string>
|
||||||
<string name="user_data">使用者資料</string>
|
<string name="user_data">使用者資料</string>
|
||||||
<string name="user_data_description">匯入/匯出所有應用程式資料\n\n匯入使用者資料時,現有的使用者資料將被取代!\n\n直接從 Citron 匯入使用者資料可能會出現問題,建議手動匯入所有所需資料</string>
|
<string name="user_data_description">導入/導出所有應用程式資料\n\n導入使用者資料時,現有的使用者資料將被取代!\n\n直接從 Citron 導入使用者資料可能會出現問題,建議手動導入所有所需資料</string>
|
||||||
<string name="exporting_user_data">正在匯出使用者資料…</string>
|
<string name="exporting_user_data">正在導出使用者資料…</string>
|
||||||
<string name="importing_user_data">正在匯入使用者資料…</string>
|
<string name="importing_user_data">正在導入使用者資料…</string>
|
||||||
<string name="invalid_yuzu_backup">無效的Eden備份</string>
|
<string name="invalid_yuzu_backup">無效的Eden備份</string>
|
||||||
<string name="user_data_export_success">使用者資料匯出成功</string>
|
<string name="user_data_export_success">使用者資料導出成功</string>
|
||||||
<string name="user_data_import_success">使用者資料匯入成功</string>
|
<string name="user_data_import_success">使用者資料導入成功</string>
|
||||||
<string name="user_data_export_cancelled">匯出已取消</string>
|
<string name="user_data_export_cancelled">導出已取消</string>
|
||||||
<string name="user_data_import_failed_description">請確保使用者資料夾位於zip壓縮檔的根目錄,並在 config/config.ini 路徑中包含組態檔案後重試</string>
|
<string name="user_data_import_failed_description">請確保使用者資料夾位於zip壓縮檔的根目錄,並在 config/config.ini 路徑中包含組態檔案後重試</string>
|
||||||
<!-- General settings strings -->
|
<!-- General settings strings -->
|
||||||
<string name="frame_limit_enable">限制模擬速度</string>
|
<string name="frame_limit_enable">限制模擬速度</string>
|
||||||
@@ -521,7 +521,7 @@
|
|||||||
<string name="custom_cpu_ticks_description">自訂CPU時脈,更高的值可能提高效能,但也可能導致遊戲卡死。建議範圍為77-21000</string>
|
<string name="custom_cpu_ticks_description">自訂CPU時脈,更高的值可能提高效能,但也可能導致遊戲卡死。建議範圍為77-21000</string>
|
||||||
<string name="cpu_ticks">時脈</string>
|
<string name="cpu_ticks">時脈</string>
|
||||||
<string name="memory_layout">記憶體布局</string>
|
<string name="memory_layout">記憶體布局</string>
|
||||||
<string name="memory_layout_description">(實驗性)更改模擬記憶體布局,此設定不會提高效能,但可能有助於使用模組來提高解析度的遊戲的載入。不要在 RAM 為 8GB 或更少的手機上使用。若遊戲崩潰請將進階設定裡偵錯選項中的 CPU 後端改為 Dynarmic(JIT)</string>
|
<string name="memory_layout_description">(實驗性)更改模擬記憶體布局,此設定不會提高效能,但可能有助於使用模組來提高解析度的遊戲的載入。不要在RAM為8GB或更少的手機上使用。若遊戲崩潰請將進階設定裡偵錯選項中的CPU後端改為Dynarmic (JIT)</string>
|
||||||
|
|
||||||
<string name="generate">生成</string>
|
<string name="generate">生成</string>
|
||||||
|
|
||||||
@@ -564,12 +564,14 @@
|
|||||||
<string name="renderer_force_max_clock_description">強制GPU以可能的最大時脈運作(熱溫限制仍會被套用)</string>
|
<string name="renderer_force_max_clock_description">強制GPU以可能的最大時脈運作(熱溫限制仍會被套用)</string>
|
||||||
<string name="renderer_asynchronous_gpu_emulation">GPU非同步模擬</string>
|
<string name="renderer_asynchronous_gpu_emulation">GPU非同步模擬</string>
|
||||||
<string name="renderer_asynchronous_gpu_emulation_description">此修改可透過使用GPU非同步模擬來提升性能,不過可能會導致圖形問題且會提高在進行時序相關操作時當機的機率</string>
|
<string name="renderer_asynchronous_gpu_emulation_description">此修改可透過使用GPU非同步模擬來提升性能,不過可能會導致圖形問題且會提高在進行時序相關操作時當機的機率</string>
|
||||||
|
<string name="renderer_async_presentation">非同步呈現</string>
|
||||||
|
<string name="renderer_async_presentation_description">此修改可以透過將渲染移至單獨的CPU執行緒來提升性能,但可能會導致圖形問題</string>
|
||||||
<string name="renderer_reactive_flushing">使用重新啟用排清</string>
|
<string name="renderer_reactive_flushing">使用重新啟用排清</string>
|
||||||
<string name="renderer_reactive_flushing_description">犧牲效能以改善部分遊戲的轉譯準確度</string>
|
<string name="renderer_reactive_flushing_description">犧牲效能以改善部分遊戲的轉譯準確度</string>
|
||||||
<string name="enable_buffer_history">啟用緩衝區歷史</string>
|
<string name="enable_buffer_history">啟用緩衝區歷史</string>
|
||||||
<string name="enable_buffer_history_description">允許存取先前的緩衝區狀態,此選項可能會改善部分遊戲的渲染品質與效能穩定性</string>
|
<string name="enable_buffer_history_description">允許存取先前的緩衝區狀態,此選項可能會改善部分遊戲的渲染品質與效能穩定性</string>
|
||||||
<string name="use_optimized_vertex_buffers">最佳化頂點緩衝區</string>
|
<string name="use_optimized_vertex_buffers">最佳化頂點緩衝區</string>
|
||||||
<string name="use_optimized_vertex_buffers_description">啟用最佳化的頂點緩衝區綁定,需要安裝 Mesa 26.0+ Turnip drivers/Qualcomm drivers。使用舊版 Turnip drivers 會導致當機(25.3 版或更低的版本)</string>
|
<string name="use_optimized_vertex_buffers_description">啟用最佳化的頂點緩衝區綁定,需要安裝 Mesa 26.0+ Turnip drivers/Qualcomm drivers。使用舊版 Turnip drivers 會導致當機(25.3版和更低的版本)</string>
|
||||||
|
|
||||||
<string name="hacks">修改</string>
|
<string name="hacks">修改</string>
|
||||||
|
|
||||||
@@ -577,10 +579,6 @@
|
|||||||
<string name="fast_gpu_time_description">讓遊戲誤以為GPU工作能更快完成,避免遊戲為了配合Switch的時脈而降低解析度與渲染距離</string>
|
<string name="fast_gpu_time_description">讓遊戲誤以為GPU工作能更快完成,避免遊戲為了配合Switch的時脈而降低解析度與渲染距離</string>
|
||||||
<string name="skip_cpu_inner_invalidation">跳過CPU內部失效處理</string>
|
<string name="skip_cpu_inner_invalidation">跳過CPU內部失效處理</string>
|
||||||
<string name="skip_cpu_inner_invalidation_description">在記憶體更新期間跳過某些CPU端快取的失效處理,減少CPU使用率並提高其性能。可能會導致某些遊戲出現故障或當機</string>
|
<string name="skip_cpu_inner_invalidation_description">在記憶體更新期間跳過某些CPU端快取的失效處理,減少CPU使用率並提高其性能。可能會導致某些遊戲出現故障或當機</string>
|
||||||
<string name="nce_invalidation_gpu_readback">在 NCE 無效化前進行 GPU 回讀</string>
|
|
||||||
<string name="nce_invalidation_gpu_readback_description">(暫時性功能)修復 \"終結者瑪格諾莉亞:霧中綻放\" 及其它使用虛幻引擎之遊戲中的當機問題,可能會降低效能。此功能正在改善中</string>
|
|
||||||
<string name="nce_runtime_nro_patch">對 NCE Runtime 的 NRO 檔案進行修補</string>
|
|
||||||
<string name="nce_runtime_nro_patch_description">(暫時性功能)修復 \"Biomutant\" 的啟動問題,可能會對效能造成影響。此功能正在改善中</string>
|
|
||||||
<string name="fix_bloom_effects">修正光暈特效</string>
|
<string name="fix_bloom_effects">修正光暈特效</string>
|
||||||
<string name="fix_bloom_effects_description">在 \"薩爾達傳說:織夢島\" 和 \"薩爾達傳說:智慧的再現\" 中減少光暈模糊的問題並移除 \"橫衝直撞:狂飆樂園重製版\" 中的光暈效果(適用於Adreno A6XX - A7XX/ Turnip)。警告:可能會在其它遊戲中導致圖形異常</string>
|
<string name="fix_bloom_effects_description">在 \"薩爾達傳說:織夢島\" 和 \"薩爾達傳說:智慧的再現\" 中減少光暈模糊的問題並移除 \"橫衝直撞:狂飆樂園重製版\" 中的光暈效果(適用於Adreno A6XX - A7XX/ Turnip)。警告:可能會在其它遊戲中導致圖形異常</string>
|
||||||
<string name="emulate_bgr565">模擬BGR565</string>
|
<string name="emulate_bgr565">模擬BGR565</string>
|
||||||
@@ -639,7 +637,7 @@
|
|||||||
|
|
||||||
<string name="log">日誌</string>
|
<string name="log">日誌</string>
|
||||||
<string name="flush_by_line">按行寫入偵錯日誌</string>
|
<string name="flush_by_line">按行寫入偵錯日誌</string>
|
||||||
<string name="flush_by_line_description">寫入一行日誌就立刻更新偵錯記錄,讓程式在當機或畫面凍結時更容易偵錯</string>
|
<string name="flush_by_line_description">在寫入一行日誌就立刻更新偵錯記錄,讓程式在當機或閃退時更容易偵錯</string>
|
||||||
<string name="extended_logging">啟用更詳細的日誌記錄</string>
|
<string name="extended_logging">啟用更詳細的日誌記錄</string>
|
||||||
<string name="extended_logging_description">將日誌檔的最大檔案限制從100MB提高到1GB</string>
|
<string name="extended_logging_description">將日誌檔的最大檔案限制從100MB提高到1GB</string>
|
||||||
<string name="log_filter">日誌過濾器</string>
|
<string name="log_filter">日誌過濾器</string>
|
||||||
@@ -742,7 +740,7 @@
|
|||||||
<string name="button_map_description">按下一個按鈕或肩部按鍵/移動搖桿</string>
|
<string name="button_map_description">按下一個按鈕或肩部按鍵/移動搖桿</string>
|
||||||
<string name="map_dpad_direction">將方向鍵配對到 %1$s</string>
|
<string name="map_dpad_direction">將方向鍵配對到 %1$s</string>
|
||||||
<string name="map_control">配對到 %1$s</string>
|
<string name="map_control">配對到 %1$s</string>
|
||||||
<string name="failed_to_load_profile">匯入設定檔失敗</string>
|
<string name="failed_to_load_profile">導入設定檔失敗</string>
|
||||||
<string name="failed_to_save_profile">儲存設定檔失敗</string>
|
<string name="failed_to_save_profile">儲存設定檔失敗</string>
|
||||||
<string name="reset_mapping">重設控制器配對</string>
|
<string name="reset_mapping">重設控制器配對</string>
|
||||||
<string name="reset_mapping_description">您確定要將此控制器的所有配對重設為預設值?此動作無法復原</string>
|
<string name="reset_mapping_description">您確定要將此控制器的所有配對重設為預設值?此動作無法復原</string>
|
||||||
@@ -763,21 +761,21 @@
|
|||||||
<string name="auto">自動</string>
|
<string name="auto">自動</string>
|
||||||
<string name="submit">提交</string>
|
<string name="submit">提交</string>
|
||||||
<string name="string_null">無</string>
|
<string name="string_null">無</string>
|
||||||
<string name="string_import">匯入</string>
|
<string name="string_import">導入</string>
|
||||||
<string name="export">匯出</string>
|
<string name="export">導出</string>
|
||||||
<string name="export_failed">匯出失敗</string>
|
<string name="export_failed">導出失敗</string>
|
||||||
<string name="import_failed">匯入失敗</string>
|
<string name="import_failed">導入失敗</string>
|
||||||
<string name="cancelling">正在取消</string>
|
<string name="cancelling">正在取消</string>
|
||||||
<string name="install">安裝</string>
|
<string name="install">安裝</string>
|
||||||
<string name="fetch">下載</string>
|
<string name="fetch">下載</string>
|
||||||
<string name="delete">刪除</string>
|
<string name="delete">刪除</string>
|
||||||
<string name="edit">編輯</string>
|
<string name="edit">編輯</string>
|
||||||
<string name="import_success">已成功匯入</string>
|
<string name="import_success">已成功導入</string>
|
||||||
<string name="export_success">已成功匯出</string>
|
<string name="export_success">已成功導出</string>
|
||||||
<string name="start">開始</string>
|
<string name="start">開始</string>
|
||||||
<string name="global">全域設定</string>
|
<string name="global">全域設定</string>
|
||||||
<string name="custom">個別遊戲設定</string>
|
<string name="custom">個別遊戲設定</string>
|
||||||
<string name="import_complete">匯入完成</string>
|
<string name="import_complete">導入完成</string>
|
||||||
<string name="use_global_setting">使用全域設定</string>
|
<string name="use_global_setting">使用全域設定</string>
|
||||||
<string name="operation_completed_successfully">操作已成功完成</string>
|
<string name="operation_completed_successfully">操作已成功完成</string>
|
||||||
<string name="confirm">確認</string>
|
<string name="confirm">確認</string>
|
||||||
@@ -840,7 +838,7 @@
|
|||||||
<string name="save_migration_complete">成功遷移儲存資料</string>
|
<string name="save_migration_complete">成功遷移儲存資料</string>
|
||||||
<string name="save_migration_failed">儲存資料遷移失敗</string>
|
<string name="save_migration_failed">儲存資料遷移失敗</string>
|
||||||
<string name="save_directory_set">存檔目錄設定完成</string>
|
<string name="save_directory_set">存檔目錄設定完成</string>
|
||||||
<string name="destination_has_saves">所選取的位置已有儲存資料,是否要取代該檔案?</string>
|
<string name="destination_has_saves">所選取的位置已有儲存資料。是否要取代該檔案?</string>
|
||||||
<string name="all_files_permission_required">若要自訂路徑必須授予所有檔案的存取權</string>
|
<string name="all_files_permission_required">若要自訂路徑必須授予所有檔案的存取權</string>
|
||||||
<string name="grant_permission">授予權限</string>
|
<string name="grant_permission">授予權限</string>
|
||||||
<string name="custom_nand_directory">NAND 路徑</string>
|
<string name="custom_nand_directory">NAND 路徑</string>
|
||||||
@@ -877,13 +875,13 @@
|
|||||||
<string name="hours_must_be_between_0_and_9999">必須介於0到9999小時之間</string>
|
<string name="hours_must_be_between_0_and_9999">必須介於0到9999小時之間</string>
|
||||||
<string name="minutes_must_be_between_0_and_59">必須介於0到59分鐘之間</string>
|
<string name="minutes_must_be_between_0_and_59">必須介於0到59分鐘之間</string>
|
||||||
<string name="seconds_must_be_between_0_and_59">必須介於0到59秒之間</string>
|
<string name="seconds_must_be_between_0_and_59">必須介於0到59秒之間</string>
|
||||||
<string name="playtime_updated_successfully">成功修改遊玩時間</string>
|
<string name="playtime_updated_successfully">成功更新遊玩時間</string>
|
||||||
<string name="clear_shader_cache">清除著色器快取</string>
|
<string name="clear_shader_cache">清除著色器快取</string>
|
||||||
<string name="clear_shader_cache_description">清除此遊戲所有已編譯的著色器快取</string>
|
<string name="clear_shader_cache_description">清除此遊戲所有已編譯的著色器快取</string>
|
||||||
<string name="clear_shader_cache_warning_description">重新編譯著色器快取的過程中可能會導致遊戲有些微卡頓</string>
|
<string name="clear_shader_cache_warning_description">重新編譯著色器快取的過程中可能會導致遊戲有些微卡頓</string>
|
||||||
<string name="cleared_shaders_successfully">著色器快取已成功清除</string>
|
<string name="cleared_shaders_successfully">著色器快取已成功清除</string>
|
||||||
<string name="driver_shader_wipe_dialog_title">已刪除著色器快取</string>
|
<string name="driver_shader_wipe_dialog_title">已刪除著色器快取</string>
|
||||||
<string name="driver_shader_wipe_dialog_message">為了維持Vulkan管線驗證,Eden 已自動清除所有著色器快取,若要預防閃退和圖形錯誤,這是必須的動作。因為著色器需要重新編譯,您在遊戲過程中可能會遇到些微卡頓的情況</string>
|
<string name="driver_shader_wipe_dialog_message">為了維持Vulkan管線驗證,Eden已自動清除所有著色器快取。為了預防閃退和圖形錯誤,這是必須的動作。因為著色器需要重新編譯,您在遊戲過程中可能會遇到些微卡頓的情況</string>
|
||||||
<string name="addons_game">附加元件:%1$s</string>
|
<string name="addons_game">附加元件:%1$s</string>
|
||||||
<string name="save_data">儲存資料</string>
|
<string name="save_data">儲存資料</string>
|
||||||
<string name="save_data_description">管理此遊戲的儲存資料</string>
|
<string name="save_data_description">管理此遊戲的儲存資料</string>
|
||||||
@@ -915,8 +913,8 @@
|
|||||||
<string name="verify_no_result_description">未完成文件完整性檢查</string>
|
<string name="verify_no_result_description">未完成文件完整性檢查</string>
|
||||||
<string name="verification_failed_for">以下文件的完整性驗證失敗:\n %1$s</string>
|
<string name="verification_failed_for">以下文件的完整性驗證失敗:\n %1$s</string>
|
||||||
<string name="share_game_settings">分享設定</string>
|
<string name="share_game_settings">分享設定</string>
|
||||||
<string name="import_config">匯入設定</string>
|
<string name="import_config">導入設定</string>
|
||||||
<string name="export_config">匯出設定</string>
|
<string name="export_config">導出設定</string>
|
||||||
<string name="share_config_failed">分享設定失敗</string>
|
<string name="share_config_failed">分享設定失敗</string>
|
||||||
|
|
||||||
<!-- ROM loading errors -->
|
<!-- ROM loading errors -->
|
||||||
@@ -937,7 +935,7 @@
|
|||||||
<string name="custom_settings_failed_message">無法套用自訂設定 %1$s: %2$s</string>
|
<string name="custom_settings_failed_message">無法套用自訂設定 %1$s: %2$s</string>
|
||||||
<string name="launch_with_default_settings">使用預設設定啟動</string>
|
<string name="launch_with_default_settings">使用預設設定啟動</string>
|
||||||
<string name="launch_cancelled">啟動已取消</string>
|
<string name="launch_cancelled">啟動已取消</string>
|
||||||
<string name="custom_settings_failure_reasons">無法套用請求的設定,這可能是由於缺少 GPU 驅動程式或設定問題</string>
|
<string name="custom_settings_failure_reasons">無法套用請求的設定。這可能是由於缺少GPU驅動程式或設定問題。</string>
|
||||||
<string name="custom_settings_applied">已套用自訂設定</string>
|
<string name="custom_settings_applied">已套用自訂設定</string>
|
||||||
<string name="launching_game">正在啟動 %1$s...</string>
|
<string name="launching_game">正在啟動 %1$s...</string>
|
||||||
<string name="failed_to_initialize_game">無法初始化遊戲</string>
|
<string name="failed_to_initialize_game">無法初始化遊戲</string>
|
||||||
@@ -958,10 +956,10 @@
|
|||||||
<!-- Driver strings -->
|
<!-- Driver strings -->
|
||||||
<string name="driver_not_found">未安裝所需的驅動程式: %s</string>
|
<string name="driver_not_found">未安裝所需的驅動程式: %s</string>
|
||||||
<string name="invalid_driver_file">無效的驅動程式檔案: %s</string>
|
<string name="invalid_driver_file">無效的驅動程式檔案: %s</string>
|
||||||
<string name="network_unavailable">無可用網路連線,請檢查您的網路連線並重試</string>
|
<string name="network_unavailable">無可用網路連線。請檢查您的網路連線並重試</string>
|
||||||
<string name="driver_missing_title">需要GPU驅動程式</string>
|
<string name="driver_missing_title">需要GPU驅動程式</string>
|
||||||
<string name="driver_missing_message">這個遊戲的設定需要 \"%s\"驅動程式,而它並沒有安裝在您的裝置上\n\n要下載並安裝此驅動程式嗎?</string>
|
<string name="driver_missing_message">這個遊戲的設定需要 \"%s\"驅動程式,而它並沒有安裝在您的裝置上\n\n要下載並安裝此驅動程式嗎?</string>
|
||||||
<string name="driver_download_cancelled">驅動程式下載已取消,沒有所需的驅動程式無法啟動遊戲</string>
|
<string name="driver_download_cancelled">驅動程式下載已取消。沒有所需的驅動程式無法啟動遊戲。</string>
|
||||||
<string name="download">下載</string>
|
<string name="download">下載</string>
|
||||||
|
|
||||||
<!-- Emulation Menu -->
|
<!-- Emulation Menu -->
|
||||||
@@ -996,7 +994,7 @@
|
|||||||
<string name="amiibo_not_valid">您所選擇的並不是正確的amiibo金鑰檔</string>
|
<string name="amiibo_not_valid">您所選擇的並不是正確的amiibo金鑰檔</string>
|
||||||
<string name="amiibo_in_use">選擇的檔案已在使用中</string>
|
<string name="amiibo_in_use">選擇的檔案已在使用中</string>
|
||||||
<string name="amiibo_unknown_error">發生未知的錯誤</string>
|
<string name="amiibo_unknown_error">發生未知的錯誤</string>
|
||||||
<string name="amiibo_load_success">Amiibo 已匯入</string>
|
<string name="amiibo_load_success">已導入Amiibo</string>
|
||||||
|
|
||||||
|
|
||||||
<!-- Software keyboard -->
|
<!-- Software keyboard -->
|
||||||
@@ -1025,9 +1023,9 @@
|
|||||||
<string name="region_taiwan">臺灣</string>
|
<string name="region_taiwan">臺灣</string>
|
||||||
|
|
||||||
<!-- Memory Layouts -->
|
<!-- Memory Layouts -->
|
||||||
<string name="memory_4gb">4GB(推薦)</string>
|
<string name="memory_4gb">4GB (推薦)</string>
|
||||||
<string name="memory_6gb">6GB(不穩定)</string>
|
<string name="memory_6gb">6GB (不穩定)</string>
|
||||||
<string name="memory_8gb">8GB(不穩定)</string>
|
<string name="memory_8gb">8GB (不穩定)</string>
|
||||||
|
|
||||||
<!-- CPU clock levels -->
|
<!-- CPU clock levels -->
|
||||||
<string name="clock_normal">正常</string>
|
<string name="clock_normal">正常</string>
|
||||||
@@ -1077,26 +1075,20 @@
|
|||||||
|
|
||||||
<!-- Renderer Accuracy -->
|
<!-- Renderer Accuracy -->
|
||||||
<string name="renderer_accuracy_low">效能</string>
|
<string name="renderer_accuracy_low">效能</string>
|
||||||
<string name="renderer_accuracy_high">品質</string>
|
<string name="renderer_accuracy_high">準確</string>
|
||||||
|
|
||||||
<!-- DMA Accuracy -->
|
<!-- DMA Accuracy -->
|
||||||
<string name="dma_accuracy_default">預設</string>
|
<string name="dma_accuracy_default">預設</string>
|
||||||
<string name="dma_accuracy_unsafe">不穩定</string>
|
<string name="dma_accuracy_unsafe">不穩定</string>
|
||||||
<string name="dma_accuracy_safe">穩定</string>
|
<string name="dma_accuracy_safe">穩定</string>
|
||||||
|
|
||||||
<!-- GPU Fence Behavior -->
|
|
||||||
<string name="gpu_fence_behavior_default">預設</string>
|
|
||||||
<string name="gpu_fence_behavior_immediate">即時</string>
|
|
||||||
<string name="gpu_fence_behavior_balanced">平衡</string>
|
|
||||||
<string name="gpu_fence_behavior_accurate">準確</string>
|
|
||||||
|
|
||||||
<string name="vram_usage_conservative">保守</string>
|
<string name="vram_usage_conservative">保守</string>
|
||||||
<string name="vram_usage_aggressive">積極</string>
|
<string name="vram_usage_aggressive">積極</string>
|
||||||
|
|
||||||
<!-- Renderer VSync -->
|
<!-- Renderer VSync -->
|
||||||
<string name="renderer_vsync_immediate">即時(關閉)</string>
|
<string name="renderer_vsync_immediate">即時 (關閉)</string>
|
||||||
<string name="renderer_vsync_mailbox">Mailbox</string>
|
<string name="renderer_vsync_mailbox">Mailbox</string>
|
||||||
<string name="renderer_vsync_fifo">FIFO(開啟)</string>
|
<string name="renderer_vsync_fifo">FIFO (開啟)</string>
|
||||||
<string name="renderer_vsync_fifo_relaxed">FIFO 寬鬆</string>
|
<string name="renderer_vsync_fifo_relaxed">FIFO 寬鬆</string>
|
||||||
|
|
||||||
<!-- Anti-Aliasing -->
|
<!-- Anti-Aliasing -->
|
||||||
@@ -1118,18 +1110,6 @@
|
|||||||
<string name="cpu_accuracy_paranoid">不合理</string>
|
<string name="cpu_accuracy_paranoid">不合理</string>
|
||||||
<string name="cpu_accuracy_debugging">偵錯</string>
|
<string name="cpu_accuracy_debugging">偵錯</string>
|
||||||
|
|
||||||
<!-- Freedreno Settings -->
|
|
||||||
<string name="freedreno_settings_title">Freedreno 設定</string>
|
|
||||||
<string name="gpu_driver_settings">GPU 驅動程式設定</string>
|
|
||||||
<string name="freedreno_presets">預先提供的設定檔</string>
|
|
||||||
<string name="freedreno_current_settings">目前使用的設定</string>
|
|
||||||
<string name="freedreno_debug">進階設定</string>
|
|
||||||
<string name="freedreno_var_name">變數名稱 (例如: TU_DEBUG)</string>
|
|
||||||
<string name="freedreno_var_value">變數值</string>
|
|
||||||
<string name="freedreno_add_variable">新增變數</string>
|
|
||||||
<string name="freedreno_clear_all">全部清除</string>
|
|
||||||
<string name="freedreno_saved">Freedreno 設定已儲存</string>
|
|
||||||
<string name="freedreno_cleared_all">已清除所有 Freedreno 變數</string>
|
|
||||||
<!-- Gamepad Buttons -->
|
<!-- Gamepad Buttons -->
|
||||||
<string name="gamepad_d_pad">方向鍵</string>
|
<string name="gamepad_d_pad">方向鍵</string>
|
||||||
<string name="gamepad_left_stick">左搖桿</string>
|
<string name="gamepad_left_stick">左搖桿</string>
|
||||||
|
|||||||
@@ -580,6 +580,8 @@
|
|||||||
<string name="renderer_force_max_clock_description">Forces the GPU to run at the maximum possible clocks (thermal constraints will still be applied).</string>
|
<string name="renderer_force_max_clock_description">Forces the GPU to run at the maximum possible clocks (thermal constraints will still be applied).</string>
|
||||||
<string name="renderer_asynchronous_gpu_emulation">GPU async emulation</string>
|
<string name="renderer_asynchronous_gpu_emulation">GPU async emulation</string>
|
||||||
<string name="renderer_asynchronous_gpu_emulation_description">This hack can increase performance by running GPU emulation asynchronously at the cost of graphical issues and increased crash rates by timing-related operations.</string>
|
<string name="renderer_asynchronous_gpu_emulation_description">This hack can increase performance by running GPU emulation asynchronously at the cost of graphical issues and increased crash rates by timing-related operations.</string>
|
||||||
|
<string name="renderer_async_presentation">Asynchronous presentation</string>
|
||||||
|
<string name="renderer_async_presentation_description">This hack can increase performance by moving presentation to a separate CPU thread at the cost of graphical issues.</string>
|
||||||
<string name="renderer_reactive_flushing">Use reactive flushing</string>
|
<string name="renderer_reactive_flushing">Use reactive flushing</string>
|
||||||
<string name="renderer_reactive_flushing_description">Improves rendering accuracy in some games at the cost of performance.</string>
|
<string name="renderer_reactive_flushing_description">Improves rendering accuracy in some games at the cost of performance.</string>
|
||||||
<string name="enable_buffer_history">Enable buffer history</string>
|
<string name="enable_buffer_history">Enable buffer history</string>
|
||||||
|
|||||||
@@ -14,6 +14,21 @@
|
|||||||
#include "core/core_timing.h"
|
#include "core/core_timing.h"
|
||||||
#include "core/hle/kernel/k_event.h"
|
#include "core/hle/kernel/k_event.h"
|
||||||
|
|
||||||
|
// See texture_cache/util.h
|
||||||
|
template<typename T, size_t N>
|
||||||
|
#if BOOST_VERSION >= 108100 || __GNUC__ > 12
|
||||||
|
[[nodiscard]] boost::container::static_vector<T, N> FixStaticVectorADL(const boost::container::static_vector<T, N>& v) {
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
[[nodiscard]] std::vector<T> FixStaticVectorADL(const boost::container::static_vector<T, N>& v) {
|
||||||
|
std::vector<T> u;
|
||||||
|
for (auto const& e : v)
|
||||||
|
u.push_back(e);
|
||||||
|
return u;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace AudioCore::AudioIn {
|
namespace AudioCore::AudioIn {
|
||||||
|
|
||||||
System::System(Core::System& system_, Kernel::KEvent* event_, const size_t session_id_)
|
System::System(Core::System& system_, Kernel::KEvent* event_, const size_t session_id_)
|
||||||
@@ -95,7 +110,7 @@ Result System::Start() {
|
|||||||
|
|
||||||
boost::container::static_vector<AudioBuffer, BufferCount> buffers_to_flush{};
|
boost::container::static_vector<AudioBuffer, BufferCount> buffers_to_flush{};
|
||||||
buffers.RegisterBuffers(buffers_to_flush);
|
buffers.RegisterBuffers(buffers_to_flush);
|
||||||
session->AppendBuffers(buffers_to_flush);
|
session->AppendBuffers(FixStaticVectorADL(buffers_to_flush));
|
||||||
session->SetRingSize(static_cast<u32>(buffers_to_flush.size()));
|
session->SetRingSize(static_cast<u32>(buffers_to_flush.size()));
|
||||||
|
|
||||||
return ResultSuccess;
|
return ResultSuccess;
|
||||||
@@ -140,7 +155,7 @@ void System::RegisterBuffers() {
|
|||||||
if (state == State::Started) {
|
if (state == State::Started) {
|
||||||
boost::container::static_vector<AudioBuffer, BufferCount> registered_buffers{};
|
boost::container::static_vector<AudioBuffer, BufferCount> registered_buffers{};
|
||||||
buffers.RegisterBuffers(registered_buffers);
|
buffers.RegisterBuffers(registered_buffers);
|
||||||
session->AppendBuffers(registered_buffers);
|
session->AppendBuffers(FixStaticVectorADL(registered_buffers));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+15
-12
@@ -171,13 +171,8 @@ struct Values {
|
|||||||
SwitchableSetting<bool> enable_overlay{linkage, false, "enable_overlay", Category::LibraryApplet};
|
SwitchableSetting<bool> enable_overlay{linkage, false, "enable_overlay", Category::LibraryApplet};
|
||||||
|
|
||||||
// Audio
|
// Audio
|
||||||
SwitchableSetting<AudioEngine> sink_id{linkage,
|
SwitchableSetting<AudioEngine> sink_id{linkage, AudioEngine::Auto, "output_engine",
|
||||||
#ifdef __ANDROID__
|
Category::Audio, Specialization::RuntimeList};
|
||||||
AudioEngine::Sdl3,
|
|
||||||
#else
|
|
||||||
AudioEngine::Auto,
|
|
||||||
#endif
|
|
||||||
"output_engine", Category::Audio, Specialization::RuntimeList};
|
|
||||||
SwitchableSetting<std::string> audio_output_device_id{
|
SwitchableSetting<std::string> audio_output_device_id{
|
||||||
linkage, "auto", "output_device", Category::Audio, Specialization::RuntimeList};
|
linkage, "auto", "output_device", Category::Audio, Specialization::RuntimeList};
|
||||||
SwitchableSetting<std::string> audio_input_device_id{
|
SwitchableSetting<std::string> audio_input_device_id{
|
||||||
@@ -477,8 +472,13 @@ struct Values {
|
|||||||
SwitchableSetting<bool> frame_gen_dump_flow{linkage, false, "frame_gen_dump_flow",
|
SwitchableSetting<bool> frame_gen_dump_flow{linkage, false, "frame_gen_dump_flow",
|
||||||
Category::Renderer};
|
Category::Renderer};
|
||||||
|
|
||||||
SwitchableSetting<bool> use_asynchronous_gpu_emulation{linkage, true, "use_asynchronous_gpu_emulation",
|
SwitchableSetting<bool> use_asynchronous_gpu_emulation{linkage,
|
||||||
Category::Renderer};
|
#ifdef __ANDROID__
|
||||||
|
false,
|
||||||
|
#else
|
||||||
|
true,
|
||||||
|
#endif
|
||||||
|
"use_asynchronous_gpu_emulation", Category::Renderer};
|
||||||
// *nix platforms may have issues with the borderless windowed fullscreen mode.
|
// *nix platforms may have issues with the borderless windowed fullscreen mode.
|
||||||
// Default to exclusive fullscreen on these platforms for now.
|
// Default to exclusive fullscreen on these platforms for now.
|
||||||
SwitchableSetting<FullscreenMode, true> fullscreen_mode{linkage,
|
SwitchableSetting<FullscreenMode, true> fullscreen_mode{linkage,
|
||||||
@@ -537,7 +537,7 @@ struct Values {
|
|||||||
"vram_usage_mode",
|
"vram_usage_mode",
|
||||||
Category::RendererAdvanced};
|
Category::RendererAdvanced};
|
||||||
|
|
||||||
SwitchableSetting<NvdecEmulation> nvdec_emulation{linkage, NvdecEmulation::Cpu,
|
SwitchableSetting<NvdecEmulation> nvdec_emulation{linkage, NvdecEmulation::Gpu,
|
||||||
"nvdec_emulation", Category::RendererAdvanced};
|
"nvdec_emulation", Category::RendererAdvanced};
|
||||||
|
|
||||||
SwitchableSetting<AnisotropyMode, true> max_anisotropy{linkage,
|
SwitchableSetting<AnisotropyMode, true> max_anisotropy{linkage,
|
||||||
@@ -645,7 +645,7 @@ struct Values {
|
|||||||
linkage, false, "nce_runtime_nro_patch", Category::RendererHacks};
|
linkage, false, "nce_runtime_nro_patch", Category::RendererHacks};
|
||||||
SwitchableSetting<bool> async_presentation{linkage,
|
SwitchableSetting<bool> async_presentation{linkage,
|
||||||
#ifdef __ANDROID__
|
#ifdef __ANDROID__
|
||||||
true,
|
false,
|
||||||
#else
|
#else
|
||||||
false,
|
false,
|
||||||
#endif
|
#endif
|
||||||
@@ -657,6 +657,9 @@ struct Values {
|
|||||||
SwitchableSetting<bool> emulate_bgr565{linkage, false, "emulate_bgr565",
|
SwitchableSetting<bool> emulate_bgr565{linkage, false, "emulate_bgr565",
|
||||||
Category::RendererHacks};
|
Category::RendererHacks};
|
||||||
|
|
||||||
|
SwitchableSetting<bool> rescale_hack{linkage, false, "rescale_hack",
|
||||||
|
Category::RendererHacks};
|
||||||
|
|
||||||
SwitchableSetting<bool> use_asynchronous_shaders{linkage, false, "use_asynchronous_shaders",
|
SwitchableSetting<bool> use_asynchronous_shaders{linkage, false, "use_asynchronous_shaders",
|
||||||
Category::RendererHacks};
|
Category::RendererHacks};
|
||||||
|
|
||||||
@@ -933,7 +936,7 @@ struct Values {
|
|||||||
// Network
|
// Network
|
||||||
Setting<std::string> network_interface{linkage, std::string(), "network_interface",
|
Setting<std::string> network_interface{linkage, std::string(), "network_interface",
|
||||||
Category::Network};
|
Category::Network};
|
||||||
SwitchableSetting<bool> airplane_mode{linkage, true, "airplane_mode", Category::Network};
|
SwitchableSetting<bool> airplane_mode{linkage, false, "airplane_mode", Category::Network};
|
||||||
|
|
||||||
// WebService
|
// WebService
|
||||||
Setting<std::string> web_api_url{linkage, "api.ynet-fun.xyz", "web_api_url",
|
Setting<std::string> web_api_url{linkage, "api.ynet-fun.xyz", "web_api_url",
|
||||||
|
|||||||
+69
-1
@@ -444,18 +444,28 @@ add_library(core STATIC
|
|||||||
hle/service/am/process_creation.h
|
hle/service/am/process_creation.h
|
||||||
hle/service/am/process_holder.cpp
|
hle/service/am/process_holder.cpp
|
||||||
hle/service/am/process_holder.h
|
hle/service/am/process_holder.h
|
||||||
|
hle/service/am/service/all_system_applet_proxies_service.cpp
|
||||||
|
hle/service/am/service/all_system_applet_proxies_service.h
|
||||||
|
hle/service/am/service/applet_common_functions.cpp
|
||||||
|
hle/service/am/service/applet_common_functions.h
|
||||||
hle/service/am/service/application_accessor.cpp
|
hle/service/am/service/application_accessor.cpp
|
||||||
hle/service/am/service/application_accessor.h
|
hle/service/am/service/application_accessor.h
|
||||||
hle/service/am/service/application_creator.cpp
|
hle/service/am/service/application_creator.cpp
|
||||||
hle/service/am/service/application_creator.h
|
hle/service/am/service/application_creator.h
|
||||||
hle/service/am/service/application_functions.cpp
|
hle/service/am/service/application_functions.cpp
|
||||||
hle/service/am/service/application_functions.h
|
hle/service/am/service/application_functions.h
|
||||||
|
hle/service/am/service/application_proxy.cpp
|
||||||
|
hle/service/am/service/application_proxy.h
|
||||||
|
hle/service/am/service/application_proxy_service.cpp
|
||||||
|
hle/service/am/service/application_proxy_service.h
|
||||||
hle/service/am/service/audio_controller.cpp
|
hle/service/am/service/audio_controller.cpp
|
||||||
hle/service/am/service/audio_controller.h
|
hle/service/am/service/audio_controller.h
|
||||||
hle/service/am/service/common_state_getter.cpp
|
hle/service/am/service/common_state_getter.cpp
|
||||||
hle/service/am/service/common_state_getter.h
|
hle/service/am/service/common_state_getter.h
|
||||||
hle/service/am/service/cradle_firmware_updater.cpp
|
hle/service/am/service/cradle_firmware_updater.cpp
|
||||||
hle/service/am/service/cradle_firmware_updater.h
|
hle/service/am/service/cradle_firmware_updater.h
|
||||||
|
hle/service/am/service/debug_functions.cpp
|
||||||
|
hle/service/am/service/debug_functions.h
|
||||||
hle/service/am/service/display_controller.cpp
|
hle/service/am/service/display_controller.cpp
|
||||||
hle/service/am/service/display_controller.h
|
hle/service/am/service/display_controller.h
|
||||||
hle/service/am/service/global_state_controller.cpp
|
hle/service/am/service/global_state_controller.cpp
|
||||||
@@ -464,14 +474,28 @@ add_library(core STATIC
|
|||||||
hle/service/am/service/home_menu_functions.h
|
hle/service/am/service/home_menu_functions.h
|
||||||
hle/service/am/service/library_applet_accessor.cpp
|
hle/service/am/service/library_applet_accessor.cpp
|
||||||
hle/service/am/service/library_applet_accessor.h
|
hle/service/am/service/library_applet_accessor.h
|
||||||
|
hle/service/am/service/library_applet_creator.cpp
|
||||||
|
hle/service/am/service/library_applet_creator.h
|
||||||
|
hle/service/am/service/library_applet_proxy.cpp
|
||||||
|
hle/service/am/service/library_applet_proxy.h
|
||||||
|
hle/service/am/service/library_applet_self_accessor.cpp
|
||||||
|
hle/service/am/service/library_applet_self_accessor.h
|
||||||
|
hle/service/am/service/lock_accessor.cpp
|
||||||
|
hle/service/am/service/lock_accessor.h
|
||||||
hle/service/am/service/overlay_functions.cpp
|
hle/service/am/service/overlay_functions.cpp
|
||||||
hle/service/am/service/overlay_functions.h
|
hle/service/am/service/overlay_functions.h
|
||||||
|
hle/service/am/service/overlay_applet_proxy.cpp
|
||||||
|
hle/service/am/service/overlay_applet_proxy.h
|
||||||
hle/service/am/service/process_winding_controller.cpp
|
hle/service/am/service/process_winding_controller.cpp
|
||||||
hle/service/am/service/process_winding_controller.h
|
hle/service/am/service/process_winding_controller.h
|
||||||
hle/service/am/service/self_controller.cpp
|
hle/service/am/service/self_controller.cpp
|
||||||
hle/service/am/service/self_controller.h
|
hle/service/am/service/self_controller.h
|
||||||
hle/service/am/service/storage.cpp
|
hle/service/am/service/storage.cpp
|
||||||
hle/service/am/service/storage.h
|
hle/service/am/service/storage.h
|
||||||
|
hle/service/am/service/storage_accessor.cpp
|
||||||
|
hle/service/am/service/storage_accessor.h
|
||||||
|
hle/service/am/service/system_applet_proxy.cpp
|
||||||
|
hle/service/am/service/system_applet_proxy.h
|
||||||
hle/service/am/service/window_controller.cpp
|
hle/service/am/service/window_controller.cpp
|
||||||
hle/service/am/service/window_controller.h
|
hle/service/am/service/window_controller.h
|
||||||
hle/service/am/window_system.cpp
|
hle/service/am/window_system.cpp
|
||||||
@@ -556,8 +580,20 @@ add_library(core STATIC
|
|||||||
hle/service/btdrv/btdrv.h
|
hle/service/btdrv/btdrv.h
|
||||||
hle/service/btm/btm.cpp
|
hle/service/btm/btm.cpp
|
||||||
hle/service/btm/btm.h
|
hle/service/btm/btm.h
|
||||||
|
hle/service/btm/btm_debug.cpp
|
||||||
|
hle/service/btm/btm_debug.h
|
||||||
|
hle/service/btm/btm_system.cpp
|
||||||
|
hle/service/btm/btm_system.h
|
||||||
|
hle/service/btm/btm_system_core.cpp
|
||||||
|
hle/service/btm/btm_system_core.h
|
||||||
|
hle/service/btm/btm_user.cpp
|
||||||
|
hle/service/btm/btm_user.h
|
||||||
|
hle/service/btm/btm_user_core.cpp
|
||||||
|
hle/service/btm/btm_user_core.h
|
||||||
hle/service/caps/caps.cpp
|
hle/service/caps/caps.cpp
|
||||||
hle/service/caps/caps.h
|
hle/service/caps/caps.h
|
||||||
|
hle/service/caps/caps_a.cpp
|
||||||
|
hle/service/caps/caps_a.h
|
||||||
hle/service/caps/caps_c.cpp
|
hle/service/caps/caps_c.cpp
|
||||||
hle/service/caps/caps_c.h
|
hle/service/caps/caps_c.h
|
||||||
hle/service/caps/caps_manager.cpp
|
hle/service/caps/caps_manager.cpp
|
||||||
@@ -582,6 +618,10 @@ add_library(core STATIC
|
|||||||
hle/service/eupld/eupld.h
|
hle/service/eupld/eupld.h
|
||||||
hle/service/fatal/fatal.cpp
|
hle/service/fatal/fatal.cpp
|
||||||
hle/service/fatal/fatal.h
|
hle/service/fatal/fatal.h
|
||||||
|
hle/service/fatal/fatal_p.cpp
|
||||||
|
hle/service/fatal/fatal_p.h
|
||||||
|
hle/service/fatal/fatal_u.cpp
|
||||||
|
hle/service/fatal/fatal_u.h
|
||||||
hle/service/fgm/fgm.cpp
|
hle/service/fgm/fgm.cpp
|
||||||
hle/service/fgm/fgm.h
|
hle/service/fgm/fgm.h
|
||||||
hle/service/filesystem/filesystem.cpp
|
hle/service/filesystem/filesystem.cpp
|
||||||
@@ -613,6 +653,8 @@ add_library(core STATIC
|
|||||||
hle/service/filesystem/save_data_controller.h
|
hle/service/filesystem/save_data_controller.h
|
||||||
hle/service/friend/friend.cpp
|
hle/service/friend/friend.cpp
|
||||||
hle/service/friend/friend.h
|
hle/service/friend/friend.h
|
||||||
|
hle/service/friend/friend_interface.cpp
|
||||||
|
hle/service/friend/friend_interface.h
|
||||||
hle/service/glue/arp.cpp
|
hle/service/glue/arp.cpp
|
||||||
hle/service/glue/arp.h
|
hle/service/glue/arp.h
|
||||||
hle/service/glue/bgtc.cpp
|
hle/service/glue/bgtc.cpp
|
||||||
@@ -681,6 +723,8 @@ add_library(core STATIC
|
|||||||
hle/service/ldn/monitor_service.h
|
hle/service/ldn/monitor_service.h
|
||||||
hle/service/ldn/sf_monitor_service.cpp
|
hle/service/ldn/sf_monitor_service.cpp
|
||||||
hle/service/ldn/sf_monitor_service.h
|
hle/service/ldn/sf_monitor_service.h
|
||||||
|
hle/service/ldn/sf_service.cpp
|
||||||
|
hle/service/ldn/sf_service.h
|
||||||
hle/service/ldn/sf_service_monitor.cpp
|
hle/service/ldn/sf_service_monitor.cpp
|
||||||
hle/service/ldn/sf_service_monitor.h
|
hle/service/ldn/sf_service_monitor.h
|
||||||
hle/service/ldn/system_local_communication_service.cpp
|
hle/service/ldn/system_local_communication_service.cpp
|
||||||
@@ -869,6 +913,8 @@ add_library(core STATIC
|
|||||||
hle/service/olsc/native_handle_holder.h
|
hle/service/olsc/native_handle_holder.h
|
||||||
hle/service/olsc/olsc_service_for_application.cpp
|
hle/service/olsc/olsc_service_for_application.cpp
|
||||||
hle/service/olsc/olsc_service_for_application.h
|
hle/service/olsc/olsc_service_for_application.h
|
||||||
|
hle/service/olsc/olsc_service_for_system_service.cpp
|
||||||
|
hle/service/olsc/olsc_service_for_system_service.h
|
||||||
hle/service/olsc/olsc.cpp
|
hle/service/olsc/olsc.cpp
|
||||||
hle/service/olsc/olsc.h
|
hle/service/olsc/olsc.h
|
||||||
hle/service/olsc/remote_storage_controller.cpp
|
hle/service/olsc/remote_storage_controller.cpp
|
||||||
@@ -898,8 +944,14 @@ add_library(core STATIC
|
|||||||
hle/service/os/process.h
|
hle/service/os/process.h
|
||||||
hle/service/pcie/pcie.cpp
|
hle/service/pcie/pcie.cpp
|
||||||
hle/service/pcie/pcie.h
|
hle/service/pcie/pcie.h
|
||||||
|
hle/service/pctl/parental_control_service_factory.cpp
|
||||||
|
hle/service/pctl/parental_control_service_factory.h
|
||||||
|
hle/service/pctl/parental_control_service.cpp
|
||||||
|
hle/service/pctl/parental_control_service.h
|
||||||
hle/service/pctl/pctl.cpp
|
hle/service/pctl/pctl.cpp
|
||||||
hle/service/pctl/pctl.h
|
hle/service/pctl/pctl.h
|
||||||
|
hle/service/pctl/pctl_results.h
|
||||||
|
hle/service/pctl/pctl_types.h
|
||||||
hle/service/pcv/pcv.cpp
|
hle/service/pcv/pcv.cpp
|
||||||
hle/service/pcv/pcv.h
|
hle/service/pcv/pcv.h
|
||||||
hle/service/pm/pm.cpp
|
hle/service/pm/pm.cpp
|
||||||
@@ -909,8 +961,18 @@ add_library(core STATIC
|
|||||||
hle/service/psc/ovln/ovln_types.h
|
hle/service/psc/ovln/ovln_types.h
|
||||||
hle/service/psc/ovln/receiver_service.cpp
|
hle/service/psc/ovln/receiver_service.cpp
|
||||||
hle/service/psc/ovln/receiver_service.h
|
hle/service/psc/ovln/receiver_service.h
|
||||||
|
hle/service/psc/ovln/receiver.cpp
|
||||||
|
hle/service/psc/ovln/receiver.h
|
||||||
hle/service/psc/ovln/sender_service.cpp
|
hle/service/psc/ovln/sender_service.cpp
|
||||||
hle/service/psc/ovln/sender_service.h
|
hle/service/psc/ovln/sender_service.h
|
||||||
|
hle/service/psc/ovln/sender.cpp
|
||||||
|
hle/service/psc/ovln/sender.h
|
||||||
|
hle/service/psc/pm_control.cpp
|
||||||
|
hle/service/psc/pm_control.h
|
||||||
|
hle/service/psc/pm_module.cpp
|
||||||
|
hle/service/psc/pm_module.h
|
||||||
|
hle/service/psc/pm_service.cpp
|
||||||
|
hle/service/psc/pm_service.h
|
||||||
hle/service/psc/psc.cpp
|
hle/service/psc/psc.cpp
|
||||||
hle/service/psc/psc.h
|
hle/service/psc/psc.h
|
||||||
hle/service/psc/time/alarms.cpp
|
hle/service/psc/time/alarms.cpp
|
||||||
@@ -961,6 +1023,10 @@ add_library(core STATIC
|
|||||||
hle/service/ptm/ts.h
|
hle/service/ptm/ts.h
|
||||||
hle/service/ro/ro.cpp
|
hle/service/ro/ro.cpp
|
||||||
hle/service/ro/ro.h
|
hle/service/ro/ro.h
|
||||||
|
hle/service/ro/ro_nro_utils.cpp
|
||||||
|
hle/service/ro/ro_nro_utils.h
|
||||||
|
hle/service/ro/ro_results.h
|
||||||
|
hle/service/ro/ro_types.h
|
||||||
hle/service/server_manager.cpp
|
hle/service/server_manager.cpp
|
||||||
hle/service/server_manager.h
|
hle/service/server_manager.h
|
||||||
hle/service/service.cpp
|
hle/service/service.cpp
|
||||||
@@ -989,6 +1055,8 @@ add_library(core STATIC
|
|||||||
hle/service/set/system_settings_server.h
|
hle/service/set/system_settings_server.h
|
||||||
hle/service/sm/sm.cpp
|
hle/service/sm/sm.cpp
|
||||||
hle/service/sm/sm.h
|
hle/service/sm/sm.h
|
||||||
|
hle/service/sm/sm_controller.cpp
|
||||||
|
hle/service/sm/sm_controller.h
|
||||||
hle/service/sockets/bsd.cpp
|
hle/service/sockets/bsd.cpp
|
||||||
hle/service/sockets/bsd.h
|
hle/service/sockets/bsd.h
|
||||||
hle/service/sockets/nsd.cpp
|
hle/service/sockets/nsd.cpp
|
||||||
@@ -1154,7 +1222,7 @@ target_link_libraries(core PRIVATE
|
|||||||
RenderDoc::API
|
RenderDoc::API
|
||||||
ZLIB::ZLIB)
|
ZLIB::ZLIB)
|
||||||
|
|
||||||
target_link_libraries(core PUBLIC httplib::httplib zstd::zstd frozen::frozen-headers)
|
target_link_libraries(core PUBLIC httplib::httplib zstd::zstd)
|
||||||
|
|
||||||
if (ENABLE_WEB_SERVICE)
|
if (ENABLE_WEB_SERVICE)
|
||||||
target_compile_definitions(core PUBLIC ENABLE_WEB_SERVICE)
|
target_compile_definitions(core PUBLIC ENABLE_WEB_SERVICE)
|
||||||
|
|||||||
+11
-12
@@ -1,3 +1,6 @@
|
|||||||
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
@@ -143,20 +146,16 @@ public:
|
|||||||
return m_str;
|
return m_str;
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr size_t GetLength() const {
|
size_t GetLength() const {
|
||||||
if (std::is_constant_evaluated()) {
|
|
||||||
return Strlen(this->GetString());
|
|
||||||
} else {
|
|
||||||
return std::strlen(this->GetString());
|
return std::strlen(this->GetString());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
constexpr bool IsEmpty() const {
|
constexpr bool IsEmpty() const {
|
||||||
return *m_str == '\x00';
|
return *m_str == '\x00';
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr bool IsMatchHead(const char* p, size_t len) const {
|
bool IsMatchHead(const char* p, size_t len) const {
|
||||||
return Strncmp(this->GetString(), p, len) == 0;
|
return std::strncmp(this->GetString(), p, len) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Result Initialize(const Path& rhs) {
|
Result Initialize(const Path& rhs) {
|
||||||
@@ -169,7 +168,7 @@ public:
|
|||||||
R_TRY(this->Preallocate(len + 1));
|
R_TRY(this->Preallocate(len + 1));
|
||||||
|
|
||||||
// Copy the path
|
// Copy the path
|
||||||
const size_t copied = Strlcpy<char>(m_write_buffer.Get(), rhs.GetString(), len + 1);
|
const size_t copied = strlcpy(m_write_buffer.Get(), rhs.GetString(), len + 1);
|
||||||
R_UNLESS(copied == len, ResultUnexpectedInPathA);
|
R_UNLESS(copied == len, ResultUnexpectedInPathA);
|
||||||
|
|
||||||
// Set normalized
|
// Set normalized
|
||||||
@@ -331,14 +330,14 @@ public:
|
|||||||
// Get our write buffer
|
// Get our write buffer
|
||||||
auto* dst = m_write_buffer.Get();
|
auto* dst = m_write_buffer.Get();
|
||||||
if (old_write_buffer.Get() != nullptr && cur_len > 0) {
|
if (old_write_buffer.Get() != nullptr && cur_len > 0) {
|
||||||
Strlcpy<char>(dst, old_write_buffer.Get(), cur_len + 1);
|
strlcpy(dst, old_write_buffer.Get(), cur_len + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add separator
|
// Add separator
|
||||||
dst[cur_len] = '/';
|
dst[cur_len] = '/';
|
||||||
|
|
||||||
// Copy the child path
|
// Copy the child path
|
||||||
const size_t copied = Strlcpy<char>(dst + cur_len + 1, c, child_len + 1);
|
const size_t copied = strlcpy(dst + cur_len + 1, c, child_len + 1);
|
||||||
R_UNLESS(copied == child_len, ResultUnexpectedInPathA);
|
R_UNLESS(copied == child_len, ResultUnexpectedInPathA);
|
||||||
|
|
||||||
R_SUCCEED();
|
R_SUCCEED();
|
||||||
@@ -375,7 +374,7 @@ public:
|
|||||||
if (m_write_buffer.Get() == nullptr) {
|
if (m_write_buffer.Get() == nullptr) {
|
||||||
if (const auto len = std::strlen(m_str); len > 0) {
|
if (const auto len = std::strlen(m_str); len > 0) {
|
||||||
R_TRY(this->Preallocate(len));
|
R_TRY(this->Preallocate(len));
|
||||||
Strlcpy<char>(m_write_buffer.Get(), m_str, len + 1);
|
strlcpy(m_write_buffer.Get(), m_str, len + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -497,7 +496,7 @@ private:
|
|||||||
R_TRY(this->Preallocate(size + 1));
|
R_TRY(this->Preallocate(size + 1));
|
||||||
|
|
||||||
// Copy the path
|
// Copy the path
|
||||||
const size_t copied = Strlcpy<char>(m_write_buffer.Get(), path, size + 1);
|
const size_t copied = strlcpy(m_write_buffer.Get(), path, size + 1);
|
||||||
R_UNLESS(copied >= size, ResultUnexpectedInPathA);
|
R_UNLESS(copied >= size, ResultUnexpectedInPathA);
|
||||||
} else {
|
} else {
|
||||||
// We can just clear the buffer
|
// We can just clear the buffer
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
@@ -1217,7 +1217,7 @@ public:
|
|||||||
replaced_src = static_cast<char*>(Allocate(replaced_src_len));
|
replaced_src = static_cast<char*>(Allocate(replaced_src_len));
|
||||||
}
|
}
|
||||||
|
|
||||||
Strlcpy<char>(replaced_src, src, replaced_src_len);
|
strlcpy(replaced_src, src, replaced_src_len);
|
||||||
|
|
||||||
Replace(replaced_src, replaced_src_len, AlternateDirectorySeparator,
|
Replace(replaced_src, replaced_src_len, AlternateDirectorySeparator,
|
||||||
DirectorySeparator);
|
DirectorySeparator);
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
@@ -7,85 +10,6 @@
|
|||||||
|
|
||||||
namespace FileSys {
|
namespace FileSys {
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
constexpr int Strlen(const T* str) {
|
|
||||||
ASSERT(str != nullptr);
|
|
||||||
|
|
||||||
int length = 0;
|
|
||||||
while (*str++) {
|
|
||||||
++length;
|
|
||||||
}
|
|
||||||
|
|
||||||
return length;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
constexpr int Strnlen(const T* str, std::size_t count) {
|
|
||||||
return Strnlen(str, static_cast<int>(count));
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
constexpr int Strnlen(const T* str, int count) {
|
|
||||||
ASSERT(str != nullptr);
|
|
||||||
ASSERT(count >= 0);
|
|
||||||
|
|
||||||
int length = 0;
|
|
||||||
while (count-- && *str++) {
|
|
||||||
++length;
|
|
||||||
}
|
|
||||||
|
|
||||||
return length;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
constexpr int Strncmp(const T* lhs, const T* rhs, std::size_t count) {
|
|
||||||
return Strncmp(lhs, rhs, static_cast<int>(count));
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
constexpr int Strncmp(const T* lhs, const T* rhs, int count) {
|
|
||||||
ASSERT(lhs != nullptr);
|
|
||||||
ASSERT(rhs != nullptr);
|
|
||||||
ASSERT(count >= 0);
|
|
||||||
|
|
||||||
if (count == 0) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
T l, r;
|
|
||||||
do {
|
|
||||||
l = *(lhs++);
|
|
||||||
r = *(rhs++);
|
|
||||||
} while (l && (l == r) && (--count));
|
|
||||||
|
|
||||||
return l - r;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
static constexpr int Strlcpy(T* dst, const T* src, std::size_t count) {
|
|
||||||
return Strlcpy<T>(dst, src, static_cast<int>(count));
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
static constexpr int Strlcpy(T* dst, const T* src, int count) {
|
|
||||||
ASSERT(dst != nullptr);
|
|
||||||
ASSERT(src != nullptr);
|
|
||||||
|
|
||||||
const T* cur = src;
|
|
||||||
if (count > 0) {
|
|
||||||
while ((--count) && *cur) {
|
|
||||||
*(dst++) = *(cur++);
|
|
||||||
}
|
|
||||||
*dst = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (*cur) {
|
|
||||||
cur++;
|
|
||||||
}
|
|
||||||
|
|
||||||
return static_cast<int>(cur - src);
|
|
||||||
}
|
|
||||||
|
|
||||||
enum CharacterEncodingResult {
|
enum CharacterEncodingResult {
|
||||||
CharacterEncodingResult_Success = 0,
|
CharacterEncodingResult_Success = 0,
|
||||||
CharacterEncodingResult_InsufficientLength = 1,
|
CharacterEncodingResult_InsufficientLength = 1,
|
||||||
|
|||||||
+882
-891
File diff suppressed because it is too large
Load Diff
@@ -14,6 +14,70 @@ namespace Service::Account {
|
|||||||
|
|
||||||
class ProfileManager;
|
class ProfileManager;
|
||||||
|
|
||||||
|
class Module final {
|
||||||
|
public:
|
||||||
|
class Interface : public ServiceFramework<Interface> {
|
||||||
|
public:
|
||||||
|
explicit Interface(std::shared_ptr<Module> module_,
|
||||||
|
std::shared_ptr<ProfileManager> profile_manager_, Core::System& system_,
|
||||||
|
const char* name);
|
||||||
|
~Interface() override;
|
||||||
|
|
||||||
|
void GetUserCount(HLERequestContext& ctx);
|
||||||
|
void GetUserExistence(HLERequestContext& ctx);
|
||||||
|
void ListAllUsers(HLERequestContext& ctx);
|
||||||
|
void ListOpenUsers(HLERequestContext& ctx);
|
||||||
|
void GetLastOpenedUser(HLERequestContext& ctx);
|
||||||
|
void GetProfile(HLERequestContext& ctx);
|
||||||
|
void InitializeApplicationInfo(HLERequestContext& ctx);
|
||||||
|
void InitializeApplicationInfoRestricted(HLERequestContext& ctx);
|
||||||
|
void GetBaasAccountManagerForApplication(HLERequestContext& ctx);
|
||||||
|
void IsUserRegistrationRequestPermitted(HLERequestContext& ctx);
|
||||||
|
void TrySelectUserWithoutInteractionDeprecated(HLERequestContext& ctx);
|
||||||
|
void TrySelectUserWithoutInteraction(HLERequestContext& ctx);
|
||||||
|
void IsUserAccountSwitchLocked(HLERequestContext& ctx);
|
||||||
|
void InitializeApplicationInfoV2(HLERequestContext& ctx);
|
||||||
|
void BeginUserRegistration(HLERequestContext& ctx);
|
||||||
|
void CompleteUserRegistration(HLERequestContext& ctx);
|
||||||
|
void DeleteUser(HLERequestContext& ctx);
|
||||||
|
void SetUserPosition(HLERequestContext& ctx);
|
||||||
|
void GetProfileEditor(HLERequestContext& ctx);
|
||||||
|
void GetBaasAccountAdministrator(HLERequestContext &ctx);
|
||||||
|
void ListQualifiedUsers(HLERequestContext& ctx);
|
||||||
|
void ListOpenContextStoredUsers(HLERequestContext& ctx);
|
||||||
|
void StoreSaveDataThumbnailApplication(HLERequestContext& ctx);
|
||||||
|
void GetBaasAccountManagerForSystemService(HLERequestContext& ctx);
|
||||||
|
void StoreSaveDataThumbnailSystem(HLERequestContext& ctx);
|
||||||
|
void GetPinCodeLength(HLERequestContext& ctx);
|
||||||
|
|
||||||
|
private:
|
||||||
|
Result InitializeApplicationInfoBase();
|
||||||
|
void StoreSaveDataThumbnail(HLERequestContext& ctx, const Common::UUID& uuid,
|
||||||
|
const u64 tid);
|
||||||
|
|
||||||
|
enum class ApplicationType : u32_le {
|
||||||
|
GameCard = 0,
|
||||||
|
Digital = 1,
|
||||||
|
Unknown = 3,
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ApplicationInfo {
|
||||||
|
Service::Glue::ApplicationLaunchProperty launch_property;
|
||||||
|
ApplicationType application_type;
|
||||||
|
|
||||||
|
constexpr explicit operator bool() const {
|
||||||
|
return launch_property.title_id != 0x0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
ApplicationInfo application_info{};
|
||||||
|
|
||||||
|
protected:
|
||||||
|
std::shared_ptr<Module> module;
|
||||||
|
std::shared_ptr<ProfileManager> profile_manager;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
void LoopProcess(Core::System& system);
|
void LoopProcess(Core::System& system);
|
||||||
|
|
||||||
} // namespace Service::Account
|
} // namespace Service::Account
|
||||||
|
|||||||
@@ -12,6 +12,17 @@
|
|||||||
namespace Service::Account {
|
namespace Service::Account {
|
||||||
IAsyncContext::IAsyncContext(Core::System& system_)
|
IAsyncContext::IAsyncContext(Core::System& system_)
|
||||||
: ServiceFramework{system_, "IAsyncContext"}, service_context{system_, "IAsyncContext"} {
|
: ServiceFramework{system_, "IAsyncContext"}, service_context{system_, "IAsyncContext"} {
|
||||||
|
// clang-format off
|
||||||
|
static const FunctionInfo functions[] = {
|
||||||
|
{0, &IAsyncContext::GetSystemEvent, "GetSystemEvent"},
|
||||||
|
{1, &IAsyncContext::Cancel, "Cancel"},
|
||||||
|
{2, &IAsyncContext::HasDone, "HasDone"},
|
||||||
|
{3, &IAsyncContext::GetResult, "GetResult"},
|
||||||
|
};
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
|
RegisterHandlers(functions);
|
||||||
|
|
||||||
completion_event = service_context.CreateEvent("IAsyncContext:CompletionEvent");
|
completion_event = service_context.CreateEvent("IAsyncContext:CompletionEvent");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
|
|
||||||
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
@@ -33,16 +30,6 @@ protected:
|
|||||||
|
|
||||||
void MarkComplete();
|
void MarkComplete();
|
||||||
|
|
||||||
std::optional<FunctionInfoBase> FindRequest(u32 key) override {
|
|
||||||
return HandlerTableGenerateWithFind(key, functions);
|
|
||||||
}
|
|
||||||
static constexpr auto functions = CreateStaticMap(
|
|
||||||
FunctionInfo{0, &IAsyncContext::GetSystemEvent, "GetSystemEvent"},
|
|
||||||
FunctionInfo{1, &IAsyncContext::Cancel, "Cancel"},
|
|
||||||
FunctionInfo{2, &IAsyncContext::HasDone, "HasDone"},
|
|
||||||
FunctionInfo{3, &IAsyncContext::GetResult, "GetResult"}
|
|
||||||
);
|
|
||||||
|
|
||||||
KernelHelpers::ServiceContext service_context;
|
KernelHelpers::ServiceContext service_context;
|
||||||
|
|
||||||
std::atomic<bool> is_complete{false};
|
std::atomic<bool> is_complete{false};
|
||||||
|
|||||||
+8
-1333
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,135 @@
|
|||||||
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#include "core/core.h"
|
||||||
|
#include "core/hle/service/am/applet_manager.h"
|
||||||
|
#include "core/hle/service/am/service/all_system_applet_proxies_service.h"
|
||||||
|
#include "core/hle/service/am/service/application_proxy.h"
|
||||||
|
#include "core/hle/service/am/service/library_applet_proxy.h"
|
||||||
|
#include "core/hle/service/am/service/system_applet_proxy.h"
|
||||||
|
#include "core/hle/service/am/service/overlay_applet_proxy.h"
|
||||||
|
#include "core/hle/service/am/window_system.h"
|
||||||
|
#include "core/hle/service/cmif_serialization.h"
|
||||||
|
|
||||||
|
namespace Service::AM {
|
||||||
|
|
||||||
|
IAllSystemAppletProxiesService::IAllSystemAppletProxiesService(Core::System& system_,
|
||||||
|
WindowSystem& window_system)
|
||||||
|
: ServiceFramework{system_, "appletAE"}, m_window_system{window_system} {
|
||||||
|
// clang-format off
|
||||||
|
static const FunctionInfo functions[] = {
|
||||||
|
{100, D<&IAllSystemAppletProxiesService::OpenSystemAppletProxy>, "OpenSystemAppletProxy"},
|
||||||
|
{110, D<&IAllSystemAppletProxiesService::OpenSystemAppletProxy>, "OpenSystemAppletProxyEx"},
|
||||||
|
{200, D<&IAllSystemAppletProxiesService::OpenLibraryAppletProxyOld>, "OpenLibraryAppletProxyOld"},
|
||||||
|
{201, D<&IAllSystemAppletProxiesService::OpenLibraryAppletProxy>, "OpenLibraryAppletProxy"},
|
||||||
|
{300, D<&IAllSystemAppletProxiesService::OpenOverlayAppletProxy>, "OpenOverlayAppletProxy"},
|
||||||
|
{350, D<&IAllSystemAppletProxiesService::OpenSystemApplicationProxy>, "OpenSystemApplicationProxy"},
|
||||||
|
{400, nullptr, "CreateSelfLibraryAppletCreatorForDevelop"},
|
||||||
|
{410, nullptr, "GetSystemAppletControllerForDebug"},
|
||||||
|
{450, D<&IAllSystemAppletProxiesService::GetSystemProcessCommonFunctions>, "GetSystemProcessCommonFunctions"}, // 19.0.0+
|
||||||
|
{460, D<&IAllSystemAppletProxiesService::GetAppletAlternativeFunctions>, "GetAppletAlternativeFunctions"}, // 20.0.0+
|
||||||
|
{1000, nullptr, "GetDebugFunctions"},
|
||||||
|
};
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
|
RegisterHandlers(functions);
|
||||||
|
}
|
||||||
|
|
||||||
|
IAllSystemAppletProxiesService::~IAllSystemAppletProxiesService() = default;
|
||||||
|
|
||||||
|
Result IAllSystemAppletProxiesService::OpenSystemAppletProxy(
|
||||||
|
Out<SharedPointer<ISystemAppletProxy>> out_system_applet_proxy, ClientProcessId pid,
|
||||||
|
InCopyHandle<Kernel::KProcess> process_handle) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
|
||||||
|
if (const auto applet = this->GetAppletFromProcessId(pid); applet) {
|
||||||
|
*out_system_applet_proxy = std::make_shared<ISystemAppletProxy>(
|
||||||
|
system, applet, process_handle.Get(), m_window_system);
|
||||||
|
R_SUCCEED();
|
||||||
|
} else {
|
||||||
|
UNIMPLEMENTED();
|
||||||
|
R_THROW(ResultUnknown);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Result IAllSystemAppletProxiesService::OpenLibraryAppletProxy(
|
||||||
|
Out<SharedPointer<ILibraryAppletProxy>> out_library_applet_proxy, ClientProcessId pid,
|
||||||
|
InCopyHandle<Kernel::KProcess> process_handle,
|
||||||
|
InLargeData<AppletAttribute, BufferAttr_HipcMapAlias> attribute) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
|
||||||
|
if (const auto applet = this->GetAppletFromProcessId(pid); applet) {
|
||||||
|
*out_library_applet_proxy = std::make_shared<ILibraryAppletProxy>(
|
||||||
|
system, applet, process_handle.Get(), m_window_system);
|
||||||
|
R_SUCCEED();
|
||||||
|
} else {
|
||||||
|
UNIMPLEMENTED();
|
||||||
|
R_THROW(ResultUnknown);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Result IAllSystemAppletProxiesService::OpenOverlayAppletProxy(
|
||||||
|
Out<SharedPointer<IOverlayAppletProxy>> out_overlay_applet_proxy, ClientProcessId pid,
|
||||||
|
InCopyHandle<Kernel::KProcess> process_handle) {
|
||||||
|
LOG_WARNING(Service_AM, "called");
|
||||||
|
|
||||||
|
if (const auto applet = this->GetAppletFromProcessId(pid); applet) {
|
||||||
|
*out_overlay_applet_proxy = std::make_shared<IOverlayAppletProxy>(
|
||||||
|
system, applet, process_handle.Get(), m_window_system);
|
||||||
|
R_SUCCEED();
|
||||||
|
} else {
|
||||||
|
UNIMPLEMENTED();
|
||||||
|
R_THROW(ResultUnknown);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Result IAllSystemAppletProxiesService::OpenSystemApplicationProxy(
|
||||||
|
Out<SharedPointer<IApplicationProxy>> out_system_application_proxy, ClientProcessId pid,
|
||||||
|
InCopyHandle<Kernel::KProcess> process_handle) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
|
||||||
|
if (const auto applet = this->GetAppletFromProcessId(pid); applet) {
|
||||||
|
*out_system_application_proxy = std::make_shared<IApplicationProxy>(
|
||||||
|
system, applet, process_handle.Get(), m_window_system);
|
||||||
|
R_SUCCEED();
|
||||||
|
} else {
|
||||||
|
UNIMPLEMENTED();
|
||||||
|
R_THROW(ResultUnknown);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Result IAllSystemAppletProxiesService::OpenLibraryAppletProxyOld(
|
||||||
|
Out<SharedPointer<ILibraryAppletProxy>> out_library_applet_proxy, ClientProcessId pid,
|
||||||
|
InCopyHandle<Kernel::KProcess> process_handle) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
|
||||||
|
AppletAttribute attribute{};
|
||||||
|
R_RETURN(
|
||||||
|
this->OpenLibraryAppletProxy(out_library_applet_proxy, pid, process_handle, attribute));
|
||||||
|
}
|
||||||
|
|
||||||
|
Result IAllSystemAppletProxiesService::GetSystemProcessCommonFunctions() {
|
||||||
|
LOG_DEBUG(Service_AM, "(STUBBED) called.");
|
||||||
|
|
||||||
|
// TODO (jarrodnorwell)
|
||||||
|
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result IAllSystemAppletProxiesService::GetAppletAlternativeFunctions() {
|
||||||
|
LOG_DEBUG(Service_AM, "(STUBBED) called.");
|
||||||
|
|
||||||
|
// TODO (maufeat)
|
||||||
|
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<Applet> IAllSystemAppletProxiesService::GetAppletFromProcessId(
|
||||||
|
ProcessId process_id) {
|
||||||
|
return m_window_system.GetByAppletResourceUserId(process_id.pid);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace Service::AM
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "core/hle/service/cmif_types.h"
|
||||||
|
#include "core/hle/service/service.h"
|
||||||
|
#include "core/hle/service/am/service/overlay_applet_proxy.h"
|
||||||
|
|
||||||
|
namespace Service {
|
||||||
|
|
||||||
|
namespace AM {
|
||||||
|
|
||||||
|
struct Applet;
|
||||||
|
struct AppletAttribute;
|
||||||
|
class IApplicationProxy;
|
||||||
|
class ILibraryAppletProxy;
|
||||||
|
class ISystemAppletProxy;
|
||||||
|
class WindowSystem;
|
||||||
|
|
||||||
|
class IAllSystemAppletProxiesService final
|
||||||
|
: public ServiceFramework<IAllSystemAppletProxiesService> {
|
||||||
|
public:
|
||||||
|
explicit IAllSystemAppletProxiesService(Core::System& system_, WindowSystem& window_system);
|
||||||
|
~IAllSystemAppletProxiesService() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
Result OpenSystemAppletProxy(Out<SharedPointer<ISystemAppletProxy>> out_system_applet_proxy,
|
||||||
|
ClientProcessId pid,
|
||||||
|
InCopyHandle<Kernel::KProcess> process_handle);
|
||||||
|
Result OpenLibraryAppletProxy(Out<SharedPointer<ILibraryAppletProxy>> out_library_applet_proxy,
|
||||||
|
ClientProcessId pid,
|
||||||
|
InCopyHandle<Kernel::KProcess> process_handle,
|
||||||
|
InLargeData<AppletAttribute, BufferAttr_HipcMapAlias> attribute);
|
||||||
|
Result OpenOverlayAppletProxy(Out<SharedPointer<IOverlayAppletProxy>> out_overlay_applet_proxy,
|
||||||
|
ClientProcessId pid, InCopyHandle<Kernel::KProcess> process_handle);
|
||||||
|
Result OpenLibraryAppletProxyOld(
|
||||||
|
Out<SharedPointer<ILibraryAppletProxy>> out_library_applet_proxy, ClientProcessId pid,
|
||||||
|
InCopyHandle<Kernel::KProcess> process_handle);
|
||||||
|
Result OpenSystemApplicationProxy(
|
||||||
|
Out<SharedPointer<IApplicationProxy>> out_system_application_proxy, ClientProcessId pid,
|
||||||
|
InCopyHandle<Kernel::KProcess> process_handle);
|
||||||
|
Result GetSystemProcessCommonFunctions();
|
||||||
|
Result GetAppletAlternativeFunctions();
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::shared_ptr<Applet> GetAppletFromProcessId(ProcessId pid);
|
||||||
|
|
||||||
|
WindowSystem& m_window_system;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace AM
|
||||||
|
} // namespace Service
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#include "core/core.h"
|
||||||
|
#include "core/file_sys/common_funcs.h"
|
||||||
|
#include "core/hle/service/am/applet.h"
|
||||||
|
#include "core/hle/service/am/service/applet_common_functions.h"
|
||||||
|
#include "core/hle/service/cmif_serialization.h"
|
||||||
|
|
||||||
|
namespace Service::AM {
|
||||||
|
|
||||||
|
IAppletCommonFunctions::IAppletCommonFunctions(Core::System& system_,
|
||||||
|
std::shared_ptr<Applet> applet_)
|
||||||
|
: ServiceFramework{system_, "IAppletCommonFunctions"}, applet{std::move(applet_)} {
|
||||||
|
// clang-format off
|
||||||
|
static const FunctionInfo functions[] = {
|
||||||
|
{0, nullptr, "SetTerminateResult"},
|
||||||
|
{10, nullptr, "ReadThemeStorage"},
|
||||||
|
{11, nullptr, "WriteThemeStorage"},
|
||||||
|
{20, nullptr, "PushToAppletBoundChannel"},
|
||||||
|
{21, nullptr, "TryPopFromAppletBoundChannel"},
|
||||||
|
{40, nullptr, "GetDisplayLogicalResolution"},
|
||||||
|
{42, D<&IAppletCommonFunctions::SetDisplayMagnification>, "SetDisplayMagnification"},
|
||||||
|
{50, D<&IAppletCommonFunctions::SetHomeButtonDoubleClickEnabled>, "SetHomeButtonDoubleClickEnabled"},
|
||||||
|
{51, D<&IAppletCommonFunctions::GetHomeButtonDoubleClickEnabled>, "GetHomeButtonDoubleClickEnabled"},
|
||||||
|
{52, nullptr, "IsHomeButtonShortPressedBlocked"},
|
||||||
|
{60, nullptr, "IsVrModeCurtainRequired"},
|
||||||
|
{61, nullptr, "IsSleepRequiredByHighTemperature"},
|
||||||
|
{62, nullptr, "IsSleepRequiredByLowBattery"},
|
||||||
|
{70, D<&IAppletCommonFunctions::SetCpuBoostRequestPriority>, "SetCpuBoostRequestPriority"},
|
||||||
|
{80, nullptr, "SetHandlingCaptureButtonShortPressedMessageEnabledForApplet"},
|
||||||
|
{81, nullptr, "SetHandlingCaptureButtonLongPressedMessageEnabledForApplet"},
|
||||||
|
{90, nullptr, "OpenNamedChannelAsParent"},
|
||||||
|
{91, nullptr, "OpenNamedChannelAsChild"},
|
||||||
|
{100, nullptr, "SetApplicationCoreUsageMode"},
|
||||||
|
{300, D<&IAppletCommonFunctions::GetCurrentApplicationId>, "GetCurrentApplicationId"},
|
||||||
|
{310, nullptr, "IsSystemAppletHomeMenu"}, //19.0.0+
|
||||||
|
{320, D<&IAppletCommonFunctions::SetGpuTimeSliceBoost>, "SetGpuTimeSliceBoost"}, //19.0.0+
|
||||||
|
{321, nullptr, "SetGpuTimeSliceBoostDueToApplication"}, //19.0.0+
|
||||||
|
{350, D<&IAppletCommonFunctions::Unknown350>, "Unknown350"} //20.0.0+
|
||||||
|
};
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
|
RegisterHandlers(functions);
|
||||||
|
}
|
||||||
|
|
||||||
|
IAppletCommonFunctions::~IAppletCommonFunctions() = default;
|
||||||
|
|
||||||
|
Result IAppletCommonFunctions::SetHomeButtonDoubleClickEnabled(
|
||||||
|
bool home_button_double_click_enabled) {
|
||||||
|
LOG_WARNING(Service_AM, "(STUBBED) called, home_button_double_click_enabled={}",
|
||||||
|
home_button_double_click_enabled);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result IAppletCommonFunctions::GetHomeButtonDoubleClickEnabled(
|
||||||
|
Out<bool> out_home_button_double_click_enabled) {
|
||||||
|
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||||
|
*out_home_button_double_click_enabled = false;
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result IAppletCommonFunctions::SetDisplayMagnification(f32 x, f32 y, f32 width, f32 height) {
|
||||||
|
LOG_DEBUG(Service_AM, "(STUBBED) called, x={}, y={}, width={}, height={}", x, y, width,
|
||||||
|
height);
|
||||||
|
std::scoped_lock lk{applet->lock};
|
||||||
|
applet->display_magnification = Common::Rectangle<f32>{x, y, x + width, y + height};
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result IAppletCommonFunctions::SetCpuBoostRequestPriority(s32 priority) {
|
||||||
|
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||||
|
std::scoped_lock lk{applet->lock};
|
||||||
|
applet->cpu_boost_request_priority = priority;
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result IAppletCommonFunctions::GetCurrentApplicationId(Out<u64> out_application_id) {
|
||||||
|
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||||
|
*out_application_id = FileSys::GetBaseTitleID(system.GetApplicationProcessProgramID());
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result IAppletCommonFunctions::SetGpuTimeSliceBoost(s64 time_span) {
|
||||||
|
LOG_WARNING(Service_AM, "(STUBBED) called, time_span={}", time_span);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result IAppletCommonFunctions::Unknown350(Out<u16> out_unknown) {
|
||||||
|
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||||
|
*out_unknown = 0;
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace Service::AM
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "core/hle/service/cmif_types.h"
|
||||||
|
#include "core/hle/service/service.h"
|
||||||
|
|
||||||
|
namespace Service::AM {
|
||||||
|
|
||||||
|
struct Applet;
|
||||||
|
|
||||||
|
class IAppletCommonFunctions final : public ServiceFramework<IAppletCommonFunctions> {
|
||||||
|
public:
|
||||||
|
explicit IAppletCommonFunctions(Core::System& system_, std::shared_ptr<Applet> applet_);
|
||||||
|
~IAppletCommonFunctions() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
Result SetHomeButtonDoubleClickEnabled(bool home_button_double_click_enabled);
|
||||||
|
Result GetHomeButtonDoubleClickEnabled(Out<bool> out_home_button_double_click_enabled);
|
||||||
|
Result SetDisplayMagnification(f32 x, f32 y, f32 width, f32 height);
|
||||||
|
Result SetCpuBoostRequestPriority(s32 priority);
|
||||||
|
Result GetCurrentApplicationId(Out<u64> out_application_id);
|
||||||
|
Result SetGpuTimeSliceBoost(s64 time_span);
|
||||||
|
Result Unknown350(Out<u16> out_unknown);
|
||||||
|
|
||||||
|
const std::shared_ptr<Applet> applet;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Service::AM
|
||||||
@@ -18,42 +18,42 @@
|
|||||||
|
|
||||||
namespace Service::AM {
|
namespace Service::AM {
|
||||||
|
|
||||||
std::optional<ServiceFrameworkBase::FunctionInfoBase> IApplicationAccessor::FindRequest(u32 key) {
|
|
||||||
static constexpr auto functions = CreateStaticMap(
|
|
||||||
FunctionInfo{0, D<&IApplicationAccessor::GetAppletStateChangedEvent>, "GetAppletStateChangedEvent"},
|
|
||||||
FunctionInfo{1, nullptr, "IsCompleted"},
|
|
||||||
FunctionInfo{10, D<&IApplicationAccessor::Start>, "Start"},
|
|
||||||
FunctionInfo{20, D<&IApplicationAccessor::RequestExit>, "RequestExit"},
|
|
||||||
FunctionInfo{25, D<&IApplicationAccessor::Terminate>, "Terminate"},
|
|
||||||
FunctionInfo{30, D<&IApplicationAccessor::GetResult>, "GetResult"},
|
|
||||||
FunctionInfo{101, D<&IApplicationAccessor::RequestForApplicationToGetForeground>, "RequestForApplicationToGetForeground"},
|
|
||||||
FunctionInfo{110, nullptr, "TerminateAllLibraryApplets"},
|
|
||||||
FunctionInfo{111, nullptr, "AreAnyLibraryAppletsLeft"},
|
|
||||||
FunctionInfo{112, D<&IApplicationAccessor::GetCurrentLibraryApplet>, "GetCurrentLibraryApplet"},
|
|
||||||
FunctionInfo{120, nullptr, "GetApplicationId"},
|
|
||||||
FunctionInfo{121, D<&IApplicationAccessor::PushLaunchParameter>, "PushLaunchParameter"},
|
|
||||||
FunctionInfo{122, D<&IApplicationAccessor::GetApplicationControlProperty>, "GetApplicationControlProperty"},
|
|
||||||
FunctionInfo{123, nullptr, "GetApplicationLaunchProperty"},
|
|
||||||
FunctionInfo{124, nullptr, "GetApplicationLaunchRequestInfo"},
|
|
||||||
FunctionInfo{130, D<&IApplicationAccessor::SetUsers>, "SetUsers"},
|
|
||||||
FunctionInfo{131, D<&IApplicationAccessor::CheckRightsEnvironmentAvailable>, "CheckRightsEnvironmentAvailable"},
|
|
||||||
FunctionInfo{132, D<&IApplicationAccessor::GetNsRightsEnvironmentHandle>, "GetNsRightsEnvironmentHandle"},
|
|
||||||
FunctionInfo{140, nullptr, "GetDesirableUids"},
|
|
||||||
FunctionInfo{150, D<&IApplicationAccessor::ReportApplicationExitTimeout>, "ReportApplicationExitTimeout"},
|
|
||||||
FunctionInfo{160, nullptr, "SetApplicationAttribute"},
|
|
||||||
FunctionInfo{170, nullptr, "HasSaveDataAccessPermission"},
|
|
||||||
FunctionInfo{180, nullptr, "PushToFriendInvitationStorageChannel"},
|
|
||||||
FunctionInfo{190, nullptr, "PushToNotificationStorageChannel"},
|
|
||||||
FunctionInfo{200, nullptr, "RequestApplicationSoftReset"},
|
|
||||||
FunctionInfo{201, nullptr, "RestartApplicationTimer"}
|
|
||||||
);
|
|
||||||
return HandlerTableGenerateWithFind(key, functions);
|
|
||||||
}
|
|
||||||
|
|
||||||
IApplicationAccessor::IApplicationAccessor(Core::System& system_, std::shared_ptr<Applet> applet,
|
IApplicationAccessor::IApplicationAccessor(Core::System& system_, std::shared_ptr<Applet> applet,
|
||||||
WindowSystem& window_system)
|
WindowSystem& window_system)
|
||||||
: ServiceFramework{system_, "IApplicationAccessor"}, m_window_system(window_system),
|
: ServiceFramework{system_, "IApplicationAccessor"}, m_window_system(window_system),
|
||||||
m_applet(std::move(applet)) {
|
m_applet(std::move(applet)) {
|
||||||
|
// clang-format off
|
||||||
|
static const FunctionInfo functions[] = {
|
||||||
|
{0, D<&IApplicationAccessor::GetAppletStateChangedEvent>, "GetAppletStateChangedEvent"},
|
||||||
|
{1, nullptr, "IsCompleted"},
|
||||||
|
{10, D<&IApplicationAccessor::Start>, "Start"},
|
||||||
|
{20, D<&IApplicationAccessor::RequestExit>, "RequestExit"},
|
||||||
|
{25, D<&IApplicationAccessor::Terminate>, "Terminate"},
|
||||||
|
{30, D<&IApplicationAccessor::GetResult>, "GetResult"},
|
||||||
|
{101, D<&IApplicationAccessor::RequestForApplicationToGetForeground>, "RequestForApplicationToGetForeground"},
|
||||||
|
{110, nullptr, "TerminateAllLibraryApplets"},
|
||||||
|
{111, nullptr, "AreAnyLibraryAppletsLeft"},
|
||||||
|
{112, D<&IApplicationAccessor::GetCurrentLibraryApplet>, "GetCurrentLibraryApplet"},
|
||||||
|
{120, nullptr, "GetApplicationId"},
|
||||||
|
{121, D<&IApplicationAccessor::PushLaunchParameter>, "PushLaunchParameter"},
|
||||||
|
{122, D<&IApplicationAccessor::GetApplicationControlProperty>, "GetApplicationControlProperty"},
|
||||||
|
{123, nullptr, "GetApplicationLaunchProperty"},
|
||||||
|
{124, nullptr, "GetApplicationLaunchRequestInfo"},
|
||||||
|
{130, D<&IApplicationAccessor::SetUsers>, "SetUsers"},
|
||||||
|
{131, D<&IApplicationAccessor::CheckRightsEnvironmentAvailable>, "CheckRightsEnvironmentAvailable"},
|
||||||
|
{132, D<&IApplicationAccessor::GetNsRightsEnvironmentHandle>, "GetNsRightsEnvironmentHandle"},
|
||||||
|
{140, nullptr, "GetDesirableUids"},
|
||||||
|
{150, D<&IApplicationAccessor::ReportApplicationExitTimeout>, "ReportApplicationExitTimeout"},
|
||||||
|
{160, nullptr, "SetApplicationAttribute"},
|
||||||
|
{170, nullptr, "HasSaveDataAccessPermission"},
|
||||||
|
{180, nullptr, "PushToFriendInvitationStorageChannel"},
|
||||||
|
{190, nullptr, "PushToNotificationStorageChannel"},
|
||||||
|
{200, nullptr, "RequestApplicationSoftReset"},
|
||||||
|
{201, nullptr, "RestartApplicationTimer"},
|
||||||
|
};
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
|
RegisterHandlers(functions);
|
||||||
}
|
}
|
||||||
|
|
||||||
IApplicationAccessor::~IApplicationAccessor() = default;
|
IApplicationAccessor::~IApplicationAccessor() = default;
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
|
|
||||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
@@ -39,7 +36,6 @@ private:
|
|||||||
Result GetNsRightsEnvironmentHandle(Out<u64> out_handle);
|
Result GetNsRightsEnvironmentHandle(Out<u64> out_handle);
|
||||||
Result ReportApplicationExitTimeout();
|
Result ReportApplicationExitTimeout();
|
||||||
|
|
||||||
std::optional<FunctionInfoBase> FindRequest(u32 key) override;
|
|
||||||
WindowSystem& m_window_system;
|
WindowSystem& m_window_system;
|
||||||
const std::shared_ptr<Applet> m_applet;
|
const std::shared_ptr<Applet> m_applet;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -20,16 +20,6 @@
|
|||||||
|
|
||||||
namespace Service::AM {
|
namespace Service::AM {
|
||||||
|
|
||||||
std::optional<ServiceFrameworkBase::FunctionInfoBase> IApplicationCreator::FindRequest(u32 key) {
|
|
||||||
static constexpr auto functions = CreateStaticMap(
|
|
||||||
FunctionInfo{0, D<&IApplicationCreator::CreateApplication>, "CreateApplication"},
|
|
||||||
FunctionInfo{1, nullptr, "PopLaunchRequestedApplication"},
|
|
||||||
FunctionInfo{10, D<&IApplicationCreator::CreateSystemApplication>, "CreateSystemApplication"},
|
|
||||||
FunctionInfo{100, nullptr, "PopFloatingApplicationForDevelopment"}
|
|
||||||
);
|
|
||||||
return HandlerTableGenerateWithFind(key, functions);
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
Result CreateGuestApplication(SharedPointer<IApplicationAccessor>* out_application_accessor, Core::System& system, WindowSystem& window_system, u64 program_id) {
|
Result CreateGuestApplication(SharedPointer<IApplicationAccessor>* out_application_accessor, Core::System& system, WindowSystem& window_system, u64 program_id) {
|
||||||
@@ -64,6 +54,16 @@ Result CreateGuestApplication(SharedPointer<IApplicationAccessor>* out_applicati
|
|||||||
|
|
||||||
IApplicationCreator::IApplicationCreator(Core::System& system_, WindowSystem& window_system)
|
IApplicationCreator::IApplicationCreator(Core::System& system_, WindowSystem& window_system)
|
||||||
: ServiceFramework{system_, "IApplicationCreator"}, m_window_system{window_system} {
|
: ServiceFramework{system_, "IApplicationCreator"}, m_window_system{window_system} {
|
||||||
|
// clang-format off
|
||||||
|
static const FunctionInfo functions[] = {
|
||||||
|
{0, D<&IApplicationCreator::CreateApplication>, "CreateApplication"},
|
||||||
|
{1, nullptr, "PopLaunchRequestedApplication"},
|
||||||
|
{10, D<&IApplicationCreator::CreateSystemApplication>, "CreateSystemApplication"},
|
||||||
|
{100, nullptr, "PopFloatingApplicationForDevelopment"},
|
||||||
|
};
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
|
RegisterHandlers(functions);
|
||||||
}
|
}
|
||||||
|
|
||||||
IApplicationCreator::~IApplicationCreator() = default;
|
IApplicationCreator::~IApplicationCreator() = default;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
@@ -24,7 +24,6 @@ private:
|
|||||||
Result CreateApplication(Out<SharedPointer<IApplicationAccessor>>, u64 application_id);
|
Result CreateApplication(Out<SharedPointer<IApplicationAccessor>>, u64 application_id);
|
||||||
Result CreateSystemApplication(Out<SharedPointer<IApplicationAccessor>>, u64 application_id);
|
Result CreateSystemApplication(Out<SharedPointer<IApplicationAccessor>>, u64 application_id);
|
||||||
|
|
||||||
std::optional<FunctionInfoBase> FindRequest(u32 key) override;
|
|
||||||
WindowSystem& m_window_system;
|
WindowSystem& m_window_system;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -51,84 +51,83 @@ FileSys::PatchManager::Metadata GetApplicationMetadata(Core::System& system, u64
|
|||||||
|
|
||||||
} // Anonymous namespace
|
} // Anonymous namespace
|
||||||
|
|
||||||
std::optional<ServiceFrameworkBase::FunctionInfoBase> IApplicationFunctions::FindRequest(u32 key) {
|
|
||||||
static constexpr auto functions = CreateStaticMap(
|
|
||||||
FunctionInfo{1, D<&IApplicationFunctions::PopLaunchParameter>, "PopLaunchParameter"},
|
|
||||||
FunctionInfo{10, nullptr, "CreateApplicationAndPushAndRequestToStart"},
|
|
||||||
FunctionInfo{11, nullptr, "CreateApplicationAndPushAndRequestToStartForQuest"},
|
|
||||||
FunctionInfo{12, D<&IApplicationFunctions::CreateApplicationAndRequestToStart>, "CreateApplicationAndRequestToStart"},
|
|
||||||
FunctionInfo{13, nullptr, "CreateApplicationAndRequestToStartForQuest"},
|
|
||||||
FunctionInfo{14, nullptr, "CreateApplicationWithAttributeAndPushAndRequestToStartForQuest"},
|
|
||||||
FunctionInfo{15, nullptr, "CreateApplicationWithAttributeAndRequestToStartForQuest"},
|
|
||||||
FunctionInfo{20, D<&IApplicationFunctions::EnsureSaveData>, "EnsureSaveData"},
|
|
||||||
FunctionInfo{21, D<&IApplicationFunctions::GetDesiredLanguage>, "GetDesiredLanguage"},
|
|
||||||
FunctionInfo{22, D<&IApplicationFunctions::SetTerminateResult>, "SetTerminateResult"},
|
|
||||||
FunctionInfo{23, D<&IApplicationFunctions::GetDisplayVersion>, "GetDisplayVersion"},
|
|
||||||
FunctionInfo{24, nullptr, "GetLaunchStorageInfoForDebug"},
|
|
||||||
FunctionInfo{25, D<&IApplicationFunctions::ExtendSaveData>, "ExtendSaveData"},
|
|
||||||
FunctionInfo{26, D<&IApplicationFunctions::GetSaveDataSize>, "GetSaveDataSize"},
|
|
||||||
FunctionInfo{27, D<&IApplicationFunctions::CreateCacheStorage>, "CreateCacheStorage"},
|
|
||||||
FunctionInfo{28, D<&IApplicationFunctions::GetSaveDataSizeMax>, "GetSaveDataSizeMax"},
|
|
||||||
FunctionInfo{29, D<&IApplicationFunctions::GetCacheStorageMax>, "GetCacheStorageMax"},
|
|
||||||
FunctionInfo{30, D<&IApplicationFunctions::BeginBlockingHomeButtonShortAndLongPressed>, "BeginBlockingHomeButtonShortAndLongPressed"},
|
|
||||||
FunctionInfo{31, D<&IApplicationFunctions::EndBlockingHomeButtonShortAndLongPressed>, "EndBlockingHomeButtonShortAndLongPressed"},
|
|
||||||
FunctionInfo{32, D<&IApplicationFunctions::BeginBlockingHomeButton>, "BeginBlockingHomeButton"},
|
|
||||||
FunctionInfo{33, D<&IApplicationFunctions::EndBlockingHomeButton>, "EndBlockingHomeButton"},
|
|
||||||
FunctionInfo{34, nullptr, "SelectApplicationLicense"},
|
|
||||||
FunctionInfo{35, nullptr, "GetDeviceSaveDataSizeMax"},
|
|
||||||
FunctionInfo{36, nullptr, "GetLimitedApplicationLicense"},
|
|
||||||
FunctionInfo{37, nullptr, "GetLimitedApplicationLicenseUpgradableEvent"},
|
|
||||||
FunctionInfo{40, D<&IApplicationFunctions::NotifyRunning>, "NotifyRunning"},
|
|
||||||
FunctionInfo{50, D<&IApplicationFunctions::GetPseudoDeviceId>, "GetPseudoDeviceId"},
|
|
||||||
FunctionInfo{60, D<&IApplicationFunctions::SetMediaPlaybackStateForApplication>, "SetMediaPlaybackStateForApplication"},
|
|
||||||
FunctionInfo{65, D<&IApplicationFunctions::IsGamePlayRecordingSupported>, "IsGamePlayRecordingSupported"},
|
|
||||||
FunctionInfo{66, D<&IApplicationFunctions::InitializeGamePlayRecording>, "InitializeGamePlayRecording"},
|
|
||||||
FunctionInfo{67, D<&IApplicationFunctions::SetGamePlayRecordingState>, "SetGamePlayRecordingState"},
|
|
||||||
FunctionInfo{68, nullptr, "RequestFlushGamePlayingMovieForDebug"},
|
|
||||||
FunctionInfo{70, nullptr, "RequestToShutdown"},
|
|
||||||
FunctionInfo{71, nullptr, "RequestToReboot"},
|
|
||||||
FunctionInfo{72, nullptr, "RequestToSleep"},
|
|
||||||
FunctionInfo{80, nullptr, "ExitAndRequestToShowThanksMessage"},
|
|
||||||
FunctionInfo{90, D<&IApplicationFunctions::EnableApplicationCrashReport>, "EnableApplicationCrashReport"},
|
|
||||||
FunctionInfo{100, D<&IApplicationFunctions::InitializeApplicationCopyrightFrameBuffer>, "InitializeApplicationCopyrightFrameBuffer"},
|
|
||||||
FunctionInfo{101, D<&IApplicationFunctions::SetApplicationCopyrightImage>, "SetApplicationCopyrightImage"},
|
|
||||||
FunctionInfo{102, D<&IApplicationFunctions::SetApplicationCopyrightVisibility>, "SetApplicationCopyrightVisibility"},
|
|
||||||
FunctionInfo{110, D<&IApplicationFunctions::QueryApplicationPlayStatistics>, "QueryApplicationPlayStatistics"},
|
|
||||||
FunctionInfo{111, D<&IApplicationFunctions::QueryApplicationPlayStatisticsByUid>, "QueryApplicationPlayStatisticsByUid"},
|
|
||||||
FunctionInfo{120, D<&IApplicationFunctions::ExecuteProgram>, "ExecuteProgram"},
|
|
||||||
FunctionInfo{121, D<&IApplicationFunctions::ClearUserChannel>, "ClearUserChannel"},
|
|
||||||
FunctionInfo{122, D<&IApplicationFunctions::UnpopToUserChannel>, "UnpopToUserChannel"},
|
|
||||||
FunctionInfo{123, D<&IApplicationFunctions::GetPreviousProgramIndex>, "GetPreviousProgramIndex"},
|
|
||||||
FunctionInfo{124, nullptr, "EnableApplicationAllThreadDumpOnCrash"},
|
|
||||||
FunctionInfo{130, D<&IApplicationFunctions::GetGpuErrorDetectedSystemEvent>, "GetGpuErrorDetectedSystemEvent"},
|
|
||||||
FunctionInfo{131, nullptr, "SetDelayTimeToAbortOnGpuError"},
|
|
||||||
FunctionInfo{140, D<&IApplicationFunctions::GetFriendInvitationStorageChannelEvent>, "GetFriendInvitationStorageChannelEvent"},
|
|
||||||
FunctionInfo{141, D<&IApplicationFunctions::TryPopFromFriendInvitationStorageChannel>, "TryPopFromFriendInvitationStorageChannel"},
|
|
||||||
FunctionInfo{150, D<&IApplicationFunctions::GetNotificationStorageChannelEvent>, "GetNotificationStorageChannelEvent"},
|
|
||||||
FunctionInfo{151, nullptr, "TryPopFromNotificationStorageChannel"},
|
|
||||||
FunctionInfo{160, D<&IApplicationFunctions::GetHealthWarningDisappearedSystemEvent>, "GetHealthWarningDisappearedSystemEvent"},
|
|
||||||
FunctionInfo{170, nullptr, "SetHdcpAuthenticationActivated"},
|
|
||||||
FunctionInfo{180, nullptr, "GetLaunchRequiredVersion"},
|
|
||||||
FunctionInfo{181, nullptr, "UpgradeLaunchRequiredVersion"},
|
|
||||||
FunctionInfo{190, nullptr, "SendServerMaintenanceOverlayNotification"},
|
|
||||||
FunctionInfo{200, nullptr, "GetLastApplicationExitReason"},
|
|
||||||
FunctionInfo{210, D<&IApplicationFunctions::GetUnknownEvent210>, "Unknown210"},
|
|
||||||
FunctionInfo{220, nullptr, "Unknown220"}, // [20.0.0+]
|
|
||||||
FunctionInfo{300, nullptr, "CreateMovieWriter"}, // [19.0.0+]
|
|
||||||
FunctionInfo{310, nullptr, "Unknown310"}, // [20.0.0+]
|
|
||||||
FunctionInfo{320, nullptr, "Unknown320"}, // [20.0.0+]
|
|
||||||
FunctionInfo{330, D<&IApplicationFunctions::Unknown330>, "Unknown330"}, // [20.0.0+]
|
|
||||||
FunctionInfo{500, nullptr, "StartContinuousRecordingFlushForDebug"},
|
|
||||||
FunctionInfo{1000, nullptr, "CreateMovieMaker"},
|
|
||||||
FunctionInfo{1001, D<&IApplicationFunctions::PrepareForJit>, "PrepareForJit"}
|
|
||||||
);
|
|
||||||
return HandlerTableGenerateWithFind(key, functions);
|
|
||||||
}
|
|
||||||
|
|
||||||
IApplicationFunctions::IApplicationFunctions(Core::System& system_, std::shared_ptr<Applet> applet)
|
IApplicationFunctions::IApplicationFunctions(Core::System& system_, std::shared_ptr<Applet> applet)
|
||||||
: ServiceFramework{system_, "IApplicationFunctions"}
|
: ServiceFramework{system_, "IApplicationFunctions"}, m_applet{std::move(applet)} {
|
||||||
, m_applet{std::move(applet)}
|
// clang-format off
|
||||||
{}
|
static const FunctionInfo functions[] = {
|
||||||
|
{1, D<&IApplicationFunctions::PopLaunchParameter>, "PopLaunchParameter"},
|
||||||
|
{10, nullptr, "CreateApplicationAndPushAndRequestToStart"},
|
||||||
|
{11, nullptr, "CreateApplicationAndPushAndRequestToStartForQuest"},
|
||||||
|
{12, D<&IApplicationFunctions::CreateApplicationAndRequestToStart>, "CreateApplicationAndRequestToStart"},
|
||||||
|
{13, nullptr, "CreateApplicationAndRequestToStartForQuest"},
|
||||||
|
{14, nullptr, "CreateApplicationWithAttributeAndPushAndRequestToStartForQuest"},
|
||||||
|
{15, nullptr, "CreateApplicationWithAttributeAndRequestToStartForQuest"},
|
||||||
|
{20, D<&IApplicationFunctions::EnsureSaveData>, "EnsureSaveData"},
|
||||||
|
{21, D<&IApplicationFunctions::GetDesiredLanguage>, "GetDesiredLanguage"},
|
||||||
|
{22, D<&IApplicationFunctions::SetTerminateResult>, "SetTerminateResult"},
|
||||||
|
{23, D<&IApplicationFunctions::GetDisplayVersion>, "GetDisplayVersion"},
|
||||||
|
{24, nullptr, "GetLaunchStorageInfoForDebug"},
|
||||||
|
{25, D<&IApplicationFunctions::ExtendSaveData>, "ExtendSaveData"},
|
||||||
|
{26, D<&IApplicationFunctions::GetSaveDataSize>, "GetSaveDataSize"},
|
||||||
|
{27, D<&IApplicationFunctions::CreateCacheStorage>, "CreateCacheStorage"},
|
||||||
|
{28, D<&IApplicationFunctions::GetSaveDataSizeMax>, "GetSaveDataSizeMax"},
|
||||||
|
{29, D<&IApplicationFunctions::GetCacheStorageMax>, "GetCacheStorageMax"},
|
||||||
|
{30, D<&IApplicationFunctions::BeginBlockingHomeButtonShortAndLongPressed>, "BeginBlockingHomeButtonShortAndLongPressed"},
|
||||||
|
{31, D<&IApplicationFunctions::EndBlockingHomeButtonShortAndLongPressed>, "EndBlockingHomeButtonShortAndLongPressed"},
|
||||||
|
{32, D<&IApplicationFunctions::BeginBlockingHomeButton>, "BeginBlockingHomeButton"},
|
||||||
|
{33, D<&IApplicationFunctions::EndBlockingHomeButton>, "EndBlockingHomeButton"},
|
||||||
|
{34, nullptr, "SelectApplicationLicense"},
|
||||||
|
{35, nullptr, "GetDeviceSaveDataSizeMax"},
|
||||||
|
{36, nullptr, "GetLimitedApplicationLicense"},
|
||||||
|
{37, nullptr, "GetLimitedApplicationLicenseUpgradableEvent"},
|
||||||
|
{40, D<&IApplicationFunctions::NotifyRunning>, "NotifyRunning"},
|
||||||
|
{50, D<&IApplicationFunctions::GetPseudoDeviceId>, "GetPseudoDeviceId"},
|
||||||
|
{60, D<&IApplicationFunctions::SetMediaPlaybackStateForApplication>, "SetMediaPlaybackStateForApplication"},
|
||||||
|
{65, D<&IApplicationFunctions::IsGamePlayRecordingSupported>, "IsGamePlayRecordingSupported"},
|
||||||
|
{66, D<&IApplicationFunctions::InitializeGamePlayRecording>, "InitializeGamePlayRecording"},
|
||||||
|
{67, D<&IApplicationFunctions::SetGamePlayRecordingState>, "SetGamePlayRecordingState"},
|
||||||
|
{68, nullptr, "RequestFlushGamePlayingMovieForDebug"},
|
||||||
|
{70, nullptr, "RequestToShutdown"},
|
||||||
|
{71, nullptr, "RequestToReboot"},
|
||||||
|
{72, nullptr, "RequestToSleep"},
|
||||||
|
{80, nullptr, "ExitAndRequestToShowThanksMessage"},
|
||||||
|
{90, D<&IApplicationFunctions::EnableApplicationCrashReport>, "EnableApplicationCrashReport"},
|
||||||
|
{100, D<&IApplicationFunctions::InitializeApplicationCopyrightFrameBuffer>, "InitializeApplicationCopyrightFrameBuffer"},
|
||||||
|
{101, D<&IApplicationFunctions::SetApplicationCopyrightImage>, "SetApplicationCopyrightImage"},
|
||||||
|
{102, D<&IApplicationFunctions::SetApplicationCopyrightVisibility>, "SetApplicationCopyrightVisibility"},
|
||||||
|
{110, D<&IApplicationFunctions::QueryApplicationPlayStatistics>, "QueryApplicationPlayStatistics"},
|
||||||
|
{111, D<&IApplicationFunctions::QueryApplicationPlayStatisticsByUid>, "QueryApplicationPlayStatisticsByUid"},
|
||||||
|
{120, D<&IApplicationFunctions::ExecuteProgram>, "ExecuteProgram"},
|
||||||
|
{121, D<&IApplicationFunctions::ClearUserChannel>, "ClearUserChannel"},
|
||||||
|
{122, D<&IApplicationFunctions::UnpopToUserChannel>, "UnpopToUserChannel"},
|
||||||
|
{123, D<&IApplicationFunctions::GetPreviousProgramIndex>, "GetPreviousProgramIndex"},
|
||||||
|
{124, nullptr, "EnableApplicationAllThreadDumpOnCrash"},
|
||||||
|
{130, D<&IApplicationFunctions::GetGpuErrorDetectedSystemEvent>, "GetGpuErrorDetectedSystemEvent"},
|
||||||
|
{131, nullptr, "SetDelayTimeToAbortOnGpuError"},
|
||||||
|
{140, D<&IApplicationFunctions::GetFriendInvitationStorageChannelEvent>, "GetFriendInvitationStorageChannelEvent"},
|
||||||
|
{141, D<&IApplicationFunctions::TryPopFromFriendInvitationStorageChannel>, "TryPopFromFriendInvitationStorageChannel"},
|
||||||
|
{150, D<&IApplicationFunctions::GetNotificationStorageChannelEvent>, "GetNotificationStorageChannelEvent"},
|
||||||
|
{151, nullptr, "TryPopFromNotificationStorageChannel"},
|
||||||
|
{160, D<&IApplicationFunctions::GetHealthWarningDisappearedSystemEvent>, "GetHealthWarningDisappearedSystemEvent"},
|
||||||
|
{170, nullptr, "SetHdcpAuthenticationActivated"},
|
||||||
|
{180, nullptr, "GetLaunchRequiredVersion"},
|
||||||
|
{181, nullptr, "UpgradeLaunchRequiredVersion"},
|
||||||
|
{190, nullptr, "SendServerMaintenanceOverlayNotification"},
|
||||||
|
{200, nullptr, "GetLastApplicationExitReason"},
|
||||||
|
{210, D<&IApplicationFunctions::GetUnknownEvent210>, "Unknown210"},
|
||||||
|
{220, nullptr, "Unknown220"}, // [20.0.0+]
|
||||||
|
{300, nullptr, "CreateMovieWriter"}, // [19.0.0+]
|
||||||
|
{310, nullptr, "Unknown310"}, // [20.0.0+]
|
||||||
|
{320, nullptr, "Unknown320"}, // [20.0.0+]
|
||||||
|
{330, D<&IApplicationFunctions::Unknown330>, "Unknown330"}, // [20.0.0+]
|
||||||
|
{500, nullptr, "StartContinuousRecordingFlushForDebug"},
|
||||||
|
{1000, nullptr, "CreateMovieMaker"},
|
||||||
|
{1001, D<&IApplicationFunctions::PrepareForJit>, "PrepareForJit"},
|
||||||
|
};
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
|
RegisterHandlers(functions);
|
||||||
|
}
|
||||||
|
|
||||||
IApplicationFunctions::~IApplicationFunctions() = default;
|
IApplicationFunctions::~IApplicationFunctions() = default;
|
||||||
|
|
||||||
|
|||||||
@@ -84,7 +84,6 @@ private:
|
|||||||
Result GetUnknownEvent210(OutCopyHandle<Kernel::KReadableEvent> out_event);
|
Result GetUnknownEvent210(OutCopyHandle<Kernel::KReadableEvent> out_event);
|
||||||
Result Unknown330(Out<u8> out);
|
Result Unknown330(Out<u8> out);
|
||||||
Result PrepareForJit();
|
Result PrepareForJit();
|
||||||
std::optional<FunctionInfoBase> FindRequest(u32 key) override;
|
|
||||||
|
|
||||||
const std::shared_ptr<Applet> m_applet;
|
const std::shared_ptr<Applet> m_applet;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,106 @@
|
|||||||
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#include "core/hle/service/am/service/applet_common_functions.h"
|
||||||
|
#include "core/hle/service/am/service/application_functions.h"
|
||||||
|
#include "core/hle/service/am/service/application_proxy.h"
|
||||||
|
#include "core/hle/service/am/service/audio_controller.h"
|
||||||
|
#include "core/hle/service/am/service/common_state_getter.h"
|
||||||
|
#include "core/hle/service/am/service/debug_functions.h"
|
||||||
|
#include "core/hle/service/am/service/display_controller.h"
|
||||||
|
#include "core/hle/service/am/service/library_applet_creator.h"
|
||||||
|
#include "core/hle/service/am/service/process_winding_controller.h"
|
||||||
|
#include "core/hle/service/am/service/self_controller.h"
|
||||||
|
#include "core/hle/service/am/service/window_controller.h"
|
||||||
|
#include "core/hle/service/cmif_serialization.h"
|
||||||
|
|
||||||
|
namespace Service::AM {
|
||||||
|
|
||||||
|
IApplicationProxy::IApplicationProxy(Core::System& system_, std::shared_ptr<Applet> applet,
|
||||||
|
Kernel::KProcess* process, WindowSystem& window_system)
|
||||||
|
: ServiceFramework{system_, "IApplicationProxy"},
|
||||||
|
m_window_system{window_system}, m_process{process}, m_applet{std::move(applet)} {
|
||||||
|
// clang-format off
|
||||||
|
static const FunctionInfo functions[] = {
|
||||||
|
{0, D<&IApplicationProxy::GetCommonStateGetter>, "GetCommonStateGetter"},
|
||||||
|
{1, D<&IApplicationProxy::GetSelfController>, "GetSelfController"},
|
||||||
|
{2, D<&IApplicationProxy::GetWindowController>, "GetWindowController"},
|
||||||
|
{3, D<&IApplicationProxy::GetAudioController>, "GetAudioController"},
|
||||||
|
{4, D<&IApplicationProxy::GetDisplayController>, "GetDisplayController"},
|
||||||
|
{10, D<&IApplicationProxy::GetProcessWindingController>, "GetProcessWindingController"},
|
||||||
|
{11, D<&IApplicationProxy::GetLibraryAppletCreator>, "GetLibraryAppletCreator"},
|
||||||
|
{20, D<&IApplicationProxy::GetApplicationFunctions>, "GetApplicationFunctions"},
|
||||||
|
{1000, D<&IApplicationProxy::GetDebugFunctions>, "GetDebugFunctions"},
|
||||||
|
};
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
|
RegisterHandlers(functions);
|
||||||
|
}
|
||||||
|
|
||||||
|
IApplicationProxy::~IApplicationProxy() = default;
|
||||||
|
|
||||||
|
Result IApplicationProxy::GetAudioController(
|
||||||
|
Out<SharedPointer<IAudioController>> out_audio_controller) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_audio_controller = std::make_shared<IAudioController>(system);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result IApplicationProxy::GetDisplayController(
|
||||||
|
Out<SharedPointer<IDisplayController>> out_display_controller) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_display_controller = std::make_shared<IDisplayController>(system, m_applet);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result IApplicationProxy::GetProcessWindingController(
|
||||||
|
Out<SharedPointer<IProcessWindingController>> out_process_winding_controller) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_process_winding_controller = std::make_shared<IProcessWindingController>(system, m_applet);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result IApplicationProxy::GetDebugFunctions(
|
||||||
|
Out<SharedPointer<IDebugFunctions>> out_debug_functions) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_debug_functions = std::make_shared<IDebugFunctions>(system);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result IApplicationProxy::GetWindowController(
|
||||||
|
Out<SharedPointer<IWindowController>> out_window_controller) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_window_controller = std::make_shared<IWindowController>(system, m_applet, m_window_system);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result IApplicationProxy::GetSelfController(
|
||||||
|
Out<SharedPointer<ISelfController>> out_self_controller) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_self_controller = std::make_shared<ISelfController>(system, m_applet, m_process);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result IApplicationProxy::GetCommonStateGetter(
|
||||||
|
Out<SharedPointer<ICommonStateGetter>> out_common_state_getter) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_common_state_getter = std::make_shared<ICommonStateGetter>(system, m_applet);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result IApplicationProxy::GetLibraryAppletCreator(
|
||||||
|
Out<SharedPointer<ILibraryAppletCreator>> out_library_applet_creator) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_library_applet_creator =
|
||||||
|
std::make_shared<ILibraryAppletCreator>(system, m_applet, m_window_system);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result IApplicationProxy::GetApplicationFunctions(
|
||||||
|
Out<SharedPointer<IApplicationFunctions>> out_application_functions) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_application_functions = std::make_shared<IApplicationFunctions>(system, m_applet);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace Service::AM
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "core/hle/service/cmif_types.h"
|
||||||
|
#include "core/hle/service/service.h"
|
||||||
|
|
||||||
|
namespace Service::AM {
|
||||||
|
|
||||||
|
struct Applet;
|
||||||
|
class IAudioController;
|
||||||
|
class IApplicationFunctions;
|
||||||
|
class ICommonStateGetter;
|
||||||
|
class IDebugFunctions;
|
||||||
|
class IDisplayController;
|
||||||
|
class ILibraryAppletCreator;
|
||||||
|
class IProcessWindingController;
|
||||||
|
class ISelfController;
|
||||||
|
class IWindowController;
|
||||||
|
class WindowSystem;
|
||||||
|
|
||||||
|
class IApplicationProxy final : public ServiceFramework<IApplicationProxy> {
|
||||||
|
public:
|
||||||
|
explicit IApplicationProxy(Core::System& system_, std::shared_ptr<Applet> applet,
|
||||||
|
Kernel::KProcess* process, WindowSystem& window_system);
|
||||||
|
~IApplicationProxy();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Result GetAudioController(Out<SharedPointer<IAudioController>> out_audio_controller);
|
||||||
|
Result GetDisplayController(Out<SharedPointer<IDisplayController>> out_display_controller);
|
||||||
|
Result GetProcessWindingController(
|
||||||
|
Out<SharedPointer<IProcessWindingController>> out_process_winding_controller);
|
||||||
|
Result GetDebugFunctions(Out<SharedPointer<IDebugFunctions>> out_debug_functions);
|
||||||
|
Result GetWindowController(Out<SharedPointer<IWindowController>> out_window_controller);
|
||||||
|
Result GetSelfController(Out<SharedPointer<ISelfController>> out_self_controller);
|
||||||
|
Result GetCommonStateGetter(Out<SharedPointer<ICommonStateGetter>> out_common_state_getter);
|
||||||
|
Result GetLibraryAppletCreator(
|
||||||
|
Out<SharedPointer<ILibraryAppletCreator>> out_library_applet_creator);
|
||||||
|
Result GetApplicationFunctions(
|
||||||
|
Out<SharedPointer<IApplicationFunctions>> out_application_functions);
|
||||||
|
|
||||||
|
private:
|
||||||
|
WindowSystem& m_window_system;
|
||||||
|
Kernel::KProcess* const m_process;
|
||||||
|
const std::shared_ptr<Applet> m_applet;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Service::AM
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#include "core/core.h"
|
||||||
|
#include "core/hle/service/am/am.h"
|
||||||
|
#include "core/hle/service/am/applet_manager.h"
|
||||||
|
#include "core/hle/service/am/service/application_proxy.h"
|
||||||
|
#include "core/hle/service/am/service/application_proxy_service.h"
|
||||||
|
#include "core/hle/service/am/window_system.h"
|
||||||
|
#include "core/hle/service/cmif_serialization.h"
|
||||||
|
|
||||||
|
namespace Service::AM {
|
||||||
|
|
||||||
|
IApplicationProxyService::IApplicationProxyService(Core::System& system_,
|
||||||
|
WindowSystem& window_system)
|
||||||
|
: ServiceFramework{system_, "appletOE"}, m_window_system{window_system} {
|
||||||
|
static const FunctionInfo functions[] = {
|
||||||
|
{0, D<&IApplicationProxyService::OpenApplicationProxy>, "OpenApplicationProxy"},
|
||||||
|
};
|
||||||
|
RegisterHandlers(functions);
|
||||||
|
}
|
||||||
|
|
||||||
|
IApplicationProxyService::~IApplicationProxyService() = default;
|
||||||
|
|
||||||
|
Result IApplicationProxyService::OpenApplicationProxy(
|
||||||
|
Out<SharedPointer<IApplicationProxy>> out_application_proxy, ClientProcessId pid,
|
||||||
|
InCopyHandle<Kernel::KProcess> process_handle) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
|
||||||
|
if (const auto applet = this->GetAppletFromProcessId(pid)) {
|
||||||
|
*out_application_proxy = std::make_shared<IApplicationProxy>(
|
||||||
|
system, applet, process_handle.Get(), m_window_system);
|
||||||
|
R_SUCCEED();
|
||||||
|
} else {
|
||||||
|
UNIMPLEMENTED();
|
||||||
|
R_THROW(ResultUnknown);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<Applet> IApplicationProxyService::GetAppletFromProcessId(ProcessId process_id) {
|
||||||
|
return m_window_system.GetByAppletResourceUserId(process_id.pid);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace Service::AM
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "core/hle/service/cmif_types.h"
|
||||||
|
#include "core/hle/service/service.h"
|
||||||
|
|
||||||
|
namespace Service {
|
||||||
|
|
||||||
|
namespace AM {
|
||||||
|
|
||||||
|
struct Applet;
|
||||||
|
class IApplicationProxy;
|
||||||
|
class WindowSystem;
|
||||||
|
|
||||||
|
class IApplicationProxyService final : public ServiceFramework<IApplicationProxyService> {
|
||||||
|
public:
|
||||||
|
explicit IApplicationProxyService(Core::System& system_, WindowSystem& window_system);
|
||||||
|
~IApplicationProxyService() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
Result OpenApplicationProxy(Out<SharedPointer<IApplicationProxy>> out_application_proxy,
|
||||||
|
ClientProcessId pid, InCopyHandle<Kernel::KProcess> process_handle);
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::shared_ptr<Applet> GetAppletFromProcessId(ProcessId pid);
|
||||||
|
|
||||||
|
WindowSystem& m_window_system;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace AM
|
||||||
|
} // namespace Service
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
@@ -9,20 +9,20 @@
|
|||||||
|
|
||||||
namespace Service::AM {
|
namespace Service::AM {
|
||||||
|
|
||||||
std::optional<ServiceFrameworkBase::FunctionInfoBase> IAudioController::FindRequest(u32 key) {
|
|
||||||
static constexpr auto functions = CreateStaticMap(
|
|
||||||
FunctionInfo{0, D<&IAudioController::SetExpectedMasterVolume>, "SetExpectedMasterVolume"},
|
|
||||||
FunctionInfo{1, D<&IAudioController::GetMainAppletExpectedMasterVolume>, "GetMainAppletExpectedMasterVolume"},
|
|
||||||
FunctionInfo{2, D<&IAudioController::GetLibraryAppletExpectedMasterVolume>, "GetLibraryAppletExpectedMasterVolume"},
|
|
||||||
FunctionInfo{3, D<&IAudioController::ChangeMainAppletMasterVolume>, "ChangeMainAppletMasterVolume"},
|
|
||||||
FunctionInfo{4, D<&IAudioController::SetTransparentVolumeRate>, "SetTransparentVolumeRate"},
|
|
||||||
FunctionInfo{5, nullptr, "Unknown5", MakeVersionGate({20,0,0})}
|
|
||||||
);
|
|
||||||
return HandlerTableGenerateWithFind(key, functions);
|
|
||||||
}
|
|
||||||
|
|
||||||
IAudioController::IAudioController(Core::System& system_)
|
IAudioController::IAudioController(Core::System& system_)
|
||||||
: ServiceFramework{system_, "IAudioController"} {
|
: ServiceFramework{system_, "IAudioController"} {
|
||||||
|
// clang-format off
|
||||||
|
static const FunctionInfo functions[] = {
|
||||||
|
{0, D<&IAudioController::SetExpectedMasterVolume>, "SetExpectedMasterVolume"},
|
||||||
|
{1, D<&IAudioController::GetMainAppletExpectedMasterVolume>, "GetMainAppletExpectedMasterVolume"},
|
||||||
|
{2, D<&IAudioController::GetLibraryAppletExpectedMasterVolume>, "GetLibraryAppletExpectedMasterVolume"},
|
||||||
|
{3, D<&IAudioController::ChangeMainAppletMasterVolume>, "ChangeMainAppletMasterVolume"},
|
||||||
|
{4, D<&IAudioController::SetTransparentVolumeRate>, "SetTransparentVolumeRate"},
|
||||||
|
{5, nullptr, "Unknown5"}, //20.0.0+
|
||||||
|
};
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
|
RegisterHandlers(functions);
|
||||||
}
|
}
|
||||||
|
|
||||||
IAudioController::~IAudioController() = default;
|
IAudioController::~IAudioController() = default;
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
|
|
||||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
@@ -23,7 +20,6 @@ private:
|
|||||||
Result ChangeMainAppletMasterVolume(f32 volume, s64 fade_time_ns);
|
Result ChangeMainAppletMasterVolume(f32 volume, s64 fade_time_ns);
|
||||||
Result SetTransparentVolumeRate(f32 transparent_volume_rate);
|
Result SetTransparentVolumeRate(f32 transparent_volume_rate);
|
||||||
|
|
||||||
std::optional<FunctionInfoBase> FindRequest(u32 key) override;
|
|
||||||
static constexpr float MinAllowedVolume = 0.0f;
|
static constexpr float MinAllowedVolume = 0.0f;
|
||||||
static constexpr float MaxAllowedVolume = 1.0f;
|
static constexpr float MaxAllowedVolume = 1.0f;
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
#include "core/hle/service/am/am_results.h"
|
#include "core/hle/service/am/am_results.h"
|
||||||
#include "core/hle/service/am/applet.h"
|
#include "core/hle/service/am/applet.h"
|
||||||
#include "core/hle/service/am/service/common_state_getter.h"
|
#include "core/hle/service/am/service/common_state_getter.h"
|
||||||
|
#include "core/hle/service/am/service/lock_accessor.h"
|
||||||
#include "core/hle/service/am/service/storage.h"
|
#include "core/hle/service/am/service/storage.h"
|
||||||
#include "core/hle/service/apm/apm_interface.h"
|
#include "core/hle/service/apm/apm_interface.h"
|
||||||
#include "core/hle/service/cmif_serialization.h"
|
#include "core/hle/service/cmif_serialization.h"
|
||||||
@@ -17,147 +18,77 @@
|
|||||||
|
|
||||||
namespace Service::AM {
|
namespace Service::AM {
|
||||||
|
|
||||||
std::optional<ServiceFrameworkBase::FunctionInfoBase> ICommonStateGetter::FindRequest(u32 key) {
|
|
||||||
static constexpr auto functions = CreateStaticMap(
|
|
||||||
FunctionInfo{0, D<&ICommonStateGetter::GetEventHandle>, "GetEventHandle"},
|
|
||||||
FunctionInfo{1, D<&ICommonStateGetter::ReceiveMessage>, "ReceiveMessage"},
|
|
||||||
FunctionInfo{2, nullptr, "GetThisAppletKind"},
|
|
||||||
FunctionInfo{3, nullptr, "AllowToEnterSleep"},
|
|
||||||
FunctionInfo{4, nullptr, "DisallowToEnterSleep"},
|
|
||||||
FunctionInfo{5, D<&ICommonStateGetter::GetOperationMode>, "GetOperationMode"},
|
|
||||||
FunctionInfo{6, D<&ICommonStateGetter::GetPerformanceMode>, "GetPerformanceMode"},
|
|
||||||
FunctionInfo{7, nullptr, "GetCradleStatus"},
|
|
||||||
FunctionInfo{8, D<&ICommonStateGetter::GetBootMode>, "GetBootMode"},
|
|
||||||
FunctionInfo{9, D<&ICommonStateGetter::GetCurrentFocusState>, "GetCurrentFocusState"},
|
|
||||||
FunctionInfo{10, D<&ICommonStateGetter::RequestToAcquireSleepLock>, "RequestToAcquireSleepLock"},
|
|
||||||
FunctionInfo{11, D<&ICommonStateGetter::ReleaseSleepLock>, "ReleaseSleepLock"},
|
|
||||||
FunctionInfo{12, D<&ICommonStateGetter::ReleaseSleepLockTransiently>, "ReleaseSleepLockTransiently"},
|
|
||||||
FunctionInfo{13, D<&ICommonStateGetter::GetAcquiredSleepLockEvent>, "GetAcquiredSleepLockEvent"},
|
|
||||||
FunctionInfo{14, nullptr, "GetWakeupCount", MakeVersionGate({11,0,0})},
|
|
||||||
FunctionInfo{15, nullptr, "Unknown15", MakeVersionGate({19,0,0})},
|
|
||||||
FunctionInfo{20, D<&ICommonStateGetter::PushToGeneralChannel>, "PushToGeneralChannel"},
|
|
||||||
FunctionInfo{30, D<&ICommonStateGetter::GetHomeButtonReaderLockAccessor>, "GetHomeButtonReaderLockAccessor"},
|
|
||||||
FunctionInfo{31, D<&ICommonStateGetter::GetReaderLockAccessorEx>, "GetReaderLockAccessorEx", MakeVersionGate({2,0,0})},
|
|
||||||
FunctionInfo{32, D<&ICommonStateGetter::GetWriterLockAccessorEx>, "GetWriterLockAccessorEx", MakeVersionGate({7,0,0})},
|
|
||||||
FunctionInfo{40, nullptr, "GetCradleFwVersion", MakeVersionGate({2,0,0})},
|
|
||||||
FunctionInfo{50, D<&ICommonStateGetter::IsVrModeEnabled>, "IsVrModeEnabled", MakeVersionGate({3,0,0})},
|
|
||||||
FunctionInfo{51, D<&ICommonStateGetter::SetVrModeEnabled>, "SetVrModeEnabled", MakeVersionGate({3,0,0})},
|
|
||||||
FunctionInfo{52, D<&ICommonStateGetter::SetLcdBacklighOffEnabled>, "SetLcdBacklighOffEnabled", MakeVersionGate({4,0,0})},
|
|
||||||
FunctionInfo{53, D<&ICommonStateGetter::BeginVrModeEx>, "BeginVrModeEx", MakeVersionGate({7,0,0})},
|
|
||||||
FunctionInfo{54, D<&ICommonStateGetter::EndVrModeEx>, "EndVrModeEx", MakeVersionGate({7,0,0})},
|
|
||||||
FunctionInfo{55, D<&ICommonStateGetter::IsInControllerFirmwareUpdateSection>, "IsInControllerFirmwareUpdateSection", MakeVersionGate({3,0,0})},
|
|
||||||
FunctionInfo{59, nullptr, "SetVrPositionForDebug", MakeVersionGate({1,0,0})},
|
|
||||||
FunctionInfo{60, D<&ICommonStateGetter::GetDefaultDisplayResolution>, "GetDefaultDisplayResolution"},
|
|
||||||
FunctionInfo{61, D<&ICommonStateGetter::GetDefaultDisplayResolutionChangeEvent>, "GetDefaultDisplayResolutionChangeEvent"},
|
|
||||||
FunctionInfo{62, D<&ICommonStateGetter::GetHdcpAuthenticationState>, "GetHdcpAuthenticationState"},
|
|
||||||
FunctionInfo{63, D<&ICommonStateGetter::GetHdcpAuthenticationStateChangeEvent>, "GetHdcpAuthenticationStateChangeEvent"},
|
|
||||||
FunctionInfo{64, nullptr, "SetTvPowerStateMatchingMode"},
|
|
||||||
FunctionInfo{65, nullptr, "GetApplicationIdByContentActionName"},
|
|
||||||
FunctionInfo{66, &ICommonStateGetter::SetCpuBoostMode, "SetCpuBoostMode"},
|
|
||||||
FunctionInfo{67, nullptr, "CancelCpuBoostMode"},
|
|
||||||
FunctionInfo{68, D<&ICommonStateGetter::GetBuiltInDisplayType>, "GetBuiltInDisplayType"},
|
|
||||||
FunctionInfo{80, D<&ICommonStateGetter::PerformSystemButtonPressingIfInFocus>, "PerformSystemButtonPressingIfInFocus"},
|
|
||||||
FunctionInfo{90, nullptr, "SetPerformanceConfigurationChangedNotification"},
|
|
||||||
FunctionInfo{91, nullptr, "GetCurrentPerformanceConfiguration"},
|
|
||||||
FunctionInfo{100, D<&ICommonStateGetter::SetHandlingHomeButtonShortPressedEnabled>, "SetHandlingHomeButtonShortPressedEnabled"},
|
|
||||||
FunctionInfo{110, nullptr, "OpenMyGpuErrorHandler"},
|
|
||||||
FunctionInfo{120, D<&ICommonStateGetter::GetAppletLaunchedHistory>, "GetAppletLaunchedHistory", MakeVersionGate({13,0,0})},
|
|
||||||
FunctionInfo{130, D<&ICommonStateGetter::EnableStartupLogoDisappearedMessage>, "EnableStartupLogoDisappearedMessage", MakeVersionGate({21,0,0})},
|
|
||||||
FunctionInfo{200, D<&ICommonStateGetter::GetOperationModeSystemInfo>, "GetOperationModeSystemInfo"},
|
|
||||||
FunctionInfo{300, D<&ICommonStateGetter::GetSettingsPlatformRegion>, "GetSettingsPlatformRegion"},
|
|
||||||
FunctionInfo{400, nullptr, "ActivateMigrationService"},
|
|
||||||
FunctionInfo{401, nullptr, "DeactivateMigrationService"},
|
|
||||||
FunctionInfo{500, nullptr, "DisableSleepTillShutdown"},
|
|
||||||
FunctionInfo{501, nullptr, "SuppressDisablingSleepTemporarily"},
|
|
||||||
FunctionInfo{502, nullptr, "IsSleepEnabled"},
|
|
||||||
FunctionInfo{503, nullptr, "IsDisablingSleepSuppressed"},
|
|
||||||
FunctionInfo{600, nullptr, "SetHidInputMagnificationForApplication", MakeVersionGate({20,0,0})},
|
|
||||||
FunctionInfo{610, D<&ICommonStateGetter::Unknown610>, "Unknown610", MakeVersionGate({21,0,0})},
|
|
||||||
FunctionInfo{611, D<&ICommonStateGetter::Unknown611>, "Unknown611", MakeVersionGate({22,0,0})},
|
|
||||||
FunctionInfo{900, D<&ICommonStateGetter::SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled>, "SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled", MakeVersionGate({11,0,0})},
|
|
||||||
FunctionInfo{910, nullptr, "GetLaunchRequiredTick", MakeVersionGate({17,0,0})},
|
|
||||||
FunctionInfo{1000, D<&ICommonStateGetter::BeginVrMode3d>, "BeginVrMode3d", MakeVersionGate({19,0,0})},
|
|
||||||
FunctionInfo{1001, D<&ICommonStateGetter::EndVrMode3d>, "EndVrMode3d", MakeVersionGate({19,0,0})},
|
|
||||||
FunctionInfo{1002, D<&ICommonStateGetter::IsVrModeEnabled3d>, "IsVrModeEnabled3d", MakeVersionGate({19,0,0})},
|
|
||||||
FunctionInfo{1003, D<&ICommonStateGetter::GetVrLaboGoggleViewport>, "GetVrLaboGoggleViewport", MakeVersionGate({21,0,0})},
|
|
||||||
FunctionInfo{1004, D<&ICommonStateGetter::GetPanelPhysicalSizeForSpecificTitle>, "GetPanelPhysicalSizeForSpecificTitle", MakeVersionGate({21,0,0})},
|
|
||||||
FunctionInfo{1005, D<&ICommonStateGetter::GetPanelResolutionForSpecificTitle>, "GetPanelResolutionForSpecificTitle", MakeVersionGate({21,0,0})}
|
|
||||||
);
|
|
||||||
return HandlerTableGenerateWithFind(key, functions);
|
|
||||||
}
|
|
||||||
|
|
||||||
class ILockAccessor final : public ServiceFramework<ILockAccessor> {
|
|
||||||
public:
|
|
||||||
explicit ILockAccessor(Core::System& system_)
|
|
||||||
: ServiceFramework{system_, "ILockAccessor"}, m_context{system_, "ILockAccessor"},
|
|
||||||
m_event{m_context} {
|
|
||||||
m_event.Signal(system.Kernel());
|
|
||||||
}
|
|
||||||
~ILockAccessor() override = default;
|
|
||||||
|
|
||||||
Result TryLock(Out<bool> out_is_locked, OutCopyHandle<Kernel::KReadableEvent> out_handle, bool return_handle) {
|
|
||||||
LOG_INFO(Service_AM, "called, return_handle={}", return_handle);
|
|
||||||
|
|
||||||
{
|
|
||||||
std::scoped_lock lk{m_mutex};
|
|
||||||
if (m_is_locked) {
|
|
||||||
*out_is_locked = false;
|
|
||||||
} else {
|
|
||||||
m_is_locked = true;
|
|
||||||
*out_is_locked = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (return_handle) {
|
|
||||||
*out_handle = m_event.GetHandle();
|
|
||||||
}
|
|
||||||
|
|
||||||
R_SUCCEED();
|
|
||||||
}
|
|
||||||
|
|
||||||
Result Unlock() {
|
|
||||||
LOG_INFO(Service_AM, "called");
|
|
||||||
|
|
||||||
{
|
|
||||||
std::scoped_lock lk{m_mutex};
|
|
||||||
m_is_locked = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_event.Signal(system.Kernel());
|
|
||||||
R_SUCCEED();
|
|
||||||
}
|
|
||||||
|
|
||||||
Result GetEvent(OutCopyHandle<Kernel::KReadableEvent> out_handle) {
|
|
||||||
LOG_INFO(Service_AM, "called");
|
|
||||||
*out_handle = m_event.GetHandle();
|
|
||||||
R_SUCCEED();
|
|
||||||
}
|
|
||||||
|
|
||||||
Result IsLocked(Out<bool> out_is_locked) {
|
|
||||||
LOG_INFO(Service_AM, "called");
|
|
||||||
std::scoped_lock lk{m_mutex};
|
|
||||||
*out_is_locked = m_is_locked;
|
|
||||||
R_SUCCEED();
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
std::optional<FunctionInfoBase> FindRequest(u32 key) override {
|
|
||||||
return HandlerTableGenerateWithFind(key, functions);
|
|
||||||
}
|
|
||||||
static constexpr auto functions = CreateStaticMap(
|
|
||||||
FunctionInfo{1, D<&ILockAccessor::TryLock>, "TryLock"},
|
|
||||||
FunctionInfo{2, D<&ILockAccessor::Unlock>, "Unlock"},
|
|
||||||
FunctionInfo{3, D<&ILockAccessor::GetEvent>, "GetEvent"},
|
|
||||||
FunctionInfo{4, D<&ILockAccessor::IsLocked>, "IsLocked"}
|
|
||||||
);
|
|
||||||
KernelHelpers::ServiceContext m_context;
|
|
||||||
Event m_event;
|
|
||||||
std::mutex m_mutex{};
|
|
||||||
bool m_is_locked{};
|
|
||||||
};
|
|
||||||
|
|
||||||
ICommonStateGetter::ICommonStateGetter(Core::System& system_, std::shared_ptr<Applet> applet)
|
ICommonStateGetter::ICommonStateGetter(Core::System& system_, std::shared_ptr<Applet> applet)
|
||||||
: ServiceFramework{system_, "ICommonStateGetter"}, m_applet{std::move(applet)} {
|
: ServiceFramework{system_, "ICommonStateGetter"}, m_applet{std::move(applet)} {
|
||||||
|
// clang-format off
|
||||||
|
static const FunctionInfo functions[] = {
|
||||||
|
{0, D<&ICommonStateGetter::GetEventHandle>, "GetEventHandle"},
|
||||||
|
{1, D<&ICommonStateGetter::ReceiveMessage>, "ReceiveMessage"},
|
||||||
|
{2, nullptr, "GetThisAppletKind"},
|
||||||
|
{3, nullptr, "AllowToEnterSleep"},
|
||||||
|
{4, nullptr, "DisallowToEnterSleep"},
|
||||||
|
{5, D<&ICommonStateGetter::GetOperationMode>, "GetOperationMode"},
|
||||||
|
{6, D<&ICommonStateGetter::GetPerformanceMode>, "GetPerformanceMode"},
|
||||||
|
{7, nullptr, "GetCradleStatus"},
|
||||||
|
{8, D<&ICommonStateGetter::GetBootMode>, "GetBootMode"},
|
||||||
|
{9, D<&ICommonStateGetter::GetCurrentFocusState>, "GetCurrentFocusState"},
|
||||||
|
{10, D<&ICommonStateGetter::RequestToAcquireSleepLock>, "RequestToAcquireSleepLock"},
|
||||||
|
{11, D<&ICommonStateGetter::ReleaseSleepLock>, "ReleaseSleepLock"},
|
||||||
|
{12, D<&ICommonStateGetter::ReleaseSleepLockTransiently>, "ReleaseSleepLockTransiently"},
|
||||||
|
{13, D<&ICommonStateGetter::GetAcquiredSleepLockEvent>, "GetAcquiredSleepLockEvent"},
|
||||||
|
{14, nullptr, "GetWakeupCount"}, //11.0.0+
|
||||||
|
{15, nullptr, "Unknown15"}, //19.0.0+
|
||||||
|
{20, D<&ICommonStateGetter::PushToGeneralChannel>, "PushToGeneralChannel"},
|
||||||
|
{30, D<&ICommonStateGetter::GetHomeButtonReaderLockAccessor>, "GetHomeButtonReaderLockAccessor"},
|
||||||
|
{31, D<&ICommonStateGetter::GetReaderLockAccessorEx>, "GetReaderLockAccessorEx"}, //2.0.0+
|
||||||
|
{32, D<&ICommonStateGetter::GetWriterLockAccessorEx>, "GetWriterLockAccessorEx"}, //7.0.0+
|
||||||
|
{40, nullptr, "GetCradleFwVersion"}, //2.0.0+
|
||||||
|
{50, D<&ICommonStateGetter::IsVrModeEnabled>, "IsVrModeEnabled"}, //3.0.0+
|
||||||
|
{51, D<&ICommonStateGetter::SetVrModeEnabled>, "SetVrModeEnabled"}, //3.0.0+
|
||||||
|
{52, D<&ICommonStateGetter::SetLcdBacklighOffEnabled>, "SetLcdBacklighOffEnabled"}, //4.0.0+
|
||||||
|
{53, D<&ICommonStateGetter::BeginVrModeEx>, "BeginVrModeEx"}, //7.0.0+
|
||||||
|
{54, D<&ICommonStateGetter::EndVrModeEx>, "EndVrModeEx"}, //7.0.0+
|
||||||
|
{55, D<&ICommonStateGetter::IsInControllerFirmwareUpdateSection>, "IsInControllerFirmwareUpdateSection"}, //3.0.0+
|
||||||
|
{59, nullptr, "SetVrPositionForDebug"}, //1.0.0+
|
||||||
|
{60, D<&ICommonStateGetter::GetDefaultDisplayResolution>, "GetDefaultDisplayResolution"},
|
||||||
|
{61, D<&ICommonStateGetter::GetDefaultDisplayResolutionChangeEvent>, "GetDefaultDisplayResolutionChangeEvent"},
|
||||||
|
{62, D<&ICommonStateGetter::GetHdcpAuthenticationState>, "GetHdcpAuthenticationState"},
|
||||||
|
{63, D<&ICommonStateGetter::GetHdcpAuthenticationStateChangeEvent>, "GetHdcpAuthenticationStateChangeEvent"},
|
||||||
|
{64, nullptr, "SetTvPowerStateMatchingMode"},
|
||||||
|
{65, nullptr, "GetApplicationIdByContentActionName"},
|
||||||
|
{66, &ICommonStateGetter::SetCpuBoostMode, "SetCpuBoostMode"},
|
||||||
|
{67, nullptr, "CancelCpuBoostMode"},
|
||||||
|
{68, D<&ICommonStateGetter::GetBuiltInDisplayType>, "GetBuiltInDisplayType"},
|
||||||
|
{80, D<&ICommonStateGetter::PerformSystemButtonPressingIfInFocus>, "PerformSystemButtonPressingIfInFocus"},
|
||||||
|
{90, nullptr, "SetPerformanceConfigurationChangedNotification"},
|
||||||
|
{91, nullptr, "GetCurrentPerformanceConfiguration"},
|
||||||
|
{100, D<&ICommonStateGetter::SetHandlingHomeButtonShortPressedEnabled>, "SetHandlingHomeButtonShortPressedEnabled"},
|
||||||
|
{110, nullptr, "OpenMyGpuErrorHandler"},
|
||||||
|
{120, D<&ICommonStateGetter::GetAppletLaunchedHistory>, "GetAppletLaunchedHistory"}, //13.0.0+
|
||||||
|
{130, D<&ICommonStateGetter::EnableStartupLogoDisappearedMessage>, "EnableStartupLogoDisappearedMessage"}, //21.0.0+
|
||||||
|
{200, D<&ICommonStateGetter::GetOperationModeSystemInfo>, "GetOperationModeSystemInfo"},
|
||||||
|
{300, D<&ICommonStateGetter::GetSettingsPlatformRegion>, "GetSettingsPlatformRegion"},
|
||||||
|
{400, nullptr, "ActivateMigrationService"},
|
||||||
|
{401, nullptr, "DeactivateMigrationService"},
|
||||||
|
{500, nullptr, "DisableSleepTillShutdown"},
|
||||||
|
{501, nullptr, "SuppressDisablingSleepTemporarily"},
|
||||||
|
{502, nullptr, "IsSleepEnabled"},
|
||||||
|
{503, nullptr, "IsDisablingSleepSuppressed"},
|
||||||
|
{600, nullptr, "SetHidInputMagnificationForApplication"}, //20.0.0+
|
||||||
|
{610, D<&ICommonStateGetter::Unknown610>, "Unknown610"}, //21.0.0+
|
||||||
|
{611, D<&ICommonStateGetter::Unknown611>, "Unknown611"}, //22.0.0+
|
||||||
|
{900, D<&ICommonStateGetter::SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled>, "SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled"}, //11.0.0+
|
||||||
|
{910, nullptr, "GetLaunchRequiredTick"}, //17.0.0+
|
||||||
|
{1000, D<&ICommonStateGetter::BeginVrMode3d>, "BeginVrMode3d"}, //19.0.0+
|
||||||
|
{1001, D<&ICommonStateGetter::EndVrMode3d>, "EndVrMode3d"}, //19.0.0+
|
||||||
|
{1002, D<&ICommonStateGetter::IsVrModeEnabled3d>, "IsVrModeEnabled3d"}, //19.0.0+
|
||||||
|
{1003, D<&ICommonStateGetter::GetVrLaboGoggleViewport>, "GetVrLaboGoggleViewport"}, //21.0.0+
|
||||||
|
{1004, D<&ICommonStateGetter::GetPanelPhysicalSizeForSpecificTitle>, "GetPanelPhysicalSizeForSpecificTitle"}, //21.0.0+
|
||||||
|
{1005, D<&ICommonStateGetter::GetPanelResolutionForSpecificTitle>, "GetPanelResolutionForSpecificTitle"}, //21.0.0+
|
||||||
|
};
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
|
RegisterHandlers(functions);
|
||||||
}
|
}
|
||||||
|
|
||||||
ICommonStateGetter::~ICommonStateGetter() = default;
|
ICommonStateGetter::~ICommonStateGetter() = default;
|
||||||
|
|||||||
@@ -76,7 +76,6 @@ private:
|
|||||||
|
|
||||||
void SetCpuBoostMode(HLERequestContext& ctx);
|
void SetCpuBoostMode(HLERequestContext& ctx);
|
||||||
|
|
||||||
std::optional<FunctionInfoBase> FindRequest(u32 key) override;
|
|
||||||
const std::shared_ptr<Applet> m_applet;
|
const std::shared_ptr<Applet> m_applet;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
|
|
||||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
@@ -9,21 +6,22 @@
|
|||||||
|
|
||||||
namespace Service::AM {
|
namespace Service::AM {
|
||||||
|
|
||||||
std::optional<ServiceFrameworkBase::FunctionInfoBase> ICradleFirmwareUpdater::FindRequest(u32 key) {
|
|
||||||
static constexpr auto functions = CreateStaticMap(
|
|
||||||
FunctionInfo{0, D<&ICradleFirmwareUpdater::StartUpdate>, "StartUpdate"},
|
|
||||||
FunctionInfo{1, D<&ICradleFirmwareUpdater::FinishUpdate>, "FinishUpdate"},
|
|
||||||
FunctionInfo{2, D<&ICradleFirmwareUpdater::GetCradleDeviceInfo>, "GetCradleDeviceInfo"},
|
|
||||||
FunctionInfo{3, D<&ICradleFirmwareUpdater::GetCradleDeviceInfoChangeEvent>, "GetCradleDeviceInfoChangeEvent"},
|
|
||||||
FunctionInfo{4, nullptr, "GetUpdateProgressInfo"},
|
|
||||||
FunctionInfo{5, nullptr, "GetLastInternalResult"}
|
|
||||||
);
|
|
||||||
return HandlerTableGenerateWithFind(key, functions);
|
|
||||||
}
|
|
||||||
|
|
||||||
ICradleFirmwareUpdater::ICradleFirmwareUpdater(Core::System& system_)
|
ICradleFirmwareUpdater::ICradleFirmwareUpdater(Core::System& system_)
|
||||||
: ServiceFramework{system_, "ICradleFirmwareUpdater"},
|
: ServiceFramework{system_, "ICradleFirmwareUpdater"},
|
||||||
m_context{system, "ICradleFirmwareUpdater"}, m_cradle_device_info_event{m_context} {
|
m_context{system, "ICradleFirmwareUpdater"}, m_cradle_device_info_event{m_context} {
|
||||||
|
// clang-format off
|
||||||
|
static const FunctionInfo functions[] = {
|
||||||
|
{0, D<&ICradleFirmwareUpdater::StartUpdate>, "StartUpdate"},
|
||||||
|
{1, D<&ICradleFirmwareUpdater::FinishUpdate>, "FinishUpdate"},
|
||||||
|
{2, D<&ICradleFirmwareUpdater::GetCradleDeviceInfo>, "GetCradleDeviceInfo"},
|
||||||
|
{3, D<&ICradleFirmwareUpdater::GetCradleDeviceInfoChangeEvent>, "GetCradleDeviceInfoChangeEvent"},
|
||||||
|
{4, nullptr, "GetUpdateProgressInfo"},
|
||||||
|
{5, nullptr, "GetLastInternalResult"},
|
||||||
|
|
||||||
|
};
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
|
RegisterHandlers(functions);
|
||||||
}
|
}
|
||||||
|
|
||||||
ICradleFirmwareUpdater::~ICradleFirmwareUpdater() = default;
|
ICradleFirmwareUpdater::~ICradleFirmwareUpdater() = default;
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
|
|
||||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
@@ -33,7 +30,6 @@ private:
|
|||||||
Result GetCradleDeviceInfoChangeEvent(OutCopyHandle<Kernel::KReadableEvent> out_event);
|
Result GetCradleDeviceInfoChangeEvent(OutCopyHandle<Kernel::KReadableEvent> out_event);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::optional<FunctionInfoBase> FindRequest(u32 key) override;
|
|
||||||
KernelHelpers::ServiceContext m_context;
|
KernelHelpers::ServiceContext m_context;
|
||||||
Event m_cradle_device_info_event;
|
Event m_cradle_device_info_event;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#include "core/hle/service/am/service/debug_functions.h"
|
||||||
|
|
||||||
|
namespace Service::AM {
|
||||||
|
|
||||||
|
IDebugFunctions::IDebugFunctions(Core::System& system_)
|
||||||
|
: ServiceFramework{system_, "IDebugFunctions"} {
|
||||||
|
// clang-format off
|
||||||
|
static const FunctionInfo functions[] = {
|
||||||
|
{0, nullptr, "NotifyMessageToHomeMenuForDebug"},
|
||||||
|
{1, nullptr, "OpenMainApplication"},
|
||||||
|
{10, nullptr, "PerformSystemButtonPressing"},
|
||||||
|
{20, nullptr, "InvalidateTransitionLayer"},
|
||||||
|
{30, nullptr, "RequestLaunchApplicationWithUserAndArgumentForDebug"},
|
||||||
|
{31, nullptr, "RequestLaunchApplicationByApplicationLaunchInfoForDebug"},
|
||||||
|
{40, nullptr, "GetAppletResourceUsageInfo"},
|
||||||
|
{50, nullptr, "AddSystemProgramIdAndAppletIdForDebug"},
|
||||||
|
{51, nullptr, "AddOperationConfirmedLibraryAppletIdForDebug"},
|
||||||
|
{100, nullptr, "SetCpuBoostModeForApplet"},
|
||||||
|
{101, nullptr, "CancelCpuBoostModeForApplet"},
|
||||||
|
{110, nullptr, "PushToAppletBoundChannelForDebug"},
|
||||||
|
{111, nullptr, "TryPopFromAppletBoundChannelForDebug"},
|
||||||
|
{120, nullptr, "AlarmSettingNotificationEnableAppEventReserve"},
|
||||||
|
{121, nullptr, "AlarmSettingNotificationDisableAppEventReserve"},
|
||||||
|
{122, nullptr, "AlarmSettingNotificationPushAppEventNotify"},
|
||||||
|
{130, nullptr, "FriendInvitationSetApplicationParameter"},
|
||||||
|
{131, nullptr, "FriendInvitationClearApplicationParameter"},
|
||||||
|
{132, nullptr, "FriendInvitationPushApplicationParameter"},
|
||||||
|
{140, nullptr, "RestrictPowerOperationForSecureLaunchModeForDebug"},
|
||||||
|
{200, nullptr, "CreateFloatingLibraryAppletAccepterForDebug"},
|
||||||
|
{300, nullptr, "TerminateAllRunningApplicationsForDebug"},
|
||||||
|
{900, nullptr, "GetGrcProcessLaunchedSystemEvent"},
|
||||||
|
};
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
|
RegisterHandlers(functions);
|
||||||
|
}
|
||||||
|
|
||||||
|
IDebugFunctions::~IDebugFunctions() = default;
|
||||||
|
|
||||||
|
} // namespace Service::AM
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "core/hle/service/service.h"
|
||||||
|
|
||||||
|
namespace Service::AM {
|
||||||
|
|
||||||
|
class IDebugFunctions final : public ServiceFramework<IDebugFunctions> {
|
||||||
|
public:
|
||||||
|
explicit IDebugFunctions(Core::System& system_);
|
||||||
|
~IDebugFunctions() override;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Service::AM
|
||||||
@@ -12,42 +12,42 @@
|
|||||||
|
|
||||||
namespace Service::AM {
|
namespace Service::AM {
|
||||||
|
|
||||||
std::optional<ServiceFrameworkBase::FunctionInfoBase> IDisplayController::FindRequest(u32 key) {
|
|
||||||
static constexpr auto functions = CreateStaticMap(
|
|
||||||
FunctionInfo{0, nullptr, "GetLastForegroundCaptureImage"},
|
|
||||||
FunctionInfo{1, nullptr, "UpdateLastForegroundCaptureImage"},
|
|
||||||
FunctionInfo{2, nullptr, "GetLastApplicationCaptureImage"},
|
|
||||||
FunctionInfo{3, nullptr, "GetCallerAppletCaptureImage"},
|
|
||||||
FunctionInfo{4, nullptr, "UpdateCallerAppletCaptureImage"},
|
|
||||||
FunctionInfo{5, D<&IDisplayController::GetLastForegroundCaptureImageEx>, "GetLastForegroundCaptureImageEx"},
|
|
||||||
FunctionInfo{6, nullptr, "GetLastApplicationCaptureImageEx"},
|
|
||||||
FunctionInfo{7, D<&IDisplayController::GetCallerAppletCaptureImageEx>, "GetCallerAppletCaptureImageEx"},
|
|
||||||
FunctionInfo{8, D<&IDisplayController::TakeScreenShotOfOwnLayer>, "TakeScreenShotOfOwnLayer"},
|
|
||||||
FunctionInfo{9, nullptr, "CopyBetweenCaptureBuffers"},
|
|
||||||
FunctionInfo{10, nullptr, "AcquireLastApplicationCaptureBuffer"},
|
|
||||||
FunctionInfo{11, nullptr, "ReleaseLastApplicationCaptureBuffer"},
|
|
||||||
FunctionInfo{12, nullptr, "AcquireLastForegroundCaptureBuffer"},
|
|
||||||
FunctionInfo{13, nullptr, "ReleaseLastForegroundCaptureBuffer"},
|
|
||||||
FunctionInfo{14, nullptr, "AcquireCallerAppletCaptureBuffer"},
|
|
||||||
FunctionInfo{15, nullptr, "ReleaseCallerAppletCaptureBuffer"},
|
|
||||||
FunctionInfo{16, nullptr, "AcquireLastApplicationCaptureBufferEx"},
|
|
||||||
FunctionInfo{17, nullptr, "AcquireLastForegroundCaptureBufferEx"},
|
|
||||||
FunctionInfo{18, nullptr, "AcquireCallerAppletCaptureBufferEx"},
|
|
||||||
FunctionInfo{20, D<&IDisplayController::ClearCaptureBuffer>, "ClearCaptureBuffer"},
|
|
||||||
FunctionInfo{21, nullptr, "ClearAppletTransitionBuffer"},
|
|
||||||
FunctionInfo{22, D<&IDisplayController::AcquireLastApplicationCaptureSharedBuffer>, "AcquireLastApplicationCaptureSharedBuffer"},
|
|
||||||
FunctionInfo{23, D<&IDisplayController::ReleaseLastApplicationCaptureSharedBuffer>, "ReleaseLastApplicationCaptureSharedBuffer"},
|
|
||||||
FunctionInfo{24, D<&IDisplayController::AcquireLastForegroundCaptureSharedBuffer>, "AcquireLastForegroundCaptureSharedBuffer"},
|
|
||||||
FunctionInfo{25, D<&IDisplayController::ReleaseLastForegroundCaptureSharedBuffer>, "ReleaseLastForegroundCaptureSharedBuffer"},
|
|
||||||
FunctionInfo{26, D<&IDisplayController::AcquireCallerAppletCaptureSharedBuffer>, "AcquireCallerAppletCaptureSharedBuffer"},
|
|
||||||
FunctionInfo{27, D<&IDisplayController::ReleaseCallerAppletCaptureSharedBuffer>, "ReleaseCallerAppletCaptureSharedBuffer"},
|
|
||||||
FunctionInfo{28, nullptr, "TakeScreenShotOfOwnLayerEx"}
|
|
||||||
);
|
|
||||||
return HandlerTableGenerateWithFind(key, functions);
|
|
||||||
}
|
|
||||||
|
|
||||||
IDisplayController::IDisplayController(Core::System& system_, std::shared_ptr<Applet> applet_)
|
IDisplayController::IDisplayController(Core::System& system_, std::shared_ptr<Applet> applet_)
|
||||||
: ServiceFramework{system_, "IDisplayController"}, applet(std::move(applet_)) {
|
: ServiceFramework{system_, "IDisplayController"}, applet(std::move(applet_)) {
|
||||||
|
// clang-format off
|
||||||
|
static const FunctionInfo functions[] = {
|
||||||
|
{0, nullptr, "GetLastForegroundCaptureImage"},
|
||||||
|
{1, nullptr, "UpdateLastForegroundCaptureImage"},
|
||||||
|
{2, nullptr, "GetLastApplicationCaptureImage"},
|
||||||
|
{3, nullptr, "GetCallerAppletCaptureImage"},
|
||||||
|
{4, nullptr, "UpdateCallerAppletCaptureImage"},
|
||||||
|
{5, D<&IDisplayController::GetLastForegroundCaptureImageEx>, "GetLastForegroundCaptureImageEx"},
|
||||||
|
{6, nullptr, "GetLastApplicationCaptureImageEx"},
|
||||||
|
{7, D<&IDisplayController::GetCallerAppletCaptureImageEx>, "GetCallerAppletCaptureImageEx"},
|
||||||
|
{8, D<&IDisplayController::TakeScreenShotOfOwnLayer>, "TakeScreenShotOfOwnLayer"},
|
||||||
|
{9, nullptr, "CopyBetweenCaptureBuffers"},
|
||||||
|
{10, nullptr, "AcquireLastApplicationCaptureBuffer"},
|
||||||
|
{11, nullptr, "ReleaseLastApplicationCaptureBuffer"},
|
||||||
|
{12, nullptr, "AcquireLastForegroundCaptureBuffer"},
|
||||||
|
{13, nullptr, "ReleaseLastForegroundCaptureBuffer"},
|
||||||
|
{14, nullptr, "AcquireCallerAppletCaptureBuffer"},
|
||||||
|
{15, nullptr, "ReleaseCallerAppletCaptureBuffer"},
|
||||||
|
{16, nullptr, "AcquireLastApplicationCaptureBufferEx"},
|
||||||
|
{17, nullptr, "AcquireLastForegroundCaptureBufferEx"},
|
||||||
|
{18, nullptr, "AcquireCallerAppletCaptureBufferEx"},
|
||||||
|
{20, D<&IDisplayController::ClearCaptureBuffer>, "ClearCaptureBuffer"},
|
||||||
|
{21, nullptr, "ClearAppletTransitionBuffer"},
|
||||||
|
{22, D<&IDisplayController::AcquireLastApplicationCaptureSharedBuffer>, "AcquireLastApplicationCaptureSharedBuffer"},
|
||||||
|
{23, D<&IDisplayController::ReleaseLastApplicationCaptureSharedBuffer>, "ReleaseLastApplicationCaptureSharedBuffer"},
|
||||||
|
{24, D<&IDisplayController::AcquireLastForegroundCaptureSharedBuffer>, "AcquireLastForegroundCaptureSharedBuffer"},
|
||||||
|
{25, D<&IDisplayController::ReleaseLastForegroundCaptureSharedBuffer>, "ReleaseLastForegroundCaptureSharedBuffer"},
|
||||||
|
{26, D<&IDisplayController::AcquireCallerAppletCaptureSharedBuffer>, "AcquireCallerAppletCaptureSharedBuffer"},
|
||||||
|
{27, D<&IDisplayController::ReleaseCallerAppletCaptureSharedBuffer>, "ReleaseCallerAppletCaptureSharedBuffer"},
|
||||||
|
{28, nullptr, "TakeScreenShotOfOwnLayerEx"},
|
||||||
|
};
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
|
RegisterHandlers(functions);
|
||||||
}
|
}
|
||||||
|
|
||||||
IDisplayController::~IDisplayController() = default;
|
IDisplayController::~IDisplayController() = default;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
@@ -35,7 +35,6 @@ private:
|
|||||||
Out<s32> out_fbshare_layer_index);
|
Out<s32> out_fbshare_layer_index);
|
||||||
Result ReleaseLastApplicationCaptureSharedBuffer();
|
Result ReleaseLastApplicationCaptureSharedBuffer();
|
||||||
|
|
||||||
std::optional<FunctionInfoBase> FindRequest(u32 key) override;
|
|
||||||
const std::shared_ptr<Applet> applet;
|
const std::shared_ptr<Applet> applet;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
|
|
||||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
@@ -10,28 +7,28 @@
|
|||||||
|
|
||||||
namespace Service::AM {
|
namespace Service::AM {
|
||||||
|
|
||||||
std::optional<ServiceFrameworkBase::FunctionInfoBase> IGlobalStateController::FindRequest(u32 key) {
|
|
||||||
static constexpr auto functions = CreateStaticMap(
|
|
||||||
FunctionInfo{0, nullptr, "RequestToEnterSleep"},
|
|
||||||
FunctionInfo{1, nullptr, "EnterSleep"},
|
|
||||||
FunctionInfo{2, nullptr, "StartSleepSequence"},
|
|
||||||
FunctionInfo{3, D<&IGlobalStateController::StartShutdownSequence>, "StartShutdownSequence"},
|
|
||||||
FunctionInfo{4, D<&IGlobalStateController::StartRebootSequence>, "StartRebootSequence"},
|
|
||||||
FunctionInfo{9, nullptr, "IsAutoPowerDownRequested"},
|
|
||||||
FunctionInfo{10, D<&IGlobalStateController::LoadAndApplyIdlePolicySettings>, "LoadAndApplyIdlePolicySettings"},
|
|
||||||
FunctionInfo{11, nullptr, "NotifyCecSettingsChanged"},
|
|
||||||
FunctionInfo{12, nullptr, "SetDefaultHomeButtonLongPressTime"},
|
|
||||||
FunctionInfo{13, nullptr, "UpdateDefaultDisplayResolution"},
|
|
||||||
FunctionInfo{14, D<&IGlobalStateController::ShouldSleepOnBoot>, "ShouldSleepOnBoot"},
|
|
||||||
FunctionInfo{15, D<&IGlobalStateController::GetHdcpAuthenticationFailedEvent>, "GetHdcpAuthenticationFailedEvent"},
|
|
||||||
FunctionInfo{30, D<&IGlobalStateController::OpenCradleFirmwareUpdater>, "OpenCradleFirmwareUpdater"}
|
|
||||||
);
|
|
||||||
return HandlerTableGenerateWithFind(key, functions);
|
|
||||||
}
|
|
||||||
|
|
||||||
IGlobalStateController::IGlobalStateController(Core::System& system_)
|
IGlobalStateController::IGlobalStateController(Core::System& system_)
|
||||||
: ServiceFramework{system_, "IGlobalStateController"},
|
: ServiceFramework{system_, "IGlobalStateController"},
|
||||||
m_context{system_, "IGlobalStateController"}, m_hdcp_authentication_failed_event{m_context} {
|
m_context{system_, "IGlobalStateController"}, m_hdcp_authentication_failed_event{m_context} {
|
||||||
|
// clang-format off
|
||||||
|
static const FunctionInfo functions[] = {
|
||||||
|
{0, nullptr, "RequestToEnterSleep"},
|
||||||
|
{1, nullptr, "EnterSleep"},
|
||||||
|
{2, nullptr, "StartSleepSequence"},
|
||||||
|
{3, D<&IGlobalStateController::StartShutdownSequence>, "StartShutdownSequence"},
|
||||||
|
{4, D<&IGlobalStateController::StartRebootSequence>, "StartRebootSequence"},
|
||||||
|
{9, nullptr, "IsAutoPowerDownRequested"},
|
||||||
|
{10, D<&IGlobalStateController::LoadAndApplyIdlePolicySettings>, "LoadAndApplyIdlePolicySettings"},
|
||||||
|
{11, nullptr, "NotifyCecSettingsChanged"},
|
||||||
|
{12, nullptr, "SetDefaultHomeButtonLongPressTime"},
|
||||||
|
{13, nullptr, "UpdateDefaultDisplayResolution"},
|
||||||
|
{14, D<&IGlobalStateController::ShouldSleepOnBoot>, "ShouldSleepOnBoot"},
|
||||||
|
{15, D<&IGlobalStateController::GetHdcpAuthenticationFailedEvent>, "GetHdcpAuthenticationFailedEvent"},
|
||||||
|
{30, D<&IGlobalStateController::OpenCradleFirmwareUpdater>, "OpenCradleFirmwareUpdater"},
|
||||||
|
};
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
|
RegisterHandlers(functions);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result IGlobalStateController::StartShutdownSequence() {
|
Result IGlobalStateController::StartShutdownSequence() {
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
|
|
||||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
@@ -26,9 +23,9 @@ private:
|
|||||||
Result LoadAndApplyIdlePolicySettings();
|
Result LoadAndApplyIdlePolicySettings();
|
||||||
Result ShouldSleepOnBoot(Out<bool> out_should_sleep_on_boot);
|
Result ShouldSleepOnBoot(Out<bool> out_should_sleep_on_boot);
|
||||||
Result GetHdcpAuthenticationFailedEvent(OutCopyHandle<Kernel::KReadableEvent> out_event);
|
Result GetHdcpAuthenticationFailedEvent(OutCopyHandle<Kernel::KReadableEvent> out_event);
|
||||||
Result OpenCradleFirmwareUpdater(Out<SharedPointer<ICradleFirmwareUpdater>> out_cradle_firmware_updater);
|
Result OpenCradleFirmwareUpdater(
|
||||||
|
Out<SharedPointer<ICradleFirmwareUpdater>> out_cradle_firmware_updater);
|
||||||
|
|
||||||
std::optional<FunctionInfoBase> FindRequest(u32 key) override;
|
|
||||||
KernelHelpers::ServiceContext m_context;
|
KernelHelpers::ServiceContext m_context;
|
||||||
Event m_hdcp_authentication_failed_event;
|
Event m_hdcp_authentication_failed_event;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,31 +14,31 @@
|
|||||||
|
|
||||||
namespace Service::AM {
|
namespace Service::AM {
|
||||||
|
|
||||||
std::optional<ServiceFrameworkBase::FunctionInfoBase> IHomeMenuFunctions::FindRequest(u32 key) {
|
|
||||||
static constexpr auto functions = CreateStaticMap(
|
|
||||||
FunctionInfo{10, D<&IHomeMenuFunctions::RequestToGetForeground>, "RequestToGetForeground"},
|
|
||||||
FunctionInfo{11, D<&IHomeMenuFunctions::LockForeground>, "LockForeground"},
|
|
||||||
FunctionInfo{12, D<&IHomeMenuFunctions::UnlockForeground>, "UnlockForeground"},
|
|
||||||
FunctionInfo{20, D<&IHomeMenuFunctions::PopFromGeneralChannel>, "PopFromGeneralChannel"},
|
|
||||||
FunctionInfo{21, D<&IHomeMenuFunctions::GetPopFromGeneralChannelEvent>, "GetPopFromGeneralChannelEvent"},
|
|
||||||
FunctionInfo{30, nullptr, "GetHomeButtonWriterLockAccessor"},
|
|
||||||
FunctionInfo{31, nullptr, "GetWriterLockAccessorEx"},
|
|
||||||
FunctionInfo{40, D<&IHomeMenuFunctions::IsSleepEnabled>, "IsSleepEnabled"},
|
|
||||||
FunctionInfo{41, D<&IHomeMenuFunctions::IsRebootEnabled>, "IsRebootEnabled"},
|
|
||||||
FunctionInfo{50, nullptr, "LaunchSystemApplet"},
|
|
||||||
FunctionInfo{51, nullptr, "LaunchStarter"},
|
|
||||||
FunctionInfo{100, nullptr, "PopRequestLaunchApplicationForDebug"},
|
|
||||||
FunctionInfo{110, D<&IHomeMenuFunctions::IsForceTerminateApplicationDisabledForDebug>, "IsForceTerminateApplicationDisabledForDebug"},
|
|
||||||
FunctionInfo{200, nullptr, "LaunchDevMenu"},
|
|
||||||
FunctionInfo{1000, nullptr, "SetLastApplicationExitReason"}
|
|
||||||
);
|
|
||||||
return HandlerTableGenerateWithFind(key, functions);
|
|
||||||
}
|
|
||||||
|
|
||||||
IHomeMenuFunctions::IHomeMenuFunctions(Core::System& system_, std::shared_ptr<Applet> applet,
|
IHomeMenuFunctions::IHomeMenuFunctions(Core::System& system_, std::shared_ptr<Applet> applet,
|
||||||
WindowSystem& window_system)
|
WindowSystem& window_system)
|
||||||
: ServiceFramework{system_, "IHomeMenuFunctions"}, m_window_system{window_system},
|
: ServiceFramework{system_, "IHomeMenuFunctions"}, m_window_system{window_system},
|
||||||
m_applet{std::move(applet)}, m_context{system, "IHomeMenuFunctions"} {
|
m_applet{std::move(applet)}, m_context{system, "IHomeMenuFunctions"} {
|
||||||
|
// clang-format off
|
||||||
|
static const FunctionInfo functions[] = {
|
||||||
|
{10, D<&IHomeMenuFunctions::RequestToGetForeground>, "RequestToGetForeground"},
|
||||||
|
{11, D<&IHomeMenuFunctions::LockForeground>, "LockForeground"},
|
||||||
|
{12, D<&IHomeMenuFunctions::UnlockForeground>, "UnlockForeground"},
|
||||||
|
{20, D<&IHomeMenuFunctions::PopFromGeneralChannel>, "PopFromGeneralChannel"},
|
||||||
|
{21, D<&IHomeMenuFunctions::GetPopFromGeneralChannelEvent>, "GetPopFromGeneralChannelEvent"},
|
||||||
|
{30, nullptr, "GetHomeButtonWriterLockAccessor"},
|
||||||
|
{31, nullptr, "GetWriterLockAccessorEx"},
|
||||||
|
{40, D<&IHomeMenuFunctions::IsSleepEnabled>, "IsSleepEnabled"},
|
||||||
|
{41, D<&IHomeMenuFunctions::IsRebootEnabled>, "IsRebootEnabled"},
|
||||||
|
{50, nullptr, "LaunchSystemApplet"},
|
||||||
|
{51, nullptr, "LaunchStarter"},
|
||||||
|
{100, nullptr, "PopRequestLaunchApplicationForDebug"},
|
||||||
|
{110, D<&IHomeMenuFunctions::IsForceTerminateApplicationDisabledForDebug>, "IsForceTerminateApplicationDisabledForDebug"},
|
||||||
|
{200, nullptr, "LaunchDevMenu"},
|
||||||
|
{1000, nullptr, "SetLastApplicationExitReason"},
|
||||||
|
};
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
|
RegisterHandlers(functions);
|
||||||
}
|
}
|
||||||
|
|
||||||
IHomeMenuFunctions::~IHomeMenuFunctions() = default;
|
IHomeMenuFunctions::~IHomeMenuFunctions() = default;
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ private:
|
|||||||
Result IsForceTerminateApplicationDisabledForDebug(
|
Result IsForceTerminateApplicationDisabledForDebug(
|
||||||
Out<bool> out_is_force_terminate_application_disabled_for_debug);
|
Out<bool> out_is_force_terminate_application_disabled_for_debug);
|
||||||
|
|
||||||
std::optional<FunctionInfoBase> FindRequest(u32 key) override;
|
|
||||||
WindowSystem& m_window_system;
|
WindowSystem& m_window_system;
|
||||||
const std::shared_ptr<Applet> m_applet;
|
const std::shared_ptr<Applet> m_applet;
|
||||||
KernelHelpers::ServiceContext m_context;
|
KernelHelpers::ServiceContext m_context;
|
||||||
|
|||||||
@@ -17,7 +17,9 @@
|
|||||||
|
|
||||||
namespace Service::AM {
|
namespace Service::AM {
|
||||||
|
|
||||||
static void EnableSingleUserPlay(const std::shared_ptr<LibraryAppletStorage>& impl) {
|
namespace {
|
||||||
|
|
||||||
|
void EnableSingleUserPlay(const std::shared_ptr<LibraryAppletStorage>& impl) {
|
||||||
constexpr s64 DisplayOptionsOffset = 0x90;
|
constexpr s64 DisplayOptionsOffset = 0x90;
|
||||||
constexpr s64 IsSkipEnabledOffset = 1;
|
constexpr s64 IsSkipEnabledOffset = 1;
|
||||||
constexpr s64 ShowSkipButtonOffset = 4;
|
constexpr s64 ShowSkipButtonOffset = 4;
|
||||||
@@ -27,7 +29,7 @@ static void EnableSingleUserPlay(const std::shared_ptr<LibraryAppletStorage>& im
|
|||||||
impl->Write(DisplayOptionsOffset + ShowSkipButtonOffset, &enabled, sizeof(enabled));
|
impl->Write(DisplayOptionsOffset + ShowSkipButtonOffset, &enabled, sizeof(enabled));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ReplaceEmptyUuidWithCurrentUser(const std::shared_ptr<LibraryAppletStorage>& impl) {
|
void ReplaceEmptyUuidWithCurrentUser(const std::shared_ptr<LibraryAppletStorage>& impl) {
|
||||||
Frontend::UiReturnArg return_arg{};
|
Frontend::UiReturnArg return_arg{};
|
||||||
impl->Read(0, &return_arg, sizeof(return_arg));
|
impl->Read(0, &return_arg, sizeof(return_arg));
|
||||||
|
|
||||||
@@ -45,40 +47,42 @@ static void ReplaceEmptyUuidWithCurrentUser(const std::shared_ptr<LibraryAppletS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::optional<ServiceFrameworkBase::FunctionInfoBase> ILibraryAppletAccessor::FindRequest(u32 key) {
|
} // namespace
|
||||||
static constexpr auto functions = CreateStaticMap(
|
|
||||||
FunctionInfo{0, D<&ILibraryAppletAccessor::GetAppletStateChangedEvent>, "GetAppletStateChangedEvent"},
|
|
||||||
FunctionInfo{1, D<&ILibraryAppletAccessor::IsCompleted>, "IsCompleted"},
|
|
||||||
FunctionInfo{10, D<&ILibraryAppletAccessor::Start>, "Start"},
|
|
||||||
FunctionInfo{20, D<&ILibraryAppletAccessor::RequestExit>, "RequestExit"},
|
|
||||||
FunctionInfo{25, D<&ILibraryAppletAccessor::Terminate>, "Terminate"},
|
|
||||||
FunctionInfo{30, D<&ILibraryAppletAccessor::GetResult>, "GetResult"},
|
|
||||||
FunctionInfo{50, nullptr, "SetOutOfFocusApplicationSuspendingEnabled"},
|
|
||||||
FunctionInfo{60, D<&ILibraryAppletAccessor::PresetLibraryAppletGpuTimeSliceZero>, "PresetLibraryAppletGpuTimeSliceZero", MakeVersionGate({10,0,0})},
|
|
||||||
FunctionInfo{80, nullptr, "RequestForLibraryAppletToGetForeground", MakeVersionGate({19,0,0})},
|
|
||||||
FunctionInfo{81, nullptr, "GetCurrentChildLibraryApplet", MakeVersionGate({19,0,0})},
|
|
||||||
FunctionInfo{90, D<&ILibraryAppletAccessor::Unknown90>, "Unknown90", MakeVersionGate({20,0,0})},
|
|
||||||
FunctionInfo{100, D<&ILibraryAppletAccessor::PushInData>, "PushInData"},
|
|
||||||
FunctionInfo{101, D<&ILibraryAppletAccessor::PopOutData>, "PopOutData"},
|
|
||||||
FunctionInfo{102, nullptr, "PushExtraStorage"},
|
|
||||||
FunctionInfo{103, D<&ILibraryAppletAccessor::PushInteractiveInData>, "PushInteractiveInData"},
|
|
||||||
FunctionInfo{104, D<&ILibraryAppletAccessor::PopInteractiveOutData>, "PopInteractiveOutData"},
|
|
||||||
FunctionInfo{105, D<&ILibraryAppletAccessor::GetPopOutDataEvent>, "GetPopOutDataEvent"},
|
|
||||||
FunctionInfo{106, D<&ILibraryAppletAccessor::GetPopInteractiveOutDataEvent>, "GetPopInteractiveOutDataEvent"},
|
|
||||||
FunctionInfo{110, nullptr, "NeedsToExitProcess"},
|
|
||||||
FunctionInfo{120, D<&ILibraryAppletAccessor::GetLibraryAppletInfo>, "GetLibraryAppletInfo"},
|
|
||||||
FunctionInfo{150, nullptr, "RequestForAppletToGetForeground"},
|
|
||||||
FunctionInfo{160, D<&ILibraryAppletAccessor::GetIndirectLayerConsumerHandle>, "GetIndirectLayerConsumerHandle", MakeVersionGate({2,0,0})},
|
|
||||||
FunctionInfo{170, D<&ILibraryAppletAccessor::Unknown170>, "Unknown170", MakeVersionGate({22,0,0})}
|
|
||||||
);
|
|
||||||
return HandlerTableGenerateWithFind(key, functions);
|
|
||||||
}
|
|
||||||
|
|
||||||
ILibraryAppletAccessor::ILibraryAppletAccessor(Core::System& system_,
|
ILibraryAppletAccessor::ILibraryAppletAccessor(Core::System& system_,
|
||||||
std::shared_ptr<AppletDataBroker> broker,
|
std::shared_ptr<AppletDataBroker> broker,
|
||||||
std::shared_ptr<Applet> applet)
|
std::shared_ptr<Applet> applet)
|
||||||
: ServiceFramework{system_, "ILibraryAppletAccessor"}, m_broker{std::move(broker)},
|
: ServiceFramework{system_, "ILibraryAppletAccessor"}, m_broker{std::move(broker)},
|
||||||
m_applet{std::move(applet)} {
|
m_applet{std::move(applet)} {
|
||||||
|
// clang-format off
|
||||||
|
static const FunctionInfo functions[] = {
|
||||||
|
{0, D<&ILibraryAppletAccessor::GetAppletStateChangedEvent>, "GetAppletStateChangedEvent"},
|
||||||
|
{1, D<&ILibraryAppletAccessor::IsCompleted>, "IsCompleted"},
|
||||||
|
{10, D<&ILibraryAppletAccessor::Start>, "Start"},
|
||||||
|
{20, D<&ILibraryAppletAccessor::RequestExit>, "RequestExit"},
|
||||||
|
{25, D<&ILibraryAppletAccessor::Terminate>, "Terminate"},
|
||||||
|
{30, D<&ILibraryAppletAccessor::GetResult>, "GetResult"},
|
||||||
|
{50, nullptr, "SetOutOfFocusApplicationSuspendingEnabled"},
|
||||||
|
{60, D<&ILibraryAppletAccessor::PresetLibraryAppletGpuTimeSliceZero>, "PresetLibraryAppletGpuTimeSliceZero"}, //10.0.0+
|
||||||
|
{80, nullptr, "RequestForLibraryAppletToGetForeground"}, //19.0.0+
|
||||||
|
{81, nullptr, "GetCurrentChildLibraryApplet"}, //19.0.0+
|
||||||
|
{90, D<&ILibraryAppletAccessor::Unknown90>, "Unknown90"}, //20.0.0+
|
||||||
|
{100, D<&ILibraryAppletAccessor::PushInData>, "PushInData"},
|
||||||
|
{101, D<&ILibraryAppletAccessor::PopOutData>, "PopOutData"},
|
||||||
|
{102, nullptr, "PushExtraStorage"},
|
||||||
|
{103, D<&ILibraryAppletAccessor::PushInteractiveInData>, "PushInteractiveInData"},
|
||||||
|
{104, D<&ILibraryAppletAccessor::PopInteractiveOutData>, "PopInteractiveOutData"},
|
||||||
|
{105, D<&ILibraryAppletAccessor::GetPopOutDataEvent>, "GetPopOutDataEvent"},
|
||||||
|
{106, D<&ILibraryAppletAccessor::GetPopInteractiveOutDataEvent>, "GetPopInteractiveOutDataEvent"},
|
||||||
|
{110, nullptr, "NeedsToExitProcess"},
|
||||||
|
{120, D<&ILibraryAppletAccessor::GetLibraryAppletInfo>, "GetLibraryAppletInfo"},
|
||||||
|
{150, nullptr, "RequestForAppletToGetForeground"},
|
||||||
|
{160, D<&ILibraryAppletAccessor::GetIndirectLayerConsumerHandle>, "GetIndirectLayerConsumerHandle"}, //2.0.0+
|
||||||
|
{170, D<&ILibraryAppletAccessor::Unknown170>, "Unknown170"}, //22.0.0+
|
||||||
|
};
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
|
RegisterHandlers(functions);
|
||||||
}
|
}
|
||||||
|
|
||||||
ILibraryAppletAccessor::~ILibraryAppletAccessor() = default;
|
ILibraryAppletAccessor::~ILibraryAppletAccessor() = default;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "core/hle/service/am/service/library_applet_self_accessor.h"
|
||||||
#include "core/hle/service/cmif_types.h"
|
#include "core/hle/service/cmif_types.h"
|
||||||
#include "core/hle/service/service.h"
|
#include "core/hle/service/service.h"
|
||||||
|
|
||||||
@@ -15,26 +16,6 @@ class AppletDataBroker;
|
|||||||
struct Applet;
|
struct Applet;
|
||||||
class IStorage;
|
class IStorage;
|
||||||
|
|
||||||
struct LibraryAppletInfo {
|
|
||||||
AppletId applet_id;
|
|
||||||
LibraryAppletMode library_applet_mode;
|
|
||||||
};
|
|
||||||
static_assert(sizeof(LibraryAppletInfo) == 0x8, "LibraryAppletInfo has incorrect size.");
|
|
||||||
|
|
||||||
struct ErrorCode {
|
|
||||||
u32 category;
|
|
||||||
u32 number;
|
|
||||||
};
|
|
||||||
static_assert(sizeof(ErrorCode) == 0x8, "ErrorCode has incorrect size.");
|
|
||||||
|
|
||||||
struct ErrorContext {
|
|
||||||
u8 type;
|
|
||||||
INSERT_PADDING_BYTES_NOINIT(0x7);
|
|
||||||
std::array<u8, 0x1f4> data;
|
|
||||||
Result result;
|
|
||||||
};
|
|
||||||
static_assert(sizeof(ErrorContext) == 0x200, "ErrorContext has incorrect size.");
|
|
||||||
|
|
||||||
class ILibraryAppletAccessor final : public ServiceFramework<ILibraryAppletAccessor> {
|
class ILibraryAppletAccessor final : public ServiceFramework<ILibraryAppletAccessor> {
|
||||||
public:
|
public:
|
||||||
explicit ILibraryAppletAccessor(Core::System& system_, std::shared_ptr<AppletDataBroker> broker,
|
explicit ILibraryAppletAccessor(Core::System& system_, std::shared_ptr<AppletDataBroker> broker,
|
||||||
@@ -68,7 +49,6 @@ private:
|
|||||||
void FrontendExecuteInteractive();
|
void FrontendExecuteInteractive();
|
||||||
void FrontendRequestExit();
|
void FrontendRequestExit();
|
||||||
|
|
||||||
std::optional<FunctionInfoBase> FindRequest(u32 key) override;
|
|
||||||
const std::shared_ptr<AppletDataBroker> m_broker;
|
const std::shared_ptr<AppletDataBroker> m_broker;
|
||||||
const std::shared_ptr<Applet> m_applet;
|
const std::shared_ptr<Applet> m_applet;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,287 @@
|
|||||||
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#include "common/settings.h"
|
||||||
|
#include "core/hle/kernel/k_transfer_memory.h"
|
||||||
|
#include "core/hle/service/am/applet_data_broker.h"
|
||||||
|
#include "core/hle/service/am/applet_manager.h"
|
||||||
|
#include "core/hle/service/am/frontend/applets.h"
|
||||||
|
#include "core/hle/service/am/library_applet_storage.h"
|
||||||
|
#include "core/hle/service/am/process_creation.h"
|
||||||
|
#include "core/hle/service/am/service/library_applet_accessor.h"
|
||||||
|
#include "core/hle/service/am/service/library_applet_creator.h"
|
||||||
|
|
||||||
|
#include "core/hle/api_version.h"
|
||||||
|
#include "core/hle/service/am/service/storage.h"
|
||||||
|
#include "core/hle/service/am/window_system.h"
|
||||||
|
#include "core/hle/service/cmif_serialization.h"
|
||||||
|
#include "core/hle/service/sm/sm.h"
|
||||||
|
|
||||||
|
namespace Service::AM {
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
bool ShouldCreateGuestApplet(AppletId applet_id) {
|
||||||
|
#define X(Name, name) \
|
||||||
|
if (applet_id == AppletId::Name && \
|
||||||
|
Settings::values.name##_applet_mode.GetValue() != Settings::AppletMode::LLE) { \
|
||||||
|
return false; \
|
||||||
|
}
|
||||||
|
|
||||||
|
X(Cabinet, cabinet)
|
||||||
|
X(Controller, controller)
|
||||||
|
X(DataErase, data_erase)
|
||||||
|
X(Error, error)
|
||||||
|
X(NetConnect, net_connect)
|
||||||
|
X(ProfileSelect, player_select)
|
||||||
|
X(SoftwareKeyboard, swkbd)
|
||||||
|
X(MiiEdit, mii_edit)
|
||||||
|
X(Web, web)
|
||||||
|
X(Shop, shop)
|
||||||
|
X(PhotoViewer, photo_viewer)
|
||||||
|
X(OfflineWeb, offline_web)
|
||||||
|
X(LoginShare, login_share)
|
||||||
|
X(WebAuth, wifi_web_auth)
|
||||||
|
X(MyPage, my_page)
|
||||||
|
|
||||||
|
#undef X
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
AppletProgramId AppletIdToProgramId(AppletId applet_id) {
|
||||||
|
switch (applet_id) {
|
||||||
|
case AppletId::OverlayDisplay:
|
||||||
|
return AppletProgramId::OverlayDisplay;
|
||||||
|
case AppletId::QLaunch:
|
||||||
|
return AppletProgramId::QLaunch;
|
||||||
|
case AppletId::Starter:
|
||||||
|
return AppletProgramId::Starter;
|
||||||
|
case AppletId::Auth:
|
||||||
|
return AppletProgramId::Auth;
|
||||||
|
case AppletId::Cabinet:
|
||||||
|
return AppletProgramId::Cabinet;
|
||||||
|
case AppletId::Controller:
|
||||||
|
return AppletProgramId::Controller;
|
||||||
|
case AppletId::DataErase:
|
||||||
|
return AppletProgramId::DataErase;
|
||||||
|
case AppletId::Error:
|
||||||
|
return AppletProgramId::Error;
|
||||||
|
case AppletId::NetConnect:
|
||||||
|
return AppletProgramId::NetConnect;
|
||||||
|
case AppletId::ProfileSelect:
|
||||||
|
return AppletProgramId::ProfileSelect;
|
||||||
|
case AppletId::SoftwareKeyboard:
|
||||||
|
return AppletProgramId::SoftwareKeyboard;
|
||||||
|
case AppletId::MiiEdit:
|
||||||
|
return AppletProgramId::MiiEdit;
|
||||||
|
case AppletId::Web:
|
||||||
|
return AppletProgramId::Web;
|
||||||
|
case AppletId::Shop:
|
||||||
|
return AppletProgramId::Shop;
|
||||||
|
case AppletId::PhotoViewer:
|
||||||
|
return AppletProgramId::PhotoViewer;
|
||||||
|
case AppletId::Settings:
|
||||||
|
return AppletProgramId::Settings;
|
||||||
|
case AppletId::OfflineWeb:
|
||||||
|
return AppletProgramId::OfflineWeb;
|
||||||
|
case AppletId::LoginShare:
|
||||||
|
return AppletProgramId::LoginShare;
|
||||||
|
case AppletId::WebAuth:
|
||||||
|
return AppletProgramId::WebAuth;
|
||||||
|
case AppletId::MyPage:
|
||||||
|
return AppletProgramId::MyPage;
|
||||||
|
default:
|
||||||
|
return static_cast<AppletProgramId>(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<ILibraryAppletAccessor> CreateGuestApplet(Core::System& system,
|
||||||
|
WindowSystem& window_system,
|
||||||
|
std::shared_ptr<Applet> caller_applet,
|
||||||
|
AppletId applet_id,
|
||||||
|
LibraryAppletMode mode) {
|
||||||
|
const auto program_id = static_cast<u64>(AppletIdToProgramId(applet_id));
|
||||||
|
if (program_id == 0) {
|
||||||
|
// Unknown applet
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
auto process = CreateProcess(system, program_id, 1, HLE::ApiVersion::HOS_VERSION_MAJOR);
|
||||||
|
if (process) {
|
||||||
|
const auto applet = std::make_shared<Applet>(system, std::move(process), false);
|
||||||
|
applet->program_id = program_id;
|
||||||
|
applet->applet_id = applet_id;
|
||||||
|
applet->type = AppletType::LibraryApplet;
|
||||||
|
applet->library_applet_mode = mode;
|
||||||
|
applet->window_visible = mode != LibraryAppletMode::AllForegroundInitiallyHidden;
|
||||||
|
|
||||||
|
auto broker = std::make_shared<AppletDataBroker>(system);
|
||||||
|
applet->caller_applet = caller_applet;
|
||||||
|
applet->caller_applet_broker = broker;
|
||||||
|
{
|
||||||
|
std::scoped_lock lk{caller_applet->lock};
|
||||||
|
caller_applet->child_applets.push_back(applet);
|
||||||
|
}
|
||||||
|
window_system.TrackApplet(applet, false);
|
||||||
|
return std::make_shared<ILibraryAppletAccessor>(system, broker, applet);
|
||||||
|
}
|
||||||
|
// Couldn't initialize the guest process
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<ILibraryAppletAccessor> CreateFrontendApplet(Core::System& system,
|
||||||
|
WindowSystem& window_system,
|
||||||
|
std::shared_ptr<Applet> caller_applet,
|
||||||
|
AppletId applet_id,
|
||||||
|
LibraryAppletMode mode) {
|
||||||
|
const auto program_id = static_cast<u64>(AppletIdToProgramId(applet_id));
|
||||||
|
|
||||||
|
auto process = std::make_unique<Process>(system);
|
||||||
|
auto applet = std::make_shared<Applet>(system, std::move(process), false);
|
||||||
|
applet->program_id = program_id;
|
||||||
|
applet->applet_id = applet_id;
|
||||||
|
applet->type = AppletType::LibraryApplet;
|
||||||
|
applet->library_applet_mode = mode;
|
||||||
|
|
||||||
|
auto storage = std::make_shared<AppletDataBroker>(system);
|
||||||
|
applet->caller_applet = caller_applet;
|
||||||
|
applet->caller_applet_broker = storage;
|
||||||
|
applet->frontend = system.GetFrontendAppletHolder().GetApplet(applet, applet_id, mode);
|
||||||
|
{
|
||||||
|
std::scoped_lock lk{caller_applet->lock};
|
||||||
|
caller_applet->child_applets.push_back(applet);
|
||||||
|
}
|
||||||
|
return std::make_shared<ILibraryAppletAccessor>(system, storage, applet);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
ILibraryAppletCreator::ILibraryAppletCreator(Core::System& system_, std::shared_ptr<Applet> applet,
|
||||||
|
WindowSystem& window_system)
|
||||||
|
: ServiceFramework{system_, "ILibraryAppletCreator"},
|
||||||
|
m_window_system{window_system}, m_applet{std::move(applet)} {
|
||||||
|
static const FunctionInfo functions[] = {
|
||||||
|
{0, D<&ILibraryAppletCreator::CreateLibraryApplet>, "CreateLibraryApplet"},
|
||||||
|
{1, nullptr, "TerminateAllLibraryApplets"},
|
||||||
|
{2, nullptr, "AreAnyLibraryAppletsLeft"},
|
||||||
|
{3, D<&ILibraryAppletCreator::CreateLibraryAppletEx>, "CreateLibraryAppletEx"},
|
||||||
|
{10, D<&ILibraryAppletCreator::CreateStorage>, "CreateStorage"},
|
||||||
|
{11, D<&ILibraryAppletCreator::CreateTransferMemoryStorage>, "CreateTransferMemoryStorage"},
|
||||||
|
{12, D<&ILibraryAppletCreator::CreateHandleStorage>, "CreateHandleStorage"},
|
||||||
|
};
|
||||||
|
RegisterHandlers(functions);
|
||||||
|
}
|
||||||
|
|
||||||
|
ILibraryAppletCreator::~ILibraryAppletCreator() = default;
|
||||||
|
|
||||||
|
Result ILibraryAppletCreator::CreateLibraryApplet(
|
||||||
|
Out<SharedPointer<ILibraryAppletAccessor>> out_library_applet_accessor, AppletId applet_id,
|
||||||
|
LibraryAppletMode library_applet_mode) {
|
||||||
|
LOG_DEBUG(Service_AM, "called with applet_id={} applet_mode={}", applet_id,
|
||||||
|
library_applet_mode);
|
||||||
|
|
||||||
|
std::shared_ptr<ILibraryAppletAccessor> library_applet;
|
||||||
|
if (ShouldCreateGuestApplet(applet_id)) {
|
||||||
|
library_applet =
|
||||||
|
CreateGuestApplet(system, m_window_system, m_applet, applet_id, library_applet_mode);
|
||||||
|
}
|
||||||
|
if (!library_applet) {
|
||||||
|
library_applet =
|
||||||
|
CreateFrontendApplet(system, m_window_system, m_applet, applet_id, library_applet_mode);
|
||||||
|
}
|
||||||
|
if (!library_applet) {
|
||||||
|
LOG_ERROR(Service_AM, "Applet doesn't exist! applet_id={}", applet_id);
|
||||||
|
R_THROW(ResultUnknown);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Applet is created, can now be launched.
|
||||||
|
m_applet->library_applet_launchable_event.Signal(system.Kernel());
|
||||||
|
*out_library_applet_accessor = library_applet;
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletCreator::CreateLibraryAppletEx(
|
||||||
|
Out<SharedPointer<ILibraryAppletAccessor>> out_library_applet_accessor, AppletId applet_id,
|
||||||
|
LibraryAppletMode library_applet_mode, u64 thread_id) {
|
||||||
|
LOG_DEBUG(Service_AM, "called with applet_id={} applet_mode={} thread_id={}", applet_id,
|
||||||
|
library_applet_mode, thread_id);
|
||||||
|
|
||||||
|
std::shared_ptr<ILibraryAppletAccessor> library_applet;
|
||||||
|
if (ShouldCreateGuestApplet(applet_id)) {
|
||||||
|
library_applet =
|
||||||
|
CreateGuestApplet(system, m_window_system, m_applet, applet_id, library_applet_mode);
|
||||||
|
}
|
||||||
|
if (!library_applet) {
|
||||||
|
library_applet =
|
||||||
|
CreateFrontendApplet(system, m_window_system, m_applet, applet_id, library_applet_mode);
|
||||||
|
}
|
||||||
|
if (!library_applet) {
|
||||||
|
LOG_ERROR(Service_AM, "Applet doesn't exist! applet_id={}", applet_id);
|
||||||
|
R_THROW(ResultUnknown);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Applet is created, can now be launched.
|
||||||
|
m_applet->library_applet_launchable_event.Signal(system.Kernel());
|
||||||
|
*out_library_applet_accessor = library_applet;
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletCreator::CreateStorage(Out<SharedPointer<IStorage>> out_storage, s64 size) {
|
||||||
|
LOG_DEBUG(Service_AM, "called, size={}", size);
|
||||||
|
|
||||||
|
if (size <= 0) {
|
||||||
|
LOG_ERROR(Service_AM, "size is less than or equal to 0");
|
||||||
|
R_THROW(ResultUnknown);
|
||||||
|
}
|
||||||
|
|
||||||
|
*out_storage = std::make_shared<IStorage>(system, AM::CreateStorage(std::vector<u8>(size)));
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletCreator::CreateTransferMemoryStorage(
|
||||||
|
Out<SharedPointer<IStorage>> out_storage, bool is_writable, s64 size,
|
||||||
|
InCopyHandle<Kernel::KTransferMemory> transfer_memory_handle) {
|
||||||
|
LOG_DEBUG(Service_AM, "called, is_writable={} size={}", is_writable, size);
|
||||||
|
|
||||||
|
if (size <= 0) {
|
||||||
|
LOG_ERROR(Service_AM, "size is less than or equal to 0");
|
||||||
|
R_THROW(ResultUnknown);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!transfer_memory_handle) {
|
||||||
|
LOG_ERROR(Service_AM, "transfer_memory_handle is null");
|
||||||
|
R_THROW(ResultUnknown);
|
||||||
|
}
|
||||||
|
|
||||||
|
*out_storage = std::make_shared<IStorage>(
|
||||||
|
system, AM::CreateTransferMemoryStorage(system.Kernel(), transfer_memory_handle->GetOwner()->GetMemory(),
|
||||||
|
transfer_memory_handle.Get(), is_writable, size));
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletCreator::CreateHandleStorage(
|
||||||
|
Out<SharedPointer<IStorage>> out_storage, s64 size,
|
||||||
|
InCopyHandle<Kernel::KTransferMemory> transfer_memory_handle) {
|
||||||
|
LOG_DEBUG(Service_AM, "called, size={}", size);
|
||||||
|
|
||||||
|
if (size <= 0) {
|
||||||
|
LOG_ERROR(Service_AM, "size is less than or equal to 0");
|
||||||
|
R_THROW(ResultUnknown);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!transfer_memory_handle) {
|
||||||
|
LOG_ERROR(Service_AM, "transfer_memory_handle is null");
|
||||||
|
R_THROW(ResultUnknown);
|
||||||
|
}
|
||||||
|
|
||||||
|
*out_storage = std::make_shared<IStorage>(
|
||||||
|
system, AM::CreateHandleStorage(system.Kernel(), transfer_memory_handle->GetOwner()->GetMemory(),
|
||||||
|
transfer_memory_handle.Get(), size));
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace Service::AM
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "core/hle/service/am/am_types.h"
|
||||||
|
#include "core/hle/service/cmif_types.h"
|
||||||
|
#include "core/hle/service/service.h"
|
||||||
|
|
||||||
|
namespace Service::AM {
|
||||||
|
|
||||||
|
struct Applet;
|
||||||
|
class ILibraryAppletAccessor;
|
||||||
|
class IStorage;
|
||||||
|
class WindowSystem;
|
||||||
|
|
||||||
|
class ILibraryAppletCreator final : public ServiceFramework<ILibraryAppletCreator> {
|
||||||
|
public:
|
||||||
|
explicit ILibraryAppletCreator(Core::System& system_, std::shared_ptr<Applet> applet,
|
||||||
|
WindowSystem& window_system);
|
||||||
|
~ILibraryAppletCreator() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
Result CreateLibraryApplet(
|
||||||
|
Out<SharedPointer<ILibraryAppletAccessor>> out_library_applet_accessor, AppletId applet_id,
|
||||||
|
LibraryAppletMode library_applet_mode);
|
||||||
|
Result CreateLibraryAppletEx(
|
||||||
|
Out<SharedPointer<ILibraryAppletAccessor>> out_library_applet_accessor, AppletId applet_id,
|
||||||
|
LibraryAppletMode library_applet_mode, u64 thread_id);
|
||||||
|
Result CreateStorage(Out<SharedPointer<IStorage>> out_storage, s64 size);
|
||||||
|
Result CreateTransferMemoryStorage(
|
||||||
|
Out<SharedPointer<IStorage>> out_storage, bool is_writable, s64 size,
|
||||||
|
InCopyHandle<Kernel::KTransferMemory> transfer_memory_handle);
|
||||||
|
Result CreateHandleStorage(Out<SharedPointer<IStorage>> out_storage, s64 size,
|
||||||
|
InCopyHandle<Kernel::KTransferMemory> transfer_memory_handle);
|
||||||
|
|
||||||
|
WindowSystem& m_window_system;
|
||||||
|
const std::shared_ptr<Applet> m_applet;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Service::AM
|
||||||
@@ -0,0 +1,134 @@
|
|||||||
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#include "core/hle/service/am/service/applet_common_functions.h"
|
||||||
|
#include "core/hle/service/am/service/audio_controller.h"
|
||||||
|
#include "core/hle/service/am/service/common_state_getter.h"
|
||||||
|
#include "core/hle/service/am/service/debug_functions.h"
|
||||||
|
#include "core/hle/service/am/service/display_controller.h"
|
||||||
|
#include "core/hle/service/am/service/global_state_controller.h"
|
||||||
|
#include "core/hle/service/am/service/home_menu_functions.h"
|
||||||
|
#include "core/hle/service/am/service/library_applet_creator.h"
|
||||||
|
#include "core/hle/service/am/service/library_applet_proxy.h"
|
||||||
|
#include "core/hle/service/am/service/library_applet_self_accessor.h"
|
||||||
|
#include "core/hle/service/am/service/process_winding_controller.h"
|
||||||
|
#include "core/hle/service/am/service/self_controller.h"
|
||||||
|
#include "core/hle/service/am/service/window_controller.h"
|
||||||
|
#include "core/hle/service/cmif_serialization.h"
|
||||||
|
|
||||||
|
namespace Service::AM {
|
||||||
|
|
||||||
|
ILibraryAppletProxy::ILibraryAppletProxy(Core::System& system_, std::shared_ptr<Applet> applet,
|
||||||
|
Kernel::KProcess* process, WindowSystem& window_system)
|
||||||
|
: ServiceFramework{system_, "ILibraryAppletProxy"},
|
||||||
|
m_window_system{window_system}, m_process{process}, m_applet{std::move(applet)} {
|
||||||
|
// clang-format off
|
||||||
|
static const FunctionInfo functions[] = {
|
||||||
|
{0, D<&ILibraryAppletProxy::GetCommonStateGetter>, "GetCommonStateGetter"},
|
||||||
|
{1, D<&ILibraryAppletProxy::GetSelfController>, "GetSelfController"},
|
||||||
|
{2, D<&ILibraryAppletProxy::GetWindowController>, "GetWindowController"},
|
||||||
|
{3, D<&ILibraryAppletProxy::GetAudioController>, "GetAudioController"},
|
||||||
|
{4, D<&ILibraryAppletProxy::GetDisplayController>, "GetDisplayController"},
|
||||||
|
{10, D<&ILibraryAppletProxy::GetProcessWindingController>, "GetProcessWindingController"},
|
||||||
|
{11, D<&ILibraryAppletProxy::GetLibraryAppletCreator>, "GetLibraryAppletCreator"},
|
||||||
|
{20, D<&ILibraryAppletProxy::OpenLibraryAppletSelfAccessor>, "OpenLibraryAppletSelfAccessor"},
|
||||||
|
{21, D<&ILibraryAppletProxy::GetAppletCommonFunctions>, "GetAppletCommonFunctions"},
|
||||||
|
{22, D<&ILibraryAppletProxy::GetHomeMenuFunctions>, "GetHomeMenuFunctions"},
|
||||||
|
{23, D<&ILibraryAppletProxy::GetGlobalStateController>, "GetGlobalStateController"},
|
||||||
|
{1000, D<&ILibraryAppletProxy::GetDebugFunctions>, "GetDebugFunctions"},
|
||||||
|
};
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
|
RegisterHandlers(functions);
|
||||||
|
}
|
||||||
|
|
||||||
|
ILibraryAppletProxy::~ILibraryAppletProxy() = default;
|
||||||
|
|
||||||
|
Result ILibraryAppletProxy::GetAudioController(
|
||||||
|
Out<SharedPointer<IAudioController>> out_audio_controller) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_audio_controller = std::make_shared<IAudioController>(system);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletProxy::GetDisplayController(
|
||||||
|
Out<SharedPointer<IDisplayController>> out_display_controller) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_display_controller = std::make_shared<IDisplayController>(system, m_applet);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletProxy::GetProcessWindingController(
|
||||||
|
Out<SharedPointer<IProcessWindingController>> out_process_winding_controller) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_process_winding_controller = std::make_shared<IProcessWindingController>(system, m_applet);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletProxy::GetDebugFunctions(
|
||||||
|
Out<SharedPointer<IDebugFunctions>> out_debug_functions) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_debug_functions = std::make_shared<IDebugFunctions>(system);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletProxy::GetWindowController(
|
||||||
|
Out<SharedPointer<IWindowController>> out_window_controller) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_window_controller = std::make_shared<IWindowController>(system, m_applet, m_window_system);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletProxy::GetSelfController(
|
||||||
|
Out<SharedPointer<ISelfController>> out_self_controller) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_self_controller = std::make_shared<ISelfController>(system, m_applet, m_process);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletProxy::GetCommonStateGetter(
|
||||||
|
Out<SharedPointer<ICommonStateGetter>> out_common_state_getter) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_common_state_getter = std::make_shared<ICommonStateGetter>(system, m_applet);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletProxy::GetLibraryAppletCreator(
|
||||||
|
Out<SharedPointer<ILibraryAppletCreator>> out_library_applet_creator) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_library_applet_creator =
|
||||||
|
std::make_shared<ILibraryAppletCreator>(system, m_applet, m_window_system);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletProxy::OpenLibraryAppletSelfAccessor(
|
||||||
|
Out<SharedPointer<ILibraryAppletSelfAccessor>> out_library_applet_self_accessor) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_library_applet_self_accessor =
|
||||||
|
std::make_shared<ILibraryAppletSelfAccessor>(system, m_applet);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletProxy::GetAppletCommonFunctions(
|
||||||
|
Out<SharedPointer<IAppletCommonFunctions>> out_applet_common_functions) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_applet_common_functions = std::make_shared<IAppletCommonFunctions>(system, m_applet);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletProxy::GetHomeMenuFunctions(
|
||||||
|
Out<SharedPointer<IHomeMenuFunctions>> out_home_menu_functions) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_home_menu_functions =
|
||||||
|
std::make_shared<IHomeMenuFunctions>(system, m_applet, m_window_system);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletProxy::GetGlobalStateController(
|
||||||
|
Out<SharedPointer<IGlobalStateController>> out_global_state_controller) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_global_state_controller = std::make_shared<IGlobalStateController>(system);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace Service::AM
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "core/hle/service/cmif_types.h"
|
||||||
|
#include "core/hle/service/service.h"
|
||||||
|
|
||||||
|
namespace Service::AM {
|
||||||
|
|
||||||
|
struct Applet;
|
||||||
|
class IAppletCommonFunctions;
|
||||||
|
class IAudioController;
|
||||||
|
class ICommonStateGetter;
|
||||||
|
class IDebugFunctions;
|
||||||
|
class IDisplayController;
|
||||||
|
class IHomeMenuFunctions;
|
||||||
|
class IGlobalStateController;
|
||||||
|
class ILibraryAppletCreator;
|
||||||
|
class ILibraryAppletSelfAccessor;
|
||||||
|
class IProcessWindingController;
|
||||||
|
class ISelfController;
|
||||||
|
class IWindowController;
|
||||||
|
class WindowSystem;
|
||||||
|
|
||||||
|
class ILibraryAppletProxy final : public ServiceFramework<ILibraryAppletProxy> {
|
||||||
|
public:
|
||||||
|
explicit ILibraryAppletProxy(Core::System& system_, std::shared_ptr<Applet> applet,
|
||||||
|
Kernel::KProcess* process, WindowSystem& window_system);
|
||||||
|
~ILibraryAppletProxy();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Result GetAudioController(Out<SharedPointer<IAudioController>> out_audio_controller);
|
||||||
|
Result GetDisplayController(Out<SharedPointer<IDisplayController>> out_display_controller);
|
||||||
|
Result GetProcessWindingController(
|
||||||
|
Out<SharedPointer<IProcessWindingController>> out_process_winding_controller);
|
||||||
|
Result GetDebugFunctions(Out<SharedPointer<IDebugFunctions>> out_debug_functions);
|
||||||
|
Result GetWindowController(Out<SharedPointer<IWindowController>> out_window_controller);
|
||||||
|
Result GetSelfController(Out<SharedPointer<ISelfController>> out_self_controller);
|
||||||
|
Result GetCommonStateGetter(Out<SharedPointer<ICommonStateGetter>> out_common_state_getter);
|
||||||
|
Result GetLibraryAppletCreator(
|
||||||
|
Out<SharedPointer<ILibraryAppletCreator>> out_library_applet_creator);
|
||||||
|
Result OpenLibraryAppletSelfAccessor(
|
||||||
|
Out<SharedPointer<ILibraryAppletSelfAccessor>> out_library_applet_self_accessor);
|
||||||
|
Result GetAppletCommonFunctions(
|
||||||
|
Out<SharedPointer<IAppletCommonFunctions>> out_applet_common_functions);
|
||||||
|
Result GetHomeMenuFunctions(Out<SharedPointer<IHomeMenuFunctions>> out_home_menu_functions);
|
||||||
|
Result GetGlobalStateController(
|
||||||
|
Out<SharedPointer<IGlobalStateController>> out_global_state_controller);
|
||||||
|
|
||||||
|
WindowSystem& m_window_system;
|
||||||
|
Kernel::KProcess* const m_process;
|
||||||
|
const std::shared_ptr<Applet> m_applet;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Service::AM
|
||||||
@@ -0,0 +1,332 @@
|
|||||||
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#include "core/core_timing.h"
|
||||||
|
#include "core/file_sys/control_metadata.h"
|
||||||
|
#include "core/file_sys/patch_manager.h"
|
||||||
|
#include "core/file_sys/registered_cache.h"
|
||||||
|
#include "core/hle/service/acc/profile_manager.h"
|
||||||
|
#include "core/hle/service/am/applet_data_broker.h"
|
||||||
|
#include "core/hle/service/am/applet_manager.h"
|
||||||
|
#include "core/hle/service/am/frontend/applets.h"
|
||||||
|
#include "core/hle/service/am/service/library_applet_self_accessor.h"
|
||||||
|
#include "core/hle/service/am/service/storage.h"
|
||||||
|
#include "core/hle/service/cmif_serialization.h"
|
||||||
|
#include "core/hle/service/filesystem/filesystem.h"
|
||||||
|
#include "core/hle/service/glue/glue_manager.h"
|
||||||
|
#include "core/hle/service/ns/application_manager_interface.h"
|
||||||
|
#include "core/hle/service/ns/service_getter_interface.h"
|
||||||
|
#include "core/hle/service/sm/sm.h"
|
||||||
|
|
||||||
|
namespace Service::AM {
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
AppletIdentityInfo GetCallerIdentity(Applet& applet) {
|
||||||
|
if (const auto caller_applet = applet.caller_applet.lock(); caller_applet) {
|
||||||
|
// TODO: is this actually the application ID?
|
||||||
|
return {
|
||||||
|
.applet_id = caller_applet->applet_id,
|
||||||
|
.application_id = caller_applet->program_id,
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
.applet_id = AppletId::QLaunch,
|
||||||
|
.application_id = 0x0100000000001000ull,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
ILibraryAppletSelfAccessor::ILibraryAppletSelfAccessor(Core::System& system_,
|
||||||
|
std::shared_ptr<Applet> applet)
|
||||||
|
: ServiceFramework{system_, "ILibraryAppletSelfAccessor"}, m_applet{std::move(applet)},
|
||||||
|
m_broker{m_applet->caller_applet_broker} {
|
||||||
|
// clang-format off
|
||||||
|
static const FunctionInfo functions[] = {
|
||||||
|
{0, D<&ILibraryAppletSelfAccessor::PopInData>, "PopInData"},
|
||||||
|
{1, D<&ILibraryAppletSelfAccessor::PushOutData>, "PushOutData"},
|
||||||
|
{2, D<&ILibraryAppletSelfAccessor::PopInteractiveInData>, "PopInteractiveInData"},
|
||||||
|
{3, D<&ILibraryAppletSelfAccessor::PushInteractiveOutData>, "PushInteractiveOutData"},
|
||||||
|
{5, D<&ILibraryAppletSelfAccessor::GetPopInDataEvent>, "GetPopInDataEvent"},
|
||||||
|
{6, D<&ILibraryAppletSelfAccessor::GetPopInteractiveInDataEvent>, "GetPopInteractiveInDataEvent"},
|
||||||
|
{10, D<&ILibraryAppletSelfAccessor::ExitProcessAndReturn>, "ExitProcessAndReturn"},
|
||||||
|
{11, D<&ILibraryAppletSelfAccessor::GetLibraryAppletInfo>, "GetLibraryAppletInfo"},
|
||||||
|
{12, D<&ILibraryAppletSelfAccessor::GetMainAppletIdentityInfo>, "GetMainAppletIdentityInfo"},
|
||||||
|
{13, D<&ILibraryAppletSelfAccessor::CanUseApplicationCore>, "CanUseApplicationCore"},
|
||||||
|
{14, D<&ILibraryAppletSelfAccessor::GetCallerAppletIdentityInfo>, "GetCallerAppletIdentityInfo"},
|
||||||
|
{15, D<&ILibraryAppletSelfAccessor::GetMainAppletApplicationControlProperty>, "GetMainAppletApplicationControlProperty"},
|
||||||
|
{16, D<&ILibraryAppletSelfAccessor::GetMainAppletStorageId>, "GetMainAppletStorageId"},
|
||||||
|
{17, D<&ILibraryAppletSelfAccessor::GetCallerAppletIdentityInfoStack>, "GetCallerAppletIdentityInfoStack"},
|
||||||
|
{18, nullptr, "GetNextReturnDestinationAppletIdentityInfo"},
|
||||||
|
{19, D<&ILibraryAppletSelfAccessor::GetDesirableKeyboardLayout>, "GetDesirableKeyboardLayout"},
|
||||||
|
{20, nullptr, "PopExtraStorage"},
|
||||||
|
{25, nullptr, "GetPopExtraStorageEvent"},
|
||||||
|
{30, D<&ILibraryAppletSelfAccessor::UnpopInData>, "UnpopInData"},
|
||||||
|
{31, nullptr, "UnpopExtraStorage"},
|
||||||
|
{40, nullptr, "GetIndirectLayerProducerHandle"},
|
||||||
|
{50, D<&ILibraryAppletSelfAccessor::ReportVisibleError>, "ReportVisibleError"},
|
||||||
|
{51, D<&ILibraryAppletSelfAccessor::ReportVisibleErrorWithErrorContext>, "ReportVisibleErrorWithErrorContext"},
|
||||||
|
{60, D<&ILibraryAppletSelfAccessor::GetMainAppletApplicationDesiredLanguage>, "GetMainAppletApplicationDesiredLanguage"},
|
||||||
|
{70, D<&ILibraryAppletSelfAccessor::GetCurrentApplicationId>, "GetCurrentApplicationId"},
|
||||||
|
{80, nullptr, "RequestExitToSelf"},
|
||||||
|
{90, nullptr, "CreateApplicationAndPushAndRequestToLaunch"},
|
||||||
|
{100, nullptr, "CreateGameMovieTrimmer"},
|
||||||
|
{101, nullptr, "ReserveResourceForMovieOperation"},
|
||||||
|
{102, nullptr, "UnreserveResourceForMovieOperation"},
|
||||||
|
{110, D<&ILibraryAppletSelfAccessor::GetMainAppletAvailableUsers>, "GetMainAppletAvailableUsers"},
|
||||||
|
{120, nullptr, "GetLaunchStorageInfoForDebug"},
|
||||||
|
{130, nullptr, "GetGpuErrorDetectedSystemEvent"},
|
||||||
|
{140, nullptr, "SetApplicationMemoryReservation"},
|
||||||
|
{150, D<&ILibraryAppletSelfAccessor::ShouldSetGpuTimeSliceManually>, "ShouldSetGpuTimeSliceManually"},
|
||||||
|
{160, D<&ILibraryAppletSelfAccessor::GetLibraryAppletInfoEx>, "GetLibraryAppletInfoEx"},
|
||||||
|
};
|
||||||
|
// clang-format on
|
||||||
|
RegisterHandlers(functions);
|
||||||
|
}
|
||||||
|
|
||||||
|
ILibraryAppletSelfAccessor::~ILibraryAppletSelfAccessor() = default;
|
||||||
|
|
||||||
|
Result ILibraryAppletSelfAccessor::PopInData(Out<SharedPointer<IStorage>> out_storage) {
|
||||||
|
LOG_INFO(Service_AM, "called");
|
||||||
|
R_RETURN(m_broker->GetInData().Pop(system.Kernel(), out_storage));
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletSelfAccessor::PushOutData(SharedPointer<IStorage> storage) {
|
||||||
|
LOG_INFO(Service_AM, "called");
|
||||||
|
m_broker->GetOutData().Push(system.Kernel(), storage);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletSelfAccessor::PopInteractiveInData(Out<SharedPointer<IStorage>> out_storage) {
|
||||||
|
LOG_INFO(Service_AM, "called");
|
||||||
|
R_RETURN(m_broker->GetInteractiveInData().Pop(system.Kernel(), out_storage));
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletSelfAccessor::PushInteractiveOutData(SharedPointer<IStorage> storage) {
|
||||||
|
LOG_INFO(Service_AM, "called");
|
||||||
|
m_broker->GetInteractiveOutData().Push(system.Kernel(), storage);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletSelfAccessor::GetPopInDataEvent(
|
||||||
|
OutCopyHandle<Kernel::KReadableEvent> out_event) {
|
||||||
|
LOG_INFO(Service_AM, "called");
|
||||||
|
*out_event = m_broker->GetInData().GetEvent();
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletSelfAccessor::GetPopInteractiveInDataEvent(
|
||||||
|
OutCopyHandle<Kernel::KReadableEvent> out_event) {
|
||||||
|
LOG_INFO(Service_AM, "called");
|
||||||
|
*out_event = m_broker->GetInteractiveInData().GetEvent();
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletSelfAccessor::GetLibraryAppletInfo(
|
||||||
|
Out<LibraryAppletInfo> out_library_applet_info) {
|
||||||
|
LOG_INFO(Service_AM, "called");
|
||||||
|
*out_library_applet_info = {
|
||||||
|
.applet_id = m_applet->applet_id,
|
||||||
|
.library_applet_mode = m_applet->library_applet_mode,
|
||||||
|
};
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletSelfAccessor::GetMainAppletIdentityInfo(
|
||||||
|
Out<AppletIdentityInfo> out_identity_info) {
|
||||||
|
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||||
|
*out_identity_info = {
|
||||||
|
.applet_id = AppletId::QLaunch,
|
||||||
|
.application_id = 0x0100000000001000ull,
|
||||||
|
};
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletSelfAccessor::CanUseApplicationCore(Out<bool> out_can_use_application_core) {
|
||||||
|
// TODO: This appears to read the NPDM from state and check the core mask of the applet.
|
||||||
|
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||||
|
*out_can_use_application_core = false;
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletSelfAccessor::GetMainAppletApplicationControlProperty(
|
||||||
|
OutLargeData<std::array<u8, 0x4000>, BufferAttr_HipcMapAlias> out_nacp) {
|
||||||
|
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||||
|
|
||||||
|
// TODO: this should be the main applet, not the caller applet
|
||||||
|
const auto application = GetCallerIdentity(*m_applet);
|
||||||
|
std::vector<u8> nacp;
|
||||||
|
const auto result =
|
||||||
|
system.GetARPManager().GetControlProperty(&nacp, application.application_id);
|
||||||
|
|
||||||
|
if (R_SUCCEEDED(result)) {
|
||||||
|
std::memcpy(out_nacp->data(), nacp.data(), (std::min)(nacp.size(), out_nacp->size()));
|
||||||
|
}
|
||||||
|
|
||||||
|
R_RETURN(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletSelfAccessor::GetMainAppletStorageId(Out<FileSys::StorageId> out_storage_id) {
|
||||||
|
LOG_INFO(Service_AM, "(STUBBED) called");
|
||||||
|
*out_storage_id = FileSys::StorageId::NandUser;
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletSelfAccessor::ExitProcessAndReturn() {
|
||||||
|
LOG_INFO(Service_AM, "called");
|
||||||
|
|
||||||
|
if (const auto caller_applet = m_applet->caller_applet.lock(); caller_applet) {
|
||||||
|
m_applet->process->Terminate();
|
||||||
|
} else {
|
||||||
|
system.GetUserChannel() = m_applet->user_channel_launch_parameter;
|
||||||
|
system.ExecuteProgram(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletSelfAccessor::GetCallerAppletIdentityInfo(
|
||||||
|
Out<AppletIdentityInfo> out_identity_info) {
|
||||||
|
LOG_INFO(Service_AM, "called");
|
||||||
|
*out_identity_info = GetCallerIdentity(*m_applet);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletSelfAccessor::GetCallerAppletIdentityInfoStack(
|
||||||
|
Out<s32> out_count, OutArray<AppletIdentityInfo, BufferAttr_HipcMapAlias> out_identity_info) {
|
||||||
|
LOG_INFO(Service_AM, "called");
|
||||||
|
|
||||||
|
std::shared_ptr<Applet> applet = m_applet;
|
||||||
|
*out_count = 0;
|
||||||
|
|
||||||
|
do {
|
||||||
|
if (*out_count >= static_cast<s32>(out_identity_info.size())) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
out_identity_info[(*out_count)++] = GetCallerIdentity(*applet);
|
||||||
|
} while ((applet = applet->caller_applet.lock()));
|
||||||
|
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletSelfAccessor::GetDesirableKeyboardLayout(Out<u32> out_desirable_layout) {
|
||||||
|
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||||
|
*out_desirable_layout = 0;
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletSelfAccessor::ReportVisibleError(ErrorCode error_code) {
|
||||||
|
LOG_WARNING(Service_AM, "(STUBBED) called, error {}-{}", error_code.category,
|
||||||
|
error_code.number);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletSelfAccessor::ReportVisibleErrorWithErrorContext(
|
||||||
|
ErrorCode error_code, InLargeData<ErrorContext, BufferAttr_HipcMapAlias> error_context) {
|
||||||
|
LOG_WARNING(Service_AM, "(STUBBED) called, error {}-{}", error_code.category,
|
||||||
|
error_code.number);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletSelfAccessor::UnpopInData(SharedPointer<IStorage> storage) {
|
||||||
|
LOG_INFO(Service_AM, "called");
|
||||||
|
m_broker->GetInData().Unpop(system.Kernel(), storage);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletSelfAccessor::GetMainAppletApplicationDesiredLanguage(
|
||||||
|
Out<u64> out_desired_language) {
|
||||||
|
// FIXME: this is copied from IApplicationFunctions::GetDesiredLanguage
|
||||||
|
// FIXME: all of this stuff belongs to ns
|
||||||
|
auto identity = GetCallerIdentity(*m_applet);
|
||||||
|
|
||||||
|
// TODO(bunnei): This should be configurable
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
|
||||||
|
// Get supported languages from NACP, if possible
|
||||||
|
// Default to 0 (all languages supported)
|
||||||
|
u32 supported_languages = 0;
|
||||||
|
|
||||||
|
const auto res = FileSys::PatchManager::GetMetadataFromBaseOrUpdate(system, identity.application_id);
|
||||||
|
|
||||||
|
if (res.first != nullptr) {
|
||||||
|
supported_languages = res.first->GetSupportedLanguages();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Call IApplicationManagerInterface implementation.
|
||||||
|
auto& service_manager = system.ServiceManager();
|
||||||
|
auto ns_am2 = service_manager.GetService<NS::IServiceGetterInterface>("ns:am2");
|
||||||
|
|
||||||
|
std::shared_ptr<NS::IApplicationManagerInterface> app_man;
|
||||||
|
R_TRY(ns_am2->GetApplicationManagerInterface(&app_man));
|
||||||
|
|
||||||
|
// Get desired application language
|
||||||
|
NS::ApplicationLanguage desired_language{};
|
||||||
|
R_TRY(app_man->GetApplicationDesiredLanguage(&desired_language, supported_languages));
|
||||||
|
|
||||||
|
// Convert to settings language code.
|
||||||
|
u64 language_code{};
|
||||||
|
R_TRY(app_man->ConvertApplicationLanguageToLanguageCode(&language_code, desired_language));
|
||||||
|
|
||||||
|
LOG_DEBUG(Service_AM, "got desired_language={:016X}", language_code);
|
||||||
|
|
||||||
|
*out_desired_language = language_code;
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletSelfAccessor::GetCurrentApplicationId(Out<u64> out_application_id) {
|
||||||
|
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||||
|
|
||||||
|
// TODO: this should be the main applet, not the caller applet
|
||||||
|
const auto main_applet = GetCallerIdentity(*m_applet);
|
||||||
|
*out_application_id = main_applet.application_id;
|
||||||
|
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletSelfAccessor::GetMainAppletAvailableUsers(
|
||||||
|
Out<bool> out_can_select_any_user, Out<s32> out_users_count,
|
||||||
|
OutArray<Common::UUID, BufferAttr_HipcMapAlias> out_users) {
|
||||||
|
const Service::Account::ProfileManager manager{};
|
||||||
|
|
||||||
|
*out_can_select_any_user = false;
|
||||||
|
*out_users_count = -1;
|
||||||
|
|
||||||
|
LOG_INFO(Service_AM, "called");
|
||||||
|
|
||||||
|
if (manager.GetUserCount() > 0) {
|
||||||
|
*out_can_select_any_user = true;
|
||||||
|
*out_users_count = static_cast<s32>(manager.GetUserCount());
|
||||||
|
|
||||||
|
const auto users = manager.GetAllUsers();
|
||||||
|
for (size_t i = 0; i < users.size() && i < out_users.size(); i++) {
|
||||||
|
out_users[i] = users[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletSelfAccessor::ShouldSetGpuTimeSliceManually(
|
||||||
|
Out<bool> out_should_set_gpu_time_slice_manually) {
|
||||||
|
LOG_INFO(Service_AM, "(STUBBED) called");
|
||||||
|
*out_should_set_gpu_time_slice_manually = false;
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILibraryAppletSelfAccessor::GetLibraryAppletInfoEx(
|
||||||
|
Out<LibraryAppletInfo> out_library_applet_info) {
|
||||||
|
LOG_INFO(Service_AM, "called");
|
||||||
|
*out_library_applet_info = {
|
||||||
|
.applet_id = m_applet->applet_id,
|
||||||
|
.library_applet_mode = m_applet->library_applet_mode,
|
||||||
|
};
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace Service::AM
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "common/uuid.h"
|
||||||
|
#include "core/hle/service/am/am_types.h"
|
||||||
|
#include "core/hle/service/cmif_types.h"
|
||||||
|
#include "core/hle/service/service.h"
|
||||||
|
|
||||||
|
namespace FileSys {
|
||||||
|
enum class StorageId : u8;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace Kernel {
|
||||||
|
class KReadableEvent;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace Service::AM {
|
||||||
|
|
||||||
|
class AppletDataBroker;
|
||||||
|
struct Applet;
|
||||||
|
class IStorage;
|
||||||
|
|
||||||
|
struct LibraryAppletInfo {
|
||||||
|
AppletId applet_id;
|
||||||
|
LibraryAppletMode library_applet_mode;
|
||||||
|
};
|
||||||
|
static_assert(sizeof(LibraryAppletInfo) == 0x8, "LibraryAppletInfo has incorrect size.");
|
||||||
|
|
||||||
|
struct ErrorCode {
|
||||||
|
u32 category;
|
||||||
|
u32 number;
|
||||||
|
};
|
||||||
|
static_assert(sizeof(ErrorCode) == 0x8, "ErrorCode has incorrect size.");
|
||||||
|
|
||||||
|
struct ErrorContext {
|
||||||
|
u8 type;
|
||||||
|
INSERT_PADDING_BYTES_NOINIT(0x7);
|
||||||
|
std::array<u8, 0x1f4> data;
|
||||||
|
Result result;
|
||||||
|
};
|
||||||
|
static_assert(sizeof(ErrorContext) == 0x200, "ErrorContext has incorrect size.");
|
||||||
|
|
||||||
|
class ILibraryAppletSelfAccessor final : public ServiceFramework<ILibraryAppletSelfAccessor> {
|
||||||
|
public:
|
||||||
|
explicit ILibraryAppletSelfAccessor(Core::System& system_, std::shared_ptr<Applet> applet);
|
||||||
|
~ILibraryAppletSelfAccessor() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
Result PopInData(Out<SharedPointer<IStorage>> out_storage);
|
||||||
|
Result PushOutData(SharedPointer<IStorage> storage);
|
||||||
|
Result PopInteractiveInData(Out<SharedPointer<IStorage>> out_storage);
|
||||||
|
Result PushInteractiveOutData(SharedPointer<IStorage> storage);
|
||||||
|
Result GetPopInDataEvent(OutCopyHandle<Kernel::KReadableEvent> out_event);
|
||||||
|
Result GetPopInteractiveInDataEvent(OutCopyHandle<Kernel::KReadableEvent> out_event);
|
||||||
|
Result GetLibraryAppletInfo(Out<LibraryAppletInfo> out_library_applet_info);
|
||||||
|
Result GetMainAppletIdentityInfo(Out<AppletIdentityInfo> out_identity_info);
|
||||||
|
Result CanUseApplicationCore(Out<bool> out_can_use_application_core);
|
||||||
|
Result GetMainAppletApplicationControlProperty(
|
||||||
|
OutLargeData<std::array<u8, 0x4000>, BufferAttr_HipcMapAlias> out_nacp);
|
||||||
|
Result GetMainAppletStorageId(Out<FileSys::StorageId> out_storage_id);
|
||||||
|
Result ExitProcessAndReturn();
|
||||||
|
Result GetCallerAppletIdentityInfo(Out<AppletIdentityInfo> out_identity_info);
|
||||||
|
Result GetCallerAppletIdentityInfoStack(
|
||||||
|
Out<s32> out_count,
|
||||||
|
OutArray<AppletIdentityInfo, BufferAttr_HipcMapAlias> out_identity_info);
|
||||||
|
Result GetDesirableKeyboardLayout(Out<u32> out_desirable_layout);
|
||||||
|
Result ReportVisibleError(ErrorCode error_code);
|
||||||
|
Result ReportVisibleErrorWithErrorContext(
|
||||||
|
ErrorCode error_code, InLargeData<ErrorContext, BufferAttr_HipcMapAlias> error_context);
|
||||||
|
Result UnpopInData(SharedPointer<IStorage> storage);
|
||||||
|
Result GetMainAppletApplicationDesiredLanguage(Out<u64> out_desired_language);
|
||||||
|
Result GetCurrentApplicationId(Out<u64> out_application_id);
|
||||||
|
Result GetMainAppletAvailableUsers(Out<bool> out_can_select_any_user, Out<s32> out_users_count,
|
||||||
|
OutArray<Common::UUID, BufferAttr_HipcMapAlias> out_users);
|
||||||
|
Result ShouldSetGpuTimeSliceManually(Out<bool> out_should_set_gpu_time_slice_manually);
|
||||||
|
Result GetLibraryAppletInfoEx(Out<LibraryAppletInfo> out_library_applet_info);
|
||||||
|
|
||||||
|
const std::shared_ptr<Applet> m_applet;
|
||||||
|
const std::shared_ptr<AppletDataBroker> m_broker;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Service::AM
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#include "core/hle/service/am/service/lock_accessor.h"
|
||||||
|
#include "core/hle/service/cmif_serialization.h"
|
||||||
|
|
||||||
|
namespace Service::AM {
|
||||||
|
|
||||||
|
ILockAccessor::ILockAccessor(Core::System& system_)
|
||||||
|
: ServiceFramework{system_, "ILockAccessor"}, m_context{system_, "ILockAccessor"},
|
||||||
|
m_event{m_context} {
|
||||||
|
// clang-format off
|
||||||
|
static const FunctionInfo functions[] = {
|
||||||
|
{1, D<&ILockAccessor::TryLock>, "TryLock"},
|
||||||
|
{2, D<&ILockAccessor::Unlock>, "Unlock"},
|
||||||
|
{3, D<&ILockAccessor::GetEvent>, "GetEvent"},
|
||||||
|
{4, D<&ILockAccessor::IsLocked>, "IsLocked"},
|
||||||
|
};
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
|
RegisterHandlers(functions);
|
||||||
|
|
||||||
|
m_event.Signal(system.Kernel());
|
||||||
|
}
|
||||||
|
|
||||||
|
ILockAccessor::~ILockAccessor() = default;
|
||||||
|
|
||||||
|
Result ILockAccessor::TryLock(Out<bool> out_is_locked,
|
||||||
|
OutCopyHandle<Kernel::KReadableEvent> out_handle,
|
||||||
|
bool return_handle) {
|
||||||
|
LOG_INFO(Service_AM, "called, return_handle={}", return_handle);
|
||||||
|
|
||||||
|
{
|
||||||
|
std::scoped_lock lk{m_mutex};
|
||||||
|
if (m_is_locked) {
|
||||||
|
*out_is_locked = false;
|
||||||
|
} else {
|
||||||
|
m_is_locked = true;
|
||||||
|
*out_is_locked = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (return_handle) {
|
||||||
|
*out_handle = m_event.GetHandle();
|
||||||
|
}
|
||||||
|
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILockAccessor::Unlock() {
|
||||||
|
LOG_INFO(Service_AM, "called");
|
||||||
|
|
||||||
|
{
|
||||||
|
std::scoped_lock lk{m_mutex};
|
||||||
|
m_is_locked = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_event.Signal(system.Kernel());
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILockAccessor::GetEvent(OutCopyHandle<Kernel::KReadableEvent> out_handle) {
|
||||||
|
LOG_INFO(Service_AM, "called");
|
||||||
|
*out_handle = m_event.GetHandle();
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ILockAccessor::IsLocked(Out<bool> out_is_locked) {
|
||||||
|
LOG_INFO(Service_AM, "called");
|
||||||
|
std::scoped_lock lk{m_mutex};
|
||||||
|
*out_is_locked = m_is_locked;
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace Service::AM
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "core/hle/service/cmif_types.h"
|
||||||
|
#include "core/hle/service/kernel_helpers.h"
|
||||||
|
#include "core/hle/service/os/event.h"
|
||||||
|
#include "core/hle/service/service.h"
|
||||||
|
|
||||||
|
namespace Service::AM {
|
||||||
|
|
||||||
|
class ILockAccessor final : public ServiceFramework<ILockAccessor> {
|
||||||
|
public:
|
||||||
|
explicit ILockAccessor(Core::System& system_);
|
||||||
|
~ILockAccessor() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
Result TryLock(Out<bool> out_is_locked, OutCopyHandle<Kernel::KReadableEvent> out_handle,
|
||||||
|
bool return_handle);
|
||||||
|
Result Unlock();
|
||||||
|
Result GetEvent(OutCopyHandle<Kernel::KReadableEvent> out_handle);
|
||||||
|
Result IsLocked(Out<bool> out_is_locked);
|
||||||
|
|
||||||
|
private:
|
||||||
|
KernelHelpers::ServiceContext m_context;
|
||||||
|
Event m_event;
|
||||||
|
std::mutex m_mutex{};
|
||||||
|
bool m_is_locked{};
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Service::AM
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
#include "core/hle/service/am/service/common_state_getter.h"
|
||||||
|
#include "core/hle/service/am/service/display_controller.h"
|
||||||
|
#include "core/hle/service/am/service/global_state_controller.h"
|
||||||
|
#include "core/hle/service/am/service/audio_controller.h"
|
||||||
|
#include "core/hle/service/am/service/applet_common_functions.h"
|
||||||
|
#include "core/hle/service/am/service/overlay_applet_proxy.h"
|
||||||
|
#include "core/hle/service/am/service/library_applet_creator.h"
|
||||||
|
#include "core/hle/service/am/service/process_winding_controller.h"
|
||||||
|
#include "core/hle/service/am/service/self_controller.h"
|
||||||
|
#include "core/hle/service/am/service/window_controller.h"
|
||||||
|
#include "core/hle/service/am/service/debug_functions.h"
|
||||||
|
#include "core/hle/service/cmif_serialization.h"
|
||||||
|
|
||||||
|
namespace Service::AM {
|
||||||
|
IOverlayAppletProxy::IOverlayAppletProxy(Core::System &system_, std::shared_ptr<Applet> applet,
|
||||||
|
Kernel::KProcess *process, WindowSystem &window_system)
|
||||||
|
: ServiceFramework{system_, "IOverlayAppletProxy"},
|
||||||
|
m_window_system{window_system}, m_process{process}, m_applet{std::move(applet)} {
|
||||||
|
// clang-format off
|
||||||
|
static const FunctionInfo functions[] = {
|
||||||
|
{0, D<&IOverlayAppletProxy::GetCommonStateGetter>, "GetCommonStateGetter"},
|
||||||
|
{1, D<&IOverlayAppletProxy::GetSelfController>, "GetSelfController"},
|
||||||
|
{2, D<&IOverlayAppletProxy::GetWindowController>, "GetWindowController"},
|
||||||
|
{3, D<&IOverlayAppletProxy::GetAudioController>, "GetAudioController"},
|
||||||
|
{4, D<&IOverlayAppletProxy::GetDisplayController>, "GetDisplayController"},
|
||||||
|
{10, D<&IOverlayAppletProxy::GetProcessWindingController>, "GetProcessWindingController"},
|
||||||
|
{11, D<&IOverlayAppletProxy::GetLibraryAppletCreator>, "GetLibraryAppletCreator"},
|
||||||
|
{20, D<&IOverlayAppletProxy::GetOverlayFunctions>, "GetOverlayFunctions"},
|
||||||
|
{21, D<&IOverlayAppletProxy::GetAppletCommonFunctions>, "GetAppletCommonFunctions"},
|
||||||
|
{23, D<&IOverlayAppletProxy::GetGlobalStateController>, "GetGlobalStateController"},
|
||||||
|
{1000, D<&IOverlayAppletProxy::GetDebugFunctions>, "GetDebugFunctions"},
|
||||||
|
};
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
|
RegisterHandlers(functions);
|
||||||
|
}
|
||||||
|
|
||||||
|
IOverlayAppletProxy::~IOverlayAppletProxy() = default;
|
||||||
|
|
||||||
|
Result IOverlayAppletProxy::GetCommonStateGetter(
|
||||||
|
Out<SharedPointer<ICommonStateGetter> > out_common_state_getter) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_common_state_getter = std::make_shared<ICommonStateGetter>(system, m_applet);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result IOverlayAppletProxy::GetSelfController(
|
||||||
|
Out<SharedPointer<ISelfController> > out_self_controller) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_self_controller = std::make_shared<ISelfController>(system, m_applet, m_process);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result IOverlayAppletProxy::GetWindowController(
|
||||||
|
Out<SharedPointer<IWindowController> > out_window_controller) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_window_controller = std::make_shared<IWindowController>(system, m_applet, m_window_system);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result IOverlayAppletProxy::GetAudioController(
|
||||||
|
Out<SharedPointer<IAudioController> > out_audio_controller) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_audio_controller = std::make_shared<IAudioController>(system);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result IOverlayAppletProxy::GetDisplayController(
|
||||||
|
Out<SharedPointer<IDisplayController> > out_display_controller) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_display_controller = std::make_shared<IDisplayController>(system, m_applet);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result IOverlayAppletProxy::GetProcessWindingController(
|
||||||
|
Out<SharedPointer<IProcessWindingController> > out_process_winding_controller) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_process_winding_controller = std::make_shared<IProcessWindingController>(system, m_applet);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result IOverlayAppletProxy::GetLibraryAppletCreator(
|
||||||
|
Out<SharedPointer<ILibraryAppletCreator> > out_library_applet_creator) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_library_applet_creator =
|
||||||
|
std::make_shared<ILibraryAppletCreator>(system, m_applet, m_window_system);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result IOverlayAppletProxy::GetOverlayFunctions(
|
||||||
|
Out<SharedPointer<IOverlayFunctions> > out_overlay_functions) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_overlay_functions = std::make_shared<IOverlayFunctions>(system, m_applet);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result IOverlayAppletProxy::GetAppletCommonFunctions(
|
||||||
|
Out<SharedPointer<IAppletCommonFunctions> > out_applet_common_functions) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_applet_common_functions = std::make_shared<IAppletCommonFunctions>(system, m_applet);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result IOverlayAppletProxy::GetGlobalStateController(
|
||||||
|
Out<SharedPointer<IGlobalStateController> > out_global_state_controller) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_global_state_controller = std::make_shared<IGlobalStateController>(system);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result IOverlayAppletProxy::GetDebugFunctions(
|
||||||
|
Out<SharedPointer<IDebugFunctions> > out_debug_functions) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_debug_functions = std::make_shared<IDebugFunctions>(system);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
} // namespace Service::AM
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "core/hle/service/cmif_types.h"
|
||||||
|
#include "core/hle/service/service.h"
|
||||||
|
#include "core/hle/service/am/service/overlay_functions.h"
|
||||||
|
|
||||||
|
namespace Service::AM {
|
||||||
|
|
||||||
|
struct Applet;
|
||||||
|
class IAppletCommonFunctions;
|
||||||
|
class IAudioController;
|
||||||
|
class ICommonStateGetter;
|
||||||
|
class IDebugFunctions;
|
||||||
|
class IDisplayController;
|
||||||
|
class IHomeMenuFunctions;
|
||||||
|
class IGlobalStateController;
|
||||||
|
class ILibraryAppletCreator;
|
||||||
|
class ILibraryAppletSelfAccessor;
|
||||||
|
class IProcessWindingController;
|
||||||
|
class ISelfController;
|
||||||
|
class IWindowController;
|
||||||
|
class WindowSystem;
|
||||||
|
|
||||||
|
class IOverlayAppletProxy final : public ServiceFramework<IOverlayAppletProxy> {
|
||||||
|
public:
|
||||||
|
explicit IOverlayAppletProxy(Core::System& system_, std::shared_ptr<Applet> applet,
|
||||||
|
Kernel::KProcess* process, WindowSystem& window_system);
|
||||||
|
~IOverlayAppletProxy();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Result GetCommonStateGetter(Out<SharedPointer<ICommonStateGetter>> out_common_state_getter);
|
||||||
|
Result GetSelfController(Out<SharedPointer<ISelfController>> out_self_controller);
|
||||||
|
Result GetWindowController(Out<SharedPointer<IWindowController>> out_window_controller);
|
||||||
|
Result GetAudioController(Out<SharedPointer<IAudioController>> out_audio_controller);
|
||||||
|
Result GetDisplayController(Out<SharedPointer<IDisplayController>> out_display_controller);
|
||||||
|
Result GetProcessWindingController(
|
||||||
|
Out<SharedPointer<IProcessWindingController>> out_process_winding_controller);
|
||||||
|
Result GetLibraryAppletCreator(
|
||||||
|
Out<SharedPointer<ILibraryAppletCreator>> out_library_applet_creator);
|
||||||
|
Result GetOverlayFunctions(Out<SharedPointer<IOverlayFunctions>> out_overlay_functions);
|
||||||
|
Result GetAppletCommonFunctions(
|
||||||
|
Out<SharedPointer<IAppletCommonFunctions>> out_applet_common_functions);
|
||||||
|
Result GetGlobalStateController(
|
||||||
|
Out<SharedPointer<IGlobalStateController>> out_global_state_controller);
|
||||||
|
Result GetDebugFunctions(Out<SharedPointer<IDebugFunctions>> out_debug_functions);
|
||||||
|
|
||||||
|
WindowSystem& m_window_system;
|
||||||
|
Kernel::KProcess* const m_process;
|
||||||
|
const std::shared_ptr<Applet> m_applet;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Service::AM
|
||||||
@@ -8,34 +8,34 @@
|
|||||||
#include "core/hle/service/am/window_system.h"
|
#include "core/hle/service/am/window_system.h"
|
||||||
|
|
||||||
namespace Service::AM {
|
namespace Service::AM {
|
||||||
std::optional<ServiceFrameworkBase::FunctionInfoBase> IOverlayFunctions::FindRequest(u32 key) {
|
|
||||||
static constexpr auto functions = CreateStaticMap(
|
|
||||||
FunctionInfo{0, D<&IOverlayFunctions::BeginToWatchShortHomeButtonMessage>, "BeginToWatchShortHomeButtonMessage"},
|
|
||||||
FunctionInfo{1, D<&IOverlayFunctions::EndToWatchShortHomeButtonMessage>, "EndToWatchShortHomeButtonMessage"},
|
|
||||||
FunctionInfo{2, D<&IOverlayFunctions::GetApplicationIdForLogo>, "GetApplicationIdForLogo"},
|
|
||||||
FunctionInfo{3, nullptr, "SetGpuTimeSliceBoost"},
|
|
||||||
FunctionInfo{4, D<&IOverlayFunctions::SetAutoSleepTimeAndDimmingTimeEnabled>, "SetAutoSleepTimeAndDimmingTimeEnabled"},
|
|
||||||
FunctionInfo{5, nullptr, "TerminateApplicationAndSetReason"},
|
|
||||||
FunctionInfo{6, nullptr, "SetScreenShotPermissionGlobally"},
|
|
||||||
FunctionInfo{10, nullptr, "StartShutdownSequenceForOverlay"},
|
|
||||||
FunctionInfo{11, nullptr, "StartRebootSequenceForOverlay"},
|
|
||||||
FunctionInfo{20, D<&IOverlayFunctions::SetHandlingHomeButtonShortPressedEnabled>, "SetHandlingHomeButtonShortPressedEnabled"},
|
|
||||||
FunctionInfo{21, D<&IOverlayFunctions::SetHandlingTouchScreenInputEnabled>, "SetHandlingTouchScreenInputEnabled"},
|
|
||||||
FunctionInfo{30, nullptr, "SetHealthWarningShowingState"},
|
|
||||||
FunctionInfo{31, D<&IOverlayFunctions::IsHealthWarningRequired>, "IsHealthWarningRequired"},
|
|
||||||
FunctionInfo{40, nullptr, "GetApplicationNintendoLogo"},
|
|
||||||
FunctionInfo{41, nullptr, "GetApplicationStartupMovie"},
|
|
||||||
FunctionInfo{50, nullptr, "SetGpuTimeSliceBoostForApplication"},
|
|
||||||
FunctionInfo{60, nullptr, "Unknown60"},
|
|
||||||
FunctionInfo{70, D<&IOverlayFunctions::Unknown70>, "Unknown70"},
|
|
||||||
FunctionInfo{90, nullptr, "SetRequiresGpuResourceUse"},
|
|
||||||
FunctionInfo{101, nullptr, "BeginToObserveHidInputForDevelop"}
|
|
||||||
);
|
|
||||||
return HandlerTableGenerateWithFind(key, functions);
|
|
||||||
}
|
|
||||||
|
|
||||||
IOverlayFunctions::IOverlayFunctions(Core::System &system_, std::shared_ptr<Applet> applet)
|
IOverlayFunctions::IOverlayFunctions(Core::System &system_, std::shared_ptr<Applet> applet)
|
||||||
: ServiceFramework{system_, "IOverlayFunctions"}, m_applet{std::move(applet)} {
|
: ServiceFramework{system_, "IOverlayFunctions"}, m_applet{std::move(applet)} {
|
||||||
|
// clang-format off
|
||||||
|
static const FunctionInfo functions[] = {
|
||||||
|
{0, D<&IOverlayFunctions::BeginToWatchShortHomeButtonMessage>, "BeginToWatchShortHomeButtonMessage"},
|
||||||
|
{1, D<&IOverlayFunctions::EndToWatchShortHomeButtonMessage>, "EndToWatchShortHomeButtonMessage"},
|
||||||
|
{2, D<&IOverlayFunctions::GetApplicationIdForLogo>, "GetApplicationIdForLogo"},
|
||||||
|
{3, nullptr, "SetGpuTimeSliceBoost"},
|
||||||
|
{4, D<&IOverlayFunctions::SetAutoSleepTimeAndDimmingTimeEnabled>, "SetAutoSleepTimeAndDimmingTimeEnabled"},
|
||||||
|
{5, nullptr, "TerminateApplicationAndSetReason"},
|
||||||
|
{6, nullptr, "SetScreenShotPermissionGlobally"},
|
||||||
|
{10, nullptr, "StartShutdownSequenceForOverlay"},
|
||||||
|
{11, nullptr, "StartRebootSequenceForOverlay"},
|
||||||
|
{20, D<&IOverlayFunctions::SetHandlingHomeButtonShortPressedEnabled>, "SetHandlingHomeButtonShortPressedEnabled"},
|
||||||
|
{21, D<&IOverlayFunctions::SetHandlingTouchScreenInputEnabled>, "SetHandlingTouchScreenInputEnabled"},
|
||||||
|
{30, nullptr, "SetHealthWarningShowingState"},
|
||||||
|
{31, D<&IOverlayFunctions::IsHealthWarningRequired>, "IsHealthWarningRequired"},
|
||||||
|
{40, nullptr, "GetApplicationNintendoLogo"},
|
||||||
|
{41, nullptr, "GetApplicationStartupMovie"},
|
||||||
|
{50, nullptr, "SetGpuTimeSliceBoostForApplication"},
|
||||||
|
{60, nullptr, "Unknown60"},
|
||||||
|
{70, D<&IOverlayFunctions::Unknown70>, "Unknown70"},
|
||||||
|
{90, nullptr, "SetRequiresGpuResourceUse"},
|
||||||
|
{101, nullptr, "BeginToObserveHidInputForDevelop"},
|
||||||
|
};
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
|
RegisterHandlers(functions);
|
||||||
}
|
}
|
||||||
|
|
||||||
IOverlayFunctions::~IOverlayFunctions() = default;
|
IOverlayFunctions::~IOverlayFunctions() = default;
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ private:
|
|||||||
Result Unknown70();
|
Result Unknown70();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::optional<FunctionInfoBase> FindRequest(u32 key) override;
|
|
||||||
const std::shared_ptr<Applet> m_applet;
|
const std::shared_ptr<Applet> m_applet;
|
||||||
};
|
};
|
||||||
} // namespace Service::AM
|
} // namespace Service::AM
|
||||||
|
|||||||
@@ -13,23 +13,23 @@
|
|||||||
|
|
||||||
namespace Service::AM {
|
namespace Service::AM {
|
||||||
|
|
||||||
std::optional<ServiceFrameworkBase::FunctionInfoBase> IProcessWindingController::FindRequest(u32 key) {
|
|
||||||
static constexpr auto functions = CreateStaticMap(
|
|
||||||
FunctionInfo{0, D<&IProcessWindingController::GetLaunchReason>, "GetLaunchReason"},
|
|
||||||
FunctionInfo{11, D<&IProcessWindingController::OpenCallingLibraryApplet>, "OpenCallingLibraryApplet"},
|
|
||||||
FunctionInfo{21, D<&IProcessWindingController::PushContext>, "PushContext"},
|
|
||||||
FunctionInfo{22, D<&IProcessWindingController::PopContext>, "PopContext"},
|
|
||||||
FunctionInfo{23, D<&IProcessWindingController::CancelWindingReservation>, "CancelWindingReservation"},
|
|
||||||
FunctionInfo{30, D<&IProcessWindingController::WindAndDoReserved>, "WindAndDoReserved"},
|
|
||||||
FunctionInfo{40, D<&IProcessWindingController::ReserveToStartAndWaitAndUnwindThis>, "ReserveToStartAndWaitAndUnwindThis"},
|
|
||||||
FunctionInfo{41, D<&IProcessWindingController::ReserveToStartAndWait>, "ReserveToStartAndWait"}
|
|
||||||
);
|
|
||||||
return HandlerTableGenerateWithFind(key, functions);
|
|
||||||
}
|
|
||||||
|
|
||||||
IProcessWindingController::IProcessWindingController(Core::System& system_,
|
IProcessWindingController::IProcessWindingController(Core::System& system_,
|
||||||
std::shared_ptr<Applet> applet)
|
std::shared_ptr<Applet> applet)
|
||||||
: ServiceFramework{system_, "IProcessWindingController"}, m_applet{std::move(applet)} {
|
: ServiceFramework{system_, "IProcessWindingController"}, m_applet{std::move(applet)} {
|
||||||
|
// clang-format off
|
||||||
|
static const FunctionInfo functions[] = {
|
||||||
|
{0, D<&IProcessWindingController::GetLaunchReason>, "GetLaunchReason"},
|
||||||
|
{11, D<&IProcessWindingController::OpenCallingLibraryApplet>, "OpenCallingLibraryApplet"},
|
||||||
|
{21, D<&IProcessWindingController::PushContext>, "PushContext"},
|
||||||
|
{22, D<&IProcessWindingController::PopContext>, "PopContext"},
|
||||||
|
{23, D<&IProcessWindingController::CancelWindingReservation>, "CancelWindingReservation"},
|
||||||
|
{30, D<&IProcessWindingController::WindAndDoReserved>, "WindAndDoReserved"},
|
||||||
|
{40, D<&IProcessWindingController::ReserveToStartAndWaitAndUnwindThis>, "ReserveToStartAndWaitAndUnwindThis"},
|
||||||
|
{41, D<&IProcessWindingController::ReserveToStartAndWait>, "ReserveToStartAndWait"},
|
||||||
|
};
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
|
RegisterHandlers(functions);
|
||||||
}
|
}
|
||||||
|
|
||||||
IProcessWindingController::~IProcessWindingController() = default;
|
IProcessWindingController::~IProcessWindingController() = default;
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ private:
|
|||||||
SharedPointer<ILibraryAppletAccessor> reserved_applet_accessor);
|
SharedPointer<ILibraryAppletAccessor> reserved_applet_accessor);
|
||||||
Result ReserveToStartAndWait(SharedPointer<ILibraryAppletAccessor> reserved_applet_accessor);
|
Result ReserveToStartAndWait(SharedPointer<ILibraryAppletAccessor> reserved_applet_accessor);
|
||||||
|
|
||||||
std::optional<FunctionInfoBase> FindRequest(u32 key) override;
|
|
||||||
const std::shared_ptr<Applet> m_applet;
|
const std::shared_ptr<Applet> m_applet;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -17,66 +17,67 @@
|
|||||||
|
|
||||||
namespace Service::AM {
|
namespace Service::AM {
|
||||||
|
|
||||||
std::optional<ServiceFrameworkBase::FunctionInfoBase> ISelfController::FindRequest(u32 key) {
|
|
||||||
static constexpr auto functions = CreateStaticMap(
|
|
||||||
FunctionInfo{0, D<&ISelfController::Exit>, "Exit"},
|
|
||||||
FunctionInfo{1, D<&ISelfController::LockExit>, "LockExit"},
|
|
||||||
FunctionInfo{2, D<&ISelfController::UnlockExit>, "UnlockExit"},
|
|
||||||
FunctionInfo{3, D<&ISelfController::EnterFatalSection>, "EnterFatalSection"},
|
|
||||||
FunctionInfo{4, D<&ISelfController::LeaveFatalSection>, "LeaveFatalSection"},
|
|
||||||
FunctionInfo{9, D<&ISelfController::GetLibraryAppletLaunchableEvent>, "GetLibraryAppletLaunchableEvent"},
|
|
||||||
FunctionInfo{10, D<&ISelfController::SetScreenShotPermission>, "SetScreenShotPermission"},
|
|
||||||
FunctionInfo{11, D<&ISelfController::SetOperationModeChangedNotification>, "SetOperationModeChangedNotification"},
|
|
||||||
FunctionInfo{12, D<&ISelfController::SetPerformanceModeChangedNotification>, "SetPerformanceModeChangedNotification"},
|
|
||||||
FunctionInfo{13, D<&ISelfController::SetFocusHandlingMode>, "SetFocusHandlingMode"},
|
|
||||||
FunctionInfo{14, D<&ISelfController::SetRestartMessageEnabled>, "SetRestartMessageEnabled"},
|
|
||||||
FunctionInfo{15, D<&ISelfController::SetScreenShotAppletIdentityInfo>, "SetScreenShotAppletIdentityInfo"},
|
|
||||||
FunctionInfo{16, D<&ISelfController::SetOutOfFocusSuspendingEnabled>, "SetOutOfFocusSuspendingEnabled"},
|
|
||||||
FunctionInfo{17, nullptr, "SetControllerFirmwareUpdateSection"},
|
|
||||||
FunctionInfo{18, nullptr, "SetRequiresCaptureButtonShortPressedMessage"},
|
|
||||||
FunctionInfo{19, D<&ISelfController::SetAlbumImageOrientation>, "SetAlbumImageOrientation"},
|
|
||||||
FunctionInfo{20, nullptr, "SetDesirableKeyboardLayout"},
|
|
||||||
FunctionInfo{21, nullptr, "GetScreenShotProgramId"},
|
|
||||||
FunctionInfo{40, D<&ISelfController::CreateManagedDisplayLayer>, "CreateManagedDisplayLayer"},
|
|
||||||
FunctionInfo{41, D<&ISelfController::IsSystemBufferSharingEnabled>, "IsSystemBufferSharingEnabled"},
|
|
||||||
FunctionInfo{42, D<&ISelfController::GetSystemSharedLayerHandle>, "GetSystemSharedLayerHandle"},
|
|
||||||
FunctionInfo{43, D<&ISelfController::GetSystemSharedBufferHandle>, "GetSystemSharedBufferHandle"},
|
|
||||||
FunctionInfo{44, D<&ISelfController::CreateManagedDisplaySeparableLayer>, "CreateManagedDisplaySeparableLayer"},
|
|
||||||
FunctionInfo{45, nullptr, "SetManagedDisplayLayerSeparationMode"},
|
|
||||||
FunctionInfo{46, nullptr, "SetRecordingLayerCompositionEnabled"},
|
|
||||||
FunctionInfo{50, D<&ISelfController::SetHandlesRequestToDisplay>, "SetHandlesRequestToDisplay"},
|
|
||||||
FunctionInfo{51, D<&ISelfController::ApproveToDisplay>, "ApproveToDisplay"},
|
|
||||||
FunctionInfo{60, D<&ISelfController::OverrideAutoSleepTimeAndDimmingTime>, "OverrideAutoSleepTimeAndDimmingTime"},
|
|
||||||
FunctionInfo{61, D<&ISelfController::SetMediaPlaybackState>, "SetMediaPlaybackState"},
|
|
||||||
FunctionInfo{62, D<&ISelfController::SetIdleTimeDetectionExtension>, "SetIdleTimeDetectionExtension"},
|
|
||||||
FunctionInfo{63, D<&ISelfController::GetIdleTimeDetectionExtension>, "GetIdleTimeDetectionExtension"},
|
|
||||||
FunctionInfo{64, nullptr, "SetInputDetectionSourceSet"},
|
|
||||||
FunctionInfo{65, D<&ISelfController::ReportUserIsActive>, "ReportUserIsActive"},
|
|
||||||
FunctionInfo{66, nullptr, "GetCurrentIlluminance"},
|
|
||||||
FunctionInfo{67, D<&ISelfController::IsIlluminanceAvailable>, "IsIlluminanceAvailable"},
|
|
||||||
FunctionInfo{68, D<&ISelfController::SetAutoSleepDisabled>, "SetAutoSleepDisabled"},
|
|
||||||
FunctionInfo{69, D<&ISelfController::IsAutoSleepDisabled>, "IsAutoSleepDisabled"},
|
|
||||||
FunctionInfo{70, nullptr, "ReportMultimediaError"},
|
|
||||||
FunctionInfo{71, nullptr, "GetCurrentIlluminanceEx"},
|
|
||||||
FunctionInfo{72, D<&ISelfController::SetInputDetectionPolicy>, "SetInputDetectionPolicy"},
|
|
||||||
FunctionInfo{80, nullptr, "SetWirelessPriorityMode"},
|
|
||||||
FunctionInfo{90, D<&ISelfController::GetAccumulatedSuspendedTickValue>, "GetAccumulatedSuspendedTickValue"},
|
|
||||||
FunctionInfo{91, D<&ISelfController::GetAccumulatedSuspendedTickChangedEvent>, "GetAccumulatedSuspendedTickChangedEvent"},
|
|
||||||
FunctionInfo{100, D<&ISelfController::SetAlbumImageTakenNotificationEnabled>, "SetAlbumImageTakenNotificationEnabled"},
|
|
||||||
FunctionInfo{110, nullptr, "SetApplicationAlbumUserData"},
|
|
||||||
FunctionInfo{120, D<&ISelfController::SaveCurrentScreenshot>, "SaveCurrentScreenshot"},
|
|
||||||
FunctionInfo{130, D<&ISelfController::SetRecordVolumeMuted>, "SetRecordVolumeMuted"},
|
|
||||||
FunctionInfo{230, D<&ISelfController::Unknown230>, "Unknown230"},
|
|
||||||
FunctionInfo{240, D<&ISelfController::Unknown240>, "Unknown240"},
|
|
||||||
FunctionInfo{1000, nullptr, "GetDebugStorageChannel"}
|
|
||||||
);
|
|
||||||
return HandlerTableGenerateWithFind(key, functions);
|
|
||||||
}
|
|
||||||
|
|
||||||
ISelfController::ISelfController(Core::System& system_, std::shared_ptr<Applet> applet,
|
ISelfController::ISelfController(Core::System& system_, std::shared_ptr<Applet> applet,
|
||||||
Kernel::KProcess* process)
|
Kernel::KProcess* process)
|
||||||
: ServiceFramework{system_, "ISelfController"}, m_process{process}, m_applet{
|
: ServiceFramework{system_, "ISelfController"}, m_process{process}, m_applet{
|
||||||
std::move(applet)} {
|
std::move(applet)} {
|
||||||
|
// clang-format off
|
||||||
|
static const FunctionInfo functions[] = {
|
||||||
|
{0, D<&ISelfController::Exit>, "Exit"},
|
||||||
|
{1, D<&ISelfController::LockExit>, "LockExit"},
|
||||||
|
{2, D<&ISelfController::UnlockExit>, "UnlockExit"},
|
||||||
|
{3, D<&ISelfController::EnterFatalSection>, "EnterFatalSection"},
|
||||||
|
{4, D<&ISelfController::LeaveFatalSection>, "LeaveFatalSection"},
|
||||||
|
{9, D<&ISelfController::GetLibraryAppletLaunchableEvent>, "GetLibraryAppletLaunchableEvent"},
|
||||||
|
{10, D<&ISelfController::SetScreenShotPermission>, "SetScreenShotPermission"},
|
||||||
|
{11, D<&ISelfController::SetOperationModeChangedNotification>, "SetOperationModeChangedNotification"},
|
||||||
|
{12, D<&ISelfController::SetPerformanceModeChangedNotification>, "SetPerformanceModeChangedNotification"},
|
||||||
|
{13, D<&ISelfController::SetFocusHandlingMode>, "SetFocusHandlingMode"},
|
||||||
|
{14, D<&ISelfController::SetRestartMessageEnabled>, "SetRestartMessageEnabled"},
|
||||||
|
{15, D<&ISelfController::SetScreenShotAppletIdentityInfo>, "SetScreenShotAppletIdentityInfo"},
|
||||||
|
{16, D<&ISelfController::SetOutOfFocusSuspendingEnabled>, "SetOutOfFocusSuspendingEnabled"},
|
||||||
|
{17, nullptr, "SetControllerFirmwareUpdateSection"},
|
||||||
|
{18, nullptr, "SetRequiresCaptureButtonShortPressedMessage"},
|
||||||
|
{19, D<&ISelfController::SetAlbumImageOrientation>, "SetAlbumImageOrientation"},
|
||||||
|
{20, nullptr, "SetDesirableKeyboardLayout"},
|
||||||
|
{21, nullptr, "GetScreenShotProgramId"},
|
||||||
|
{40, D<&ISelfController::CreateManagedDisplayLayer>, "CreateManagedDisplayLayer"},
|
||||||
|
{41, D<&ISelfController::IsSystemBufferSharingEnabled>, "IsSystemBufferSharingEnabled"},
|
||||||
|
{42, D<&ISelfController::GetSystemSharedLayerHandle>, "GetSystemSharedLayerHandle"},
|
||||||
|
{43, D<&ISelfController::GetSystemSharedBufferHandle>, "GetSystemSharedBufferHandle"},
|
||||||
|
{44, D<&ISelfController::CreateManagedDisplaySeparableLayer>, "CreateManagedDisplaySeparableLayer"},
|
||||||
|
{45, nullptr, "SetManagedDisplayLayerSeparationMode"},
|
||||||
|
{46, nullptr, "SetRecordingLayerCompositionEnabled"},
|
||||||
|
{50, D<&ISelfController::SetHandlesRequestToDisplay>, "SetHandlesRequestToDisplay"},
|
||||||
|
{51, D<&ISelfController::ApproveToDisplay>, "ApproveToDisplay"},
|
||||||
|
{60, D<&ISelfController::OverrideAutoSleepTimeAndDimmingTime>, "OverrideAutoSleepTimeAndDimmingTime"},
|
||||||
|
{61, D<&ISelfController::SetMediaPlaybackState>, "SetMediaPlaybackState"},
|
||||||
|
{62, D<&ISelfController::SetIdleTimeDetectionExtension>, "SetIdleTimeDetectionExtension"},
|
||||||
|
{63, D<&ISelfController::GetIdleTimeDetectionExtension>, "GetIdleTimeDetectionExtension"},
|
||||||
|
{64, nullptr, "SetInputDetectionSourceSet"},
|
||||||
|
{65, D<&ISelfController::ReportUserIsActive>, "ReportUserIsActive"},
|
||||||
|
{66, nullptr, "GetCurrentIlluminance"},
|
||||||
|
{67, D<&ISelfController::IsIlluminanceAvailable>, "IsIlluminanceAvailable"},
|
||||||
|
{68, D<&ISelfController::SetAutoSleepDisabled>, "SetAutoSleepDisabled"},
|
||||||
|
{69, D<&ISelfController::IsAutoSleepDisabled>, "IsAutoSleepDisabled"},
|
||||||
|
{70, nullptr, "ReportMultimediaError"},
|
||||||
|
{71, nullptr, "GetCurrentIlluminanceEx"},
|
||||||
|
{72, D<&ISelfController::SetInputDetectionPolicy>, "SetInputDetectionPolicy"},
|
||||||
|
{80, nullptr, "SetWirelessPriorityMode"},
|
||||||
|
{90, D<&ISelfController::GetAccumulatedSuspendedTickValue>, "GetAccumulatedSuspendedTickValue"},
|
||||||
|
{91, D<&ISelfController::GetAccumulatedSuspendedTickChangedEvent>, "GetAccumulatedSuspendedTickChangedEvent"},
|
||||||
|
{100, D<&ISelfController::SetAlbumImageTakenNotificationEnabled>, "SetAlbumImageTakenNotificationEnabled"},
|
||||||
|
{110, nullptr, "SetApplicationAlbumUserData"},
|
||||||
|
{120, D<&ISelfController::SaveCurrentScreenshot>, "SaveCurrentScreenshot"},
|
||||||
|
{130, D<&ISelfController::SetRecordVolumeMuted>, "SetRecordVolumeMuted"},
|
||||||
|
{230, D<&ISelfController::Unknown230>, "Unknown230"},
|
||||||
|
{240, D<&ISelfController::Unknown240>, "Unknown240"},
|
||||||
|
{1000, nullptr, "GetDebugStorageChannel"},
|
||||||
|
};
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
|
RegisterHandlers(functions);
|
||||||
|
|
||||||
std::scoped_lock lk{m_applet->lock};
|
std::scoped_lock lk{m_applet->lock};
|
||||||
m_applet->display_layer_manager.Initialize(system, m_process, m_applet->applet_id,
|
m_applet->display_layer_manager.Initialize(system, m_process, m_applet->applet_id,
|
||||||
m_applet->library_applet_mode);
|
m_applet->library_applet_mode);
|
||||||
|
|||||||
@@ -70,7 +70,6 @@ private:
|
|||||||
Result Unknown230(u32 in_val, Out<u16> out_val);
|
Result Unknown230(u32 in_val, Out<u16> out_val);
|
||||||
Result Unknown240(u32 in_val);
|
Result Unknown240(u32 in_val);
|
||||||
|
|
||||||
std::optional<FunctionInfoBase> FindRequest(u32 key) override;
|
|
||||||
Kernel::KProcess* const m_process;
|
Kernel::KProcess* const m_process;
|
||||||
const std::shared_ptr<Applet> m_applet;
|
const std::shared_ptr<Applet> m_applet;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,86 +4,22 @@
|
|||||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#include "core/hle/kernel/k_transfer_memory.h"
|
|
||||||
#include "core/hle/service/am/am_results.h"
|
#include "core/hle/service/am/am_results.h"
|
||||||
#include "core/hle/service/am/library_applet_storage.h"
|
#include "core/hle/service/am/library_applet_storage.h"
|
||||||
#include "core/hle/service/am/service/storage.h"
|
#include "core/hle/service/am/service/storage.h"
|
||||||
|
#include "core/hle/service/am/service/storage_accessor.h"
|
||||||
#include "core/hle/service/cmif_serialization.h"
|
#include "core/hle/service/cmif_serialization.h"
|
||||||
|
|
||||||
namespace Service::AM {
|
namespace Service::AM {
|
||||||
|
|
||||||
class IStorageAccessor final : public ServiceFramework<IStorageAccessor> {
|
|
||||||
public:
|
|
||||||
explicit IStorageAccessor(Core::System& system_, std::shared_ptr<LibraryAppletStorage> impl) : ServiceFramework{system_, "IStorageAccessor"}, m_impl{std::move(impl)} {}
|
|
||||||
~IStorageAccessor() override = default;
|
|
||||||
|
|
||||||
Result GetSize(Out<s64> out_size) {
|
|
||||||
LOG_DEBUG(Service_AM, "called");
|
|
||||||
*out_size = m_impl->GetSize();
|
|
||||||
R_SUCCEED();
|
|
||||||
}
|
|
||||||
|
|
||||||
Result Write(InBuffer<BufferAttr_HipcAutoSelect> buffer, s64 offset) {
|
|
||||||
LOG_DEBUG(Service_AM, "called, offset={} size={}", offset, buffer.size());
|
|
||||||
R_RETURN(m_impl->Write(offset, buffer.data(), buffer.size()));
|
|
||||||
}
|
|
||||||
|
|
||||||
Result Read(OutBuffer<BufferAttr_HipcAutoSelect> out_buffer, s64 offset) {
|
|
||||||
LOG_DEBUG(Service_AM, "called, offset={} size={}", offset, out_buffer.size());
|
|
||||||
R_RETURN(m_impl->Read(offset, out_buffer.data(), out_buffer.size()));
|
|
||||||
}
|
|
||||||
|
|
||||||
std::optional<FunctionInfoBase> FindRequest(u32 key) override {
|
|
||||||
return HandlerTableGenerateWithFind(key, functions);
|
|
||||||
}
|
|
||||||
static constexpr auto functions = CreateStaticMap(
|
|
||||||
FunctionInfo{0, D<&IStorageAccessor::GetSize>, "GetSize"},
|
|
||||||
FunctionInfo{10, D<&IStorageAccessor::Write>, "Write"},
|
|
||||||
FunctionInfo{11, D<&IStorageAccessor::Read>, "Read"}
|
|
||||||
);
|
|
||||||
|
|
||||||
const std::shared_ptr<LibraryAppletStorage> m_impl;
|
|
||||||
};
|
|
||||||
|
|
||||||
class ITransferStorageAccessor final : public ServiceFramework<ITransferStorageAccessor> {
|
|
||||||
public:
|
|
||||||
explicit ITransferStorageAccessor(Core::System& system_, std::shared_ptr<LibraryAppletStorage> impl) : ServiceFramework{system_, "ITransferStorageAccessor"}, m_impl{std::move(impl)} {}
|
|
||||||
~ITransferStorageAccessor() override = default;
|
|
||||||
|
|
||||||
Result GetSize(Out<s64> out_size) {
|
|
||||||
LOG_DEBUG(Service_AM, "called");
|
|
||||||
*out_size = m_impl->GetSize();
|
|
||||||
R_SUCCEED();
|
|
||||||
}
|
|
||||||
|
|
||||||
Result GetHandle(Out<s64> out_size, OutCopyHandle<Kernel::KTransferMemory> out_handle) {
|
|
||||||
LOG_INFO(Service_AM, "called");
|
|
||||||
*out_size = m_impl->GetSize();
|
|
||||||
*out_handle = m_impl->GetHandle();
|
|
||||||
R_SUCCEED();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::optional<FunctionInfoBase> FindRequest(u32 key) override {
|
|
||||||
return HandlerTableGenerateWithFind(key, functions);
|
|
||||||
}
|
|
||||||
static constexpr auto functions = CreateStaticMap(
|
|
||||||
FunctionInfo{0, D<&ITransferStorageAccessor::GetSize>, "GetSize"},
|
|
||||||
FunctionInfo{1, D<&ITransferStorageAccessor::GetHandle>, "GetHandle"}
|
|
||||||
);
|
|
||||||
|
|
||||||
const std::shared_ptr<LibraryAppletStorage> m_impl;
|
|
||||||
};
|
|
||||||
|
|
||||||
std::optional<ServiceFrameworkBase::FunctionInfoBase> IStorage::FindRequest(u32 key) {
|
|
||||||
static constexpr auto functions = CreateStaticMap(
|
|
||||||
FunctionInfo{0, D<&IStorage::Open>, "Open"},
|
|
||||||
FunctionInfo{1, D<&IStorage::OpenTransferStorage>, "OpenTransferStorage"}
|
|
||||||
);
|
|
||||||
return HandlerTableGenerateWithFind(key, functions);
|
|
||||||
}
|
|
||||||
|
|
||||||
IStorage::IStorage(Core::System& system_, std::shared_ptr<LibraryAppletStorage> impl)
|
IStorage::IStorage(Core::System& system_, std::shared_ptr<LibraryAppletStorage> impl)
|
||||||
: ServiceFramework{system_, "IStorage"}, m_impl{std::move(impl)} {
|
: ServiceFramework{system_, "IStorage"}, m_impl{std::move(impl)} {
|
||||||
|
static const FunctionInfo functions[] = {
|
||||||
|
{0, D<&IStorage::Open>, "Open"},
|
||||||
|
{1, D<&IStorage::OpenTransferStorage>, "OpenTransferStorage"},
|
||||||
|
};
|
||||||
|
|
||||||
|
RegisterHandlers(functions);
|
||||||
}
|
}
|
||||||
|
|
||||||
IStorage::IStorage(Core::System& system_, std::vector<u8>&& data)
|
IStorage::IStorage(Core::System& system_, std::vector<u8>&& data)
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
|
|
||||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
@@ -32,7 +29,6 @@ private:
|
|||||||
Result OpenTransferStorage(
|
Result OpenTransferStorage(
|
||||||
Out<SharedPointer<ITransferStorageAccessor>> out_transfer_storage_accessor);
|
Out<SharedPointer<ITransferStorageAccessor>> out_transfer_storage_accessor);
|
||||||
|
|
||||||
std::optional<FunctionInfoBase> FindRequest(u32 key) override;
|
|
||||||
const std::shared_ptr<LibraryAppletStorage> m_impl;
|
const std::shared_ptr<LibraryAppletStorage> m_impl;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,68 @@
|
|||||||
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#include "core/hle/kernel/k_transfer_memory.h"
|
||||||
|
#include "core/hle/service/am/library_applet_storage.h"
|
||||||
|
#include "core/hle/service/am/service/storage_accessor.h"
|
||||||
|
#include "core/hle/service/cmif_serialization.h"
|
||||||
|
|
||||||
|
namespace Service::AM {
|
||||||
|
|
||||||
|
IStorageAccessor::IStorageAccessor(Core::System& system_,
|
||||||
|
std::shared_ptr<LibraryAppletStorage> impl)
|
||||||
|
: ServiceFramework{system_, "IStorageAccessor"}, m_impl{std::move(impl)} {
|
||||||
|
static const FunctionInfo functions[] = {
|
||||||
|
{0, D<&IStorageAccessor::GetSize>, "GetSize"},
|
||||||
|
{10, D<&IStorageAccessor::Write>, "Write"},
|
||||||
|
{11, D<&IStorageAccessor::Read>, "Read"},
|
||||||
|
};
|
||||||
|
|
||||||
|
RegisterHandlers(functions);
|
||||||
|
}
|
||||||
|
|
||||||
|
IStorageAccessor::~IStorageAccessor() = default;
|
||||||
|
|
||||||
|
Result IStorageAccessor::GetSize(Out<s64> out_size) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_size = m_impl->GetSize();
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result IStorageAccessor::Write(InBuffer<BufferAttr_HipcAutoSelect> buffer, s64 offset) {
|
||||||
|
LOG_DEBUG(Service_AM, "called, offset={} size={}", offset, buffer.size());
|
||||||
|
R_RETURN(m_impl->Write(offset, buffer.data(), buffer.size()));
|
||||||
|
}
|
||||||
|
|
||||||
|
Result IStorageAccessor::Read(OutBuffer<BufferAttr_HipcAutoSelect> out_buffer, s64 offset) {
|
||||||
|
LOG_DEBUG(Service_AM, "called, offset={} size={}", offset, out_buffer.size());
|
||||||
|
R_RETURN(m_impl->Read(offset, out_buffer.data(), out_buffer.size()));
|
||||||
|
}
|
||||||
|
|
||||||
|
ITransferStorageAccessor::ITransferStorageAccessor(Core::System& system_,
|
||||||
|
std::shared_ptr<LibraryAppletStorage> impl)
|
||||||
|
: ServiceFramework{system_, "ITransferStorageAccessor"}, m_impl{std::move(impl)} {
|
||||||
|
static const FunctionInfo functions[] = {
|
||||||
|
{0, D<&ITransferStorageAccessor::GetSize>, "GetSize"},
|
||||||
|
{1, D<&ITransferStorageAccessor::GetHandle>, "GetHandle"},
|
||||||
|
};
|
||||||
|
|
||||||
|
RegisterHandlers(functions);
|
||||||
|
}
|
||||||
|
|
||||||
|
ITransferStorageAccessor::~ITransferStorageAccessor() = default;
|
||||||
|
|
||||||
|
Result ITransferStorageAccessor::GetSize(Out<s64> out_size) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_size = m_impl->GetSize();
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ITransferStorageAccessor::GetHandle(Out<s64> out_size,
|
||||||
|
OutCopyHandle<Kernel::KTransferMemory> out_handle) {
|
||||||
|
LOG_INFO(Service_AM, "called");
|
||||||
|
*out_size = m_impl->GetSize();
|
||||||
|
*out_handle = m_impl->GetHandle();
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace Service::AM
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user