Commit Graph

1862 Commits

Author SHA1 Message Date
Jonathan G Rennison
ece0a43146 Merge branch 'master' into jgrpp
# Conflicts:
#	src/newgrf_station.cpp
2022-09-14 19:43:12 +01:00
frosch
e2c46fda3f Fix: [NewGRF] Ensure that stations always have an even number of sprite layouts.
The drawing code has a special fallbacks for zero layouts, but fails hard for one layout.
(odd numbers >= 3 are weird, but do not fail as badly as 1)
2022-09-11 21:26:06 +02:00
Jonathan G Rennison
173f867e1a VarAction2: Save calculated_result in shadow group struct 2022-08-22 00:13:23 +01:00
Jonathan G Rennison
14de8c7f34 VarAction2: Add quick exit case to last-level callback groups if possible 2022-08-22 00:13:23 +01:00
Jonathan G Rennison
9c18835bd0 Move ProcessDeterministicSpriteGroupRanges into newgrf.cpp 2022-08-14 21:48:24 +01:00
Jonathan G Rennison
4601a1bfc6 Move NewGRF optimiser functions into a separate file
Create a new header for shared definitions with newgrf.cpp
2022-08-10 19:06:59 +01:00
Jonathan G Rennison
3d59c961a6 VarAction2: Avoid group variable tracking coupling through shared procs
Output dependencies on a procedure shouldn't propagate into input
dependencies on unrelated call sites in different groups
2022-08-10 18:30:09 +01:00
Jonathan G Rennison
00e32162a1 VarAction2: Allow DSE to remove procedure calls 2022-08-10 00:04:32 +01:00
Jonathan G Rennison
30ecdfe140 VarAction2: Allow jumping over constant stores to special registers
Insert suitable store(s) after the end block
2022-08-09 22:53:50 +01:00
Jonathan G Rennison
3a8bd7a589 VarAction2: Allow jumps to skip over procedure calls if possible 2022-08-09 22:10:45 +01:00
Jonathan G Rennison
e143ab06d8 VarAction2: Track which temp stores may be overwritten by procedures
Instead of treating procedures as an unpredictable store
2022-08-09 18:37:00 +01:00
Jonathan G Rennison
06cc71b6c5 VarAction2: Mark suitable AND ops as jump insertion candidates 2022-08-09 18:34:01 +01:00
Jonathan G Rennison
0bddf96f7f VarAction2: Set variable for ABS op to avoid unused read from var 0 2022-08-01 18:27:21 +01:00
Jonathan G Rennison
7af568f0f0 VarAction2: Handle case where expensive vars are only conditionally read
Within a JZ_LV and in prior DSGAF_SKIP_ON_ZERO op
2022-07-31 00:16:40 +01:00
Jonathan G Rennison
9a4c31b0da VarAction2: Add last_value variants of JZ/JNZ ops 2022-07-30 23:32:23 +01:00
Jonathan G Rennison
cbc6199542 VarAction2: Add a JNZ op analogous to JZ for OR ops 2022-07-30 22:40:41 +01:00
Jonathan G Rennison
5ec802a3d4 VarAction2: Allow substituting perm store loads through temp store 2022-07-30 21:17:00 +01:00
Jonathan G Rennison
ed737e1a8f VarAction2: Do not remove redundant adjusts when this would break var 1C 2022-07-14 23:57:23 +01:00
Jonathan G Rennison
b9c22a0b9e VarAction2: Do not prune groups when this would break var 1C 2022-07-14 23:47:48 +01:00
Jonathan G Rennison
ae746a1af4 VarAction2: Fix tracking of whether a sprite group needs var 1C 2022-07-14 23:38:52 +01:00
Jonathan G Rennison
c19bd4473f Add signal style flag to require realistic braking 2022-06-30 21:20:43 +01:00
Jonathan G Rennison
78ae295dfe Add combined normal and shunt aspect signal style flag 2022-06-27 18:51:26 +01:00
Jonathan G Rennison
759b00262e VarAction2: Allow more than one JZ to end on the same end block adjust 2022-06-26 23:30:14 +01:00
Jonathan G Rennison
9775f468e8 VarAction2: Fix jump insertion moving the end marker for another jump 2022-06-26 22:53:07 +01:00
Jonathan G Rennison
89f66236ff VarAction2: Fix SHR/SAR mixup in check for merge with prior RST 2022-06-25 20:51:09 +01:00
Jonathan G Rennison
a311f12615 Add signals_style_lookahead_single_signal_only signal style property 2022-06-25 01:29:08 +01:00
Jonathan G Rennison
fcae909839 Add signal style flag for drawing on the opposite side 2022-06-22 23:45:44 +01:00
Jonathan G Rennison
229613b06a VarAction2: Resolve jumps in advance to avoid needing to track nesting 2022-06-22 02:09:13 +01:00
Jonathan G Rennison
387e646439 VarAction2: Add group flag for whether to run jump insert pass 2022-06-20 18:46:31 +01:00
Jonathan G Rennison
3714fad790 VarAction2: Fix jump insertion using mul with bool as last value 2022-06-20 18:41:09 +01:00
Jonathan G Rennison
4af3022c45 VarAction2: Fix last variable read annotations being incorrect
This is because DSE variable substitutions/etc were applied afterwards
This broke jump insertion
2022-06-20 18:23:52 +01:00
Jonathan G Rennison
191f710c40 Add custom signal style properties to set electric/semaphore enabled types 2022-06-19 17:43:46 +01:00
Jonathan G Rennison
175c5d4d50 Add signal style flag to limit lookahead extra aspect 2022-06-19 12:46:56 +01:00
Jonathan G Rennison
bdd73a19a1 Add signal style flag for unconditional reserve through
Add map bits for unconditional reserve through
Adjust signal aspect/state handling
2022-06-19 04:15:27 +01:00
Jonathan G Rennison
7ae06124ae Add signal style flag for no aspect increase behaviour (banner repeater) 2022-06-19 02:08:38 +01:00
Jonathan G Rennison
6e4c4b35e7 Initial implementation of NewGRF custom signal styles 2022-06-19 02:08:38 +01:00
Jonathan G Rennison
4acccc232a Fix #9925: Industry tile layout validation for layouts of only one tile 2022-06-18 22:02:08 +02:00
Jonathan G Rennison
098bb74ed2 Fix industry tile layout validation when the layout has only one tile
See: https://github.com/OpenTTD/OpenTTD/issues/9925
2022-06-18 11:08:13 +01:00
Jonathan G Rennison
13fcde9ea0 VarAction2: Add a JZ operation, use for ternary style mul masking 2022-06-14 02:23:23 +01:00
Jonathan G Rennison
8687b82dd8 VarAction2: Mark various object variables as expensive 2022-06-14 01:34:25 +01:00
Jonathan G Rennison
c0b1f867a3 VarAction2: Prefer tracking store content as clone of another store 2022-06-14 00:53:26 +01:00
Jonathan G Rennison
315f12f1e4 Fix spelling error in comment 2022-06-13 17:19:02 +01:00
Jonathan G Rennison
7bb0de247d Add GRF feature: New Landscape
Custom graphics using actions 1/2/3.

Currently only for rock tiles
2022-06-13 17:13:48 +01:00
Jonathan G Rennison
5a02a13885 VarAction2: Add abs() detection to bool/mul adjust combining 2022-06-11 14:33:02 +01:00
Jonathan G Rennison
e554d7fdfb VarAction2: Generalise bool/mul adjust combining 2022-06-11 14:28:32 +01:00
Jonathan G Rennison
3e56837ae6 Fix bec2bf7e: Fix (anti-)commutative store/load re-arrangements 2022-06-11 09:21:44 +01:00
Jonathan G Rennison
34cd547325 Debug: Show if action 2s have been modified by action 6 in debug window 2022-06-11 02:34:08 +01:00
Jonathan G Rennison
6214d0d20d VarAction2: Add an ABS opcode 2022-06-11 02:33:09 +01:00
Jonathan G Rennison
7f1b3a965f VarAction2: Allow tracking stores as (inverted) clones of previous store 2022-06-10 20:28:52 +01:00
Jonathan G Rennison
bec2bf7e85 VarAction2: Initial temp store versioning in 1st pass 2022-06-10 20:07:21 +01:00