mirror of
https://github.com/AppleCommander/AppleCommander.git
synced 2024-10-31 16:04:51 +00:00
Make start address optional in ac putFile(), default 0x2000 if required; fix warning.
This commit is contained in:
parent
b403b3a4e9
commit
9fda5e9f42
@ -100,7 +100,7 @@ CreateDirectoryMenuItem=Create Directory...
|
||||
CommandLineErrorMessage = Error: {0}
|
||||
CommandLineNoMatchMessage = {0}: No match.
|
||||
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 <imagename> <filename> export file from image to stdout.\n-g <imagename> <filename> get raw file from image to stdout.\n-p <imagename> <filename> <type> [$]<addr> put stdin\n in filename on image, using file type and address.\n-d <imagename> <filename> delete file from image.\n-cc65 <imagename> <filename> <type> put stdin with cc65 header\n in filename on image, using file type and address from 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.
|
||||
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 <imagename> <filename> export file from image to stdout.\n-g <imagename> <filename> get raw file from image to stdout.\n-p <imagename> <filename> <type> [[$|0x]<addr>] put stdin\n in filename on image, using file type and address [0x2000].\n-d <imagename> <filename> delete file from image.\n-cc65 <imagename> <filename> <type> put stdin with cc65 header\n in filename on image, using file type and address from 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
|
||||
|
@ -61,7 +61,8 @@ public class ac {
|
||||
} else if ("-g".equalsIgnoreCase(args[0])) { //$NON-NLS-1$
|
||||
getFile(args[1], args[2], false);
|
||||
} else if ("-p".equalsIgnoreCase(args[0])) { //$NON-NLS-1$
|
||||
putFile(args[1], args[2], args[3], args[4]);
|
||||
putFile(args[1], args[2], args[3],
|
||||
(args.length > 4 ? args[4] : "0x2000"));
|
||||
} else if ("-d".equalsIgnoreCase(args[0])) { //$NON-NLS-1$
|
||||
deleteFile(args[1], args[2]);
|
||||
} else if ("-i".equalsIgnoreCase(args[0])) { //$NON-NLS-1$
|
||||
@ -121,9 +122,10 @@ public class ac {
|
||||
throws IOException, DiskFullException {
|
||||
|
||||
byte[] header = new byte[4];
|
||||
int byteCount = System.in.read(header, 0, 4);
|
||||
int address = AppleUtil.getWordValue(header, 0);
|
||||
putFile(imageName, fileName, fileType, Integer.toString(address));
|
||||
if (System.in.read(header, 0, 4) == 4) {
|
||||
int address = AppleUtil.getWordValue(header, 0);
|
||||
putFile(imageName, fileName, fileType, Integer.toString(address));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -303,7 +305,7 @@ public class ac {
|
||||
int i = 0;
|
||||
try {
|
||||
s = s.trim().toLowerCase();
|
||||
if (s.startsWith("$")) { // 6502, Motorola
|
||||
if (s.startsWith("$")) { // 650, Motorola
|
||||
i = Integer.parseInt(s.substring(1), 0x10);
|
||||
} else if (s.startsWith("0x")) { // Java, C
|
||||
i = Integer.parseInt(s.substring(2), 0x10);
|
||||
|
Loading…
Reference in New Issue
Block a user