libretro / vice-libretro

Versatile Commodore 8-bit Emulator
GNU General Public License v2.0
40 stars 70 forks source link

VSF snapshots saved using SDLVICE don't load anymore #420

Closed fastpop72 closed 3 years ago

fastpop72 commented 3 years ago

As stated here the problem was solved last year but now VSF files doesn't load anymore in Retroarch / Libretro-vice core.

https://github.com/libretro/vice-libretro/issues/213

sonninnos commented 3 years ago

Log should tell the reason.

Edit: Works fine here. Conditions need to be exact, which are:

As in 3.3 snapshots will not work with 3.5, and x64 snapshots will not work with x64sc, etc.

fastpop72 commented 3 years ago

@sonninnos Not very much... Only says "too old".

But it says an interesting statement about the Snapshot version. Why should expecting an old snapshot version in latest Vice?

[libretro INFO] AUTOSTART: Restoring snapshot. [libretro ERROR] Snapshot version (2.0) not valid: expecting 1.1. [libretro ERROR] Snapshot D:\SDL2VICE-3.5-win64-r40846\snapshot.vsf is incompatible (too old), Snapshot was created by VICE Version 3.5.0 (r40846).

sonninnos commented 3 years ago

Looks like later 3.5 versions have changed the snapshots yet again. This core is based on the stable 3.5.

And the same thing shall happen at 3.6 again regardless.

I can't do anything about it. I already tried removing the restrictions with the 3.5 change, but 3.3 snapshots simply did not work no matter what.

fastpop72 commented 3 years ago

So the only chance to use VSF files in RetroArch+lr-vice core is to create them with the stable SDL2-VICE 3.5 version?

Unfortunately only the GTK3 stable version is available.... no binaries for SDL2 stable version... only nightly are available.

sonninnos commented 3 years ago

Yes. GTK/SDL should not matter though, since the GUI does not dictate internal operations, but could still be the case.

SDL2VICE exists here: https://sourceforge.net/projects/vice-emu/files/releases/binaries/windows/

But why bother though, since the savestate data is the same, so simply renaming RA state to vsf should work just as well, as long as state compression is not enabled.

Edit: Only needed to remove the RA header from the state, so that it starts with VICE Snapshot and then renaming to vsf worked.

fastpop72 commented 3 years ago

With VSF file just created with stable GTK or SDL version 3.5 gives this error in both cases...

[libretro ERROR] VIC-II: Snapshot was made with model 1 while the current model is 0.

fastpop72 commented 3 years ago

@sonninnos I'd like to use Vice for creating VSF files because with integrated monitor and breakpoints i can create perfect freezes.

sonninnos commented 3 years ago

I don't know what is up. It accepted the file here when I created a snapshot with the same SDL2 3.5 version..

Edit: Hmm, that error comes when VIC-II model is not the same, which should only be possible when other is C64 and other is C64C, since they use different chips, and standalone defaults to C64C, but this core defaults to C64.

fastpop72 commented 3 years ago

Edit: Hmm, that error comes when VIC-II model is not the same, which should only be possible when other is C64 and other is C64C, since they use different chips, and standalone defaults to C64C, but this core defaults to C64.

GOTCHA!!! I must set the Vice machine to C64 instead C64C!!!!

@sonninnos Many many many many thanks!!!!!

sonninnos commented 3 years ago

No problemo. Of course you can use whichever model you prefer.

I changed the default in this core to C64, because when I think of C64 I think of the original breadbox with the superior sound chip.

fastpop72 commented 2 years ago

@sonninnos Anyway there are some problems on loading VSF...

Here's an attached VSF created with stable 3.5 (GTK3) working in Vice but crashing in RetroArch.

beyond.zip . Edit: Selected machine is C64C !!!!

Edit n.2: Vice's core load correctly only simple "one-shot" VSF files, without any attachments.

If VSF file has been saved with "disk" attached (a D64 image for example), RetroArch load the VSF and execute it correctly but the attached disk is ignored.

If VSF file has been saved with "rom" attached (a CRT image for example), RetroArch crashes at core start.

sonninnos commented 2 years ago

The crash has nothing to do with VICE settings, but instead it was caused by the hack that I've added to the core, which stops saving EF cart data to the savestate. It not only saves a lot of space, but also allows saving save data to the cart after using savestates. Standalone will ignore all saves to the cart when using snapshots.

I was able to fix it so that both RA savestates and VSF work properly. And I also did the same for D64 disks, since those snapshots are also hacked to include only the file name instead of file data, in order to be able to switch multi-disk game disk index automatically when using M3U files.

Obviously that VSF approach is doomed when it comes to multi-disk games, but at least single disks should work now like normal.

Please test this if there are more issues: vice_x64sc_libretro.zip

Edit: Derp, found a crash, will fix shortly. Edit2: ZIP updated.

fastpop72 commented 2 years ago

The crash has nothing to do with VICE settings, but instead it was caused by the hack that I've added to the core, which stops saving EF cart data to the savestate. It not only saves a lot of space, but also allows saving save data to the cart after using savestates. Standalone will ignore all saves to the cart when using snapshots.

I was able to fix it so that both RA savestates and VSF work properly. And I also did the same for D64 disks, since those snapshots are also hacked to include only the file name instead of file data, in order to be able to switch multi-disk game disk index automatically when using M3U files.

Obviously that VSF approach is doomed when it comes to multi-disk games, but at least single disks should work now like normal.

Please test this if there are more issues: vice_x64sc_libretro.zip

Edit: Derp, found a crash, will fix shortly. Edit2: ZIP updated.

It works properly now, with both VSF type of files (roms or disc attached).

These fixes will be commited to master?

sonninnos commented 2 years ago

Excellent. I'll do my usual test rounds first and then merge soonish.