beetle-psx-libretro icon indicating copy to clipboard operation
beetle-psx-libretro copied to clipboard

[Feature request] Expose Scratchpad memory for Retroachievements

Open UnliquidSnake opened this issue 1 year ago • 1 comments

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.

UnliquidSnake avatar Sep 03 '24 09:09 UnliquidSnake

scratchram memmap is currently disable, dunno why.

#if 0
   MDFNMP_AddRAM(1024, 0x1F800000, ScratchRAM.data8);
#endif

https://github.com/libretro/beetle-psx-libretro/blob/232bdf101095122cfc4b904b219d5e64a9d36528/libretro.cpp#L2105C1-L2107C7

negativeExponent avatar Mar 27 '25 02:03 negativeExponent