meleu / RetroArch-problematic-cheevos

A place to put the savestates of games with cheevos problems when running in RetroArch and no problems in official emulators.
6 stars 10 forks source link

Super Mario World 2: Yoshi's Island (SNES) #10

Closed meleu closed 7 years ago

meleu commented 7 years ago

@leiradel

The user @ivestmt666 reported on RA forum and I confirmed here: RetroArch doesn't load the achievements list for "Super Mario World 2: Yoshi's Island (SNES)"

I think there's a problem with the hash calculation for this game in RetroArch and RetroAchievements doesn't return the correct game id (558). I tested the same ROM with RASnes9x and the achievements list loads fine.

RetroArch [libretro INFO] :: "YOSHI'S ISLAND" [checksum ok] LoROM, 16Mbits, ROM+RAM+BAT+Super FX, NTSC, SRAM:256Kbits, ID:YI  , CRC32:D138F224
RetroArch [INFO] :: Environ GET_VARIABLE snes9x_next_overclock:
RetroArch [INFO] ::     Disabled(10MHz)
RetroArch [INFO] :: Environ SET_MEMORY_MAPS.
RetroArch [INFO] ::    ndx flags  ptr              offset   start    select   disconn  len      addrspace
RetroArch [INFO] :: CHEEVOS system RAM: 0x7f9f42c9d010 131072
RetroArch [INFO] :: CHEEVOS save RAM:   0x7f9f42ad7010 32768
RetroArch [INFO] :: CHEEVOS video RAM:  0x1f48fa0 65536
RetroArch [INFO] :: CHEEVOS RTC:        0x7f9f38006d10 0
RetroArch [INFO] :: CHEEVOS testing SNES (8Mb padding).
RetroArch [INFO] :: CHEEVOS getting game id for hash 61233ff18de9bd702417e6ec5175827b
RetroArch [INFO] :: CHEEVOS got game id 0.
RetroArch [INFO] :: CHEEVOS testing NES (discards VROM).
RetroArch [INFO] :: CHEEVOS testing Generic (plain content).
RetroArch [INFO] :: CHEEVOS getting game id for hash cb472164c5a71ccd3739963390ec6a50
RetroArch [INFO] :: CHEEVOS got game id 0.
RetroArch [INFO] :: CHEEVOS this game doesn't feature achievements.

Please, tell me if you need more info.

leiradel commented 7 years ago

Thanks for the additional info. Could you sniff the network and see which hash RASnes is sending to retrochievements.org?

meleu commented 7 years ago

Here is the sniffed request:

POST /requestgameid.php HTTP/1.1
Content-Type: application/x-www-form-urlencoded
User-Agent: Retro Achievements Client RASnes9X 0.015
Host: retroachievements.org
Content-Length: 42
Connection: Keep-Alive

u=meleu&m=b2d24aced8d26b584d5903556aa8d32b

So, the hash is b2d24aced8d26b584d5903556aa8d32b.

[EDIT] And the retroachievements.org response:

HTTP/1.1 200 OK
Date: Sun, 27 Nov 2016 20:02:32 GMT
Server: Apache/2.4.23 (Amazon) PHP/5.6.26
X-Powered-By: PHP/5.6.26
Set-Cookie: PHPSESSID=i0ug4gfobh5kvstrtam26g5t03; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Length: 6
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=UTF-8

OK:558
leiradel commented 7 years ago

Hm, I think I'll need to implement this stuff: https://github.com/RetroAchievements/RASuite/blob/a87594e555b75d302104b938424501b1706db11a/RASnes9x/memmap.cpp#L1559

leiradel commented 7 years ago

On the other hand, I believe it's possible to have more than one hash per game in Retro Achievements, in which case adding the hash calculated by the generic method in RetroArch would be preferable.

leiradel commented 7 years ago

I ended up just adding the plain MD5 hash of the ROM to the Retro Achievements database: cb472164c5a71ccd3739963390ec6a50

This issue can be closed.

meleu commented 7 years ago

Yeah! It's working. But how can you add a hash to the RetroAchievements database?

leiradel commented 7 years ago

There's an Retro Achievements webservice which allows for adding new MD5 hashes to existing games. Scott sent it to me an year ago, saying that it should be ok to add the plain hashes to the database, but since it would be a huge amount of work to do it for every game, I focused in calculating the hash just like the RA emulators do.

If we start to see many roms being unidentified, I will probably implement that code in memmap.cpp.

meleu commented 7 years ago

I think somebody did it for all those Contra versions we talked about on that RetroArch issue.