Added detection of Merlin assembly files.

This commit is contained in:
Robert Greene 2004-06-10 02:52:28 +00:00
parent 66a3f52faf
commit 163dd10769
2 changed files with 18 additions and 0 deletions

View File

@ -29,6 +29,7 @@ import com.webcodepro.applecommander.storage.FileEntry;
import com.webcodepro.applecommander.storage.FileFilter; import com.webcodepro.applecommander.storage.FileFilter;
import com.webcodepro.applecommander.storage.FormattedDisk; import com.webcodepro.applecommander.storage.FormattedDisk;
import com.webcodepro.applecommander.storage.filters.ApplesoftFileFilter; import com.webcodepro.applecommander.storage.filters.ApplesoftFileFilter;
import com.webcodepro.applecommander.storage.filters.AssemblySourceFileFilter;
import com.webcodepro.applecommander.storage.filters.BinaryFileFilter; import com.webcodepro.applecommander.storage.filters.BinaryFileFilter;
import com.webcodepro.applecommander.storage.filters.GraphicsFileFilter; import com.webcodepro.applecommander.storage.filters.GraphicsFileFilter;
import com.webcodepro.applecommander.storage.filters.IntegerBasicFileFilter; import com.webcodepro.applecommander.storage.filters.IntegerBasicFileFilter;
@ -388,6 +389,8 @@ public class DosFileEntry implements FileEntry {
return new ApplesoftFileFilter(); return new ApplesoftFileFilter();
} else if (isIntegerBasicFile()) { } else if (isIntegerBasicFile()) {
return new IntegerBasicFileFilter(); return new IntegerBasicFileFilter();
} else if (isAssemblySourceFile()) {
return new AssemblySourceFileFilter();
} else if (isTextFile()) { } else if (isTextFile()) {
return new TextFileFilter(); return new TextFileFilter();
} else if (isBinaryFile()) { } else if (isBinaryFile()) {
@ -406,6 +409,16 @@ public class DosFileEntry implements FileEntry {
} }
return new BinaryFileFilter(); return new BinaryFileFilter();
} }
/**
* Determine if this is an assembly source code file.
*/
public boolean isAssemblySourceFile() {
boolean rightFiletype = isTextFile() || isBinaryFile();
if (rightFiletype && getFilename().endsWith(".S")) return true;
if (rightFiletype && getFilename().startsWith("T.")) return true;
return false;
}
/** /**
* Determine if this is a text file. * Determine if this is a text file.

View File

@ -33,6 +33,7 @@ import com.webcodepro.applecommander.storage.filters.AppleWorksDataBaseFileFilte
import com.webcodepro.applecommander.storage.filters.AppleWorksSpreadSheetFileFilter; import com.webcodepro.applecommander.storage.filters.AppleWorksSpreadSheetFileFilter;
import com.webcodepro.applecommander.storage.filters.AppleWorksWordProcessorFileFilter; import com.webcodepro.applecommander.storage.filters.AppleWorksWordProcessorFileFilter;
import com.webcodepro.applecommander.storage.filters.ApplesoftFileFilter; import com.webcodepro.applecommander.storage.filters.ApplesoftFileFilter;
import com.webcodepro.applecommander.storage.filters.AssemblySourceFileFilter;
import com.webcodepro.applecommander.storage.filters.BinaryFileFilter; import com.webcodepro.applecommander.storage.filters.BinaryFileFilter;
import com.webcodepro.applecommander.storage.filters.GraphicsFileFilter; import com.webcodepro.applecommander.storage.filters.GraphicsFileFilter;
import com.webcodepro.applecommander.storage.filters.IntegerBasicFileFilter; import com.webcodepro.applecommander.storage.filters.IntegerBasicFileFilter;
@ -456,6 +457,10 @@ public class ProdosFileEntry extends ProdosCommonEntry implements FileEntry {
switch (filetype) { switch (filetype) {
case 0x04: // TXT case 0x04: // TXT
if (getFilename().endsWith(".S")) {
return new AssemblySourceFileFilter();
}
return new TextFileFilter();
case 0xb0: // SRC case 0xb0: // SRC
return new TextFileFilter(); return new TextFileFilter();
case 0x19: // ADB case 0x19: // ADB