mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
RAIntegration: Fix memory writes
This commit is contained in:
parent
c9515ceb4e
commit
d39b606931
1 changed files with 10 additions and 8 deletions
|
@ -236,6 +236,15 @@ bool IsActive() {
|
|||
return GetGameID() != 0;
|
||||
}
|
||||
|
||||
static void raintegration_write_memory_handler(uint32_t address, uint8_t *buffer, uint32_t num_bytes, rc_client_t *client) {
|
||||
// convert_retroachievements_address_to_real_address
|
||||
uint32_t realAddress = address + PSP_MEMORY_OFFSET;
|
||||
uint8_t *writePtr = Memory::GetPointerWriteRange(realAddress, num_bytes);
|
||||
if (writePtr) {
|
||||
memcpy(writePtr, buffer, num_bytes);
|
||||
}
|
||||
}
|
||||
|
||||
static uint32_t read_memory_callback(uint32_t address, uint8_t *buffer, uint32_t num_bytes, rc_client_t *client) {
|
||||
// Achievements are traditionally defined relative to the base of main memory of the emulated console.
|
||||
// This is some kind of RetroArch-related legacy. In the PSP's case, this is simply a straight offset of 0x08000000.
|
||||
|
@ -483,14 +492,7 @@ static void raintegration_get_game_name_handler(char *buffer, uint32_t buffer_si
|
|||
snprintf(buffer, buffer_size, "%s", g_gamePath.GetFilename().c_str());
|
||||
}
|
||||
|
||||
static void raintegration_write_memory_handler(uint32_t address, uint8_t *buffer, uint32_t num_bytes, rc_client_t *client) {
|
||||
// convert_retroachievements_address_to_real_address
|
||||
uint32_t realAddress = address + PSP_MEMORY_OFFSET;
|
||||
uint8_t *writePtr = Memory::GetPointerWriteRange(address, num_bytes);
|
||||
if (writePtr) {
|
||||
memcpy(writePtr, buffer, num_bytes);
|
||||
}
|
||||
}
|
||||
static void raintegration_write_memory_handler(uint32_t address, uint8_t *buffer, uint32_t num_bytes, rc_client_t *client);
|
||||
|
||||
static void raintegration_event_handler(const rc_client_raintegration_event_t *event, rc_client_t *client) {
|
||||
switch (event->type) {
|
||||
|
|
Loading…
Add table
Reference in a new issue