paavohtl Claude Opus 4.6 commited on
Commit
e3a0527
Β·
1 Parent(s): 8636b4b

docs: add WA configuration system RE notes

Browse files

Registry layout, GameInfo options, theme files, and data file paths.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Files changed (1) hide show
  1. docs/re-notes/configuration.md +98 -0
docs/re-notes/configuration.md ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # WA Configuration System
2
+
3
+ WA uses three configuration layers: Windows Registry (primary), theme files, and weapon scheme files.
4
+
5
+ ## Registry
6
+
7
+ ### Path
8
+
9
+ ```
10
+ HKEY_CURRENT_USER\Software\Team17SoftwareLTD\WormsArmageddon\
11
+ β”œβ”€β”€ Data
12
+ β”œβ”€β”€ Options
13
+ β”œβ”€β”€ ExportVideo
14
+ └── VSyncAssist
15
+ ```
16
+
17
+ Company name string at `0x6623DC` ("Team17SoftwareLTD"), app name at `0x66237C`.
18
+
19
+ ### MFC CWinApp Integration
20
+
21
+ WA uses MFC's `CWinApp` registry helpers. Dual-mode: if `CWinApp+0x54 == 0`, falls back to INI file via `GetPrivateProfileIntA`. Otherwise uses the registry.
22
+
23
+ | Function | Address | Xrefs | Notes |
24
+ |----------|---------|-------|-------|
25
+ | `CWinApp::GetAppRegistryKey` | 0x5CC4FB | β€” | Opens `HKCU\Software\{company}\{app}` |
26
+ | `CWinApp::GetSectionKey` | 0x5CC58C | β€” | Opens subsection (Options, Data, etc.) |
27
+ | `CWinApp::GetProfileIntW` | 0x5CC5D2 | 68 | Reads int from registry or INI |
28
+ | `CWinApp::WriteProfileInt` | 0x5CC63B | 55 | Writes int to registry or INI |
29
+ | `CWinApp::WriteProfileStringA` | 0x5CC6C2 | β€” | Writes string to registry or INI |
30
+ | `CWinApp::GetProfileStringA` | 0x5CC758 | β€” | Reads string from registry or INI |
31
+
32
+ Registry access flags: `0x2001F` (KEY_READ | KEY_WRITE).
33
+
34
+ ### Registry Cleanup
35
+
36
+ `Registry__CleanAll` (0x4C90D0) deletes all 4 subsections recursively via `Registry__DeleteKeyRecursive` (0x4E4D10), also clears the "NetSettings" INI section.
37
+
38
+ ## Game Options
39
+
40
+ `GameInfo__LoadOptions` (0x460AC0) reads options from the "Options" registry section into the GameInfo struct. Called from `GameInfo__InitSession` (0x4608E0).
41
+
42
+ | Registry Key | Default | GameInfo Offset | Type | Notes |
43
+ |-------------|---------|-----------------|------|-------|
44
+ | DetailLevel | 5 | +0xF3A1 | byte | |
45
+ | EnergyBar | 1 | +0xF3A2 | byte | |
46
+ | InfoTransparency | 0 | +0xF3A3 | byte | |
47
+ | InfoSpy | 1 | +0xF3A4 | bool | Stored as `!= 0` |
48
+ | ChatPinned | 0 | +0xF3A5 | byte | |
49
+ | ChatLines | 0 | +0xF3A8 | u32 | |
50
+ | PinnedChatLines | -1 | +0xF3AC | u32 | |
51
+ | HomeLock | 0 | +0xF3B0 | byte | |
52
+ | BackgroundDebrisParallax | 0x50 | +0xF3E8 | fixed16.16 | Clamped to i16 range, then `<< 16` |
53
+ | TopmostExplosionOnomatopoeia | 0 | +0xF3EC | u32 | |
54
+ | CaptureTransparentPNGs | 0 | +0xF3DC | u32 | |
55
+ | CameraUnlockMouseSpeed | 0x10 | +0xF3E0 | u32 | Squared; clamped to max 0xB504 before squaring |
56
+
57
+ Additional values loaded from globals (not registry) into offsets: +0xF3B4..+0xF3D0, +0xF3D4..+0xF3D8, +0xF3F4..+0xF400 (conditional on `DAT_0088C374`), +0xDAE8, +0xF3E4.
58
+
59
+ The struct also stores:
60
+ - Speech path at +0xF404: `sprintf("%s\\user\\speech", baseDir)`
61
+ - Land data path at +0xDAEC: `"data\land.dat"` (from string at 0x64DA58)
62
+
63
+ `Options__GetCrashReportURL` (0x5A63F0) reads "CrashReportURL" from the Options section for crash reporting.
64
+
65
+ ## Theme File (`data\current.thm`)
66
+
67
+ Binary format, variable length. Contains visual/audio theme settings.
68
+
69
+ | Function | Address | Notes |
70
+ |----------|---------|-------|
71
+ | `Theme__GetFileSize` | 0x44BA80 | Opens file, returns length (0 if missing) |
72
+ | `Theme__Load` | 0x44BB20 | Reads entire file into buffer; `AfxMessageBox` if missing |
73
+ | `Theme__Save` | 0x44BBC0 | Writes buffer to file; `AfxMessageBox` on create failure |
74
+
75
+ ### Save Flow
76
+
77
+ `Frontend__OnOptionsAccept` (0x48DAB0) triggers on screen 0x27:
78
+ 1. Calls `FUN_0048D7C0` (unknown setup)
79
+ 2. Calls `Frontend__ApplyOptions` (0x440940) with frontend data
80
+ 3. Calls `Frontend__SaveTheme` (0x490E60) with path `"data\current.thm"`
81
+ 4. Calls `FrontendChangeScreen` to navigate away
82
+
83
+ ## Weapon Schemes
84
+
85
+ Stored as `.wsc` files under `User\Schemes\`.
86
+
87
+ | Function | Address | Path Pattern |
88
+ |----------|---------|-------------|
89
+ | `Scheme__Load` | 0x4D4CD0 | `User\Schemes\%s.wsc` |
90
+ | `Scheme__LoadNumbered` | 0x4D4E00 | `User\Schemes\{%02d} %s.wsc` |
91
+
92
+ ## Data Files
93
+
94
+ | File | String Address | Notes |
95
+ |------|---------------|-------|
96
+ | `data\land.dat` | 0x64DA58 | Landscape/terrain data |
97
+ | `custom.dat` | 0x64DA88 | Custom content |
98
+ | `steam.dat` | 0x662808 | Steam integration data |