Skip to content

Commit 0d9909d

Browse files
authored
as_dsk.cpp: Fix size of FLUX chunk in MOOF files (#14499)
The previous code allocated 512 bytes to accomodate a FLUX chunk if the resulting file has flux tracks, but the actual size of a FLUX chunk is 168 bytes (8 bytes header + 160 bytes chunk). When MAME allocated 512 bytes, this left 344 zero-bytes padding in the file that other tools would interpret as invalid chunks. See file format reference: https://applesaucefdc.com/moof-reference/
1 parent eabc4eb commit 0d9909d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/formats/as_dsk.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ bool woz_format::save(util::random_read_write &io, const std::vector<uint32_t> &
423423
auto [total_blocks, max_blocks] = count_blocks(tracks);
424424
bool has_flux = test_flux(tracks);
425425

426-
std::vector<uint8_t> data(1536 + total_blocks*512 + (has_flux ? 512 : 0), 0);
426+
std::vector<uint8_t> data(1536 + total_blocks*512 + (has_flux ? 168 : 0), 0);
427427

428428
memcpy(&data[0], signature2, 8);
429429

0 commit comments

Comments
 (0)