Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
252 commits
Select commit Hold shift + click to select a range
789fb23
reimplement: SHC_3BB0A8C1_0x004F70B0 100.00% Reimplemented
gynt Sep 27, 2026
c82f783
reimplement: SHC_3BB0A8C1_0x00401060 100.00% Reimplemented
gynt Sep 27, 2026
d259c64
reimplement: SHC_3BB0A8C1_0x005017A0 100.00% Reimplemented
gynt Sep 27, 2026
34f4eca
reimplement: SHC_3BB0A8C1_0x004FC7C0 78.95% setg vs sbb/neg
gynt Sep 27, 2026
9e43533
reimplement: SHC_3BB0A8C1_0x00409300 100.00% Reimplemented
gynt Sep 27, 2026
f3f6230
reimplement: SHC_3BB0A8C1_0x005011A0 100.00% Reimplemented
gynt Sep 27, 2026
6656ef7
reimplement: SHC_3BB0A8C1_0x00512920 100.00% Reimplemented
gynt Sep 27, 2026
2300d92
reimplement: SHC_3BB0A8C1_0x00500720 100.00% Reimplemented
gynt Sep 27, 2026
744e6ba
reimplement: SHC_3BB0A8C1_0x00501180 100.00% Reimplemented
gynt Sep 27, 2026
af088b9
reimplement: SHC_3BB0A8C1_0x005002D0 100.00% Reimplemented
gynt Sep 27, 2026
1316494
reimplement: SHC_3BB0A8C1_0x004FBC30 100.00% Reimplemented
gynt Sep 27, 2026
3afc34a
reimplement: SHC_3BB0A8C1_0x00504EE0 38.46% needs callee LTCG (ecx re…
gynt Sep 27, 2026
342409c
reimplement: SHC_3BB0A8C1_0x004F9930 100.00% Reimplemented
gynt Sep 27, 2026
9ca15c1
reimplement: SHC_3BB0A8C1_0x005005F0 100.00% Reimplemented
gynt Sep 27, 2026
b22b38c
reimplement: SHC_3BB0A8C1_0x004F8530 100.00% Reimplemented
gynt Sep 27, 2026
5f592fd
reimplement: SHC_3BB0A8C1_0x00500750 100.00% Reimplemented
gynt Sep 27, 2026
0eb7c04
reimplement: SHC_3BB0A8C1_0x005000A0 100.00% Reimplemented
gynt Sep 27, 2026
f71bb29
reimplement: SHC_3BB0A8C1_0x004F81D0 100.00% Reimplemented
gynt Sep 27, 2026
8b5105f
reimplement: SHC_3BB0A8C1_0x004F6AE0 100.00% Reimplemented
gynt Sep 27, 2026
9389e98
reimplement: SHC_3BB0A8C1_0x00500850 100.00% Reimplemented
gynt Sep 27, 2026
9e78661
reimplement: SHC_3BB0A8C1_0x00500290 100.00% Reimplemented
gynt Sep 27, 2026
f08b879
reimplement: SHC_3BB0A8C1_0x00500250 100.00% Reimplemented
gynt Sep 27, 2026
98973a6
reimplement: SHC_3BB0A8C1_0x00511020 100.00% Reimplemented
gynt Sep 27, 2026
bbe1fc1
reimplement: SHC_3BB0A8C1_0x004F8640 40.00% regalloc: extra edi
gynt Sep 27, 2026
45c882e
reimplement: SHC_3BB0A8C1_0x004FA9D0 43.64% ecx not kept across callee
gynt Sep 27, 2026
57eb676
reimplement: SHC_3BB0A8C1_0x00500680 100.00% Reimplemented
gynt Sep 27, 2026
cab3d79
reimplement: SHC_3BB0A8C1_0x005007D0 100.00% Reimplemented
gynt Sep 27, 2026
6f07c4c
reimplement: SHC_3BB0A8C1_0x004F6F90 100.00% Reimplemented
gynt Sep 27, 2026
208ac6c
reimplement: SHC_3BB0A8C1_0x00503720 100.00% Reimplemented
gynt Sep 27, 2026
1eb2205
reimplement: SHC_3BB0A8C1_0x004FAD20 45.28% ecx not kept across callee
gynt Sep 27, 2026
fd27b50
reimplement: SHC_3BB0A8C1_0x00500790 100.00% Reimplemented
gynt Sep 27, 2026
c0bfe4d
reimplement: SHC_3BB0A8C1_0x00500940 100.00% Reimplemented
gynt Sep 27, 2026
7f4b7b3
reimplement: SHC_3BB0A8C1_0x005006C0 100.00% Reimplemented
gynt Sep 27, 2026
00b1134
reimplement: SHC_3BB0A8C1_0x00500370 100.00% Reimplemented
gynt Sep 27, 2026
a41084a
reimplement: SHC_3BB0A8C1_0x00500210 100.00% Reimplemented
gynt Sep 27, 2026
8b14934
reimplement: SHC_3BB0A8C1_0x004F80E0 100.00% Reimplemented
gynt Sep 27, 2026
811271f
reimplement: SHC_3BB0A8C1_0x004F79D0 100.00% Reimplemented
gynt Sep 27, 2026
360822b
reimplement: SHC_3BB0A8C1_0x004FB970 36.92% ecx not kept across callee
gynt Sep 27, 2026
9c433d5
reimplement: SHC_3BB0A8C1_0x00500890 100.00% Reimplemented
gynt Sep 27, 2026
3048516
reimplement: SHC_3BB0A8C1_0x004F9880 100.00% Reimplemented
gynt Sep 27, 2026
11bdaa6
reimplement: SHC_3BB0A8C1_0x00502950 100.00% Reimplemented
gynt Sep 27, 2026
69605d9
reimplement: SHC_3BB0A8C1_0x00500640 46.15% ecx not kept across callee
gynt Sep 27, 2026
79f303e
reimplement: SHC_3BB0A8C1_0x00500310 100.00% Reimplemented
gynt Sep 27, 2026
019402e
reimplement: SHC_3BB0A8C1_0x00500180 100.00% Reimplemented
gynt Sep 27, 2026
aaf5c43
reimplement: SHC_3BB0A8C1_0x00514480 40.00% logic masks merged by cl
gynt Sep 27, 2026
1b17bc3
reimplement: SHC_3BB0A8C1_0x00511850 58.82% ecx not kept across callee
gynt Sep 27, 2026
fb3a0c0
reimplement: SHC_3BB0A8C1_0x00500B50 68.35% loop guard/regalloc differs
gynt Sep 27, 2026
0b6dca6
reimplement: SHC_3BB0A8C1_0x004F85B0 41.03% regalloc: extra edi
gynt Sep 27, 2026
4f210ad
reimplement: SHC_3BB0A8C1_0x004FAA30 91.89% Style pass, asm differs
gynt Sep 27, 2026
543ec25
reimplement: SHC_3BB0A8C1_0x00508870 88.89% Style pass, asm differs
gynt Sep 27, 2026
824dde3
reimplement: SHC_3BB0A8C1_0x004FB8E0 28.17% ecx not kept across callee
gynt Sep 27, 2026
b61279d
reimplement: SHC_3BB0A8C1_0x004FC280 85.19% XYPair base regalloc
gynt Sep 27, 2026
c3af393
reimplement: SHC_3BB0A8C1_0x004FAE50 35.14% ecx not kept across callee
gynt Sep 27, 2026
053c6ac
reimplement: SHC_3BB0A8C1_0x004F8B50 100.00% Reimplemented
gynt Sep 27, 2026
8eedb25
types: Moat.tile is a 32-bit field, x/y are signed
gynt Sep 27, 2026
84b7a6f
reimplement: SHC_3BB0A8C1_0x005006C0 100.00% Reimplemented
gynt Sep 27, 2026
652e5bc
reimplement: SHC_3BB0A8C1_0x00500180 100.00% Reimplemented
gynt Sep 27, 2026
6e28ea6
reimplement: SHC_3BB0A8C1_0x00500290 100.00% Reimplemented
gynt Sep 27, 2026
817b390
reimplement: SHC_3BB0A8C1_0x00500250 100.00% Reimplemented
gynt Sep 27, 2026
cd98c8f
reimplement: SHC_3BB0A8C1_0x00500310 100.00% Reimplemented
gynt Sep 27, 2026
d2a6415
types: Building.x/y are signed, tileRef1..36 is one int[36]
gynt Sep 27, 2026
7f521bf
build: give each worktree its own mspdbsrv endpoint
gynt Sep 27, 2026
8019d9d
reimplement: SHC_3BB0A8C1_0x004FFB10 100.00% Reimplemented
gynt Sep 27, 2026
3072d9d
reimplement: SHC_3BB0A8C1_0x004FB360 78.95% ecx not kept across callee
gynt Sep 27, 2026
c99190f
reimplement: SHC_3BB0A8C1_0x00500BB0 100.00% Reimplemented
gynt Sep 27, 2026
6d8c8ec
reimplement: SHC_3BB0A8C1_0x004F8160 100.00% Reimplemented
gynt Sep 27, 2026
52d5a74
reimplement: SHC_3BB0A8C1_0x00511D70 100.00% Reimplemented
gynt Sep 27, 2026
1d040e1
reimplement: SHC_3BB0A8C1_0x004F8A40 87.18% shr vs sar on logic bit
gynt Sep 27, 2026
008e19f
reimplement: SHC_3BB0A8C1_0x005000E0 48.72% owner reload per unrolled…
gynt Sep 27, 2026
30a74c0
reimplement: SHC_3BB0A8C1_0x00500800 100.00% Reimplemented
gynt Sep 27, 2026
6af3a58
reimplement: SHC_3BB0A8C1_0x00501CD0 82.05% brush loop regalloc
gynt Sep 27, 2026
0bd981b
reimplement: SHC_3BB0A8C1_0x004FAEE0 55.32% ecx not kept across callee
gynt Sep 27, 2026
3cc5cd8
reimplement: SHC_3BB0A8C1_0x004F6C60 92.31% border index regalloc
gynt Sep 27, 2026
7e9e425
reimplement: SHC_3BB0A8C1_0x00507060 90.76% setupBuildingData arg reg…
gynt Sep 27, 2026
f2ce335
reimplement: SHC_3BB0A8C1_0x004F8AC0 90.70% shr vs sar on logic bit
gynt Sep 27, 2026
ec180cb
reimplement: SHC_3BB0A8C1_0x00506D40 89.60% setupBuildingData arg reg…
gynt Sep 27, 2026
8784abb
reimplement: SHC_3BB0A8C1_0x004FAC70 84.71% ecx not kept across callee
gynt Sep 27, 2026
7873418
reimplement: SHC_3BB0A8C1_0x005113F0 54.24% moat field reload/regalloc
gynt Sep 27, 2026
d146bb3
reimplement: SHC_3BB0A8C1_0x00500500 86.54% moat field reload/regalloc
gynt Sep 27, 2026
cbf8a97
reimplement: SHC_3BB0A8C1_0x004F93E0 49.02% const 1 rematerialised
gynt Sep 27, 2026
27b89b4
reimplement: SHC_3BB0A8C1_0x005003D0 54.34% moat row walk regalloc
gynt Sep 27, 2026
e9e5681
reimplement: SHC_3BB0A8C1_0x004F9980 34.23% ecx not kept across callee
gynt Sep 27, 2026
2ac998a
reimplement: SHC_3BB0A8C1_0x00507280 54.55% ecx not kept across callee
gynt Sep 27, 2026
2b028b5
reimplement: SHC_3BB0A8C1_0x004F89C0 59.15% orientation blocks not sh…
gynt Sep 27, 2026
8469789
reimplement: SHC_3BB0A8C1_0x004F8840 93.65% direction chain order
gynt Sep 27, 2026
799ae93
reimplement: SHC_3BB0A8C1_0x00507350 74.14% tree switch jump table
gynt Sep 27, 2026
357df4d
reimplement: SHC_3BB0A8C1_0x004FB3F0 34.33% XYPair stride regalloc
gynt Sep 27, 2026
a1db33a
reimplement: SHC_3BB0A8C1_0x00515C80 52.56% ecx not kept across callee
gynt Sep 28, 2026
08cd230
reimplement: SHC_3BB0A8C1_0x004F8900 63.49% neighbour load regalloc
gynt Sep 28, 2026
c53a9fc
reimplement: SHC_3BB0A8C1_0x004F86D0 98.39% direction chain regalloc
gynt Sep 28, 2026
567a48b
reimplement: SHC_3BB0A8C1_0x004FAD70 77.67% ecx not kept across callee
gynt Sep 28, 2026
ad6a7f8
reimplement: SHC_3BB0A8C1_0x00508910 66.67% ecx not kept across callee
gynt Sep 28, 2026
27cba7e
reimplement: SHC_3BB0A8C1_0x004F8210 94.66% switch table vs compare c…
gynt Sep 28, 2026
ce7e27b
reimplement: SHC_3BB0A8C1_0x004F94A0 67.23% logic masks merged by cl
gynt Sep 28, 2026
27dcba4
reimplement: SHC_3BB0A8C1_0x004F8780 100.00% Reimplemented
gynt Sep 28, 2026
71c67fd
reimplement: SHC_3BB0A8C1_0x004FF870 8.93% original built unoptimised
gynt Sep 28, 2026
734eabc
reimplement: SHC_3BB0A8C1_0x00508760 69.03% ecx not kept across callee
gynt Sep 28, 2026
cb5ff5f
reimplement: SHC_3BB0A8C1_0x004FAF70 98.51% offset walk regalloc
gynt Sep 28, 2026
ba149a4
reimplement: SHC_3BB0A8C1_0x004FF870 74.67% __asm; global not nameable
gynt Sep 28, 2026
47ddf52
reimplement: SHC_3BB0A8C1_0x004FF870 74.67% __asm; global not nameable
gynt Sep 28, 2026
b55b568
asm: shared macro for the handwritten neighbour-flag block
gynt Sep 28, 2026
26f1906
reimplement: SHC_3BB0A8C1_0x004FF870 74.67% Style pass, asm differs
gynt Sep 28, 2026
519cace
reimplement: SHC_3BB0A8C1_0x004FC9E0 64.51% Od stack slot order differs
gynt Sep 28, 2026
c526ee6
types: signed TileMapState fields, and mapping40x40 holds char
gynt Sep 28, 2026
ea3c605
reimplement: SHC_3BB0A8C1_0x004FDB00 56.32% Od stack slot order differs
gynt Sep 28, 2026
f1cb5c1
types: Unit+0x83 is a field, not padding
gynt Sep 28, 2026
82a0eb2
reimplement: SHC_3BB0A8C1_0x004F6FD0 98.31% unit loop regalloc
gynt Sep 28, 2026
adb69ca
reimplement: SHC_3BB0A8C1_0x004F9DF0 97.14% buildingType chain regalloc
gynt Sep 28, 2026
902b5eb
reimplement: SHC_3BB0A8C1_0x00501B90 75.00% orientation switch regalloc
gynt Sep 28, 2026
abb7dc9
reimplement: SHC_3BB0A8C1_0x004F9F00 72.99% microX/microY regalloc
gynt Sep 28, 2026
6e046ae
reimplement: SHC_3BB0A8C1_0x00507130 53.09% setupBuildingData arg reg…
gynt Sep 28, 2026
8d9fe6f
reimplement: SHC_3BB0A8C1_0x00507560 44.83% setupBuildingData arg reg…
gynt Sep 28, 2026
965a7e0
reimplement: SHC_3BB0A8C1_0x00507420 44.83% setupBuildingData arg reg…
gynt Sep 28, 2026
c965d32
types: name Logic1 bit 0x40
gynt Sep 28, 2026
4d35492
reimplement: SHC_3BB0A8C1_0x00512940 75.99% Od stack slot order differs
gynt Sep 28, 2026
aa46664
reimplement: SHC_3BB0A8C1_0x004FAB70 70.40% ecx not kept across callee
gynt Sep 28, 2026
f98c394
reimplement: SHC_3BB0A8C1_0x004FC340 62.42% LogicLayer walk regalloc
gynt Sep 28, 2026
e29527c
reimplement: SHC_3BB0A8C1_0x004FBD80 38.67% brush step regalloc
gynt Sep 28, 2026
5bd5f33
reimplement: SHC_3BB0A8C1_0x004FA550 100.00% Reimplemented
gynt Sep 28, 2026
d09e55a
reimplement: SHC_3BB0A8C1_0x00506F40 85.19% setupBuildingData arg reg…
gynt Sep 28, 2026
b826c32
reimplement: SHC_3BB0A8C1_0x00506E10 84.52% setupBuildingData arg reg…
gynt Sep 28, 2026
0427751
reimplement: SHC_3BB0A8C1_0x00508DD0 43.08% extra callee-saved reg
gynt Sep 28, 2026
f5ba429
reimplement: SHC_3BB0A8C1_0x00515F40 69.86% Style pass, asm differs
gynt Sep 28, 2026
187bfb6
reimplement: SHC_3BB0A8C1_0x00502390 28.09% brush loop regalloc
gynt Sep 28, 2026
6847ec9
reimplement: SHC_3BB0A8C1_0x004F9220 88.06% owner store tail-merge
gynt Sep 28, 2026
63fcb39
reimplement: SHC_3BB0A8C1_0x005110B0 84.02% moat scan regalloc
gynt Sep 28, 2026
fb733ff
reimplement: SHC_3BB0A8C1_0x004FF990 74.55% switch arm regalloc
gynt Sep 28, 2026
c11fce6
reimplement: SHC_3BB0A8C1_0x005116E0 72.43% pitch field reload/regalloc
gynt Sep 28, 2026
441a92b
reimplement: SHC_3BB0A8C1_0x005127B0 100.00% Reimplemented
gynt Sep 28, 2026
b588ae8
reimplement: SHC_3BB0A8C1_0x004FB770 76.65% gfx expression regalloc
gynt Sep 28, 2026
9a322bb
reimplement: SHC_3BB0A8C1_0x00506BD0 75.90% setupBuildingData arg reg…
gynt Sep 28, 2026
0a7bbd1
reimplement: SHC_3BB0A8C1_0x00500980 65.08% height compare regalloc
gynt Sep 28, 2026
baecfa3
reimplement: SHC_3BB0A8C1_0x004FFF10 44.03% switch arm regalloc
gynt Sep 28, 2026
e7670af
reimplement: SHC_3BB0A8C1_0x00506AD0 77.94% buildingType chain tail-m…
gynt Sep 28, 2026
545e832
reimplement: SHC_3BB0A8C1_0x004F6B20 30.11% row counter costs a spill
gynt Sep 28, 2026
21ba9d2
reimplement: SHC_3BB0A8C1_0x00515DA0 36.10% brush loop regalloc
gynt Sep 28, 2026
8cc2b0b
reimplement: SHC_3BB0A8C1_0x00501F50 9.68% one fewer spilled local
gynt Sep 28, 2026
446ba2c
reimplement: SHC_3BB0A8C1_0x00501D90 15.18% spills where original use…
gynt Sep 28, 2026
df332da
reimplement: SHC_3BB0A8C1_0x004FC810 67.21% height compare regalloc
gynt Sep 28, 2026
7264213
reimplement: SHC_3BB0A8C1_0x004FC650 45.52% orientation chain regalloc
gynt Sep 28, 2026
9162f3a
reimplement: SHC_3BB0A8C1_0x004F9000 59.49% owner store tail-merge
gynt Sep 28, 2026
adcff1a
reimplement: SHC_3BB0A8C1_0x004F8300 80.29% mapper switch jump table
gynt Sep 28, 2026
c64b420
reimplement: SHC_3BB0A8C1_0x00511DF0 100.00% Reimplemented
gynt Sep 28, 2026
b0d1b80
reimplement: SHC_3BB0A8C1_0x00508030 61.13% 68.42% x/y param reuse re…
gynt Sep 28, 2026
70fee82
reimplement: SHC_3BB0A8C1_0x005114C0 43.66% 46.51% global instance ba…
gynt Sep 28, 2026
9892baa
reimplement: SHC_3BB0A8C1_0x004FA460 100.00% Reimplemented
gynt Sep 28, 2026
39e762a
header: make the dust cloud counters and terrain index signed
gynt Sep 28, 2026
776f4e0
reimplement: SHC_3BB0A8C1_0x004FC490 54.14% 56.42% array base regalloc
gynt Sep 28, 2026
49f1ea3
reimplement: SHC_3BB0A8C1_0x00514520 75.32% 75.63% spill order
gynt Sep 28, 2026
db0a0b4
reimplement: SHC_3BB0A8C1_0x004FA2D0 47.39% 47.37% cold block layout …
gynt Sep 28, 2026
3440089
reimplement: SHC_3BB0A8C1_0x005024F0 51.75% 47.37% index spill regalloc
gynt Sep 28, 2026
5a72cde
reimplement: SHC_3BB0A8C1_0x00508540 52.94% 55.63% operand order rega…
gynt Sep 28, 2026
84f3358
reimplement: SHC_3BB0A8C1_0x00501A20 91.67% 84.72% regalloc
gynt Sep 28, 2026
7df5c1b
reimplement: SHC_3BB0A8C1_0x004FA760 56.27% 61.02% offset array parti…
gynt Sep 28, 2026
9fc3f4a
reimplement: SHC_3BB0A8C1_0x004FBE70 87.16% 85.48% regalloc
gynt Sep 28, 2026
812d1c0
header: repartition the keep outbuilding offsets in TerrainDefinedData
gynt Sep 29, 2026
90bfb13
docs: record the shared-block, threshold and named-local diff patterns
gynt Sep 29, 2026
fb302a8
reimplement: SHC_3BB0A8C1_0x005160C0 37.64% 48.02% global instance base
gynt Sep 29, 2026
bd35216
reimplement: SHC_3BB0A8C1_0x005111D0 46.43% 49.31% struct base regalloc
gynt Sep 29, 2026
a407b18
reimplement: SHC_3BB0A8C1_0x005034A0 54.55% 57.24% regalloc
gynt Sep 29, 2026
66ced0d
reimplement: SHC_3BB0A8C1_0x00502110 27.04% 28.70% this in edi vs esi…
gynt Sep 29, 2026
6964569
reimplement: SHC_3BB0A8C1_0x004FB9E0 14.56% 20.90% this in ecx vs esi…
gynt Sep 29, 2026
e88d524
reimplement: SHC_3BB0A8C1_0x005017C0 42.57% 48.37% spill order regalloc
gynt Sep 29, 2026
0f9c694
reimplement: SHC_3BB0A8C1_0x004FA000 33.91% 33.90% pointer local frame
gynt Sep 29, 2026
a61159e
reimplement: SHC_3BB0A8C1_0x00515A20 34.07% 54.84% x/y regalloc swap
gynt Sep 29, 2026
ac343b4
tools: give the batch build scripts build.bat PDB server fix
gynt Sep 29, 2026
bb5c2b5
reimplement: SHC_3BB0A8C1_0x004FB4D0 41.13% 43.40% rockType spilled v…
gynt Sep 29, 2026
af898f7
reimplement: SHC_3BB0A8C1_0x00508EC0 27.51% 35.40% spill order regalloc
gynt Sep 29, 2026
19b2f95
reimplement: SHC_3BB0A8C1_0x004FB0C0 50.43% 50.43% two jump tables, s…
gynt Sep 29, 2026
59f58ed
reimplement: SHC_3BB0A8C1_0x00502680 19.95% 20.99% highest/lowest spi…
gynt Sep 29, 2026
cad51dc
tools/batch: retry on a fresh PDB endpoint, not just a fresh server
gynt Sep 29, 2026
116bd93
reimplement: SHC_3BB0A8C1_0x004FC0B0 36.36% 36.36% regalloc
gynt Sep 29, 2026
3008d3b
reimplement: SHC_3BB0A8C1_0x004F6CF0 8.43% 9.04% this in esi vs ecx r…
gynt Sep 29, 2026
58e1dc2
reimplement: SHC_3BB0A8C1_0x00508250 40.29% 39.78% regalloc
gynt Sep 29, 2026
29bf091
reimplement: SHC_3BB0A8C1_0x004FFBA0 30.69% 26.79% duplicated tails r…
gynt Sep 29, 2026
c29b7dc
header: name the int at 0x5548d0 that the flat view toggle clears
gynt Sep 29, 2026
fcc7f00
reimplement: SHC_3BB0A8C1_0x004F8BD0 44.24% 44.57% regalloc
gynt Sep 29, 2026
44c4613
reimplement: SHC_3BB0A8C1_0x004F9590 23.63% 24.13% index arithmetic r…
gynt Sep 29, 2026
3f9dd9b
reimplement: SHC_3BB0A8C1_0x00512100 70.70% 87.94% call targets only
gynt Sep 29, 2026
81e33d2
reimplement: SHC_3BB0A8C1_0x00512450 47.42% 80.32% call targets only
gynt Sep 29, 2026
499ee11
tools/batch: give syntax_check.py the same PDB retries as build_quiet.py
gynt Sep 29, 2026
65e1f40
reimplement: SHC_3BB0A8C1_0x00508A00 71.41% 71.43% jump table, gfx se…
gynt Sep 29, 2026
3564902
reimplement: SHC_3BB0A8C1_0x00504A30 48.92% 48.92% global instance base
gynt Sep 29, 2026
ddf784b
reimplement: SHC_3BB0A8C1_0x004F9A60 49.74% 49.70% global instance base
gynt Sep 29, 2026
c36b4ca
header: name the orientation table at 0x7c8 in TerrainDefinedData
gynt Sep 29, 2026
c01b321
reimplement: SHC_3BB0A8C1_0x00504F10 28.87% 28.87% repaired from unbu…
gynt Sep 29, 2026
11c0047
reimplement: SHC_3BB0A8C1_0x005146D0 40.44% 47.46% regalloc
gynt Sep 29, 2026
51aadae
reimplement: SHC_3BB0A8C1_0x005029D0 28.49% 34.09% this spilled vs re…
gynt Sep 29, 2026
ca232e4
reimplement: SHC_3BB0A8C1_0x00502F30 33.92% 36.78% shared blocks as f…
gynt Sep 29, 2026
85f7f83
reimplement: SHC_3BB0A8C1_0x00506370 42.13% 44.49% per-arm stores vs …
gynt Sep 29, 2026
7d9c6df
reimplement: SHC_3BB0A8C1_0x004F7A80 21.92% 20.69% regalloc, frame size
gynt Sep 29, 2026
9f7cb12
reimplement: SHC_3BB0A8C1_0x004FF080 27.31% 27.06% regalloc
gynt Sep 29, 2026
ddcd6b6
reimplement: SHC_3BB0A8C1_0x004F70F0 27.21% 28.62% regalloc
gynt Sep 29, 2026
8e06bec
reimplement: SHC_3BB0A8C1_0x005162D0 35.93% 60.66% dispatch jump tabl…
gynt Sep 29, 2026
4f3ade3
reimplement: SHC_3BB0A8C1_0x00517790 42.52% 42.52% shared destroy bod…
gynt Sep 29, 2026
5c876c6
reimplement: SHC_3BB0A8C1_0x00516B80 46.04% 47.86% four labels as flags
gynt Sep 29, 2026
0dff5e7
reimplement: SHC_3BB0A8C1_0x005037B0 36.36% 36.36% repaired from unbu…
gynt Sep 29, 2026
cce53a5
header: make forceUpdateTextureTilemap signed
gynt Sep 29, 2026
aa8c3ee
reimplement: SHC_3BB0A8C1_0x00509180 15.65% 15.65% repaired, arms res…
gynt Sep 29, 2026
402281a
reimplement: SHC_3BB0A8C1_0x00506370 53.19% signed % and / restored
gynt Oct 5, 2026
9a763d2
reimplement: SHC_3BB0A8C1_0x00509180 16.06% signed % restored
gynt Oct 5, 2026
dfe18c0
reimplement: SHC_3BB0A8C1_0x004F8900 100.00% Reimplemented
gynt Oct 5, 2026
501089b
reimplement: SHC_3BB0A8C1_0x004F8640 100.00% Reimplemented
gynt Oct 5, 2026
b1bba04
reimplement: SHC_3BB0A8C1_0x004F85B0 100.00% Reimplemented
gynt Oct 5, 2026
67782f5
reimplement: SHC_3BB0A8C1_0x004F6CF0 8.99% rolled unrolled loop
gynt Oct 5, 2026
87d8b16
reimplement: SHC_3BB0A8C1_0x004F70F0 47.58% index locals hoisted
gynt Oct 5, 2026
5de92c0
reimplement: SHC_3BB0A8C1_0x00514480 100.00% Reimplemented
gynt Oct 5, 2026
978d693
tools: take main's batch helpers and reccmp fork, add --resolve-wrapp…
gynt Oct 5, 2026
2267f8a
reimplement: SHC_3BB0A8C1_0x00509180 17.33% 1 of 19 asm blocks as macro
gynt Oct 6, 2026
dc32c91
reimplement: SHC_3BB0A8C1_0x00509180 20.51% 9 of 19 asm blocks as macro
gynt Oct 6, 2026
a82262b
reimplement: SHC_3BB0A8C1_0x00509180 23.25% 14 of 19 asm blocks as macro
gynt Oct 6, 2026
51261fd
reimplement: SHC_3BB0A8C1_0x00509180 24.91% 17 of 19 asm blocks as macro
gynt Oct 6, 2026
f9f27bb
reimplement: SHC_3BB0A8C1_0x00509180 26.21% all 19 asm blocks as macro
gynt Oct 6, 2026
94b0fa5
refactor: updateGfxLayer uses the existing NeighbourFlagsAsm macros
gynt Oct 6, 2026
346beaa
fix: Tree xPosition/yPosition are signed in applyTreeBrushToLogicalLayer
gynt Oct 6, 2026
9fa8972
reimplement: SHC_3BB0A8C1_0x00504F10 30.16% Style pass, asm differs
gynt Oct 6, 2026
b4db239
reimplement: SHC_3BB0A8C1_0x005037B0 43.32% size flag as int set in if
gynt Oct 6, 2026
4acfa49
refactor: MACRO_MARK_CHANGED_NEIGHBOURS for the handwritten changed-l…
gynt Oct 6, 2026
8b429aa
build: /GL for the TileMapState functions that keep this in ecx acros…
gynt Oct 6, 2026
b49eeab
reimplement: SHC_3BB0A8C1_0x00501B90 100.00% Reimplemented
gynt Oct 6, 2026
f58fc68
reimplement: SHC_3BB0A8C1_0x004FAE50 100.00% Reimplemented
gynt Oct 6, 2026
5633c62
reimplement: SHC_3BB0A8C1_0x004FB970 96.77% LTCG, add operand order
gynt Oct 6, 2026
45a2ad1
reimplement: SHC_3BB0A8C1_0x004FB8E0 96.97% LTCG, add operand order
gynt Oct 6, 2026
f10404d
reimplement: SHC_3BB0A8C1_0x00501F50 35.57% asm macro, regalloc differs
gynt Oct 6, 2026
bea88cd
reimplement: SHC_3BB0A8C1_0x004F93E0 100.00% Reimplemented
gynt Oct 6, 2026
8531720
reimplement: SHC_3BB0A8C1_0x00508EC0 36.51% global instance access
gynt Oct 6, 2026
39d2670
reimplement: SHC_3BB0A8C1_0x00504A30 49.46% global instance access
gynt Oct 6, 2026
b86b4bc
reimplement: SHC_3BB0A8C1_0x005111D0 48.75% global instance access
gynt Oct 6, 2026
55ee069
reimplement: SHC_3BB0A8C1_0x004FBD80 74.07% step logic fixed, regalloc
gynt Oct 6, 2026
6a580d0
reimplement: SHC_3BB0A8C1_0x004FFBA0 41.03% single exit, owner test m…
gynt Oct 6, 2026
8d00a94
reimplement: SHC_3BB0A8C1_0x005162D0 41.94% global instance access
gynt Oct 6, 2026
cef9030
reimplement: SHC_3BB0A8C1_0x005160C0 49.45% global instance access
gynt Oct 6, 2026
2a4e3d0
reimplement: SHC_3BB0A8C1_0x00512450 79.15% global instance access
gynt Oct 6, 2026
b43ab56
reimplement: SHC_3BB0A8C1_0x00501D90 53.15% const 1 not pooled in ebx
gynt Oct 6, 2026
c0e881c
reimplement: SHC_3BB0A8C1_0x004FB9E0 77.81% LTCG, regalloc differs
gynt Oct 6, 2026
27067fe
reimplement: SHC_3BB0A8C1_0x004F6CF0 100.00% Reimplemented
gynt Oct 6, 2026
943b9ff
reimplement: SHC_3BB0A8C1_0x004F8300 99.27% global instance access
gynt Oct 6, 2026
11b2908
reimplement: SHC_3BB0A8C1_0x004FB0C0 62.37% LTCG, rotation hoisted
gynt Oct 6, 2026
1a10bd9
reimplement: SHC_3BB0A8C1_0x00512100 88.99% global instance access
gynt Oct 6, 2026
1159e27
reimplement: SHC_3BB0A8C1_0x004F9590 62.45% natural x/y, regalloc dif…
gynt Oct 6, 2026
69d0b10
reimplement: SHC_3BB0A8C1_0x004F9F00 82.35% global instance access
gynt Oct 6, 2026
72a65de
reimplement: SHC_3BB0A8C1_0x004F9980 100.00% Reimplemented
gynt Oct 6, 2026
e263464
reimplement: SHC_3BB0A8C1_0x004FC9E0 66.70% signed layer reads
gynt Oct 6, 2026
22d5976
reimplement: SHC_3BB0A8C1_0x00509180 26.49% signed layer reads
gynt Oct 6, 2026
cef3357
reimplement: SHC_3BB0A8C1_0x004FDB00 63.10% signed layer reads
gynt Oct 6, 2026
5c5275e
reimplement: SHC_3BB0A8C1_0x005114C0 100.00% Reimplemented
gynt Oct 6, 2026
fdebf03
reimplement: SHC_3BB0A8C1_0x005017C0 48.98% global instance access
gynt Oct 6, 2026
1fb5af9
reimplement: SHC_3BB0A8C1_0x00502110 43.30% asm macro, regalloc differs
gynt Oct 6, 2026
9e3adce
reimplement: SHC_3BB0A8C1_0x00502680 50.00% asm macro, cold arms inline
gynt Oct 6, 2026
04a3f7d
status: TileMapState functions that match through /GL alone
gynt Oct 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,20 @@ Diff patterns that were reliable (more in the cheat sheet):
not a source difference.
- A mismatching argument count or `ret N` usually means the generated header is wrong; report it instead of working around it.
- Diffs can reveal real bugs in existing reimplementations (wrong constants, wrong strides); fix those.
- A decompiled `goto` that lands *after* a shared block (a clamp ladder, a common tail) is usually not a
jump at all: put the block once, after the if/else that feeds it, and give the skipped arm the value the
block maps to itself (`step = 0` for a clamp that leaves 0 alone). MSVC then emits the original's
"jump straight past the block" for that arm on its own. Duplicating the block into each arm instead does
*not* get tail-merged and scores far worse - worth ~38 points on `updateShowHiLayerOrResetChangedLayer`.
- Thresholds in such a ladder are the literals the `cmp` shows, not what the decompiler printed:
`cmp eax, 0x3c; jle` is `step > 60`, and Ghidra renders the same code as `iVar1 < 60`.
- A folded address constant where the original has an `imul` means a named local: we wrote
`(y - 1) * 400 + x` and got one constant, while the original multiplied a `y - 1` local by 400.
Give each reused coordinate its own local and reassign it as the original walks the neighbours.
- An extra 4 bytes of frame with no local to explain it is usually a value the decompiler folded into an
expression but the original held in a variable (a copy taken across a call, a mask computed once).
- A mask applied inside a loop over a value that cannot change was hoisted in the original; look for
`and reg, MASK` before the first call and keep the masked result in a local.

## Agent Skills

Expand Down
141 changes: 141 additions & 0 deletions IMPLEMENTATION_CHEAT_SHEET.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,34 @@ This also applies when putting instructions inside the condition branches.

Naturally, the logic flow needs to be kept, so the update of a variable can not move before or after another usage of the same variable.

### Statement Order

The order of instructions in the assembly is not the order of the statements in the original source.
Within a boundary the compiler schedules freely, so do not copy the instruction order into the source.

This matters most for long runs of independent stores into one object, as in `AICState::setAICParameters_NN`:
the whole body is `this->aics[aicIndex].<field> = <constant>;` over ~130 fields, and the compiler emits
those `mov dword ptr [eax + <offset>], <reg>` instructions in an order of its own. Rewriting all 16 of
those functions so their statements followed the original's store order made every one of them *worse*
(e.g. `setAICParameters_14` 82.4% -> 50.0%).

That does not make the order unrecoverable. The compiler moves only the stores whose value sits in a **register**:
when a constant's register is about to be reloaded with another constant, the stores still waiting for the old value
are pulled up in front of the reload, and stores of a newly loaded constant are gathered behind it. Stores of an
**immediate** (`mov dword ptr [eax + off], 0x46`) stay where the source put them. So:

1. Take the immediate stores of the original as the skeleton of the source order. Across a family of sibling
functions the skeleton is the same template, so vote the precedence of every pair of fields over all siblings -
a field that is a register store in one function is an immediate in another.
2. Put each register store back at its place in that template (mostly struct order, with the template's own local
swaps: `unknown002` before `unknown001`, `populationPerFarm` before `unknown011`, `recruitProbDefWeak` before
`recruitProbDefDefault`, `RecruitIntervalWeak` before `RecruitInterval`, `AttMaxAssassins` before `AttUnit2`).
3. Compile and move the few statements that still sit elsewhere next to their neighbour in the original.

All 16 `setAICParameters_NN` went from 75-95% to 100% this way, with no type or header change; the earlier attempt
failed because it copied the *instruction* order, hoisted stores included. Which constant lands in which register
then follows by itself - it was a consequence of the statement order, not of register pressure.

## Structure

### Bitwise Operations
Expand Down Expand Up @@ -99,6 +127,56 @@ SEC_RNG::ptr->currentNumber1 % 4
- The assembly may contain multiple assigns of the same value to the same variable within the same boundary. This might be optimization suggesting there was only one assign.
- The decompiler may suggest multiple assigns of the same value to the same variable within the same boundary. If this is not present in the assembly, it might be an artifact.
- If a variable is stored in a temporary, before it is directly being incremented or decremented by one, suggests a post-increment/decrement, even more if the temporary is used after this.
- Do not hoist a repeated sub-expression into a local just because it appears several times. `int const halfWidth = barWidth / 2;`
used at four call sites lost against the original, which recomputes `barWidth / 2` at every use (SHC_3BB0A8C1_0x004B20B0, 67.6% -> 82.4%).
Write the expression out again at each use and let the compiler decide.
- **A local that only copies a field lets the compiler fold what the original kept separate.** MSVC forward-substitutes
an expression built from a register value (`int aiType = pd.aiType; ... int aicIndex = aiType - 1;`) into its use, so
`aics[aicIndex].x` becomes `[reg*0x2a4 + this + (off - 0x2a4)]` with no decrement left. It does **not** substitute
an expression that contains a memory read across a store, a call or a branch. The original's
`test eax, eax; je; add eax, -1; imul eax, eax, 0x2a4; ... [eax + ecx + off]` therefore needs the field tested
directly and read again for the index:
```cpp
if (DAT_GameState::instance.playerDataArray[playerID].aiType == AIT_NULL)
return FALSE;
int aicIndex = DAT_GameState::instance.playerDataArray[playerID].aiType - 1;
```
`determineAIPlayerHelp`, `determineAIPlayerAttackRequestResponse`, `addUnitToSmallestPatrolTribe`,
`setCurrentAttackStrength` all went to 100% on this alone. Fifteen other spellings of the index (casts, pointer
arithmetic, an inlined accessor, in-place decrement, unsigned) all folded - only the missing local matters. The
same applies to any other decompiler local for a field (`tracker`, `outerPatrolGroupsCount`): reading the field at
every use took `getTargetableBuildingForPlayerID` from 65% to 100%.
- **A constant index held in a local stops the per-struct multiply being shared.** When the original recomputes
`playerID * 0x39f4` in every basic block (`mov eax, ecx; imul eax, eax, 0x39f4` three times, with `playerID` staying
in its register) while we multiply once, the array index in the source was a *variable* that the optimizer only
later found to be constant. With a variable index MSVC factors each access by its own element size
(`playerID * 0x1cfa` for a `short` array, `* 0xe7d` for an `int` array), so the three accesses are three different
expressions and nothing is common. Write `int tribeIndex = 11;` and index with it:
```cpp
int tribeIndex = 11;
if (DAT_GameState::instance.playerDataArray[playerID].aiType == AITA_NULL)
return;
int tribeID = DAT_GameState::instance.playerDataArray[playerID].aiTribeIDs[tribeIndex];
```
Eight `AI::AICState` tribe-command functions went from 38-62% to 100% (`setTribe0xbToAggressiveAndAttack`,
`sendTribeToAttack`, `aiCommandTribe11/13`, ...). The same happens when the index is a field the code has just
compared against a constant: `pd.aivCurrentPauseIndex == 1 && pd.aivPauses[pd.aivCurrentPauseIndex] > 0`, not
`aivPauses[1]`. It is not universal - on functions whose index is a loop sum (`aiTribeIDs[166 + i]`) the local made
things worse.
- A constant kept in a callee-saved register from the top of the function (`mov ebx, 1` before the first branch, later
`mov [field], ebx`) is a **result variable** initialised at the top and stored once at the end, not two literal
stores: `int isNotNervous = 1; ... if (cond) isNotNervous = 0; else {...} field = isNotNervous;`
(`computeNervousness` 77% -> 100%).
- `add reg, -N` where we emit `sub reg, N` or `cmp reg, N` means two constants were merged: the source compared a
derived value, `aicIndex == 7` with `aicIndex = aiType - 1`, not `aiType == 8`
(`removeOrganismsAndSetMoveDestinationPairs` 97.9% -> 100%).
- Where two arguments are loaded on either side of a store (`mov ecx, [x]` ... `mov [stance], 1` ... `mov eax, [y]`),
give each a local and put the statements in that order: `int x = pd.someX; tribe.unitStance = ...; int y = pd.someY;`
(`makeUnitsGoDefensiveAndBackToSomeLocation` 95.7% -> 100%). Without a store in between, the *declaration order*
of two such locals picks which one gets `ecx` (`sendUnitsToAttackBreachedCastle` 98.7% -> 100%).
- The opposite does happen for the operands of a single statement: in `SHC_3BB0A8C1_0x00522520` the original evaluates
`unitID / 16` and `unitID % 16` into locals before the compound assignment. If a `|=`/`&=` statement with computed index
and mask does not match, give the index and the mask a local each and keep the declaration order the assembly shows.

### Conditionals

Expand All @@ -110,6 +188,14 @@ SEC_RNG::ptr->currentNumber1 % 4
- If a condition suddenly uses a normally signed variable as unsigned value (e.g. `ja` compared to signed `jg`) and most times also contains a subtraction, it suggests a range condition optimization. The actual value was moved to 0 to allow expressing this via a single check:
- Decomp code example: `DAT_GameCore.missionNumber1to20 - 1U < 0x14`
- Original (likely): `1 <= DAT_GameCore.missionNumber1to20 && DAT_GameCore.missionNumber1to20 <= 20`
- A two-sided range check that is the whole body of a `BOOL`-returning function is compiled branchless. Write it as one
expression, `return lo <= value && value <= hi;`, not as nested `if`s with early returns, and use the literals the
assembly shows rather than a `short`/`ushort` local holding the field (SHC_3BB0A8C1_0x00530FD0, 78.3% -> 100%).
- Which form a boolean result takes is **not** predictable and has to be tried both ways. The folded
`return (x & MASK) == VALUE;` matched at only 40% for SHC_3BB0A8C1_0x004549C0; spelling it out as
`if ((x & MASK) == VALUE) { return TRUE; } else { return FALSE; }`, with locals for the computed index and the loaded
byte, reached 100%. Together with the range-check case above this means: folded expression and explicit
`TRUE`/`FALSE` branches are two separate candidates, measure both.
- A switch with fewer then 4 cases is often simplified and uses subtractions in assembly to compare the value:
```
MOV EAX,[DAT_SoundEffectsHelperData1.SEC_Section1079. volumeLevel]
Expand Down Expand Up @@ -196,6 +282,48 @@ you might have found an unrolled loop. Therefore, try to reproduce the logic in

If GOTOs are present that clearly jump to the start of a loop, but the logic does not allow to do this without a GOTO, for example from a loop inside a loop, you might be able to move the continue or break condition to the outside. Methods could be placing a fitting condition related to the contained loop conditions after the loop or using a boolean flag that then functions as conditional. Both can sometimes be optimized away.

A global used as a running counter alongside the loop index is usually incremented inside the loop, even when its final
value is a constant. Ghidra shows the folded result: `DAT_CurrentUnitSlotID = 2500;` placed around the loop is really
`DAT_CurrentUnitSlotID = 1;` before it and `DAT_CurrentUnitSlotID += 1;` as the first statement of the body. This was
worth the last 8-10% on the whole `Map::Version::UpgradeMapUnitsTo_*` family (0x0053B310, 0x0053B530, 0x0053B570,
0x0053B5E0 all 90% -> 100%).

`!=` as the loop bound suppresses MSVC's unrolling. If the original ends the loop with `jne` while we emit `jl` and an
unrolled body, write `for (int i = 1; i != 2500; ++i)` instead of `i < 2500` (SHC_3BB0A8C1_0x0053B340, 53% -> 91%).

- A loop whose early exit returns the same value as the code after the loop was a `break`, not a `return`. The tell is
callee-saved registers pushed *after* the loop's entry test and one shared `mov eax, result` behind the loop, where
an early `return result;` makes us push everything in the prologue (`assignRequiredIdleEngineersToNewTribe`,
`addEngineersToSelection`, both ~88% -> 100%).
- Do not add a guard the loop condition already expresses. `if (id == 0) return 0;` in front of
`for (; id != 0; id = next(id))` moved one `push` across a branch; without it the compiler derives the same early
exit itself and places it where the original does (`aiRequiresExtraOxtethers`). Likewise put the block the
original keeps inline first: `if (best > 20) { store; return 1; } return 0;` rather than the inverted guard.

- **Several exits that end in the same statement were usually one statement.** MSVC copies a short shared tail
(a store or a call followed by the epilogue) into each predecessor, so three `mov word ptr [tribe.unitStance], 2`
+ `ret` blocks in the original do not mean three assignments in the source. Writing the assignment once after an
`if / else if` ladder instead of `stance = X; return;` in every arm changes how often each value is *used*, and the
use count is what ranks values for the callee-saved registers - so this is the fix when a function matches
instruction for instruction except that two registers are swapped (`tribeID` in `ebx` and the tribe offset in `ebp`
on one side, the reverse on the other). `giveMoveCommandToSortieUnits` 79.6% -> 100%, `instructTribe166ToMove`
81.8% -> 100%, `assignUnitToATribe` 86.1% -> 100% (one `addUnitToTribe(unitID, tribeID)` after the branches
instead of three calls). When one of the arms must skip a call the others share, a `bool` set in the arms and
tested once afterwards compiles away and gives the single call site the original has.
- A search loop whose "found a free slot" exit must skip the check that follows the loop has its end test **inside
the body**: `for (;; i++) { if (i >= count) { if (best == 0) return 0; break; } ... if (free) { best = create();
bestIndex = i; break; } ... }`. A `for (i < count)` loop with the check after it tests `best` on both paths, and
duplicating the tail into the create path changes the frame. With the test in the body the compiler rotates it to
the bottom and lays the blocks out as the original does (`getSmallestPatrolTribe` 65.2% -> 100%). The same
function needed `int i = 0;` declared *first*, before the other zero-initialised locals, to get the original's
`xor` order - declaration order did not matter anywhere else it was tried.

- `mov edx, esi; add esi, 1` at the **top** of a loop body, with the body then indexing by the copy, is a `while`
loop that takes the index and advances the counter first: `while (i < count) { int index = i; i++; if (...[index]...)
{ ...; return; } }`. A `for (...; i++)` with the same body does not produce it. Together with `int i = 0;`
declared where the original's `xor esi, esi` sits (here before an earlier early-return test, which then compares
against that zero register) this took `generateSiegeCreationInformation` from 39.4% to 100%.

### GOTO

A function may contain multiple GOTOs.
Expand Down Expand Up @@ -230,6 +358,19 @@ It is hard to find these cases. I one situation, local variables that were used

## Functions

### Return Values

A function declared `void` whose assembly still leaves a value in EAX at the return usually returns it. The most common
case is a function that returns the ID it was passed: changing `void EntityState::activateProjectileEntity(int entityID)`
to `int` with a trailing `return entityID;` took SHC_3BB0A8C1_0x004039B0 from 36.4% to 100%. Fix the signature in the
generated header rather than working around the difference.

### Link-Time Code Generation

A volatile register (usually ECX or EDX) that stays live across a call in the original, without being reloaded, means
that call was compiled with LTCG. This is fixable, not a permanent blocker: add the `.cpp` to `cmake/compiler-flags-gl.txt`
so it is built with `/GL`. SHC_3BB0A8C1_0x00504EE0 went from 38.5% to 100% and SHC_3BB0A8C1_0x0045B7F0 to 100% that way.

### Parameters

Parameters might not be pushed like normal in certain cases.
Expand Down
21 changes: 13 additions & 8 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,21 @@ if "%~1"=="" (
set "PRESET=%~1"
set "TARGET=%~2"

:: --- Kill mspdbsrv.exe if it's running ---
tasklist | find /I "mspdbsrv.exe" >nul
if not errorlevel 1 (
if not defined WRAP_QUIET echo Stopping mspdbsrv.exe...
taskkill /f /t /im mspdbsrv.exe >nul
if errorlevel 1 (
if not defined WRAP_QUIET echo [WARNING] Failed to stop mspdbsrv.exe, continuing...
)
:: --- Give this worktree its own PDB server ---
:: mspdbsrv.exe is a per-user singleton keyed on _MSPDBSRV_ENDPOINT_, and every worktree
:: carries its own copy of the toolchain. Sharing one endpoint across worktrees makes
:: cl.exe talk to whichever copy started first and fail with
:: fatal error C1090: PDB API call failed, error code '23'
if not defined _MSPDBSRV_ENDPOINT_ (
for %%I in ("%~dp0.") do set "_MSPDBSRV_ENDPOINT_=openshc_%%~nxI"
)

:: --- Kill this worktree's mspdbsrv.exe if it's running ---
:: Only ours: killing every instance by image name takes down the PDB server of any other
:: worktree that is building at the same time, which fails their build with C1090.
powershell -NoProfile -Command ^
"Get-Process mspdbsrv -ErrorAction SilentlyContinue | Where-Object { $_.Path -like '%~dp0*' } | Stop-Process -Force -ErrorAction SilentlyContinue" >nul 2>&1

:: --- Run cmake configure using preset ---
if not defined WRAP_QUIET echo [INFO] Configuring with preset "%PRESET%"...
call .\cmakew --preset "%PRESET%"
Expand Down
20 changes: 20 additions & 0 deletions cmake/compiler-flags-gl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,23 @@ src/OpenSHC/IO/ResourceManager/swapMapDataWithNextMap.cpp
src/OpenSHC/UI/Rendering/WindowAndDirectDraw/takeScreenshot.cpp
src/OpenSHC/IO/ResourceManager/readFirstPartOfCurrentResourceIntoMemory.cpp
src/OpenSHC/IO/ResourceManager/readNextPartOfCurrentResourceIntoMemory.cpp
src/OpenSHC/Map/TileMapState/getBuildingSizeIndexMappingData.cpp
src/OpenSHC/Map/TileMapState/recountTotalOwnedMoats.cpp
src/OpenSHC/Map/TileMapState/setSignpostDistanceForCampaignMission.cpp
src/OpenSHC/Map/TileMapState/determineBuildingPlacementRotation.cpp
src/OpenSHC/Map/TileMapState/updateBuildingPlacementRotationPreview.cpp
src/OpenSHC/Map/TileMapState/updateMoatCountdownTimers.cpp
src/OpenSHC/Map/TileMapState/updateGameRelatedValue.cpp
src/OpenSHC/Map/TileMapState/clearDrawBridgeWater.cpp
src/OpenSHC/Map/TileMapState/clearFixedSizeTwoBuildingFootprint.cpp
src/OpenSHC/Map/TileMapState/clearRockFootprintFlags.cpp
src/OpenSHC/Map/TileMapState/clearSizeFiveBuildingFootprintAndMoats.cpp
src/OpenSHC/Map/TileMapState/clearTreeFootprintFlags.cpp
src/OpenSHC/Map/TileMapState/floodMoatUnderRemovedBuilding.cpp
src/OpenSHC/Map/TileMapState/isUnitBlockingSizeFiveFootprint.cpp
src/OpenSHC/Map/TileMapState/markBuildingFootprintFlag.cpp
src/OpenSHC/Map/TileMapState/placeOilsmelter.cpp
src/OpenSHC/Map/TileMapState/renderWallPlacementPreview.cpp
src/OpenSHC/Map/TileMapState/setMiscDisplayLayer.cpp
src/OpenSHC/Map/TileMapState/storeMinAndMaxHeightOfArea.cpp
src/OpenSHC/Map/TileMapState/unmarkBuildingFootprintFlag.cpp
2 changes: 1 addition & 1 deletion reccmp/dll/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
git+https://github.com/isledecomp/reccmp
git+https://github.com/sourcehold/reccmp
Loading