Cadius

(C) 2011-2012 by Antoine VIGNAU and Olivier ZARDINI

> What is Cadius ?

Cadius is a command-line tool for Windows to manage Apple II image disk files (.2mg, .po, .hdv).

Cadius is part of the
Brutal Deluxe's Cross Developpement Tools Project, a full set of utilities available on Windows (and other) platforms to enable the creation of new Apple IIgs software : 65c816 Assembler, 65c816 Desassembler, 65c816 Simulator, Graphic File Converter, Resource Catcher...

The first purpose of Cadius is to write the output of the 65c816 Assembler directly into an Apple IIgs disk image (usually a .2mg) in order to quickly test the result, avoiding many keyboard & mouse manipulations.
Cadius may also manage Source Code files, by setting/cleaning the High Bit and formatting the Source Code to make it easy to read and edit in the Windows world.

Because Cadius may transfer files between Apple II Images disks and Windows hard drive, a new file format to preserve native Apple IIgs Resource Part and File Properties (including Macintosh Finder Info) has been developped. You can now transfer all your Apple II image disk content to your Windows PC hard drive and manage the files from there. As soon as you are ready, you can synchronized files in the other direction (PC to II disk image).


> Key Features

Disk Image Handling

- Creation of new Disk Image (any size, from 143 KB to 32 MB)
- Move / Rename / Delete any Files, Folders (including files located inside) or Volume.
- Catalog of Disk Image content :
  Name                Type   Aux      Size     Data     Res  Data   Res  Sparse Index  Struct  Access    Creation Date     Modification Date
/COGITO/
  Cogito              S16+  $0000    51279    50511     768    99    2      0     2     Fork   RWBND    20-May-1993 22:45   23-Sep-1994 15:29
  Finder.Data         FND   $0000      148      148       0     1    0      0     0     Seed   RWBNDH   30-Aug-1994 14:15   30-Aug-1994 14:15
  Lisez.Moi           GWP+  $5445     1373      849     524     2    2      0     2     Fork   RWBND    30-Aug-1994 14:12   30-Aug-1994 14:12
  Read.Me             GWP+  $5445     1296      772     524     2    2      0     2     Fork   RWBND    26-Aug-1994 11:24   30-Aug-1994 14:13
  Tool220             TOL   $0000     7745     7745       0    12    0      4     1     Sapl   RWBND    12-Nov-1991 19:00   17-Jan-1992 12:51
  /COGITO.DATAS/
    Cogito            BIN   $0000    26139    26139       0    52    0      0     1     Sapl   RWBND    22-Aug-1994 16:40   22-Aug-1994 16:40
    Finder.Data       FND   $0000      265      265       0     1    0      0     0     Seed   RWBNDH   26-Aug-1994 11:30   30-Aug-1994 14:15
    Happyland         BIN   $0000    10745    10745       0    21    0      0     1     Sapl   RWBND    12-Jun-1994 09:44   12-Jun-1994 09:44
    Ludyland          BIN   $0000    17087    17087       0    34    0      0     1     Sapl   RWBND    04-Jul-1994 23:39   04-Jul-1994 23:39
    Messages          BIN   $0000    14120    14120       0    28    0      0     1     Sapl   RWBND    22-Aug-1994 16:44   22-Aug-1994 16:44
    Music             BIN   $0000   120832   120832       0   234    0      2     1     Sapl   RWBND    05-Jul-1994 15:06   05-Jul-1994 15:06
    PlanetLast        BIN   $0000    10036    10036       0    20    0      0     1     Sapl   RWBND    23-Jun-1994 13:48   23-Jun-1994 13:48
    Sound.1           BIN   $0000    10491    10491       0    21    0      0     1     Sapl   RWBND    05-Apr-1993 15:31   05-Apr-1993 15:31
    Sound.2           BIN   $0000    60168    60168       0   118    0      0     1     Sapl   RWBND    05-Apr-1993 15:30   05-Apr-1993 15:30
    Sprites           BIN   $0000    13481    13481       0    27    0      0     1     Sapl   RWBND    22-Aug-1994 16:42   22-Aug-1994 16:42
    Superman          BIN   $0000    18993    18993       0    38    0      0     1     Sapl   RWBND    21-Aug-1994 16:31   21-Aug-1994 16:31
    Temp              CFG   $0000      340      340       0     1    0      0     0     Seed   RWBND    26-Aug-1994 11:40   26-Aug-1994 11:40
    Toinet            BIN   $0000    19600    19600       0    39    0      0     1     Sapl   RWBND    22-Aug-1994 16:29   22-Aug-1994 16:29
    XenoLast          BIN   $0000    17653    17653       0    35    0      0     1     Sapl   RWBND    23-Jun-1994 13:51   23-Jun-1994 13:51
  /ICONS/
    Cogito.Icon       ICN+  $0000     2862     2394     468     5    1      0     1     Fork   RWBND    18-Aug-1994 17:01   21-Aug-1994 16:02
    Finder.Data       FND   $0000       63       63       0     1    0      0     0     Seed   RWBNDH   26-Aug-1994 11:30   30-Aug-1994 14:15
            Block : 1600     Free : 768     File : 21     Directory : 2

Disk Image files transfer

The files available in the Cogito image disk (Cogito.2mg) : Cogito files in the .2mg file
     
are transfered to the PC hard drive, in a Folder named Cogito :

For each file having a Resource Part, a dedicated file is created (ending with _ResourceFork.bin suffix).

The file properties (creation / modification dates, Invisible flag) are mapped into the Windows world.

The other flags are kept into the _FileInformation.txt file (one per folder).
Cogito files on the PC

Source Code files conversion

Transfering Apple II Assembly source code to the PC gives you a flat file, hard to read : After the Cadius indent command, you source file is ready to be used :
*
* Start Olivier
*

INITMOUS LDA #$0000
 STA POSX
 STA POSY
 STA A1 ; INIT SOURIS
 STA AP
 JSR SAUV ; SAUVEGARDE DECOR
 JSR DESS

 LDY ptrMESSAGE+1 ; INIT ADRESSE EASTER EGGS
 STY EAEGSP1+2
 STY EAEGSP3+2
 STY EAEGSP4+2
 STY EAEGSP6+2

 LDA fgDOC ; INIT LANGUE
 BEQ INITMOU1
 LDA #TEXTEUSD ; ANGLAIS
 STA DOCADR
 LDA #TEXTEUSA
 STA ABOUADR
 LDA #$0008 ; 9 PAGES DE DOC
 STA ECR1012+1
 LDA #$0008 ; 9 PAGES DE ABOUT
 STA ECR1112+1
 BRA INITMOU2
INITMOU1 LDA #TEXTEFRD ; FRANCAIS
 STA DOCADR
 LDA #TEXTEFRA
 STA ABOUADR
 LDA #$0007 ; 8 PAGES DE DOC
 STA ECR1012+1
 LDA #$0007 ; 8 PAGES DE ABOUT
 STA ECR1112+1

INITMOU2 LDA #CADMMUF ; INIT MUSIC PATCH BUMPER : MUSIC
 STA ECR07DAT
 LDA #CADMSNC
 STA ECR07DAT+8

 JSR ECR08PATCH ; INIT GROUND PATCH BUMPER : RANDOM
 LDA #CADGRRAF
 STA ECR08DAT+32

 LDA #$0002
 JMP PICT ; IMAGE LUDY

 asc 'Tinies & Cogito, copyright CACAlisto',8d
 asc 'Atreid, Kalisto, Muad Dib... copyright Frank Herbert',8D
 asc 'Taken from the book Dune...',8d

*****************************************************************************
****************************  MOUSE MANAGER  ********************************
*****************************************************************************

SOURIS LDA BOUT ; ANCIEN BOUT=NOUVEAU BOUT
 STA BOUT1

SOURIS0 JSR SLECT ; LECTURE SOURIS
 CPY #$FFFF
 BEQ SECR ; DONNEES NON DISPONIBLES

SOURIS1 LDA A1 ; A1 POSITION ACTUELLE
 STA AP ; AP ANCIENNE POSITION
 LDA POSX
 LSR
 STA SOURIS2+1
 LDA POSY
 ASL
 TAX
 LDA TABLE,X
 CLC
SOURIS2 ADC #$0000 ; CALCUL DE A1 (160*POSY+POSX)
*
* Start Olivier
*

INITMOUS    LDA   #$0000
            STA   POSX
            STA   POSY
            STA   A1            ; INIT SOURIS
            STA   AP
            JSR   SAUV          ; SAUVEGARDE DECOR
            JSR   DESS

            LDY   ptrMESSAGE+1  ; INIT ADRESSE EASTER EGGS
            STY   EAEGSP1+2
            STY   EAEGSP3+2
            STY   EAEGSP4+2
            STY   EAEGSP6+2

            LDA   fgDOC         ; INIT LANGUE
            BEQ   INITMOU1
            LDA   #TEXTEUSD     ; ANGLAIS
            STA   DOCADR
            LDA   #TEXTEUSA
            STA   ABOUADR
            LDA   #$0008        ; 9 PAGES DE DOC
            STA   ECR1012+1
            LDA   #$0008        ; 9 PAGES DE ABOUT
            STA   ECR1112+1
            BRA   INITMOU2
INITMOU1    LDA   #TEXTEFRD     ; FRANCAIS
            STA   DOCADR
            LDA   #TEXTEFRA
            STA   ABOUADR
            LDA   #$0007        ; 8 PAGES DE DOC
            STA   ECR1012+1
            LDA   #$0007        ; 8 PAGES DE ABOUT
            STA   ECR1112+1

INITMOU2    LDA   #CADMMUF      ; INIT MUSIC PATCH BUMPER : MUSIC
            STA   ECR07DAT
            LDA   #CADMSNC
            STA   ECR07DAT+8

            JSR   ECR08PATCH    ; INIT GROUND PATCH BUMPER : RANDOM
            LDA   #CADGRRAF
            STA   ECR08DAT+32

            LDA   #$0002
            JMP   PICT          ; IMAGE LUDY

            asc   'Tinies & Cogito, copyright CACAlisto',8d
            asc   'Atreid, Kalisto, Muad Dib... copyright Frank Herbert',8D
            asc   'Taken from the book Dune...',8d

*****************************************************************************
****************************  MOUSE MANAGER  ********************************
*****************************************************************************

SOURIS      LDA   BOUT          ; ANCIEN BOUT=NOUVEAU BOUT
            STA   BOUT1

SOURIS0     JSR   SLECT         ; LECTURE SOURIS
            CPY   #$FFFF
            BEQ   SECR          ; DONNEES NON DISPONIBLES

SOURIS1     LDA   A1            ; A1 POSITION ACTUELLE
            STA   AP            ; AP ANCIENNE POSITION
            LDA   POSX
            LSR
            STA   SOURIS2+1
            LDA   POSY
            ASL
            TAX
            LDA   TABLE,X
            CLC
SOURIS2     ADC   #$0000        ; CALCUL DE A1 (160*POSY+POSX)


> Commands List


If you do not provide any parameter on the command line, Cadius displays a quick reminder of existing commands :

C:\AppleIIgs>Cadius.exe
Cadius.exe v 1.0, (c) Brutal Deluxe 2011-2012.

Usage : Cadius.exe COMMAND <param_1> <param_2> <param_3>... [-V] :
        ----
        Cadius.exe CATALOG       <[2mg|hdv|po]_image_path>   [-V]
        Cadius.exe CHECKVOLUME   <[2mg|hdv|po]_image_path>   [-V]
        ----
        Cadius.exe EXTRACTFILE   <[2mg|hdv|po]_image_path>   <prodos_file_path>    <output_directory>
        Cadius.exe EXTRACTFOLDER <[2mg|hdv|po]_image_path>   <prodos_folder_path>  <output_directory>
        Cadius.exe EXTRACTVOLUME <[2mg|hdv|po]_image_path>   <output_directory>
        ----
        Cadius.exe RENAMEFILE    <[2mg|hdv|po]_image_path>   <prodos_file_path>    <new_file_name>
        Cadius.exe RENAMEFOLDER  <[2mg|hdv|po]_image_path>   <prodos_folder_path>  <new_folder_name>
        Cadius.exe RENAMEVOLUME  <[2mg|hdv|po]_image_path>   <new_volume_name>
        ----
        Cadius.exe MOVEFILE      <[2mg|hdv|po]_image_path>   <prodos_file_path>    <target_folder_path>
        Cadius.exe MOVEFOLDER    <[2mg|hdv|po]_image_path>   <prodos_folder_path>  <target_folder_path>
        ----
        Cadius.exe DELETEFILE    <[2mg|hdv|po]_image_path>   <prodos_file_path>
        Cadius.exe DELETEFOLDER  <[2mg|hdv|po]_image_path>   <prodos_file_path>
        Cadius.exe DELETEVOLUME  <[2mg|hdv|po]_image_path>
        ----
        Cadius.exe ADDFILE       <[2mg|hdv|po]_image_path>   <prodos_folder_path>  <file_path>
        Cadius.exe ADDFOLDER     <[2mg|hdv|po]_image_path>   <prodos_folder_path>  <folder_path>
        ----
        Cadius.exe CREATEFOLDER  <[2mg|hdv|po]_image_path>   <prodos_folder_path>
        Cadius.exe CREATEVOLUME  <[2mg|hdv|po]_image_path>   <volume_name>         <volume_size>
        ----
        Cadius.exe CLEARHIGHBIT  <source_file_path>
        Cadius.exe SETHIGHBIT    <source_file_path>
        Cadius.exe INDENTFILE    <source_file_path>
        Cadius.exe OUTDENTFILE   <source_file_path>
        ----

Few remarks about the Parameters required on the Command Line :
 
        - Some Commands accept an optional -V as last parameter.  This enable the VERBOSE mode for this command (more information are displayed on the screen during command execution).
        - If the Windows File or folder paths contains Space characters, quote the path to avoid conflicts (Cadius.exe CATALOG "c:\Users and Settings\AppleIIgs\Cogito.2mg").
 
       - The Prodos File or Folder paths use the Slash character (/) as separator.
 
       -  A valid Prodos File or Folder Name is 15 characters long (max), starts with a letter (A-Z or a-z), may contains Numerics (0-9) or a period (.).
        - A Prodos File Path (
/Cogito/COGITO.DATAS/Music) starts with the Volume Name (/Cogito/), may contains some Folder Names (/COGITO.DATAS/) and ends with the File Name (Music).
        - A Prodos File Size can't be larger than 16 MB.
        - A valid Prodos Image Size is between 143 KB and 32 MB. If you want to specify 1,6 MB, use the 1600KB syntax (integer numbers only).
       - The number of Prodos Files or Folders located at the Root of the Volume is limited to 51. If you need to store more files, create Folders !

Few remarks about the software behavior :
        - Any error occuring during the execution of a command is immediately displayed on the Screen. For multi-actions command (ADD FOLDER = Add all Files from a Folder, including Subfolders), a report provides errors count at the end of the process.
        - If any error occurs during the execution of a command, the Prodos Image file is NOT modified. You won't get a kind of half done job (Folder created into the Image disk but not the File...).
        - For Windows to Prodos Image files transfers, we DO NOT 
OVERWRITE Prodos File. Make sure there are no already existing files with the same name at the Prodos Target path. You can use RENAME or DELETE commands to perform the clean-up.
        - For Prodos Image to Windows files transfers, we DO OVERWRITE the existing Windows files.
        - You can chain several commands using a .bat file.
        - You can re-direct the standard output of a Command into a Text file using the > character (
Cadius.exe CATALOG c:\AppleIIgs\Cogito.2mg > c:\AppleIIgs\CogitoCatalog.txt).
        -  Most of the time, if you want to use on the PC a Merlin 16+ Source file stored in a Prodos Image disk, you have to chain 3 Commands : EXTRACTFILE, CLEARHIGHBIT and INDENTFILE.
      - The Transfer Commands (ADD / EXTRACT) use a dedicated Windows file (_FileInformation.txt) to Read / Store the Prodos File properties (access flags, Macintosh Finder Info). File content :
Cogito=Type(B3),AuxType(0000),VersionCreate(00),MinVersion(BE),Access(E3),FolderInfo1(000000000000000000000000000000000000),FolderInfo2(000000000000000000000000000000000000)
Finder.Data=Type(C9),AuxType(0000),VersionCreate(70),MinVersion(BE),Access(E7),FolderInfo1(000000000000000000000000000000000000),FolderInfo2(000000000000000000000000000000000000)
Lisez.Moi=Type(50),AuxType(5445),VersionCreate(C0),MinVersion(BC),Access(E3),FolderInfo1(000000000000000000000000000000000000),FolderInfo2(000000000000000000000000000000000000)
Read.Me=Type(50),AuxType(5445),VersionCreate(00),MinVersion(B9),Access(E3),FolderInfo1(000000000000000000000000000000000000),FolderInfo2(000000000000000000000000000000000000)
Tool220=Type(BA),AuxType(0000),VersionCreate(00),MinVersion(B8),Access(E3),FolderInfo1(000000000000000000000000000000000000),FolderInfo2(000000000000000000000000000000000000)


CATALOG
    Display the content (Files & Folders list) of a Prodos Image disk :

      Name                Type   Aux      Size     Data     Res  Data   Res  Sparse Index  Struct  Access    Creation Date     Modification Date
    /COGITO/
      Cogito              S16+  $0000    51279    50511     768    99    2      0     2     Fork   RWBND    20-May-1993 22:45   23-Sep-1994 15:29
      Finder.Data         FND   $0000      148      148       0     1    0      0     0     Seed   RWBNDH   30-Aug-1994 14:15   30-Aug-1994 14:15
      Lisez.Moi           GWP+  $5445     1373      849     524     2    2      0     2     Fork   RWBND    30-Aug-1994 14:12   30-Aug-1994 14:12
      Read.Me             GWP+  $5445     1296      772     524     2    2      0     2     Fork   RWBND    26-Aug-1994 11:24   30-Aug-1994 14:13
      Tool220             TOL   $0000     7745     7745       0    12    0      4     1     Sapl   RWBND    12-Nov-1991 19:00   17-Jan-1992 12:51

        ...
      Finder.Data         FND   $0000       63       63       0     1    0      0     0     Seed   RWBNDH   26-Aug-1994 11:30   30-Aug-1994 14:15
                Block : 1600     Free : 768     File : 21     Directory : 2


    With :
    Name              : Volume Name, Folder Name or File Name. The indentation shows the depth of the file.
    Type              : File Type (Ascii if recognized, Hexa if unknown).
    Aux               : File Auxiliary Type.
    Size              : File Size (in bytes).
    Data              : File Data part Size (in bytes).
    Res               : File Resource part Size (in bytes).
    Data              : Number of Blocks used to store File Data part.
    Res               : Number of Blocks used to store File Resource part.
    Sparse            : Number of Blocks saved by the Sparse structure.
    Index             : Number of Blocks used to store File Index part.
    Struct            : Type of on-disk File structure (Seedling, Sapling, Tree, Extended).
    Access            : File Access Flags (Read, Write, Backup, re-Name, Delete, Hidden).
    Creation Date     : File Creation Time Date.
    Modification Date : File Last Modification Time Date.
   
Block             : Number of Blocks of the Volume.
    Free              : Number of Free Blocks of the Volume.
    File              : Number of Files of the Volume.
    Directory         : Number of Folders of the Volume.


    Syntax
Cadius.exe CATALOG       <[2mg|hdv|po]_image_path>   [-V]

    Example
Cadius.exe CATALOG  c:\AppleIIgs\Cogito.2mg


CHECK VOLUME

    Check the Prodos Image blocks to validate the File System. Common errors are :
        - Blocks declared FREE in the Bitmap, but used by a File.
        - Blocks declared IN USE in the Bitmap, but not referenced by any object (File, Folder, Bitmap, ...).
        - Blocks claimed by a File or a Folder but already used by another File or Folder.

    The Verbose mode (-V) of the Command delivers a Block Usage report :

; ------------------  Block List  -------------------
0000-0001;  Boot
0002-0005;  Volume
0006     ;  Bitmap
0007-0008;  Folder; /Cogito/Cogito.Datas
0009     ;  Folder; /Cogito/Icons
000A     ;  File;   /Cogito/Icons/Cogito.Icon
000B     ;  File;   /Cogito/Lisez.Moi
000C     ;  File;   /Cogito/Read.Me
000D     ;  File;   /Cogito/Cogito
000E-0042;  File;   /Cogito/Cogito.Datas/Cogito
0043-0058;  File;   /Cogito/Cogito.Datas/Happyland
0059-007B;  File;   /Cogito/Cogito.Datas/Ludyland
007C-0098;  File;   /Cogito/Cogito.Datas/Messages
0099-0183;  File;   /Cogito/Cogito.Datas/Music
0184-0198;  File;   /Cogito/Cogito.Datas/PlanetLast
0199-01AE;  File;   /Cogito/Cogito.Datas/Sound.1
01AF-0225;  File;   /Cogito/Cogito.Datas/Sound.2
0226-0241;  File;   /Cogito/Cogito.Datas/Sprites
0242-0268;  File;   /Cogito/Cogito.Datas/Superman
0269-0290;  File;   /Cogito/Cogito.Datas/Toinet
0291-02B4;  File;   /Cogito/Cogito.Datas/XenoLast
02B5     ;  File;   /Cogito/Cogito.Datas/Temp
02B6     ;  File;   /Cogito/Cogito.Datas/Finder.Data
02B7     ;  File;   /Cogito/Icons/Finder.Data
02B8-02BE;  File;   /Cogito/Icons/Cogito.Icon
02BF-02C4;  File;   /Cogito/Lisez.Moi
02C5-02CA;  File;   /Cogito/Read.Me
02CB-0331;  File;   /Cogito/Cogito
0332-033E;  File;   /Cogito/Tool220
033F     ;  File;   /Cogito/Finder.Data
0340-063F;  Free

    Syntax
Cadius.exe CHECKVOLUME   <[2mg|hdv|po]_image_path>   [-V]

    Example
Cadius.exe CHECKVOLUME  c:\AppleIIgs\Cogito.2mg


EXTRACT FILE
    Transfer ONE File from the Prodos Image disk to the Windows file system :
        - The file created on Windows hard drive inherit of the File Name, the Creation Time/Date, the Modification Time/Date and the Hide property from the Prodos file system.
        - A file named "
_FileInformation.txt"  is created (or updated) with the Prodos File properties (Type, AuxType, Version Create, Minimum Version, Access Flags, Macintosh Finder Info).
        - If the File has a Resource Fork, a second file is created at the same location, with a "
_ResourceFork.bin" suffix.
        - The data + resource of the file are transfered without any conversion. (Binary transfer).
        - If a File already exist at the target location, it is overwritten without any warning.

    Syntax
Cadius.exe EXTRACTFILE   <[2mg|hdv|po]_image_path>   <prodos_file_path>    <output_directory>

    Example
Cadius.exe EXTRACTFILE  c:\AppleIIgs\Cogito.2mg  /Cogito/COGITO.DATAS/Music  c:\AppleIIgs\Cogito\


EXTRACT FOLDER
    Transfer ALL Files and SubFolders located in a Folder of the Prodos Image disk to the Windows file system :
        - A first folder is created with the Name of the Prodos Folder.
        - All Files and SubFolders from the Prodos
Folder are transfered in this folder. The file hierarchical organization (Folder structure) is preserved.
        - See EXTRACT FILE Command for details about the individual File Transfer.
        - The Prodos Folders are re-created in the Windows file system but we DO NOT preserve their properties (Creation or Modification Time / Date, Access Flags..).
        - Each folder has its own 
_FileInformation.txt file.

    Syntax
Cadius.exe EXTRACTFOLDER <[2mg|hdv|po]_image_path>   <prodos_folder_path>  <output_directory>

    Example
Cadius.exe EXTRACTFOLDER  c:\AppleIIgs\Cogito.2mg  /Cogito/COGITO.DATAS/  c:\AppleIIgs\Cogito\


EXTRACT VOLUME
    Transfer ALL Files and Folders from the Prodos Image disk to the Windows file system :
        - A first folder is created with the Name of the Volume.
        - All Files and Folders from the Prodos disk Image are transfered in this folder. The file hierarchical organization (Folder structure) is preserved.
        - See EXTRACT FILE Command for details about the individual File Transfer.
        - The Prodos Folders are re-created in the Windows file system but we DO NOT preserve their properties (Creation or Modification Time / Date, Access Flags..).
        - Each folder has its own 
_FileInformation.txt file.

    Syntax
Cadius.exe EXTRACTVOLUME <[2mg|hdv|po]_image_path>   <output_directory>

    Example
Cadius.exe EXTRACTVOLUME  c:\AppleIIgs\Cogito.2mg  c:\AppleIIgs\


RENAME FILE

    Rename one File located in a Prodos Image disk. Command fails if the File doesn't exist or if a File or a Folder already exists with the same target name.

    Syntax
Cadius.exe RENAMEFILE    <[2mg|hdv|po]_image_path>   <prodos_file_path>    <new_file_name>

    Example
Cadius.exe RENAMEFILE  c:\AppleIIgs\Cogito.2mg  /Cogito/COGITO.DATAS/Music  Music.old


RENAME FOLDER
    Rename one Folder located in a Prodos Image disk. Command fails if the Folder doesn't exists or if a File or a Folder already exists with the same target name.

    Syntax
Cadius.exe RENAMEFOLDER  <[2mg|hdv|po]_image_path>   <prodos_folder_path>  <new_folder_name>

    Example
Cadius.exe RENAMEFOLDER  c:\AppleIIgs\Cogito.2mg  /Cogito/COGITO.DATAS/  COGITO.DATA


RENAME VOLUME
    Change the Prodos Volume Name of a Prodos Image disk.

    Syntax
Cadius.exe RENAMEVOLUME  <[2mg|hdv|po]_image_path>   <new_volume_name>

    Example
Cadius.exe RENAMEVOLUME  c:\AppleIIgs\Cogito.2mg  CogitoVGA


MOVE FILE

    Move one File from one location to another in a Prodos Image disk. The missing target SubFolders are created if needed. Command fails if the File doesn't exist or if the Target Path is invalid (wrong Volume name, SubFolder Names are used by already existing Files, ...) or if the Volume if Full.

    Syntax
Cadius.exe MOVEFILE      <[2mg|hdv|po]_image_path>   <prodos_file_path>    <target_folder_path>

    Example
Cadius.exe MOVEFILE  c:\AppleIIgs\Cogito.2mg  /Cogito/COGITO.DATAS/Music  /Cogito/ICONS/


MOVE FOLDER

    Move one Folder (and all the files located in this Folder) from one location to another in a Prodos Image disk. The missing target SubFolders are created if needed. Command fails if the Folder doesn't exist or if the Target Path is invalid (wrong Volume name, SubFolder Names are used by already existing Files, ...) or if the Volume if Full. You are NOT allowed to move a Folder inside itself (/Cogito/ICONS/ into /Cogito/ICONS/OLD/).

    Syntax
Cadius.exe MOVEFOLDER    <[2mg|hdv|po]_image_path>   <prodos_folder_path>  <target_folder_path>

    Example
Cadius.exe MOVEFOLDER  c:\AppleIIgs\Cogito.2mg  /Cogito/ICONS/  /Cogito/OLD/


DELETE FILE
    Delete one File from a Prodos Image disk. Command fails if the File doesn't exist.

    Syntax
Cadius.exe DELETEFILE    <[2mg|hdv|po]_image_path>   <prodos_file_path>

    Example
Cadius.exe DELETEFILE  c:\AppleIIgs\Cogito.2mg  /Cogito/COGITO.DATAS/Music


DELETE FOLDER

    Delete one Folder from a Prodos Image disk, including ALL Files and SubFolders located inside the target Folder. Command fails if the Folder doesn't exist.

    Syntax
Cadius.exe DELETEFOLDER  <[2mg|hdv|po]_image_path>   <prodos_folder_path>

    Example
Cadius.exe DELETEFOLDER  c:\AppleIIgs\Cogito.2mg  /Cogito/ICONS/


DELETE VOLUME
    Erase the content of a Prodos Image disk. ALL Files and SubFolders located in the Prodos Image are deleted.

    Syntax
Cadius.exe DELETEVOLUME  <[2mg|hdv|po]_image_path>

    Example
Cadius.exe DELETEVOLUME  c:\AppleIIgs\Cogito.2mg


ADD FILE
    Transfer ONE File from the Windows File system to Prodos Image disk :
        - The file created in the Prodos Image inherit of the File Name, the Creation Time/Date, the Modification Time/Date and the Hide property from the Windows file.
        - 
The Prodos File properties (Type, AuxType, Version Create, Minimum Version, Access Flags, Macintosh Finder Info) come from the file named "_FileInformation.txt" (located at the same location than the file). If the file does not exist or does not contain any information about the file to transfer, default values are used (Type = $00, AuxType= $0000, .Access = $E3, ...).
        - If
a Windows File with a "_ResourceFork.bin" suffix exists at the same location, its content is used as Resource Fork for the Prodos File.
        - The data + resource of the file are transfered without any conversion. (Binary transfer).
        - If the Target Prodos Path does not exist, it is created (SubFolders tree structure) in the Prodos Image disk.

    The command fails if :
        - The Windows File Name is not compatible with Prodos File name limitations (15 characters long, alpha-numeric and period, starting with a letter, ...).
        - The Windows File Size is larger than 16 MB.
        - If a File or Folder already exists at the target location (Prodos Image) with the same name.
        - The Prodos Image is Full (no left space to store the file).
        - The Prodos Volume directory is Full (51 entries maximum).
        - The Volume Name given in the Prodos Target Path (
/Cogito/) does not match with the one of the Prodos Image disk.

    Syntax
Cadius.exe ADDFILE       <[2mg|hdv|po]_image_path>   <prodos_folder_path>  <file_path>

    Example
Cadius.exe ADDFILE  c:\AppleIIgs\Cogito.2mg  /Cogito/COGITO.MUSIC/  c:\AppleIIgs\Data\Music.wav


ADD FOLDER

    Transfer ALL Files and SubFolders located in a Windows Folder to the Prodos Image disk :
        - All Files and SubFolders located in the Windows
Folder are transfered in Prodos Image disk (at the root of the Volume /Cogito/ or in a SubFolder /Cogito/COGITO.MUSIC/). The file hierarchical organization (Folder structure) is preserved.
        - The Windows SubFolders are re-created in the Prodos Image disk but we DO NOT preserve their properties (Creation or Modification Time / Date, Access Flags...).
        - If ONE File is not properly transfered from Windows to the Prodos Image disk, all the copy is cancelled and the Prodos Image disk remains unmodified.
        - See ADD FILE Command for details about the individual File Transfer and potential failures.

    Syntax
Cadius.exe ADDFOLDER     <[2mg|hdv|po]_image_path>   <prodos_folder_path>  <folder_path>

    Example
Cadius.exe ADDFOLDER  c:\AppleIIgs\Cogito.2mg  /Cogito/COGITO.MUSIC/  c:\AppleIIgs\Data\Instruments\


CREATE FOLDER
    Create a new empty Folder in a Prodos Image disk, including all required SubFolders. Command fails if the Folder Path is invalid (wrong Volume name, SubFolder Names are used by already existing Files, ...) or if the Volume if Full.

    Syntax
Cadius.exe CREATEFOLDER  <[2mg|hdv|po]_image_path>   <prodos_folder_path>

    Example
Cadius.exe CREATEFOLDER  c:\AppleIIgs\Cogito.2mg  /Cogito/COGITO.MUSIC/


CREATE VOLUME
    Create a new empty Prodos Image disk. The Volume Size may be given in KB or in MB. Any size between 143KB and 32MB is valid (143KB, 800KB, 1600KB, 32MB, ...). Command fails if the Image Path is invalid (wrong Windows Path) or if the disk is full.

    Syntax
Cadius.exe CREATEVOLUME  <[2mg|hdv|po]_image_path>   <volume_name>         <volume_size>

    Example
Cadius.exe CREATEVOLUME  c:\AppleIIgs\CogitoSecondSight.2mg  CogitoVGA  1600KB


CLEAR HIGH BIT
    Clear the bit 7 of one or several Windows files. This is usefull to read Merlin 16+ file (assembly source file) into a Windows Text editor. You can use Wildcard character (*) to process SEVERAL files during ONE run (c:\AppleIIgs\Source\*.s).

    Syntax
Cadius.exe CLEARHIGHBIT  <source_file_path>

    Example
Cadius.exe CLEARHIGHBIT  c:\AppleIIgs\Source\Cogito.s


SET HIGH BIT
    Set the bit 7 of one or several Windows files. This is usefull to convert Windows Text files as ready-to-use Merlin 16+ file (assembly source file). You can use Wildcard character (*) to process SEVERAL files during ONE run (c:\AppleIIgs\Source\*.s).

    Syntax
Cadius.exe SETHIGHBIT    <source_file_path>

    Example
Cadius.exe SETHIGHBIT    c:\AppleIIgs\Source\Cogito.s


INDENT FILE
    Indent properly one or several Assembly Language Text files (add extra spaces to render column alignment). This is usefull to read Merlin 16+ file into a Windows Text editor. You can use Wildcard character (*) to process SEVERAL files during ONE run (c:\AppleIIgs\Source\*.s).

    Syntax
Cadius.exe INDENTFILE    <source_file_path>

    Example
Cadius.exe INDENTFILE    c:\AppleIIgs\Source\Cogito.s


OUTDENT FILE
    Remove extra spaces from one or several Assembly Language Text files (keep only one space bewteen values). This is usefull to convert Windows Text file as Merlin 16+ files. You can use Wildcard character (*) to process SEVERAL files during ONE run (c:\AppleIIgs\Source\*.s).

    Syntax
Cadius.exe OUTDENTFILE   <source_file_path>

    Example
Cadius.exe OUTDENTFILE   c:\AppleIIgs\Source\Cogito.s


> Known Bugs

Folder Properties

We do NOT preserve the Folder properties during files exchange beween the Apple II disk image and the Windows environment.
So the Creation / Modification dates and the Access flags are lost.

> F.A.Q

Is the Source code available somewhere ?

The Source code is freely available in the Zip file (see download section).
It is currently pakaged as a Visual Studio 2010 Project set of files. The tool is only using C Language, so you can recompile it with any other C ANSI compiler (GCC...).

What about a Macintosh or Linux release ?

Everything has be done to be as independant as possible from the Operating System. The first release has been done using a Windows environment. The Macintosh and Linux ports should be done in the next weeks, as soon as someone is ready to handle it !
The source code is written in C Ansi and the only Operating Systems calls have been isolated in a specific file. So porting the project to Macintosh or Unix systems should take maximum 4 hours to any C programmers having the knowledge of the target platform.

How do you compete with CiderPress ?

We don't :-)
CiderPress is a fantastic piece of code to interract with Disk Images (creating images, transfering files, viewing files...). We use it all the time !
Cadius is a disk image command line utility, mostly targeted to be used in a chain of Cross Developement tools. You can easily create batchs to launch multiple commands to manage disk image contents.

Where Cadius name comes from ?

Cool Another Disk Image Utility Software !


> References

Beneath Apple ProDos by Don Worth and Pieter Lechner
ProDOS 8 Technical Reference Manual
ProDOS Technical Note #23
CiderPress v3.0.1
by Andy McFadden
Universe Master v 1.02 ECON Technologies
Apple IIgs System 6.0.1 Finder


> Download

Cadius v1.1 for Windows 32 & 64 bits + Source Code                     Cadius for Windows
Cadius v1.1 for MacOS                     Cadius for MacOS
Cadius v1.4 for MacOS                     Cadius for MacOS