mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2024-11-29 11:49:29 +00:00
tidying
This commit is contained in:
parent
33b58e8d79
commit
7ec277e0a3
@ -9,8 +9,13 @@ public class ExtendedKeyBlock
|
|||||||
private final ProdosDisk disk;
|
private final ProdosDisk disk;
|
||||||
private final int ptr;
|
private final int ptr;
|
||||||
|
|
||||||
MiniEntry dataFork;
|
private MiniEntry dataFork;
|
||||||
MiniEntry resourceFork;
|
private MiniEntry resourceFork;
|
||||||
|
|
||||||
|
enum ForkType
|
||||||
|
{
|
||||||
|
DATA, RESOURCE;
|
||||||
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------------//
|
// ---------------------------------------------------------------------------------//
|
||||||
public ExtendedKeyBlock (ProdosDisk disk, int ptr)
|
public ExtendedKeyBlock (ProdosDisk disk, int ptr)
|
||||||
@ -21,15 +26,30 @@ public class ExtendedKeyBlock
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------------//
|
// ---------------------------------------------------------------------------------//
|
||||||
void addMiniEntry (int type, byte storageType, int keyBlock, int blocksUsed, int eof)
|
void addMiniEntry (ForkType type, FileEntry fileEntry)
|
||||||
// ---------------------------------------------------------------------------------//
|
// ---------------------------------------------------------------------------------//
|
||||||
{
|
{
|
||||||
MiniEntry miniEntry = new MiniEntry (storageType, keyBlock, blocksUsed, eof);
|
addMiniEntry (type, fileEntry.storageType, fileEntry.keyPointer, fileEntry.blocksUsed,
|
||||||
|
fileEntry.eof);
|
||||||
|
}
|
||||||
|
|
||||||
if (type == 1) // enum??
|
// ---------------------------------------------------------------------------------//
|
||||||
dataFork = miniEntry;
|
void addMiniEntry (ForkType type, FileWriter fileWriter)
|
||||||
|
// ---------------------------------------------------------------------------------//
|
||||||
|
{
|
||||||
|
addMiniEntry (type, fileWriter.storageType, fileWriter.keyPointer,
|
||||||
|
fileWriter.blocksUsed, fileWriter.eof);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------------//
|
||||||
|
private void addMiniEntry (ForkType type, byte storageType, int keyPointer,
|
||||||
|
int blocksUsed, int eof)
|
||||||
|
// ---------------------------------------------------------------------------------//
|
||||||
|
{
|
||||||
|
if (type == ForkType.DATA)
|
||||||
|
dataFork = new MiniEntry (storageType, keyPointer, blocksUsed, eof);
|
||||||
else
|
else
|
||||||
resourceFork = miniEntry;
|
resourceFork = new MiniEntry (storageType, keyPointer, blocksUsed, eof);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------------//
|
// ---------------------------------------------------------------------------------//
|
||||||
|
@ -19,6 +19,8 @@ import java.util.Map;
|
|||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.TreeMap;
|
import java.util.TreeMap;
|
||||||
|
|
||||||
|
import com.bytezone.diskbrowser.prodos.write.ExtendedKeyBlock.ForkType;
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------------//
|
// -----------------------------------------------------------------------------------//
|
||||||
public class ProdosDisk
|
public class ProdosDisk
|
||||||
// -----------------------------------------------------------------------------------//
|
// -----------------------------------------------------------------------------------//
|
||||||
@ -214,10 +216,8 @@ public class ProdosDisk
|
|||||||
|
|
||||||
ExtendedKeyBlock extendedKeyBlock = new ExtendedKeyBlock (this, blockNo * BLOCK_SIZE);
|
ExtendedKeyBlock extendedKeyBlock = new ExtendedKeyBlock (this, blockNo * BLOCK_SIZE);
|
||||||
|
|
||||||
extendedKeyBlock.addMiniEntry (1, fileEntry.storageType, fileEntry.keyPointer,
|
extendedKeyBlock.addMiniEntry (ForkType.DATA, fileEntry);
|
||||||
fileEntry.blocksUsed, fileEntry.eof);
|
extendedKeyBlock.addMiniEntry (ForkType.RESOURCE, fileWriter);
|
||||||
extendedKeyBlock.addMiniEntry (2, fileWriter.storageType, fileWriter.keyPointer,
|
|
||||||
fileWriter.blocksUsed, fileWriter.eof);
|
|
||||||
|
|
||||||
fileEntry.keyPointer = blockNo; // extended key block
|
fileEntry.keyPointer = blockNo; // extended key block
|
||||||
fileEntry.storageType = 0x05; // extended
|
fileEntry.storageType = 0x05; // extended
|
||||||
|
Loading…
Reference in New Issue
Block a user