mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2025-02-06 04:29:56 +00:00
tidying
This commit is contained in:
parent
4767c317d0
commit
2a6fd74013
@ -16,10 +16,9 @@ import com.bytezone.diskbrowser.utilities.Utility;
|
||||
public abstract class HiResImage extends AbstractFile
|
||||
// -----------------------------------------------------------------------------------//
|
||||
{
|
||||
static final String[] auxTypes =
|
||||
{ "Paintworks Packed SHR Image", "Packed Super Hi-Res Image",
|
||||
"Super Hi-Res Image (Apple Preferred Format)", "Packed QuickDraw II PICT File",
|
||||
"Packed Super Hi-Res 3200 color image" };
|
||||
static final String[] auxTypes = { "Paintworks Packed SHR Image",
|
||||
"Packed Super Hi-Res Image", "Super Hi-Res Image (Apple Preferred Format)",
|
||||
"Packed QuickDraw II PICT File", "Packed Super Hi-Res 3200 color image" };
|
||||
static final int COLOR_TABLE_SIZE = 32;
|
||||
static final int COLOR_TABLE_OFFSET_AUX_0 = 32_256;
|
||||
static final int COLOR_TABLE_OFFSET_AUX_2 = 32_000;
|
||||
@ -90,7 +89,7 @@ public abstract class HiResImage extends AbstractFile
|
||||
// $C0 1000 .
|
||||
// $C0 8000 .
|
||||
// $C0 8001 .
|
||||
// $C0 8005 .
|
||||
// $C0 8005 6
|
||||
// $C0 8006 .
|
||||
// $C1 0042 4
|
||||
// $C1 0043 4
|
||||
@ -106,7 +105,7 @@ public abstract class HiResImage extends AbstractFile
|
||||
// 3 CompressedSlides.do
|
||||
// 4 System Addons.hdv
|
||||
// 5 gfx.po
|
||||
//
|
||||
// 6 Dream Grafix v1.02.po
|
||||
|
||||
// see also - https://docs.google.com/spreadsheets/d
|
||||
// /1rKR6A_bVniSCtIP_rrv8QLWJdj4h6jEU1jJj0AebWwg/edit#gid=0
|
||||
|
@ -31,6 +31,13 @@ public class Binary2
|
||||
{
|
||||
fileName = path.toFile ().getName ();
|
||||
buffer = Files.readAllBytes (path);
|
||||
read (buffer);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------//
|
||||
private void read (byte[] buffer)
|
||||
// ---------------------------------------------------------------------------------//
|
||||
{
|
||||
int ptr = 0;
|
||||
|
||||
do
|
||||
|
@ -19,7 +19,7 @@ abstract class LZW
|
||||
|
||||
int crc;
|
||||
int crcBase;
|
||||
int v3eof; // LZW/2 calculates the crc sans padding
|
||||
int v3eof; // LZW/2 calculates the crc without padding
|
||||
|
||||
private int byteBuffer; // one character buffer
|
||||
private int bitsLeft; // unused bits left in buffer
|
||||
|
@ -6,7 +6,7 @@ import com.bytezone.diskbrowser.utilities.HexFormatter;
|
||||
import com.bytezone.diskbrowser.utilities.Utility;
|
||||
|
||||
// -----------------------------------------------------------------------------------//
|
||||
class MasterHeader
|
||||
public class MasterHeader
|
||||
// -----------------------------------------------------------------------------------//
|
||||
{
|
||||
private static final byte[] NuFile =
|
||||
|
@ -39,8 +39,24 @@ public class NuFX
|
||||
// ---------------------------------------------------------------------------------//
|
||||
{
|
||||
buffer = Files.readAllBytes (path);
|
||||
volumeName = new VolumeName (path);
|
||||
volumeName = new VolumeName (path.getFileName ().toString ());
|
||||
read (buffer);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------//
|
||||
public NuFX (byte[] buffer, String fileName)
|
||||
// ---------------------------------------------------------------------------------//
|
||||
{
|
||||
this.buffer = buffer;
|
||||
this.volumeName = new VolumeName (fileName);
|
||||
|
||||
read (buffer);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------//
|
||||
void read (byte[] buffer)
|
||||
// ---------------------------------------------------------------------------------//
|
||||
{
|
||||
masterHeader = new MasterHeader (buffer);
|
||||
|
||||
int dataPtr = 48;
|
||||
@ -250,8 +266,8 @@ public class NuFX
|
||||
StringBuilder text = new StringBuilder ();
|
||||
|
||||
text.append (String.format (" %-15.15s Created:%-17s Mod:%-17s Recs:%5d%n%n",
|
||||
volumeName.getFileName (), masterHeader.getCreated2 (),
|
||||
masterHeader.getModified2 (), masterHeader.getTotalRecords ()));
|
||||
volumeName.volumeName, masterHeader.getCreated2 (), masterHeader.getModified2 (),
|
||||
masterHeader.getTotalRecords ()));
|
||||
|
||||
text.append (" Name Type Auxtyp Archived"
|
||||
+ " Fmat Size Un-Length\n");
|
||||
@ -288,27 +304,19 @@ public class NuFX
|
||||
|
||||
private String volumeName = "DiskBrowser";
|
||||
private int nameOffset = 0;
|
||||
private Path path;
|
||||
|
||||
// -------------------------------------------------------------------------------//
|
||||
VolumeName (Path path)
|
||||
VolumeName (String name)
|
||||
// -------------------------------------------------------------------------------//
|
||||
{
|
||||
this.path = path;
|
||||
volumeName = getFileName ();
|
||||
int pos = volumeName.lastIndexOf ('.');
|
||||
int pos = name.lastIndexOf ('.');
|
||||
if (pos > 0)
|
||||
volumeName = volumeName.substring (0, pos);
|
||||
if (volumeName.length () > 15)
|
||||
volumeName = volumeName.substring (0, 15);
|
||||
volumeName = volumeName.replace (' ', '.');
|
||||
}
|
||||
name = name.substring (0, pos);
|
||||
if (name.length () > 15)
|
||||
name = name.substring (0, 15);
|
||||
name = name.replace (' ', '.');
|
||||
|
||||
// -------------------------------------------------------------------------------//
|
||||
String getFileName ()
|
||||
// -------------------------------------------------------------------------------//
|
||||
{
|
||||
return path.getFileName ().toString ();
|
||||
this.volumeName = name;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------//
|
||||
|
Loading…
x
Reference in New Issue
Block a user