libretro / libretro-uae

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

WHDLoad does not work with Cloanto Kickstarts #625

Closed fallenguru closed 1 year ago

fallenguru commented 1 year ago

I thought I'd use the official Kickstarts from Cloanto, seeing as I bought Amiga Forever—7 Plus, to be specific— way back when. I simply copied them to ~/.config/retroarch/system, along with rom.key, which this version still uses; no renaming.

The PAUE core itself recognises and uses the files just fine. However, when trying to launch WHDLoad games, my test case being 976f8b92bdf9bb4e61c4fad808ca24be *ItCameFromTheDesert_v2.0_0014.lha, WHDLoad will complain (Amiga-side):

DOS-Error #205
(object not found)
on reading: "devs:kickstarts/kick34005.a500"

Making kick34005.a500 / kick34005.A500 [see below] a symlink to / a copy of amiga-os-130.rom won't change a thing, same error. It basically insists that I source kick34005.A500, err, alternatively. Note that despite the A in the error message being lower case, it must be upper case to be found.

This is probably at least in part a bug in the WHDLoad installers in question, but from the couple of games I tried it's a very common one, and FWIW, FS-UAE works with the Cloanto Kickstarts OOTB, even in WHDLoad mode.

Would it be possible to apply the equivalency mapping even when creating ~/.config/retroarch/saves/WHDLoad, decrypt the Cloanto Kickstarts, if found, and copy them over under the conventional name (as well)? Or do whatever else FS-UAE does to make this work?

Also, the case-(in)sensitivity issue may or may not be a (separate), potentially Linux-specific problem.

sonninnos commented 1 year ago

205 means the file is not found, so pretty sure it has nothing to do with the version. Or can you make the error go away with some other Kickstart version? Note that just changing the file in system after the first run will not do anything, so you must delete the WHDLoad directory in saves to create a new one.

The WHDLoad helper image populator is copying the file in correct place as the correct name here as designed regardless if the name in system is kick34005.a500 or amiga-os-130.rom.

And everything will be logged, so post the log of the first run after deleting WHDLoad. Also pretty sure that if UAE can use the Kickstart file, so can WHDLoad.

https://whdload.de/docs/en/need.html

Starting WHDLoad version 16.5 also the kickstart images from the Cloanto Amiga Forever CDs may be used. The images must be renamed according the table below. Additionally the rom.key must be copied to Devs:Kickstarts/ or WHDCOMMON:. The Cloanto Plus Edition ROMs are no longer encoded and do not require the rom.key. For further information please refer to Amiga Forever.

fallenguru commented 1 year ago

I know that I have to delete saves/WHDLoad between tests to regenerate it.

What log, precisely? logs/retroarch.log doesn't have anything about the WHDLoad creation process that I can see.

What I'm trying to say is:

tl;dr: It only copies the shady Kickstart into the WHDLoad tree, and only if it's named kick34005.A500 (case matters).

Considering that case apparently doesn't matter for WHDLoad Amiga-side, it probably shouldn't matter during the creation of the WHDLoad tree.

Even if it did copy the Cloanto version of the ROM, by whatever name, would it even work? It is encrypted, so it'd need some sort of special handling, no?

sonninnos commented 1 year ago

There is no other log. The log will have in regular info level

[libretro INFO] WHDLoad image directory 'x' not found, attempting to create..

And then a bunch of unzipping and Kickstart copying. There is no other checking than filesize in both WHDLoad methods (files mode happens outside emulation, HDF mode happens inside emulation). So the only reason why the copy won't happen is that the filesize does not match. How can the filesize be different than the usual, and still work with UAE itself..?

There is no mechanism to copy rom.key to the WHDLoad image from system, so try copying it manually to the same directory where the Amiga-side Kickstarts are, like the WHDLoad document says.

And the Kickstart copying writes to upper case .A500, so I have no idea how you can even end up with low case .a500..

fallenguru commented 1 year ago

There is no other log. The log will have in regular info level [...]

There it is. I must be going blind ... Sorry.

The WHDLoad helper image populator is copying the file in correct place as the correct name here as designed regardless if the name in system is kick34005.a500 or amiga-os-130.rom.

No, it's not. That's impossible. Unless whdload/WHDLoad_files/S/KSCopy is dead code, the names and sizes of the Kickstarts to be copied are hardcoded. There's no handling for the Amiga Forever Kickstarters whatsoever. They not only fail the name check, they also fail the size one, since the encryption wrapper adds about 1 KB or so.

The clean way to do this would be something like:

FWIW, if I cp system/amiga-os-130.rom saves/WHDLoad/Devs/Kickstarts/kick34005.a500 [the case of the A doesn't matter] and cp system/rom.key saves/WHDLoad/Devs/Kickstarts/ manually after first run, it works.

sonninnos commented 1 year ago

The Amiga-side copy script is only used when WHDLoad is in HDF mode, which is not advised. The default mode handles more, as stated in the readme: https://github.com/libretro/libretro-uae#kickstart-roms

Amiga Forever and TOSEC filenames are also accepted.

Maybe better to just use the decrypted versions directly.

fallenguru commented 1 year ago

Oops, the code is actually in libretro-core.c. It looks like it does check for the Amiga Forever Kickstarts, but it doesn't support encrypted ones at all, not with WHDLoad.

AFAICS, all that would be needed to support them is adding their sizes as valid and copying rom.key as well.

There is no mechanism to copy rom.key to the WHDLoad image from system

Why? Shouldn't be hard to add?

so try copying it manually to the same directory where the Amiga-side Kickstarts are, like the WHDLoad document says.

That does indeed work, as stated above. The WHDLoad docs may suggest this, but the core's docs do not. There's no way a normal user would know to do this.

Maybe better to just use the decrypted versions directly.

Why? WHDLoad itself supports the encrypted ones just fine. Besides, the encrypted ones are all I have, officially.

Anyway, the point is that the core docs say that the Amiga Forever Kickstarts are supported, but for WHDLoad mode encrypted Amiga Forever Kickstarts are not currently supported.

sonninnos commented 1 year ago

It does not exist yet, because I wasn't aware that it was a thing, and that I don't have the files to test with, and that no one has complained about it yet.

But if the size difference is fixed, and adding just one more file to be copied is enough, then no, it shouldn't be hard.

Could you deliver the file sizes and hashes for all of the Cloanto file versions, since the data I got from their site https://cloanto.com/amiga/roms/ has the same checksums as those files that are supported by UAE. Or I guess I could just skip the file size check completely when the filename is in the particular Cloanto format, since surely no one renames the amiga-*files to kick* manually..

zzedmore commented 1 year ago

Probably the first person i've seen that actually uses the Cloanto versions of ROMs ! The last time I used Amiga Forever (years ago) they weren't even encrypted and didn't require a rom.key file.

fallenguru commented 1 year ago

Could you deliver the file sizes and hashes for all of the Cloanto file versions,

I only have the ones from version 7 Plus, but those I'll happily share:

The first one has sizes, dates, and CRC32. ralphschmidt-cyberstorm-ppc-4471.rom, like rom.key, is generated on demand by the Amiga Forever frontend, which is why it's new; I wouldn't bet that the size or contents of either is identical across versions and installations.

Probably the first person i've seen that actually uses the Cloanto versions of ROMs !

:-)

I'll admit that simply documenting that the encrypted versions won't work for WHDLoad, or telling people to (re-)buy a current version would be a legitimate way to close this issue, but then PUAE is about reviving a system that's going on 40 years-old, so being told that Kickstarts from 5 years ago are too old would be a bit weird.

sonninnos commented 1 year ago

Thanks. This should cover it: https://github.com/libretro/libretro-uae/pull/627

sonninnos commented 1 year ago

Does it need something more? I'll update the 2021 core too if everything is fine.

fallenguru commented 1 year ago

Huh, that was quick. I didn't expect the changes to show up in what's available via Core Updater so soon.

Everything works now without manual intervention (starting fresh after wiping saves/WHDLoad).

Thank you!

sonninnos commented 1 year ago

Excellent, thanks for confirming.