mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2025-01-30 18:31:20 +00:00
forgot this
This commit is contained in:
parent
c18806a0d5
commit
9f9580f4ca
53
src/com/bytezone/diskbrowser/applefile/PascalArea.java
Normal file
53
src/com/bytezone/diskbrowser/applefile/PascalArea.java
Normal file
@ -0,0 +1,53 @@
|
||||
package com.bytezone.diskbrowser.applefile;
|
||||
|
||||
import com.bytezone.diskbrowser.utilities.HexFormatter;
|
||||
|
||||
// -----------------------------------------------------------------------------------//
|
||||
public class PascalArea extends AbstractFile
|
||||
// -----------------------------------------------------------------------------------//
|
||||
{
|
||||
int size;
|
||||
int volumes;
|
||||
String ppmName;
|
||||
int start;
|
||||
int length;
|
||||
int defaultUnit;
|
||||
boolean writeProtected;
|
||||
int oldDriver;
|
||||
|
||||
// ---------------------------------------------------------------------------------//
|
||||
public PascalArea (String name, byte[] buffer)
|
||||
// ---------------------------------------------------------------------------------//
|
||||
{
|
||||
super (name, buffer);
|
||||
|
||||
size = HexFormatter.unsignedShort (buffer, 0);
|
||||
volumes = HexFormatter.unsignedShort (buffer, 2);
|
||||
ppmName = HexFormatter.getPascalString (buffer, 4);
|
||||
start = HexFormatter.unsignedShort (buffer, 8);
|
||||
length = HexFormatter.unsignedShort (buffer, 11);
|
||||
defaultUnit = buffer[13] & 0xFF;
|
||||
oldDriver = HexFormatter.unsignedShort (buffer, 14);
|
||||
// writeProtected = buffer[12] != 0;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------//
|
||||
@Override
|
||||
public String getText ()
|
||||
// ---------------------------------------------------------------------------------//
|
||||
{
|
||||
StringBuilder text = new StringBuilder (getHeader ());
|
||||
|
||||
text.append (String.format ("Size ............. %04X (%<,d)%n", size));
|
||||
text.append (String.format ("Volumes .......... %04X%n", volumes));
|
||||
text.append (String.format ("PPM .............. %s%n", ppmName));
|
||||
text.append (String.format ("Start ............ %04X (%<,d)%n", start));
|
||||
text.append (String.format ("Length ........... %04X (%<,d)%n", length));
|
||||
text.append (String.format ("Default Unit ..... %d%n", defaultUnit));
|
||||
text.append (
|
||||
String.format ("Write Protected .. %s%n", writeProtected ? "True" : "False"));
|
||||
text.append (String.format ("Old driver ....... %04X (%<,d)%n", oldDriver));
|
||||
|
||||
return text.toString ();
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user