dmolony-DiskBrowser/src/com/bytezone/diskbrowser/applefile/DeviceDriver.java

42 lines
1.5 KiB
Java
Raw Normal View History

2017-01-22 06:55:51 +00:00
package com.bytezone.diskbrowser.applefile;
2020-02-07 23:21:13 +00:00
// -----------------------------------------------------------------------------------//
2017-01-22 06:55:51 +00:00
public class DeviceDriver extends AbstractFile
2020-02-07 23:21:13 +00:00
// -----------------------------------------------------------------------------------//
2017-01-22 06:55:51 +00:00
{
private final int auxType;
private final int classifications;
private final int driverClass;
private final boolean inactive;
2020-02-07 23:21:13 +00:00
// ---------------------------------------------------------------------------------//
2017-01-22 06:55:51 +00:00
public DeviceDriver (String name, byte[] buffer, int auxType)
2020-02-07 23:21:13 +00:00
// ---------------------------------------------------------------------------------//
2017-01-22 06:55:51 +00:00
{
super (name, buffer);
this.auxType = auxType;
classifications = auxType & 0xFF;
driverClass = (auxType & 0x7F00) >>> 8;
inactive = (auxType & 0x8000) != 0;
}
2020-02-07 23:21:13 +00:00
// ---------------------------------------------------------------------------------//
2017-01-22 06:55:51 +00:00
@Override
public String getText ()
2020-02-07 23:21:13 +00:00
// ---------------------------------------------------------------------------------//
2017-01-22 06:55:51 +00:00
{
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));
2018-04-25 20:41:03 +00:00
text.append (String.format ("Aux type .......... %d%n", auxType));
2017-01-22 06:55:51 +00:00
text.append (String.format ("Inactive .......... %s%n", inactive ? "True" : "False"));
text.deleteCharAt (text.length () - 1);
return text.toString ();
}
}