Amiga.org

Amiga computer related discussion => General chat about Amiga topics => Topic started by: bloodline on November 30, 2016, 11:11:40 PM

Title: ADF Viewer/Manager for macOS
Post by: bloodline on November 30, 2016, 11:11:40 PM
I was cleaning through some old files and found some old code for an ADF manager I wrote for the Mac some time ago.

I have compiled the code and amazingly it works... if anyone here find it useful, let me know and I might add more features :)

https://drive.google.com/file/d/0B3CMG5yqFK4janJFaS1CUFRFek0/view?usp=sharing
Title: Re: ADF Viewer/Manager for macOS
Post by: Matt_H on December 01, 2016, 02:59:09 AM
Er, any chance you can do an OSX 10.6 compatible compile? ;)

I'm currently using The Archive Browser (https://archivebrowser.c3.cx/) to examine ADFs on my Mac, but it's a little unstable...
Title: Re: ADF Viewer/Manager for macOS
Post by: bloodline on December 01, 2016, 07:34:17 AM
Quote from: Matt_H;817120
Er, any chance you can do an OSX 10.6 compatible compile? ;)



I'll see if I still have an OS 10.6 sdk :)
Title: Re: ADF Viewer/Manager for macOS
Post by: guest6931 on December 01, 2016, 02:48:42 PM
Quote from: bloodline;817131
I'll see if I still have an OS 10.6 sdk :)

This  runs fine on Sierra.  Good job!

Is there any way you could add to this app to export the .info icons to the desktop as icns files, or png files?  I'd love to be able to replace icons in macos with amiga icons.
Title: Re: ADF Viewer/Manager for macOS
Post by: guest6931 on December 01, 2016, 02:50:56 PM
Quote from: Matt_H;817120
Er, any chance you can do an OSX 10.6 compatible compile? ;)

I'm currently using The Archive Browser (https://archivebrowser.c3.cx/) to examine ADFs on my Mac, but it's a little unstable...
Chances are your adf has glowicons or newicons, which crashes ADFBench.
Title: Re: ADF Viewer/Manager for macOS
Post by: bloodline on December 01, 2016, 05:28:26 PM
Quote from: Jason___;817136
This  runs fine on Sierra.  Good job!

Is there any way you could add to this app to export the .info icons to the desktop as icns files, or png files?  I'd love to be able to replace icons in macos with amiga icons.

I can add the feature for you :)

Things on the current todo list:
1. Implement 1.3 style window borders (no code yet)
2. Activate the missing gadgets (the code for scrolling and resizing is buggy)
3. Saving files to your Mac (I'll add saving out the icon image to this as well)
Title: Re: ADF Viewer/Manager for macOS
Post by: bloodline on December 01, 2016, 05:30:11 PM
Quote from: Jason___;817137
Chances are your adf has glowicons or newicons, which crashes ADFBench.


I don't have any ADFs with GlowIcons or NewIcons so I couldn't test them :(
Title: Re: ADF Viewer/Manager for macOS
Post by: bloodline on December 02, 2016, 09:27:07 AM
@Matt_H: I can't compile for OS 10.6 because I have used ARC (Automatic reference counting) throughout the code, which is only supported in later versions of macOX :(

-Edit- I noticed that the error message code was disabled for some reason, I've reactivated it so the next release should now give a message when something goes wrong.

Screenshot:

(https://lh5.googleusercontent.com/DwY0XtWaJ1Skb6-oPYK-wHoiAl26ut1FEZaPNMdNZifU8N6LKyV2BpPuzXOg2qwnlKVqz_VoU5L2918=w1349-h706)
https://drive.google.com/open?id=0B3CMG5yqFK4jeGZiZ2R0U1ZmMEE
Title: Re: ADF Viewer/Manager for macOS
Post by: bloodline on December 03, 2016, 01:23:25 PM
I have uploaded a new build.

To save the icon file to your Mac, right click on it and select the "Save Icon" option.

Enjoy :)


https://drive.google.com/file/d/0B3CMG5yqFK4janJFaS1CUFRFek0/view?usp=sharing

Note: this version is developer signed, I might add it to the Mac App store if there is enough demand. :)
Title: Re: ADF Viewer/Manager for macOS
Post by: Matt_H on December 03, 2016, 05:00:54 PM
Quote from: bloodline;817175
@Matt_H: I can't compile for OS 10.6 because I have used ARC (Automatic reference counting) throughout the code, which is only supported in later versions of macOX :(


Ah well, thanks for trying. Will give it a spin on my 10.10 partition next time I have it booted. :)
Title: Re: ADF Viewer/Manager for macOS
Post by: bloodline on December 06, 2016, 10:11:18 AM
Quote from: Matt_H;817241
Ah well, thanks for trying. Will give it a spin on my 10.10 partition next time I have it booted. :)
Here is a 10.10 (Yosemite) build just for you :)

https://drive.google.com/open?id=0B3CMG5yqFK4jbE1pNjIxUDJPN2M
Title: Re: ADF Viewer/Manager for macOS
Post by: guest6931 on December 07, 2016, 05:53:27 PM
Quote from: bloodline;817232
I have uploaded a new build.

To save the icon file to your Mac, right click on it and select the "Save Icon" option.

Enjoy :)


https://drive.google.com/file/d/0B3CMG5yqFK4janJFaS1CUFRFek0/view?usp=sharing

Note: this version is developer signed, I might add it to the Mac App store if there is enough demand. :)

This is great!  Is it possible to add a recursive save feature, to save every .info on a disk at the same time?  Also, being able to select which states to save would be nice--selected,unselected,both.  I like how it saves to .TIF.  Is it also possible to add an option to save as ICNS to skip the editing/saving on the mac side step?

You should definitely add this to the mac store once its polished.  I think people would happily pay a couple bucks for this.  I know I would.
Title: Re: ADF Viewer/Manager for macOS
Post by: guest6931 on December 07, 2016, 06:03:47 PM
Just discovered a bad bug for saving icons.  The OSX display antialiases the icon image, so when saved, its not in its original 4 colors. (lots of extraneous colours and data)
Title: Re: ADF Viewer/Manager for macOS
Post by: bloodline on December 07, 2016, 09:15:09 PM
Quote from: Jason___;817418
Just discovered a bad bug for saving icons.  The OSX display antialiases the icon image, so when saved, its not in its original 4 colors. (lots of extraneous colours and data)
I appreciate the feedback! I'll get to work fixing the bugs and implementing the features you requested.

PS I'm not planning on charging for this, I just hope someone finds it useful :)
Title: Re: ADF Viewer/Manager for macOS
Post by: bloodline on January 14, 2017, 12:17:39 PM
Quote from: Jason___;817418
Just discovered a bad bug for saving icons.  The OSX display antialiases the icon image, so when saved, its not in its original 4 colors. (lots of extraneous colours and data)

I've implemented a "Save All Icons" feature in the "Amiga Disk Files" menu, which will save all the icons it finds in your ADF as tiff files. The normal and selected states are placed one on top of the other... that's the only way I can make this work for now (I'll see what I can do). I have removed the antialiasing so the original 4 colours are used.

I few little improvements as well, windows can now be resized, double clicking a window will raise it to the front most view.
The screen area can be any size you like... which includes full screen (looks awesome... especially in 1.3 view mode: atl-cmd-t).

The browser supports multiple ADFs, I want to implement greater interaction between disk files at some point.


Keep the suggestions coming :)
Title: Re: ADF Viewer/Manager for macOS
Post by: guest6931 on January 14, 2017, 02:24:04 PM
An option to save only the unclicked state would be useful, especially since OSX doesn't support two-state icons :O

The save all icons feature is great.

Opening HDFs (or other hardfiles) would be good too--you could save a huge amount of icons all at the same time.

The program seems to be able to open disk images with other types of icons now, but still crashes under certain conditions. Not sure why.
Title: Re: ADF Viewer/Manager for macOS
Post by: guest6931 on January 14, 2017, 02:28:51 PM
Something else that might be useful for someone:

Saving icons as two-state pngs.  From what I remember, writing the two pngs to one file is sufficient. (even catting them seems to work)

This is the png style used by AROS and MorphOS.
Title: Re: ADF Viewer/Manager for macOS
Post by: bloodline on January 14, 2017, 02:38:45 PM
Quote from: Jason___;819711
An option to save only the unclicked state would be useful, especially since OSX doesn't support two-state icons :O

The save all icons feature is great.

Opening HDFs (or other hardfiles) would be good too--you could save a huge amount of icons all at the same time.

The program seems to be able to open disk images with other types of icons now, but still crashes under certain conditions. Not sure why.


if an ADF crashes the App, then email it to punysupport@gmail.com so I can examine it an figure out what is going wrong.

Hardfiles shouldn't be too difficult to add.
Title: Re: ADF Viewer/Manager for macOS
Post by: bloodline on January 14, 2017, 10:19:33 PM
Jason, do you have a link to a known good HDF file, I can't seem to get UAE to work with any.
Title: Re: ADF Viewer/Manager for macOS
Post by: Acill on January 15, 2017, 07:02:41 AM
Seems I cant find any way to view files with no icons on an ADF? Is this missing or am I just not finding the option?
Title: Re: ADF Viewer/Manager for macOS
Post by: bloodline on January 15, 2017, 10:39:19 AM
Quote from: Acill;819756
Seems I cant find any way to view files with no icons on an ADF? Is this missing or am I just not finding the option?


I'm working on adding a "Show All Files" option, which will be useful when I activate the rest of the disk operations.
Title: Re: ADF Viewer/Manager for macOS
Post by: bloodline on January 24, 2017, 11:42:17 AM
I have rewritten the actual ADF code, as my old code (written well over 5 years ago) made too many assumptions and optimisations to allow it to read High Density ADF and HDF files.

It has been quite an intensive rewrite (reading/writing amiga disks/files is a byte swapping nightmare), but should allow access to real amiga formatted hard disks in the future too! But will now work even if the disk doesn't have an icon (i.e. no disk.info file).

This has also allowed me to change the oldest supported macOS to 10.10 (Yosemite).

Please email me a disk image if it doesn't work, so I can make my code support it.

I will now try to get the "Show All Files" option working :)

https://drive.google.com/file/d/0B3CMG5yqFK4janJFaS1CUFRFek0/view?usp=sharing

Ultimately this app should become an ADFOpus for macOS.
Title: Re: ADF Viewer/Manager for macOS
Post by: bloodline on January 24, 2017, 09:54:26 PM
"Show All Files" now works, but needs to be activated on a per disk basis in the "Amiga Disk Files" menu :)
Title: Re: ADF Viewer/Manager for macOS
Post by: bloodline on January 28, 2017, 01:40:56 PM
It's been a while coming, but right clicking on an icon now gives the option to save the file to your Mac hard drive, ideal for recovering files from old ADF/HDF.

I will add a menu option to save all files to your Mac in one go.

Other bug fixes and under-the-hood improvements have been made as well.

-edit- I will activate writing to the ADF/HDF files once I can be sure that it doesn't corrupt the disk :)
Title: Re: ADF Viewer/Manager for macOS
Post by: golem on January 28, 2017, 09:10:43 PM
Thanks bloodline. I've downloaded and will give this a shot. Always interested in more modern ways to back up my aging Amigas.
Title: Re: ADF Viewer/Manager for macOS
Post by: nicholas on January 29, 2017, 06:12:45 PM
Nice work Matt!

Does it only support OFS/FFS at the moment?

SFS and PFS3 might be useful additions for HDF or even physical drive reading in the future.
Title: Re: ADF Viewer/Manager for macOS
Post by: bloodline on January 29, 2017, 07:49:48 PM
Quote from: nicholas;821034
Nice work Matt!

Does it only support OFS/FFS at the moment?

SFS and PFS3 might be useful additions for HDF or even physical drive reading in the future.
Hey Nick, yeah just OFS/FFS as I don't have any SFS or PFS disk images to test.

I want to add real drive access later too.

Once all that works, I'll see about supporting other file systems.

To be honest the real fun is making a "workbench" clone to access them... there is also a 68k emulator in there too... just not doing anything at the moment :)
Title: Re: ADF Viewer/Manager for macOS
Post by: nyteschayde on January 30, 2017, 12:31:36 AM
Quote from: bloodline;821039
Hey Nick, yeah just OFS/FFS as I don't have any SFS or PFS disk images to test.

I want to add real drive access later too.

Once all that works, I'll see about supporting other file systems.

To be honest the real fun is making a "workbench" clone to access them... there is also a 68k emulator in there too... just not doing anything at the moment :)


Are you going to put the source on GitHub or some other public place. I understand if you might not want to, but learning is awesome. I'd love to see how you did all this.

I can't wait to download a build and try it out.
Title: Re: ADF Viewer/Manager for macOS
Post by: nicholas on January 30, 2017, 01:29:39 AM
Quote from: bloodline;821039
Hey Nick, yeah just OFS/FFS as I don't have any SFS or PFS disk images to test.

I want to add real drive access later too.

Once all that works, I'll see about supporting other file systems.

To be honest the real fun is making a "workbench" clone to access them... there is also a 68k emulator in there too... just not doing anything at the moment :)


I was actually wondering if you'd done it that way so you could use the actual 68k filesystem handlers.  Well done,  I'm impressed.  :)

I've not got a working Intel Mac anymore so I can't have a play with it sadly.   Maybe I should build a Hackintosh.
Title: Re: ADF Viewer/Manager for macOS
Post by: bloodline on January 30, 2017, 09:38:00 AM
Quote from: nyteschayde;821051
Are you going to put the source on GitHub or some other public place. I understand if you might not want to, but learning is awesome. I'd love to see how you did all this.

I can't wait to download a build and try it out.

Hey there,
 
 I don't want to release the code in its current state, some of it is 6 years old and written before I properly understood the Appkit and Cocoa... I'm still not sure why some of it works (the .info icon reading code really shouldn't work), so I simply won't be able to support it :(
 
 I am rewriting as I add more features, and when the code looks better I will share it :)
 
 I'm replacing a lot of target/action patterned sections with closures.
 
 Little easter-egg for you; if you run ADFBench from the terminal, it dumps out all my debugging printf()s as it runs... some of my statements are simply embarrassing, others give a fascinating insight into my state of mind.
Title: Re: ADF Viewer/Manager for macOS
Post by: bloodline on January 30, 2017, 09:47:06 AM
Quote from: nicholas;821059
I was actually wondering if you'd done it that way so you could use the actual 68k filesystem handlers. Well done, I'm impressed. :)


The 68K emulator was originally included to run any 68k embedded into the files system (the first 1024bytes of a floppy etc...), and I guessed it might be able to avoid endianess issues... But, in ther end I didn't need it... Then I found Lallafa's blog about running Amiga executable files, so now I'm trying to figure out the Amiga Hunk format, once I do that I'll let the 68k run it :hammer: see what happens.
 
 Anyone who wants to work with me on this part is welcome :)
 

Quote

I've not got a working Intel Mac anymore so I can't have a play with it sadly. Maybe I should build a Hackintosh.
I recently built a 32gb RAM, 4Ghz Skylake i7 Hackintosh (with two 28" 4K monitors)... best thing I ever did.
Title: Re: ADF Viewer/Manager for macOS
Post by: nicholas on January 30, 2017, 01:44:47 PM
Quote from: bloodline;821083
The 68K emulator was originally included to run any 68k embedded into the files system (the first 1024bytes of a floppy etc...), and I guessed it might be able to avoid endianess issues... But, in ther end I didn't need it... Then I found Lallafa's blog about running Amiga executable files, so now I'm trying to figure out the Amiga Hunk format, once I do that I'll let the 68k run it :hammer: see what happens.
 
 Anyone who wants to work with me on this part is welcome :)
 

I recently built a 32gb RAM, 4Ghz Skylake i7 Hackintosh (with two 28" 4K monitors)... best thing I ever did.


I'm looking to get a new workstation for music. Was thinking about buying a second hand xeon server with at least 8 cores plus hyperthreading. Dunno whether osx would support one but it's worth a shot.

If I get one up and running I might just have to see if I can help you at all.  :)
Title: Re: ADF Viewer/Manager for macOS
Post by: bloodline on January 30, 2017, 03:43:48 PM
Quote from: nicholas;821092
I'm looking to get a new workstation for music. Was thinking about buying a second hand xeon server with at least 8 cores plus hyperthreading. Dunno whether osx would support one but it's worth a shot.

OSX Sierra certainly does support the Xeon, check out https://www.tonymacx86.com/ for full list of hardware.

My own specs are:
intel Skylake 6700k i7 4Ghz CPU
GA-Z170X-UD5 TH Motherboard
32Gb DDR4 2400Mhz RAM
2x nVidia GTX950 GFX cards
1TB SATA SSD
Zoom UAC-2 USB3 Audio interface
2x AOC 28" UHD 4K monitors

I cheaped out a bit on the RAM.

Quote
If I get one up and running I might just have to see if I can help you at all. :)
Let me know, this should be fun!
Title: Re: ADF Viewer/Manager for macOS
Post by: bloodline on February 01, 2017, 08:55:28 AM
Quote from: bloodline;820987
It's been a while coming, but right clicking on an icon now gives the option to save the file to your Mac hard drive, ideal for recovering files from old ADF/HDF.

I will add a menu option to save all files to your Mac in one go.

"Save All Files" now works and doesn't miss files located down the hash_chain ( :furious: ).

This option will create a folder (wherever you want) called the same as the volume name, and then populate it with the files and folders from your ADF/HDF (at the moment, file attributes aren't retained, like creation date, etc... not vital, but I hope to add that).
 
 -edit- international characters are now properly handled too... that took a bit of work :laugh1:
Title: Re: ADF Viewer/Manager for macOS
Post by: nyteschayde on October 12, 2017, 10:50:50 PM
Is the code you use for interacting with ADF files on the macOS portable? Can I use it in an app of my own? Got a github repo for this?
Title: Re: ADF Viewer/Manager for macOS
Post by: bloodline on October 13, 2017, 11:00:41 PM
Quote from: nyteschayde;831688
Is the code you use for interacting with ADF files on the macOS portable? Can I use it in an app of my own? Got a github repo for this?

It's written in Objective-C (with some swift, I code much faster in Obj-C)... is that any good?

-edit-
Actually looking over the code, I can think of better approach than the one I used in the program. If I get time perhaps I could rewrite it in C++ which would be far more portable.
Title: Re: ADF Viewer/Manager for macOS
Post by: nyteschayde on October 14, 2017, 12:09:40 AM
Quote from: bloodline;831719
It's written in Objective-C (with some swift, I code much faster in Obj-C)... is that any good?

-edit-
Actually looking over the code, I can think of better approach than the one I used in the program. If I get time perhaps I could rewrite it in C++ which would be far more portable.


Objective C is more than fine. As is swift or C++
Title: Re: ADF Viewer/Manager for macOS
Post by: bloodline on October 14, 2017, 01:22:51 PM
Quote from: nyteschayde;831726
Objective C is more than fine. As is swift or C++


I would love to help out! I have replied to your personal message :)