mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2025-01-13 16:32:37 +00:00
pass Disk first
This commit is contained in:
parent
06b4a4cfea
commit
f33f3f52c0
@ -72,7 +72,7 @@ public class DirectoryEntry implements AppleFileSource
|
||||
blockNumber = (b & 0x7F) * 4;
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
blocks.add (new AppleDiskAddress (blockNumber + i, disk));
|
||||
blocks.add (new AppleDiskAddress (disk, blockNumber + i));
|
||||
}
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@ public class DirectoryEntry implements AppleFileSource
|
||||
|
||||
int blockNumber = b * 4 + 48;
|
||||
for (int i = 0; i < 4; i++)
|
||||
blocks.add (new AppleDiskAddress (blockNumber + i, disk));
|
||||
blocks.add (new AppleDiskAddress (disk, blockNumber + i));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -372,9 +372,9 @@ public class AppleDisk implements Disk
|
||||
{
|
||||
System.out.println ("Invalid block : " + block);
|
||||
// return null;
|
||||
return new AppleDiskAddress (0, this);
|
||||
return new AppleDiskAddress (this, 0);
|
||||
}
|
||||
return new AppleDiskAddress (block, this);
|
||||
return new AppleDiskAddress (this, block);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -385,7 +385,7 @@ public class AppleDisk implements Disk
|
||||
for (int block : blocks)
|
||||
{
|
||||
assert (isValidAddress (block)) : "Invalid block : " + block;
|
||||
addressList.add (new AppleDiskAddress (block, this));
|
||||
addressList.add (new AppleDiskAddress (this, block));
|
||||
}
|
||||
return addressList;
|
||||
}
|
||||
@ -396,7 +396,7 @@ public class AppleDisk implements Disk
|
||||
// should this return null for invalid addresses?
|
||||
assert (isValidAddress (track, sector)) : "Invalid address : " + track + ", "
|
||||
+ sector;
|
||||
return new AppleDiskAddress (track, sector, this);
|
||||
return new AppleDiskAddress (this, track, sector);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -505,7 +505,7 @@ public class AppleDisk implements Disk
|
||||
{
|
||||
blockList = new ArrayList<DiskAddress> (blocks);
|
||||
for (int block = 0; block < blocks; block++)
|
||||
blockList.add (new AppleDiskAddress (block, this));
|
||||
blockList.add (new AppleDiskAddress (this, block));
|
||||
}
|
||||
|
||||
return blockList.iterator ();
|
||||
|
@ -7,7 +7,7 @@ public class AppleDiskAddress implements DiskAddress
|
||||
private final int sector;
|
||||
public final Disk owner;
|
||||
|
||||
public AppleDiskAddress (int block, Disk owner)
|
||||
public AppleDiskAddress (Disk owner, int block)
|
||||
{
|
||||
this.owner = owner;
|
||||
this.block = block;
|
||||
@ -16,7 +16,7 @@ public class AppleDiskAddress implements DiskAddress
|
||||
this.sector = block % sectorsPerTrack;
|
||||
}
|
||||
|
||||
public AppleDiskAddress (int track, int sector, Disk owner)
|
||||
public AppleDiskAddress (Disk owner, int track, int sector)
|
||||
{
|
||||
this.owner = owner;
|
||||
this.track = track;
|
||||
|
Loading…
x
Reference in New Issue
Block a user