SSFEdit is a small desktop editor with one main form, one modal entry form, and two reusable binary file handlers. The main form owns most of the user workflow and uses TLK lookups to decorate SSF slot values with sound and text metadata.
-
USSFEdit.dpr- Initializes the VCL application.
- Creates
TForm1fromSSFEdit.pasandTEntryFormfromUEntryForm.pas. - Accepts an optional first CLI argument and passes it to
Form1.LoadFile(...)when it is an existing.ssfpath.
-
SSFEdit.pas- Defines the main form
TForm1. - Maintains the 40 entry labels and current SSF slot values.
- Loads the TLK file, reads SSF data into the grid, updates
StrRefvalues, appends new TLK entries, and writes files on save.
- Defines the main form
-
UEntryForm.pas- Defines the modal dialog used when appending a brand-new TLK entry.
- Captures text plus a 16-character sound resource reference.
-
USSFFile.pas- Encapsulates SSF v1.1 reading and writing.
- Treats an SSF as 40 fixed-width
DWORDentries after the'SSF '/'V1.1'header. - Stores slot values in a 1-indexed array with a hardcoded label map.
-
UTLKFile.pas- Encapsulates TLK v3.0 reading and writing.
- Stores entries in a linked list (
TStringDataList). - Supports appending new TLK entries and rewriting the full TLK file.
-
UST_Common.pas- User dialogs, numeric/string helpers, file writable/backup helpers, shell helpers.
-
StoffeUtils.pas- Minimal legacy utility functions retained for string replacement and offset-based search.
USSFEdit.dprstarts the app and creates both forms.- If the first CLI argument is an existing
.ssfpath,TForm1.LoadFileis called during startup. - The main form prompts for
dialog.tlkif one is not already loaded. - The app reads SSF slot values and stores them in
l_entries[1..40]. - For each non-empty slot,
GetTlkStringresolves the slot'sStrRefto TLK text and sound metadata for display in the grid. - The user either edits a
StrRefdirectly or uses the modal entry form to append a new TLK entry and assign its newStrRefto the selected slot. - On save, the app writes modified TLK data first when needed, then writes the SSF file.
For field-level format details, see docs/file-formats.md.
- Magic:
'SSF ' - Version:
V1.1 - Entry count: exactly 40
- Entry type:
DWORD - Empty slot sentinel:
$FFFFFFFF - UI presentation of empty slot:
-1
- Magic:
'TLK ' - Version:
V3.0 - Entry identity: position-based
StrRef - New entries are appended, not inserted into the middle
- Sound resource references are stored as fixed 16-character
TResRefarrays with null padding
The repo contains a reusable TSSFFile class in USSFFile.pas, but the main form in SSFEdit.pas currently performs its own SSF stream reading and writing instead of delegating to that class. Any serializer changes should account for both paths unless the code is first consolidated.
For workflow-to-unit ownership, see docs/workflows.md.
- The window form files (
.dfm) in this repo are binary, so UI changes are harder to diff and review than text-form forms. - The
.vscodeworkspace files now mirror the SSFEdit repo surface, but they are still convenience metadata rather than the source of truth. - The reachable history on
mainis still too shallow to explain much product intent, so the source files and maintained docs are better evidence than git archaeology here.