Page 1 of 1

.adf extraction

Posted: Sun Dec 12, 2010 8:05 pm
by AndyF
I was just wondering, as although I can do this the long way around (by writing the .adf image out on a PC disc using omniflop, but I've got a few to do and it takes ages to do it this way) , is there a tool I can use to build a disc image in its native environment ? :)

Basically, stick the .adf as-is onto a floppy disk, drag it onto my Archi hard drive and then run said tool to 'build' a floppy and / or extract its files ?

I have not tried it yet, but I do not expect SparkPlug will be able to extract data from an .adf, unless I've missed something obvious :oops: , the images work fine on an emulator but they would be more at 'home' I think on a real machine.

Doing it on a PC takes ages, so in its native environment aka Risc OS, it would be better. I looked at the tools JGH has on his site, but am unsure what I actually need.

Re: .adf extraction

Posted: Mon Dec 13, 2010 5:30 pm
by tautology
IIRC you can use SWI ADFS_DiscOp to read the whole disc into memory - I used to use this to erm... backup my discs of Axis.

I do have a utility that I wrote which basically did this; unfortunately it's only on the Arc in the loft, which would require a couple of days to extract the data from it (as I'd have to let it come up to room temperature.

Edit: a quick search on the Interwebs showed me:
Entry: R1 = 1 to read, 2 to write
R2 = disc address (0-819200)
R3 = memory address of data to read / write
R4 = number of bytes to read / write
So you can probably do (from BASIC):

Code: Select all

SYS "ADFS_DiscOp",1,0,&8000,819200
*SAVE image.adfs 8000 +C8000
You may have to mess around with this to get to work; or break it into blocks (as IIRC BASIC can't handle 800k memory chunks - it's been a long time since I last programmed in it).

Re: .adf extraction

Posted: Mon Dec 13, 2010 9:23 pm
by regregex
Well Basic won't work if you land the disc image on top of it like that #-o Ask Basic nicely where to put 800k of stuff and it'll point you to the bottom of the garden or anywhere else that's not right on top of the house:

Code: Select all

discsize=819200
DIM discbuffer discsize
SYS "ADFS_DiscOp",1,0,discbuffer,discsize
OSCLI "SAVE image.adfs "+STR$~discbuffer+" +"+STR$~discsize
(Been pushing ANSI C around all week, can't you tell?)

--Greg

Re: .adf extraction

Posted: Mon Dec 13, 2010 10:01 pm
by tautology
Or use the SWI calls to grab some heap. I couldn't get a DIM working for any more than 600K in red squirrel/arculator and couldn't be bothered to look any deeper.

Re: .adf extraction

Posted: Tue Dec 14, 2010 2:18 pm
by AndyF
:D

I think that's all too complicated for a 32bit newbie, to give you an 'idea' , I only discovered the shift double click a couple of days ago :oops: :oops: :oops:

But thanks anyway :) , appreciated. I will have to see what I can do. Surprised there is not a tool actually.

Wonder if ADFS Explorer would work to 'xfer' across the way you can do the 8 bit images quite easily :-k , guess it depends if xfer.bas will run 'as is' on the archie.

Re: .adf extraction

Posted: Thu Dec 16, 2010 3:19 pm
by AndyF
After a bit of a search around, I found this, although I've not tested it yet:
Make sure your disc is formatted ADFS 800k (D), open up a command prompt and type the following.

*BASIC
>END=&1A0000
>DIM buf% 1600*1024

For each floppy image:
>SYS "OS_File",16,"image/adf",buf% TO ,,,,L%
>SYS "ADFS_DiscOp",,2,0,buf%,L%

Eject the disc, put it back in and it should have the correct files on it.

If the disc image is 1600k then do the same with a ADFS 1.6Mb formatted disc, but Dismount it before attempting to open it.

Re: .adf extraction

Posted: Thu Dec 16, 2010 4:20 pm
by AndyF
Seems to work =D>

Well, Elite did, Lander did not but I've put that down to Lander. Will test with some free demo adf's to confirm but looks good.

I should turn that into a quick basic program or something with an input field so I can save time. It is case-sensitive though (the File DiscOp wording) which initially caught me out.

Re: .adf extraction

Posted: Sun Dec 19, 2010 7:07 pm
by frankoid
Here's a little RISC OS desktop proggy that I use to read/write floppy disc images. Sorry I didn't post earlier, could have saved you some time...

By Richard Terry with modifications by me. Version history:

Code: Select all

1.00: First release. Loads image file (up to 800k)
      into memory and writes it to a disk
1.01: Reads and writes 100k blocks. In theory,
      no disk limit, and now wimpslots at 128k.
1.11: Write disk images. Rename from !Deimager
1.12: Modification by Francis Devereux (francis@devrx.org):
      Uses OS_GBPB instead of BGET and BPUT to read/write files to increase speed
      Dismounts drive 0 after writing image (failure to do this was causing hangs when clicking on the :0 icon bar icon on my RISC OS 3.60 RiscPC)

Re: .adf extraction

Posted: Sun Dec 19, 2010 7:44 pm
by AndyF
Thank you :)

I'll have a play with that when I get a bit of time over Christmas, much busy at the moment :(

Re: .adf extraction

Posted: Mon Dec 20, 2010 7:28 pm
by jgharston
is there a tool I can use to build a disc image in its native environment ? :)
Basically, stick the .adf as-is onto a floppy disk, drag it onto my Archi hard drive and then run said tool to 'build' a floppy and / or extract its files ?
You mean unbuild a disk image.

BeebArc at http://mdfs.net/Apps/FileUtils will extract files from an ADFS disk image.

Re: .adf extraction

Posted: Mon Dec 20, 2010 8:10 pm
by AndyF
Thanks :)

At the moment (as above, that quick bit of basic does work although a bit long winded, its a lot quicker than omniflop though, and more reliable)

I simply end up with some adf files on my Archi hard drive and then use that to extract them.

They are not .zips, they are just blah.adf :) , but I see what you mean now with beebarc now I have (re-read) the description.

I'll have a play with that over Christmas. I did have a quick glance around your site but was not really sure what I needed.