← Choose when DLLs load and who owns them

Commands

Choose when DLLs load and who owns them

Build and compare the three policy disks

Terminal
mkdir -p build
out=$(mktemp -d build/tutorial-policy.XXXXXX)
source=docs/tutorial-examples/dll-policy.zp64
cp "$source" "$out/on_demand.zp64"
sed 's/load = .on_demand;/load = .preload;/' "$source" > "$out/preload.zp64"
sed -e '/load_file = "rules";/d' -e 's/load = .on_demand;/load = .manual;/' \
  -e '/    if (Rules.tick(5))/i\
    if (Rules.loadFromDisk("rules") == false) {\
        c64.console.print("MANUAL LOAD FAILED", .{});\
    }\
' "$source" > "$out/manual.zp64"
for policy in preload on_demand manual; do
  ./zig-out/bin/zp64c compile "$out/$policy.zp64" -o "$out/$policy.prg"
  c1541 -format 'rules policy,01' d64 "$out/$policy.d64" \
    -write "$out/$policy.prg" boot -write "$out/$policy.prg.zpmod.disk.prg" rules
done
x64sc -reu -reusize 256 -autostart "$out/preload.d64:boot"
x64sc -reu -reusize 256 -autostart "$out/on_demand.d64:boot"
x64sc -reu -reusize 256 -autostart "$out/manual.d64:boot"

Return to the guide

Build and boot both graph disks

Terminal
mkdir -p build
out=$(mktemp -d build/tutorial-graph.XXXXXX)
compiler=./zig-out/bin/zp64c
"$compiler" compile docs/tutorial-examples/cache-terrain.zp64 -o "$out/terrain.prg"
"$compiler" compile docs/tutorial-examples/memory-plan-math.zp64 -o "$out/math.prg"
"$compiler" compile docs/tutorial-examples/dll-graph.zp64 -o "$out/survey.prg" \
  --dependency-module "terrain_rules=$out/terrain.prg.zpmod.json" \
  --dependency-relocsim "terrain_rules=$out/terrain.prg.zpmod.relocsim.json" \
  --dependency-module "fixed_math=$out/math.prg.zpmod.json" \
  --dependency-relocsim "fixed_math=$out/math.prg.zpmod.relocsim.json"
c1541 -format 'survey graph,01' d64 "$out/complete.d64" \
  -write "$out/survey.prg" boot -write "$out/math.prg.zpmod.disk.prg" fixedmath \
  -write "$out/terrain.prg.zpmod.disk.prg" terrain
c1541 -format 'missing terrain,02' d64 "$out/missing.d64" \
  -write "$out/survey.prg" boot -write "$out/math.prg.zpmod.disk.prg" fixedmath
x64sc -reu -reusize 256 -autostart "$out/complete.d64:boot"
x64sc -reu -reusize 256 -autostart "$out/missing.d64:boot"

Return to the guide