libretro / fuse-libretro

A port of the Fuse Unix Spectrum Emulator to libretro
GNU General Public License v3.0
36 stars 46 forks source link

Model set to Scorpion freezes Retroarch when loading TZX, TAP #98

Closed zzedmore closed 3 years ago

zzedmore commented 3 years ago

@tomconte If you accidently have the Model set to Scorpion and you try to load a TAP or TZX etc. then Retroarch crashes. The log says it can't find the roms ?

[libretro INFO] Checking if "\256s-0.rom" exists
[libretro INFO] Could not find file "\256s-0.rom", trying file system
[INFO] [Environ]: SYSTEM_DIRECTORY: "C:\Games\RetroArch\system".
[libretro INFO] Trying to open "C:\Games\RetroArch\system/fuse\256s-0.rom" from the file system
[libretro INFO] Opened "C:\Games\RetroArch\system/fuse\256s-0.rom" from the file system
[libretro INFO] Could not find file "\256s-0.rom", trying file system
[INFO] [Environ]: SYSTEM_DIRECTORY: "C:\Games\RetroArch\system".
[libretro INFO] Trying to open "C:\Games\RetroArch\system/fuse\256s-0.rom" from the file system
[libretro INFO] Opened "C:\Games\RetroArch\system/fuse\256s-0.rom" from the file system
[libretro INFO] Checking if "\256s-1.rom" exists
[libretro INFO] Could not find file "\256s-1.rom", trying file system
[INFO] [Environ]: SYSTEM_DIRECTORY: "C:\Games\RetroArch\system".
[libretro INFO] Trying to open "C:\Games\RetroArch\system/fuse\256s-1.rom" from the file system
[libretro INFO] Opened "C:\Games\RetroArch\system/fuse\256s-1.rom" from the file system
[libretro INFO] Could not find file "\256s-1.rom", trying file system
[INFO] [Environ]: SYSTEM_DIRECTORY: "C:\Games\RetroArch\system".
[libretro INFO] Trying to open "C:\Games\RetroArch\system/fuse\256s-1.rom" from the file system
[libretro INFO] Opened "C:\Games\RetroArch\system/fuse\256s-1.rom" from the file system

etc..

Also, you can't load TAP, TZX when it's set to Scorpion 512 or 1024.

In the 'Core Information' it says that the optional roms are not detected. I have the rom files in system/fuse. However, they ARE detected if you put them in the system directory (not in fuse subdirectory).

To summarize, If you have the model set to Scorpion, Pentagon 512 or Pentagon 1024 then you can only load SCL and TRD files. Anything else will either not do anything or crash Retroarch.

tomconte commented 3 years ago

The paths to the BIOS files are wrong indeed in the info file. I have submitted the fix: https://github.com/libretro/libretro-super/pull/1541

tomconte commented 3 years ago

Your log says "Opened ... from the file system", so I think it does find the BIOS files.

On RPi4, I get the following results:

I don't know if this is a bug in the emulator or just a difference in the way the Pentagon/Scorpion machines work...

zzedmore commented 3 years ago

So we'll have to make sure that the model isn't set to Scorpion if we try to load a TZX or TAP otherwise it locks up. Maybe you could prevent selecting Scorpion and Pentagon 512 & 1024 from the Model option in the core settings ? That way you'll still be able to select Pentagon 128K and if it's set to anything else and you load a SCL or TRD it automatically chooses Scorpion.

Or just prevent loading TZX and TAP when a TR-DOS machine is selected ?

zzedmore commented 3 years ago

Also, about the roms. If the optional roms are in system/fuse (which is where they should be), the Core Information option says they are missing. If you put them in system then it says they are present ?

zzedmore commented 3 years ago

@tomconte

So these are my findings, i've been trying this on regular FUSE.

Pentagon 128K - tapes load fine automatically. Pentagon 512K & 1024K - a 'Gluck' menu appears and you have to select 48K or 128K and type LOAD"" and tapes load fine. Scorpion - a 128K style menu should appear but doesn't on Libretro (because of Autoload ?). Maybe, TZX and TAP should be prevented on this machine only.

SCL and TRD load fine on all four models.

tomconte commented 3 years ago

Also, about the roms. If the optional roms are in system/fuse (which is where they should be), the Core Information option says they are missing. If you put them in system then it says they are present ?

Yeah, the BIOS paths were wrong in the info file. See my comment above, I submitted a fix to the info file.

zzedmore commented 3 years ago

So do you have any ideas about fixing the Retroarch freeze when loading tapes with Scorpion ? Is there even any need for tape support on Pentagon & Scorpion ? I thought they were just used for TR-DOS disks (SCL & TRD).

tomconte commented 3 years ago

I will try to step through the code to see if there is something going on when auto-loading a tape in Scorpion mode... That said I think you are right that most people would probably use Scorpion/Pentagon machines for TRD/SCL roms, and tapes would be loaded with earlier "traditional" models.

tomconte commented 3 years ago

Finally did some tests with Fuse standalone... I think the auto-start logic for tapes on Scorpion is not working somehow... e.g. if I run:

fuse --machine scorpion --tape my_favourite_game.tap 

Then I get a "R Tape loading error" (see screen capture).

Screenshot 2021-05-11 at 11 38 38

To start the tape I have to manually go to 128 BASIC, type load "" and then open the tape using the Media menu.

In the Libretro core, when opening a TAP file, the emulator just loops endlessly, waiting for the Beta 128 disk interface, so I think it is not going through the right sequence to read a tape.

Will look into it a bit more just for curiosity sake :-)