bboxy/bitfire

d64write ignores --side parameter when creating new empty disks

Closed this issue · 4 comments

If I understand correctly this is by design as the side information is stored in the "directory entries" of files in bitfire format. However, this makes building disk images in the following manner impossible for disk sides that need to be requested later:

	@echo "# Building SIDE 2..."
	@$(D64WRITE)  -c side2.d64 -h "foobar" -i "2020" --side 2 --boot build/boot2.prg 
	@echo "# Part 1"
	@$(D64WRITE) -d side2.d64  -b build/foobar.lz

There's an easy workaround though: just supply the --side argument to when writing each bitfire file to the disk image (or at least to the first such file written):

	@echo "# Building SIDE 2..."
	@$(D64WRITE)  -c side2.d64 -h "foobar" -i "2020" --side 2 --boot build/boot2.prg 
	@echo "# Part 1"
	@$(D64WRITE) -d side2.d64 --side 2 -b build/foobar.lz

Note the extra --side 2 argument in the last line. Since it's such an easy workaround (one can also create the disk image with one command, that would also work) I'd suggest just amending the documentation with this information so someone else does not have to spend a few hours figuring it out. 🙂

bboxy commented

I never noticed that, as i always create the image and write files in a single command. Thanks for pushing me to this. It's not meant by design, but in deed a bug then, as the side parameter implies a bitfire disk format format anyway. Will fix that :-)

bboxy commented

Solved with db03271

Thanks. I didn't expect such a quick fix, especially as I had a workaround. I was also under the impression that you actually need at least one valid directory entry in "bitfire" format for this to work.

bboxy commented

That's true. I fixed it the following way: When the image is created without setting the --side parameter, a blank image is created. When using the --side paremeter the bitfire dir-sector is flagged as used in the BAM and the magic byte for the diskside is set. This also happens whenever the --side parameter is used on any other action.