mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-09 15:49:25 +01:00
Add rc_client MemoryPeekerV2 to AchievementManager
Has a more traditional read-x-bytes structure; for passing into rc_client in the constructor.
This commit is contained in:
parent
05136ee099
commit
4ec662bcdf
@ -1749,4 +1749,21 @@ void AchievementManager::RequestV2(const rc_api_request_t* request,
|
||||
});
|
||||
}
|
||||
|
||||
u32 AchievementManager::MemoryPeekerV2(u32 address, u8* buffer, u32 num_bytes, rc_client_t* client)
|
||||
{
|
||||
if (buffer == nullptr)
|
||||
return 0u;
|
||||
auto& system = Core::System::GetInstance();
|
||||
Core::CPUThreadGuard threadguard(system);
|
||||
for (u32 num_read = 0; num_read < num_bytes; num_read++)
|
||||
{
|
||||
auto value = system.GetMMU().HostTryReadU8(threadguard, address + num_read,
|
||||
PowerPC::RequestedAddressSpace::Physical);
|
||||
if (!value.has_value())
|
||||
return num_read;
|
||||
buffer[num_read] = value.value().value;
|
||||
}
|
||||
return num_bytes;
|
||||
}
|
||||
|
||||
#endif // USE_RETRO_ACHIEVEMENTS
|
||||
|
@ -204,8 +204,10 @@ private:
|
||||
const std::function<int(rc_api_request_t*, const RcRequest*)>& init_request,
|
||||
const std::function<int(RcResponse*, const char*)>& process_response);
|
||||
ResponseType RequestImage(rc_api_fetch_image_request_t rc_request, Badge* rc_response);
|
||||
|
||||
static void RequestV2(const rc_api_request_t* request, rc_client_server_callback_t callback,
|
||||
void* callback_data, rc_client_t* client);
|
||||
static u32 MemoryPeekerV2(u32 address, u8* buffer, u32 num_bytes, rc_client_t* client);
|
||||
|
||||
rc_runtime_t m_runtime{};
|
||||
Core::System* m_system{};
|
||||
|
Loading…
x
Reference in New Issue
Block a user