User Tools

Site Tools


base:tools_for_putting_files_into_a_.d64_image

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revisionBoth sides next revision
base:tools_for_putting_files_into_a_.d64_image [2015-04-17 04:34] – external edit 127.0.0.1base:tools_for_putting_files_into_a_.d64_image [2020-10-08 11:45] – [cc1541] claus
Line 49: Line 49:
 ====== cc1541 ====== ====== cc1541 ======
  
-c1541 works fine for most purposes, but some of the better coders around says it is buggy, and thus there is also [[http://noname.c64.org/csdb/release/?id=69964|cc1541]]. cc1541 also supports some more advanced options which gives you better control over how the files are actually laid out onto the image. The available options goes like this:+c1541 works fine for most purposes, but some of the better coders around says it is buggy, and thus there is also [[https://csdb.dk/release/?id=196448|cc1541]]. cc1541 also supports some more advanced options which gives you better control over how the files are actually laid out onto the image. The available options go like this:
  
-<code> +*** This is cc1541 version 3.2 built on Oct  8 2020 ***
-Usage: cc1541 -niSsfw image.d64+
  
--n diskname   Disk name, default='default+Usage: cc1541 -niwfoVTPONlBMmdtuxFSseErbc45gqvh image.[d64|d71|d81] 
--i id         Disk ID, default='lodis' + 
--S value      Default sector interleave, default=10 +-n diskname   Disk name, default='cc1541'. 
--s value      Next file sector interleave, after each file +-i id         Disk ID, default='00 2a'.
-              the interleave value falls back to the default value set by -S +
--f filename   Use filename as name when writing next file+
 -w localname  Write local file to disk, if filename is not set then the -w localname  Write local file to disk, if filename is not set then the
-              local name is used. After file written filename is unset +              local name is used. After file written, the filename is unset. 
--           Don't split files over track 18 hole (default split files+-f filename   Use filename as name when writing next file, use prefix # to 
--t            Use track 18 to also store files (makes -x useless) (default no) +              include arbitrary PETSCII characters (e.g. -f "START#a0,8,1"). 
--4            Use tracks 35-40 with SPEED DOS formatting +-o            Do not overwrite if file with same name exists already. 
--5            Use tracks 35-40 with DOLPHIN DOS formatting+-V            Do not modify image unless it is in valid CBM DOS format. 
 +-T filetype   Filetype for next file, allowed parameters are PRG, SEQ, USR, REL 
 +              and DEL. For DEL, the input file is ignored. Default is PRG. 
 +-P            Set write protect flag for next file. 
 +-O            Set open flag for next file. 
 +-N            Force creation of a new directory entry, even if a file with the 
 +              same name exists already. 
 +-l filename   Write loop file (an additional dir entry) to existing file to 
 +              disk, set filename with -f. 
 +-B numblocks  Write the given value as file size in blocks to the directory for 
 +              the next file. 
 +-M numchars   Hash computation maximum filename length, this must 
 +              match loader option FILENAME_MAXLENGTH in Krill's Loader. 
 +              Default is 16. 
 +-m            Ignore filename hash collisions, without this switch a collision 
 +              results in an error. 
 +-d track      Maintain a shadow directory (copy of the actual directory without 
 +              a valid BAM). 
 +-t            Use dirtrack to also store files (makes -x useless) (default no)
 +-u numblocks  When using -t, amount of dir blocks to leave free (default=2). 
 +-x            Don't split files over dirtrack hole (default split files). 
 +-F            Next file first sector on a new track (default=0). 
 +              Any negative value assumes aligned tracks and uses current 
 +              sector + interleave. After each file, the value falls back to the 
 +              default. Not applicable for D81. 
 +-S value      Default sector interleave, default=10. 
 +              At track end, reduces this by 1 to accomodate large tail gap. 
 +              If negative, no special treatment of tail gap.  Not applicable for 
 +              D81. 
 +-s value      Next file sector interleave, valid after each file. 
 +              At track end, reduces this by 1 to accomodate large tail gap. 
 +              If negative, no special treatment of tail gap. 
 +              The interleave value falls back to the default value set by -S 
 +              after the first sector of the next file. Not applicable for D81. 
 +-e            Start next file on an empty track (default start sector is 
 +              current sector plus interleave). 
 +-E            Try to fit file on a single track. 
 +-r track      Restrict next file blocks to the specified track or higher. 
 +-b sector     Set next file beginning sector to the specified value. 
 +              Not applicable for D81. 
 +-c            Save next file cluster-optimized (d71 only). 
 +-4            Use tracks 35-40 with SPEED DOS BAM formatting. 
 +-5            Use tracks 35-40 with DOLPHIN DOS BAM formatting
 +-g filename   Write additional g64 output file with given name. 
 +-q            Be quiet. 
 +-v            Be verbose. 
 +-h            Print this commandline help. 
 +</code> 
 +====== mkd64 ====== 
 + 
 +Another flexible alternative is [[http://zirias.github.io/c64_tool_mkd64/|mkd64]] which takes a modular approach to creating the disk files, so you don't have to follow the default 1541 format at all. In fact, creation of a directory and block allocation map ist taken care of by a loadable module named "cbmdos". It also includes all sorts of tricks and tweaks possible with the 1541 format as well as a module providing some pre-made "separator" directory entries using graphical characters. The help pages for mkd64 itself and the cbmdos module look like this: 
 + 
 +<code> 
 +mkd64 1.4b help 
 + 
 +mkd64 supports four types of options. Single options trigger some immediate 
 +action, see below. Global options affect the whole disk image generation, 
 +module options are passed just to the last loaded module and file options 
 +control single files written to the image. 
 +Global and module options must come before file options on the command line. 
 + 
 +Modules can provide their own global and file options, check their help 
 +messages (-h MODULE) for reference. 
 + 
 +SINGLE options (must be the only option to mkd64): 
 +  -h [MODULE]    Show this help message or, if given, the help message for 
 +                 the module {MODULE}, and exit. 
 +  -V [MODULE]    Show version info and exit. If {MODULE} is given, version 
 +                 info for that module is shown instead. 
 +  -C OPTFILE     Read options from file {OPTFILE} instead of the command 
 +                 line. The file has the same format as the normal command 
 +                 line and the following rules: 
 +                 - Strings containing whitespace are escaped using quotes 
 +                   or doublequotes (' or ") 
 +                 - The backslash (\) has no special meaning at all 
 +                 - Newlines are just normal whitspace and thus ignored 
 +  -M             Display all available modules and exit. 
 + 
 +GLOBAL options: 
 +  -m MODULE      Activate module {MODULE}. Modules are searched for in the 
 +                 directory of the mkd64 executable for a portable build of 
 +                 mkd64, or in the dedicated module directory (typically 
 +                 /usr/lib/mkd64) for an installable build. Any options 
 +                 following -m are treated as module options to this module, 
 +                 as long as there is no other -m option or a -g option to 
 +                 get back to global scope or a -f option to switch to file 
 +                 scope. 
 +  -o D64FILE     Write generated disk image to {D64FILE}. This option must 
 +                 be given to actually write something. 
 +  -M MAPFILE     Write file map of the generated disk image to MAPFILE. The 
 +                 map file format is one line per file on disk: 
 +                 [startTrack];[startSector];[filename] 
 +  -P [MAXPASSES] Allow up to {MAXPASSES} passes, automatically applying 
 +                 options suggested by modules. The default is only one pass 
 +                 if this option is not given or up to 5 passes if it is 
 +                 given without an argument. 
 + 
 +MODULE options: 
 +  -g             Go back to global scope after loading a module. 
 +                 Please see the module documentation or help text 
 +                 (-h MODULE) for options available with specific modules. 
 + 
 +FILE options: 
 +  -f [FILENAME]  Start a new file. {FILENAME} is the name on your PC. It 
 +                 can be omitted for special emtpy files. 
 +  -t TRACK       Set fixed start track for current file. 
 +  -s SECTOR      Set fixed start sector for current file. 
 +  -i INTERLEAVE  Set sector interleave for current file. 
 +  -w             Write current file to disk image. 
 + 
 +Note that filesystem elements (like the original cbmdos directory and BAM) 
 +are implemented by modules. They can provide a sensible default value for 
 +sector interleave. A default allocation strategy is built in and determines 
 +start track and sector automatically if not given, modules can install their 
 +own strategy. 
 +</code> 
 +<code> 
 +mkd64 1.4b help 
 + 
 +* Module `cbmdos': 
 + 
 +cbmdos implements the default directory and BAM scheme of a 1541 floppy. 
 +Interleave is initially set to 10 for every file (cbmdos standard). The 
 +following options are recognized: 
 + 
 +  -d DISKNAME   The name of the disk, defaults to an empty name. 
 +  -i DISKID     The ID of the disk, defaults to two random characters. 
 +                this can be up to 5 characters long, in this case it will 
 +                overwrite the default `DOS type' string (`2A'). 
 +  -R DIRBLOCKS  reserve {DIRBLOCKS} blocks for the directory. The default 
 +                value is 18, which is exactly the whole track #18. 
 +  -I INTERLV    Set the directory interleave to {INTERLV}. The default value 
 +                for directory interleave is 3. 
 +  -D DOSVER     Set the dos version byte to {DOSVER}, given in hexadecimal. 
 +                The default value is (hex) 41. this can be used for soft 
 +                write protection, the original floppy will refuse any write 
 +                attempts if this value is changed. 
 +  -A            Allocate all blocks in the BAM. 
 +  -0            Set available blocks to 0 in BAM, but still write flags for 
 +                individual sectors. 
 + 
 +* File options: 
 + 
 +  -n [FILENAME] Activates cbmdos directory entry for the current file. If 
 +                {FILENAME} is given, it is used for the cbmdos directory. 
 +  -T FILETYPE   One of `p', `s', `u', `r' or `d' (for PRG, SEQ, USR, REL or 
 +                DEL), defaults to PRG. 
 +  -P            Make the file write-protected. 
 +  -S BLOCKSIZE  Force the size written to the directory to be {BLOCKSIZE}. 
 +</code> 
 + 
 +Example usage from an own project: 
 +<code> 
 + mkd64 -odisks/demo.d64 \ 
 +          -mcbmdos -d'C=64 WORKBENCH' -i'AMIGA' -R1 -Da0 -0 \ 
 +          -mseparators \ 
 +          -fdemo_bootloader                    -proundtop        -S1      -w \ 
 +   -fdemo_kickstart  -n'DEMO: AMIGADOS' -pfr -t19 -s0 -TU -S0 -i15 -w \ 
 +   -fdemo_amigados                      -pfrmid       -TU -S0 -i15 -w \ 
 +   -fdemo_music      -n'RELEASE 1.09A4' -pfr          -TU -S0 -i15 -w \ 
 +   -f                -n'  2013/12/15  ' -pfr          -TD          -w \ 
 +   -f                -n'  BY ZIRIAS   ' -pfr          -TD          -w \ 
 +   -f                                   -proundbot    -TD          -w
 </code> </code>
 +For Linux/Windows binaries or Debian packages, check the [[https://github.com/Zirias/c64_tool_mkd64/tree/release|release branch]], folders "win32bin", "lin32bin", "deb32bin", "deb64bin".
 +//[Section added by Felix Palmen (Zirias)]//
  
-====== mkd64 & copy2d64 ======+====== k2xtools ======
  
 In the [[http://k2devel.sourceforge.net/download.html|k2xtools]] collection there are also two tools called "mkd64" (to create d64 images) and "copy2d64" (to copy files onto the d64 images). I don't have them installed on my computer at the moment, so I cannot provide a list of the available options, but at least I remember that these tools worked just fine when I used them a few years ago. In the [[http://k2devel.sourceforge.net/download.html|k2xtools]] collection there are also two tools called "mkd64" (to create d64 images) and "copy2d64" (to copy files onto the d64 images). I don't have them installed on my computer at the moment, so I cannot provide a list of the available options, but at least I remember that these tools worked just fine when I used them a few years ago.
base/tools_for_putting_files_into_a_.d64_image.txt · Last modified: 2024-03-15 19:52 by ftc