windows screen image

This commit is contained in:
Denis Molony 2019-10-22 16:02:54 +10:00
parent 9bde1564a2
commit 8f1974def9
3 changed files with 35 additions and 6 deletions

View File

@ -37,6 +37,8 @@ Double-click a disk from the Disk Tree tab and a new tab appears. This tab conta
#### Detailed sector display #### Detailed sector display
Click on any sector in the Disk Layout panel and the Output panel will display the contents of that sector. If it is a recognised sector type, it will be formatted for easier reading. Click on any sector in the Disk Layout panel and the Output panel will display the contents of that sector. If it is a recognised sector type, it will be formatted for easier reading.
![Sector details](resources/sector.png?raw=true "Sector details") ![Sector details](resources/sector.png?raw=true "Sector details")
#### Windows
![Windows](resources/windows.png?raw=true "Windows")
#### Hard disk #### Hard disk
![Hard disk](resources/disk3.png?raw=true "Hard disk") ![Hard disk](resources/disk3.png?raw=true "Hard disk")
#### Pascal code #### Pascal code

BIN
resources/windows.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

View File

@ -18,13 +18,15 @@ import com.bytezone.diskbrowser.gui.DataSource;
import com.bytezone.diskbrowser.gui.ProdosPreferences; import com.bytezone.diskbrowser.gui.ProdosPreferences;
import com.bytezone.diskbrowser.utilities.HexFormatter; import com.bytezone.diskbrowser.utilities.HexFormatter;
// -----------------------------------------------------------------------------------//
public class ProdosDisk extends AbstractFormattedDisk public class ProdosDisk extends AbstractFormattedDisk
// -----------------------------------------------------------------------------------//
{ {
static ProdosPreferences prodosPreferences; // set by MenuHandler static ProdosPreferences prodosPreferences; // set by MenuHandler
protected final DateFormat df = DateFormat.getInstance (); final DateFormat df = DateFormat.getInstance ();
protected final SimpleDateFormat sdf = new SimpleDateFormat ("d-MMM-yy"); final SimpleDateFormat sdf = new SimpleDateFormat ("d-MMM-yy");
protected final SimpleDateFormat stf = new SimpleDateFormat ("H:mm"); final SimpleDateFormat stf = new SimpleDateFormat ("H:mm");
final SectorType dosSector = new SectorType ("Bootstrap Loader", Color.lightGray); final SectorType dosSector = new SectorType ("Bootstrap Loader", Color.lightGray);
final SectorType catalogSector = new SectorType ("Catalog", new Color (0, 200, 0)); final SectorType catalogSector = new SectorType ("Catalog", new Color (0, 200, 0));
@ -35,19 +37,23 @@ public class ProdosDisk extends AbstractFormattedDisk
final SectorType dataSector = new SectorType ("Data", Color.red); final SectorType dataSector = new SectorType ("Data", Color.red);
final SectorType extendedKeySector = new SectorType ("Extended key", Color.gray); final SectorType extendedKeySector = new SectorType ("Extended key", Color.gray);
private final List<DirectoryHeader> headerEntries = new ArrayList<DirectoryHeader> (); private final List<DirectoryHeader> headerEntries = new ArrayList<> ();
protected VolumeDirectoryHeader vdh; VolumeDirectoryHeader vdh;
private final DefaultMutableTreeNode volumeNode; private final DefaultMutableTreeNode volumeNode;
private final NodeComparator nodeComparator = new NodeComparator (); private final NodeComparator nodeComparator = new NodeComparator ();
private static final boolean debug = false; private static final boolean debug = false;
// ---------------------------------------------------------------------------------//
public static void setProdosPreferences (ProdosPreferences prodosPreferences) public static void setProdosPreferences (ProdosPreferences prodosPreferences)
// ---------------------------------------------------------------------------------//
{ {
ProdosDisk.prodosPreferences = prodosPreferences; ProdosDisk.prodosPreferences = prodosPreferences;
} }
// ---------------------------------------------------------------------------------//
public ProdosDisk (Disk disk) public ProdosDisk (Disk disk)
// ---------------------------------------------------------------------------------//
{ {
super (disk); super (disk);
@ -94,8 +100,10 @@ public class ProdosDisk extends AbstractFormattedDisk
} }
} }
// ---------------------------------------------------------------------------------//
private void processDirectoryBlock (int block, FileEntry parent, private void processDirectoryBlock (int block, FileEntry parent,
DefaultMutableTreeNode parentNode) DefaultMutableTreeNode parentNode)
// ---------------------------------------------------------------------------------//
{ {
DirectoryHeader localHeader = null; DirectoryHeader localHeader = null;
SectorType currentSectorType = null; SectorType currentSectorType = null;
@ -188,12 +196,16 @@ public class ProdosDisk extends AbstractFormattedDisk
} }
} }
// ---------------------------------------------------------------------------------//
public boolean isReservedAddress (int blockNo) public boolean isReservedAddress (int blockNo)
// ---------------------------------------------------------------------------------//
{ {
return false; return false;
} }
// ---------------------------------------------------------------------------------//
public static boolean isCorrectFormat (AppleDisk disk) public static boolean isCorrectFormat (AppleDisk disk)
// ---------------------------------------------------------------------------------//
{ {
disk.setInterleave (1); disk.setInterleave (1);
if (checkFormat (disk)) if (checkFormat (disk))
@ -202,7 +214,9 @@ public class ProdosDisk extends AbstractFormattedDisk
return checkFormat (disk); return checkFormat (disk);
} }
// ---------------------------------------------------------------------------------//
public static boolean checkFormat (AppleDisk disk) public static boolean checkFormat (AppleDisk disk)
// ---------------------------------------------------------------------------------//
{ {
byte[] buffer = disk.readSector (2); // Prodos KEY BLOCK byte[] buffer = disk.readSector (2); // Prodos KEY BLOCK
if (debug) if (debug)
@ -224,22 +238,28 @@ public class ProdosDisk extends AbstractFormattedDisk
return true; return true;
} }
// ---------------------------------------------------------------------------------//
public DataSource getFile (int fileNo) public DataSource getFile (int fileNo)
// ---------------------------------------------------------------------------------//
{ {
if (fileNo == 0) if (fileNo == 0)
return ((VolumeDirectoryHeader) headerEntries.get (0)).getDataSource (); return ((VolumeDirectoryHeader) headerEntries.get (0)).getDataSource ();
return fileEntries.get (fileNo - 1).getDataSource (); return fileEntries.get (fileNo - 1).getDataSource ();
} }
// ---------------------------------------------------------------------------------//
@Override @Override
public AppleFileSource getCatalog () public AppleFileSource getCatalog ()
// ---------------------------------------------------------------------------------//
{ {
return new DefaultAppleFileSource ("Catalog", headerEntries.get (0).getDataSource (), return new DefaultAppleFileSource ("Catalog", headerEntries.get (0).getDataSource (),
this); this);
} }
// ---------------------------------------------------------------------------------//
@Override @Override
public DataSource getFormattedSector (DiskAddress da) public DataSource getFormattedSector (DiskAddress da)
// ---------------------------------------------------------------------------------//
{ {
if (da.getBlock () == 0) if (da.getBlock () == 0)
return bootSector; return bootSector;
@ -264,15 +284,19 @@ public class ProdosDisk extends AbstractFormattedDisk
return super.getFormattedSector (da); return super.getFormattedSector (da);
} }
// ---------------------------------------------------------------------------------//
@Override @Override
public List<DiskAddress> getFileSectors (int fileNo) public List<DiskAddress> getFileSectors (int fileNo)
// ---------------------------------------------------------------------------------//
{ {
if (fileNo == 0) if (fileNo == 0)
return ((VolumeDirectoryHeader) headerEntries.get (0)).getSectors (); return ((VolumeDirectoryHeader) headerEntries.get (0)).getSectors ();
return fileEntries.get (fileNo - 1).getSectors (); return fileEntries.get (fileNo - 1).getSectors ();
} }
// ---------------------------------------------------------------------------------//
public void sortNodes (DefaultMutableTreeNode node) public void sortNodes (DefaultMutableTreeNode node)
// ---------------------------------------------------------------------------------//
{ {
int totalChildren = node.getChildCount (); int totalChildren = node.getChildCount ();
if (totalChildren == 0) if (totalChildren == 0)
@ -296,8 +320,10 @@ public class ProdosDisk extends AbstractFormattedDisk
} }
} }
// ---------------------------------------------------------------------------------//
@Override @Override
public String toString () public String toString ()
// ---------------------------------------------------------------------------------//
{ {
StringBuffer text = new StringBuffer (); StringBuffer text = new StringBuffer ();
String newLine = String.format ("%n"); String newLine = String.format ("%n");
@ -319,7 +345,9 @@ public class ProdosDisk extends AbstractFormattedDisk
return text.toString (); return text.toString ();
} }
// ---------------------------------------------------------------------------------//
class NodeComparator implements Comparator<DefaultMutableTreeNode> class NodeComparator implements Comparator<DefaultMutableTreeNode>
// ---------------------------------------------------------------------------------//
{ {
@Override @Override
public int compare (DefaultMutableTreeNode o1, DefaultMutableTreeNode o2) public int compare (DefaultMutableTreeNode o1, DefaultMutableTreeNode o2)
@ -335,6 +363,5 @@ public class ProdosDisk extends AbstractFormattedDisk
return name1.compareTo (name2); return name1.compareTo (name2);
} }
} }
} }