JesseTG / melonds-ds

A remake of the libretro melonDS core that prioritizes standalone parity, reliability, and usability.
GNU General Public License v3.0
157 stars 18 forks source link

DSiWare crashes from ZIP, does not load RetroAchievements from content file #149

Closed Hexadigital closed 10 months ago

Hexadigital commented 10 months ago

What version of melonDS DS are you using?

1.0.1

Does the problem happen in standalone melonDS?

I don't know.

What happened?

I'm trying to load GO Series: Fishing Resort for the DSi in MelonDS DS through RetroArch 1.16.0. I'm using a decrypted copy of the European release, as is linked to the game on RetroAchievements.

The game immediately fails to load when loading from the .zip that includes the tmd and title files. When loading the extracted content file directly, it runs the game but does not hash to something that lines up with the RetroAchievements hash.

Here is a log from RetroArch, when trying to load the .zip: retroarch2024_01_1615_53_54.log

What should've happened instead?

Depending on how I load the game, I get different behavior compared to BizHawk, the only DSi emulator that currently supports RetroAchievements:

  1. BizHawk, complete game ZIP - game loads without issue, emulator loads achievements without issue
  2. BizHawk, just content file - game loads without issue, emulator loads achievements without issue
  3. RetroArch, complete game ZIP - game does not load, RetroArch gives a "Could not read content file" error and returns to the menu
  4. RetroArch, just content file - game loads without issue, no achievements are loaded and RetroArch states "RetroAchievements: Game could not be identified."

Which platforms do you see the problem on?

Which versions of the OS?

Manjaro 23.0.4 Uranos

Which libretro frontend are you using?

RetroArch 1.16.0, official Manjaro package

Terms

Hexadigital commented 10 months ago

Loading the content file (no extension) within RALibRetro produces this error, preventing the game from loading: 2024-01-17_11-14

Loading the content file (with a .nds extension) in RetroArch or RALibRetro loads the game fine and hashes it properly for RetroAchievements.

JesseTG commented 10 months ago

Loading the content file (no extension) within RALibRetro produces this error, preventing the game from loading: 2024-01-17_11-14

Loading the content file (with a .nds extension) in RetroArch or RALibRetro loads the game fine and hashes it properly for RetroAchievements.

Which version of RALibRetro does this occur in? If you built it yourself, which commit? I ask because I can't reproduce this issue.

JesseTG commented 10 months ago

RetroArch, complete game ZIP - game does not load, RetroArch gives a "Could not read content file" error and returns to the menu

This is currently expected behavior, as melonDS DS does not directly read games from .zip files. It expects the frontend to extract the game data and provide the bytes. What are your expectations for the core, as far as .zip archives go?

JesseTG commented 10 months ago

RetroArch, just content file - game loads without issue, no achievements are loaded and RetroArch states "RetroAchievements: Game could not be identified."

I can reproduce this issue, but I suspect that it's a bug in RetroArch itself rcheevos, which RetroArch uses to talk to RetroAchievements. Adding the empty string (i.e. no extension) to the list of supported file extensions does not resolve this bug.

In fact, looking at rcheevos tells me that this is a bug there! In the case where a file does not have an extension, the whole file is hashed...but since RetroAchievement's hashes for DS/DSi games aren't derived from the whole file, you're getting a different hash. Depnding on your perspective, this is either a bug in rcheevos (because it's not detecting the console type properly) or in RetroArch (because it's not telling rcheevos to use DSiWare).

Since this isn't an issue I can resolve in the core, I will close it. Sorry I couldn't be more helpful. In the meantime, I suggest the following: