Cemu/src/Cafe/OS/RPL/COSModule.h
Exzap c5913fe8cb refactor/rpl: Treat HLE libs more like RPL modules
HLE modules now have a unified interface via which they can get notified when mapped into the process or when loaded/unloaded.

We also always call the unload functions when stopping emulation to give the module implementations a chance to reset all state (although many of them are still missing proper cleanup code for now)
2026-01-07 02:46:49 +01:00

24 lines
621 B
C++

#pragma once
namespace coreinit
{
enum class RplEntryReason;
};
// base class for HLE RPL implementations
class COSModule
{
public:
virtual std::string_view GetName() = 0;
virtual std::vector<std::string_view> GetDependencies() { return {}; };
virtual void RPLMapped() {}; // RPL mapped into process
virtual void RPLUnmapped() {}; // RPL unmapped
virtual void rpl_entry(uint32 moduleHandle, coreinit::RplEntryReason reason) {};
// note: to simplify cleanup, both RPLUnmapped() and rpl_entry(unload) are always called even if the process is shutdown via "Close game"
};
std::span<COSModule*> GetCOSModules();