melonDS-emu / melonDS

DS emulator, sorta
https://melonds.kuribo64.net
GNU General Public License v3.0
3.13k stars 513 forks source link

Opening some compressed ROM files fails depending on archive and enclosed ROM filename #1525

Open jbhannah opened 1 year ago

jbhannah commented 1 year ago

Running 0.9.4 (caveat: I'm using the latest developer beta of macOS 13 Ventura, but can also test on Windows 11), I'm able to open ROMs with the following names:

Golden Sun - Dark Dawn [NTR-BO5E-USA].nds
Golden Sun - Dark Dawn [NTR-BO5E-USA].nds.zip|Golden Sun - Dark Dawn [NTR-BO5E-USA].nds
Pokémon Conquest [TWL-VPYT-???].nds
Pokémon Conquest [TWL-VPYT-???].nds.zip|Pokémon Conquest [TWL-VPYT-???].nds
Pokémon - White Version 2 [TWL-IRDO-INT].nds
POKEMON W2.TWL-IRDO-INT.nds (<-- identical to Pokémon - White Version 2 [TWL-IRDO-INT].nds)
POKEMON W2.TWL-IRDO-INT.nds.zip|POKEMON W2.TWL-IRDO-INT.nds
Pokémon - White Version 2 [TWL-IRDO-INT].nds.zip|POKEMON W2.TWL-IRDO-INT.nds
POKEMON W2.TWL-IRDO-INT.nds.zip|Pokémon - White Version 2 [TWL-IRDO-INT].nds

but not:

Pokémon - White Version 2 [TWL-IRDO-INT].nds.zip|Pokémon - White Version 2 [TWL-IRDO-INT].nds

despite it being otherwise identical to the working .nds.zip files for the same ROM. Running it from the CLI gives the following output:

$ /Applications/melonDS.app/Contents/MacOS/melonDS "Pokémon - White Version 2 [TWL-IRDO-INT].nds.zip|Pokémon - White Version 2 [TWL-IRDO-INT].nds"
qt.gui.imageio: libpng warning: iCCP: known incorrect sRGB profile
melonDS 0.9.4
https://melonds.kuribo64.net/
Audio output frequency: 48000 Hz
OpenGL: renderer: AMD Radeon Pro 5500M OpenGL Engine
OpenGL: version: 4.1 ATI-4.9.47
Resetting JIT block cache...
done resetting jit mem
done resetting jit mem
MAC: 00:09:BF:5D:18:12
FW: WIFI CRC16 = GOOD
FW: AP1 CRC16 = GOOD
FW: AP2 CRC16 = GOOD
FW: AP3 CRC16 = GOOD
FW: USER0 CRC16 = GOOD
FW: USER1 CRC16 = BAD
Game code: 
ROM entry not found
!! bad ROM size 0 (expected 512) rounded to 512
Cart ID: 000100C2
remapping SWRAM
remapping DTCM 0 1000 ffffffff ffffffff
PU: region 0 = 04000033 : enabled, 04000000-08000000
PU: region 0 = 04000033 : enabled, 04000000-08000000
PU: region 1 = 0200002B : enabled, 02000000-02400000
PU: region 1 = 0200002B : enabled, 02000000-02400000
PU: region 2 = 00000000 : disabled, 00000000-00000002
PU: region 2 = 00000000 : disabled, 00000000-00000002
PU: region 3 = 08000035 : enabled, 08000000-10000000
PU: region 3 = 08000035 : enabled, 08000000-10000000
PU: region 4 = 0300001B : enabled, 03000000-03004000
PU: region 4 = 0300001B : enabled, 03000000-03004000
PU: region 5 = 00000000 : disabled, 00000000-00000002
PU: region 5 = 00000000 : disabled, 00000000-00000002
PU: region 6 = FFFF001D : enabled, FFFF0000-FFFF8000
PU: region 6 = FFFF001D : enabled, FFFF0000-FFFF8000
PU: region 7 = 027FF017 : enabled, 027FF000-02800000
PU: region 7 = 027FF017 : enabled, 027FF000-02800000
remapping DTCM 3000000 3004000 0 fffff000
Game is now booting
ARMv5 PC in non executable region 00000004
ARMv5 PC in non executable region 00000004
ARMv5 PC in non executable region 00000004
ARMv5 PC in non executable region 00000004
ARMv5 PC in non executable region 00000004
ARMv5 PC in non executable region 00000004
ARMv5 PC in non executable region 00000004
ARMv5 PC in non executable region 00000004
ARMv5 PC in non executable region 00000004
ARMv5 PC in non executable region 00000004
…

and loops the last message infinitely without ever starting the game (i.e. getting past the initial blank white screen). AFAICT the issue occurs with other archive types as well (e.g. .nds.tar.gz created with tar czf …) for the same combinations of archive and enclosed ROM filenames (always with only one ROM per archive), and I've reproduced it for ZIP archives created both with the zip command and the Compress … context menu item.

jbhannah commented 1 year ago

Just occurred to me that maybe it's the length of the combined file names?

patataofcourse commented 1 year ago

was this through the command-line or File>Open ROM?