.adf extraction

chat about arc/risc pc gaming & RISC OS software here (NOT the core OS!)Related forum: adventures


Post Reply
User avatar
AndyF
Posts: 1241
Joined: Sat Feb 23, 2008 10:16 pm
Location: Derby
Contact:

.adf extraction

Post by AndyF » Sun Dec 12, 2010 8:05 pm

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.
Andy

* NEW * The Jetset Willy and Manic Miner community :)

Adventure games ported across to the BBC (in progress) as soon as I can find some time!

User avatar
tautology
Posts: 388
Joined: Wed Sep 01, 2010 2:26 pm
Contact:

Re: .adf extraction

Post by tautology » Mon Dec 13, 2010 5:30 pm

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).

User avatar
regregex
Posts: 558
Joined: Sun Jan 02, 2005 9:51 pm
Location: London, UK
Contact:

Re: .adf extraction

Post by regregex » Mon Dec 13, 2010 9:23 pm

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

User avatar
tautology
Posts: 388
Joined: Wed Sep 01, 2010 2:26 pm
Contact:

Re: .adf extraction

Post by tautology » Mon Dec 13, 2010 10:01 pm

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.

User avatar
AndyF
Posts: 1241
Joined: Sat Feb 23, 2008 10:16 pm
Location: Derby
Contact:

Re: .adf extraction

Post by AndyF » Tue Dec 14, 2010 2:18 pm

: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.
Andy

* NEW * The Jetset Willy and Manic Miner community :)

Adventure games ported across to the BBC (in progress) as soon as I can find some time!

User avatar
AndyF
Posts: 1241
Joined: Sat Feb 23, 2008 10:16 pm
Location: Derby
Contact:

Re: .adf extraction

Post by AndyF » Thu Dec 16, 2010 3:19 pm

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.
Andy

* NEW * The Jetset Willy and Manic Miner community :)

Adventure games ported across to the BBC (in progress) as soon as I can find some time!

User avatar
AndyF
Posts: 1241
Joined: Sat Feb 23, 2008 10:16 pm
Location: Derby
Contact:

Re: .adf extraction

Post by AndyF » Thu Dec 16, 2010 4:20 pm

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.
Andy

* NEW * The Jetset Willy and Manic Miner community :)

Adventure games ported across to the BBC (in progress) as soon as I can find some time!

frankoid
Posts: 53
Joined: Wed Jan 10, 2007 9:18 am
Location: London
Contact:

Re: .adf extraction

Post by frankoid » Sun Dec 19, 2010 7:07 pm

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)
Attachments
DImager_112.zip
(8.58 KiB) Downloaded 268 times

User avatar
AndyF
Posts: 1241
Joined: Sat Feb 23, 2008 10:16 pm
Location: Derby
Contact:

Re: .adf extraction

Post by AndyF » Sun Dec 19, 2010 7:44 pm

Thank you :)

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

* NEW * The Jetset Willy and Manic Miner community :)

Adventure games ported across to the BBC (in progress) as soon as I can find some time!

User avatar
jgharston
Posts: 3569
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield
Contact:

Re: .adf extraction

Post by jgharston » Mon Dec 20, 2010 7:28 pm

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.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

User avatar
AndyF
Posts: 1241
Joined: Sat Feb 23, 2008 10:16 pm
Location: Derby
Contact:

Re: .adf extraction

Post by AndyF » Mon Dec 20, 2010 8:10 pm

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.
Andy

* NEW * The Jetset Willy and Manic Miner community :)

Adventure games ported across to the BBC (in progress) as soon as I can find some time!

Post Reply