nesbox / TIC-80

TIC-80 is a fantasy computer for making, playing and sharing tiny games.
https://tic80.com
MIT License
5.05k stars 491 forks source link

LibRetro: Add RetroAchievements support #1903

Open TheFetishMachine opened 2 years ago

TheFetishMachine commented 2 years ago

As requested, here's the issue for achievement support. The two most important aspects for achievement support are savestates and exposed memory. Currently achievements do not work correctly and only 96 KB of memory are exposed (probably the "hardware"?).

RobLoach commented 2 years ago

Thanks for making this. The memory hooks are implemented. Not sure what would be required on the RetroAchiements side tho.

pinguupinguu commented 2 years ago

Hello! I'm a dev on RA

I was poking around with the current libretro core. When using our memory inspector, I wasn't able to find values such as high-scores and lives in some cartridges. I tried "Dino Run" and with "Cavern Run" no luck though.

Reading up on the RAM map, I noticed that "persistent memory" might have what developers need to create achievements. This might be a part that's not readily available? https://github.com/nesbox/TIC-80/wiki/ram

I'm uncertain of the state of the core as @TheFetishMachine just brought this to my attention. Thanks for your work so far!

RobLoach commented 2 years ago

Correct. Since many of the games use their own scripting language, it can be difficult to grab memory information from the games. If the applications use the persistent memory thgouh pmem(), we can query against that.

For Super Meat Boy Tic-80 Demake, for instance, I was able to find the values within pmem to toggle which levels were avialable for cheats: https://github.com/libretro/libretro-database/blob/master/cht/TIC-80/Super%20Meat%20Boy%20TIC-80%20Demake.cht