Add putcc65 as a visible external method so we can call it from the ant interface

This commit is contained in:
2012-07-09 03:54:59 +00:00
parent 4580a7183f
commit a04ee91c3d
1 changed files with 15 additions and 2 deletions

View File

@ -142,8 +142,7 @@ public class ac {
* Put fileName from the local filesytem into the file named fileOnImageName on the disk named imageName;
* Note: only volume level supported; input size unlimited.
*/
public static void putFile(String fileName, String imageName, String fileOnImageName, String fileType,
String address) throws IOException, DiskFullException {
public static void putFile(String fileName, String imageName, String fileOnImageName, String fileType, String address) throws IOException, DiskFullException {
Name name = new Name(fileOnImageName);
File file = new File(fileName);
if (!file.canRead())
@ -200,6 +199,20 @@ public class ac {
}
}
/**
* Put file fileName into the file named fileOnImageName on the disk named imageName;
* Assume a cc65 style four-byte header with start address in bytes 0-1.
*/
public static void putCC65(String fileName, String imageName, String fileOnImageName, String fileType)
throws IOException, DiskFullException {
byte[] header = new byte[4];
if (System.in.read(header, 0, 4) == 4) {
int address = AppleUtil.getWordValue(header, 0);
putFile(fileName, imageName, fileOnImageName, fileType, Integer.toString(address));
}
}
/**
* 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.