RetroArch icon indicating copy to clipboard operation
RetroArch copied to clipboard

[Feature Request] Timed-Application of Cheats After ROM Load

Open cxtal opened this issue 8 months ago • 0 comments

Hello!

When a ROM is loaded and RetroArch is configured to apply cheats on load, the cheats might be applied too soon such that the memory layout might have changed in the meanwhile which, in turn, leads to memory corruption due to an implicit time-of-check-to-time-of-use race condition. During testing, it was determined that this issue occurs for complex emulators like FBNeo that have their own specific boot-up such that tampering with the memory before the actual game has loaded does not make much sense - if you will, you can compare this to overriding a memory location on some emulator with loadable media like PlayStation such that applying any "hack" would not even make sense if the disc would not be inside and the game not loaded yet.

Short of implementing conditionals (ie: apply the memory overwrite when some other memory location contains a certain value) which would be an ideal solution, an easier variant could be implemented such that RetroArch would wait a user-provided number of time units before applying the cheats. It would be even nicer if the delay could be applied per cheat instead of applying them all with a delay. For the most part, this is because the memory layout can already be determined and the only major change takes place only during loading.

Right now, the RetroArch option to apply a cheat once the game loads, applies the cheat right when the ROM is loaded, which leads to various errors even though the cheat works fine if it is loaded manually (and even) right after the loading screen.

Thank you!

cxtal avatar May 30 '25 22:05 cxtal