Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
299 commits
Select commit Hold shift + click to select a range
8a99771
reimplement: SHC_3BB0A8C1_0x00534380 77.61% orig walks matrix row ptr
gynt Sep 27, 2026
21bc4eb
reimplement: SHC_3BB0A8C1_0x00536DE0 100.00% Reimplemented
gynt Sep 27, 2026
572a203
reimplement: SHC_3BB0A8C1_0x0052FCA0 100.00% Reimplemented
gynt Sep 27, 2026
1a3f476
reimplement: SHC_3BB0A8C1_0x005302B0 100.00% Reimplemented
gynt Sep 27, 2026
937b77b
reimplement: SHC_3BB0A8C1_0x00536CC0 100.00% Reimplemented
gynt Sep 27, 2026
d41d112
reimplement: SHC_3BB0A8C1_0x00530390 100.00% Reimplemented
gynt Sep 27, 2026
0aa4598
reimplement: SHC_3BB0A8C1_0x0052FC30 100.00% Reimplemented
gynt Sep 27, 2026
0e15c8d
reimplement: SHC_3BB0A8C1_0x00537100 100.00% Reimplemented
gynt Sep 27, 2026
8e27838
reimplement: SHC_3BB0A8C1_0x005355E0 100.00% Reimplemented
gynt Sep 27, 2026
bac87ed
reimplement: SHC_3BB0A8C1_0x0052F4E0 100.00% Reimplemented
gynt Sep 27, 2026
e438c73
reimplement: SHC_3BB0A8C1_0x00535DF0 46.15% call+reg alloc differs
gynt Sep 27, 2026
2f87f1e
reimplement: SHC_3BB0A8C1_0x005343F0 100.00% Reimplemented
gynt Sep 27, 2026
09daa29
reimplement: SHC_3BB0A8C1_0x00537130 40.00% param store order differs
gynt Sep 27, 2026
1356c60
reimplement: SHC_3BB0A8C1_0x0052F550 100.00% Reimplemented
gynt Sep 27, 2026
80d7d4d
reimplement: SHC_3BB0A8C1_0x0053BB90 60.00% one read via global inst
gynt Sep 27, 2026
24293d3
reimplement: SHC_3BB0A8C1_0x005370C0 100.00% Reimplemented
gynt Sep 27, 2026
3f430a9
reimplement: SHC_3BB0A8C1_0x0052F440 66.67% loop shape differs
gynt Sep 27, 2026
5f11074
reimplement: SHC_3BB0A8C1_0x00530880 100.00% Reimplemented
gynt Sep 27, 2026
f923469
reimplement: SHC_3BB0A8C1_0x00535730 100.00% Reimplemented
gynt Sep 27, 2026
476713c
reimplement: SHC_3BB0A8C1_0x005365A0 100.00% Reimplemented
gynt Sep 27, 2026
f597be5
reimplement: SHC_3BB0A8C1_0x005364C0 100.00% Reimplemented
gynt Sep 27, 2026
dad0955
reimplement: SHC_3BB0A8C1_0x00536530 100.00% Reimplemented
gynt Sep 27, 2026
5c25dae
reimplement: SHC_3BB0A8C1_0x005359C0 100.00% Reimplemented
gynt Sep 27, 2026
e33523d
reimplement: SHC_3BB0A8C1_0x00536710 100.00% Reimplemented
gynt Sep 27, 2026
93a0238
reimplement: SHC_3BB0A8C1_0x005361F0 100.00% Reimplemented
gynt Sep 27, 2026
8942c4f
reimplement: SHC_3BB0A8C1_0x005362F0 100.00% Reimplemented
gynt Sep 27, 2026
b0d792c
reimplement: SHC_3BB0A8C1_0x00536610 100.00% Reimplemented
gynt Sep 27, 2026
a395f16
reimplement: SHC_3BB0A8C1_0x0053E9F0 56.79% orig caches x/y in locals
gynt Sep 27, 2026
422e75c
reimplement: SHC_3BB0A8C1_0x00536260 65.00% type range test shape
gynt Sep 27, 2026
bf37bd2
reimplement: SHC_3BB0A8C1_0x00537160 100.00% Reimplemented
gynt Sep 27, 2026
6ab5757
reimplement: SHC_3BB0A8C1_0x005371A0 35.71% param store order differs
gynt Sep 27, 2026
b67a3d2
reimplement: SHC_3BB0A8C1_0x0052F010 68.97% branch shape differs
gynt Sep 27, 2026
688fcf8
reimplement: SHC_3BB0A8C1_0x00533FC0 70.83% branch shape differs
gynt Sep 27, 2026
b44193d
reimplement: SHC_3BB0A8C1_0x00530240 100.00% Reimplemented
gynt Sep 27, 2026
2d94988
reimplement: SHC_3BB0A8C1_0x00530310 100.00% Reimplemented
gynt Sep 27, 2026
b050166
reimplement: SHC_3BB0A8C1_0x0053A4D0 100.00% Reimplemented
gynt Sep 27, 2026
ddc0920
reimplement: SHC_3BB0A8C1_0x0052E7B0 100.00% Reimplemented
gynt Sep 27, 2026
171c744
reimplement: SHC_3BB0A8C1_0x00534030 55.77% switch shape differs
gynt Sep 27, 2026
893e6f5
reimplement: SHC_3BB0A8C1_0x0052FE00 84.85% reg alloc differs
gynt Sep 27, 2026
b348169
reimplement: SHC_3BB0A8C1_0x0053E790 36.36% orig uses global instance
gynt Sep 27, 2026
840ec37
reimplement: SHC_3BB0A8C1_0x00536970 34.15% local loop var + reg alloc
gynt Sep 27, 2026
6e7cbd6
reimplement: SHC_3BB0A8C1_0x00536CF0 52.17% branch order differs
gynt Sep 27, 2026
78e4356
reimplement: SHC_3BB0A8C1_0x00537A00 100.00% Reimplemented
gynt Sep 27, 2026
fc0380e
reimplement: SHC_3BB0A8C1_0x0053CAE0 41.67% loop shape differs
gynt Sep 27, 2026
b07fdf1
reimplement: SHC_3BB0A8C1_0x00534520 17.39% orig unrolled, not a loop
gynt Sep 27, 2026
3e93d84
reimplement: SHC_3BB0A8C1_0x00534490 15.38% orig unrolled, 16-bit ORs
gynt Sep 27, 2026
6f63f4f
reimplement: SHC_3BB0A8C1_0x00537EE0 100.00% Reimplemented
gynt Sep 27, 2026
aaf4ee3
reimplement: SHC_3BB0A8C1_0x005334A0 41.24% orig caches unitType local
gynt Sep 27, 2026
636c60d
reimplement: SHC_3BB0A8C1_0x0053D850 69.77% reg alloc differs
gynt Sep 27, 2026
0b68652
reimplement: SHC_3BB0A8C1_0x00537D60 14.63% orig uses global instance
gynt Sep 27, 2026
1e5bca9
reimplement: SHC_3BB0A8C1_0x00536370 77.27% cond order differs
gynt Sep 27, 2026
63df663
reimplement: SHC_3BB0A8C1_0x00535FD0 88.89% orig walks hotkey ptr
gynt Sep 27, 2026
04cd64e
reimplement: SHC_3BB0A8C1_0x00533580 24.49% orig caches locals
gynt Sep 27, 2026
1dbede2
reimplement: SHC_3BB0A8C1_0x00533810 80.26% orig walks matrix row ptr
gynt Sep 27, 2026
09db8e1
reimplement: SHC_3BB0A8C1_0x00536690 92.11% Style pass, asm differs
gynt Sep 27, 2026
3423386
reimplement: SHC_3BB0A8C1_0x00535680 23.68% guard order differs
gynt Sep 27, 2026
cb5adc0
reimplement: SHC_3BB0A8C1_0x00530650 80.36% reg alloc differs
gynt Sep 27, 2026
4c96b54
reimplement: SHC_3BB0A8C1_0x0052F730 45.36% branch shape differs
gynt Sep 27, 2026
6b2b881
reimplement: SHC_3BB0A8C1_0x00532F80 12.59% orig walks 2 arrays by ptr
gynt Sep 27, 2026
b450b67
reimplement: SHC_3BB0A8C1_0x00533CA0 90.91% loop exit shape differs
gynt Sep 27, 2026
e559048
reimplement: SHC_3BB0A8C1_0x0053A070 64.00% orig caches state local
gynt Sep 27, 2026
1f8ce2a
reimplement: SHC_3BB0A8C1_0x00536400 38.89% branch shape differs
gynt Sep 27, 2026
3b0ab39
reimplement: SHC_3BB0A8C1_0x0052F680 58.33% branch shape differs
gynt Sep 27, 2026
556244b
reimplement: SHC_3BB0A8C1_0x00537E00 35.16% orig has 2 separate loops
gynt Sep 27, 2026
ef7f203
reimplement: SHC_3BB0A8C1_0x00530400 100.00% Reimplemented
gynt Sep 27, 2026
6b2f342
reimplement: SHC_3BB0A8C1_0x005346D0 32.12% orig walks unit ptr
gynt Sep 27, 2026
4008a1d
reimplement: SHC_3BB0A8C1_0x0053E6C0 83.72% branch shape differs
gynt Sep 27, 2026
0d5e80d
reimplement: SHC_3BB0A8C1_0x0053E390 55.17% version ladder shape
gynt Sep 27, 2026
f6fc4e1
reimplement: SHC_3BB0A8C1_0x005308F0 100.00% Reimplemented
gynt Sep 27, 2026
689eb82
reimplement: SHC_3BB0A8C1_0x0052F5B0 24.62% orig fully unrolled x4
gynt Sep 27, 2026
4c7e83b
reimplement: SHC_3BB0A8C1_0x0052FD00 83.10% orig caches dir in locals
gynt Sep 27, 2026
7f14fcb
reimplement: SHC_3BB0A8C1_0x00537700 16.13% orig caches counter local
gynt Sep 27, 2026
1bbf2cf
reimplement: SHC_3BB0A8C1_0x00534240 28.99% orig walks matrix row ptrs
gynt Sep 27, 2026
44bd658
reimplement: SHC_3BB0A8C1_0x0052FE90 81.94% orig caches dir in locals
gynt Sep 27, 2026
d4e8313
reimplement: SHC_3BB0A8C1_0x00533A10 19.51% orig caches x/y in locals
gynt Sep 27, 2026
d1177d8
reimplement: SHC_3BB0A8C1_0x0052EED0 80.00% orig caches unitType local
gynt Sep 27, 2026
999f5c2
reimplement: SHC_3BB0A8C1_0x0054C4F0 13.98% orig walks matrix row ptr
gynt Sep 27, 2026
c756c39
reimplement: SHC_3BB0A8C1_0x005345A0 61.73% orig walks unit ptr
gynt Sep 27, 2026
b695d1b
reimplement: SHC_3BB0A8C1_0x00535B00 61.82% call+reg alloc differs
gynt Sep 27, 2026
4ce90ee
reimplement: SHC_3BB0A8C1_0x00537C10 48.52% orig walks unit ptr
gynt Sep 27, 2026
3ed1d33
reimplement: SHC_3BB0A8C1_0x00533B30 70.07% orig caches x/y in locals
gynt Sep 27, 2026
c34b16b
reimplement: SHC_3BB0A8C1_0x00534130 79.73% reg alloc differs
gynt Sep 27, 2026
1ff1241
reimplement: SHC_3BB0A8C1_0x00537880 28.57% retry loop shape differs
gynt Sep 27, 2026
75162a7
reimplement: SHC_3BB0A8C1_0x00535A30 67.74% call+reg alloc differs
gynt Sep 27, 2026
96cad7b
reimplement: SHC_3BB0A8C1_0x00530500 100.00% Reimplemented
gynt Sep 27, 2026
eae5f18
reimplement: SHC_3BB0A8C1_0x0052FF80 67.53% orig caches dir in locals
gynt Sep 27, 2026
7fec45d
reimplement: SHC_3BB0A8C1_0x0054C610 72.73% call+reg alloc differs
gynt Sep 27, 2026
394e335
reimplement: SHC_3BB0A8C1_0x005360A0 90.54% orig unrolls inner loop x5
gynt Sep 27, 2026
e1ce378
reimplement: SHC_3BB0A8C1_0x0053E900 87.04% reg alloc differs
gynt Sep 27, 2026
25ca113
reimplement: SHC_3BB0A8C1_0x005350B0 100.00% Reimplemented
gynt Sep 27, 2026
e841804
reimplement: SHC_3BB0A8C1_0x0053D900 68.75% orig caches x/y in locals
gynt Sep 27, 2026
829badb
reimplement: SHC_3BB0A8C1_0x0052E830 89.47% orig walks unit ptr
gynt Sep 27, 2026
642fc6f
reimplement: SHC_3BB0A8C1_0x00537AA0 38.92% orig walks unit ptr
gynt Sep 27, 2026
43001ca
reimplement: SHC_3BB0A8C1_0x005300B0 25.00% orig caches rng in local
gynt Sep 27, 2026
0ce7da9
reimplement: SHC_3BB0A8C1_0x0052F0D0 40.96% branch shape differs
gynt Sep 27, 2026
6ea07e9
reimplement: SHC_3BB0A8C1_0x0052EDC0 48.48% branch shape differs
gynt Sep 27, 2026
086c145
reimplement: SHC_3BB0A8C1_0x0053DCC0 14.93% orig caches many locals
gynt Sep 27, 2026
c1c32fd
reimplement: SHC_3BB0A8C1_0x00539BE0 78.43% jump table order differs
gynt Sep 27, 2026
b5eb3d7
reimplement: SHC_3BB0A8C1_0x00540040 49.84% orig caches locals
gynt Sep 27, 2026
bb38329
reimplement: SHC_3BB0A8C1_0x00536780 20.48% orig unrolls counter loop x3
gynt Sep 27, 2026
8ca1e99
reimplement: SHC_3BB0A8C1_0x00533D50 37.57% branch shape differs
gynt Sep 27, 2026
fa515e5
reimplement: SHC_3BB0A8C1_0x0052F260 19.32% loop shape differs
gynt Sep 27, 2026
9ece5e4
reimplement: SHC_3BB0A8C1_0x00531000 38.28% orig caches unitTypes local
gynt Sep 27, 2026
d914f1f
reimplement: SHC_3BB0A8C1_0x00533630 20.60% orig walks enemy array ptr
gynt Sep 27, 2026
cc8f8f0
reimplement: SHC_3BB0A8C1_0x0054BFC0 46.09% branch shape differs
gynt Sep 27, 2026
c86a581
reimplement: SHC_3BB0A8C1_0x00534EE0 88.14% reg alloc differs
gynt Sep 27, 2026
9aba176
reimplement: SHC_3BB0A8C1_0x00535E20 40.00% branch shape differs
gynt Sep 27, 2026
5e1a76f
reimplement: SHC_3BB0A8C1_0x00534D10 88.99% reg alloc differs
gynt Sep 27, 2026
e1fc168
reimplement: SHC_3BB0A8C1_0x0052EC10 100.00% Reimplemented
gynt Sep 27, 2026
bd9d112
reimplement: SHC_3BB0A8C1_0x00536A60 87.31% array init loop differs
gynt Sep 27, 2026
e627f69
reimplement: SHC_3BB0A8C1_0x0053B8E0 83.61% orig caches many locals
gynt Sep 27, 2026
11cc28e
reimplement: SHC_3BB0A8C1_0x00532460 66.24% branch shape differs
gynt Sep 27, 2026
3c50499
reimplement: SHC_3BB0A8C1_0x005330A0 81.58% switch fallthrough differs
gynt Sep 27, 2026
3aa5d7d
reimplement: SHC_3BB0A8C1_0x0053E440 46.10% orig walks unit ptr
gynt Sep 27, 2026
46d5ccd
reimplement: SHC_3BB0A8C1_0x0053A150 31.65% orig shares call tails
gynt Sep 27, 2026
ad8d565
reimplement: SHC_3BB0A8C1_0x0053D9C0 19.24% orig shares branch tails
gynt Sep 27, 2026
cd8c881
reimplement: SHC_3BB0A8C1_0x00535240 35.10% orig walks counter ptr
gynt Sep 27, 2026
36c2be3
reimplement: SHC_3BB0A8C1_0x0052F7E0 17.62% orig caches height locals
gynt Sep 27, 2026
f1fb68c
reimplement: SHC_3BB0A8C1_0x00532700 9.98% orig caches unit fields
gynt Sep 27, 2026
a2188b3
reimplement: SHC_3BB0A8C1_0x00532700 55.24% orig dups call per branch
gynt Sep 27, 2026
fffcf61
reimplement: SHC_3BB0A8C1_0x0053CBD0 35.81% orig caches shooter fields
gynt Sep 27, 2026
c780d5f
reimplement: SHC_3BB0A8C1_0x0052E960 83.29% orig walks unit ptr
gynt Sep 27, 2026
6a2e631
reimplement: SHC_3BB0A8C1_0x0053D030 42.88% branch shape differs
gynt Sep 27, 2026
9e62f40
reimplement: SHC_3BB0A8C1_0x00532BA0 44.40% orig walks unit ptr
gynt Sep 27, 2026
c9a88e5
reimplement: SHC_3BB0A8C1_0x00536E30 24.74% branch shape differs
gynt Sep 27, 2026
a5aea28
reimplement: SHC_3BB0A8C1_0x00535BC0 47.16% branch shape differs
gynt Sep 27, 2026
2127f4e
reimplement: SHC_3BB0A8C1_0x0054C1C0 32.51% branch shape differs
gynt Sep 27, 2026
6775ef6
reimplement: SHC_3BB0A8C1_0x00539DF0 64.66% hist array via 1st global
gynt Sep 27, 2026
43878e1
reimplement: SHC_3BB0A8C1_0x0053D3D0 13.33% orig dups climb resolve
gynt Sep 27, 2026
d635c87
reimplement: SHC_3BB0A8C1_0x0053D3D0 21.48% orig dups climb resolve
gynt Sep 27, 2026
36935ae
reimplement: SHC_3BB0A8C1_0x0053DDD0 65.46% orig unrolls scan loop x4
gynt Sep 27, 2026
8c4c884
reimplement: SHC_3BB0A8C1_0x005347E0 61.78% cases 1-8 dead in binary
gynt Sep 27, 2026
a4cd6ec
reimplement: SHC_3BB0A8C1_0x005371F0 36.20% orig walks XYPair ptrs
gynt Sep 27, 2026
8588945
reimplement: SHC_3BB0A8C1_0x00578C40 59.73% branch shape differs
gynt Sep 27, 2026
706f73b
reimplement: SHC_3BB0A8C1_0x00531220 31.00% orig shares sfx tails
gynt Sep 27, 2026
1bcd150
reimplement: SHC_3BB0A8C1_0x0054A7B0 34.03% orig walks enemy array ptr
gynt Sep 27, 2026
c684961
reimplement: SHC_3BB0A8C1_0x0053A5B0 9.88% reg alloc differs
gynt Sep 27, 2026
c1e88d0
reimplement: SHC_3BB0A8C1_0x0053A5B0 9.88% reg alloc differs
gynt Sep 27, 2026
fd1ef5b
reimplement: SHC_3BB0A8C1_0x0053A5B0 9.80% reg alloc differs
gynt Sep 27, 2026
9d2a3c3
reimplement: SHC_3BB0A8C1_0x0053A5B0 9.81% reg alloc, this on stack
gynt Sep 27, 2026
dc7faf4
reimplement: SHC_3BB0A8C1_0x00537F60 62.54% jump table order differs
gynt Sep 27, 2026
44ed223
reimplement: SHC_3BB0A8C1_0x00549C70 20.30% orig shares melee tail
gynt Sep 27, 2026
274e52a
reimplement: SHC_3BB0A8C1_0x00531920 17.98% orig merges pos blocks
gynt Sep 27, 2026
c9a19fe
reimplement: SHC_3BB0A8C1_0x0054B0D0 38.11% score tail, reg alloc
gynt Sep 27, 2026
6b4b47e
reimplement: SHC_3BB0A8C1_0x00579300 28.52% reg alloc, dup tails
gynt Sep 27, 2026
dd6c690
reimplement: SHC_3BB0A8C1_0x00536C90 100.00% Reimplemented
gynt Sep 27, 2026
8bff188
reimplement: SHC_3BB0A8C1_0x00549C70 29.18% mask reg alloc, frame ptr
gynt Sep 27, 2026
eda9ce2
reimplement: SHC_3BB0A8C1_0x00531920 25.58% extra spills, frame size
gynt Sep 27, 2026
519ee36
reimplement: SHC_3BB0A8C1_0x0054A7B0 34.28% reg alloc, spill order
gynt Sep 27, 2026
50fbd2d
reimplement: SHC_3BB0A8C1_0x00531220 44.04% block order, reg alloc
gynt Sep 27, 2026
148e4e6
reimplement: SHC_3BB0A8C1_0x0053A5B0 11.38% arg push scheduling
gynt Sep 27, 2026
e79ee49
reimplement: SHC_3BB0A8C1_0x0054B0D0 39.18% score tail, reg alloc
gynt Sep 27, 2026
ff697fb
reimplement: SHC_3BB0A8C1_0x00533A10 29.51% reg alloc
gynt Sep 27, 2026
b6ac40e
reimplement: SHC_3BB0A8C1_0x00536400 62.96% loop shape
gynt Sep 27, 2026
a1712f6
reimplement: SHC_3BB0A8C1_0x0052E960 87.92% reg alloc
gynt Sep 27, 2026
b6519b6
reimplement: SHC_3BB0A8C1_0x00537700 21.14% loop shape, spills
gynt Sep 27, 2026
c92eb58
reimplement: SHC_3BB0A8C1_0x0053CAE0 48.61% reg alloc
gynt Sep 27, 2026
426995d
reimplement: SHC_3BB0A8C1_0x005300B0 26.19% Style pass, asm differs
gynt Sep 27, 2026
c12e2bb
reimplement: SHC_3BB0A8C1_0x00535BC0 57.91% Style pass, asm differs
gynt Sep 27, 2026
5c0ed20
reimplement: SHC_3BB0A8C1_0x0053CBD0 37.21% reg alloc
gynt Sep 27, 2026
0065229
reimplement: SHC_3BB0A8C1_0x00532460 75.85% reg alloc
gynt Sep 27, 2026
aa82629
reimplement: SHC_3BB0A8C1_0x00549C70 29.20% Style pass, asm differs
gynt Sep 27, 2026
f61389a
reimplement: SHC_3BB0A8C1_0x0052F010 100.00% Reimplemented
gynt Sep 27, 2026
848730c
reimplement: SHC_3BB0A8C1_0x0052F730 82.83% reg alloc
gynt Sep 27, 2026
bd81567
reimplement: SHC_3BB0A8C1_0x00535E20 65.08% reg alloc
gynt Sep 27, 2026
9cd4b0d
reimplement: SHC_3BB0A8C1_0x0052FE00 100.00% Reimplemented
gynt Sep 27, 2026
ba351d9
reimplement: SHC_3BB0A8C1_0x0052FD00 90.14% reg alloc
gynt Sep 27, 2026
a5fc84a
reimplement: SHC_3BB0A8C1_0x0053B8E0 86.89% reg alloc
gynt Sep 27, 2026
2e563ac
reimplement: SHC_3BB0A8C1_0x00537D60 48.72% reg alloc
gynt Sep 27, 2026
b709f6f
reimplement: SHC_3BB0A8C1_0x00579300 33.71% Style pass, asm differs
gynt Sep 27, 2026
6e2a0e2
reimplement: SHC_3BB0A8C1_0x00535240 75.53% switch case order
gynt Sep 27, 2026
b420a77
reimplement: SHC_3BB0A8C1_0x0053A150 56.87% reg alloc, spill order
gynt Sep 27, 2026
813807a
reimplement: SHC_3BB0A8C1_0x00536780 32.75% loop shape, reg alloc
gynt Sep 27, 2026
3be58a5
reimplement: SHC_3BB0A8C1_0x0053D9C0 25.82% reg alloc, hoisted loads
gynt Sep 27, 2026
76517f2
reimplement: SHC_3BB0A8C1_0x0053D3D0 28.17% reg alloc, spill order
gynt Sep 27, 2026
6c6075e
reimplement: SHC_3BB0A8C1_0x00537AA0 40.00% reg alloc
gynt Sep 27, 2026
2681ed4
reimplement: SHC_3BB0A8C1_0x00537C10 50.89% reg alloc
gynt Sep 27, 2026
4536e95
reimplement: SHC_3BB0A8C1_0x005371F0 38.54% reg alloc, loop shape
gynt Sep 27, 2026
1556aa1
reimplement: SHC_3BB0A8C1_0x0053E900 87.04% reg alloc
gynt Sep 27, 2026
165e1cf
reimplement: SHC_3BB0A8C1_0x0054B0D0 39.18% 2-reg addressing, reg alloc
gynt Sep 27, 2026
c4822fb
reimplement: SHC_3BB0A8C1_0x0054B0D0 39.29% 2-reg addressing, reg alloc
gynt Sep 27, 2026
9e4b846
reimplement: SHC_3BB0A8C1_0x0052EDC0 62.12% reg alloc, edi save site
gynt Sep 27, 2026
cf99606
reimplement: SHC_3BB0A8C1_0x0054B0D0 39.29% Style pass, asm differs
gynt Sep 27, 2026
4f8443d
reimplement: SHC_3BB0A8C1_0x0054C1C0 32.51% reg alloc
gynt Sep 27, 2026
ac9c6ea
reimplement: SHC_3BB0A8C1_0x00579300 33.71% reg alloc, dup tails
gynt Sep 27, 2026
6564181
reimplement: SHC_3BB0A8C1_0x0054B0D0 39.29% 2-reg addressing, reg alloc
gynt Sep 27, 2026
0cd5161
reimplement: SHC_3BB0A8C1_0x00531920 25.58% extra spills, frame size
gynt Sep 27, 2026
dc5db85
reimplement: SHC_3BB0A8C1_0x00549C70 29.20% mask reg alloc, frame ptr
gynt Sep 27, 2026
035109f
reimplement: SHC_3BB0A8C1_0x0053A5B0 11.97% arg push hoist, y in reg
gynt Sep 27, 2026
0cd5623
reimplement: SHC_3BB0A8C1_0x0053A5B0 25.73% arg push hoist, y cached
gynt Sep 27, 2026
201d7e5
reimplement: SHC_3BB0A8C1_0x0054B0D0 39.29% 2-reg addressing, reg alloc
gynt Sep 27, 2026
bc50400
reimplement: SHC_3BB0A8C1_0x00531920 25.58% extra spills, frame size
gynt Sep 27, 2026
41442ae
reimplement: SHC_3BB0A8C1_0x0053A5B0 33.37% arg push hoist, y cached
gynt Sep 27, 2026
6d977b4
reimplement: SHC_3BB0A8C1_0x00579300 33.71% reg alloc, dup tails
gynt Sep 27, 2026
0e8d062
reimplement: SHC_3BB0A8C1_0x00549C70 29.20% mask reg alloc, frame ptr
gynt Sep 27, 2026
39d9219
reimplement: SHC_3BB0A8C1_0x0054B0D0 39.29% 2-reg addressing, reg alloc
gynt Sep 27, 2026
6b24cac
reimplement: SHC_3BB0A8C1_0x00579300 34.14% reg alloc, dup tails
gynt Sep 27, 2026
ed6abef
reimplement: SHC_3BB0A8C1_0x0054B0D0 39.29% 2-reg addressing, reg alloc
gynt Sep 27, 2026
6281048
reimplement: SHC_3BB0A8C1_0x00531920 25.58% extra spills, frame size
gynt Sep 27, 2026
bd1a6d6
reimplement: SHC_3BB0A8C1_0x00549C70 29.20% mask reg alloc, frame ptr
gynt Sep 27, 2026
44cbcca
reimplement: SHC_3BB0A8C1_0x00579300 34.14% reg alloc, dup tails
gynt Sep 27, 2026
bacf39e
reimplement: SHC_3BB0A8C1_0x00534520 21.28% spills base+tile to stack
gynt Sep 27, 2026
c6f27c3
reimplement: SHC_3BB0A8C1_0x00534490 20.41% spills base+tile, word OR
gynt Sep 27, 2026
ac3752c
reimplement: SHC_3BB0A8C1_0x00532F80 43.31% block order, spills
gynt Sep 27, 2026
7340a65
reimplement: SHC_3BB0A8C1_0x00534520 22.22% spills base+tile to stack
gynt Sep 27, 2026
4770081
reimplement: SHC_3BB0A8C1_0x0052F7E0 26.43% reg alloc, band order
gynt Sep 27, 2026
78fc4e0
reimplement: SHC_3BB0A8C1_0x00534520 22.22% spills base+tile to stack
gynt Sep 27, 2026
ed86987
reimplement: SHC_3BB0A8C1_0x00534490 20.41% spills base+tile, word OR
gynt Sep 27, 2026
3ea5224
reimplement: SHC_3BB0A8C1_0x0054B0D0 39.29% 2-reg addressing, reg alloc
gynt Sep 27, 2026
338ee16
reimplement: SHC_3BB0A8C1_0x0054A7B0 34.28% reg alloc, spill order
gynt Sep 27, 2026
c68829b
reimplement: SHC_3BB0A8C1_0x00531220 44.04% block order, reg alloc
gynt Sep 27, 2026
2f62820
reimplement: SHC_3BB0A8C1_0x0053B8E0 86.89% reg alloc
gynt Sep 27, 2026
643a2e4
reimplement: SHC_3BB0A8C1_0x00579300 34.14% reg alloc, dup tails
gynt Sep 27, 2026
84bc404
reimplement: SHC_3BB0A8C1_0x00536E30 32.30% reg alloc, spill order
gynt Sep 27, 2026
fd1b4c5
reimplement: SHC_3BB0A8C1_0x00533630 24.03% reg alloc
gynt Sep 28, 2026
8f711cf
reimplement: SHC_3BB0A8C1_0x00537AA0 40.00% reg alloc
gynt Sep 28, 2026
cbd8aa4
reimplement: SHC_3BB0A8C1_0x00537C10 60.36% reg alloc
gynt Sep 28, 2026
eec09ed
reimplement: SHC_3BB0A8C1_0x0054A7B0 34.28% reg alloc, spill order
gynt Sep 28, 2026
c55cdf8
reimplement: SHC_3BB0A8C1_0x00530650 83.93% reg alloc
gynt Sep 28, 2026
20d852c
reimplement: SHC_3BB0A8C1_0x0053DCC0 25.37% reg alloc
gynt Sep 28, 2026
9032434
reimplement: SHC_3BB0A8C1_0x00536E30 34.48% reg alloc, spill order
gynt Sep 28, 2026
852d5c5
reimplement: SHC_3BB0A8C1_0x0053D3D0 36.15% reg alloc, spill order
gynt Sep 28, 2026
92d8971
reimplement: SHC_3BB0A8C1_0x00533630 42.29% reg alloc
gynt Sep 28, 2026
949a682
reimplement: SHC_3BB0A8C1_0x00531000 38.28% reg alloc, branch order
gynt Sep 28, 2026
ac1f930
reimplement: SHC_3BB0A8C1_0x00532BA0 50.28% reg alloc
gynt Sep 28, 2026
3b0d0db
reimplement: SHC_3BB0A8C1_0x0053CBD0 42.49% reg alloc, spill order
gynt Sep 28, 2026
82e7449
reimplement: SHC_3BB0A8C1_0x00579300 35.22% reg alloc, dup tails
gynt Sep 28, 2026
819062c
reimplement: SHC_3BB0A8C1_0x00531920 28.71% extra spills, frame size
gynt Sep 28, 2026
6b4f578
reimplement: SHC_3BB0A8C1_0x00537F60 64.89% LTCG edx across call
gynt Sep 28, 2026
a942a92
reimplement: SHC_3BB0A8C1_0x00533D50 39.42% reg alloc
gynt Sep 28, 2026
7aa1286
cleanup: calculateUnitMovementSpeed readability at equal match
gynt Sep 28, 2026
5978fbc
reimplement: findNearestEnemyAndHeadTowardsIt 34.4% reg alloc
gynt Sep 28, 2026
4e05848
reimplement: restore signed power-of-two divisions in 8 functions
gynt Sep 28, 2026
78e3e2b
reimplement: restore signed power-of-two remainders in updateUnits
gynt Sep 28, 2026
aed965c
reimplement: processEntityDamageToUnit 31.4% reg alloc
gynt Sep 28, 2026
df3af4c
fix: three lost shared blocks in processEntityDamageToUnit; 28.7% -> …
gynt Sep 28, 2026
cad9453
cleanup: name acquireShootTarget locals at equal match
gynt Sep 28, 2026
f48a6f4
reimplement: drop 60 field-walking pointers in updateUnits; 37.8% -> …
gynt Sep 28, 2026
3883cb4
reimplement: updateUnits reads the unit slot global directly; 39.0% -…
gynt Sep 28, 2026
3de206b
reimplement: updateUnits 40.9% -> 41.2%, unpick two comma-operator co…
gynt Sep 28, 2026
0ea2c2b
fix: try_styles.py compared rounded percentages, hiding small regress…
gynt Sep 28, 2026
df10692
reimplement: calculateUnitMovementSpeed 26.4% -> 31.1%, one signed re…
gynt Sep 28, 2026
96cbe8b
reimplement: resetUnitMovementState 100% Reimplemented, one int local
gynt Sep 28, 2026
eb556dc
reimplement: widen short locals holding a field read, 5 functions
gynt Sep 28, 2026
2f9f163
reimplement: widen byte-sized flag locals to int, 3 functions
gynt Sep 28, 2026
10e6c09
cleanup: setDestinationForUnit holds a signed field in an int, at equ…
gynt Sep 29, 2026
584cf14
reimplement: reorder independent statements, 3 functions
gynt Sep 29, 2026
95e8f0e
tools: give the batch build scripts build.bat PDB server fix
gynt Sep 29, 2026
2583dc7
reimplement: reorder six independent statements in updateUnits; 41.2%…
gynt Sep 29, 2026
2826353
tools/batch: retry on a fresh PDB endpoint, not just a fresh server
gynt Sep 29, 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
21 changes: 21 additions & 0 deletions src/OpenSHC/Map/Units/UnitsState/Constructor_UnitsState.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include "OpenSHC/Map/Units/UnitsState.func.hpp"

namespace OpenSHC {
namespace Map {
namespace Units {

// FUNCTION: STRONGHOLDCRUSADER 0x0053B8B0
UnitsState* UnitsState::Constructor_UnitsState()
{
this->creationTime = timeGetTime();
MACRO_CALL_MEMBER(OpenSHC::Map::Units::UnitsState_Func::clearAllUnits, this)();
this->lastSelectedUnitID = 0;
this->unknownInitially0_01 = 0;
this->lostChimps = 0;
this->maxUnitCount = 2500;
return this;
}

}
}
}
547 changes: 547 additions & 0 deletions src/OpenSHC/Map/Units/UnitsState/acquireShootTarget.cpp

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include "OpenSHC/Map/Units/UnitsState.func.hpp"

#include "OpenSHC/Globals/DAT_UnitPropertiesDefinedData.hpp"

namespace OpenSHC {
namespace Map {
namespace Units {

// FUNCTION: STRONGHOLDCRUSADER 0x005340F0
void UnitsState::adjustUnitMapOrientationRelatedPositionBasedOnMapOrientationCorrectedFacingDirection(
int unitID)
{
this->units[unitID].orientationRelatedPositionX = this->units[unitID].orientationRelatedPositionX
+ (short)DAT_UnitPropertiesDefinedData::instance
.UnitOrientationRelatedOffset[this->units[unitID].facingDirectionMapOrientationCorrected][0];
this->units[unitID].orientationRelatedPositionY = this->units[unitID].orientationRelatedPositionY
+ (short)DAT_UnitPropertiesDefinedData::instance
.UnitOrientationRelatedOffset[this->units[unitID].facingDirectionMapOrientationCorrected][1];
}

}
}
}
264 changes: 264 additions & 0 deletions src/OpenSHC/Map/Units/UnitsState/applyDragBoxSelectionByPriority.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@
#include "OpenSHC/Map/Units/UnitsState.func.hpp"
#include "OpenSHC/Map/Units/States/UnitState.hpp"
#include "OpenSHC/Map/Units/UnitLogicState.hpp"
#include "OpenSHC/Map/Units/UnitType.hpp"

#include "OpenSHC/Globals/DAT_CurrentUnitSlotID.hpp"
#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp"
#include "OpenSHC/Globals/DAT_MouseState.hpp"

namespace OpenSHC {
namespace Map {
namespace Units {

using OpenSHC::Map::Units::UnitLogicState;
using OpenSHC::Map::Units::UnitType;
using OpenSHC::Map::Units::States::UnitState;

// FUNCTION: STRONGHOLDCRUSADER 0x005347E0
void UnitsState::applyDragBoxSelectionByPriority()
{
this->field14_0x55c = 0;
LONG _boxLeft;
LONG _boxRight;
if (DAT_MouseState::instance.selectionBox.right < DAT_MouseState::instance.selectionBox.left) {
_boxLeft = DAT_MouseState::instance.selectionBox.right;
_boxRight = DAT_MouseState::instance.selectionBox.left;
} else {
_boxLeft = DAT_MouseState::instance.selectionBox.left;
_boxRight = DAT_MouseState::instance.selectionBox.right;
}
LONG _boxTop;
LONG _boxBottom;
if (DAT_MouseState::instance.selectionBox.bottom < DAT_MouseState::instance.selectionBox.top) {
_boxTop = DAT_MouseState::instance.selectionBox.bottom;
_boxBottom = DAT_MouseState::instance.selectionBox.top;
} else {
_boxTop = DAT_MouseState::instance.selectionBox.top;
_boxBottom = DAT_MouseState::instance.selectionBox.bottom;
}
int _otherOwnUnits = 0;
int _catapults = 0;
int _trebuchets = 0;
int _siegeTowers = 0;
int _batteringRams = 0;
int _shields = 0;
int _mangonels = 0;
int _ballistas = 0;
int _priority = 0;
uint _lordUnitID = 0;
int _siegeEngineUnits = 0;
for (DAT_CurrentUnitSlotID::instance = 1; (int)DAT_CurrentUnitSlotID::instance < (int)this->maxUnitCount;
DAT_CurrentUnitSlotID::instance = DAT_CurrentUnitSlotID::instance + 1) {
if (this->units[DAT_CurrentUnitSlotID::instance].logicalState != OpenSHC::Map::Units::ULS_NORMAL
|| this->units[DAT_CurrentUnitSlotID::instance].dying != 0
|| this->units[DAT_CurrentUnitSlotID::instance].isSelectable_OR_matchTime == 0
|| this->units[DAT_CurrentUnitSlotID::instance].unknownTestAgainst0_2 != 0
|| this->units[DAT_CurrentUnitSlotID::instance].state.generic
== OpenSHC::Map::Units::States::US_JESTER_ROAM_TO
|| (this->units[DAT_CurrentUnitSlotID::instance].drawX == 0
&& this->units[DAT_CurrentUnitSlotID::instance].drawY == 0)
|| this->units[DAT_CurrentUnitSlotID::instance].drawX
+ this->units[DAT_CurrentUnitSlotID::instance].drawXOffset
>= _boxRight
|| this->units[DAT_CurrentUnitSlotID::instance].drawY
+ this->units[DAT_CurrentUnitSlotID::instance].someDrawYOffset
>= _boxBottom
|| this->units[DAT_CurrentUnitSlotID::instance].spriteWidthUnk
+ this->units[DAT_CurrentUnitSlotID::instance].drawX
+ this->units[DAT_CurrentUnitSlotID::instance].drawXOffset
< _boxLeft
|| this->units[DAT_CurrentUnitSlotID::instance].spriteHeightUnk
+ this->units[DAT_CurrentUnitSlotID::instance].drawY
+ this->units[DAT_CurrentUnitSlotID::instance].someDrawYOffset
< _boxTop
|| (this->units[DAT_CurrentUnitSlotID::instance].unitType == OpenSHC::Map::Units::UT_TUNNELER
&& (this->units[DAT_CurrentUnitSlotID::instance].state.generic
== OpenSHC::Map::Units::States::US_LOOK_AROUNDUnk
|| this->units[DAT_CurrentUnitSlotID::instance].state.generic
== OpenSHC::Map::Units::States::US_STAND_UPUnk))) {
continue;
}
if (this->units[DAT_CurrentUnitSlotID::instance].owner
!= DAT_GameSynchronyState::instance.currentPlayerSlotID) {
if (this->units[DAT_CurrentUnitSlotID::instance].owner != 0) {
this->field14_0x55c = this->units[DAT_CurrentUnitSlotID::instance].owner;
}
continue;
}
if (this->units[DAT_CurrentUnitSlotID::instance].unitType == OpenSHC::Map::Units::UT_LORD) {
_lordUnitID = DAT_CurrentUnitSlotID::instance;
_otherOwnUnits = _otherOwnUnits + 1;
continue;
}
_siegeEngineUnits = _siegeEngineUnits + 1;
if (this->units[DAT_CurrentUnitSlotID::instance].unitType == OpenSHC::Map::Units::UT_S_CATAPULT) {
_catapults = _catapults + 1;
} else if (this->units[DAT_CurrentUnitSlotID::instance].unitType
== OpenSHC::Map::Units::UT_S_TREBUCHET) {
_trebuchets = _trebuchets + 1;
} else if (this->units[DAT_CurrentUnitSlotID::instance].unitType == OpenSHC::Map::Units::UT_S_TOWER) {
_siegeTowers = _siegeTowers + 1;
} else if (this->units[DAT_CurrentUnitSlotID::instance].unitType
== OpenSHC::Map::Units::UT_S_BATTERINGRAM) {
_batteringRams = _batteringRams + 1;
} else if (this->units[DAT_CurrentUnitSlotID::instance].unitType == OpenSHC::Map::Units::UT_S_SHIELD) {
_shields = _shields + 1;
} else if (this->units[DAT_CurrentUnitSlotID::instance].unitType
== OpenSHC::Map::Units::UT_S_MANGONEL) {
_mangonels = _mangonels + 1;
} else if (this->units[DAT_CurrentUnitSlotID::instance].unitType
== OpenSHC::Map::Units::UT_S_BALLISTA) {
_ballistas = _ballistas + 1;
} else if (this->units[DAT_CurrentUnitSlotID::instance].unitType
== OpenSHC::Map::Units::UT_S_FBALLISTA) {
_priority = _priority + 1;
} else {
_otherOwnUnits = _otherOwnUnits + 1;
}
}
if (_lordUnitID != 0 && _siegeEngineUnits != 0) {
_otherOwnUnits = _otherOwnUnits - 1;
_lordUnitID = 0;
}
if (_otherOwnUnits != 0 || _catapults != 0 || _trebuchets != 0 || _siegeTowers != 0 || _batteringRams != 0
|| _shields != 0 || _mangonels != 0 || _ballistas != 0 || _priority != 0) {
_priority = 0;
} else {
_priority = 9;
}
this->totalUnitsInSelection = 0;
for (DAT_CurrentUnitSlotID::instance = 1; (int)DAT_CurrentUnitSlotID::instance < (int)this->maxUnitCount;
DAT_CurrentUnitSlotID::instance = DAT_CurrentUnitSlotID::instance + 1) {
this->units[DAT_CurrentUnitSlotID::instance].isSelected = 0;
if (this->units[DAT_CurrentUnitSlotID::instance].logicalState != OpenSHC::Map::Units::ULS_NORMAL
|| this->units[DAT_CurrentUnitSlotID::instance].dying != 0
|| this->units[DAT_CurrentUnitSlotID::instance].isSelectable_OR_matchTime == 0
|| this->units[DAT_CurrentUnitSlotID::instance].unknownTestAgainst0_2 != 0
|| this->units[DAT_CurrentUnitSlotID::instance].state.generic
== OpenSHC::Map::Units::States::US_JESTER_ROAM_TO
|| (this->units[DAT_CurrentUnitSlotID::instance].drawX == 0
&& this->units[DAT_CurrentUnitSlotID::instance].drawY == 0)
|| this->units[DAT_CurrentUnitSlotID::instance].drawX
+ this->units[DAT_CurrentUnitSlotID::instance].drawXOffset
>= _boxRight
|| this->units[DAT_CurrentUnitSlotID::instance].drawY
+ this->units[DAT_CurrentUnitSlotID::instance].someDrawYOffset
>= _boxBottom
|| this->units[DAT_CurrentUnitSlotID::instance].spriteWidthUnk
+ this->units[DAT_CurrentUnitSlotID::instance].drawX
+ this->units[DAT_CurrentUnitSlotID::instance].drawXOffset
< _boxLeft
|| this->units[DAT_CurrentUnitSlotID::instance].spriteHeightUnk
+ this->units[DAT_CurrentUnitSlotID::instance].drawY
+ this->units[DAT_CurrentUnitSlotID::instance].someDrawYOffset
< _boxTop
|| (this->units[DAT_CurrentUnitSlotID::instance].unitType == OpenSHC::Map::Units::UT_TUNNELER
&& (this->units[DAT_CurrentUnitSlotID::instance].state.generic
== OpenSHC::Map::Units::States::US_LOOK_AROUNDUnk
|| this->units[DAT_CurrentUnitSlotID::instance].state.generic
== OpenSHC::Map::Units::States::US_STAND_UPUnk))) {
continue;
}
switch (_priority) {
case 0:
if (this->units[DAT_CurrentUnitSlotID::instance].owner
== DAT_GameSynchronyState::instance.currentPlayerSlotID) {
if (this->units[DAT_CurrentUnitSlotID::instance].unitType != OpenSHC::Map::Units::UT_LORD
|| _lordUnitID != 0) {
this->units[DAT_CurrentUnitSlotID::instance].isSelected = 1;
this->totalUnitsInSelection = this->totalUnitsInSelection + 1;
}
}
break;
case 1:
if (this->units[DAT_CurrentUnitSlotID::instance].owner
== DAT_GameSynchronyState::instance.currentPlayerSlotID) {
if (this->units[DAT_CurrentUnitSlotID::instance].unitType
== OpenSHC::Map::Units::UT_S_CATAPULT) {
this->units[DAT_CurrentUnitSlotID::instance].isSelected = 1;
this->totalUnitsInSelection = this->totalUnitsInSelection + 1;
}
}
break;
case 2:
if (this->units[DAT_CurrentUnitSlotID::instance].owner
== DAT_GameSynchronyState::instance.currentPlayerSlotID) {
if (this->units[DAT_CurrentUnitSlotID::instance].unitType
== OpenSHC::Map::Units::UT_S_TREBUCHET) {
this->units[DAT_CurrentUnitSlotID::instance].isSelected = 1;
this->totalUnitsInSelection = this->totalUnitsInSelection + 1;
}
}
break;
case 3:
if (this->units[DAT_CurrentUnitSlotID::instance].owner
== DAT_GameSynchronyState::instance.currentPlayerSlotID) {
if (this->units[DAT_CurrentUnitSlotID::instance].unitType == OpenSHC::Map::Units::UT_S_TOWER) {
this->units[DAT_CurrentUnitSlotID::instance].isSelected = 1;
this->totalUnitsInSelection = this->totalUnitsInSelection + 1;
}
}
break;
case 4:
if (this->units[DAT_CurrentUnitSlotID::instance].owner
== DAT_GameSynchronyState::instance.currentPlayerSlotID) {
if (this->units[DAT_CurrentUnitSlotID::instance].unitType
== OpenSHC::Map::Units::UT_S_BATTERINGRAM) {
this->units[DAT_CurrentUnitSlotID::instance].isSelected = 1;
this->totalUnitsInSelection = this->totalUnitsInSelection + 1;
}
}
break;
case 5:
if (this->units[DAT_CurrentUnitSlotID::instance].owner
== DAT_GameSynchronyState::instance.currentPlayerSlotID) {
if (this->units[DAT_CurrentUnitSlotID::instance].unitType == OpenSHC::Map::Units::UT_S_SHIELD) {
this->units[DAT_CurrentUnitSlotID::instance].isSelected = 1;
this->totalUnitsInSelection = this->totalUnitsInSelection + 1;
}
}
break;
case 6:
if (this->units[DAT_CurrentUnitSlotID::instance].owner
== DAT_GameSynchronyState::instance.currentPlayerSlotID) {
if (this->units[DAT_CurrentUnitSlotID::instance].unitType
== OpenSHC::Map::Units::UT_S_MANGONEL) {
this->units[DAT_CurrentUnitSlotID::instance].isSelected = 1;
this->totalUnitsInSelection = this->totalUnitsInSelection + 1;
}
}
break;
case 7:
if (this->units[DAT_CurrentUnitSlotID::instance].owner
== DAT_GameSynchronyState::instance.currentPlayerSlotID) {
if (this->units[DAT_CurrentUnitSlotID::instance].unitType
== OpenSHC::Map::Units::UT_S_BALLISTA) {
this->units[DAT_CurrentUnitSlotID::instance].isSelected = 1;
this->totalUnitsInSelection = this->totalUnitsInSelection + 1;
}
}
break;
case 8:
if (this->units[DAT_CurrentUnitSlotID::instance].owner
== DAT_GameSynchronyState::instance.currentPlayerSlotID) {
if (this->units[DAT_CurrentUnitSlotID::instance].unitType
== OpenSHC::Map::Units::UT_S_FBALLISTA) {
this->units[DAT_CurrentUnitSlotID::instance].isSelected = 1;
this->totalUnitsInSelection = this->totalUnitsInSelection + 1;
}
}
break;
case 9:
if (this->units[DAT_CurrentUnitSlotID::instance].owner
!= DAT_GameSynchronyState::instance.currentPlayerSlotID) {
this->units[DAT_CurrentUnitSlotID::instance].isSelected = 1;
this->totalUnitsInSelection = this->totalUnitsInSelection + 1;
}
}
}
}

}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#include "OpenSHC/Map/Navigation/PathFindingState.func.hpp"
#include "OpenSHC/Map/TileMapState.func.hpp"
#include "OpenSHC/Map/Units/UnitsState.func.hpp"
#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp"

#include "OpenSHC/Globals/DAT_PathFindingState.hpp"
#include "OpenSHC/Globals/DAT_TerrainDefinedData.hpp"
#include "OpenSHC/Globals/DAT_TileMapState.hpp"

namespace OpenSHC {
namespace Map {
namespace Units {

using OpenSHC::WindowsHelper::Enums::BOOLEnum;

// FUNCTION: STRONGHOLDCRUSADER 0x00534130
void UnitsState::applyTunnelDamageAlongPathPlan(uint unitID)
{
uint _xPosition = this->units[unitID].ladderExitXPosition;
uint _yPosition = this->units[unitID].ladderExitYPosition;
int _tile = this->units[unitID].previousTilePosition;
for (int _stepIndex = 0; _stepIndex < this->units[unitID].totalSizeOfPathPlan; ++_stepIndex) {
if ((DAT_TileMapState::instance.LogicLayer[_tile] & 0x20000081U) == 0) {
if (DAT_TileMapState::instance.BuildingLayer[_tile] == 0
&& (DAT_TileMapState::instance.HeightLayer[_tile] < 0x10
|| DAT_TileMapState::instance.DefaultHeightLayer[_tile] < 0x10)) {
MACRO_CALL_MEMBER(OpenSHC::Map::TileMapState_Func::increaseHeightForTunnelWithBrush,
DAT_TileMapState::ptr)(_tile, _xPosition, _yPosition, -2);
DAT_TileMapState::instance.HeightLayer[_tile] = 0;
} else {
MACRO_CALL_MEMBER(
OpenSHC::Map::TileMapState_Func::processDamageToBuilding, DAT_TileMapState::ptr)(
_tile, _xPosition, _yPosition, 5, 0, this->units[unitID].owner, FALSE, 0);
}
MACRO_CALL_MEMBER(OpenSHC::Map::Navigation::PathFindingState_Func::updateWalkAndPathLayer,
DAT_PathFindingState::ptr)(1, _xPosition, _yPosition);
}
uint _packedDirections = (char)this->units[unitID].pathPlanStart[_stepIndex / 2];
uint _direction;
if ((_stepIndex & 1) == 0) {
_direction = _packedDirections & 0xf;
} else {
_direction = (int)_packedDirections >> 4;
}
_xPosition = _xPosition
+ DAT_TerrainDefinedData::instance.clockwiseCardinalTranslationMatrix[_direction].int_.xOffset;
_tile = _tile + DAT_TileMapState::instance.directionTranslationMatrix[_yPosition][_direction];
_yPosition = _yPosition
+ DAT_TerrainDefinedData::instance.clockwiseCardinalTranslationMatrix[_direction].int_.yOffset;
}
}

}
}
}
Loading