mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
AchievementManager: verify MEM2 if it exists
Adds MEM2 to MemoryVerifier.
This commit is contained in:
@ -1317,10 +1317,10 @@ void AchievementManager::Request(const rc_api_request_t* request,
|
|||||||
u32 AchievementManager::MemoryVerifier(u32 address, u8* buffer, u32 num_bytes, rc_client_t* client)
|
u32 AchievementManager::MemoryVerifier(u32 address, u8* buffer, u32 num_bytes, rc_client_t* client)
|
||||||
{
|
{
|
||||||
auto& system = Core::System::GetInstance();
|
auto& system = Core::System::GetInstance();
|
||||||
u32 ram_size = system.GetMemory().GetRamSizeReal();
|
u32 mem2_size = system.GetMemory().GetExRamSizeReal();
|
||||||
if (address >= ram_size)
|
if (address < MEM1_SIZE + mem2_size)
|
||||||
|
return std::min(MEM1_SIZE + mem2_size - address, num_bytes);
|
||||||
return 0;
|
return 0;
|
||||||
return std::min(ram_size - address, num_bytes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 AchievementManager::MemoryPeeker(u32 address, u8* buffer, u32 num_bytes, rc_client_t* client)
|
u32 AchievementManager::MemoryPeeker(u32 address, u8* buffer, u32 num_bytes, rc_client_t* client)
|
||||||
|
@ -76,6 +76,9 @@ public:
|
|||||||
using RichPresence = std::array<char, RP_SIZE>;
|
using RichPresence = std::array<char, RP_SIZE>;
|
||||||
using Badge = VideoCommon::CustomTextureData::ArraySlice::Level;
|
using Badge = VideoCommon::CustomTextureData::ArraySlice::Level;
|
||||||
static constexpr size_t MAX_DISPLAYED_LBOARDS = 4;
|
static constexpr size_t MAX_DISPLAYED_LBOARDS = 4;
|
||||||
|
// This is hardcoded to 24MiB because rcheevos currently hardcodes it to 24MiB.
|
||||||
|
static constexpr u32 MEM1_SIZE = 0x01800000;
|
||||||
|
static constexpr u32 MEM2_START = 0x10000000;
|
||||||
|
|
||||||
static constexpr std::string_view DEFAULT_PLAYER_BADGE_FILENAME = "achievements_player.png";
|
static constexpr std::string_view DEFAULT_PLAYER_BADGE_FILENAME = "achievements_player.png";
|
||||||
static constexpr std::string_view DEFAULT_GAME_BADGE_FILENAME = "achievements_game.png";
|
static constexpr std::string_view DEFAULT_GAME_BADGE_FILENAME = "achievements_game.png";
|
||||||
|
Reference in New Issue
Block a user