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