Compare commits

..

3 Commits

Author SHA1 Message Date
lizzie 36fcb4623b 2026-09-29 03:55:29
Signed-off-by: lizzie <lizzie@eden-emu.dev>
2026-09-29 03:55:29 +00:00
lizzie 7f5fb70974 Fix license headers 2026-09-29 02:56:10 +00:00
lizzie 95f88b6bf4 2026-09-28 19:16:24
Signed-off-by: lizzie <lizzie@eden-emu.dev>
2026-09-28 19:16:24 +00:00
40 changed files with 12403 additions and 11938 deletions
+473 -455
View File
File diff suppressed because it is too large Load Diff
+456 -439
View File
File diff suppressed because it is too large Load Diff
+456 -439
View File
File diff suppressed because it is too large Load Diff
+456 -439
View File
File diff suppressed because it is too large Load Diff
+463 -440
View File
File diff suppressed because it is too large Load Diff
+456 -439
View File
File diff suppressed because it is too large Load Diff
+456 -439
View File
File diff suppressed because it is too large Load Diff
+456 -439
View File
File diff suppressed because it is too large Load Diff
+456 -439
View File
File diff suppressed because it is too large Load Diff
+456 -439
View File
File diff suppressed because it is too large Load Diff
+457 -440
View File
File diff suppressed because it is too large Load Diff
+456 -439
View File
File diff suppressed because it is too large Load Diff
+456 -439
View File
File diff suppressed because it is too large Load Diff
+463 -440
View File
File diff suppressed because it is too large Load Diff
+456 -439
View File
File diff suppressed because it is too large Load Diff
+456 -439
View File
File diff suppressed because it is too large Load Diff
+456 -439
View File
File diff suppressed because it is too large Load Diff
+456 -439
View File
File diff suppressed because it is too large Load Diff
+456 -439
View File
File diff suppressed because it is too large Load Diff
+463 -440
View File
File diff suppressed because it is too large Load Diff
+463 -440
View File
File diff suppressed because it is too large Load Diff
+456 -439
View File
File diff suppressed because it is too large Load Diff
+456 -439
View File
File diff suppressed because it is too large Load Diff
+456 -439
View File
File diff suppressed because it is too large Load Diff
+456 -439
View File
File diff suppressed because it is too large Load Diff
+463 -440
View File
File diff suppressed because it is too large Load Diff
+456 -439
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -150,7 +150,7 @@ ENUM(ScalingFilter, NearestNeighbor, Bilinear, Bicubic, Gaussian, Lanczos, Scale
ENUM(AntiAliasing, None, Fxaa, Smaa);
ENUM(AspectRatio, R16_9, R4_3, R21_9, R16_10, Stretch);
ENUM(ConsoleMode, Handheld, Docked);
ENUM(AppletMode, HLE, LLE, Disabled);
ENUM(AppletMode, HLE, LLE);
ENUM(SpirvOptimizeMode, Never, OnLoad, Always);
ENUM(GpuClock, Normal, Boost, Overclock)
ENUM(GpuUnswizzleSize, VerySmall, Small, Normal, Large, VeryLarge)
+2 -3
View File
@@ -250,10 +250,9 @@ std::shared_ptr<FrontendApplet> FrontendAppletHolder::GetApplet(std::shared_ptr<
return std::make_shared<PhotoViewer>(system, applet, mode, *frontend.photo_viewer);
case AppletId::NetConnect:
return std::make_shared<NetConnect>(system, applet, mode, *frontend.net_connect);
case AppletId::None:
return nullptr;
default:
UNIMPLEMENTED_MSG("No frontend implementation exists for applet_id={:02X} program_id={:016X}! Using stub applet.", static_cast<u8>(id), applet->program_id);
LOG_ERROR(Service_AM, "No backend implementation exists for applet_id={:02X} program_id={:016X}"
"Falling back to stub applet", static_cast<u8>(id), applet->program_id);
return std::make_shared<StubApplet>(system, applet, id, mode);
}
}
+6 -6
View File
@@ -430,8 +430,8 @@ private:
LOG_DEBUG(Service_NIFM, "(STUBBED) called");
const auto result = [this] {
const auto has_connection = Network::GetHostIPv4Address().has_value() &&
!Settings::values.airplane_mode.GetValue();
const auto has_connection = Network::GetHostIPv4Address().has_value()
&& (Network::IsConnectedToAnyRoom() || !Settings::values.airplane_mode.GetValue());
switch (state) {
case RequestState::NotSubmitted:
return has_connection ? ResultSuccess : ResultNetworkCommunicationDisabled;
@@ -925,10 +925,10 @@ void IGeneralService::SetWirelessCommunicationEnabled(HLERequestContext& ctx) {
}
void IGeneralService::IsWirelessCommunicationEnabled(HLERequestContext& ctx) {
const bool en = !Settings::values.airplane_mode.GetValue();
bool const enabled = (!Settings::values.airplane_mode.GetValue() || Network::IsConnectedToAnyRoom());
IPC::ResponseBuilder rb{ctx, 3};
rb.Push(ResultSuccess);
rb.Push<u8>(en);
rb.Push<u8>(enabled);
}
void IGeneralService::GetInternetConnectionStatus(HLERequestContext& ctx) {
@@ -972,7 +972,7 @@ void IGeneralService::IsEthernetCommunicationEnabled(HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 3};
rb.Push(ResultSuccess);
if (Network::GetHostIPv4Address().has_value() && !Settings::values.airplane_mode.GetValue()) {
if (Network::GetHostIPv4Address().has_value() && (!Settings::values.airplane_mode.GetValue() || Network::IsConnectedToAnyRoom())) {
rb.Push<u8>(1);
} else {
rb.Push<u8>(0);
@@ -984,7 +984,7 @@ void IGeneralService::IsAnyInternetRequestAccepted(HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 3};
rb.Push(ResultSuccess);
if (Network::GetHostIPv4Address().has_value() && !Settings::values.airplane_mode.GetValue()) {
if (Network::GetHostIPv4Address().has_value() && (!Settings::values.airplane_mode.GetValue() || Network::IsConnectedToAnyRoom())) {
rb.Push<u8>(1);
} else {
rb.Push<u8>(0);
+2 -30
View File
@@ -16,10 +16,6 @@
#include "core/hle/service/ro/ro_types.h"
#include "core/hle/service/server_manager.h"
#include "core/hle/service/service.h"
#ifdef HAS_NCE
#include "core/arm/nce/patcher.h"
#include "core/hle/kernel/k_shared_memory.h"
#endif
namespace Service::RO {
@@ -390,7 +386,7 @@ public:
R_SUCCEED();
}
Result MapManualLoadModuleMemory(Kernel::KernelCore& kernel, u64* out_address, size_t context_id, u64 nro_address,
Result MapManualLoadModuleMemory(u64* out_address, size_t context_id, u64 nro_address,
u64 nro_size, u64 bss_address, u64 bss_size) {
// Get context.
ProcessContext* context = this->GetContextById(context_id);
@@ -425,31 +421,7 @@ public:
R_TRY(context->ValidateNro(std::addressof(nro_info->module_id), std::addressof(rx_size),
std::addressof(ro_size), std::addressof(rw_size),
nro_info->base_address, nro_size, bss_size));
#ifdef HAS_NCE
if (Settings::IsNceEnabled()) {
auto* process = context->GetProcess();
auto& memory = process->GetMemory();
std::vector<u8> image(total_size);
memory.ReadBlock(nro_info->base_address, image.data(), rx_size);
Kernel::CodeSet::Segment code{.size = static_cast<u32>(rx_size)};
Core::NCE::Patcher patch;
patch.PatchText(image, code);
patch.RelocateAndCopy(nro_info->base_address, code, image, nullptr);
const u64 patch_address = nro_info->base_address + total_size;
const size_t patch_size = patch.GetSectionSize();
constexpr auto permission = Kernel::Svc::MemoryPermission::ReadExecute;
auto* patch_memory = Kernel::KSharedMemory::Create(kernel);
R_TRY(patch_memory->Initialize(kernel, kernel.System().DeviceMemory(), process, permission, permission, patch_size));
std::memcpy(patch_memory->GetPointer(), image.data() + total_size, patch_size);
R_TRY(process->AddSharedMemory(kernel, patch_memory, patch_address, patch_size));
R_TRY(patch_memory->Map(*process, patch_address, patch_size, permission));
memory.WriteBlock(nro_info->base_address, image.data(), rx_size);
}
#endif
// Set NRO perms.
R_TRY(SetNroPerms(context->GetProcess(), nro_info->base_address, rx_size, ro_size,
rw_size + bss_size));
@@ -559,7 +531,7 @@ public:
Result MapManualLoadModuleMemory(Out<u64> out_load_address, ClientProcessId client_pid,
u64 nro_address, u64 nro_size, u64 bss_address, u64 bss_size) {
R_TRY(m_ro->ValidateProcess(m_context_id, *client_pid));
R_RETURN(m_ro->MapManualLoadModuleMemory(system.Kernel(), out_load_address.Get(), m_context_id, nro_address,
R_RETURN(m_ro->MapManualLoadModuleMemory(out_load_address.Get(), m_context_id, nro_address,
nro_size, bss_address, bss_size));
}
+5 -7
View File
@@ -547,21 +547,19 @@ std::pair<s32, Errno> BSD_USA::SocketImpl(Domain domain, Type type, Protocol pro
LOG_INFO(Service, "New socket fd={}", fd);
auto room_member = Network::GetRoomMember().lock();
if (room_member && room_member->IsConnected()) {
if (Network::IsConnectedToAnyRoom()) {
descriptor.socket = std::make_shared<Network::ProxySocket>();
} else {
descriptor.socket = std::make_shared<Network::Socket>();
if (Settings::values.airplane_mode.GetValue() && descriptor.is_connection_based) {
LOG_ERROR(Service, "Airplane mode is enabled, cannot create socket");
return {-1, Errno::NOTCONN};
}
}
descriptor.socket->Initialize(Translate(domain), Translate(type), Translate(protocol));
descriptor.is_connection_based = IsConnectionBased(type);
if (Settings::values.airplane_mode.GetValue() && descriptor.is_connection_based) {
LOG_ERROR(Service, "Airplane mode is enabled, cannot create socket");
return {-1, Errno::NOTCONN};
}
return {fd, Errno::SUCCESS};
}
+3 -2
View File
@@ -2,9 +2,11 @@
// SPDX-License-Identifier: GPL-3.0-or-later
#include "common/logging.h"
#include "common/settings.h"
#include "core/internal_network/emu_net_state.h"
#include "core/internal_network/network.h"
#include "core/internal_network/network_interface.h"
#include "network/network.h"
#ifdef _WIN32
#define NOMINMAX
@@ -14,7 +16,6 @@
#pragma comment(lib, "wlanapi.lib")
#endif
#endif
#include <common/settings.h>
#include <mutex>
@@ -53,7 +54,7 @@ void RefreshFromHost() {
return;
}
st.wifi_enabled = !Settings::values.airplane_mode.GetValue();
st.wifi_enabled = (!Settings::values.airplane_mode.GetValue() || Network::IsConnectedToAnyRoom());
st.ethernet_enabled = sel->kind == HostAdapterKind::Ethernet;
st.connected = true;
+5
View File
@@ -32,6 +32,11 @@ std::weak_ptr<RoomMember> GetRoomMember() {
return g_room_member;
}
bool IsConnectedToAnyRoom() {
auto const room_member = GetRoomMember().lock();
return room_member && room_member->IsConnected();
}
void Shutdown() {
if (g_room_member) {
if (g_room_member->IsConnected())
+3 -1
View File
@@ -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-FileCopyrightText: Copyright 2017 Citra Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -20,6 +20,8 @@ std::weak_ptr<Room> GetRoom();
/// Returns a pointer to the room member handle
std::weak_ptr<RoomMember> GetRoomMember();
bool IsConnectedToAnyRoom();
/// Unregisters the network device, the room, and the room member and shut them down.
void Shutdown();
+3 -1
View File
@@ -342,6 +342,9 @@ std::unique_ptr<TranslationMap> InitializeTranslations(QObject* parent) {
"it bypasses such prompts and directly exits the emulation."));
INSERT(UISettings, hide_mouse, tr("Hide mouse on inactivity"),
tr("Hides the mouse after 2.5s of inactivity."));
INSERT(UISettings, controller_applet_disabled, tr("Disable controller applet"),
tr("Forcibly disables the use of the controller applet in emulated programs.\n"
"When a program attempts to open the controller applet, it is immediately closed."));
INSERT(UISettings, check_for_updates, tr("Check for updates"),
tr("Whether or not to check for updates upon startup."));
@@ -377,7 +380,6 @@ std::unique_ptr<ComboboxTranslationMap> ComboboxEnumeration(QObject* parent) {
{
PAIR(AppletMode, HLE, tr("Custom frontend")),
PAIR(AppletMode, LLE, tr("Real applet")),
PAIR(AppletMode, Disabled, tr("Disabled")),
}});
translations->insert({Settings::EnumMetadata<Settings::SpirvOptimizeMode>::Index(),
+2
View File
@@ -127,6 +127,8 @@ struct Values {
Setting<bool> hide_mouse{
linkage, true, "hideInactiveMouse", Category::UiGeneral, Settings::Specialization::Default,
true, true};
Setting<bool> controller_applet_disabled{linkage, false, "disableControllerApplet",
Category::UiGeneral};
// Set when Vulkan is known to crash the application
bool has_broken_vulkan = false;
+1 -3
View File
@@ -1,6 +1,3 @@
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: 2024 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -11,6 +8,7 @@
class QCheckBox;
class QLineEdit;
class QComboBox;
class QDateTimeEdit;
namespace Core {
class System;
+4 -8
View File
@@ -140,12 +140,7 @@ QWidget* Widget::CreateCombobox(std::function<std::string()>& serializer,
if (combobox_enumerations.contains(type)) {
enumeration = &combobox_enumerations.at(type);
for (const auto& [id, name] : *enumeration) {
if (type == Settings::EnumMetadata<Settings::AppletMode>::Index() &&
id == static_cast<u32>(Settings::AppletMode::Disabled) &&
setting.Id() != Settings::values.controller_applet_mode.Id()) {
continue;
}
combobox->addItem(name, id);
combobox->addItem(name);
}
} else {
return combobox;
@@ -163,8 +158,9 @@ QWidget* Widget::CreateCombobox(std::function<std::string()>& serializer,
const u32 setting_value = std::strtoul(setting.ToString().c_str(), nullptr, 0);
combobox->setCurrentIndex(find_index(setting_value));
serializer = [this]() {
return std::to_string(combobox->currentData().toUInt());
serializer = [this, enumeration]() {
int current = combobox->currentIndex();
return std::to_string(enumeration->at(current).first);
};
restore_func = [this, find_index]() {
+1 -1
View File
@@ -1786,7 +1786,7 @@ bool MainWindow::LoadROM(const QString& filename, Service::AM::FrontendAppletPar
QtCommon::system->SetFrontendAppletSet({
std::make_unique<QtAmiiboSettings>(*this), // Amiibo Settings
(Settings::values.controller_applet_mode.GetValue() == Settings::AppletMode::Disabled)
(UISettings::values.controller_applet_disabled.GetValue() == true)
? nullptr
: std::make_unique<QtControllerSelector>(*this), // Controller Selector
std::make_unique<QtErrorDisplay>(*this), // Error Display