libretro / beetle-psx-libretro

Standalone port/fork of Mednafen PSX to the Libretro API.
GNU General Public License v2.0
310 stars 131 forks source link

Game "Beyond the Beyond" doesn't work with beetle-psx-libretro #26

Closed orbea closed 7 years ago

orbea commented 8 years ago

The game "Beyond the Beyond" doesn't work with the beetle-psx-libretro core and crashes upon starting. It does however work with the pcsx-rearmed core even though I'm not using an arm device and other games do work with the mednafen core.

Crashes with the mednefen core.

$ retroarch -L /usr/lib64/libretro/mednafen_psx_libretro.so Beyond\ the\ Beyond\ \(USA\)/Beyond\ the\ Beyond\ \(USA\).cue 
unhandled setting UI: psx.input.port1.gun_chairs
unhandled setting UI: psx.input.port2.gun_chairs
unhandled setting UI: psx.input.port3.gun_chairs
unhandled setting UI: psx.input.port4.gun_chairs
unhandled setting UI: psx.input.port5.gun_chairs
unhandled setting UI: psx.input.port6.gun_chairs
unhandled setting UI: psx.input.port7.gun_chairs
unhandled setting UI: psx.input.port8.gun_chairs
terminate called after throwing an instance of 'MDFN_Error'
  what():  Error opening file No such file or directory
Aborted

While the pcsx-rearmed core works.

$ retroarch -L /usr/lib64/libretro/pcsx_rearmed_libretro.so Beyond\ the\ Beyond\ \(USA\)/Beyond\ the\ Beyond\ \(USA\).cue 
Starting PCSX-ReARMed r15-522-gf72db18
Running PCSX Version 1.9 (Jan 18 2016).
Mapped (RAM/scrp/ROM/LUTs/TC):
80000000/1f800000/1fc00000/00000000/00000000
found BIOS file: scph7003.bin
RGB565 supported, using it
plugin: plugins/builtin_gpu
plugin: plugins/builtin_spu
plugin: plugins/builtin_pad
plugin: plugins/builtin_pad
Plugins loaded.
Loaded CD Image: Beyond the Beyond (USA)/Beyond the Beyond (USA).cue[+cue].
Track 01 (DATA) - Start 00:02:00, Length 13:39:28
selected sound output driver: libretro
CD-ROM Label: BEYOND_THE_BEYOND               
CD-ROM ID: SCUS94702
CD-ROM EXE Name: SCUS_947.02;1
ari64_reset

As do other games.

$ retroarch -L /usr/lib64/libretro/mednafen_psx_libretro.so Tales\ of\ Phantasia\ \(Japan\)\ \[En\ by\ Gemini+Throughhim413\ v1.0\]/Tales\ of\ Phantasia\ \(Japan\)\ \[En\ by\ Gemini+Throughhim413\ v1.0\].cue 
unhandled setting UI: psx.input.port1.gun_chairs
unhandled setting UI: psx.input.port2.gun_chairs
unhandled setting UI: psx.input.port3.gun_chairs
unhandled setting UI: psx.input.port4.gun_chairs
unhandled setting UI: psx.input.port5.gun_chairs
unhandled setting UI: psx.input.port6.gun_chairs
unhandled setting UI: psx.input.port7.gun_chairs
unhandled setting UI: psx.input.port8.gun_chairs

The two relevant cue files.

FILE "Beyond the Beyond (USA).bin" BINARY
  TRACK 01 MODE2/2352
    INDEX 01 00:00:00
FILE "Tales of Phantasia (Japan) [En by Gemini+Throughhim413 v1.0].bin" BINARY
  TRACK 01 MODE2/2352
    INDEX 01 00:00:00

Also in case anyone has any objections, I do own physical copies of these games.

inactive123 commented 8 years ago

Seems like it has problems with the cuesheet names. Give a gdb backtrace so we can tell where the segfault occurs.

orbea commented 8 years ago

Here is a backtrace.

$ gdb retroarch
GNU gdb (GDB) 7.10.1
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-slackware-linux".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from retroarch...(no debugging symbols found)...done.
(gdb) run
Starting program: /usr/bin/retroarch 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7fffeb606700 (LWP 22988)]
[New Thread 0x7fffeae05700 (LWP 22989)]
[New Thread 0x7fffe7424700 (LWP 23048)]
[New Thread 0x7fffe6c23700 (LWP 23052)]
unhandled setting UI: psx.input.port1.gun_chairs
unhandled setting UI: psx.input.port2.gun_chairs
unhandled setting UI: psx.input.port3.gun_chairs
unhandled setting UI: psx.input.port4.gun_chairs
unhandled setting UI: psx.input.port5.gun_chairs
unhandled setting UI: psx.input.port6.gun_chairs
unhandled setting UI: psx.input.port7.gun_chairs
unhandled setting UI: psx.input.port8.gun_chairs
terminate called after throwing an instance of 'MDFN_Error'
  what():  Error opening file No such file or directory

Program received signal SIGABRT, Aborted.
0x00007ffff12fca18 in raise () from /lib64/libc.so.6
(gdb) bt full
#0  0x00007ffff12fca18 in raise () from /lib64/libc.so.6
No symbol table info available.
#1  0x00007ffff12fe61a in abort () from /lib64/libc.so.6
No symbol table info available.
#2  0x00007fffe967e89d in __gnu_cxx::__verbose_terminate_handler() ()
   from /usr/lib64/../lib64/libstdc++.so.6
No symbol table info available.
#3  0x00007fffe967c906 in ?? () from /usr/lib64/../lib64/libstdc++.so.6
No symbol table info available.
#4  0x00007fffe967c951 in std::terminate() ()
   from /usr/lib64/../lib64/libstdc++.so.6
No symbol table info available.
#5  0x00007fffe967cb68 in __cxa_throw () from /usr/lib64/../lib64/libstdc++.so.6
No symbol table info available.
#6  0x00007fffe87aac8d in ?? () from /usr/lib64/libretro/mednafen_psx_libretro.so
No symbol table info available.
#7  0x00007fffe87f4c0e in ?? () from /usr/lib64/libretro/mednafen_psx_libretro.so
No symbol table info available.
#8  0x00007fffe87f4e2b in ?? () from /usr/lib64/libretro/mednafen_psx_libretro.so
No symbol table info available.
#9  0x00007fffe880cf94 in ?? () from /usr/lib64/libretro/mednafen_psx_libretro.so
No symbol table info available.
#10 0x00007fffe880f2b3 in retro_load_game ()
   from /usr/lib64/libretro/mednafen_psx_libretro.so
No symbol table info available.
#11 0x000000000041eb79 in ?? ()
No symbol table info available.
#12 0x00000000004173ac in ?? ()
No symbol table info available.
#13 0x0000000000415034 in ?? ()
No symbol table info available.
#14 0x000000000041178b in ?? ()
No symbol table info available.
#15 0x0000000000483537 in ?? ()
No symbol table info available.
#16 0x0000000000413f37 in ?? ()
No symbol table info available.
#17 0x0000000000416b6b in ?? ()
No symbol table info available.
#18 0x0000000000482e2e in ?? ()
No symbol table info available.
#19 0x00000000004b26e7 in ?? ()
No symbol table info available.
#20 0x000000000049fa0d in ?? ()
No symbol table info available.
#21 0x00000000004c7385 in ?? ()
No symbol table info available.
#22 0x000000000041c508 in ?? ()
No symbol table info available.
#23 0x0000000000411b80 in ?? ()
No symbol table info available.
#24 0x00007ffff12e76d0 in __libc_start_main () from /lib64/libc.so.6
No symbol table info available.
#25 0x000000000040ed99 in ?? ()
No symbol table info available.

Edit: Fixed paste.

andres-asm commented 8 years ago

That isn't helpful at all. You need to build with debug symbols. It's clearly not finding something, most likely an error with the cuesheet or maybe you just have one of the required BIOS files.

I just added a patch that will print what file is it not finding so it's less cryptic.

orbea commented 8 years ago

Sorry, I'm not that experienced with gdb yet.

I rebuilt beetle-psx-libretro and here is the new error message.

$ retroarch -L /usr/lib64/libretro/mednafen_psx_libretro.so Beyond\ the\ Beyond\ \(USA\)/Beyond\ the\ Beyond\ \(USA\).cue 
unhandled setting UI: psx.input.port1.gun_chairs
unhandled setting UI: psx.input.port2.gun_chairs
unhandled setting UI: psx.input.port3.gun_chairs
unhandled setting UI: psx.input.port4.gun_chairs
unhandled setting UI: psx.input.port5.gun_chairs
unhandled setting UI: psx.input.port6.gun_chairs
unhandled setting UI: psx.input.port7.gun_chairs
unhandled setting UI: psx.input.port8.gun_chairs
terminate called after throwing an instance of 'MDFN_Error'
  what():  Error opening file:
/home/orbea/games/bios/scph5501.bin
No such file or directory
Aborted
~/games/bios$ ls scph*
scph5500.bin  scph5502.bin  scph7003.bin
$ md5sum scph*
8dd7d5296a650fac7319bce665a6a53c  scph5500.bin
32736f17079d0b2b7024407c39bd3050  scph5502.bin
490f666e1afb15b7362b406ed1cea246  scph7003.bin

The scph7003 bios has the same md5sum as the missing bios according to mednafen's and your documentation, but was renamed for whatever reason. This doesn't seem to cause a problem with pcsx-rearmed, but I guess the mednafen psx core has issues while Tales of Phantasia worked because it was an iso from another region where the bios hasn't been renamed.

So I tried:

$ cp scph7003.bin scph5501.bin

And now it works... It probably would be best to update both the documentation and the mednafen psx core so that the scph7003 bios also works.

Additionally, what is the proper way to rebuild retroarch with gdb support? Building it with something like: "-Og -ggdb3"?

bleakassassin commented 8 years ago

I just tested the game (NTSC-U) and don't have any issues playing it with this core. I use a renamed SCPH7003 BIOS (out of necessity, of course).

It's not exactly common knowledge that the two BIOSes are the same. Using the SCPH7003 BIOS name in the coding would be a bit less confusing considering the strange lack of a SCPH5501 BIOS. That or implementing wider BIOS support beyond what Mednafen PSX itself has.

Warriors-Blade commented 8 years ago

I just tested Beyond the Beyond Redump verified named the same as Redump standard and it has no issues running in the Mednafen PSX core.

The tested OS is windows 7 64 bit.

bleakassassin commented 8 years ago

Aside from any sort of BIOS handling change that this might inspire, it's time to close this issue.

simias commented 8 years ago

In Rustation I iterate over the files in the system folder and select the BIOS based on its size and SHA256 regardless of the file name. Mednafen already has a sha256 database in the source so maybe that could be done in the same way.

rz5 commented 7 years ago

I've done some commits that will be more forgiving on BIOS naming and it will yell at you if the expected BIOS names and/or SHA1 values don't match what it expects.

Marking this as invalid and closing.