findFreeBlock now detects if the block actually exists on the disk

image.  Typically is a problem with HDV images which allocate out to
32MB but dynamically grow within the emulator.
This commit is contained in:
Robert Greene 2003-03-31 05:04:19 +00:00
parent 391c80dfb8
commit 3febdd2c08
1 changed files with 5 additions and 1 deletions

View File

@ -671,7 +671,11 @@ public class ProdosFormatDisk extends FormattedDisk {
int blocksOnDisk = getBitmapLength();
while (block < blocksOnDisk) {
if (isBlockFree(volumeBitmap,block)) {
return block;
if ((block+1) * BLOCK_SIZE < getDiskImage().length) {
return block;
}
throw new ProdosDiskSizeDoesNotMatchException(
"The ProDOS physical disk size does not match the formatted size.");
}
block++;
}