robmcmullen / atrcopy

Command line utility to manage file systems on Atari 8-bit and Apple ][ disk images.
Mozilla Public License 2.0
24 stars 8 forks source link

Support DCM images #1

Open robmcmullen opened 8 years ago

robmcmullen commented 8 years ago

Currently, atrcopy only identifies DCM images but does not support actually unpacking them. This would be a good first issue for someone to tackle: it's all stubbed out in dcm.py, so all that needs to be done is the actual file parsing and unpacking. :smile:

I have not been able to find a text description of the file format, but I have found some source code examples:

I'm sure I'll get to it eventually, but if you have the desire I will happily accept pull requests!

robmcmullen commented 6 years ago

@ChoccyHobNob try atrcopy 8.0; it should now at least recognize DCM images, even if it doesn't do anything with them.

I stubbed out DCM support in the code, so maybe someone will be able to get to it before I can.

a8bit commented 6 years ago

I tried atrcopy on every format acvt supports, here are the results.

» ChoccyBook:atrfilestest >atrcopy 5-dos.atr  
5-dos.atr: ATR Disk Image (size=92160 (720x128B), crc=0 flags=0 unused=0) Atari DOS Format: 707 usable sectors (2 free), 21 files
File #0  (.2.u.*) 004 DOS     SYS  039
File #1  (.2.u.*) 043 DUP     SYS  042
File #2  (.2.u.*) 085 AUTORUN SYS  002
File #3  (.2.u.*) 087 TITLE        009
File #4  (.2.u.*) 096 MENU         044
File #5  (.2.u.*) 138 MYRIA        107
File #6  (.2.u.*) 245 CLEWSO       048
File #7  (.2.u.*) 293 CIVILWAR     072
File #8  (.2.u.*) 374 LUNAR        070
File #9  (.2.u.*) 444 MASTMIND     034
File #10 (.2.u.*) 478 SPIRALS      011
File #11 (.2.u.*) 489 CONCENTR     038
File #12 (.2.u.*) 529 LOGO         016
File #13 (.2.u.*) 545 SHELL        008
File #14 (.2.u.*) 553 BALL         009
File #15 (.2.u.*) 562 CONE         006
File #16 (.2.u.*) 568 DIZZY        017
File #17 (.2.u.*) 585 MUNCHERS     045
File #18 (.2.u.*) 630 PACDEMO      021
File #19 (.2.u.*) 651 EGGS         052
File #20 (.2.u.*) 703 COLOURS      015
» ChoccyBook:atrfilestest >atrcopy 5-dos.dcm
5-dos.dcm: DCM archives are not yet supported
ERROR:atrcopy:Invalid disk image: 5-dos.dcm
» ChoccyBook:atrfilestest >atrcopy 5-dos.di 
5-dos.di: BSAVE data $4944-$4b64 ($0220 @ $0004)

» ChoccyBook:atrfilestest >atrcopy 5-dos.scp
5-dos.scp: BSAVE data $fdfd-$1267d ($2880 @ $0004)

» ChoccyBook:atrfilestest >atrcopy 5-dos.xfd
5-dos.xfd: XFD Disk Image (size=92160 (720x128B) Atari DOS Format: 707 usable sectors (2 free), 21 files
File #0  (.2.u.*) 004 DOS     SYS  039
File #1  (.2.u.*) 043 DUP     SYS  042
File #2  (.2.u.*) 085 AUTORUN SYS  002
File #3  (.2.u.*) 087 TITLE        009
File #4  (.2.u.*) 096 MENU         044
File #5  (.2.u.*) 138 MYRIA        107
File #6  (.2.u.*) 245 CLEWSO       048
File #7  (.2.u.*) 293 CIVILWAR     072
File #8  (.2.u.*) 374 LUNAR        070
File #9  (.2.u.*) 444 MASTMIND     034
File #10 (.2.u.*) 478 SPIRALS      011
File #11 (.2.u.*) 489 CONCENTR     038
File #12 (.2.u.*) 529 LOGO         016
File #13 (.2.u.*) 545 SHELL        008
File #14 (.2.u.*) 553 BALL         009
File #15 (.2.u.*) 562 CONE         006
File #16 (.2.u.*) 568 DIZZY        017
File #17 (.2.u.*) 585 MUNCHERS     045
File #18 (.2.u.*) 630 PACDEMO      021
File #19 (.2.u.*) 651 EGGS         052
File #20 (.2.u.*) 703 COLOURS      015
» ChoccyBook:atrfilestest >atrcopy 4-sd.atr 
4-sd.atr: ATR Disk Image (size=92160 (720x128B), crc=0 flags=1 unused=0) Sparta DOS Format: 720 usable sectors (8 free), 32 files
File #1  (..u.  032) X32D    DOS     12890  7/10/85 15:47:24
File #2  (..u.  135) AT_RS232COM      1863  12/2/85 18:38:38
File #3  (..u.  151) AUTOBAT COM       268  20/11/85 16:55:42
File #4  (..u.  155) BYPASS  COM       379  20/11/85 13:37:31
File #5  (..u.  159) CHTD    COM       929  21/10/85 15:50:51
File #6  (..u.  168) CHVOL   COM       453  24/2/85 18:16:17
File #7  (..u.  173) DUMP    COM      1033  13/2/85 12:6:56
File #8  (..u.  183) DUPDSK  COM      2187  13/2/85 11:41:4
File #9  (..u.  202) HDINIT  COM      1500  19/11/85 14:56:50
File #10 (..u.  215) MDUMP   COM       813  13/2/85 13:1:3
File #11 (..u.  223) MENU    COM      7728  5/4/85 17:57:7
File #12 (..u.  285) MENU    HLP      6656  10/3/85 16:48:52
File #13 (..u.  338) OFF_LOADCOM      2061  13/2/85 14:59:15
File #14 (..u.  356) PORT    COM       491  13/2/85 12:5:22
File #15 (..u.  361) P_4800  RC          2  10/10/84 10:13:43
File #16 (..u.  363) PUTRUN  COM       589  6/4/85 15:45:3
File #17 (..u.  369) RD      COM      1799  14/7/86 10:6:1
File #18 (..u.  385) RD260   COM       924  3/9/85 11:23:51
File #19 (..u.  394) RDBASIC COM       760  10/3/85 11:21:47
File #20 (..u.  401) RPM     COM       691  6/6/85 9:6:7
File #21 (..u.  408) RS232   COM       127  13/2/85 12:7:10
File #22 (..u.  410) SCOPY   COM      3594  16/9/86 13:42:31
File #23 (..u.  440) SPRINT  COM       756  16/1/86 16:12:40
File #24 (..u.  447) SPRINT  DOC       546  30/1/86 20:37:18
File #25 (..u.  453) TDLINE  COM      1376  23/10/85 20:20:26
File #26 (..u.  465) TREE    COM       975  12/2/85 18:41:30
File #27 (..u.  474) UNERASE COM      1537  13/2/85 15:33:36
File #28 (..u.  488) XCOPY   COM      4467  8/7/85 22:50:7
File #29 (..u.  524) XINIT   COM      2955  13/2/85 11:40:9
File #30 (..u.  549) XC23E   DOS     10778  1/11/85 10:35:12
File #31 (..u.  636) XD23E   DOS     10754  1/11/85 10:33:49
File #32 (..u.  015) ZHAND   COM       857  1/11/85 10:51:25
» ChoccyBook:atrfilestest >acvt -xfd 4-sd.atr 
Acvt v1.07 (c) 2000-2001 Jindrich Kubec <kubecj@asw.cz>
Input file '4-sd.atr' (ATR)
Output file '4-sd.xfd' (XFD)
Done.
» ChoccyBook:atrfilestest >atrcopy 4-sd.xfd  
4-sd.xfd: XFD Disk Image (size=92160 (720x128B) Sparta DOS Format: 720 usable sectors (8 free), 32 files
File #1  (..u.  032) X32D    DOS     12890  7/10/85 15:47:24
File #2  (..u.  135) AT_RS232COM      1863  12/2/85 18:38:38
File #3  (..u.  151) AUTOBAT COM       268  20/11/85 16:55:42
File #4  (..u.  155) BYPASS  COM       379  20/11/85 13:37:31
File #5  (..u.  159) CHTD    COM       929  21/10/85 15:50:51
File #6  (..u.  168) CHVOL   COM       453  24/2/85 18:16:17
File #7  (..u.  173) DUMP    COM      1033  13/2/85 12:6:56
File #8  (..u.  183) DUPDSK  COM      2187  13/2/85 11:41:4
File #9  (..u.  202) HDINIT  COM      1500  19/11/85 14:56:50
File #10 (..u.  215) MDUMP   COM       813  13/2/85 13:1:3
File #11 (..u.  223) MENU    COM      7728  5/4/85 17:57:7
File #12 (..u.  285) MENU    HLP      6656  10/3/85 16:48:52
File #13 (..u.  338) OFF_LOADCOM      2061  13/2/85 14:59:15
File #14 (..u.  356) PORT    COM       491  13/2/85 12:5:22
File #15 (..u.  361) P_4800  RC          2  10/10/84 10:13:43
File #16 (..u.  363) PUTRUN  COM       589  6/4/85 15:45:3
File #17 (..u.  369) RD      COM      1799  14/7/86 10:6:1
File #18 (..u.  385) RD260   COM       924  3/9/85 11:23:51
File #19 (..u.  394) RDBASIC COM       760  10/3/85 11:21:47
File #20 (..u.  401) RPM     COM       691  6/6/85 9:6:7
File #21 (..u.  408) RS232   COM       127  13/2/85 12:7:10
File #22 (..u.  410) SCOPY   COM      3594  16/9/86 13:42:31
File #23 (..u.  440) SPRINT  COM       756  16/1/86 16:12:40
File #24 (..u.  447) SPRINT  DOC       546  30/1/86 20:37:18
File #25 (..u.  453) TDLINE  COM      1376  23/10/85 20:20:26
File #26 (..u.  465) TREE    COM       975  12/2/85 18:41:30
File #27 (..u.  474) UNERASE COM      1537  13/2/85 15:33:36
File #28 (..u.  488) XCOPY   COM      4467  8/7/85 22:50:7
File #29 (..u.  524) XINIT   COM      2955  13/2/85 11:40:9
File #30 (..u.  549) XC23E   DOS     10778  1/11/85 10:35:12
File #31 (..u.  636) XD23E   DOS     10754  1/11/85 10:33:49
File #32 (..u.  015) ZHAND   COM       857  1/11/85 10:51:25
» ChoccyBook:atrfilestest >
a8bit commented 6 years ago

I've noticed you detect some disks as DOS format even when they don't meet the requirements in Ken Siders DOS documentation. For example the Homesoft disks are identified as DOS disks even though in the boot sector btJMP is 0xa2 not 0x4c

Mr. Robot and His Robot Factory (1983)(Datamost)(US)[t +1] is id'd as DOS formatted even though the boot sector is completely different to Kens docs

btUnused      0x0
btLoadSectors 0x80
wBootLoadAddr 0x1fd3
wInitAddr     0x7f52
btJMP         0xad
wJMPAddr      0x2000
btMaxOpen     0xee
btDriveBits   0xda

You are correct, these disks are DOS formatted and have files on them that can be extracted.

What criteria do you use to decide a disk is DOS formatted?

robmcmullen commented 6 years ago

I hadn't heard of acvt before, then noticed you have it in your github page. A couple things I noticed from your list:

The Ken Siders page and Mapping the Atari show the btJMP/JMPXBCONT as a JMP. But, apparently $706 doesn't actually have to be a JMP instruction, the boot process jumps to $706 which by DOS standards is another JMP, but as long as it's valid assembly code, it will continue the boot process. It seems like some disks ignore the DOS params between $709 and $714 and just start their boot code at $706.

I look for the number of sectors to load and the load address, and if they're sane (i.e. don't cause sectors to load beyond the end of ram at $bfff) I ignore everything else and assume it would actually boot.

As for it being a DOS disk, in addition to the boot disk check, I look at the VTOC sector and see if the number of VTOC sectors and its location make sense.

robmcmullen commented 6 years ago

Try version 8.1. It should be better about the BSAVE stuff

a8bit commented 6 years ago

acvt is one of the old jindroush utilities, I got it from here https://www.atarimax.com/jindroush.atari.org/asoft.html after finding mention of it here http://atariage.com/forums/topic/234141-dcm-atr-utility-for-macos/ I just got it to build on the mac

SCP is a SpartaDOS SCOPY image. I have a few of these, they aren't very common nowadays. DI is from some 800 emulator/sio transfer app for the Atari ST. I only have a few of these, I had to hunt to find them. Not supporting them in atrcopy won't be noticed!

I wouldn't be too strict about identifying non dos disks, the ones you ident that aren't strictly dos do seem to have a directory structure and do have files on them that we can query/extract. Maybe just describe them as "custom bootloader" or something like that?

I figured it was something like checking if it has a boot address and looking for a valid VTOC, I am messing around with trying to get more info out of atari files and I'm not looking at the VTOC in adfs yet so I haven't started trying to parse it.