TSLPatcher is a legacy Delphi 7 Windows desktop application for applying mod-driven changes to Star Wars: Knights of the Old Republic and The Sith Lords game data. It reads patch instructions from INI files and updates game assets such as 2DA tables, TLK dialog strings, GFF resources, ERF/RIM archives, and SSF soundsets.
Yes, this is the authentic source code Stoffe was working with 10-20 some years ago.
- Starts a VCL GUI application from
TSLPatcher.dpr. - Loads
changes.iniandinfo.rtfby default, with optional CLI overrides for a different.iniand.rtf. - Looks for runtime patch data in a
tslpatchdatafolder next to the executable. - Supports namespace-based multi-configuration installs through
namespaces.iniwhen present. - Runs either patcher mode or installer mode depending on INI settings.
- Writes progress output to an RTF or plaintext install log, depending on configuration.
TSLPatcher.dpr: application entrypoint, form creation, and CLI override handling.UMainForm.pas: main window, config loading, info text display, user confirmation, progress bar, and summary/report flow.UNamespaceForm.pas: namespace chooser used whennamespaces.iniexists.UTSLPatcher.pas: patch engine, sequencing, logging, and most of the operational behavior.
U2DAEdit.pas: 2DA reader/editor/writer.UTLKFile.pas: TLK V3.0 reader/writer and append behavior.UGFFFile.pas: BioWare GFF V3.2 tree-based reader/writer.UERFHandler.pas: ERF/RIM archive handling.USSFFile.pas: SSF reader/writer.
UST_Common.pas: Windows dialogs, registry helpers, backup/copy helpers, shell output capture, and file utilities.UST_IniFile.pas: INI wrapper that expands<#LF#>and<#CR#>newline tokens.UStrTok.pas: simple string tokenizer used by format helpers.
TSLPatcher.dof: Delphi project options and embedded version metadata.TSLPatcher.cfg: compiler options plus old machine-specific output paths. Do not treat those paths as current.UMainForm.dfm/UNamespaceForm.dfm: form resources for the VCL UI.UMainForm.ddp/UNamespaceForm.ddp: Delphi diagram/designer metadata.UGFFHandler.pasandUTSLPatcher12.pas: older legacy source variants not referenced byTSLPatcher.dpr.
- Delphi 7 on Windows.
- A runtime
tslpatchdatafolder beside the built executable.
The current repository snapshot does not include a tslpatchdata/ directory, so a meaningful launch requires supplying that runtime data separately.
- Open
TSLPatcher.dprin Delphi 7. - Review project options from
TSLPatcher.dofonly as IDE metadata, not as authoritative output-path guidance. - Compile the project in Delphi 7.
- Default config files:
changes.iniandinfo.rtf. - Optional CLI arguments:
- Argument 1: alternate
.ini - Argument 2: alternate
.rtf
- Argument 1: alternate
- Default runtime data location:
tslpatchdata\under the executable directory. - Namespace selection appears automatically when
tslpatchdata\namespaces.iniexists.
There is no automated test suite in this repository.
Use the narrowest practical manual check:
- Compile
TSLPatcher.dprin Delphi 7. - Launch the app and confirm it can load its INI and info text from the runtime data folder.
- If
namespaces.iniexists, confirm the namespace selection flow works. - Run one representative patch or install operation and confirm a progress log is written.
- This is stateful legacy code. Call order inside
UTSLPatcher.pasmatters. - Binary and archive handlers are sensitive to offsets and internal layout.
- Install path handling mixes Windows registry lookup with manual folder selection.
- Source comments and project metadata contain historical version information that is not fully synchronized. Treat
TSLPatcher.dprand the active units it wires in as the current authority.
- See
CONTRIBUTING.mdfor prerequisites, change workflow, and validation expectations. - See
CONVENTIONS.mdfor code organization, Delphi 7 compatibility rules, and high-risk areas. - See
BUILDING.mdfor exact build, launch, runtime-data, and VS Code workflow details. - See
ARCHITECTURE.mdfor the active unit map, runtime sequence, handler layers, and historical-file boundaries.