mirror of
https://github.com/AppleCommander/AppleCommander.git
synced 2024-12-05 18:49:30 +00:00
Adding getAddress method to FileEntry.
This commit is contained in:
parent
3396e285d2
commit
0842f1f31f
@ -131,6 +131,11 @@ public interface FileEntry {
|
||||
*/
|
||||
public abstract void setAddress(int address);
|
||||
|
||||
/**
|
||||
* Get the address that this file loads at.
|
||||
*/
|
||||
public abstract int getAddress();
|
||||
|
||||
/**
|
||||
* Indicates that this filetype can be compiled.
|
||||
* Compile is a somewhat arbitrary term, as the code may be
|
||||
|
@ -476,6 +476,14 @@ public class CpmFileEntry implements FileEntry {
|
||||
public void setAddress(int address) {
|
||||
// not applicable
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the address that this file loads at.
|
||||
*/
|
||||
public int getAddress() {
|
||||
return 0; // Not applicable
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Indicates that this filetype can be compiled.
|
||||
|
@ -285,6 +285,7 @@ public class DosFileEntry implements FileEntry {
|
||||
list.add(numberFormat.format(getSectorsUsed()));
|
||||
list.add(isDeleted() ? textBundle.get("Deleted") : ""); //$NON-NLS-1$//$NON-NLS-2$
|
||||
list.add("T" + getTrack() + " S" + getSector()); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
list.add("A=$" + AppleUtil.getFormattedWord(getAddress()));
|
||||
break;
|
||||
default: // FILE_DISPLAY_STANDARD
|
||||
list.add(getFilename());
|
||||
@ -496,6 +497,17 @@ public class DosFileEntry implements FileEntry {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the address that this file loads at.
|
||||
*/
|
||||
public int getAddress() {
|
||||
if (needsAddress()) {
|
||||
byte[] rawData = disk.getFileData(this);
|
||||
return AppleUtil.getWordValue(rawData, 0);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates that this filetype can be compiled.
|
||||
*/
|
||||
|
@ -376,6 +376,8 @@ public class DosFormatDisk extends FormattedDisk {
|
||||
FileColumnHeader.ALIGN_CENTER, "deleted"));
|
||||
list.add(new FileColumnHeader(textBundle.get("DosFormatDisk.TrackAndSectorList"), 7,
|
||||
FileColumnHeader.ALIGN_CENTER, "trackAndSectorList"));
|
||||
list.add(new FileColumnHeader(textBundle.get("DosFormatDisk.FileAddress"), 7,
|
||||
FileColumnHeader.ALIGN_RIGHT, "address"));
|
||||
break;
|
||||
default: // FILE_DISPLAY_STANDARD
|
||||
list.addAll(super.getFileColumnHeaders(displayMode));
|
||||
|
@ -334,6 +334,13 @@ public class GutenbergFileEntry implements FileEntry {
|
||||
public void setAddress(int address) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the address that this file loads at.
|
||||
*/
|
||||
public int getAddress() {
|
||||
return 0; // Does not apply.
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates that this filetype can be compiled.
|
||||
*/
|
||||
|
@ -245,6 +245,14 @@ public class NakedosFileEntry implements FileEntry {
|
||||
*/
|
||||
public void setAddress(int address) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the address that this file loads at.
|
||||
*/
|
||||
public int getAddress() {
|
||||
return 0; // Does not apply.
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Indicates that this filetype can be compiled.
|
||||
|
@ -511,6 +511,13 @@ public class PascalFileEntry implements FileEntry {
|
||||
// Does not apply.
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the address that this file loads at.
|
||||
*/
|
||||
public int getAddress() {
|
||||
return 0; // Does not apply.
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates that this filetype can be compiled.
|
||||
*/
|
||||
|
@ -612,6 +612,17 @@ public class ProdosFileEntry extends ProdosCommonEntry implements FileEntry {
|
||||
writeFileEntry(fileEntry);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the address that this file loads at.
|
||||
*/
|
||||
public int getAddress() {
|
||||
if (needsAddress()) {
|
||||
return getAuxiliaryType();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Indicates that this filetype can be compiled.
|
||||
*/
|
||||
|
@ -154,6 +154,7 @@ DosFormatDisk.SectorsOnDisk=Sectors On Disk
|
||||
DosFormatDisk.Type=Type
|
||||
DosFormatDisk.SizeInSectors=Size (sectors)
|
||||
DosFormatDisk.TrackAndSectorList=Track/Sector List
|
||||
DosFormatDisk.FileAddress=Address
|
||||
DosFormatDisk.InvalidFileEntryError=Must have a DOS 3.3 file entry\!
|
||||
DosFormatDisk.NotEnoughSectorsError=This file requires {0} sectors but there are only {1} sectors available on the disk.
|
||||
DosFormatDisk.InvalidTrackAndSectorCombinationError=Invalid track ({0}), sector ({1}) combination.
|
||||
|
Loading…
Reference in New Issue
Block a user