From 0ce07a8a1e5e5787917435037c326c7bd67adbc7 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Tue, 31 Jul 2018 04:18:28 +1000 Subject: (nw) more render work: * Clean up some corner cases in layouts with repeating blocks * Make complay.py validate many more elements and attributes * Make complay.py easier to use for just validating a layout * Remove redundant view from Sega VMU layout * Make buttons visually respond to input in whousetc.lay * Add view with LED displays as well as terminal for aim65_40 and use repeats * Clean up some outdated "game" terminology in clifront.cpp * Initiaise a couple of members in tap/tun network module * Start documenting layout format --- docs/source/techspecs/index.rst | 1 + docs/source/techspecs/layout_files.rst | 615 +++++++++++++++++++++++++++++++++ scripts/build/complay.py | 112 ++++-- src/emu/rendlay.cpp | 80 +++-- src/frontend/mame/clifront.cpp | 22 +- src/mame/drivers/micro20.cpp | 4 +- src/mame/layout/aim65_40.lay | 147 ++------ src/mame/layout/rocknms.lay | 4 +- src/mame/layout/stepstag.lay | 6 +- src/mame/layout/svmu.lay | 5 - src/mame/layout/whousetc.lay | 266 +++++++++++--- src/osd/modules/netdev/taptun.cpp | 7 +- 12 files changed, 1008 insertions(+), 261 deletions(-) create mode 100644 docs/source/techspecs/layout_files.rst diff --git a/docs/source/techspecs/index.rst b/docs/source/techspecs/index.rst index 6ed4435772a..67775ae3a74 100644 --- a/docs/source/techspecs/index.rst +++ b/docs/source/techspecs/index.rst @@ -6,6 +6,7 @@ This section covers technical specifications useful to programmers working on MA .. toctree:: :titlesonly: + layout_files device_memory_interface device_rom_interface device_disasm_interface diff --git a/docs/source/techspecs/layout_files.rst b/docs/source/techspecs/layout_files.rst new file mode 100644 index 00000000000..91796700342 --- /dev/null +++ b/docs/source/techspecs/layout_files.rst @@ -0,0 +1,615 @@ +MAME Layout Files +================= + +.. contents:: :local: + + +.. _layout-intro: + +Introduction +------------ + +Layout files are used to tell MAME what to display when running an emulated +system, and how to arrange it. MAME can render emulated screens, images, text, +shapes, and specialised objects for common output devices. Elements can be +static, or dynamically update to reflect the state of inputs and outputs. +Layouts may be automatically generated based on the number/type of emulated +screens, built and linked into the MAME binary, or provided externally. MAME +layout files are an XML application, using the ``.lay`` filename extension. + + +.. _layout-concepts: + +Core concepts +------------- + +.. _layout-concepts-numbers: + +Numbers +~~~~~~~ + +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 +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 +both the prefix and digits. + +Floating-point numbers may be supplied in decimal fixed-point or scientific +notation. Note that integer prefixes and hexadecimal values are *not* +accepted where a floating-point number is expected. + +For a few attributes, both integers and floating-point numbers are allowed. In +these cases, the presence of a # (hash), $ (dollar sign) or 0x (zero ex) prefix +causes the value to be interpreted as an integer. If no recognised integer +prefix is found and the value contains a decimal point or the letter E +(uppercase or lowercase) introducing an exponent, it is interpreted as a +floating-point number. If no integer prefix, decimal point or letter E is +found, the number will be interpreted as an integer. + +Numbers are parsed using the "C" locale for portability. + + +.. _layout-concepts-coordinates: + +Coordinates +~~~~~~~~~~~ + +Layout coordinates are internally represented as IEEE754 32-bit binary +floating-point numbers (also known as "single precision"). Coordinates increase +in the rightward and downward directions. The origin (0,0) has no particular +significance, and you may freely use negative coordinates in layouts. +Coordinates are supplied as floating-point numbers. + +MAME assumes that view coordinates have the same aspect ratio as pixel on the +output device (host screen or window). Assuming square pixels and no rotation, +this means equal distances in X and Y axes correspond to equal horizontal and +vertical distances in the rendered output. + +Views, groups and elements all have their own internal coordinate systems. When +an element or group is referenced from a view or another group, its coordinates +are scaled as necessary to fit the specified bounds. + +Objects are positioned and sized using ``bounds`` elements. A bounds element +may specify the position of the top left corner and the size using ``x``, ``y``, +``width`` and ``height`` attributes, or it may specify the coordinates of the +edges with the ``left``, ``top``, ``right`` and ``bottom`` attributes. These +two ``bounds`` elements are equivalent:: + + + + +Either the ``x`` or ``left`` attribute must be present to distinguish between +the two schemes. The ``width`` and ``height`` or ``right`` and ``bottom`` +default to 1.0 if not supplied. It is an error if ``width`` or ``height`` are +negative, if ``right`` is less than ``left``, or if ``bottom`` is less than +``top``. + + +.. _layout-concepts-colours: + +Colours +~~~~~~~ + +Colours are specified in RGBA space. MAME is not aware of colour profiles and +gamuts, so colours will typically be interpreted as sRGB with your system's +target gamma (usually 2.2). Channel values are specified as floating-point +numbers. Red, green and blue channel values range from 0.0 (off) to 1.0 (full +intensity). Alpha ranges from 0.0 (fully transparent) to 1.0 (opaque). + +Component and view item colour is specified using ``color`` elements. +Meaningful attributes are ``red``, ``green``, ``blue`` and ``alpha``. This +example ``color`` element specifies all channel values:: + + + +Any omitted channel attributes default to 1.0 (full intensity or opaque). It +is an error if any channel value falls outside the range of 0.0 to 1.0 +(inclusive). + + +.. _layout-concepts-params: + +Parameters +~~~~~~~~~~ + +Parameters are named variables that can be used in most attributes. To use +a parameter in an attribute, surround its name with tilde (~) characters. If a +parameter is not defined, no substitution occurs. Here is an examples showing +two instances of parameter use -- the values of the ``digitno`` and ``x`` +parameters will be substituted for ``~digitno~`` and ``~x~``:: + + + + + +A parameter name is a sequence of uppercase English letters A-Z, lowercase +English letters a-z, decimal digits 0-9, and/or underscore (_) characters. +Parameter names are case-sensitive. When looking for a parameter, the layout +engine starts at the current, innermost scope and works outwards. The outermost +scope level corresponds to the top-level ``mamelayout`` element. Each +``repeat``, ``group`` or ``view`` element creates a new, nested scope level. + +Internally a parameter can hold a string, integer, or floating-point number, but +this is mostly transparent. Integers are stored as 64-bit signed +twos-complement values, and floating-point numbers are stored as IEEE754 64-bit +binary floating-point numbers (also known as "double precision"). Integers are +substituted in decimal notation, and floating point numbers are substituted in +default format, which may be decimal fixed-point or scientific notation +depending on the value). There is no way to override the default formatting of +integer and floating-point number parameters. + +There are two kinds of parameters: *value parameters* and *generator +parameters*. Value parameters keep their assigned value until reassigned. +Generator parameters have a starting value and an increment and/or shift to be +applied for each iteration. + +Value parameters are assigned using a ``param`` element with ``name`` and +``value`` attributes. Value parameters may appear inside the top-level +``mamelayout`` element, inside ``repeat``, and ``view`` elements, and inside +``group`` definition elements (that is, ``group`` elements in the top-level +``mamelayout`` element, as opposed to ``group`` reference elements inside +``view`` elements other ``group`` definition elements). A value parameter may +be reassigned at any point. + +Here's an example assigning the value "4" to the value parameter "firstdigit":: + + + +Generator parameters are assigned using a ``param`` element with ``name`` and +``start`` attributes, and ``increment``, ``lshift`` and/or ``rshift`` +attributes. Generator parameters may only appear inside ``repeat`` elements. +A generator parameter must not be reassigned in the same scope (an identically +named parameter may be defined in a child scope). Here are some example +generator parameters:: + + + + + +* The ``nybble`` parameter generates values 3, 2, 1... +* The ``switchpos`` parameter generates values 74, 230, 386... +* The ``mask`` parameter generates values 2048, 1024, 512... + +The ``increment`` attribute must be an integer or floating-point number to be +added to the parameter's value. The ``lshift`` and ``rshift`` attributes must +be non-negative integers specifying numbers of bits to shift the parameter's +value to the left or right. The increment and shift are applied at the end of +the repeating block before the next iteration starts. If both an increment and +shift are supplied, the increment is applied before the shift. + +If the ``increment`` attribute is present and is a floating-point number, the +parameter's value will be interpreted as an integer or floating-point number and +converted to a floating-point number before the increment is added. If the +``increment`` attribute is present and is an integer, the parameter's value will +be interpreted as an integer or floating number before the increment is added. +The increment will be converted to a floating-point number before the addition +if the parameter's value is a floating-point number. + +If the ``lshift`` and/or ``rshift`` attributes are present and not equal, the +parameter's value will be interpreted as an integer or floating-point number, +converted to an integer as necessary, and shifted accordingly. Shifting to the +left is defined as shifting towards the most significant bit. If both +``lshift`` and ``rshift`` are supplied, they are netted off before being +applied. This means you cannot, for example, use equal ``lshift`` and +``rshift`` attributes to clear bits at one end of a parameter's value after the +first iteration. + +It is an error if a ``param`` element has neither ``value`` nor ``start`` +attributes, and it is an error if a ``param`` element has both a ``value`` +attribute and any of the ``start``, ``increment``, ``lshift``, or ``rshift`` +attributes. + +A ``param`` element defines a parameter or reassigns its value in the current, +innermost scope. It is not possible to define or reassign parameters in a +containing scope. + + +.. _layout-concepts-predef-params: + +Pre-defined parameters +~~~~~~~~~~~~~~~~~~~~~~ + +A number of pre-defined value parameters are available providing information +about the running machine: + +devicetag + The full tag path of the device that caused the layout to be loaded, for + example ``:`` for the root driver device, or ``:tty:ie15`` for a terminal + connected to a port. This parameter is a string defined at layout (global) + scope. +devicebasetag + The base tag of the device that caused the layout to be loaded, for example + ``root`` for the root driver device, or ``ie15`` for a terminal connected to + a port. This parameter is a string defined at layout (global) scope. +devicename + The full name (description) of the device that caused the layout to be + loaded, for example ``AIM-65/40`` or ``IE15 Terminal``. This parameter is a + string defined at layout (global) scope. +deviceshortname + The short name of the device that caused the layout to be loaded, for + example ``aim65_40`` or ``ie15_terminal``. This parameter is a string + defined at layout (global) scope. +scr0physicalxaspect + The horizontal part of the physical aspect ratio of the first screen (if + present). The physical aspect ratio is provided as a reduced improper + fraction. Note that this is the horizontal component *before* rotation is + applied. This parameter is an integer defined at layout (global) scope. +scr0physicalyaspect + The vertical part of the physical aspect ratio of the first screen (if + present). The physical aspect ratio is provided as a reduced improper + fraction. Note that this is the vertical component *before* rotation is + applied. This parameter is an integer defined at layout (global) scope. +scr0nativexaspect + The horizontal part of the pixel aspect ratio of the first screen's visible + area (if present). The pixel aspect ratio is provided as a reduced improper + fraction. Note that this is the horizontal component *before* rotation is + applied. This parameter is an integer defined at layout (global) scope. +scr0nativeyaspect + The vertical part of the pixel aspect ratio of the first screen's visible + area (if present). The pixel aspect ratio is provided as a reduced improper + fraction. Note that this is the vertical component *before* rotation is + applied. This parameter is an integer defined at layout (global) scope. +scr0width + The width of the first screen's visible area (if present) in emulated + pixels. Note that this is the width *before* rotation is applied. This + parameter is an integer defined at layout (global) scope. +scr0height + The height of the first screen's visible area (if present) in emulated + pixels. Note that this is the height *before* rotation is applied. This + parameter is an integer defined at layout (global) scope. +scr1physicalxaspect + The horizontal part of the physical aspect ratio of the second screen (if + present). This parameter is an integer defined at layout (global) scope. +scr1physicalyaspect + The vertical part of the physical aspect ratio of the second screen (if + present). This parameter is an integer defined at layout (global) scope. +scr1nativexaspect + The horizontal part of the pixel aspect ratio of the second screen's visible + area (if present). This parameter is an integer defined at layout (global) + scope. +scr1nativeyaspect + The vertical part of the pixel aspect ratio of the second screen's visible + area (if present). This parameter is an integer defined at layout (global) + scope. +scr1width + The width of the second screen's visible area (if present) in emulated + pixels. This parameter is an integer defined at layout (global) scope. +scr1height + The height of the second screen's visible area (if present) in emulated + pixels. This parameter is an integer defined at layout (global) scope. +scr\ *N*\ physicalxaspect + The horizontal part of the physical aspect ratio of the (zero-based) *N*\ th + screen (if present). This parameter is an integer defined at layout + (global) scope. +scr\ *N*\ physicalyaspect + The vertical part of the physical aspect ratio of the (zero-based) *N*\ th + screen (if present). This parameter is an integer defined at layout + (global) scope. +scr\ *N*\ nativexaspect + The horizontal part of the pixel aspect ratio of the (zero-based) *N*\ th + screen's visible area (if present). This parameter is an integer defined at + layout (global) scope. +scr\ *N*\ nativeyaspect + The vertical part of the pixel aspect ratio of the (zero-based) *N*\ th + screen's visible area (if present). This parameter is an integer defined at + layout (global) scope. +scr\ *N*\ width + The width of the (zero-based) *N*\ th screen's visible area (if present) in + emulated pixels. This parameter is an integer defined at layout (global) + scope. +scr\ *N*\ height + The height of the (zero-based) *N*\ th screen's visible area (if present) in + emulated pixels. This parameter is an integer defined at layout (global) + scope. +viewname + The name of the current view. This parameter is a string defined at view + scope. It is not defined outside a view. + +For screen-related parameters, screens are numbered from zero in the order they +appear in machine configuration, and all screens are included (not just +subdevices of the device that caused the layout to be loaded). X/width and +Y/height refer to the horizontal and vertical dimensions of the screen *before* +rotation is applied. Values based on the visible area are calculated at the +end of configuration. Values are not updated and layouts are not recomputed if +the system reconfigures the screen while running. + + +.. _layout-parts: + +Parts of a layout +----------------- + +A *view* specifies an arrangement graphical object to display. A MAME layout +file can contain multiple views. Views are built up from *elements* and +*screens*. To simplify complex layouts, reusable groups and repeating blocks +are supported. + +The top-level element of a MAME layout file must be a ``mamelayout`` element +with a ``version`` attribute. The ``version`` attribute must be an integer. +Currently MAME only supports version 2, and will not load any other version. +This is an example opening tag for a top-level ``mamelayout`` element:: + + + +In general, children of the top-level ``mamelayout`` element are processed in +reading order from top to bottom. The exception is that, for historical +reasons, views are processed last. This means views see the final values of all +parameters at the end of the ``mamelayout`` element, and may refer to elements +and groups that appear after them. + +The following elements are allowed inside the top-level ``mamelayout`` element: + +param + Defines or reassigns a value parameter. See :ref:`layout-concepts-params` + for details. +element + Defines an element -- one of the basic objects that can be arranged in a + view. See :ref:`layout-parts-elements` for details. +group + Defines a reusable group of elements/screens that may be referenced from + views or other groups. See :ref:`layout-parts-groups` for details. +repeat + A repeating group of elements -- may contain ``param``, ``element``, + ``group``, and ``repeat`` elements. See :ref:`layout-parts-repeats` for + details. +view + An arrangement of elements and/or screens that can be displayed on an output + device (a host screen/window). See :ref:`layout-parts-views` for details. +script + Allows lua script to be supplied for enhanced interactive layouts. + + +.. _layout-parts-elements: + +Elements +-------- + +Elements are one of the basic visual objects that may be arranged, along with +screens, to make up a view. Elements may be built up one or more *components*, +but an element is treated as as single surface when building the scene graph +and rendering. An element may be used in multiple views, and may be used +multiple times within a view. + +An element's appearance depends on its *state*. The state is an integer which +usually comes from an I/O port field or an emulated output (see the discussion +of :ref:`layout-parts-views` for information on connecting an element to an I/O +port or output). Any component of an element may be restricted to only drawing +when the element's state is a particular value. Some components (e.g. +multi-segment displays and reels) use the state directly to determine their +appearance. + +Each element has its own internal coordinate system. The bounds of the +element's coordinate system are computed as the union of the bounds of the +individual components it's composed of. + +Every element must have a ``name`` attribute specifying its name. Elements are +referred to by name when instantiated in groups or views. Elements may +optionally supply a default state value with a ``defstate`` attribute, to be +used if not connected to an emulated output or I/O port. If present, the +``defstate`` attribute must be a non-negative integer. + +Child elements of the ``element`` element instantiate components, which are +drawn in reading order from first to last (components draw on top of components +that come before them). All components support a few common features: + +* Each component may have a ``state`` attribute. If present, the component will + only be drawn when the element's state matches its value (if absent, the + component will always be drawn). If present, the ``state`` attribute must be + a non-negative integer. +* Each component may have a ``bounds`` child element specifying its position and + size (see :ref:`layout-concepts-coordinates`). If no such element is present, + the bounds default to a unit square (width and height of 1.0) with the top + left corner at (0,0). +* Each component may have a ``color`` child element specifying an RGBA colour + (see :ref:`layout-concepts-colours` for details). This can be used to control + the colour of geometric, algorithmically drawn, or textual components. It is + ignored for ``image`` components. If no such element is present, the colour + defaults to opaque white. + +The following components are supported: + +rect + Draws a uniform colour rectangle filling its bounds. +disk + Draws a uniform colour ellipse fitted to its bounds. +image + Draws an image loaded from a PNG or JPEG file. The name of the file to load + (including the file name extension) is supplied with the required ``file`` + attribute. Additionally, an optional ``alphafile`` attribute may be used to + specify the name of a PNG file (including the file name extension) to load + into the alpha channel of the image. The image file(s) should be placed in + the same directory/archive as the layout file. If the ``alphafile`` + attribute refers refers to a file, it must have the same dimensions as the + file referred to by the ``file`` attribute, and must have a bit depth no + greater than eight bits per channel per pixel. The intensity from this + image (brightness) is copied to the alpha channel, with full intensity (white + in a greyscale image) corresponding to fully opaque, and black corresponding + to fully transparent. +text + Draws text in using the UI font in the specified colour. The text to draw + must be supplied using a ``string`` attribute. An ``align`` attribute may + be supplied to set text alignment. If present, the ``align`` attribute must + be an integer, where 0 (zero) means centred, 1 (one) means left-aligned, and + 2 (two) means right-aligned. If the ``align`` attribute is absent, the text + will be centred. +dotmatrix + Draws an eight-pixel horizontal segment of a dot matrix display, using + circular pixels in the specified colour. The bits of the element's state + determine which pixels are lit, with the least significant bit corresponding + to the leftmost pixel. Unlit pixels are drawn at low intensity (0x20/0xff). +dotmatrix5dot + Draws a five-pixel horizontal segment of a dot matrix display, using + circular pixels in the specified colour. The bits of the element's state + determine which pixels are lit, with the least significant bit corresponding + to the leftmost pixel. Unlit pixels are drawn at low intensity (0x20/0xff). +dotmatrixdot + Draws a single element of a dot matrix display as a circular pixels in the + specified colour. The least significant bit of the element's state + determines whether the pixel is lit. An unlit pixel is drawn at low + intensity (0x20/0xff). +led7seg + Draws a standard seven-segment (plus decimal point) digital LED/fluorescent + display in the specified colour. The low eight bits of the element's state + control which segments are lit. Starting from the least significant bit, + the bits correspond to the top segment, the upper right-hand segment, + continuing clockwise to the upper left segment, the middle bar, and the + decimal point. Unlit segments are drawn at low intensity (0x20/0xff). +led8seg_gts1 + Draws an eight-segment digital fluorescent display of the type used in + Gottlieb System 1 pinball machines (actually a Futaba part). Compared to + standard seven-segment displays, these displays have no decimal point, the + horizontal middle bar is broken in the centre, and there is a broken + vertical middle bar controlled by the bit that would control the decimal + point in a standard seven-segment display. Unlit segments are drawn at low + intensity (0x20/0xff). +led14seg + Draws a standard fourteen-segment alphanumeric LED/fluorescent display in + the specified colour. The low fourteen bits of the element's state control + which segments are lit. Starting from the least significant bit, the bits + correspond to the top segment, the upper right-hand segment, continuing + clockwise to the upper left segment, the left-hand and right-hand halves of + the horizontal middle bar, the upper and lower halves of the vertical middle + bar, and the diagonal bars clockwise from lower left to lower right. Unlit + segments are drawn at low intensity (0x20/0xff). +led14segsc + Draws a standard fourteen-segment alphanumeric LED/fluorescent display with + decimal point/comma in the specified colour. The low sixteen bits of the + element's state control which segments are lit. The low fourteen bits + correspond to the same segments as in the ``led14seg`` component. Two + additional bits correspond to the decimal point and comma tail. Unlit + segments are drawn at low intensity (0x20/0xff). +led16seg + Draws a standard sixteen-segment alphanumeric LED/fluorescent display in the + specified colour. The low sixteen bits of the element's state control which + segments are lit. Starting from the least significant bit, the bits + correspond to the left-hand half of the top bar, the right-hand half of the + top bar, continuing clockwise to the upper left segment, the left-hand and + right-hand halves of the horizontal middle bar, the upper and lower halves + of the vertical middle bar, and the diagonal bars clockwise from lower left + to lower right. Unlit segments are drawn at low intensity (0x20/0xff). +led16segsc + Draws a standard sixteen-segment alphanumeric LED/fluorescent display with + decimal point/comma in the specified colour. The low eighteen bits of the + element's state control which segments are lit. The low sixteen bits + correspond to the same segments as in the ``led16seg`` component. Two + additional bits correspond to the decimal point and comma tail. Unlit + segments are drawn at low intensity (0x20/0xff). +simplecounter + Displays the numeric value of the element's state using the system font in + the specified colour. The value is formatted in decimal notation. A + ``digits`` attribute may be supplied to specify the minimum number of digits + to display. If present, the ``digits`` attribute must be a positive + integer; if absent, a minimum of two digits will be displayed. A + ``maxstate`` attribute may be supplied to specify the maximum state value to + display. If present, the ``maxstate`` attribute must be a non-negative + number; if absent it defaults to 999. An ``align`` attribute may be supplied + to set text alignment. If present, the ``align`` attribute must be an + integer, where 0 (zero) means centred, 1 (one) means left-aligned, and 2 + (two) means right-aligned; if absent, the text will be centred. +reel + Used for drawing slot machine reels. Supported attributes include + ``symbollist``, ``stateoffset``, ``numsymbolsvisible``, ``reelreversed``, + and ``beltreel``. + +An example element that draws a static left-aligned text string:: + + + + + + +An example element that displays a circular LED where the intensity depends on +the state of an active-high output:: + + + + + + +An example element for a button that gives visual feedback when clicked:: + + + + + + + + + + + + +.. _layout-autogen: + +Automatically-generated views +----------------------------- + +After loading internal (developer-supplied) and external (user-supplied) +layouts, MAME automatically generates views based on the machine configuration. +The following views will be automatically generated: + +* If the system has no screens and no viable views were found in the internal + and external layouts, MAME will load a view that shows the message "No screens + attached to the system". +* For each emulated screen, MAME will generate a view showing the screen at its + physical aspect ratio with rotation applied. +* For each emulated screen where the configured pixel aspect ratio doesn't match + the physical aspect ratio, MAME will generate a view showing the screen at an + aspect ratio that produces square pixels, with rotation applied. +* If the system has a single emulated screen, MAME will generate a view showing + two copies of the screen image above each other with a small gap between them. + The upper copy will be rotated by 180 degrees. This view can be used in a + "cocktail table" cabinet for simultaneous two-player games, or alternating + play games that don't automatically rotate the display for the second player. + The screen will be displayed at its physical aspect ratio, with rotation + applied. +* If the system has exactly two emulated screens and no view in the internal or + external layouts shows all screens, or if the system has more than two + emulated screens, MAME will generate views with the screens arranged + horizontally from left to right and vertically from top to bottom, both with + and without small gaps between them. The screens will be displayed at + physical aspect ratio, with rotation applied. +* If the system has three or more emulated screens, MAME will generate views + tiling the screens in grid patterns, in both row-major (left-to-right then + top-to-bottom) and column-major (top-to-bottom then left-to-right) order. + Views are generated with and without gaps between the screens. The screens + will be displayed at physical aspect ratio, with rotation applied. + + +.. _layout-complay: + +Using complay.py +---------------- + +The MAME source contains a Python script called ``complay.py``, found in the +``scripts/build`` subdirectory. This script is used as part of MAME's build +process to reduce the size of data for internal layouts and convert it to a form +that can be built into the executable. However, it can also detect many common +layout file format errors, and generally provides better error messages than +MAME does when loading a layout file. Note that it doesn't actually run the +whole layout engine, so it can't detect errors like undefined element references +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:: + + 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, +without producing output. If no base variable name is provided, ``complay.py`` +will generate one based on the input file name. This is not guaranteed to +produce valid identifiers. The exit status is 0 (zero) on success, 1 on an +error in the command invocation, 2 if error are found in the input file, or 3 +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:: + + python scripts/build/complay.py artwork/dino/default.lay diff --git a/scripts/build/complay.py b/scripts/build/complay.py index f6e7db4320e..c6cea3be251 100644 --- a/scripts/build/complay.py +++ b/scripts/build/complay.py @@ -4,6 +4,7 @@ ## copyright-holders:Vas Crabb import os +import os.path import re import sys import xml.sax @@ -95,7 +96,7 @@ class LayoutChecker(Minifyer): BADTAGPATTERN = re.compile('[^abcdefghijklmnopqrstuvwxyz0123456789_.:^$]') VARPATTERN = re.compile('^.*~[0-9A-Za-z_]+~.*$') FLOATCHARS = re.compile('^.*[.eE].*$') - SHAPES = frozenset(('disk', 'led14seg', 'led14segsc', 'led16seg', 'led16segsc', 'led7seg', 'led8seg_gts1', 'rect')) + SHAPES = frozenset(('disk', 'dotmatrix', 'dotmatrix5dot', 'dotmatrixdot', 'led14seg', 'led14segsc', 'led16seg', 'led16segsc', 'led7seg', 'led8seg_gts1', 'rect')) OBJECTS = frozenset(('backdrop', 'bezel', 'cpanel', 'marquee', 'overlay')) def __init__(self, output, **kwargs): @@ -182,10 +183,10 @@ class LayoutChecker(Minifyer): self.checkNumericAttribute('param', attrs, 'increment', None) lshift = self.checkIntAttribute('param', attrs, 'lshift', None) if (lshift is not None) and (0 > lshift): - self.handleError('Element param attribute lshift "%s" is negative', (attrs['lshift'], )) + self.handleError('Element param attribute lshift "%s" is negative' % (attrs['lshift'], )) rshift = self.checkIntAttribute('param', attrs, 'rshift', None) if (rshift is not None) and (0 > rshift): - self.handleError('Element param attribute rshift "%s" is negative', (attrs['rshift'], )) + self.handleError('Element param attribute rshift "%s" is negative' % (attrs['rshift'], )) if self.repeat_depth and self.repeat_depth[-1]: if 'start' in attrs: if 'value' in attrs: @@ -194,7 +195,7 @@ class LayoutChecker(Minifyer): if name not in self.variable_scopes[-1]: self.variable_scopes[-1][name] = True elif not self.VARPATTERN.match(name): - self.handleError('Incrementing parameter "%s" redefined', (name, )) + self.handleError('Generator parameter "%s" redefined' % (name, )) else: if 'value' not in attrs: self.handleError('Element param missing attribute value') @@ -204,7 +205,7 @@ class LayoutChecker(Minifyer): if not self.variable_scopes[-1].get(name, False): self.variable_scopes[-1][name] = False elif not self.VARPATTERN.match(name): - self.handleError('Incrementing parameter "%s" redefined', (name, )) + self.handleError('Generator parameter "%s" redefined' % (name, )) else: if ('start' in attrs) or ('increment' in attrs) or ('lshift' in attrs) or ('rshift' in attrs): self.handleError('Element param with start/increment/lshift/rshift attribute(s) not in repeat scope') @@ -261,6 +262,14 @@ class LayoutChecker(Minifyer): if tag.find('::') >= 0: self.handleError('Element %s attribute %s "%s" contains double separator' % (element, attr, tag)) + def checkComponent(self, name, attrs): + state = self.checkIntAttribute(name, attrs, 'state', None) + if (state is not None) and (0 > state): + self.handleError('Element %s attribute state "%s" is negative' % (name, attrs['state'])) + self.handlers.append((self.componentStartHandler, self.componentEndHandler)) + self.have_bounds.append(False) + self.have_color.append(False) + def rootStartHandler(self, name, attrs): if 'mamelayout' != name: self.ignored_depth = 1 @@ -292,6 +301,9 @@ class LayoutChecker(Minifyer): self.elements[attrs['name']] = self.formatLocation() elif not generated_name: self.handleError('Element element has duplicate name (previous %s)' % (self.elements[attrs['name']], )) + defstate = self.checkIntAttribute(name, attrs, 'defstate', None) + if (defstate is not None) and (0 > defstate): + self.handleError('Element element attribute defstate "%s" is negative' % (attrs['defstate'], )) self.handlers.append((self.elementStartHandler, self.elementEndHandler)) elif 'group' == name: if 'name' not in attrs: @@ -308,7 +320,7 @@ class LayoutChecker(Minifyer): self.variable_scopes.append({ }) self.repeat_depth.append(0) self.have_bounds.append(False) - elif 'view' == name: + elif ('view' == name) and (not self.repeat_depth[-1]): if 'name' not in attrs: self.handleError('Element view missing attribute name') else: @@ -326,13 +338,13 @@ class LayoutChecker(Minifyer): else: count = self.checkIntAttribute(name, attrs, 'count', None) if (count is not None) and (0 >= count): - self.handleError('Element repeat attribute count "%s" is negative' % (attrs['count'], )) + self.handleError('Element repeat attribute count "%s" is not positive' % (attrs['count'], )) self.variable_scopes.append({ }) self.repeat_depth[-1] += 1 elif 'param' == name: self.checkParameter(attrs) self.ignored_depth = 1 - elif 'script' == name: + elif ('script' == name) and (not self.repeat_depth[-1]): self.ignored_depth = 1 else: self.handleError('Encountered unexpected element %s' % (name, )) @@ -355,31 +367,55 @@ class LayoutChecker(Minifyer): def elementStartHandler(self, name, attrs): if name in self.SHAPES: - self.handlers.append((self.shapeStartHandler, self.shapeEndHandler)) - self.have_bounds.append(False) - self.have_color.append(False) + self.checkComponent(name, attrs) elif 'text' == name: if 'string' not in attrs: - self.handleError('Element bounds missing attribute string') - if 'align' in attrs: - align = self.checkIntAttribute(name, attrs, 'align', None) - if (align is not None) and ((0 > align) or (2 < align)): - self.handleError('Element text attribute align "%s" not in valid range 0-2' % (attrs['align'], )) - self.handlers.append((self.shapeStartHandler, self.shapeEndHandler)) - self.have_bounds.append(False) - self.have_color.append(False) + self.handleError('Element text missing attribute string') + align = self.checkIntAttribute(name, attrs, 'align', None) + if (align is not None) and ((0 > align) or (2 < align)): + self.handleError('Element text attribute align "%s" not in valid range 0-2' % (attrs['align'], )) + self.checkComponent(name, attrs) + elif 'simplecounter' == name: + maxstate = self.checkIntAttribute(name, attrs, 'maxstate', None) + if (maxstate is not None) and (0 > maxstate): + self.handleError('Element simplecounter attribute maxstate "%s" is negative' % (attrs['maxstate'], )) + digits = self.checkIntAttribute(name, attrs, 'digits', None) + if (digits is not None) and (0 >= digits): + self.handleError('Element simplecounter attribute digits "%s" is not positive' % (attrs['digits'], )) + align = self.checkIntAttribute(name, attrs, 'align', None) + if (align is not None) and ((0 > align) or (2 < align)): + self.handleError('Element simplecounter attribute align "%s" not in valid range 0-2' % (attrs['align'], )) + self.checkComponent(name, attrs) + elif 'image' == name: + if 'file' not in attrs: + self.handleError('Element image missing attribute file') + self.checkComponent(name, attrs) + elif 'reel' == name: + # TODO: validate symbollist and improve validation of other attributes + self.checkIntAttribute(name, attrs, 'stateoffset', None) + numsymbolsvisible = self.checkIntAttribute(name, attrs, 'numsymbolsvisible', None) + if (numsymbolsvisible is not None) and (0 >= numsymbolsvisible): + self.handleError('Element reel attribute numsymbolsvisible "%s" not positive' % (attrs['numsymbolsvisible'], )) + reelreversed = self.checkIntAttribute(name, attrs, 'reelreversed', None) + if (reelreversed is not None) and ((0 > reelreversed) or (1 < reelreversed)): + self.handleError('Element reel attribute reelreversed "%s" not in valid range 0-1' % (attrs['reelreversed'], )) + beltreel = self.checkIntAttribute(name, attrs, 'beltreel', None) + if (beltreel is not None) and ((0 > beltreel) or (1 < beltreel)): + self.handleError('Element reel attribute beltreel "%s" not in valid range 0-1' % (attrs['beltreel'], )) + self.checkComponent(name, attrs) else: + self.handleError('Encountered unexpected element %s' % (name, )) self.ignored_depth = 1 def elementEndHandler(self, name): self.handlers.pop() - def shapeStartHandler(self, name, attrs): + def componentStartHandler(self, name, attrs): if 'bounds' == name: self.checkBounds(attrs) elif 'color' == name: if self.have_color[-1]: - self.handleError('Duplicate bounds element') + self.handleError('Duplicate color element') else: self.have_color[-1] = True self.checkColorChannel(attrs, 'red') @@ -388,7 +424,7 @@ class LayoutChecker(Minifyer): self.checkColorChannel(attrs, 'alpha') self.ignored_depth = 1 - def shapeEndHandler(self, name): + def componentEndHandler(self, name): self.have_bounds.pop() self.have_color.pop() self.handlers.pop() @@ -396,7 +432,7 @@ class LayoutChecker(Minifyer): def groupViewStartHandler(self, name, attrs): if name in self.OBJECTS: if 'element' not in attrs: - self.handleError('Element %s missing attribute element', (name, )) + self.handleError('Element %s missing attribute element' % (name, )) elif attrs['element'] not in self.referenced_elements: self.referenced_elements[attrs['element']] = self.formatLocation() if 'inputtag' in attrs: @@ -549,19 +585,33 @@ def compressLayout(src, dst, comp): return state[1], state[0] +class BlackHole(object): + def write(self, *args): + pass + def close(self): + pass + + if __name__ == '__main__': - if len(sys.argv) != 4: + if (len(sys.argv) > 4) or (len(sys.argv) < 2): print('Usage:') - print(' complay ') + print(' complay [ []]') sys.exit(0 if len(sys.argv) <= 1 else 1) srcfile = sys.argv[1] - dstfile = sys.argv[2] - varname = sys.argv[3] + dstfile = sys.argv[2] if len(sys.argv) >= 3 else None + if len(sys.argv) >= 4: + varname = sys.argv[3] + else: + varname = os.path.basename(srcfile) + base, ext = os.path.splitext(varname) + if ext.lower() == '.lay': + varname = base + varname = 'layout_' + re.sub('[^0-9A-Za-z_]', '_', varname) comp_type = 1 try: - dst = open(dstfile,'w') + dst = open(dstfile,'w') if dstfile is not None else BlackHole() dst.write('static const unsigned char %s_data[] = {\n' % (varname)) byte_count, comp_size = compressLayout(srcfile, lambda x: dst.write(x), zlib.compressobj()) dst.write('};\n\n') @@ -571,10 +621,12 @@ if __name__ == '__main__': dst.close() except XmlError: dst.close() - os.remove(dstfile) + if dstfile is not None: + os.remove(dstfile) sys.exit(2) except IOError: sys.stderr.write("Unable to open output file '%s'\n" % dstfile) - os.remove(dstfile) dst.close() + if dstfile is not None: + os.remove(dstfile) sys.exit(3) diff --git a/src/emu/rendlay.cpp b/src/emu/rendlay.cpp index 1d5dd7eadd5..7a926ba8963 100644 --- a/src/emu/rendlay.cpp +++ b/src/emu/rendlay.cpp @@ -129,7 +129,7 @@ private: , m_int_increment(i) , m_shift(s) , m_text_valid(true) - , m_incrementing(true) + , m_generator(true) { } entry(std::string &&name, std::string &&t, double i, int s) : m_name(std::move(name)) @@ -137,7 +137,7 @@ private: , m_float_increment(i) , m_shift(s) , m_text_valid(true) - , m_incrementing(true) + , m_generator(true) { } entry(entry &&) = default; entry &operator=(entry &&) = default; @@ -165,7 +165,7 @@ private: } std::string const &name() const { return m_name; } - bool is_incrementing() const { return m_incrementing; } + bool is_generator() const { return m_generator; } std::string const &get_text() { @@ -187,7 +187,7 @@ private: void increment() { - if (is_incrementing()) + if (is_generator()) { // apply increment if (m_float_increment) @@ -342,7 +342,7 @@ private: bool m_text_valid = false; bool m_int_valid = false; bool m_float_valid = false; - bool m_incrementing = false; + bool m_generator = false; }; using entry_vector = std::vector; @@ -631,7 +631,7 @@ public: throw layout_syntax_error("increment attribute must be a number"); } - // don't allow incrementing parameters to be redefined + // don't allow generator parameters to be redefined if (init) { entry_vector::iterator const pos( @@ -641,7 +641,7 @@ public: name, [] (entry const &lhs, auto const &rhs) { return lhs.name() < rhs; })); if ((m_entries.end() != pos) && (pos->name() == name)) - throw layout_syntax_error("incrementing parameters must be defined exactly once per scope"); + throw layout_syntax_error("generator parameters must be defined exactly once per scope"); std::pair const expanded(expand(start)); if (floatincrement) @@ -668,8 +668,8 @@ public: [] (entry const &lhs, auto const &rhs) { return lhs.name() < rhs; })); if ((m_entries.end() == pos) || (pos->name() != name)) m_entries.emplace(pos, std::move(name), std::string(expanded.first, expanded.second)); - else if (pos->is_incrementing()) - throw layout_syntax_error("incrementing parameters must be defined exactly once per scope"); + else if (pos->is_generator()) + throw layout_syntax_error("generator parameters must be defined exactly once per scope"); else pos->set(std::string(expanded.first, expanded.second)); } @@ -677,8 +677,18 @@ public: void increment_parameters() { - for (entry &e : m_entries) - e.increment(); + m_entries.erase( + std::remove_if( + m_entries.begin(), + m_entries.end(), + [] (entry &e) + { + if (!e.is_generator()) + return true; + e.increment(); + return false; + }), + m_entries.end()); } char const *get_attribute_string(util::xml::data_node const &node, char const *name, char const *defvalue) @@ -1188,24 +1198,24 @@ private: ru_imgformat const format = render_detect_image(*m_file, m_dirname.c_str(), m_imagefile.c_str()); switch (format) { - case RENDUTIL_IMGFORMAT_ERROR: - break; - - case RENDUTIL_IMGFORMAT_PNG: - // load the basic bitmap - m_hasalpha = render_load_png(m_bitmap, *m_file, m_dirname.c_str(), m_imagefile.c_str()); + case RENDUTIL_IMGFORMAT_ERROR: + break; - // load the alpha bitmap if specified - if (m_bitmap.valid() && !m_alphafile.empty()) - render_load_png(m_bitmap, *m_file, m_dirname.c_str(), m_alphafile.c_str(), true); - break; + case RENDUTIL_IMGFORMAT_PNG: + // load the basic bitmap + m_hasalpha = render_load_png(m_bitmap, *m_file, m_dirname.c_str(), m_imagefile.c_str()); + break; - default: - // try JPG - render_load_jpeg(m_bitmap, *m_file, m_dirname.c_str(), m_imagefile.c_str()); - break; + default: + // try JPG + render_load_jpeg(m_bitmap, *m_file, m_dirname.c_str(), m_imagefile.c_str()); + break; } + // load the alpha bitmap if specified + if (m_bitmap.valid() && !m_alphafile.empty()) + render_load_png(m_bitmap, *m_file, m_dirname.c_str(), m_alphafile.c_str(), true); + // if we can't load the bitmap, allocate a dummy one and report an error if (!m_bitmap.valid()) { @@ -1399,31 +1409,31 @@ protected: tempbitmap.fill(rgb_t(0xff,0x00,0x00,0x00)); // top bar - draw_segment_horizontal(tempbitmap, 0 + 2*segwidth/3, bmwidth - 2*segwidth/3, 0 + segwidth/2, segwidth, (state & (1 << 0)) ? onpen : offpen); + draw_segment_horizontal(tempbitmap, 0 + 2*segwidth/3, bmwidth - 2*segwidth/3, 0 + segwidth/2, segwidth, BIT(state, 0) ? onpen : offpen); // top-right bar - draw_segment_vertical(tempbitmap, 0 + 2*segwidth/3, bmheight/2 - segwidth/3, bmwidth - segwidth/2, segwidth, (state & (1 << 1)) ? onpen : offpen); + draw_segment_vertical(tempbitmap, 0 + 2*segwidth/3, bmheight/2 - segwidth/3, bmwidth - segwidth/2, segwidth, BIT(state, 1) ? onpen : offpen); // bottom-right bar - draw_segment_vertical(tempbitmap, bmheight/2 + segwidth/3, bmheight - 2*segwidth/3, bmwidth - segwidth/2, segwidth, (state & (1 << 2)) ? onpen : offpen); + draw_segment_vertical(tempbitmap, bmheight/2 + segwidth/3, bmheight - 2*segwidth/3, bmwidth - segwidth/2, segwidth, BIT(state, 2) ? onpen : offpen); // bottom bar - draw_segment_horizontal(tempbitmap, 0 + 2*segwidth/3, bmwidth - 2*segwidth/3, bmheight - segwidth/2, segwidth, (state & (1 << 3)) ? onpen : offpen); + draw_segment_horizontal(tempbitmap, 0 + 2*segwidth/3, bmwidth - 2*segwidth/3, bmheight - segwidth/2, segwidth, BIT(state, 3) ? onpen : offpen); // bottom-left bar - draw_segment_vertical(tempbitmap, bmheight/2 + segwidth/3, bmheight - 2*segwidth/3, 0 + segwidth/2, segwidth, (state & (1 << 4)) ? onpen : offpen); + draw_segment_vertical(tempbitmap, bmheight/2 + segwidth/3, bmheight - 2*segwidth/3, 0 + segwidth/2, segwidth, BIT(state, 4) ? onpen : offpen); // top-left bar - draw_segment_vertical(tempbitmap, 0 + 2*segwidth/3, bmheight/2 - segwidth/3, 0 + segwidth/2, segwidth, (state & (1 << 5)) ? onpen : offpen); + draw_segment_vertical(tempbitmap, 0 + 2*segwidth/3, bmheight/2 - segwidth/3, 0 + segwidth/2, segwidth, BIT(state, 5) ? onpen : offpen); // middle bar - draw_segment_horizontal(tempbitmap, 0 + 2*segwidth/3, bmwidth - 2*segwidth/3, bmheight/2, segwidth, (state & (1 << 6)) ? onpen : offpen); + draw_segment_horizontal(tempbitmap, 0 + 2*segwidth/3, bmwidth - 2*segwidth/3, bmheight/2, segwidth, BIT(state, 6) ? onpen : offpen); // apply skew apply_skew(tempbitmap, 40); // decimal point - draw_segment_decimal(tempbitmap, bmwidth + segwidth/2, bmheight - segwidth/2, segwidth, (state & (1 << 7)) ? onpen : offpen); + draw_segment_decimal(tempbitmap, bmwidth + segwidth/2, bmheight - segwidth/2, segwidth, BIT(state, 7) ? onpen : offpen); // resample to the target size render_resample_argb_bitmap_hq(dest, tempbitmap, color()); @@ -2014,7 +2024,7 @@ protected: tempbitmap.fill(rgb_t(0xff, 0x00, 0x00, 0x00)); for (int i = 0; i < m_dots; i++) - draw_segment_decimal(tempbitmap, ((dotwidth/2 )+ (i * dotwidth)), bmheight/2, dotwidth, (state & (1 << i))?onpen:offpen); + draw_segment_decimal(tempbitmap, ((dotwidth / 2) + (i * dotwidth)), bmheight / 2, dotwidth, BIT(state, i) ? onpen : offpen); // resample to the target size render_resample_argb_bitmap_hq(dest, tempbitmap, color()); @@ -2155,7 +2165,7 @@ protected: { int basey; - if (m_reelreversed==1) + if (m_reelreversed) { basey = bounds.top() + ((use_state)*(ourheight/num_shown)/(max_state_used/m_numstops)) + curry; } diff --git a/src/frontend/mame/clifront.cpp b/src/frontend/mame/clifront.cpp index 60260556606..581d6edd62f 100644 --- a/src/frontend/mame/clifront.cpp +++ b/src/frontend/mame/clifront.cpp @@ -83,7 +83,7 @@ const options_entry cli_option_entries[] = /* core commands */ { nullptr, nullptr, OPTION_HEADER, "CORE COMMANDS" }, { CLICOMMAND_HELP ";h;?", "0", OPTION_COMMAND, "show help message" }, - { CLICOMMAND_VALIDATE ";valid", "0", OPTION_COMMAND, "perform driver validation on game drivers" }, + { CLICOMMAND_VALIDATE ";valid", "0", OPTION_COMMAND, "perform validation on system drivers and devices" }, /* configuration commands */ { nullptr, nullptr, OPTION_HEADER, "CONFIGURATION COMMANDS" }, @@ -552,7 +552,7 @@ void cli_frontend::listcrc(const std::vector &args) // determine which drivers to output; return an error if none found driver_enumerator drivlist(m_options, gamename); if (drivlist.count() == 0) - throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching games found for '%s'", gamename); + throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching systems found for '%s'", gamename); // iterate through matches, and then through ROMs while (drivlist.next()) @@ -720,7 +720,7 @@ void cli_frontend::listsamples(const std::vector &args) // determine which drivers to output; return an error if none found driver_enumerator drivlist(m_options, gamename); if (drivlist.count() == 0) - throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching games found for '%s'", gamename); + throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching systems found for '%s'", gamename); // iterate over drivers, looking for SAMPLES devices bool first = true; @@ -760,7 +760,7 @@ void cli_frontend::listdevices(const std::vector &args) // determine which drivers to output; return an error if none found driver_enumerator drivlist(m_options, gamename); if (drivlist.count() == 0) - throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching games found for '%s'", gamename); + throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching systems found for '%s'", gamename); // iterate over drivers, looking for SAMPLES devices bool first = true; @@ -845,7 +845,7 @@ void cli_frontend::listslots(const std::vector &args) // determine which drivers to output; return an error if none found driver_enumerator drivlist(m_options, gamename); if (drivlist.count() == 0) - throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching games found for '%s'", gamename); + throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching systems found for '%s'", gamename); // print header printf("%-16s %-16s %-16s %s\n", "SYSTEM", "SLOT NAME", "SLOT OPTIONS", "SLOT DEVICE NAME"); @@ -913,7 +913,7 @@ void cli_frontend::listmedia(const std::vector &args) // determine which drivers to output; return an error if none found driver_enumerator drivlist(m_options, gamename); if (drivlist.count() == 0) - throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching games found for '%s'", gamename); + throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching systems found for '%s'", gamename); // print header printf("%-16s %-16s %-10s %s\n", "SYSTEM", "MEDIA NAME", "(brief)", "IMAGE FILE EXTENSIONS SUPPORTED"); @@ -1114,7 +1114,7 @@ void cli_frontend::verifysamples(const std::vector &args) // return an error if none found if (matched == 0) - throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching games found for '%s'", gamename); + throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching systems found for '%s'", gamename); // if we didn't get anything at all, display a generic end message if (matched > 0 && correct == 0 && incorrect == 0) @@ -1327,7 +1327,7 @@ void cli_frontend::listsoftware(const std::vector &args) // determine which drivers to output; return an error if none found driver_enumerator drivlist(m_options, gamename); if (drivlist.count() == 0) - throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching games found for '%s'", gamename); + throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching systems found for '%s'", gamename); while (drivlist.next()) { @@ -1372,9 +1372,7 @@ void cli_frontend::verifysoftware(const std::vector &args) // determine which drivers to process; return an error if none found driver_enumerator drivlist(m_options, gamename); if (drivlist.count() == 0) - { - throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching games found for '%s'", gamename); - } + throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching systems found for '%s'", gamename); media_auditor auditor(drivlist); util::ovectorstream summary_string; @@ -1412,7 +1410,7 @@ void cli_frontend::verifysoftware(const std::vector &args) // return an error if none found if (matched == 0) - throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching games found for '%s'", gamename); + throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching systems found for '%s'", gamename); // if we didn't get anything at all, display a generic end message if (matched > 0 && correct == 0 && incorrect == 0) diff --git a/src/mame/drivers/micro20.cpp b/src/mame/drivers/micro20.cpp index 05b11e2b6a0..26ad1f003a7 100644 --- a/src/mame/drivers/micro20.cpp +++ b/src/mame/drivers/micro20.cpp @@ -30,8 +30,8 @@ class micro20_state : public driver_device { public: - micro20_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + micro20_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_maincpu(*this, MAINCPU_TAG), m_rom(*this, "bootrom"), m_mainram(*this, "mainram"), diff --git a/src/mame/layout/aim65_40.lay b/src/mame/layout/aim65_40.lay index c0b90ebdfb3..e44100700f0 100644 --- a/src/mame/layout/aim65_40.lay +++ b/src/mame/layout/aim65_40.lay @@ -10,138 +10,39 @@ - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/rocknms.lay b/src/mame/layout/rocknms.lay index a8d892f3cb4..b6b053eacae 100644 --- a/src/mame/layout/rocknms.lay +++ b/src/mame/layout/rocknms.lay @@ -2,10 +2,10 @@ - + - + diff --git a/src/mame/layout/stepstag.lay b/src/mame/layout/stepstag.lay index f51becc014f..0525d15a310 100644 --- a/src/mame/layout/stepstag.lay +++ b/src/mame/layout/stepstag.lay @@ -2,13 +2,13 @@ - + - + - + diff --git a/src/mame/layout/svmu.lay b/src/mame/layout/svmu.lay index f4419de1b90..cb14d4318c0 100644 --- a/src/mame/layout/svmu.lay +++ b/src/mame/layout/svmu.lay @@ -47,9 +47,4 @@ - - - - - diff --git a/src/mame/layout/whousetc.lay b/src/mame/layout/whousetc.lay index 8c621db3b54..6af99406950 100644 --- a/src/mame/layout/whousetc.lay +++ b/src/mame/layout/whousetc.lay @@ -17,10 +17,14 @@ Westinghouse Test Console Serial #5 layout - + + + + + @@ -32,14 +36,22 @@ Westinghouse Test Console Serial #5 layout - + - + + + + + + + + + @@ -55,14 +67,22 @@ Westinghouse Test Console Serial #5 layout - + - + + + + + + + + + @@ -78,14 +98,22 @@ Westinghouse Test Console Serial #5 layout - + - + + + + + + + + + @@ -101,14 +129,22 @@ Westinghouse Test Console Serial #5 layout - + - + + + + + + + + + @@ -124,14 +160,22 @@ Westinghouse Test Console Serial #5 layout - + - + + + + + + + + + @@ -147,14 +191,22 @@ Westinghouse Test Console Serial #5 layout - + - + + + + + + + + + @@ -170,14 +222,22 @@ Westinghouse Test Console Serial #5 layout - + - + + + + + + + + + @@ -193,14 +253,22 @@ Westinghouse Test Console Serial #5 layout - + - + + + + + + + + + @@ -216,14 +284,22 @@ Westinghouse Test Console Serial #5 layout - + - + + + + + + + + + @@ -239,14 +315,22 @@ Westinghouse Test Console Serial #5 layout - + - + + + + + + + + + @@ -262,14 +346,22 @@ Westinghouse Test Console Serial #5 layout - + - + + + + + + + + + @@ -285,10 +377,14 @@ Westinghouse Test Console Serial #5 layout - + + + + + @@ -304,10 +400,14 @@ Westinghouse Test Console Serial #5 layout - + + + + + @@ -323,14 +423,22 @@ Westinghouse Test Console Serial #5 layout - + - + + + + + + + + + @@ -346,10 +454,14 @@ Westinghouse Test Console Serial #5 layout - + + + + + @@ -361,10 +473,14 @@ Westinghouse Test Console Serial #5 layout - + + + + + @@ -380,10 +496,14 @@ Westinghouse Test Console Serial #5 layout - + + + + + @@ -399,10 +519,14 @@ Westinghouse Test Console Serial #5 layout - + + + + + @@ -418,10 +542,14 @@ Westinghouse Test Console Serial #5 layout - + + + + + @@ -437,10 +565,14 @@ Westinghouse Test Console Serial #5 layout - + + + + + @@ -456,10 +588,14 @@ Westinghouse Test Console Serial #5 layout - + + + + + @@ -475,10 +611,14 @@ Westinghouse Test Console Serial #5 layout - + + + + + @@ -494,10 +634,14 @@ Westinghouse Test Console Serial #5 layout - + + + + + @@ -513,10 +657,14 @@ Westinghouse Test Console Serial #5 layout - + + + + + @@ -528,10 +676,14 @@ Westinghouse Test Console Serial #5 layout - + + + + + @@ -543,10 +695,14 @@ Westinghouse Test Console Serial #5 layout - + + + + + @@ -558,10 +714,14 @@ Westinghouse Test Console Serial #5 layout - + + + + + @@ -573,10 +733,14 @@ Westinghouse Test Console Serial #5 layout - + + + + + @@ -588,10 +752,14 @@ Westinghouse Test Console Serial #5 layout - + + + + + @@ -603,10 +771,14 @@ Westinghouse Test Console Serial #5 layout - + + + + + @@ -618,10 +790,14 @@ Westinghouse Test Console Serial #5 layout - + + + + + @@ -660,7 +836,7 @@ Westinghouse Test Console Serial #5 layout - + diff --git a/src/osd/modules/netdev/taptun.cpp b/src/osd/modules/netdev/taptun.cpp index b81ae99826c..b4d8b963c02 100644 --- a/src/osd/modules/netdev/taptun.cpp +++ b/src/osd/modules/netdev/taptun.cpp @@ -34,8 +34,7 @@ class taptun_module : public osd_module, public netdev_module { public: - taptun_module() - : osd_module(OSD_NETDEV_PROVIDER, "taptun"), netdev_module() + taptun_module() : osd_module(OSD_NETDEV_PROVIDER, "taptun"), netdev_module() { } virtual ~taptun_module() { } @@ -60,11 +59,11 @@ protected: int recv_dev(uint8_t **buf); private: #if defined(WIN32) - HANDLE m_handle; + HANDLE m_handle = INVALID_HANDLE_VALUE; OVERLAPPED m_overlapped; bool m_receive_pending; #else - int m_fd; + int m_fd = -1; char m_ifname[10]; #endif char m_mac[6]; -- cgit v1.2.3