Device Driver

This commit is contained in:
Denis Molony 2017-01-22 17:55:51 +11:00
parent 66f0602e23
commit ec58b667f3
3 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,35 @@
package com.bytezone.diskbrowser.applefile;
public class DeviceDriver extends AbstractFile
{
private final int auxType;
private final int classifications;
private final int driverClass;
private final boolean inactive;
public DeviceDriver (String name, byte[] buffer, int auxType)
{
super (name, buffer);
this.auxType = auxType;
classifications = auxType & 0xFF;
driverClass = (auxType & 0x7F00) >>> 8;
inactive = (auxType & 0x8000) != 0;
}
@Override
public String getText ()
{
StringBuilder text = new StringBuilder ("Name : " + name + "\n\n");
text.append ("Apple IIGS Device Driver File\n\n");
text.append (String.format ("Classifications ... %02X%n", classifications));
text.append (String.format ("Driver Class ...... %02X%n", driverClass));
text.append (String.format ("Inactive .......... %s%n", inactive ? "True" : "False"));
text.deleteCharAt (text.length () - 1);
return text.toString ();
}
}

View File

@ -347,6 +347,9 @@ class FileEntry extends CatalogEntry implements ProdosConstants
// new DefaultAppleFile (name, buffer, "S16 Apple IIgs Application Program");
file = new AssemblerProgram (name, buffer, auxType);
break;
case FILE_TYPE_IIGS_DEVICE_DRIVER:
file = new DeviceDriver (name, exactBuffer, auxType);
break;
case FILE_TYPE_ICN:
file = new IconFile (name, exactBuffer);
break;

View File

@ -15,6 +15,7 @@ public interface ProdosConstants
int FILE_TYPE_IIGS_OBJECT = 0xB1;
// int FILE_TYPE_FORKED_FILE = 0xB3; // S16
int FILE_TYPE_IIGS_APPLICATION = 0xB3;
int FILE_TYPE_IIGS_DEVICE_DRIVER = 0xBB;
int FILE_TYPE_GSOS_FILE_SYSTEM_TRANSLATOR = 0xBD;
int FILE_TYPE_PNT = 0xC0;
int FILE_TYPE_PIC = 0xC1;