libretro / beetle-psx-libretro

Standalone port/fork of Mednafen PSX to the Libretro API.
GNU General Public License v2.0
309 stars 131 forks source link

[Feature request] Expose Scratchpad memory for Retroachievements #907

Open PopovMark opened 3 weeks ago

PopovMark commented 3 weeks ago

Description

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:

363927184-dbb53197-34b1-451e-8ff3-4bc9722dd0bb

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.