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

Wario Adventure Snes #12

Closed grenade44 closed 7 years ago

grenade44 commented 7 years ago

Hi just tried playing http://retroachievements.org/Game/9175 (link to rom in comments) via the lr-snes9x-2010 emulator and it doesn't load the achievement or shows on my profile. I've updated retroarch and emulator from source today. I played another SNES game and it worked fine.

meleu commented 7 years ago

Can you post a log? (Run retroarch with --verbose)

grenade44 commented 7 years ago

I will upload the long in a couple of hours, when I get a chance.

grenade44 commented 7 years ago

Where is the log saved to on retropie?

grenade44 commented 7 years ago

Parameters: Executing: /opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-snes9x2010/snes9x2010_libretro.so --config /opt/retropie/configs/snes/retroarch.cfg "/home/pi/RetroPie/roms/snes/Wario Adventure.smc" --verbose --appendconfig /dev/shm/retroarch.cfg RetroArch [INFO] :: Redirecting save file to "/home/pi/RetroPie/roms/snes/Wario Adventure.srm". RetroArch [INFO] :: === Build ======================================= Capabilities: Built: Dec 11 2016 RetroArch [INFO] :: Version: 1.3.6 RetroArch [INFO] :: Git: d8acba1 RetroArch [INFO] :: ================================================= RetroArch [INFO] :: Config: loading config from: /opt/retropie/configs/snes/retroarch.cfg. RetroArch [INFO] :: Config: appending config "/dev/shm/retroarch.cfg" RetroArch [INFO] :: Incompatible shader for backend gl, clearing... RetroArch [INFO] :: Resetting undo buffers. RetroArch [INFO] :: Loading dynamic libretro core from: "/opt/retropie/libretrocores/lr-snes9x2010/snes9x2010_libretro.so" RetroArch [INFO] :: [overrides] no core-specific overrides found at /home/pi/.config/retroarch/config/Snes9x 2010/Snes9x 2010.cfg. RetroArch [INFO] :: [overrides] no game-specific overrides found at /home/pi/.config/retroarch/config/Snes9x 2010/Wario Adventure.cfg. RetroArch [INFO] :: Shaders: preset directory: /opt/retropie/emulators/retroarch/shader/presets RetroArch [INFO] :: Shaders: no game-specific preset found at /opt/retropie/emulators/retroarch/shader/presets/Snes9x 2010/Wario Adventure.cgp. RetroArch [INFO] :: Shaders: no game-specific preset found at /opt/retropie/emulators/retroarch/shader/presets/Snes9x 2010/Wario Adventure.glslp. RetroArch [INFO] :: Shaders: no core-specific preset found at /opt/retropie/emulators/retroarch/shader/presets/Snes9x 2010/Snes9x 2010.cgp. RetroArch [INFO] :: Shaders: no core-specific preset found at /opt/retropie/emulators/retroarch/shader/presets/Snes9x 2010/Snes9x 2010.glslp. RetroArch [INFO] :: Environ SET_VARIABLES. RetroArch [INFO] :: Environ SET_CONTROLLER_INFO. RetroArch [INFO] :: Controller port: 1 RetroArch [INFO] :: SNES Joypad (ID: 1) RetroArch [INFO] :: SNES Mouse (ID: 2) RetroArch [INFO] :: RetroPad (ID: 1) RetroArch [INFO] :: Controller port: 2 RetroArch [INFO] :: SNES Joypad (ID: 1) RetroArch [INFO] :: SNES Mouse (ID: 2) RetroArch [INFO] :: Multitap (ID: 257) RetroArch [INFO] :: SuperScope (ID: 260) RetroArch [INFO] :: Justifier (ID: 516) RetroArch [INFO] :: Justifiers (ID: 772) RetroArch [INFO] :: RetroPad (ID: 1) RetroArch [INFO] :: Remaps: remap directory: /opt/retropie/configs/snes/ RetroArch [INFO] :: Remaps: no game-specific remap found at /opt/retropie/configs/snes/Snes9x 2010/Wario Adventure.rmp. RetroArch [INFO] :: Remaps: no core-specific remap found at /opt/retropie/configs/snes/Snes9x 2010/Snes9x 2010.rmp. RetroArch [INFO] :: Redirecting save file to "/home/pi/RetroPie/roms/snes/Wario Adventure.srm". RetroArch [INFO] :: Environ GET_OVERSCAN: 0 RetroArch [INFO] :: Environ GET_LOG_INTERFACE. RetroArch [INFO] :: Environ SET_SUPPORT_ACHIEVEMENTS: yes. RetroArch [INFO] :: Environ SET_PIXEL_FORMAT: RGB565. RetroArch [libretro INFO] :: Frontend supports RGB565 - will use that instead of XRGB1555. RetroArch [INFO] :: Environ PERFORMANCE_LEVEL: 7. RetroArch [INFO] :: Loading content file: /home/pi/RetroPie/roms/snes/Wario Adventure.smc. RetroArch [INFO] :: Did not find a valid content patch. RetroArch [INFO] :: CRC32: 0x9d0b4df0 . RetroArch [INFO] :: Environ SET_INPUT_DESCRIPTORS: RetroArch [INFO] :: RetroPad, User 1, Button "B (bottom)" => "B" RetroArch [INFO] :: RetroPad, User 1, Button "Y (left)" => "Y" RetroArch [INFO] :: RetroPad, User 1, Button "Select" => "Select" RetroArch [INFO] :: RetroPad, User 1, Button "Start" => "Start" RetroArch [INFO] :: RetroPad, User 1, Button "D-Pad Up" => "D-Pad Up" RetroArch [INFO] :: RetroPad, User 1, Button "D-Pad Down" => "D-Pad Down" RetroArch [INFO] :: RetroPad, User 1, Button "D-Pad Left" => "D-Pad Left" RetroArch [INFO] :: RetroPad, User 1, Button "D-Pad Right" => "D-Pad Right" RetroArch [INFO] :: RetroPad, User 1, Button "A (right)" => "A" RetroArch [INFO] :: RetroPad, User 1, Button "X (up)" => "X" RetroArch [INFO] :: RetroPad, User 1, Button "L" => "L" RetroArch [INFO] :: RetroPad, User 1, Button "R" => "R" RetroArch [INFO] :: RetroPad, User 2, Button "B (bottom)" => "B" RetroArch [INFO] :: RetroPad, User 2, Button "Y (left)" => "Y" RetroArch [INFO] :: RetroPad, User 2, Button "Select" => "Select" RetroArch [INFO] :: RetroPad, User 2, Button "Start" => "Start" RetroArch [INFO] :: RetroPad, User 2, Button "D-Pad Up" => "D-Pad Up" RetroArch [INFO] :: RetroPad, User 2, Button "D-Pad Down" => "D-Pad Down" RetroArch [INFO] :: RetroPad, User 2, Button "D-Pad Left" => "D-Pad Left" RetroArch [INFO] :: RetroPad, User 2, Button "D-Pad Right" => "D-Pad Right" RetroArch [INFO] :: RetroPad, User 2, Button "A (right)" => "A" RetroArch [INFO] :: RetroPad, User 2, Button "X (up)" => "X" RetroArch [INFO] :: RetroPad, User 2, Button "L" => "L" RetroArch [INFO] :: RetroPad, User 2, Button "R" => "R" RetroArch [INFO] :: RetroPad, User 3, Button "B (bottom)" => "B" RetroArch [INFO] :: RetroPad, User 3, Button "Y (left)" => "Y" RetroArch [INFO] :: RetroPad, User 3, Button "Select" => "Select" RetroArch [INFO] :: RetroPad, User 3, Button "Start" => "Start" RetroArch [INFO] :: RetroPad, User 3, Button "D-Pad Up" => "D-Pad Up" RetroArch [INFO] :: RetroPad, User 3, Button "D-Pad Down" => "D-Pad Down" RetroArch [INFO] :: RetroPad, User 3, Button "D-Pad Left" => "D-Pad Left" RetroArch [INFO] :: RetroPad, User 3, Button "D-Pad Right" => "D-Pad Right" RetroArch [INFO] :: RetroPad, User 3, Button "A (right)" => "A" RetroArch [INFO] :: RetroPad, User 3, Button "X (up)" => "X" RetroArch [INFO] :: RetroPad, User 3, Button "L" => "L" RetroArch [INFO] :: RetroPad, User 3, Button "R" => "R" RetroArch [INFO] :: RetroPad, User 4, Button "B (bottom)" => "B" RetroArch [INFO] :: RetroPad, User 4, Button "Y (left)" => "Y" RetroArch [INFO] :: RetroPad, User 4, Button "Select" => "Select" RetroArch [INFO] :: RetroPad, User 4, Button "Start" => "Start" RetroArch [INFO] :: RetroPad, User 4, Button "D-Pad Up" => "D-Pad Up" RetroArch [INFO] :: RetroPad, User 4, Button "D-Pad Down" => "D-Pad Down" RetroArch [INFO] :: RetroPad, User 4, Button "D-Pad Left" => "D-Pad Left" RetroArch [INFO] :: RetroPad, User 4, Button "D-Pad Right" => "D-Pad Right" RetroArch [INFO] :: RetroPad, User 4, Button "A (right)" => "A" RetroArch [INFO] :: RetroPad, User 4, Button "X (up)" => "X" RetroArch [INFO] :: RetroPad, User 4, Button "L" => "L" RetroArch [INFO] :: RetroPad, User 4, Button "R" => "R" RetroArch [INFO] :: RetroPad, User 5, Button "B (bottom)" => "B" RetroArch [INFO] :: RetroPad, User 5, Button "Y (left)" => "Y" RetroArch [INFO] :: RetroPad, User 5, Button "Select" => "Select" RetroArch [INFO] :: RetroPad, User 5, Button "Start" => "Start" RetroArch [INFO] :: RetroPad, User 5, Button "D-Pad Up" => "D-Pad Up" RetroArch [INFO] :: RetroPad, User 5, Button "D-Pad Down" => "D-Pad Down" RetroArch [INFO] :: RetroPad, User 5, Button "D-Pad Left" => "D-Pad Left" RetroArch [INFO] :: RetroPad, User 5, Button "D-Pad Right" => "D-Pad Right" RetroArch [INFO] :: RetroPad, User 5, Button "A (right)" => "A" RetroArch [INFO] :: RetroPad, User 5, Button "X (up)" => "X" RetroArch [INFO] :: RetroPad, User 5, Button "L" => "L" RetroArch [INFO] :: RetroPad, User 5, Button "R" => "R" RetroArch [libretro INFO] :: No ROM file header found. PPU.RenderSub = 0 PPU.FullClipping = 1 Settings.Transparency = 1 Settings.SpeedhackGameID = 7 PPU.SFXSpeedupHack = 0 coldata_update_screen = 0 RetroArch [libretro INFO] :: "SUPER MARIOWORLD" [checksum ok] LoROM, 32Mbits, ROM+RAM+BAT, NTSC, SRAM:16Kbits, ID:____, CRC32:145C9207 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: 0xb5bdf008 131072 RetroArch [INFO] :: CHEEVOS save RAM: 0xb5bbe008 2048 RetroArch [INFO] :: CHEEVOS video RAM: 0x1d38718 65536 RetroArch [INFO] :: CHEEVOS RTC: 0xb5dd7c78 0 RetroArch [INFO] :: CHEEVOS testing SNES (8Mb padding). RetroArch [INFO] :: CHEEVOS getting game id for hash 5e38f7bbe6cd3e864d74cfc3d7619cd8 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 5c8db832618e964828a1f312d4f7a31b RetroArch [INFO] :: CHEEVOS got game id 0. RetroArch [INFO] :: CHEEVOS this game doesn't feature achievements. RetroArch [INFO] :: Skipping SRAM load.. RetroArch [INFO] :: Version of libretro API: 1 RetroArch [INFO] :: Compiled against API: 1 RetroArch [INFO] :: Set audio input rate to: 31987.82 Hz. RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/2xsal.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/2xScaleHQ.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/barrel-distortion.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/barrel-distortion_lanczos4.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/barrel-distortion_phosphor.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/barrel-distortion_snes.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/Brighter-with_Contrast.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/bsnes_gamma_ramp.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/crt-pi-curvature-vertical.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/crt-pi-curvature.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/crt-pi-vertical.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/crt-pi.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/gameboy-screen-grid.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/gameboy.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/gameboy2.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/hq2x&lcd3x.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/hq2x.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/hq2x2.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/hq2x_lcd3x.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/hq2x_phosphor.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/hq2xwaterpaint.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/hq2xwaterpaintscanline.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/hq4x.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/hq4x_lcd3x.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/nds.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/nedi.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/phosphor.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/snes.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/snes2.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/snes_hq2x.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/snes_hq2xwaterpaint.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/snes_hq2xwaterpainthicontrast.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/snes_hq2xwaterpaintscanline.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/snes_lcd3x.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/snes_phosphor.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/snes_scanline.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/snes_waterpaint.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/stock.glsl" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/super-2xsai.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/super-eagle.glslp" RetroArch [INFO] :: Found shader "/opt/retropie/emulators/retroarch/shader/xbr-lv1-noblend.glslp" RetroArch [INFO] :: Video @ 897x672 RetroArch [INFO] :: Starting threaded video driver ... RetroArch [INFO] :: [EGL]: EGL version: 1.4 RetroArch [INFO] :: [EGL]: Current context: 0x1. RetroArch [INFO] :: Found GL context: videocore RetroArch [INFO] :: Detecting screen resolution 640x480. RetroArch [INFO] :: [EGL]: eglSwapInterval(1) RetroArch [INFO] :: [EGL]: eglSwapInterval(1) RetroArch [INFO] :: [GL]: Vendor: Broadcom, Renderer: VideoCore IV HW. RetroArch [INFO] :: [GL]: Version: OpenGL ES 2.0. RetroArch [INFO] :: GL: Using resolution 640x480 RetroArch [INFO] :: [GL]: Default shader backend found: glsl. RetroArch [INFO] :: [Shader driver]: Using GLSL shader backend. RetroArch [WARN] :: [GL]: Stock GLSL shaders will be used. RetroArch [INFO] :: Found GLSL vertex shader. RetroArch [INFO] :: Shader log: Compiled RetroArch [INFO] :: Found GLSL fragment shader. RetroArch [INFO] :: Shader log: Compiled RetroArch [INFO] :: Linking GLSL program. RetroArch [INFO] :: Found GLSL vertex shader. RetroArch [INFO] :: Shader log: Compiled RetroArch [INFO] :: Found GLSL fragment shader. RetroArch [INFO] :: Shader log: Compiled RetroArch [INFO] :: Linking GLSL program. RetroArch [INFO] :: Found GLSL vertex shader. RetroArch [INFO] :: Shader log: Compiled RetroArch [INFO] :: Found GLSL fragment shader. RetroArch [INFO] :: Shader log: Compiled RetroArch [INFO] :: Linking GLSL program. RetroArch [INFO] :: Found GLSL vertex shader. RetroArch [INFO] :: Shader log: Compiled RetroArch [INFO] :: Found GLSL fragment shader. RetroArch [INFO] :: Shader log: Compiled RetroArch [INFO] :: Linking GLSL program. RetroArch [INFO] :: Found GLSL vertex shader. RetroArch [INFO] :: Shader log: Compiled RetroArch [INFO] :: Found GLSL fragment shader. RetroArch [INFO] :: Shader log: Compiled RetroArch [INFO] :: Linking GLSL program. RetroArch [INFO] :: Found GLSL vertex shader. RetroArch [INFO] :: Shader log: Compiled RetroArch [INFO] :: Found GLSL fragment shader. RetroArch [INFO] :: Shader log: Compiled RetroArch [INFO] :: Linking GLSL program. RetroArch [INFO] :: Found GLSL vertex shader. RetroArch [INFO] :: Shader log: Compiled RetroArch [INFO] :: Found GLSL fragment shader. RetroArch [INFO] :: Shader log: Compiled RetroArch [INFO] :: Linking GLSL program. RetroArch [INFO] :: [GL]: Using 4 textures. RetroArch [INFO] :: [GL]: Loaded 1 program(s). RetroArch [INFO] :: Querying EGL extension: KHR_image => exists RetroArch [INFO] :: Using font rendering backend: freetype. RetroArch [INFO] :: Graphics driver did not initialize an input driver. Attempting to pick a suitable driver. RetroArch [WARN] :: [udev]: Couldn't open any keyboard, mouse or touchpad. Are permissions set correctly for /dev/input/event*? RetroArch [INFO] :: [udev]: Plugged pad: GPIO Controller 1 (0:0) on port #0. RetroArch [INFO] :: Autodetect: 1 profiles found. RetroArch [INFO] :: Autodetect: selected configuration: /opt/retropie/configs/all/retroarch-joypads/GPIOController1.cfg RetroArch [INFO] :: [udev]: Pad #0 (/dev/input/event0) supports 0 force feedback effects. RetroArch [INFO] :: Found joypad driver: "udev". RetroArch [INFO] :: ALSA: Using signed 16-bit format. RetroArch [INFO] :: ALSA: Period size: 384 frames RetroArch [INFO] :: ALSA: Buffer size: 1536 frames RetroArch [INFO] :: Loading history file: [/opt/retropie/configs/snes/content_history.lpl]. RetroArch [INFO] :: Loading history file: [/opt/retropie/configs/snes/content_image_history.lpl].

meleu commented 7 years ago

Did you tried this same ROM with RASnes? Doest it work?

grenade44 commented 7 years ago

Sorry for the late reply, its been mental today,

Yes the game works in RAsnes9x.

meleu commented 7 years ago

Sorry for the late reply too. My youngest son has been ill. I'll take a look in this issue ASAP.

meleu commented 7 years ago

@leiradel I tried to solve this issue here adding the MD5 hash to retroachievements.org database but, as expected, I don't have enough permissions to do it (received "Credentials invalid (0)" message). :-)

Could you add this game to the database?

I used the hash from Generic (plain content): 5c8db832618e964828a1f312d4f7a31b

meleu commented 7 years ago

I confirm this issue. Maybe @GameDragon2k can help us here.

I downloaded the ROM from the URL in comments here: http://retroachievements.org/Game/9175 Tried to launch with RetroArch/Snes9x2010 and the Achievements list didn't load.

The SNES (8Mb padding) hash is: 5e38f7bbe6cd3e864d74cfc3d7619cd8. The Generic (plain content) hash is: 5c8db832618e964828a1f312d4f7a31b.

GameDragon2k commented 7 years ago

The checksum that RASnes9x gets for that same rom is b2f244e83988370cba85ce09d2ad51a2.

@leiradel I mentioned that SNES games hash was handled differently as of recently. This should be the line that was changed. And this is the commit.

leiradel commented 7 years ago

@GameDragon2k Do you know what exactly that change does without having to go through the code?

GameDragon2k commented 7 years ago

@leiradel From my understanding, it's supposed to convert the ROMSize into bytes (I believe the original format is Mb), which is used as the length for md5 hashing. Although I'm unsure if it is accurate or not.

As far as I can tell, the hash process is the same.

meleu commented 7 years ago

@GameDragon2k do you know what's the best way to contact the person responsible for those changes in hash handling? Is it @RetroAchievements user?

RetroAchievements commented 7 years ago

Yep it's me - I'm still unsure about that line, it's supposed to just take the whole ROM - if it's doing anything else, it will need fixing

RetroAchievements commented 7 years ago

@leiradel spent a while trying to make RetroArch do the same as RASnes, and it was tough going because it's awkwardly calculated. It really just ought to be the whole ROM. Worst case we can just read it from the file?

leiradel commented 7 years ago

@RetroAchievements I lack context to understand what RASnes does now WRT the ROM hash. If it just uses the whole ROM, the fourth hash method that RetroArch employs should take care of that, but doesn't.

Maybe the new method rounds the ROM size to some boundary? This line confuses me:

int nRomSizeBytes = ( ( 1 << ( Memory.ROMSize - 7 ) ) * 128 ) * 1024;

because I doubt Memory.ROMSize is the size in bytes, and I don't know what it really is.

RetroAchievements commented 7 years ago

ROMSize is the size in Megabits, bit shifted to the right 7 times. I have no idea why. There's a similar line that I copied that from which appeared to get the actual ROM size in bytes. It could be wrong

leiradel commented 7 years ago

ROMSize is the size in Megabits, bit shifted to the right 7 times

So is the code below correct?

// FileSize is the size of the file in the file system in bytes
int FileSizeBits = FileSize * 8;
int MegaBits = FileSizeBits / 1024 / 1024;
ROMSize = MegaBits / 128;

Isn't the actual file size available for use?

RetroAchievements commented 7 years ago

I couldn't find it at the time :( if it can be found it should be used instead, definitely. That code looks accurate from what I can tell. My original line was a workaround that I borrowed from somewhere else in the project.

leiradel commented 7 years ago

@meleu could you evaluate the MD5 of this ROM using an external utility?

meleu commented 7 years ago

Sure. I'm at work now. Windows machine, but to avoid abstinence crisis I have Cygwin installed. :sweat_smile:

I used the md5sum tool from Cygwin:

$ md5sum Wario\ Adventure.smc
5c8db832618e964828a1f312d4f7a31b *Wario Adventure.smc

As we can see in the @grenade44 's RetroArch log above, RetroArch Generic (plain content) method gives the same hash as the md5sum tool.

leiradel commented 7 years ago

Thanks @meleu

Ok, so RASnes is doing something different than a plain MD5 of the ROM.

I'll see if I can build it from source and step through the code, and understand how it's calculating the hash.

RetroAchievements commented 7 years ago

If RASnes isn't getting the actual md5, it should be. Should be changed to be accurate in the next RASnes release as a priority

On Sat, 27 May 2017, 14:14 Andre Leiradella, notifications@github.com wrote:

Thanks @meleu https://github.com/meleu

Ok, so RASnes is doing something different than a plain MD5 of the ROM.

I'll see if I can build it from source and step through the code, and understand how it's calculating the hash.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/meleu/RetroArch-problematic-cheevos/issues/12#issuecomment-304451020, or mute the thread https://github.com/notifications/unsubscribe-auth/AFKR9o1w8A_KuXQB-ntIgnvDRJPvVRIOks5r-CGugaJpZM4LJ8Hs .

leiradel commented 7 years ago

@RetroAchievements so I'll consider this a RASnes bug, and that RetroArch is calculating the correct hash and doesn't need any change, ok?

meleu commented 7 years ago

@RetroAchievements

If RASnes isn't getting the actual md5, it should be. Should be changed to be accurate in the next RASnes release as a priority

Then can I ask to a cheevo developer to add the actual md5 hash for this game in RA database?

If yes, maybe @GameDragon2k could do it. :) And then we'll be done with the issue here.

leiradel commented 7 years ago

Also, I was testing N64 and the MD5 hash for Super Mario 64 calculated with md5sum is 165a9558b7539507e73e7afecffb200c, but RetroArch fails to find a game with that hash.

Does the N64 Retro Achievements emulator also have a bug in the hash calculation?

GameDragon2k commented 7 years ago

@leiradel The N64 hash seems to be accurate. Using Ocarina of Time 1.0 for reference:

This is the MD5 that Project64 produces. image

And this is the MD5 that is currently present on RA. image

leiradel commented 7 years ago

Maybe my Super Mario 64 ROM is different? The game works ok though.On May 28, 2017 17:53, GameDragon2k notifications@github.com wrote:@leiradel The N64 hash seems to be accurate. Using Ocarina of Time 1.0 for reference: This is the MD5 that Project64 produces.

And this is the MD5 that is currently present on RA.

—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.

leiradel commented 7 years ago

Hm, maybe the hash is for the ZIP file, and not for the ROM?

GameDragon2k commented 7 years ago

Nah, it's the hash for the ROM itself. Just double checked.

image

leiradel commented 7 years ago

Hm, I think RAN64 isn't using the plain ROM MD5:

$ md5sum.exe ../../RetroArch/content/Legend\ of\ Zelda\,\ The\ -\ Ocarina\ of\ Time\ \(USA\).n64
6697768a7a7df2dd27a692a2638ea90b *../../RetroArch/content/Legend of Zelda, The - Ocarina of Time (USA).n64
RetroAchievements commented 7 years ago

Ah - I can't yet comment on N64, but will make an attempt to fix the RASnes issue now

RetroAchievements commented 7 years ago

Changed pushed - now using Memory.CalculatedSize rather than that odd formula, but still questionable for romhacks especially. It also looked as though that particular SNES ROM was very oddly linked to the wrong game, should now be fixed (unlink and re-load the ROM). As for the sheer quantity of bad SNES roms, I'm looking into how I can provide a tool to manage this a little better. Very interested in RAN64 now though, going to check it out

GameDragon2k commented 7 years ago

@leiradel Hmm you're right. I simply used the MD5 that pj64 generated itself.

//Calculate files MD5 m_MD5 = MD5((const unsigned char *)m_ROMImage, m_RomFileSize).hex_digest();

meleu commented 7 years ago

@GameDragon2k @leiradel @RetroAchievements Just to keep things a little bit more organized, would you mind to continue the N64 related conversation on a more appropriate issue topic? Like this one: #21

@grenade44 Could you test if after loading "Wario Adventure" on RetroArch you get the right Achievements List? Close this issue if everything is fine for you. Thanks. :wink:

grenade44 commented 7 years ago

@meleu

Still doesn't load the achievement list.

meleu commented 7 years ago

@RetroAchievements said in https://github.com/meleu/RetroArch-problematic-cheevos/issues/12#issuecomment-304463231

If RASnes isn't getting the actual md5, it should be.

As far as I understood you agree that plain MD5 hashes is the way to go. Then can I ask to some developer (maybe @GameDragon2k ) to add the hash 5c8db832618e964828a1f312d4f7a31b for the game Wario Adventures (SNES)?

This would allow RetroArch users to earn cheevos for this game...

RetroAchievements commented 7 years ago

If the correct hash is 5c8 then RASnes is still not calculating it correctly. Will investigate asap

meleu commented 7 years ago

Yes, 5c8db832618e964828a1f312d4f7a31b is the correct MD5 hash. You can check it with the md5sum tool in Linux.

RetroAchievements commented 7 years ago

Ah. I have a feeling that RASnes is adjusting the checksum or contents of the ROM (headers) in memory, that could explain this discrepancy. Will investigate

RetroAchievements commented 7 years ago

Finally. OK I've found the issue - that particular ROM had an additional header prepended to the ROM (hence a ROM size of 0x400200, or 512 bytes bigger than 4mb), as most homebrew will potentially have. RASnes9x was stripping the headers out before storing the remainder at ROM, which wasn't this case the same as the actual ROM file. I now store the original ROM alongside, in order to have something to hash against, while preserving zipped ROM loading. RASnes9x.019 released

meleu commented 7 years ago

That seems to be the same problem for Super Mario World Bros (SNES), as reported by @grenade44 in #13 .

RetroAchievements commented 7 years ago

If so, that should also now be fixed: https://i.imgur.com/VH7yTTN.png

grenade44 commented 7 years ago

Achievement list now loads and I've unlocked 1 achievement, seems to be working now, thank you

meleu commented 7 years ago

Closing this issue then.

@grenade44 could you check if your issue #13 was solved too? And close it if yes.

Thanks guys! You are awesome! :-)