mirror of
				https://git.suyu.dev/suyu/suyu
				synced 2025-11-03 16:39:01 -06:00 
			
		
		
		
	
							
								
								
									
										75
									
								
								src/core/hle/service/fgm/fgm.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										75
									
								
								src/core/hle/service/fgm/fgm.cpp
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,75 @@
 | 
			
		||||
// Copyright 2018 yuzu emulator team
 | 
			
		||||
// Licensed under GPLv2 or any later version
 | 
			
		||||
// Refer to the license.txt file included.
 | 
			
		||||
 | 
			
		||||
#include <memory>
 | 
			
		||||
 | 
			
		||||
#include "core/hle/ipc_helpers.h"
 | 
			
		||||
#include "core/hle/kernel/hle_ipc.h"
 | 
			
		||||
#include "core/hle/service/fgm/fgm.h"
 | 
			
		||||
#include "core/hle/service/service.h"
 | 
			
		||||
#include "core/hle/service/sm/sm.h"
 | 
			
		||||
 | 
			
		||||
namespace Service::FGM {
 | 
			
		||||
 | 
			
		||||
class IRequest final : public ServiceFramework<IRequest> {
 | 
			
		||||
public:
 | 
			
		||||
    explicit IRequest() : ServiceFramework{"IRequest"} {
 | 
			
		||||
        // clang-format off
 | 
			
		||||
        static const FunctionInfo functions[] = {
 | 
			
		||||
            {0, nullptr, "Initialize"},
 | 
			
		||||
            {1, nullptr, "Set"},
 | 
			
		||||
            {2, nullptr, "Get"},
 | 
			
		||||
            {3, nullptr, "Cancel"},
 | 
			
		||||
        };
 | 
			
		||||
        // clang-format on
 | 
			
		||||
 | 
			
		||||
        RegisterHandlers(functions);
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
class FGM final : public ServiceFramework<FGM> {
 | 
			
		||||
public:
 | 
			
		||||
    explicit FGM(const char* name) : ServiceFramework{name} {
 | 
			
		||||
        // clang-format off
 | 
			
		||||
        static const FunctionInfo functions[] = {
 | 
			
		||||
            {0, &FGM::Initialize, "Initialize"},
 | 
			
		||||
        };
 | 
			
		||||
        // clang-format on
 | 
			
		||||
 | 
			
		||||
        RegisterHandlers(functions);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
    void Initialize(Kernel::HLERequestContext& ctx) {
 | 
			
		||||
        IPC::ResponseBuilder rb{ctx, 2, 0, 1};
 | 
			
		||||
        rb.Push(RESULT_SUCCESS);
 | 
			
		||||
        rb.PushIpcInterface<IRequest>();
 | 
			
		||||
 | 
			
		||||
        LOG_DEBUG(Service_FGM, "called");
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
class FGM_DBG final : public ServiceFramework<FGM_DBG> {
 | 
			
		||||
public:
 | 
			
		||||
    explicit FGM_DBG() : ServiceFramework{"fgm:dbg"} {
 | 
			
		||||
        // clang-format off
 | 
			
		||||
        static const FunctionInfo functions[] = {
 | 
			
		||||
            {0, nullptr, "Initialize"},
 | 
			
		||||
            {1, nullptr, "Read"},
 | 
			
		||||
            {2, nullptr, "Cancel"},
 | 
			
		||||
        };
 | 
			
		||||
        // clang-format on
 | 
			
		||||
 | 
			
		||||
        RegisterHandlers(functions);
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
void InstallInterfaces(SM::ServiceManager& sm) {
 | 
			
		||||
    std::make_shared<FGM>("fgm")->InstallAsService(sm);
 | 
			
		||||
    std::make_shared<FGM>("fgm:0")->InstallAsService(sm);
 | 
			
		||||
    std::make_shared<FGM>("fgm:9")->InstallAsService(sm);
 | 
			
		||||
    std::make_shared<FGM_DBG>()->InstallAsService(sm);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
} // namespace Service::FGM
 | 
			
		||||
							
								
								
									
										15
									
								
								src/core/hle/service/fgm/fgm.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								src/core/hle/service/fgm/fgm.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,15 @@
 | 
			
		||||
// Copyright 2018 yuzu emulator team
 | 
			
		||||
// Licensed under GPLv2 or any later version
 | 
			
		||||
// Refer to the license.txt file included.
 | 
			
		||||
 | 
			
		||||
#pragma once
 | 
			
		||||
 | 
			
		||||
namespace Service::SM {
 | 
			
		||||
class ServiceManager;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
namespace Service::FGM {
 | 
			
		||||
 | 
			
		||||
void InstallInterfaces(SM::ServiceManager& sm);
 | 
			
		||||
 | 
			
		||||
} // namespace Service::FGM
 | 
			
		||||
@@ -27,6 +27,7 @@
 | 
			
		||||
#include "core/hle/service/es/es.h"
 | 
			
		||||
#include "core/hle/service/eupld/eupld.h"
 | 
			
		||||
#include "core/hle/service/fatal/fatal.h"
 | 
			
		||||
#include "core/hle/service/fgm/fgm.h"
 | 
			
		||||
#include "core/hle/service/filesystem/filesystem.h"
 | 
			
		||||
#include "core/hle/service/friend/friend.h"
 | 
			
		||||
#include "core/hle/service/grc/grc.h"
 | 
			
		||||
@@ -209,6 +210,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
 | 
			
		||||
    ES::InstallInterfaces(*sm);
 | 
			
		||||
    EUPLD::InstallInterfaces(*sm);
 | 
			
		||||
    Fatal::InstallInterfaces(*sm);
 | 
			
		||||
    FGM::InstallInterfaces(*sm);
 | 
			
		||||
    FileSystem::InstallInterfaces(*sm);
 | 
			
		||||
    Friend::InstallInterfaces(*sm);
 | 
			
		||||
    GRC::InstallInterfaces(*sm);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user