Jonathan G Rennison
4f3058ee06
VarAction2: Improve handling of variable 7B with a previous constant
2 years ago
Jonathan G Rennison
23e6d861fc
VarAction2: Ensure that store simplification can't break var 7B
2 years ago
Jonathan G Rennison
3bddd55921
VarAction2: Add sprite group flag for if var 1C seen before proc
2 years ago
Jonathan G Rennison
16185e817e
VarAction2: Merge compatible constant operations
2 years ago
Jonathan G Rennison
0343e9d9dd
VarAction2: Replace sequences of the form: (var * flag) + (var * !flag)
2 years ago
Jonathan G Rennison
e5e984d92f
VarAction2: Replace effective SMAX/SMIN sequences in DSE pass
2 years ago
Jonathan G Rennison
0484fbf941
VarAction2: Save/restore inference when going back to previous op with side effects
2 years ago
Jonathan G Rennison
376b434d53
VarAction2: Re-order commutative skip on zero operation sequences
...
Such that less expensive variables can be tested first
2 years ago
Jonathan G Rennison
0409bd88e8
VarAction2: Simplify tracking of sprite group feature
2 years ago
Jonathan G Rennison
caebff85f5
VarAction2: Add helper functions for constant comparison adjust types
2 years ago
Jonathan G Rennison
249a20e47a
VarAction2: Add helper functions for relational comparison ops
2 years ago
Jonathan G Rennison
31e96ff5e7
VarAction2: Add helper functions for anti-commutative ops
2 years ago
Jonathan G Rennison
5db30e559e
VarAction2: Store substitutions can now handle inversions
2 years ago
Jonathan G Rennison
b95116e4fc
VarAction2: Apply XOR bool inversion conversions after DSE
2 years ago
Jonathan G Rennison
2bbfa37730
VarAction2: Replace reversed commutative/sub op via temp storage in DSE pass
2 years ago
Jonathan G Rennison
45ac1a89aa
VarAction2: Apply XOR with 1 bool logic inversion in more cases
...
Fixes case of DSE-delayed var substitutions
2 years ago
Jonathan G Rennison
1c1e6a1042
VarAction2: Prune deterministic sprite group children again after DSE
2 years ago
Jonathan G Rennison
6e398f9cec
VarAction2: DSE now takes into account DSE results from child groups
2 years ago
Jonathan G Rennison
65407210a6
VarAction2: Allow DSGA_OP_STO_NC to be used with DSGA_TYPE_EQ/NEQ
2 years ago
Jonathan G Rennison
d3dce79d73
VarAction2: Substitute single-use vars through temp storage in DSE pass
2 years ago
Jonathan G Rennison
0310692acf
VarAction2: Only substitute cheap vars through temp storage in 1st pass
2 years ago
Jonathan G Rennison
f54530b1b2
VarAction2: Add checks for vars 7B, 7C when getting previous single load
2 years ago
Jonathan G Rennison
a8c0e47dd8
VarAction2: If DSE results in a redundant load, remove it
2 years ago
Jonathan G Rennison
86324e0fda
Debug: Add mode to sprite dump window to show unoptimised
2 years ago
Jonathan G Rennison
74681f70d9
VarAction2: Replace inverted OR of bools with AND where this makes sense
2 years ago
Jonathan G Rennison
e41a5d2f63
VarAction2: Add flags to skip adjust if value is 0 or LSB set
2 years ago
Jonathan G Rennison
236cbc4e83
VarAction2: Optimise SAR same as SHR on unsigned inputs
2 years ago
Jonathan G Rennison
9d04ebcc90
VarAction2: Remove operations which always do nothing when applied to 0
2 years ago
Jonathan G Rennison
26dd84f931
VarAction2: Optimise OR followed by XOR of same constant
2 years ago
Jonathan G Rennison
3aa0ccb97b
VarAction2: Optimise OR which always produces 1
2 years ago
Jonathan G Rennison
4b7288902d
VarAction2: Consider industry tile vars 0x60 to 0x62 to be expensive
2 years ago
Jonathan G Rennison
3a5902ff77
VarAction2: Reduce cost of RecursiveDisallowDSEForProcedure
...
Fix disallowing DSE also disallowing store simplification
2 years ago
Jonathan G Rennison
c342b4219b
NewGRF: Use per-GRF text ID map in GetGRFStringID
2 years ago
Jonathan G Rennison
3ea1e27fdd
Merge branch 'master' into jgrpp
...
# Conflicts:
# src/lang/german.txt
# src/lang/korean.txt
# src/lang/spanish_MX.txt
# src/lang/traditional_chinese.txt
# src/script/api/script_airport.cpp
# src/script/api/script_rail.cpp
2 years ago
Jonathan G Rennison
f05b5163f7
Fix narrowing converison warning
2 years ago
Jonathan G Rennison
bbc1e28b24
VarAction2: Re-use allocated callback result sprite groups
2 years ago
Jonathan G Rennison
e5ef888e80
VarAction2: Add variable/constant copy store simplifification
2 years ago
Jonathan G Rennison
a93b3948b5
VarAction2: Don't change variable masks when disabling procedure DSE
2 years ago
Jonathan G Rennison
3d42e36f89
VarAction2: Avoid pessimising DSE when a procedure returns a callback result
2 years ago
Jonathan G Rennison
9e414a1eab
VarAction2: Move optimiser flags to a separate setting
2 years ago
Jonathan G Rennison
6ff8066d34
VarAction2: Ensure that a temp store var can't reference a clobbered var
2 years ago
Jonathan G Rennison
fe6ab0f19f
VarAction2: Don't track var copies through temporary storage for stations
...
Except for copies of other temporary storage vars
2 years ago
Jonathan G Rennison
db7f29b07c
VarAction2: Deduplicate loads from expensive uncached variables
...
Currently only some vehicle variables
2 years ago
Jonathan G Rennison
6a17f00a27
VarAction2: Ensure dead store elimination doesn't break variable 0x7B
2 years ago
Jonathan G Rennison
813146a78f
VarAction2: Track value inferences through temp storage in more cases
2 years ago
Jonathan G Rennison
ccef3646db
VarAction2: Set value inferences for operations with eq/neq adjust types
2 years ago
Jonathan G Rennison
04a9c73ec2
VarAction2: Combine RST, UMIN sequence to load with neq 0 adjust
2 years ago
Jonathan G Rennison
9116ca6bb0
VarAction2: Track copies of variables through temporary storage
2 years ago
Jonathan G Rennison
263a87f5da
VarAction2: Add adjust types for combined (in)equality with constant
2 years ago
Jonathan G Rennison
1e52e51ce1
VarAction2: Add bounds checks to previous adjust accesses
2 years ago
Jonathan G Rennison
c2fde53495
VarAction2: Remove redundant variable loads
2 years ago
Jonathan G Rennison
30f74c5b74
Sprite group: Add getter function for sprite groups
2 years ago
Jonathan G Rennison
d8f9641dc9
VarAction2: Remove redundant UMIN operation on already boolean values
2 years ago
Jonathan G Rennison
3c9201ebd5
VarAction2: Fix dead store elimination through randomised sprite groups
2 years ago
Jonathan G Rennison
e0581db2a1
VarAction2: Remove dead stores and redundant adjusts in more cases
2 years ago
Jonathan G Rennison
d71e38446e
Improve performance of string lookup in AddGRFString
2 years ago
Jonathan G Rennison
994dc683a2
VarAction2: Fix calculated result groups being incorrectly pruned
2 years ago
Jonathan G Rennison
b102e912b3
VarAction2: Allow temp store dead store elmination with industries
2 years ago
Jonathan G Rennison
4687a8c2a4
VarAction2: Prune group ranges for constant values
...
Add chicken bit to control pruning
2 years ago
Jonathan G Rennison
c894d5a86d
VarAction2: Add temp store dead store elimination
2 years ago
Niels Martin Hansen
5587e439a9
Fix: Industry layouts with zero regular tiles should be invalid
2 years ago
Jonathan G Rennison
a8eb52f061
VarAction2: Simplify handling of first adjustment
2 years ago
Jonathan G Rennison
a5f5be2dff
VarAction2: Detect ops on previous constants which become loads
2 years ago
Jonathan G Rennison
1fec7d6ddb
VarAction2: Detect and replace reversed commutative op via temp storage
2 years ago
Jonathan G Rennison
762cfb3df7
VarAction2: Track temp store loads with respect to stores
2 years ago
Jonathan G Rennison
6953150898
VarAction2: Move optimisation pass to separate function
...
Simplify logic slightly
2 years ago
Jonathan G Rennison
145536e1fd
VarAction2: Detect and replace reverse subtract via temp storage
2 years ago
Jonathan G Rennison
dd2e1fe956
Add chicken bit to disable varact2 optimisation
2 years ago
Jonathan G Rennison
f0a0b2e200
VarAction2: Flatten constant operations on constants in more cases
2 years ago
Jonathan G Rennison
2360b3e93e
VarAction2: Detect and replace scaled reads of train/RV/ship current speed
2 years ago
Jonathan G Rennison
13cdef2a2d
VarAction2: Remove redundant and with 1 when value is already bool
2 years ago
Jonathan G Rennison
2f09eff404
VarAction2: Convert boolean, invert sequence to ternary
2 years ago
Jonathan G Rennison
90a2aa57fc
VarAction2: Detect and replace signed relational comparisons
2 years ago
Jonathan G Rennison
e732042785
VarAction2: Remove redundant constant loads
2 years ago
Jonathan G Rennison
74e1a40f7c
VarAction2: Remove trivially resolvable deterministic sprite groups
2 years ago
Jonathan G Rennison
3b5eede3fc
VarAction2: Detect and replace operations which always produce 0
2 years ago
Jonathan G Rennison
a21ae12c90
VarAction2: Remove redundant temp store loads after stores
2 years ago
Jonathan G Rennison
db5be4f92e
VarAction2: Remove constant parameter redirection via variable 7B
2 years ago
Jonathan G Rennison
da629e4cfa
VarAction2: Replace divs of powers of 2 with shifts where possible
2 years ago
Jonathan G Rennison
fad5973161
VarAction2: Reduce shift right and mask ops into adjust shift/mask
2 years ago
Jonathan G Rennison
012d73ef34
VarAction2: Detect equality comparisons
...
Remove redundant equality with 0 comparison before ternary
2 years ago
Jonathan G Rennison
7283825638
VarAction2: Detect and replace ternary operator pattern
2 years ago
Jonathan G Rennison
e3df522111
VarAction2: Delete provably zero adjustment operations
2 years ago
Jonathan G Rennison
a54416afbc
Add GRF variable to use extra station names even when default names remain
2 years ago
Jonathan G Rennison
34af4844d1
Merge branch 'master' into jgrpp
2 years ago
Michael Lutz
08a5478a93
Add: [NewGRF] Map seed as global variable.
...
This is useful to provide a feature-agnostic, stable random value that differs between games.
One of the possible uses is to e.g. use it to create pseudo-random regions for towns or industries.
2 years ago
Jonathan G Rennison
cb573a1523
Add road stop property to set cost multipliers
2 years ago
Jonathan G Rennison
5a2cc24190
Fix initialisation of new road stop specs
2 years ago
Jonathan G Rennison
2cbbae16da
Add roadstop GRF properties to set bridge heights and disallowed pillars
2 years ago
Jonathan G Rennison
23c472d2a0
Add support for road stop animation, availability callback
...
Add animation, callback mask, general flags properties
Add animation frame variables
2 years ago
Jonathan G Rennison
67d967befb
Add road stop support for Action 3 cargo type groups
2 years ago
Jonathan G Rennison
a69eba31fe
Implement NewGRF road stop root sprite group selection
2 years ago
Jonathan G Rennison
1084bb8566
Initial support for NewGRF road stops (bus and lorry stops)
2 years ago
Jonathan G Rennison
a3c003546b
Implement extended NewGRF variable parameter support
2 years ago
Jonathan G Rennison
d4f11eca42
Add NewGRF object properties to set viewport map mode/smallmap tile type
2 years ago
Jonathan G Rennison
a03453da49
Add properties to set lighthouse and transmitter generation amounts
2 years ago
Jonathan G Rennison
eeef6c485a
Initial implementation of NewGRF feature ID mapping
2 years ago
Jonathan G Rennison
ef3916928c
Initial abstraction around NewGRF feature ID bytes
2 years ago
Jonathan G Rennison
bb848331b6
Fix narrowing conversion warning
2 years ago
Jonathan G Rennison
33dc6c9688
Add NewGRF VarAction2 variable remapping infrastructure
2 years ago