bsnes icon indicating copy to clipboard operation
bsnes copied to clipboard

Add RetroAchievements support

Open nfp0 opened this issue 4 years ago • 10 comments

All bsnes and higan cores in Retroarch, besides this one, support RetroAchievements (even higan Accuracy and nSide Balanced, contrary to the info in the docs).

It would be great to have this excellent up-to-date core also supporting RetroAchievements. Maybe code from the other bsnes/higan cores can be ported to this one to save time.

nfp0 avatar May 02 '20 00:05 nfp0

According to a contributor, the missing implementation is this:

https://github.com/bsnes-emu/bsnes/blob/30e274953a8d7dc10e71be0987c15018e397df2f/bsnes/target-libretro/libretro.cpp#L711-L721

nfp0 avatar May 02 '20 00:05 nfp0

I don't know enough about the libretro API or bsnes' internals to guess why that comment describes it as "severe hackery", but it does seem it would be nice to have as an option.

If it's possible to implement this feature without "severe hackery", I'd accept a PR. If not, I would be interested to hear an explanation of the scope of the hackery required.

Screwtapello avatar Oct 15 '20 11:10 Screwtapello

That comment also confused me. The problem is that I don't know how to track who wrote that comment. And the comment is so old that it might not even be valid anymore.

From a quick look-around on the code of the old bsnes cores that support RetroAchievements, it seems to be a straightforward implementation. Here are examples from 2 different bsnes cores: https://github.com/libretro/nSide/blob/5e965d0db4c0d05e7e8fb6449035538781c73473/nSide/target-libretro/libretro.cpp#L334-L346

https://github.com/libretro/bsnes-libretro/blob/6d2c3a811c09ffa5d00f50c1491975f1e480fffa/target-libretro/libretro.cpp#L1033-L1108

nfp0 avatar Oct 17 '20 14:10 nfp0

I wish this would get more attention. I'd help out but I don't know anything about emulators or the technical side of RetroAchievements.

Noxillio avatar Aug 26 '21 00:08 Noxillio

If memory is exposed properly, you shouldn't need to know anything about RetroAchievements for it to work. Achieving that without breaking or slowing down everything ~~in this core~~ would require quite a bit of programming knowledge though.

Sanaki avatar Aug 26 '21 00:08 Sanaki

this core

It's not a core though, right? This is its own emulator. But then again, I don't understand the technicalities of RetroArch cores either so if I'm wrong about that please tell me.

Also, this might be asking too much too, but it would be absolutely perfect if it would also support Game Boy titles via Super Game Boy emulation. It's the whole reason I use bsnes, because it's the absolute best way to play Game Boy games.

Noxillio avatar Aug 26 '21 00:08 Noxillio

Oh, bugger, misread the repo. Thought this was in the libretro core's repo. I'm following too many of these, sorry about that. Then yeah, this one would need to implement rcheevos. But again, the big difficulty is in memory exposure. If someone -does- want to take on the task, I'd be happy to help go over requirements and such, and you can always contact us through the RetroAchievements discord server if need be. https://github.com/RetroAchievements/rcheevos/

Sanaki avatar Aug 26 '21 00:08 Sanaki

There's a comment from @hunterk (don't remember where) where he mentions that this is not as simple as it looks, but I would like to have some insight on why it would be complex.

If it's nothing outside of this world, I might dive into it.

nfp0 avatar Feb 25 '22 16:02 nfp0

IIRC, the issue is that the memory pointer lives inside of a struct that lives inside another struct and unrolling it enough to access it directly would make quite a mess of things.

EDIT: and to be clear, this wasn't the case with previous bsnes iterations, which exposed it easy-peasy.

hizzlekizzle avatar Feb 25 '22 17:02 hizzlekizzle

Aw shame. If that is the case I guess we'll be stuck with bsnes2014 for a while. Thank you for the insight @hizzlekizzle !

nfp0 avatar Feb 25 '22 19:02 nfp0