Imported from Kwezza/whdload-parser-lab (
AGENTS.md). Install upstream withnpx skills add Kwezza/whdload-parser-lab. Copyright stays with the author.
dat_to_tlv — Agent Instructions
This repository is a standalone staging area for converting Logiqx-style WHDLoad DAT files into a binary TLV format for Amiga use.
Read these first when you need deeper context:
- README.md for the current folder map and pipeline overview.
- .github/instructions/dat-to-tlv-codebase.instructions.md for detailed codebase conventions.
- docs/HANDOVER_2026-05-01.md for the known Amiga runtime crash and recent handover notes.
- notes/backport_inventory.md for what is active now versus staged for later milestones.
Build And Run
The Makefile uses cmd as its shell. Do not add or rely on PowerShell in normal make rules.
make
make TARGET=host
make TARGET=amiga
make PROFILE=1
make run
make clean
make help
Build outputs:
build/host/dat_to_tlv.exebuild/amiga/dat_to_tlv
What Is Active
The current built pipeline is:
DAT parse -> filename tokenize -> CSV validation -> field registry -> TLV output
Active ownership split:
app_src/: standalone harness and minimal DAT parsing.src_raw/: active TLV pipeline logic.src/: stable platform, logging, and utility support.include_raw/andinclude/: headers for those two layers.
Do not describe the staged filter_*, variant_*, active_set.c, or profile_loader.c modules as current runtime behavior unless you also wire them into the Makefile build.
Code Rules
- Use only the existing platform guards:
#ifdef PLATFORM_AMIGA
/* Amiga-specific code */
#else
/* Host code */
#endif
- Keep
src_raw/compatible with vbcc C89 mode. Avoid C99-only syntax there. - If you add a new pipeline module, add the
.cfile insrc_raw/, its header ininclude_raw/, and update theSRClist inMakefile. - Keep docs aligned with the current runtime defaults in
app_src/main.cand do not reintroduce stale staging-path references.
Known Pitfalls
- Host builds work; the Amiga binary is still known to crash at runtime.
- On Amiga, raise the stack before running:
STACK 100000. VBCCdefaults toC:/VBCC; override it if your vbcc install lives elsewhere.