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:
parent
391c80dfb8
commit
3febdd2c08
|
@ -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++;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue