libretro / libretro-uae

PUAE libretro
GNU General Public License v2.0
114 stars 61 forks source link

OS error on *.lha files #524

Closed Bigmonty69 closed 2 years ago

Bigmonty69 commented 2 years ago

I've been trying to use the PUAE core on the Steamdeck and on the PC and am getting the same error when trying to load *.lha files (these files work fine on my Amiga mini).

image

All settings seem to be fine and Kickstarts in the correct place and working. I have also tried *.adf files and these work no problem. Can you please help?

ocimbaluria commented 2 years ago

Helllo, I have the same issue. I found that this is due to the downgrade of WHDLoad in 18.6 because this param (NoWriteInfo) has been added in 18.7. I tried to modify the prefs file in the installed WHDLoad part but it does not work. If someone can help

Bigmonty69 commented 2 years ago

Helllo, I have the same issue. I found that this is due to the downgrade of WHDLoad in 18.6 because this param (NoWriteInfo) has been added in 18.7. I tried to modify the prefs file in the installed WHDLoad part but it does not work. If someone can help

I deleted that line out of the prefs file and got it working. Not sure if it is just papering over something that might have other issues that I am not aware of however.

ocimbaluria commented 2 years ago

Can you tell me what line you removed because I tried to comment and Then remove the line 28 (NoWriteInfo) in the file WHD/WHDLoad/S/WHDLoad.prefs which has been automatically installed while launching the lha file for the first time but it does not work.

Bigmonty69 commented 2 years ago

Can you tell me what line you removed because I tried to comment and Then remove the line 28 (NoWriteInfo) in the file WHD/WHDLoad/S/WHDLoad.prefs which has been automatically installed while launching the lha file for the first time but it does not work.

Yeah that was the line. I just deleted it using wordpad. Tried a *.lha game and it worked no issues. It was the windows version of RetroArch I was using so the prefs file was on a different location, maybe that’s the difference.

ocimbaluria commented 2 years ago

Thanks, I found the good file. I was using the wrong on, now it works fine.

Bigmonty69 commented 2 years ago

Been trying this fix but, while it appears that it lets you run the games, save files do not seem to work. Will need someone to have a proper look at it.

ocimbaluria commented 2 years ago

I tried to save a games with savestates and it works fine, but I tried for exemple with Dungeon Master and save game crashes with this error : disk.2 is compressed using xpk but not cached detected in function resload_savefileoffset

sonninnos commented 2 years ago

Just delete WHDLoad.prefs from system and WHDLoad directory or HDF from saves and the core will generate new (old) ones.

That system prefs will be copied to the helper image always, so editing that one won't help.

The Dungeon Master error is something else entirely. Saves in all other games have been working so far.

Edit: Whoops, looks like I have made a mistake with the fresh prefs file being the wrong version, will fix soon.

sonninnos commented 2 years ago

I found out what is up with Dungeon Master. The initial save disk creation requires write cache, as in NoWriteCache can not be enabled, which for obvious reasons is enabled by default. So simply comment the line with a ; in system/WHDLoad.prefs to allow write cache this time, run the game, format save disk, quit, remove the comment, and it will save fine without write cache afterwards.

InterClaw commented 1 year ago

I was having some problem getting the Dungeon Master workaround to work for me. What I was doing wrong was not quitting WHDLoad the right way.

If you quit in-game you just end up on the language selection screen again and nothing is still written to disk. To quit so that the chache gets flushed to disk, I hit * on the keypad. I don't know why it's this key. I was randomly hitting keys and suddenly ended up on the ReadMe from the .lha file. Turns out that's the hotkey to quit for me at least.

And then both Disk.1 and disk.2 got written under saves\WHDSaves.

This is running PUAE in RetroArch btw.

After that I could disable the write chache again and save and load normally.

sonninnos commented 1 year ago

After the NoWriteCache option addition the universal quit key is not , but numpad minus. Only way to make it automatic when quitting RA is to force it to a certain key. Numpad tends to be the untouched default key, so something is messing your settings up.

If write cache is enabled, data will be lost if WHDLoad is not quit nicely. Quitting nicely according to my tests works just nicely when quitting RA without quitting WHDLoad manually first.

Also tried Dungeon Master with the default settings, and it quits with the set key instead of default, so the game saved just fine when RA is quit with Alt-F4 after saving in game.

So delete WHDLoad.prefs from system and try again.

InterClaw commented 1 year ago

I renamed WHDLoad.prefs to generate a new one and the generated one is identical to the one I had.

Regardless of having NoWriteCache or ;NoWriteCache, the key that seems to quit WHDLoad is numpad * for me. Numpad minus (and plus) changes the volume in RetroArch, which I think is standard. Note that ;QuitKey=$5a, so that setting is disabled. Language is set to English in RetroArch and I have a 105 key ISO standard layout.

Or maybe I'm misunderstanding something here. πŸ˜ƒ When I say "quit", I mean it shows me the ReadMe file, so I'm not sure if that is "quit" or not. It was enough to flush the cache at least.

Regardless, the disk images are written under saves\WHDSaves, so I can run with the default NoWriteCache, which is a good thing right? It writes immediately to disk. So I'm happy. πŸ‘

sonninnos commented 1 year ago

Yes, $5a is the default, and the one being used is at the bottom QuitKey=$4a, which is RETROK_KP_MINUS. It won't be there if the NoWriteCache core option is enabled, since it is not needed then. Host keyboard layout has nothing to do with it, since it happens inside emulation.

Log will say "WHDLoad QuitKey triggered.." when it does what it is supposed to.

NoWriteCache is no longer the default since it is not needed anymore. Do as you please, but some games will have horrible flashing and otherwise longer load times if write cache is disabled.

InterClaw commented 1 year ago

I just realized I'm running PUAE 2021, not PUAE. So that must be why it's slightly different. I'll have to do some more experimenting then.

I believe the reason for doing this is because that's the version that is available in RetroPie and I wanted parity, so that save states are compatible etc.

sonninnos commented 1 year ago

Can't be that since both cores are up-to-date on that regard.

Edit: Just tried with 2021 with default settings (as in the core option is not enabled) and deleted old save disks. Hit save in game, pressed Alt-F4. Disks are there and loaded fine.

InterClaw commented 1 year ago

Good to hear that there's no difference on this between PUAE and PUAE 2021. πŸ‘

I updated all cores in RA now and now the default WHDLoad.prefs has ;NoWriteCache and has QuitKey=$4a (kp minus) at the bottom! This new version also has WriteDelay=0, whereas the old version had WriteDelay=50. Those are the differences I'm seeing.

I stupidly did not take note of what the (apparently) old version of PUAE 2021 had as version number before updating, but this one is saying "2.6.1 c2d803d" at least. Haven't found a changelog/version history, so not sure when this was changed and made available. From browsing the commits, maybe some time earlier this summer? I would have installed the version I had in April. These are fairly recent changes I take it then?

(Now since the hotkey is kp minus, which is also used for volume down, I have to be in game focus mode to quit using that key, but that's alright. You kind of have to anyway for mouse and keyboard games.)

I followed your latest example now: Removed what I had in saves\WHDSaves. Started the game on the latest version. πŸ˜… Played until I could save. Just clicked "Save". And then tried Alt-F4, "Close content", and the quit key. All methods then wrote both disk images!

It's a bit scary that when you save, the data is still only in memory. But if this is the recommended way to go about this now, then alright then. πŸ‘

sonninnos commented 1 year ago

That write delay difference is only because HDF mode requires delay, while Files mode does not. As in 50 is the safe default, and Files mode sets it to 0, because there is no benefit in having it, and it only slows down for nothing.

The 2.6.1 branch is right here in the same repo and it is updated with the same libretro features as the current core.

Again you don't need to worry about the WHDLoad quit key manually anymore, and you can also press it via the VKBD.