mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2024-11-29 11:49:29 +00:00
tidying
This commit is contained in:
parent
466633bb4f
commit
5402449439
@ -54,11 +54,19 @@ abstract class DiskReader
|
||||
return decodeSector (buffer, 0);
|
||||
}
|
||||
|
||||
// reverse 2 bits - 0 <= bits <= 3
|
||||
// ---------------------------------------------------------------------------------//
|
||||
// abstract functions
|
||||
static int reverse (int bits)
|
||||
// ---------------------------------------------------------------------------------//
|
||||
{
|
||||
return bits == 1 ? 2 : bits == 2 ? 1 : bits;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------//
|
||||
abstract byte[] decodeSector (byte[] buffer, int offset) throws DiskNibbleException;
|
||||
// ---------------------------------------------------------------------------------//
|
||||
|
||||
// ---------------------------------------------------------------------------------//
|
||||
abstract byte[] encodeSector (byte[] buffer);
|
||||
// ---------------------------------------------------------------------------------//
|
||||
}
|
||||
|
@ -103,12 +103,4 @@ class DiskReader16Sector extends DiskReader
|
||||
|
||||
return encodedBuffer;
|
||||
}
|
||||
|
||||
// reverse 2 bits - 0 <= bits <= 3
|
||||
// ---------------------------------------------------------------------------------//
|
||||
private static int reverse (int bits)
|
||||
// ---------------------------------------------------------------------------------//
|
||||
{
|
||||
return bits == 1 ? 2 : bits == 2 ? 1 : bits;
|
||||
}
|
||||
}
|
||||
|
@ -113,13 +113,13 @@ public class WozFile
|
||||
sectors.addAll (track.sectors);
|
||||
Collections.sort (sectors);
|
||||
|
||||
diskBuffer = new byte[800 * info.sides * SECTOR_SIZE * 2];
|
||||
diskBuffer = new byte[800 * info.sides * BLOCK_SIZE];
|
||||
ptr = 0;
|
||||
|
||||
for (Sector sector : sectors)
|
||||
{
|
||||
sector.pack (diskBuffer, ptr);
|
||||
ptr += 512;
|
||||
sector.pack35 (diskBuffer, ptr);
|
||||
ptr += BLOCK_SIZE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -646,7 +646,7 @@ public class WozFile
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------//
|
||||
void pack (byte[] diskBuffer, int ptr) throws DiskNibbleException
|
||||
void pack35 (byte[] diskBuffer, int ptr) throws DiskNibbleException
|
||||
// ---------------------------------------------------------------------------------//
|
||||
{
|
||||
DiskReader diskReader = DiskReader.getInstance (0);
|
||||
@ -656,7 +656,7 @@ public class WozFile
|
||||
byte[] decodedBuffer = diskReader.decodeSector (track.newBuffer, dataOffset + 4);
|
||||
|
||||
// return 512 bytes (ignore the 12 tag bytes)
|
||||
System.arraycopy (decodedBuffer, 12, diskBuffer, ptr, 512);
|
||||
System.arraycopy (decodedBuffer, DiskReaderGCR.TAG_SIZE, diskBuffer, ptr, 512);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------//
|
||||
|
Loading…
Reference in New Issue
Block a user