-
-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Libretro achievements not working #48
Comments
Ok have some more info Pokemon Blue achievements didn't unlock when running in GBC mode, they unlocked properly in GB mode So it seems to be an issue with GBC @LIJI32 maybe the offsets are different? |
Same thing seems to happen in gearboy, he hooked up achievements recently and I guess it's a similar prob https://github.com/drhelius/Gearboy/blob/master/platforms/libretro/libretro.cpp#L349 He even adds a note about it. |
Can you give any example to an achievement definition that does not work on CGB mode, but works on DMG mode? |
Not sure how the achievements are defined exactly @leiradel would have to help there. http://retroachievements.org/user/Radius4 see all the GB games on top, I reset all of those and tried in CGB (and never triggered) and DMG (all of those triggered), the pokemon ones triggered because I have SRM. The one in the screenshot is "beat level 1 in normal difficulty" in Kirby's Dream Land. I asked on the RetroAchievements.org discord, awaiting a response now. |
I'm sorry, I've been busy with RL... In this line descs[3].ptr = core->IsCGB() ? (core->GetMemory()->GetCGBRAM() + (0x1000 * core->GetMemory()->GetCurrentCGBRAMBank())) : (core->GetMemory()->GetMemoryMap() + 0xD000); What descs[3].ptr = core->IsCGB() ? (core->GetMemory()->GetCGBRAM() + 0x1000) : (core->GetMemory()->GetMemoryMap() + 0xD000); |
That's not SameBoy code. :) |
Ugh, that's from Gearboy! Sorry for the confusion. I believe this descriptor gets RAM banks 0 and 1, right? Bank 1 is needed when available. descs[2].ptr = GB_get_direct_access(&gameboy[i], GB_DIRECT_ACCESS_RAM, &size, &bank);
descs[2].start = 0xC000;
descs[2].len = 0x2000; Also, I'm not 100% sure but I think some cheevos rely on the IE register at 0xFFFF, is it updated in the memory location saved on |
This descriptor gets both banks 0 and 1. IE is also updated in the same memory location. |
Also, can you give examples of which memory address are being queried for an achievement working in DMG mode but not in CGB mode? And, are you using the SameBoy CGB boot ROM or the original one? |
An easy test is this achievement: I don't know how to get conditions it uses to unlock, maybe I need their developer tools but I'm sure @leiradel knows how |
This is the expression for that achievement:
The explanation is this:
It only uses addresses in the 0xD000-0xDFFF range, so it should be working. |
I'm pretty sure we (as in libretro) added achievements not @LIJI32. He fixed it here: I see that he has 2 banks for RAM and that the addresses have different offsets? depending on model |
Here is an easy test case, load the game, load SRM and it should unlock a ton It actually does in B&W mode but not in Color mode |
So the only difference is that Gearboy maps the CGB RAM banks 0 and 1 separately, from 0xC000 to 0xCFFFF and from 0xD000 to 0xDFFF, and SameBoy maps both banks in one go, from 0xC000 to 0xDFFF? It shouldn't make any difference for the cheevos code. I'll check the RetroArch log for both cores and see how it's reporting the memory descriptors for clues. |
Sameboy in GBC mode (Link Adventure DX)
|
Gearboy in GBC mode (Link Adventure DX)
|
Both seem fine to me. I haven't tested anything myself (No clue how to configure libretro achievements 😳), but any chance the libretro fork uses an old CGB SameBoy boot ROM? Old versions of the boot ROM incorrectly switched the CGB RAM bank to bank 2 (instead of the usual 1 used for DMG games), and if that's the case RetroArch would read all zeros from D000 to E000 (As it'll read from the unused bank 1) |
we do use the sameboy boot rom yeah, I updated a few months ago, maybe I should again, let me try that |
With updated bootroms. I'll test again with some achievements. |
SameBoy is returning a |
I tried with the updated bootroms but doesn't seem to make a difference |
Cartrdige RAM should be NULL if the game doesn’t come with a RAM chip on the cartridge, it’s normal. I wonder if it somehow breaks RetroArch though. |
@LIJI32 basically you create an account in retroachievements.org, and then enter your username and password in settings / achievements and (enable the achievements toggle) You have to reload it after that of course. |
I was trying to add SameBoy to RALibretro so I could see the memory live while a game was running, but it crashes after the game is loaded. I'm not sure what could be wrong, I'll try to compile it myself and debug the issue. |
This may sound silly but gbc achievements work if you split c000, d000.
Maybe because D000 can swap banks 1-7? Whereas C000-DFFF only checks banks 0-1? |
@fr500 Can you check if the latest commit solved this? |
I just tried at commit 639d2a8 with kirby's dreamland. I unlocked these two wrongly in color mode ie: they shouldn't have triggered. And beating stage 1 didn't trigger the correct achievement in either mode. |
The mmaps are set properly as far as I can see, but achievements are not triggering. The games are identified correctly.
@leiradel I think this worked before right?
The text was updated successfully, but these errors were encountered: