Pad files to the correct size (128 sectors) in assemble_floppy.py

This commit is contained in:
Juhani Krekelä 2023-03-18 01:03:19 +02:00
parent 56d22db6e0
commit 2a2985640e
1 changed files with 2 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import os.path
floppy_bytes = 1440 * 1024
sector_bytes = 512
dirent_bytes = 32
file_bytes = sector_bytes * 128
floppy = bytearray()
@ -52,7 +53,7 @@ assert len(directory) <= sector_bytes
extend_padded(floppy, sector_bytes, directory)
for file_contents in files:
extend_padded(floppy, sector_bytes, file_contents)
extend_padded(floppy, file_bytes, file_contents)
assert len(floppy) <= floppy_bytes