AMV + WLAN stubs

This commit is contained in:
lizzie 2026-05-20 08:39:21 +00:00
parent 07f1c7fabb
commit 323d82302c

View file

@ -2,6 +2,9 @@
// SPDX-License-Identifier: GPL-3.0-or-later
#include <memory>
#include "core/hle/result.h"
#include "core/hle/service/cmif_serialization.h"
#include "core/hle/service/cmif_types.h"
#include "core/hle/service/ipc_helpers.h"
#include "core/hle/service/ulsf/ulsf.h"
#include "core/hle/service/server_manager.h"
@ -30,11 +33,104 @@ void ULSF_U::GetVersion(HLERequestContext& ctx) {
rb.PushRaw(version);
}
enum class MenuMessage : u32 {
Invalid,
HomeRequest,
SdCardEjected,
GameCardMountFailure,
PreviousLaunchFailure,
ChosenHomebrew,
FinishedSleep,
ApplicationRecordsChanged,
ApplicationVerifyProgress,
ApplicationVerifyResult
};
struct MenuMessageContext {
MenuMessage msg;
union {
struct {
Result mount_rc;
} gc_mount_failure;
struct {
char nro_path[0x301];
} chosen_hb;
struct {
bool records_added_or_deleted;
} app_records_changed;
struct {
u64 app_id;
u64 done;
u64 total;
} app_verify_progress;
struct {
u64 app_id;
Result rc;
Result detail_rc;
} app_verify_rc;
};
};
class ULSF_P final : public ServiceFramework<ULSF_P> {
public:
explicit ULSF_P(Core::System& system_) : ServiceFramework{system_, "ulsf:p"} {
static const FunctionInfo functions[] = {
{0, C<&ULSF_P::Initialize>, "Initialize"},
{1, C<&ULSF_P::TryPopMessageContext>, "TryPopMessageContext"},
};
RegisterHandlers(functions);
}
~ULSF_P() = default;
Result Initialize(u64 pid) {
LOG_WARNING(Service_SM, "(stubbed) pid={}", pid);
R_SUCCEED();
}
Result TryPopMessageContext(OutLargeData<MenuMessageContext, BufferAttr_HipcMapAlias> out_menu_message) {
//LOG_WARNING(Service_SM, "(stubbed)");
// *out_menu_message = {};
// R_SUCCEED();
R_THROW(Kernel::ResultInvalidAddress);
}
};
class AVM final : public ServiceFramework<AVM> {
public:
explicit AVM(Core::System& system_): ServiceFramework{system_, "avm"} {
static const FunctionInfo functions[] = {
{0, &AVM::Cmd0, "Cmd0"},
};
RegisterHandlers(functions);
}
~AVM() = default;
void Cmd0(HLERequestContext& ctx) {
LOG_WARNING(Service_SM, "(stubbed)");
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
};
class WLAN final : public ServiceFramework<WLAN> {
public:
explicit WLAN(Core::System& system_): ServiceFramework{system_, "wlan"} {
static const FunctionInfo functions[] = {
{0, &WLAN::Cmd0, "Cmd0"},
};
RegisterHandlers(functions);
}
~WLAN() = default;
void Cmd0(HLERequestContext& ctx) {
LOG_WARNING(Service_SM, "(stubbed)");
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
};
void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
server_manager->RegisterNamedService("ulsf:u", std::make_shared<ULSF_U>(system));
server_manager->RegisterNamedService("ulsf:p", std::make_shared<ULSF_P>(system));
server_manager->RegisterNamedService("avm", std::make_shared<AVM>(system));
server_manager->RegisterNamedService("wlan", std::make_shared<WLAN>(system));
ServerManager::RunServer(std::move(server_manager));
}