From 4ba73dac9599a92f5c228a156e0f2d1e22f275ea Mon Sep 17 00:00:00 2001
From: Greg-21 <34160838+Greg-21@users.noreply.github.com>
Date: Tue, 6 Nov 2018 00:38:42 +0100
Subject: [PATCH 1/5] Doc: Changed several files to unificate them... (#6964)
...with those from release 1.8 branch.
---
os/debian/changelog | 13 ++++++++++++-
src/script/api/ai_changelog.hpp | 2 +-
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/os/debian/changelog b/os/debian/changelog
index ce2582128c..bb57ca39e8 100644
--- a/os/debian/changelog
+++ b/os/debian/changelog
@@ -1,3 +1,15 @@
+openttd (1.8.0-0) unstable; urgency=low
+
+ * New upstream release 1.8.0
+
+ -- OpenTTD This document describes non-standard additions to the Official OpenTTD NewGRF Specifications which are present in this branch.
+ This additions MAY also be present in other branches/repositories/etc. They MAY be removed or moved in future, if necessary. NewGRFs which use any of these features SHOULD use the feature testing mechanism described below to check whether individual added features are supported. See Action 14 Specification for background information. Each FTST chunk (type C) describes an individual feature test. Feature tests can be safely used on implementations which do not implement the described feature test mechanism because unknown Action 14 blocks are ignored,
+ and the observable result (in global variable 0x9D) is equivalent to the case where all feature tests have failed, indicating that the feature is not present. Within an FTST chunk, the NAME text (type T) field contains the name of the feature to test for. The value of the language ID byte is ignored. The feature testing mechanism itself has the feature name: feature_test, this document describes version 1. Within an FTST chunk, the MINV binary (type B) field contains the minimum (inclusive) (≥) version to accept. This is a Word (2 bytes). Within an FTST chunk, the MINV binary (type B) field contains the maximum (inclusive) (≤) version to accept. This is a Word (2 bytes). Within an FTST chunk, the SETP binary (type B) field contains the bit number to set/clear in
+ global variable 0x9D (TTD Platform) to store the result of the test. This is 1 byte.Additions to NewGRF Specifications in thi branch
+ Action 14 - Feature Tests
+ Feature Test: C "FTST"
+
+ Sub-chunks within each FTST chunk may appear in any order, however each sub-chunk SHOULD only appear ONCE within an individual FTST chunk.Feature Name: C "FTST" -> T "NAME"
+
+ If the named feature is not present, or if this field is omitted, the version is 0.
+ If the named feature is present, the version number will be at least 1.Feature Minimum Version: C "FTST" -> B "MINV"
+
+ The default value is 1.Feature Maximum Version: C "FTST" -> B "MAXV"
+
+ The default value is 0xFFFF (no maximum).Feature Set Global Variable 0x9D Bit: C "FTST" -> B "SETP"
+
+ If the test is successful, the bit is set (to 1), otherwise the bit is cleared (to 0).
+ The bit number MUST be in the range: 4 ≤ bit number ≤ 31. These bits can be assumed to be 0 on implementations which do not support this feature test mechanism.
+ Global variable 0x9D can then be tested by using a standard Action 7 or 9, or a standard Variational Action 2.
+ If this field is omitted, no bit is set or cleared, and the test is not observable.
+
+ Example:
+
+// Set bit 4 of global variable 0x9D if sample_feature_1 is present with a version of at least 4
+// Set bit 5 of global variable 0x9D if sample_feature_2 is present with a version of at least 5 and at most 6
+-1 * -1 14
+ "C" "FTST"
+ "T" "NAME" 00 "sample_feature_1" 00
+ "B" "MINV" \w2 \w4
+ "B" "SETP" \w1 04
+ 00
+ "C" "FTST"
+ "T" "NAME" 00 "sample_feature_2" 00
+ "B" "MINV" \w2 \w5
+ "B" "MAXV" \w2 \w6
+ "B" "SETP" \w1 05
+ 00
+ 00
+....
+// Skip 1 sprite if bit 4 of global variable 0x9D is not set (indicating that sample_feature_1 with a version of at least 4 is NOT present)
+-1 * -1 07 9D 01 \70 04 01
+
+
+
From 9a6a66a054b98e1d3024921c169187cdc18cdb8f Mon Sep 17 00:00:00 2001
From: Jonathan G Rennison
// Set bit 4 of global variable 0x9D if sample_feature_1 is present with a version of at least 4 // Set bit 5 of global variable 0x9D if sample_feature_2 is present with a version of at least 5 and at most 6 @@ -69,5 +71,73 @@ // Skip 1 sprite if bit 4 of global variable 0x9D is not set (indicating that sample_feature_1 with a version of at least 4 is NOT present) -1 * -1 07 9D 01 \70 04 01+
See Action 14 Specification and Action 0 Specification for background information.
+The property mapping mechanism has the feature name: property_mapping, this document describes version 1.
+Users of this mechanism SHOULD at minimum use test for the presence of the feature above or test variable 8D, below.
+Each A0PM chunk (type C) describes an individual property mapping.
+ Sub-chunks within each A0PM chunk may appear in any order, however except where otherwise noted each sub-chunk SHOULD only appear ONCE within an individual A0PM chunk.
Property mapping can be safely used on implementations which do not implement the property mapping mechanism if Action 0 sprites which use mapped property IDs are skipped if one or more of: +
Within an A0PM chunk, the NAME text (type T) field contains the name of the property to map. The value of the language ID byte is ignored.
+Within an A0PM chunk, the FEAT binary (type B) field contains the Action 0 feature ID. This is 1 byte.
+Within an A0PM chunk, the PROP binary (type B) field contains the property ID to allocate to the named property, this value can used in Action 0 sprites. This is 1 byte.
+ It is possible to override existing properties, however this use is not recommended.
Within an A0PM chunk, the SETT binary (type B) field contains the bit number to set/clear in
+ global variable 0x8D (TTD version) to store whether the mapping operation was successful. This is 1 byte.
+ If the operation is successful, the bit is set (to 1), otherwise the bit is cleared (to 0).
+ The bit number MUST be in the range: 4 ≤ bit number ≤ 31. These bits can be assumed to be 0 on implementations which do not support this property mapping mechanism.
+ Global variable 0x8D can then be tested by using a standard Action 7 or 9, or a standard Variational Action 2.
+ If this field is omitted, no bit is set or cleared.
+
Within an A0PM chunk, the FLBK binary (type B) field contains the fallback mode. This is 1 byte.
+ The fallback mode may take the following values:
+
Value | Behaviour |
---|---|
0 | Attempts to map an unknown property name are ignored. Use of the mapped property in an Action 0 is ignored. This is the default. |
1 | Attempts to map an unknown property name are ignored. Use of the mapped property in an Action 0 is an error. |
2 | Attempting to map an unknown property name is an error. |
Size | Name | Meaning |
---|---|---|
B* | num | Size of the data in bytes |
V | data | Property data |
+// Map station property "sample_station_property" to property id 0xF8, and set bit 4 of global variable 0x8D if successful +-1 * -1 14 + "C" "A0PM" + "T" "NAME" 00 "sample_station_property" 00 + "B" "FEAT" \w1 04 + "B" "PROP" \w1 F8 + "B" "SETT" \w1 4 + 00 + 00 +.... +// Skip 1 sprite if bit 4 of global variable 0x8D is not set (indicating that station property sample_station_property is NOT present) +-1 * -1 07 8D 01 \70 04 01 +// Set sample_station_property for station ID 10 to 2 byte value: AB CD +-1 * -1 00 04 01 01 10 F8 02 AB CD +