mirror of
https://github.com/PabloMK7/citra.git
synced 2025-09-10 04:40:05 +00:00
Implement plugin loader Mode3 mem strategy (#7)
This commit is contained in:
parent
f5316532e6
commit
c710c0009f
8 changed files with 61 additions and 12 deletions
|
@ -117,6 +117,14 @@ public:
|
|||
return std::make_pair(0x2, ResultStatus::Success);
|
||||
}
|
||||
|
||||
/**
|
||||
* Forces the application memory mode to the specified value,
|
||||
* overriding the memory mode specified in the metadata.
|
||||
*/
|
||||
void SetKernelMemoryModeOverride(Kernel::MemoryMode mem_override) {
|
||||
memory_mode_override = mem_override;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the memory mode that this application needs.
|
||||
* This function defaults to Dev1 (96MB allocated to the application) if it can't read the
|
||||
|
@ -124,6 +132,9 @@ public:
|
|||
* @returns A pair with the optional memory mode, and the status.
|
||||
*/
|
||||
virtual std::pair<std::optional<Kernel::MemoryMode>, ResultStatus> LoadKernelMemoryMode() {
|
||||
if (memory_mode_override.has_value()) {
|
||||
return std::make_pair(*memory_mode_override, ResultStatus::Success);
|
||||
}
|
||||
// 96MB allocated to the application.
|
||||
return std::make_pair(Kernel::MemoryMode::Dev1, ResultStatus::Success);
|
||||
}
|
||||
|
@ -257,6 +268,7 @@ protected:
|
|||
Core::System& system;
|
||||
FileUtil::IOFile file;
|
||||
bool is_loaded = false;
|
||||
std::optional<Kernel::MemoryMode> memory_mode_override = std::nullopt;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue