--- type: workflow-guide source: E07-S01 disk builder and E07-S02 launchers --- # Editor and Compiler Workflow Nova128 does not link the editor and compiler in memory. A development disk is edited in one emulator session and compiled in another, strictly in sequence. `scripts/prepare-disk.ps1` (E07-S01) copies `../vim/work.d81` to a disposable image without ever writing the source; the launchers below add the two sessions. ## Sequential rule Never attach the same disk image writable to two emulators at once, and never edit an image while a compiler session still has it open. VICE buffers DOS writes, so a second session can read a half-written directory or overwrite the first session's changes. The launchers enforce this with a session lock in the image's folder (`.newlang-session.lock`); the lock holds the owning process and its kind, and a lock left behind by a dead process is replaced automatically. ## Editor session ```text powershell -NoProfile -ExecutionPolicy Bypass -File scripts\launch-editor.ps1 ``` - Autostarts `../vim/vim128.prg` in `x64sc` with the disk image attached as a true drive. - Copies `../vim/vim-improved.d81` to `build/newlang-edit.d81` first, so the editor never opens the source image. - Waits for `x64sc` to exit, then waits until the image can be opened exclusively (the image has flushed) before returning. - Verifies the source image's SHA-256 is unchanged. Use `-EditorPrg` and `-SourceImage` to select another editor build or disk. `-LimitCycles` and `-Screenshot` are for automated checks only; they end the session early. ## Compiler session ```text powershell -NoProfile -ExecutionPolicy Bypass -File scripts\launch-compiler.ps1 ``` - Rebuilds `build/newlang-dev.d81` from the clean source copy with `prepare-disk.ps1` (unless `-SkipPrepare` is given), injecting `build/n128c.prg`. - Autostarts that compiler PRG in `x128` with the development image attached. - Waits for `x128` to exit and for the image to flush before returning. `-CompilerPrg` selects another compiler PRG. The launcher reports a missing compiler program, source image, or VICE tool before starting anything. ## Recovery - **Lock reported as still owned**: close the named session's emulator window first; if the process is gone, the launcher replaces the stale lock. - **Image still locked after the emulator exits**: wait for the DOS write to finish; the launcher retries for 30 seconds before failing. - **Source image changed**: stop and inspect `../vim` with `git status`; the launchers only ever copy from it. - **Wrong editor or compiler build**: pass `-EditorPrg`/`-CompilerPrg` explicitly rather than editing the defaults. ## Limits Autostart loads the program from the host file system, not from the disk; the disk stays attached for the session's own file access. Physical C128 testing and the full edit/compile/run walkthrough belong to E07-S04 and E08-S06.