mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-10-03 13:13:40 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 36fcb4623b | |||
| 7f5fb70974 | |||
| 95f88b6bf4 |
@@ -1,40 +0,0 @@
|
||||
diff --git a/cmake/ConfigureOpenSSL.cmake b/cmake/ConfigureOpenSSL.cmake
|
||||
index 3012e05..2ae23ff 100644
|
||||
--- a/cmake/ConfigureOpenSSL.cmake
|
||||
+++ b/cmake/ConfigureOpenSSL.cmake
|
||||
@@ -108,7 +108,8 @@ function(configure_openssl)
|
||||
)
|
||||
|
||||
if(NOT "${CONFIGURE_OPTIONS_OLD}" STREQUAL "")
|
||||
- if(CONFIGURE_OPTIONS STREQUAL CONFIGURE_OPTIONS_OLD)
|
||||
+ # TODO(lizzie): Emscripten has issues with rebuilding due to the wrapper it uses
|
||||
+ if(CMAKE_SYSTEM_NAME MATCHES "Emscripten" OR CONFIGURE_OPTIONS STREQUAL CONFIGURE_OPTIONS_OLD)
|
||||
message(STATUS "Found previous configure results. Don't perform configuration")
|
||||
return()
|
||||
endif()
|
||||
@@ -134,10 +135,24 @@ function(configure_openssl)
|
||||
set(VERBOSE_OPTION OUTPUT_QUIET)
|
||||
endif()
|
||||
|
||||
+ if (CMAKE_SYSTEM_NAME MATCHES "Emscripten")
|
||||
+ set(EMSCRIPTEN_CMAKE_WRAPPER "emcmake")
|
||||
+ find_program(EMCC emcc REQUIRED)
|
||||
+ set(EMSCRIPTEN_LINKER ${EMCC})
|
||||
+ list(APPEND CONFIGURE_COMMAND wasm64)
|
||||
+ else()
|
||||
+ set(EMSCRIPTEN_CMAKE_WRAPPER "")
|
||||
+ set(EMSCRIPTEN_LINKER ${CMAKE_LINKER})
|
||||
+ endif ()
|
||||
+
|
||||
execute_process(
|
||||
- COMMAND ${CMAKE_COMMAND} -E env
|
||||
+ COMMAND ${EMSCRIPTEN_CMAKE_WRAPPER} ${CMAKE_COMMAND} -E env
|
||||
"CFLAGS=${CMAKE_C_FLAGS}"
|
||||
"CXXFLAGS=${CMAKE_CXX_FLAGS}"
|
||||
+ "LDFLAGS=${CMAKE_CXX_LINK_FLAGS}"
|
||||
+ "CC=${CMAKE_C_COMPILER}"
|
||||
+ "CXX=${CMAKE_CXX_COMPILER}"
|
||||
+ "LD=${EMSCRIPTEN_LINKER}"
|
||||
${CONFIGURE_COMMAND}
|
||||
WORKING_DIRECTORY ${CONFIGURE_BUILD_DIR}
|
||||
${VERBOSE_OPTION}
|
||||
+1
-2
@@ -202,8 +202,7 @@
|
||||
"0001-cpmutil-compat.patch",
|
||||
"0002-use-ccache.patch",
|
||||
"0003-use-cmake-compiler-flags.patch",
|
||||
"0004-use-shell-wrapper.patch",
|
||||
"0005-cross-compile.patch"
|
||||
"0004-use-shell-wrapper.patch"
|
||||
],
|
||||
"repo": "jimmy-park/openssl-cmake",
|
||||
"version": "3.6.2"
|
||||
|
||||
+4
-25
@@ -6,31 +6,10 @@ General guide for cross compiling.
|
||||
|
||||
A painless guide for cross compilation (or to test NCE) from a x86_64 system without polluting your main.
|
||||
|
||||
```sh
|
||||
#!/bin/sh
|
||||
ISO_FILE="debian-13.0.0-arm64-netinst.iso"
|
||||
DISK_FILE="debian-13-arm64-ci.qcow2"
|
||||
which -- qemu-system-aarch64 || sudo pkg install qemu
|
||||
[ -f "$ISO_FILE" ] || wget https://cdimage.debian.org/debian-cd/current/arm64/iso-cd/$ISO_FILE
|
||||
[ -f "$DISK_FILE" ] || qemu-img create -f qcow2 "$DISK_FILE" 30G
|
||||
QEMU_FLAGS=(
|
||||
-M virt
|
||||
-m 2G
|
||||
-cpu max
|
||||
-bios /usr/local/share/qemu/edk2-aarch64-code.fd
|
||||
-drive if=none,file=$ISO_FILE,format=raw,id=cdrom
|
||||
-drive if=none,file=$DISK_FILE,id=hd0,format=qcow2
|
||||
-device scsi-cd,drive=cdrom
|
||||
-device virtio-blk-device,drive=hd0
|
||||
-device virtio-gpu-pci
|
||||
-device usb-ehci
|
||||
-device usb-kbd
|
||||
-device intel-hda
|
||||
-device hda-output
|
||||
-nic user,model=virtio-net-pci
|
||||
)
|
||||
qemu-system-aarch64 "${QEMU_FLAGS[@]}"
|
||||
```
|
||||
- Install QEMU: `sudo pkg install qemu`
|
||||
- Download Debian 13: `wget https://cdimage.debian.org/debian-cd/current/arm64/iso-cd/debian-13.0.0-arm64-netinst.iso`
|
||||
- Create a system disk: `qemu-img create -f qcow2 debian-13-arm64-ci.qcow2 30G`
|
||||
- Run the VM: `qemu-system-aarch64 -M virt -m 2G -cpu max -bios /usr/local/share/qemu/edk2-aarch64-code.fd -drive if=none,file=debian-13.0.0-arm64-netinst.iso,format=raw,id=cdrom -device scsi-cd,drive=cdrom -drive if=none,file=debian-13-arm64-ci.qcow2,id=hd0,format=qcow2 -device virtio-blk-device,drive=hd0 -device virtio-gpu-pci -device usb-ehci -device usb-kbd -device intel-hda -device hda-output -nic user,model=virtio-net-pci`
|
||||
|
||||
## Gentoo
|
||||
|
||||
|
||||
+5
-5
@@ -101,11 +101,6 @@ endfunction()
|
||||
# ia64 exists
|
||||
# the rest exist, but are probably less popular than ia64
|
||||
|
||||
detect_architecture_symbols(
|
||||
ARCH wasm
|
||||
SYMBOLS
|
||||
"__EMSCRIPTEN__")
|
||||
|
||||
detect_architecture_symbols(
|
||||
ARCH arm64
|
||||
SYMBOLS
|
||||
@@ -208,6 +203,11 @@ detect_architecture_symbols(
|
||||
"__loongarch__"
|
||||
"__loongarch64")
|
||||
|
||||
detect_architecture_symbols(
|
||||
ARCH wasm
|
||||
SYMBOLS
|
||||
"__EMSCRIPTEN__")
|
||||
|
||||
# "generic" target
|
||||
# If you have reached this point, you're on some as-of-yet unsupported architecture.
|
||||
# See the docs up above for known unsupported architectures
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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};
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -197,15 +197,15 @@ void EmitA32Terminal(biscuit::Assembler& as, EmitContext& ctx, IR::Term::CheckHa
|
||||
|
||||
void EmitA32LeafTerminal(biscuit::Assembler& as, EmitContext& ctx, IR::Term::LeafTerminal terminal, IR::LocationDescriptor initial_location, bool is_single_step) {
|
||||
if (auto const x = std::get_if<IR::Term::ReturnToDispatch>(&terminal))
|
||||
return EmitA32Terminal(as, ctx, *x, initial_location, is_single_step);
|
||||
return EmitA32LeafTerminal(as, ctx, *x, initial_location, is_single_step);
|
||||
if (auto const x = std::get_if<IR::Term::LinkBlock>(&terminal))
|
||||
return EmitA32Terminal(as, ctx, *x, initial_location, is_single_step);
|
||||
return EmitA32LeafTerminal(as, ctx, *x, initial_location, is_single_step);
|
||||
if (auto const x = std::get_if<IR::Term::LinkBlockFast>(&terminal))
|
||||
return EmitA32Terminal(as, ctx, *x, initial_location, is_single_step);
|
||||
return EmitA32LeafTerminal(as, ctx, *x, initial_location, is_single_step);
|
||||
if (auto const x = std::get_if<IR::Term::PopRSBHint>(&terminal))
|
||||
return EmitA32Terminal(as, ctx, *x, initial_location, is_single_step);
|
||||
return EmitA32LeafTerminal(as, ctx, *x, initial_location, is_single_step);
|
||||
if (auto const x = std::get_if<IR::Term::FastDispatchHint>(&terminal))
|
||||
return EmitA32Terminal(as, ctx, *x, initial_location, is_single_step);
|
||||
return EmitA32LeafTerminal(as, ctx, *x, initial_location, is_single_step);
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user