libretro / pcsx_rearmed

ARM optimized PCSX fork
GNU General Public License v2.0
168 stars 120 forks source link

[Feature request] Expose Scratchpad memory for Retroachievements #845

Closed PopovMark closed 2 months ago

PopovMark commented 2 months ago

The Scratchpad is a cache-like memory region that is 1KB in size and starts at 1F800000 in the console memory. It is used occasionally for certain speed optimizations and other things. See this link for more details: https://psx-spx.consoledev.net/memorymap/

Currently, Scratchpad memory is not exposed in the core's memory map. This is used extensively in a few games (notably, the Rockman Complete Works ports of the first six Mega Man games have critical values in that region such as health, lives, weapon ammo, e.t.c.). Here is the relevant bits of the log:

363930024-94e78b87-4ef7-43b0-a625-d721989c75c0

I am mostly requesting this to be able to use this region for cheat codes and for Retroachievements. Currently, the Duckstation standalone and apparently BizHawk already have this feature, but the former has issues processing achievements when savestates are involved, and the latter's achievement functionality is relatively new and not as stable or convenient to use. Thank you for understanding.

PopovMark commented 2 months ago

I tested the latest update and now it works like a charm. Thank you so much!