mirror of
https://github.com/AppleCommander/AppleCommander.git
synced 2025-01-18 04:34:25 +00:00
Add -cc65 option to command-line.
This commit is contained in:
parent
111502da4b
commit
0abb2ef45b
@ -40,7 +40,7 @@ import com.webcodepro.applecommander.util.TextBundle;
|
|||||||
* @author Rob Greene
|
* @author Rob Greene
|
||||||
*/
|
*/
|
||||||
public class AppleCommander {
|
public class AppleCommander {
|
||||||
public static final String VERSION = "1.3.4"; //$NON-NLS-1$
|
public static final String VERSION = "1.3.4.1"; //$NON-NLS-1$
|
||||||
private static TextBundle textBundle = UiBundle.getInstance();
|
private static TextBundle textBundle = UiBundle.getInstance();
|
||||||
/**
|
/**
|
||||||
* Launch AppleCommander.
|
* Launch AppleCommander.
|
||||||
|
@ -100,7 +100,7 @@ CreateDirectoryMenuItem=Create Directory...
|
|||||||
CommandLineErrorMessage = Error: {0}
|
CommandLineErrorMessage = Error: {0}
|
||||||
CommandLineNoMatchMessage = {0}: No match.
|
CommandLineNoMatchMessage = {0}: No match.
|
||||||
CommandLineStatus = {0} format; {1} bytes free; {2} bytes used.
|
CommandLineStatus = {0} format; {1} bytes free; {2} bytes used.
|
||||||
CommandLineHelp = AppleCommander command line options [{0}]:\n-i <imagename> display information about image.\n-ls <imagename> list brief directory of image.\n-l <imagename> list directory of image.\n-ll <imagename> list detailed directory of image.\n-e <filename> <imagename> export file from image to stdout.\n-g <filename> <imagename> get raw file from image to stdout.\n-p <destname> <type> <addr> <imagename> put stdin\n in destname on image, using file type and address.\n-d <filename> <imagename> delete file from image.\n-dos140 <imagename> create a 140K DOS 3.3 image.\n-pro140 <imagename> <volname> create a 140K ProDOS image.\n-pro800 <imagename> <volname> create a 800K ProDOS image.\n-pas140 <imagename> <volname> create a 140K Pascal image.
|
CommandLineHelp = AppleCommander command line options [{0}]:\n-i <imagename> display information about image.\n-ls <imagename> list brief directory of image.\n-l <imagename> list directory of image.\n-ll <imagename> list detailed directory of image.\n-e <filename> <imagename> export file from image to stdout.\n-g <filename> <imagename> get raw file from image to stdout.\n-p <destname> <type> <addr> <imagename> put stdin\n in destname on image, using file type and address.\n-d <filename> <imagename> delete file from image.\n-cc65 <destname> <type> <imagename> put stdin\n in destname on image, using file type cc65 header.\n-dos140 <imagename> create a 140K DOS 3.3 image.\n-pro140 <imagename> <volname> create a 140K ProDOS image.\n-pro800 <imagename> <volname> create a 800K ProDOS image.\n-pas140 <imagename> <volname> create a 140K Pascal image.
|
||||||
|
|
||||||
|
|
||||||
# UserPreferences
|
# UserPreferences
|
||||||
|
@ -49,11 +49,11 @@ public class ac {
|
|||||||
try {
|
try {
|
||||||
if (args.length == 0) {
|
if (args.length == 0) {
|
||||||
help();
|
help();
|
||||||
} else if ("-ls".equalsIgnoreCase(args[0])) {
|
} else if ("-ls".equalsIgnoreCase(args[0])) { //$NON-NLS-1$
|
||||||
showDirectory(args[1], FormattedDisk.FILE_DISPLAY_STANDARD);
|
showDirectory(args[1], FormattedDisk.FILE_DISPLAY_STANDARD);
|
||||||
} else if ("-l".equalsIgnoreCase(args[0])) { //$NON-NLS-1$
|
} else if ("-l".equalsIgnoreCase(args[0])) { //$NON-NLS-1$
|
||||||
showDirectory(args[1], FormattedDisk.FILE_DISPLAY_NATIVE);
|
showDirectory(args[1], FormattedDisk.FILE_DISPLAY_NATIVE);
|
||||||
} else if ("-ll".equalsIgnoreCase(args[0])) {
|
} else if ("-ll".equalsIgnoreCase(args[0])) { //$NON-NLS-1$
|
||||||
showDirectory(args[1], FormattedDisk.FILE_DISPLAY_DETAIL);
|
showDirectory(args[1], FormattedDisk.FILE_DISPLAY_DETAIL);
|
||||||
} else if ("-e".equalsIgnoreCase(args[0])) { //$NON-NLS-1$
|
} else if ("-e".equalsIgnoreCase(args[0])) { //$NON-NLS-1$
|
||||||
getFile(args[1], args[2], true);
|
getFile(args[1], args[2], true);
|
||||||
@ -63,15 +63,17 @@ public class ac {
|
|||||||
putFile(args[1], args[2], args[3], args[4]);
|
putFile(args[1], args[2], args[3], args[4]);
|
||||||
} else if ("-d".equalsIgnoreCase(args[0])) { //$NON-NLS-1$
|
} else if ("-d".equalsIgnoreCase(args[0])) { //$NON-NLS-1$
|
||||||
deleteFile(args[1], args[2]);
|
deleteFile(args[1], args[2]);
|
||||||
} else if ("-i".equalsIgnoreCase(args[0])) {
|
} else if ("-i".equalsIgnoreCase(args[0])) { //$NON-NLS-1$
|
||||||
getDiskInfo(args[1]);
|
getDiskInfo(args[1]);
|
||||||
} else if ("-dos140".equalsIgnoreCase(args[0])) {
|
} else if ("-cc65".equalsIgnoreCase(args[0])) { //$NON-NLS-1$
|
||||||
|
putCC65(args[1], args[2], args[3]);
|
||||||
|
} else if ("-dos140".equalsIgnoreCase(args[0])) { //$NON-NLS-1$
|
||||||
createDosDisk(args[1], Disk.APPLE_140KB_DISK);
|
createDosDisk(args[1], Disk.APPLE_140KB_DISK);
|
||||||
} else if ("-pas140".equalsIgnoreCase(args[0])) {
|
} else if ("-pas140".equalsIgnoreCase(args[0])) { //$NON-NLS-1$
|
||||||
createPasDisk(args[1], args[2], Disk.APPLE_140KB_DISK);
|
createPasDisk(args[1], args[2], Disk.APPLE_140KB_DISK);
|
||||||
} else if ("-pro140".equalsIgnoreCase(args[0])) {
|
} else if ("-pro140".equalsIgnoreCase(args[0])) { //$NON-NLS-1$
|
||||||
createProDisk(args[1], args[2], Disk.APPLE_140KB_DISK);
|
createProDisk(args[1], args[2], Disk.APPLE_140KB_DISK);
|
||||||
} else if ("-pro800".equalsIgnoreCase(args[0])) {
|
} else if ("-pro800".equalsIgnoreCase(args[0])) { //$NON-NLS-1$
|
||||||
createProDisk(args[1], args[2], Disk.APPLE_800KB_DISK);
|
createProDisk(args[1], args[2], Disk.APPLE_800KB_DISK);
|
||||||
} else {
|
} else {
|
||||||
help();
|
help();
|
||||||
@ -111,6 +113,19 @@ public class ac {
|
|||||||
formattedDisk.save();
|
formattedDisk.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Put <stdin> into the file named fileName on the disk named imageName;
|
||||||
|
* Assume a cc65 style four-byte header with start address in bytes 0-1.
|
||||||
|
*/
|
||||||
|
static void putCC65(String fileName, String fileType, String imageName)
|
||||||
|
throws IOException, DiskFullException {
|
||||||
|
|
||||||
|
byte[] header = new byte[4];
|
||||||
|
int byteCount = System.in.read(header, 0, 4);
|
||||||
|
int address = header[1] * 256 + header[0];
|
||||||
|
putFile(fileName, fileType, Integer.toString(address), imageName);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete the file named fileName from the disk named imageName.
|
* Delete the file named fileName from the disk named imageName.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user