summaryrefslogtreecommitdiffstatshomepage
path: root/docs/source/techspecs/layout_files.rst
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2019-03-26 11:13:37 +1100
committer Vas Crabb <vas@vastheman.com>2019-03-26 11:13:37 +1100
commit97b67170277437131adf6ed4d60139c172529e4f (patch)
tree7a5cbf608f191075f1612b1af15832c206a3fe2d /docs/source/techspecs/layout_files.rst
parentb380514764cf857469bae61c11143a19f79a74c5 (diff)
(nw) Clean up the mess on master
This effectively reverts b380514764cf857469bae61c11143a19f79a74c5 and c24473ddff715ecec2e258a6eb38960cf8c8e98e, restoring the state at 598cd5227223c3b04ca31f0dbc1981256d9ea3ff. Before pushing, please check that what you're about to push is sane. Check your local commit log and ensure there isn't anything out-of-place before pushing to mainline. When things like this happen, it wastes everyone's time. I really don't need this in a week when real work™ is busting my balls and I'm behind where I want to be with preparing for MAME release.
Diffstat (limited to 'docs/source/techspecs/layout_files.rst')
-rw-r--r--docs/source/techspecs/layout_files.rst24
1 files changed, 13 insertions, 11 deletions
diff --git a/docs/source/techspecs/layout_files.rst b/docs/source/techspecs/layout_files.rst
index de9bdff916c..10467a8d0e9 100644
--- a/docs/source/techspecs/layout_files.rst
+++ b/docs/source/techspecs/layout_files.rst
@@ -32,7 +32,7 @@ There are two kinds of numbers in MAME layouts: integers and floating-point
numbers.
Integers may be supplied in decimal or hexadecimal notation. A decimal integer
-consists of and optional # (hash) prefix, an optional +/- (plus or minus) sign
+consists of an optional # (hash) prefix, an optional +/- (plus or minus) sign
character, and a sequence of digits 0-9. A hexadecimal number consists of one
of the prefixes $ (dollar sign) or 0x (zero ex) followed by a sequence of
hexadecimal digits 0-9 and A-F. Hexadecimal numbers are case-insensitive for
@@ -768,12 +768,14 @@ how digital displays may be connected to emulated outputs::
If an element instantiating a layout element has ``inputtag`` and ``inputmask``
attributes but lacks a ``name`` attribute, it will take its state from the value
-of the corresponding I/O port, masked with the ``inputmask`` value, and shifted
-to the right so that the least significant one bit of the mask aligns with the
-least significant bit of the value (for example a mask of 0x05 will result in no
-shift, while a mask of 0xb0 will result in the value being shifted four bits to
-the right). This is often used to allow clickable buttons and toggle switches
-to provide visible feedback.
+of the corresponding I/O port, masked with the ``inputmask`` value and XORed
+with the I/O port default field value. The latter is useful for inputs that are
+active-low. If the result is non-zero, the state is 1, otherwise it's 0. This
+is often used to allow clickable buttons and toggle switches to provide visible
+feedback. By using ``inputraw="1"``, it's possible to obtain the raw data from
+the I/O port, masked with the ``inputmask`` value and shifted to the right to
+remove trailing zeroes (for example a mask of 0x05 will result in no shift, while
+a mask of 0xb0 will result in the value being shifted four bits to the right).
When handling mouse input, MAME treats all layout elements as being rectangular,
and only activates the frontmost element whose area includes the location of the
@@ -1090,9 +1092,9 @@ when parameters are used, or recursively nested groups. The ``complay.py``
script is compatible with both Python 2.7 and Python 3 interpreters.
The ``complay.py`` script takes three parameters -- an input file name, an
-output file name, and a base name for variables in the output::
+output file name, and a base name for variables in the output:
- python scripts/build/complay.py input [output [varname]]
+ **python scripts/build/complay.py** *<input>* [*<output>* [*<varname>*]]
The input file name is required. If no output file name is supplied,
``complay.py`` will parse and check the input, reporting any errors found,
@@ -1104,6 +1106,6 @@ in case of an I/O error. If an output file name is specified, the file will be
created/overwritten on success or removed on failure.
To check a layout file for common errors, run the script with the path to the
-file no check and no output file name or base variable name. For example::
+file no check and no output file name or base variable name. For example:
- python scripts/build/complay.py artwork/dino/default.lay
+ **python scripts/build/complay.py artwork/dino/default.lay**