Torch CPN utilities

discuss PC<>Acorn file transfer issues & the use of FDC, XFER, Omniflop/disk etc.
User avatar
danielj
Posts: 5135
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester

Torch CPN utilities

Postby danielj » Thu Aug 22, 2013 9:57 am

This is potentially useful(ish) now...

I'm putting together a wee java utility to extract files from Torch disc images and also to create them.

It's a funny old format... I know it's been claimed that there are no "interleaved" 8 bit formats (i.e. track 0 side 0 -> track 0 side 1 etc, etc), but the Torch format is just that, data spilling from one side to the other before shifting track.

It's not in any way finished, but there is now a useful class "DiskImage" which is capable of extracting files from an image. It should soon be capable of creating an image from a directory. The "main" program at the moment lies in TestClass.java and it really is just that, a wrapper around my other classes for testing them (no, I've never heard of unit testing, shhh.). Documentation is sparse but the code shouldn't be too hard to understand with a copy of the CPN disk structure in hand.

Still, without further ado:
https://github.com/drdpj/TorchCPN

Please ask if any questions!

d.

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

Re: Torch CPN utilities

Postby jgharston » Thu Aug 22, 2013 6:05 pm

danielj wrote:Still, without further ado:
https://github.com/drdpj/TorchCPN
CPMFiler does the equivalent on BBC/RISC OS/Windows (Win=images only). And yes, fiddlying out the CPN disk structure was fiddly, even with the documentation.

Code: Select all

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

User avatar
danielj
Posts: 5135
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester

Re: Torch CPN utilities

Postby danielj » Thu Aug 22, 2013 6:14 pm

jgharston wrote:
danielj wrote:Still, without further ado:
https://github.com/drdpj/TorchCPN
CPMFiler does the equivalent on BBC/RISC OS/Windows (Win=images only). And yes, fiddlying out the CPN disk structure was fiddly, even with the documentation.


Indeed, it's a great little utility, unfortunately it didn't let me write to images and I'm mostly mac/unix based when creating CPN discs from individual files I've downloaded from the internet all methods available involved either lots of disc swapping or lots of pen-drive swapping or both.

Once this is done you should be able to do something along the lines of:

Code: Select all

java -jar cpnutil.jar <directory>
and out will pop a dirname.dsd file that can be written to disk directly via UPURS or datacentre.

That's the theory anyway... :D

d.

User avatar
MartinB
Posts: 4511
Joined: Mon Mar 31, 2008 9:04 pm
Location: Obscurity

Re: Torch CPN utilities

Postby MartinB » Thu Aug 22, 2013 7:27 pm

Daniel wrote:...that can be written to disk directly via UPURS...
Ok Daniel, you've finally got the job - you're head of sales =D>

User avatar
danielj
Posts: 5135
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester

Re: Torch CPN utilities

Postby danielj » Thu Aug 22, 2013 8:30 pm

MartinB wrote:Ok Daniel, you've finally got the job - you're head of sales =D>


Do I get a badge? [-o<

d.

User avatar
MartinB
Posts: 4511
Joined: Mon Mar 31, 2008 9:04 pm
Location: Obscurity

Re: Torch CPN utilities

Postby MartinB » Thu Aug 22, 2013 8:55 pm

Better than that, you get a T-Shirt with UPURS across the front and a picture of naked Austrian eBay guy on the back :D

User avatar
danielj
Posts: 5135
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester

Re: Torch CPN utilities

Postby danielj » Thu Aug 22, 2013 9:03 pm

MartinB wrote:Better than that, you get a T-Shirt with UPURS across the front and a picture of naked Austrian eBay guy on the back :D


Brilliant. I think I'll last approximately 13.2 seconds on the mean streets of the Manchester wearing that.

d.

User avatar
danielj
Posts: 5135
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester

Re: Torch CPN utilities

Postby danielj » Sat Aug 24, 2013 8:07 pm

Right, the DiskImage class now allows the adding of files. I've made a complete pigs ear of the code, but it does work. It's about as elegant as me dancing Swan Lake.

I'll wrap this up in a command line utility as soon as I can work out what's actually meant to go in the 0:1:8 and 0:1:9 sectors :? 0:1:9 is particularly confusing - I think sector 8 is a standard pattern...

d.

Edit. Just for the record - it seems to always be set to &85 for any disc I write to, irrespective of number of files. I have a sneaking suspicion it relates to the version of MCP used to format it...

d.

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

Re: Torch CPN utilities

Postby jgharston » Sun Aug 25, 2013 11:14 pm

danielj wrote:Indeed, it's a great little utility, unfortunately it didn't let me write to images and I'm mostly mac/unix based when creating CPN discs from individual files
Yes, I've got MkImage creating DFS,ADFS,HADFS disk images, and tools to create various Spectrum file images (which also work on Windows), and skeleton code for CPM which I never finished as I tend to boot to use CPMFS on RISC OS to create images. Really should get around to finishing the code off, along with digging through ADFS/VFS, getting my C64 port finished, more work on PDP11 BASIC, updating the family tree indexes, finishing my Whitby maps.... ;) Oh, and finding somebody prepared to pay me to work.

danielj wrote:I'll wrap this up in a command line utility as soon as I can work out what's actually meant to go in the 0:1:8 and 0:1:9 sectors :? 0:1:9 is particularly confusing - I think sector 8 is a standard pattern...
All the disks I've examined have sector &18 going &D6,&D7...etc...&D4,&D5 and sector &19 filled with zeros and a non-zero byte at &FE. To get any further information I think I'd have to dig through the CPN code itself and see what it actually does with the contents there.

Code: Select all

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

User avatar
danielj
Posts: 5135
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester

Re: Torch CPN utilities

Postby danielj » Mon Aug 26, 2013 6:42 am

jgharston wrote:Really should get around to finishing the code off, along with digging through ADFS/VFS, getting my C64 port finished, more work on PDP11 BASIC, updating the family tree indexes, finishing my Whitby maps.... ;) Oh, and finding somebody prepared to pay me to work.


The curse of having a big hob :D

]All the disks I've examined have sector &18 going &D6,&D7...etc...&D4,&D5 and sector &19 filled with zeros and a non-zero byte at &FE. To get any further information I think I'd have to dig through the CPN code itself and see what it actually does with the contents there.


Thanks. Got that in now - it's a "Test pattern" apparently?! I'm going to stick with 0x85 for now in sector &19 and see what happens. It's mostly working now, it just seems to be getting something wrong either with block allocation or counting the number of used blocks - I can now create disks with valid directories and allocation maps, it's just that I've just got trunkated files even though all the data's on the disc...

Interesting to note, CPN discs formatted with CCCP1.02 and MCP1.22 seem to have the allocation map showing sectors on tracks beyond 79 as "available".

d.


Return to “software & utilities for the pc, mac or unix”

Who is online

Users browsing this forum: No registered users and 1 guest