Files
VCCPlusOSS/tools/toolchain/patches/writecocofile-before-dir.patch
T

33 lines
1.5 KiB
Diff

--- a/src/writecocofile.cpp
+++ b/src/writecocofile.cpp
@@ -1,3 +1,8 @@
+/* VCC Plus modification, November 4, 2026: support an explicit
+ --allocate-before-dir option using the existing forward allocator.
+ This modification is licensed GPL-3.0-or-later.
+*/
+
/* writecocofile.cpp - A tool to write native files to a CoCo DECB disk image.
Copyright (C) 2003-2026 Pierre Sarrazin <http://sarrazip.com/>
@@ -874,6 +879,8 @@
"--kill|-k Kill the designated file.\n"
"--read|-r Read instead of writing. Refuses to overwrite existing native file.\n"
"--stdout|-s Like --read, but print file contents on standard out.\n"
+ "--allocate-before-dir Allocate from granule zero (the default), preferring space\n"
+ " before the directory, then continuing above it if needed.\n"
"--allocate-after-dir When adding a file, allocate granules after the directory track,\n"
" then continue allocating below that track if needed.\n"
"--allocate-from-end When adding a file, allocate granules from the end.\n"
@@ -1376,6 +1383,11 @@
granuleAllocator.reset(new BackwardGranuleAllocator());
continue;
}
+ if (curopt == "--allocate-before-dir")
+ {
+ granuleAllocator.reset(new ForwardGranuleAllocator());
+ continue;
+ }
if (curopt == "--allocate-after-dir")
{
granuleAllocator.reset(new PostDirTrackGranuleAllocator());