bin/dsktool.rb in dsktool-0.4.2 vs bin/dsktool.rb in dsktool-0.5.1
- old
+ new
@@ -8,10 +8,11 @@
#
# == Usage
#
# dsktool.rb [switches] <filename.dsk>
# -a | --add FILENAME (*) add file
+# -A | --ascii force output to be ASCII (even if binary)
# -b | --base BASE use BASE as address to load Binary File
# this will add 2 bytes to the start of file
# BASE should be a hex number
# (can be prefixed with $, 0x, or nothing)
# -B | --bootcode FILENAME FILENAME gets written to track 0, sector 0
@@ -24,11 +25,11 @@
# -e | --extract FILENAME extract file by name (either to stdout,
# or file specified by --output)
# -h | --help display this message
# -I | --init FILESYSTEM initialise the disk with the specified filesytem
# DSK will be created if it doesn't exist.
-# FILESYSTEM can be : prodos,dos33,nadol,pascal,none
+# FILESYSTEM can be : cpm,dos33,nadol,pascal,none
# -l | --list FILENAME monitor style listing (disassembles 65C02 opcodes)
# -o | --output FILENAME specify name to save extracted file as
# -r | --raw don't convert files to ASCII
# -S | --showtrace show full stack trace on any error
# -t | --filetype FILETYPE file type for file being added.
@@ -41,10 +42,11 @@
# (*) options marked with an asterisk are only available for
# file systems that have READ/WRITE support.
#
# Currently supported filesystems:
# Apple Pascal (read only)
+# CP/M (READ/WRITE)
# DOS 3.3 (READ/WRITE)
# NADOL (READ/WRITE)
# ProDOS 8 (read only)
#
# Supports 16 sector DSK images
@@ -58,14 +60,14 @@
# dsktool.rb -e HELLO -o HELLO.bas DOS3MASTR.dsk
# dsktool.rb -x DOS3MASTR.dsk.gz -o /tmp/DOS3MASTR/
# dsktool.rb --add STARTUP -T nadol.po
# dsktool.rb --add c:\src\dosdemo\a.out -t B -b $2000 dosdemo.dsk
# dsktool.rb --init dos33 new_dos_disk.dsk.gz
-# dsktool.rb --I none -B /tmp/a.out demo1.dsk
+# dsktool.rb -I none -B /tmp/a.out demo1.dsk
-DSKTOOL_VERSION="0.4.2"
+DSKTOOL_VERSION="0.5.1"
#make sure the relevant folder with our libraries is in the require path
lib_path=File.expand_path(File.dirname(__FILE__)+"//..//lib")
$:.unshift(lib_path) unless $:.include?(lib_path)
require 'rubygems'
@@ -91,10 +93,11 @@
opts.on("-v","--version") do
puts File.basename($0)+" "+DSKTOOL_VERSION
exit
end
opts.on("-r","--raw") {extract_mode=:raw}
+opts.on("-A","--ascii") {extract_mode=:ascii}
opts.on("-c","--catalog") {catalog=true}
opts.on("-D","--diskdump") {diskdump=true}
opts.on("-x","--explode") {explode=true}
opts.on("-l","--list FILENAME",String) do |val|
extract_filename=val.upcase
@@ -209,9 +212,10 @@
puts "'#{extract_filename}' not found in #{filename}"
else
output_file<< case extract_mode
when :raw then file.contents
when :hex then file.hex_dump
+ when :ascii then file.to_ascii
when :list then
if file.respond_to?(:disassembly)
file.disassembly
else
puts "'#{extract_filename}' is not a binary file"