Hi Vas,

I read the page at https://docs.mamedev.org/techspecs/layout_files.html which is a lot to digest for a noob.

and now I see there's a section on error handling that says:

Error handling

For internal (developer-supplied) layout files, errors detected by the complay.py script result in a build failure.
MAME will stop loading a layout file if a syntax error is encountered. No views from the layout will be available. Examples of syntax errors include undefined element or group references, invalid bounds, invalid colours, recursively nested groups, and redefined generator parameters.
When loading a layout file, if a view references a non-existent screen, MAME will print a warning message and continue. Views referencing non-existent screens are considered unviable and not available to the user.

Oh now I see the part about complay.py:

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.

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

And complay.py will tell me the line and the character position of the malformed token. Thanks for the pointer. I learn something new about mame every day.

$ python scripts/build/complay.py artwork/segfault_apple2p/default.lay
fatal error: artwork/segfault_apple2p/default.lay:164:98: not well-formed (invalid token)

Last edited by Golden Child; 04/24/19 05:08 PM.