CAPS Lib / IPF Support / OSX

HxC Floppy Emulator on Amiga support
Post Reply
data.fux
Posts: 3
Joined: Fri Dec 20, 2019 11:15 pm

CAPS Lib / IPF Support / OSX

Post by data.fux »

I'm trying to enable IPF Support for the HxCFloppyEmulator v2.2.2.1 running on OSX 10.14.

I downloaded the newest CAPS Lib from https://github.com/simonowen/capsimage/releases since the SPS Site doesn't have the v5.1 for OSX.
I then put the Lib in all possible places:

/Library/Frameworks,
~/Library/Frameworks,
same directory as HxCFloppyEmulator.app,
and inside HxCFloppyEmulator.app next to libhxcfe.dylib

I did this with the original CAPSimage.framework and with the actual lib file that I extracted from that package.
But I can't get the HxCFloppyEmulator to load *.ipf files.

commit [r1894] states: windows & linux caps libraries are now specified with the environment variables.
So I set the variable LINUX_SPSCAPS_LIB_NAME but then I saw that this commit is newer than v2.2.2.1

Is there anything I miss? Is there someone who managed to get this working under OSX?

Thanks for any hints!

Jeff
Site Admin
Posts: 7937
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: CAPS Lib / IPF Support / OSX

Post by Jeff »

It currently only support Linux and Windows caps libraries.

data.fux
Posts: 3
Joined: Fri Dec 20, 2019 11:15 pm

Re: CAPS Lib / IPF Support / OSX

Post by data.fux »

Ok. But is an older version that supports IPF on OSX still available for download?

Jeff
Site Admin
Posts: 7937
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: CAPS Lib / IPF Support / OSX

Post by Jeff »

data.fux wrote:
Sat Dec 21, 2019 12:50 am
Ok. But is an older version that supports IPF on OSX still available for download?
There is no older version supporting this.

Since SPS forbid the CAPS library distribution, i can't link the software to this library directly.
I need to add library loader. This is specific to each OS and the Mac OS X version isn't done yet.

Linux version :
https://sourceforge.net/p/hxcfloppyemu/ ... ibloader.c

Windows version :
https://sourceforge.net/p/hxcfloppyemu/ ... ibloader.c

But what is the exact purpose of this ? Are you using it to use the image with an HxC Floppy Emulator ?

EDIT : It appears that mac OS X also support the dlopen / dlsym API used in the Linux version. So the code is already there, this is probably just question of some little Makefile changes.

Jeff
Site Admin
Posts: 7937
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: CAPS Lib / IPF Support / OSX

Post by Jeff »

The all the capslib loaders are now unified :

https://sourceforge.net/p/hxcfloppyemu/ ... ibloader.c

And the mac OS capslib loader is now working :

https://hxc2001.com/download/floppy_dri ... t_beta.zip

data.fux
Posts: 3
Joined: Fri Dec 20, 2019 11:15 pm

Re: CAPS Lib / IPF Support / OSX

Post by data.fux »

Thanks a lot! What a service!
But I think the link to the beta is still v2.2.2.1 (8.12.19) It did not work form me.
I had to update the svn an compile it for myself. This indeed gives me ipf support on osx!
Thanks!

Jeff
Site Admin
Posts: 7937
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: CAPS Lib / IPF Support / OSX

Post by Jeff »

data.fux wrote:
Sun Dec 22, 2019 3:46 am
But I think the link to the beta is still v2.2.2.1 (8.12.19) It did not work form me.
It does. This sound to be a browser cache issue ;)

renaud
Posts: 4
Joined: Mon Oct 06, 2014 2:29 am

Re: CAPS Lib / IPF Support / OSX

Post by renaud »

Hello,

I struggled with this too on the latest beta v2.5.6.9 and I sent my findings directly to Jeff, but I will repost here in case it's useful to others.

For me, copying CAPSImage.framework into /Applications/HxCFloppyEmulator.app/Contents/Frameworks still doesn't work (if I'm missing something, please tell me what and don't read the rest of this post :lol: )

After some research and looking at the source, it makes sense why:

The SPS library path is defined in SPSCAPS_LIB_NAME which defaults to "CAPSimage.framework/CAPSimage". This is a relative path from the app's current working directory, which unfortunately on macOS is NOT the executable or .app's directory on disk as you would hope, but is apparently "/" for GUI programs launched from the Finder.

From the GUI, if you manually change SPSCAPS_LIB_NAME in the "internal parameters" menu to a full path (e.g. "/Applications/HxCFloppyEmulator.app/Contents/Frameworks/CAPSImage.framework/CAPSImage") it will work.

Or cleaner solution, make it relative to the path of libhxcfe.dylib : "@loader_path/CAPSImage.framework/CAPSImage" (you can also use @executable_path to make it relative to hxcfloppyemulator, or even better : @rpath to use proper default library locations, but that one also requires a change to LDFLAGS during compilation)

You can also set it to "/Users/<you>/Library/Frameworks/CAPSImage.framework/CAPSImage" if you've installed a shared version there.

But of course, changing SPSCAPS_LIB_NAME manually every time is annoying, and it seems environment variables aren't supported, but that's what config.script is for, right ?

Except that on macOS, config.script has the exact same problem : it's loaded by floppy_loader.c in libhxcfe, and it's looking for it in the current working directory which is "/" on macOS GUI apps.
Therefore, the comment in init.script that says "You can put a "config.script" file in the HxC Software folder to change one or more of these variables if needed." is wrong, unfortunately.

So, config.script basically unusable on macOS unless you're happy to put it at the root of your filesystem (I'm not :) )

With no config.script and no environment variables, we need to make things work with the current default value of SPSCAPS_LIB_NAME ("CAPSimage.framework/CAPSimage").
The only way I've found is to launch the GUI app executable from the Terminal ("/Applications/HxCFloppyEmulator.app/Contents/MacOS/hxcfloppyemulator"), with CAPSImage.framework present in the directory you're launching from. I'm going to make a script for that.

Of course, it would be easier if the default hardcoded value for SPSCAPS_LIB_NAME was something more convenient like "@loader_path/CAPSImage.framework/CAPSImage" (so that you can copy the framework next to libhxcfe.dylib), or even better, support standard shared library paths with @rpath. Or if config.script could be made to work on macOS not just in "/" (but I suspect you need to use some specific APIs to find out the installed app path)

Jeff
Site Admin
Posts: 7937
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: CAPS Lib / IPF Support / OSX

Post by Jeff »

Hello,

Unfortunately since my Mac mini is now too old to run the latest macOs and xcode i can't provide any new build anymore. macOs support will probably being dropped in the next release.

anyway i accept any tested code patch.

yserra
Posts: 1
Joined: Wed Nov 02, 2022 12:59 am

Re: CAPS Lib / IPF Support / OSX

Post by yserra »

As far as I know, the CAPSimage.framework/CAPSimage framework is obsolete.

To open .ipf, FS-UAE emulator and Greaseweazle software use now this up-to-date library:
For x86 Mac: https://fs-uae.net/files/CAPSImg/Stable ... -64.tar.xz
For M1 Mac: https://fs-uae.net/files/CAPSImg/Stable ... M64.tar.xz

Notice the new correct name is : CAPSImg.framework/CAPSImg

Usually it's supposed to be installed as:
~/Library/Frameworks/CAPSImg.framework/CAPSImg
or as:
/Library/Frameworks/CAPSImg.framework/CAPSImg

But, in any case, I can't make the command line hxcfe nor the GUI hxcfloppyemulator to use it. Even when I go to Settings/Internal parameters/SPSCAPS_LIB_NAME to enter the direct path, or a relative path with "@loader_path/..." or "@executable_path/...", I can never open any .ipf file, wherever I put this CAPSImg.framework/CAPSImg framework!

(I'm using HxCFloppyEmulator v2.5.12.1, build on macOS Ventura 13.0, on November 1st 2022, from the source code on SourceForge)

mahen
Posts: 5
Joined: Mon Nov 14, 2022 1:03 pm

Re: CAPS Lib / IPF Support / OSX

Post by mahen »

Hi ! Under Linux, I had installed the Flatpak version of HxCFloppyEmulator and didn't manage to convert an IPS file.
So I compiled & installed libcaps then HxCFloppyEmulator, but it still doesn't work.
Is there an additional step I'm overlooking ?

Thanks a lot !!

mahen
Posts: 5
Joined: Mon Nov 14, 2022 1:03 pm

Re: CAPS Lib / IPF Support / OSX

Post by mahen »

OK, it does work after modifying by hand the patch of libcaps in the internal parameters ! :)

Post Reply