diff --git a/docs/source/techspecs/index.rst b/docs/source/techspecs/index.rst
index 0435dd486e8..37d37c73479 100644
--- a/docs/source/techspecs/index.rst
+++ b/docs/source/techspecs/index.rst
@@ -18,4 +18,5 @@ MAME’s source or working on scripts that run within the MAME framework.
floppy
nscsi
luaengine
+ luareference
m6502
diff --git a/docs/source/techspecs/layout_script.rst b/docs/source/techspecs/layout_script.rst
index 968a8fe81fb..2291a3c4eb4 100644
--- a/docs/source/techspecs/layout_script.rst
+++ b/docs/source/techspecs/layout_script.rst
@@ -33,7 +33,13 @@ Practical examples
------------------
Before diving into the technical details of how it works, we’ll start with some
-example layout files using Lua script for enhancement.
+example layout files using Lua script for enhancement. It’s assumed that you’re
+familiar with MAME’s artwork system and have a basic understanding of Lua
+scripting. For details on MAME’s layout file, see :ref:`layfile`; for an
+introduction to Lua scripting in MAME, see :ref:`luaengine`; for detailed
+descriptions of MAME’s Lua classes, see :ref:`luareference`.
+
+.. _layscript-examples-espial:
Espial: joystick split across ports
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -201,3 +207,400 @@ This function does the following tasks:
The function called before view items are added to the render target reads the
player inputs, and shuffles the bits into the order needed by the joystick
element.
+
+.. _layscript-examples-starwars:
+
+Star Wars: animation on two axes
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+We’ll make a layout that shows the position of the flight yoke for Atari Star
+Wars. The input ports are straightforward – each analog axis produces a value
+in the range from 0x00 (0) to 0xff (255), inclusive:
+
+.. code-block:: C++
+
+ PORT_START("STICKY")
+ PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(70) PORT_KEYDELTA(30)
+
+ PORT_START("STICKX")
+ PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(30)
+
+Here’s our layout file:
+
+.. code-block:: XML
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+The layout has a ``script`` element containing the Lua script, to be called as a
+function by the layout plugin when the layout file is loaded. This happens
+after the layout views have been build, but before the emulated system has
+finished starting. The layout file object is supplied to the script in the
+``file`` variable.
+
+We supply a function to be called after tags in the layout file have been
+resolved. This function does the following:
+
+* Looks up the analog axis inputs.
+* Looks up the view item that draws the outline of area where the yoke position
+ is displayed.
+* Declares some variables to hold calculated values across function calls.
+* Supplies a function to be called when the view’s dimensions have been
+ recomputed.
+* Supplies a function to be called before adding view items to the render
+ container.
+* Supplies functions that will supply the bounds for the animated items.
+* Hides the warning that reminds the user to enable the layout plugin by setting
+ the element state for the item to 0 (the text component is only drawn when
+ the element state is 1).
+
+The view is looked up by name (value of its ``name`` attribute), and items
+within the view are looked up by ID (values of their ``id`` attributes).
+
+Layout view dimensions are recomputed in response to several events, including
+the window being resized, entering/leaving full screen mode, toggling visibility
+of item collections, and changing the zoom to screen area setting. When this
+happens, we need to update our size and animation scale factors. We get the
+bounds of the square where the yoke position is displayed, calculate the size
+for the animated items, and calculate the ratios of axis units to render target
+coordinates in each direction. It’s more efficient to do these calculations
+only when the results may change.
+
+Before view items are added to the render target, we read the analog axis inputs
+and convert the values to coordinates positions for the animated items. The Y
+axis input uses larger values to aim higher, so we need to reverse the value by
+subtracting it from 0xff (255). We add in the coordinates of the top left
+corner of the square where we’re displaying the yoke position. We do this once
+each time the layout is drawn for efficiency, since we can use the values for
+all three animated items.
+
+Finally, we supply bounds for the animated items when required. These functions
+need to return ``render_bounds`` objects giving the position and size of the
+items in render target coordinates.
+
+(Since the vertical and horizontal line elements each only move on a single
+axis, it would be possible to animate them using the layout file format’s item
+animation features. Only the box at the intersection of the line actually
+requires scripting. It’s done entirely using scripting here for illustrative
+purposes.)
+
+
+.. _layscript-environment:
+
+The layout script environment
+-----------------------------
+
+The Lua environment is provided by the layout plugin. It’s fairly minimal, only
+providing what’s needed:
+
+* ``file`` giving the script’s layout file object. Has a ``device`` property
+ for obtaining the device that caused the layout file to be loaded, and a
+ ``views`` property for obtaining the layout’s views (indexed by name).
+* ``machine`` giving MAME’s current running machine.
+* ``emu.render_bounds`` and ``emu.render_color`` functions for creating bounds
+ and colour objects.
+* ``emu.print_error``, ``emu.print_info`` and ``emu.print_debug`` functions for
+ diagnostic output.
+* Standard Lua ``pairs``, ``ipairs``, ``table.insert`` and ``table.remove``
+ functions for manipulating tables and other containers.
+* Standard Lua ``print`` function for text output to the console.
+* Standard Lua ``string.format`` function for string formatting.
+
+
+.. _layscript-events:
+
+Layout events
+-------------
+
+MAME layout scripting uses an event-based model. Scripts can supply functions
+to be called after events occur, or when data is needed. There are three levels
+of events: layout file events, layout view events, and layout view item events.
+
+.. _layscript-events-file:
+
+Layout file events
+~~~~~~~~~~~~~~~~~~
+
+Layout file events apply to the file as a whole, and not to an individual view.
+
+Resolve tags
+ ``file:set_resolve_tags_callback(cb)``
+
+ Called after the emulated system has finished starting, input and output
+ tags in the layout have been resolved, and default item callbacks have been
+ set up. This is a good time to look up inputs and set up view item event
+ handlers.
+
+ The callback function has no return value and takes no parameters. Call
+ with ``nil`` as the argument to remove the event handler.
+
+.. _layscript-events-view:
+
+Layout view events
+~~~~~~~~~~~~~~~~~~
+
+Layout view events apply to an individual view.
+
+Prepare items
+ ``view:set_prepare_items_callback(cb)``
+
+ Called before the view’s items are added to the render target in preparation
+ for drawing a video frame.
+
+ The callback function has no return value and takes no parameters. Call
+ with ``nil`` as the argument to remove the event handler.
+Preload
+ ``view:set_preload_callback(cb)``
+
+ Called after pre-loading visible view elements. This can happen when the
+ view is selected for the first time in a session, or when the user toggles
+ visibility of an element collection on. Be aware that this can be called
+ multiple times in a session and avoid repeating expensive tasks.
+
+ The callback function has no return value and takes no parameters. Call
+ with ``nil`` as the argument to remove the event handler.
+Dimensions recomputed
+ ``view:set_recomputed_callback(cb)``
+
+ Called after view dimensions are recomputed. This happens in several
+ situations, including the window being resized, entering or leaving full
+ screen mode, toggling visibility of item collections, and changes to the
+ rotation and zoom to screen area settings. If you’re animating the position
+ of view items, this is a good time to calculate positions and scale factors.
+
+ The callback function has no return value and takes no parameters. Call
+ with ``nil`` as the argument to remove the event handler.
+
+.. _layscript-events-item:
+
+Layout view item events
+~~~~~~~~~~~~~~~~~~~~~~~
+
+Layout view item callbacks apply to individual items within a view. They are
+used to override items’ default element state, animation state, bounds and
+colour behaviour.
+
+Get element state
+ ``item:set_element_state_callback(cb)``
+
+ Set callback for getting the item’s element state. This controls how the
+ item’s element is drawn, for components that change appearance depending on
+ state, conditionally-drawn components, and component bounds/colour
+ animation. Do not attempt to access the item’s ``element_state`` property
+ from the callback, as it will result in infinite recursion.
+
+ The callback function must return an integer, and takes no parameters. Call
+ with ``nil`` as the argument to restore the default element state
+ handler (based on the item’s XML attributes).
+Get animation state
+ ``item:set_animation_state_callback(cb)``
+
+ Set callback for getting the item’s animation state. This is used for item
+ bounds/colour animation. Do not attempt to access the item’s
+ ``animation_state`` property from the callback, as it will result in
+ infinite recursion.
+
+ The callback function must return an integer, and takes no parameters. Call
+ with ``nil`` as the argument to restore the default animation state handler
+ (based on the item’s XML attributes and ``animate`` child element).
+Get item bounds
+ ``item:set_bounds_callback(cb)``
+
+ Set callback for getting the item’s bounds (position and size). Do not
+ attempt to access the item’s ``bounds`` property from the callback, as it
+ will result in infinite recursion.
+
+ The callback function must return a render bounds object representing the
+ item’s bounds in render target coordinates (usually created by calling
+ ``emu.render_bounds``), and takes no parameters. Call with ``nil`` as the
+ argument to restore the default bounds handler (based on the item’s
+ animation state and ``bounds`` child elements).
+Get item colour
+ ``item::set_color_callback(cb)``
+
+ Set callback for getting the item’s colour (the element texture’s colours
+ multiplied by this colour). Do not attempt to access the item’s ``color``
+ property from the callback, as it will result in infinite recursion.
+
+ The callback function must return a render colour object representing the
+ ARGB colour (usually created by calling ``emu.render_color``), and takes no
+ parameters. Call with ``nil`` as the argument to restore the default colour
+ handler (based on the item’s animation state and ``color`` child elements).
diff --git a/docs/source/techspecs/luaengine.rst b/docs/source/techspecs/luaengine.rst
index 4b9c3f0e555..22981fe79e6 100644
--- a/docs/source/techspecs/luaengine.rst
+++ b/docs/source/techspecs/luaengine.rst
@@ -1,6 +1,13 @@
-Scripting MAME via LUA
+.. _luaengine:
+
+Scripting MAME via Lua
======================
+.. contents:: :local:
+
+
+.. _luaengine-intro:
+
Introduction
------------
@@ -19,6 +26,9 @@ change without prior notice. However, we expose methods to let you know at
runtime which API version you are running against, and most of the objects
support runtime you can introspection.
+
+.. _luaengine-features:
+
Features
--------
@@ -34,6 +44,9 @@ currently available to Lua scripts:
- memory read/write (8/16/32/64 bits, signed and unsigned)
- register and state control (state enumeration, get and set)
+
+.. _luaengine-usage:
+
Usage
-----
@@ -52,10 +65,13 @@ approach. The former is not encouraged as it is resource-intensive and makes
control flow unnecessarily complex. Instead, we suggest to register custom
hooks to be invoked on specific events (e.g. at each frame rendering).
+
+.. _luaengine-walkthrough:
+
Walkthrough
-----------
-Let's first run MAME in a terminal to reach the LUA console:
+Let's first run MAME in a terminal to reach the Lua console:
::
diff --git a/docs/source/techspecs/luareference.rst b/docs/source/techspecs/luareference.rst
new file mode 100644
index 00000000000..ac606f02293
--- /dev/null
+++ b/docs/source/techspecs/luareference.rst
@@ -0,0 +1,582 @@
+.. _luareference:
+
+MAME Lua Class Reference
+========================
+
+.. contents::
+ :local:
+ :depth: 2
+
+
+.. _luareference-intro:
+
+Introduction
+------------
+
+Various aspects of MAME can be controlled using Lua scripting. Many key classes
+are exposed as Lua objects.
+
+.. _luareference-intro-containers:
+
+Containers
+~~~~~~~~~~
+
+Many properties yield container wrappers. Container wrappers are cheap to
+create, and provide an interface that is similar to a read-only table. The
+complexity of operations may vary. Container wrappers usually provide most of
+these operations:
+
+#c
+ Get the number of items in the container.
+c[k]
+ Returns the item corresponding to the key ``k``, or ``nil`` if the key is
+ not present.
+pairs(c)
+ Iterate container by key and value. The key is what you would pass to the
+ index operator or the ``get`` method to get the value.
+ipairs(c)
+ Iterate container by index and value. The index is what you would pass to
+ the ``at`` method to get the value (this may be the same as the key for some
+ containers).
+c:empty()
+ Returns a Boolean indicating whether there are no items in the container.
+c:get(k)
+ Returns the item corresponding to the key ``k``, or ``nil`` if the key is
+ not present. Usually equivalent to the index operator.
+c:at(i)
+ Returns the value at the 1-based index ``i``, or ``nil`` if it is out of
+ range.
+c:find(v)
+ Returns the key for item ``v``, or ``nil`` if it is not in the collection.
+ The key is what you would pass to the index operator to get the value.
+c:find(v)
+ Returns the key for item ``v``, or ``nil`` if it is not in the container.
+ The key is what you would pass to the index operator to get the value.
+c:index_of(v)
+ Returns the 1-based index for item ``v``, or ``nil`` if it is not in the
+ container. The index is what you would pass to the ``at`` method to get the
+ value.
+
+
+.. _luareference-render:
+
+Render system
+-------------
+
+The render system is responsible for drawing what you see in MAME’s windows,
+including emulated screens, artwork, and UI elements.
+
+.. _luareference-render-bounds:
+
+Render bounds
+~~~~~~~~~~~~~
+
+Wraps MAME’s ``render_bounds`` class, which represents a rectangle using
+floating-point coordinates.
+
+Instantiation
+^^^^^^^^^^^^^
+
+emu.render_bounds()
+ Creates a render bounds object representing a unit square, with top left
+ corner at (0, 0) and bottom right corner at (1, 1). Note that render
+ target coordinates don’t necessarily have equal X and Y scales, so this may
+ not represent a square in the final output.
+emu.render_bounds(left, top, right, bottom)
+ Creates a render bounds object representing a rectangle with top left
+ corner at (x0, y0) and bottom right corner at (x1, y1).
+
+ The arguments must all be floating-point numbers.
+
+Methods
+^^^^^^^
+
+bounds:includes(x, y)
+ Returns a Boolean indicating whether the specified point falls within the
+ rectangle. The rectangle must be normalised for this to work (right greater
+ than left and bottom greater than top).
+
+ The arguments must both be floating-point numbers.
+bounds:set_xy(left, top, right, bottom)
+ Set the rectangle’s position and size in terms of the positions of the
+ edges.
+
+ The arguments must all be floating-point numbers.
+bounds:set_wh(left, top, width, height)
+ Set the rectangle’s position and size in terms of the top top left corner
+ position, and the width and height.
+
+ The arguments must all be floating-point numbers.
+
+Properties
+^^^^^^^^^^
+
+bounds.x0 (read/write)
+ The leftmost coordinate in the rectangle (i.e. the X coordinate of the left
+ edge or the top left corner).
+bounds.x1 (read/write)
+ The rightmost coordinate in the rectangle (i.e. the X coordinate of the
+ right edge or the bottom right corner).
+bounds.y0 (read/write)
+ The topmost coordinate in the rectangle (i.e. the Y coordinate of the top
+ edge or the top left corner).
+bounds.y1 (read/write)
+ The bottommost coordinate in the rectangle (i.e. the Y coordinate of the
+ bottom edge or the bottom right corner).
+bounds.width (read/write)
+ The width of the rectangle. Setting this property changes the position of
+ the rightmost edge.
+bounds.height (read/write)
+ The height of the rectangle. Setting this property changes the position of
+ the bottommost edge.
+bounds.aspect (read-only)
+ The width-to-height aspect ratio of the rectangle. Note that this is often
+ in render target coordinates which don’t necessarily have equal X and Y
+ scales. A rectangle representing a square in the final output doesn’t
+ necessarily have an aspect ratio of 1.
+
+.. _luareference-render-color:
+
+Render colour
+~~~~~~~~~~~~~
+
+Wraps MAME’s ``render_color`` class, which represents an ARGB (alpha, red,
+green, blue) format colour. Channels are floating-point values ranging from
+zero (0, transparent alpha or colour off) to one (1, opaque or full colour
+intensity). Colour channel values are not pre-multiplied by the alpha channel
+value.
+
+Instantiation
+^^^^^^^^^^^^^
+
+emu.render_color()
+ Creates a render colour object representing opaque white (all channels set
+ to 1). This is the identity value – ARGB multiplication by this value will
+ not change a colour.
+emu.render_color(a, r, g, b)
+ Creates a render colour object with the specified alpha, red, green and
+ blue channel values.
+
+ The arguments must all be floating-point numbers in the range from zero (0)
+ to one (1), inclusive.
+
+Methods
+^^^^^^^
+
+color:set(a, r, g, b)
+ Sets the colour object’s alpha, red, green and blue channel values.
+
+ The arguments must all be floating-point numbers in the range from zero (0)
+ to one (1), inclusive.
+
+Properties
+^^^^^^^^^^
+
+color.a (read/write)
+ Alpha value, in the range of zero (0, transparent) to one (1, opaque).
+color.r (read/write)
+ Red channel value, in the range of zero (0, off) to one (1, full intensity).
+color.g (read/write)
+ Green channel value, in the range of zero (0, off) to one (1, full
+ intensity).
+color.b (read/write)
+ Blue channel value, in the range of zero (0, off) to one (1, full
+ intensity).
+
+.. _luareference-render-manager:
+
+Render manager
+~~~~~~~~~~~~~~
+
+Wraps MAME’s ``render_manager`` class, responsible for managing render targets
+and textures.
+
+Instantiation
+^^^^^^^^^^^^^
+
+manager:machine():render()
+ Gets the global render manager instance for the emulation session.
+
+Properties
+^^^^^^^^^^
+
+render.max_update_rate (read-only)
+ The maximum update rate in Hertz. This is a floating-point number.
+render.ui_target (read-only)
+ The :ref:`render target ` used to draw the user
+ interface (including menus, sliders and pop-up messages). This is usually
+ the first host window or screen.
+render.ui_container (read-only)
+ The :ref:`render container ` used for drawing
+ the user interface.
+render.targets[] (read-only)
+ The list of render targets, including output windows and screens, as well as
+ hidden render targets used for things like rendering screenshots. Uses
+ 1-based integer indices. The index operator and the ``at`` method have O(n)
+ complexity.
+
+.. _luareference-render-target:
+
+Render target
+~~~~~~~~~~~~~
+
+Wrap’s MAME’s ``render_target`` class, which represents a video output channel.
+This could be a host window or screen, or a hidden target used for rendering
+screenshots.
+
+Instantiation
+^^^^^^^^^^^^^
+
+manager:machine():render().targets[index]
+ Get a render target by index.
+manager:machine():render():ui_target()
+ Get the render target used to display the user interface (including menus,
+ sliders and pop-up messages). This is usually the first host window or
+ screen.
+
+Properties
+^^^^^^^^^^
+
+target.index (read-only)
+ The 1-based index of the render target. This has O(n) complexity.
+target.width (read-only)
+ The width of the render target in output pixels. This is an integer.
+target.height (read-only)
+ The height of the render target in output pixels. This is an integer.
+target.pixel_aspect (read-only)
+ The width-to-height aspect ratio of the render target’s pixels. This is a
+ floating-point number.
+target.hidden (read-only)
+ A Boolean indicating whether this is an internal render target that is not
+ displayed to the user directly (e.g. the render target used to draw
+ screenshots).
+target.is_ui_target (read-only)
+ A Boolean indicating whether this is the render target used to display the
+ user interface.
+target.max_update_rate (read/write)
+ The maximum update rate for the render target in Hertz.
+target.orientation (read/write)
+ The target orientation flags. This is an integer bit mask, where bit 0
+ (0x01) is set to mirror horizontally, bit 1 (0x02) is set to mirror
+ vertically, and bit 2 (0x04) is set to mirror along the top left-bottom
+ right diagonal.
+target.view_names[]
+ The names of the available views for this render target. Uses 1-based
+ integer indices. The ``find`` and ``index_of`` methods have O(n)
+ complexity; all other supported operations have O(1) complexity.
+target.current_view (read-only)
+ The currently selected view for the render target. This is a
+ :ref:`layout view ` object.
+target.view_index (read/write)
+ The 1-based index of the selected view for this render target.
+target.visibility_mask (read-only)
+ An integer bit mask indicating which item collections are currently visible
+ for the current view.
+target.screen_overlay (read/write)
+ A Boolean indicating whether screen overlays are enabled.
+target.zoom_to_screen (read/write)
+ A Boolean indicating whether the render target is configured to scale so
+ that the emulated screen(s) fill as much of the output window/screen as
+ possible.
+
+.. _luareference-render-container:
+
+Render container
+~~~~~~~~~~~~~~~~
+
+Wraps MAME’s ``render_container`` class.
+
+Instantiation
+^^^^^^^^^^^^^
+
+manager:machine():render().ui_container
+ Gets the render container used to draw the user interface, including menus,
+ sliders and pop-up messages.
+manager:machine().screens[tag].container
+ Gets the render container used to draw a given screen.
+
+Properties
+^^^^^^^^^^
+
+container.user_settings (read/write)
+ The container’s :ref:`user settings `.
+ This can be used to control a number of image adjustments.
+container.orientation (read/write)
+ The container orientation flags. This is an integer bit mask, where bit 0
+ (0x01) is set to mirror horizontally, bit 1 (0x02) is set to mirror
+ vertically, and bit 2 (0x04) is set to mirror along the top left-bottom
+ right diagonal.
+container.xscale (read/write)
+ The container’s X scale factor. This is a floating-point number.
+container.yscale (read/write)
+ The container’s Y scale factor. This is a floating-point number.
+container.xoffset (read/write)
+ The container’s X offset. This is a floating-point number where one (1)
+ represents the X size of the container.
+container.yoffset (read/write)
+ The container’s Y offset. This is a floating-point number where one (1)
+ represents the Y size of the container.
+container.is_empty (read-only)
+ A Boolean indicating whether the container has no items.
+
+.. _luareference-render-contsettings:
+
+Container user settings
+~~~~~~~~~~~~~~~~~~~~~~~
+
+Wraps MAME’s ``render_container::user_settings`` class, representing image
+adjustments applied to a
+:ref:`render container `.
+
+Instantiation
+^^^^^^^^^^^^^
+
+manager:machine().screens[tag].container
+ Gets the current container user settings for a given screen.
+
+Properties
+^^^^^^^^^^
+
+settings.orientation (read/write)
+ The container orientation flags. This is an integer bit mask, where bit 0
+ (0x01) is set to mirror horizontally, bit 1 (0x02) is set to mirror
+ vertically, and bit 2 (0x04) is set to mirror along the top left-bottom
+ right diagonal.
+settings.brightness (read/write)
+ The brightness adjustment applied to the container. This is a
+ floating-point number.
+settings.contrast (read/write)
+ The contrast adjustment applied to the container. This is a floating-point
+ number.
+settings.gamma (read/write)
+ The gamma adjustment applied to the container. This is a floating-point
+ number.
+settings.xscale (read/write)
+ The container’s X scale factor. This is a floating-point number.
+settings.yscale (read/write)
+ The container’s Y scale factor. This is a floating-point number.
+settings.xoffset (read/write)
+ The container’s X offset. This is a floating-point number where one (1)
+ represents the X size of the container.
+settings.yoffset (read/write)
+ The container’s Y offset. This is a floating-point number where one (1)
+ represents the Y size of the container.
+
+.. _luareference-render-layfile:
+
+Layout file
+~~~~~~~~~~~
+
+Wraps MAME’s ``layout_file`` class, representing the views loaded from a layout
+file for use by a render target.
+
+Instantiation
+^^^^^^^^^^^^^
+
+A layout file object is supplied to its layout script in the ``file`` variable.
+Layout file objects are not instantiated directly from Lua scripts.
+
+Methods
+^^^^^^^
+
+layout:set_resolve_tags_callback(cb)
+ Set a function to perform additional tasks after the emulated machine has
+ finished starting, tags in the layout views have been resolved, and the
+ default view item handlers have been set up. The function must accept no
+ arguments.
+
+ Call with ``nil`` to remove the callback.
+
+Properties
+^^^^^^^^^^
+
+layout.device (read-only)
+ The device that caused the layout file to be loaded. Usually the root
+ machine device for external layouts.
+layout.views[] (read-only)
+ The :ref:`views ` created from the layout file.
+ Views are indexed by unqualified name (i.e. the value of the ``name``
+ attribute). Views are ordered how they appear in the layout file when
+ iterating or using the ``at`` method. The index get, ``at`` and
+ ``index_of`` methods have O(n) complexity.
+
+ Note that not all views in the XML file may be created. For example views
+ that reference screens provided by slot card devices will not be created if
+ said slot card devices are not present in the system.
+
+.. _luareference-render-layview:
+
+Layout view
+~~~~~~~~~~~
+
+Wraps MAME’s ``layout_view`` class, representing a view that can be displayed in
+a render target. Views are created from XML layout files, which may be loaded
+from external artwork, internal to MAME, or automatically generated based on the
+screens in the emulated system.
+
+Instantiation
+^^^^^^^^^^^^^
+
+Layout scripts generally
+
+manager:machine():render().targets[index].current_view
+ Gets the currently selected view for a given render target.
+
+Methods
+^^^^^^^
+
+view:has_screen(screen)
+ Returns a Boolean indicating whether the screen is present in the view.
+ This is true for screens that are present but not visible because the user
+ has hidden the item collection they belong to.
+view:set_prepare_items_callback(cb)
+ Set a function to perform additional tasks before the view items are added
+ to the render target in preparation for drawing a video frame. The function
+ must accept no arguments. Call with ``nil`` to remove the callback.
+view:set_preload_callback(cb)
+ Set a function to perform additional tasks after preloading visible view
+ items. The function must accept no arguments. Call with ``nil`` to remove
+ the callback.
+
+ This function may be called when the user selects a view or makes an item
+ collection visible. It may be called multiple times for a view, so avoid
+ repeating expensive tasks.
+view:set_recomputed_callback(cb)
+ Set a function to perform additional tasks after the view’s dimensions are
+ recomputed. The function must accept no arguments. Call with ``nil`` to
+ remove the callback.
+
+ View coordinates are recomputed in various events, including the window
+ being resized, entering or leaving full-screen mode, and changing the zoom
+ to screen area setting.
+
+Properties
+^^^^^^^^^^
+
+view.items[] (read-only)
+ The screen and layout element :ref:`items ` in
+ the view. This container does not support iteration by key using ``pairs``;
+ only iteration by index using ``ipairs`` is supported. The key is the value
+ of the ``id`` attribute if present. Only items with ``id`` attributes can
+ be looked up by key. The index get method has O(1) complexity, and the
+ ``at`` and ``index_of`` methods have O(n) complexity.
+view.name (read-only)
+ The display name for the view. This may be qualified to indicate the device
+ that caused the layout file to be loaded when it isn’t the root machine
+ device.
+view.unqualified_name (read-only)
+ The unqualified name of the view, exactly as it appears in the ``name``
+ attribute in the XML layout file.
+view.visible_screen_count (read-only)
+ The number of screens items currently enabled in the view.
+view.effective_aspect (read-only)
+ The effective width-to-height aspect ratio of the view in its current
+ configuration.
+view.bounds (read-only)
+ A :ref:`render bounds ` object representing the
+ effective bounds of the view in its current configuration. The coordinates
+ are in view units, which are arbitrary but assumed to have square aspect
+ ratio.
+view.has_art
+ A Boolean indicating whether the view has any non-screen items, including
+ items that are not visible because the user has hidden the item collection
+ that they belong to.
+
+.. _luareference-render-layitem:
+
+Layout view item
+~~~~~~~~~~~~~~~~
+
+Wraps MAME’s ``layout_view::item`` class, representing an item in a view. An
+item is drawn as a rectangular textured surface. The texture is supplied by an
+emulated screen or a layout element.
+
+Instantiation
+^^^^^^^^^^^^^
+
+layout.views[name].items[id]
+ Get a view item by ID. The item must have an ``id`` attribute in the XML
+ layout file to be looked up by ID.
+
+Methods
+^^^^^^^
+
+item:set_state(state)
+ Set the value used as the element state and animation state in the absence
+ of bindings. The argument must be an integer.
+item.set_element_state_callback(cb)
+ Set a function to call to obtain the element state for the item. The
+ function must accept no arguments and return an integer. Call with ``nil``
+ to restore the default element state callback (based on bindings in the XML
+ layout file).
+
+ Note that the function must not access the item’s ``element_state``
+ property, as this will result in infinite recursion.
+
+ This callback will not be used to obtain the animation state for the item,
+ even if the item lacks explicit animation state bindings in the XML layout
+ file.
+item.set_animation_state_callback(cb)
+ Set a function to call to obtain the animation state for the item. The
+ function must accept no arguments and return an integer. Call with ``nil``
+ to restore the default animation state callback (based on bindings in the
+ XML layout file).
+
+ Note that the function must not access the item’s ``animation_state``
+ property, as this will result in infinite recursion.
+item.set_bounds_callback(cb)
+ Set a function to call to obtain the bounds for the item. The function must
+ accept no arguments and return a
+ :ref:`render bounds ` object in render target
+ coordinates. Call with ``nil`` to restore the default bounds callback
+ (based on the item’s animation state and ``bounds`` child elements in the
+ XML layout file).
+
+ Note that the function must not access the item’s ``bounds`` property, as
+ this will result in infinite recursion.
+item.set_color_callback(cb)
+ Set a function to call to obtain the multiplier colour for the item. The
+ function must accept no arguments and return a
+ :ref:`render colour ` object. Call with ``nil``
+ to restore the default colour callback (based on the item’s animation state
+ and ``color`` child elements in the XML layout file).
+
+ Note that the function must not access the item’s ``color`` property, as
+ this will result in infinite recursion.
+
+Properties
+^^^^^^^^^^
+
+item.id (read-only)
+ Get the optional item identifier. This is the value of the ``id`` attribute
+ in the XML layout file if present, or ``nil``.
+item.bounds_animated (read-only)
+ A Boolean indicating whether the item’s bounds depend on its animation
+ state.
+item.color_animated (read-only)
+ A Boolean indicating whether the item’s colour depends on its animation
+ state.
+item.bounds (read-only)
+ The item’s bounds for the current state. This is a
+ :ref:`render bounds ` object in render target
+ coordinates.
+item.color (read-only)
+ The item’s colour for the current state. The colour of the screen or
+ element texture is multiplied by this colour. This is a
+ :ref:`render colour ` object.
+item.blend_mode (read-only)
+ Get the item’s blend mode. This is an integer value, where 0 means no
+ blending, 1 means alpha blending, 2 means RGB multiplication, 3 means
+ additive blending, and -1 allows the items within a container to specify
+ their own blending modes.
+item.orientation (read-only)
+ Get the item orientation flags. This is an integer bit mask, where bit 0
+ (0x01) is set to mirror horizontally, bit 1 (0x02) is set to mirror
+ vertically, and bit 2 (0x04) is set to mirror along the top left-bottom
+ right diagonal.
+item.element_state (read-only)
+ Get the current element state. This will call the element state callback
+ function to handle bindings.
+item.animation_state (read-only)
+ Get the current animation state. This will call the animation state
+ callback function to handle bindings.
diff --git a/scripts/target/mame/tiny.lua b/scripts/target/mame/tiny.lua
index f91c7f16120..c41ccc37a9d 100644
--- a/scripts/target/mame/tiny.lua
+++ b/scripts/target/mame/tiny.lua
@@ -16,63 +16,68 @@
-- drivers referenced in tiny.lst.
--------------------------------------------------
-CPUS["Z80"] = true
+CPUS["COP400"] = true
CPUS["M6502"] = true
-CPUS["MCS48"] = true
-CPUS["MCS51"] = true
CPUS["M6800"] = true
CPUS["M6805"] = true
CPUS["M6809"] = true
CPUS["M680X0"] = true
+CPUS["MCS48"] = true
+CPUS["MCS51"] = true
CPUS["TMS9900"] = true
-CPUS["COP400"] = true
+CPUS["Z80"] = true
--------------------------------------------------
-- Specify all the sound cores necessary for the
-- drivers referenced in tiny.lst.
--------------------------------------------------
-SOUNDS["SAMPLES"] = true
+SOUNDS["ASTROCADE"] = true
+SOUNDS["AY8910"] = true
+SOUNDS["CEM3394"] = true
SOUNDS["DAC"] = true
SOUNDS["DISCRETE"] = true
-SOUNDS["AY8910"] = true
-SOUNDS["YM2151"] = true
-SOUNDS["ASTROCADE"] = true
-SOUNDS["TMS5220"] = true
-SOUNDS["OKIM6295"] = true
SOUNDS["HC55516"] = true
-SOUNDS["YM3812"] = true
-SOUNDS["CEM3394"] = true
+SOUNDS["OKIM6295"] = true
+SOUNDS["SAMPLES"] = true
+SOUNDS["TMS5220"] = true
SOUNDS["VOTRAX"] = true
+SOUNDS["YM2151"] = true
+SOUNDS["YM3812"] = true
+
--------------------------------------------------
-- specify available video cores
--------------------------------------------------
+VIDEOS["MC6845"] = true
+
+
--------------------------------------------------
-- specify available machine cores
--------------------------------------------------
MACHINES["6821PIA"] = true
-MACHINES["ADC0808"] = true
-MACHINES["TTL74148"] = true
-MACHINES["TTL74153"] = true
-MACHINES["TTL74157"] = true
-MACHINES["TTL7474"] = true
-MACHINES["TTL74259"] = true
-MACHINES["RIOT6532"] = true
-MACHINES["PIT8253"] = true
-MACHINES["Z80CTC"] = true
-MACHINES["Z80PIO"] = true
MACHINES["68681"] = true
+MACHINES["ADC0808"] = true
MACHINES["BANKDEV"] = true
MACHINES["GEN_LATCH"] = true
MACHINES["INPUT_MERGER"] = true
-MACHINES["OUTPUT_LATCH"] = true
-MACHINES["TICKET"] = true
-MACHINES["WATCHDOG"] = true
-MACHINES["Z80DAISY"] = true
MACHINES["NETLIST"] = true
+MACHINES["OUTPUT_LATCH"] = true
+MACHINES["PIT8253"] = true
+MACHINES["RIOT6532"] = true
+MACHINES["TICKET"] = true
+MACHINES["TIMEKPR"] = true
+MACHINES["TTL74148"] = true
+MACHINES["TTL74153"] = true
+MACHINES["TTL74157"] = true
+MACHINES["TTL74259"] = true
+MACHINES["TTL7474"] = true
+MACHINES["WATCHDOG"] = true
+MACHINES["Z80CTC"] = true
+MACHINES["Z80DAISY"] = true
+MACHINES["Z80PIO"] = true
--------------------------------------------------
@@ -81,6 +86,7 @@ MACHINES["NETLIST"] = true
BUSES["CENTRONICS"] = true
+
--------------------------------------------------
-- This is the list of files that are necessary
-- for building all of the drivers referenced
@@ -167,6 +173,7 @@ files{
MAME_DIR .. "src/mame/machine/gaelco_ds5002fp.h",
MAME_DIR .. "src/mame/drivers/looping.cpp",
MAME_DIR .. "src/mame/drivers/supertnk.cpp",
+ MAME_DIR .. "src/mame/drivers/goldnpkr.cpp",
}
end
diff --git a/src/emu/render.cpp b/src/emu/render.cpp
index b2e278a59ea..26b7057ffb3 100644
--- a/src/emu/render.cpp
+++ b/src/emu/render.cpp
@@ -2634,10 +2634,8 @@ void render_target::config_load(util::xml::data_node const &targetnode)
// apply the opposite orientation to the UI
if (is_ui_target())
{
- render_container::user_settings settings;
render_container &ui_container = m_manager.ui_container();
-
- ui_container.get_user_settings(settings);
+ render_container::user_settings settings = ui_container.get_user_settings();
settings.m_orientation = orientation_add(orientation_reverse(rotate), settings.m_orientation);
ui_container.set_user_settings(settings);
}
@@ -3326,10 +3324,9 @@ void render_manager::config_load(config_type cfg_type, util::xml::data_node cons
{
int const index = screennode->get_attribute_int("index", -1);
render_container *container = m_screen_container_list.find(index);
- render_container::user_settings settings;
// fetch current settings
- container->get_user_settings(settings);
+ render_container::user_settings settings = container->get_user_settings();
// fetch color controls
settings.m_brightness = screennode->get_attribute_float("brightness", settings.m_brightness);
@@ -3395,8 +3392,7 @@ void render_manager::config_save(config_type cfg_type, util::xml::data_node *par
// output the basics
screennode->set_attribute_int("index", scrnum);
- render_container::user_settings settings;
- container->get_user_settings(settings);
+ render_container::user_settings settings = container->get_user_settings();
// output the color controls
if (settings.m_brightness != machine().options().brightness())
diff --git a/src/emu/render.h b/src/emu/render.h
index 3b945a08b8c..694c5bc8784 100644
--- a/src/emu/render.h
+++ b/src/emu/render.h
@@ -444,8 +444,8 @@ public:
float yscale() const { return m_user.m_yscale; }
float xoffset() const { return m_user.m_xoffset; }
float yoffset() const { return m_user.m_yoffset; }
- bool is_empty() const { return (m_itemlist.count() == 0); }
- void get_user_settings(user_settings &settings) const { settings = m_user; }
+ bool is_empty() const { return m_itemlist.empty(); }
+ const user_settings &get_user_settings() const { return m_user; }
// setters
void set_overlay(bitmap_argb32 *bitmap);
diff --git a/src/emu/rendlay.cpp b/src/emu/rendlay.cpp
index 50882d0d214..a71857175e1 100644
--- a/src/emu/rendlay.cpp
+++ b/src/emu/rendlay.cpp
@@ -5064,9 +5064,12 @@ layout_file::layout_file(
}
// load the content of the first script node
- util::xml::data_node const *const scriptnode = mamelayoutnode->get_child("script");
- if (scriptnode)
- emulator_info::layout_script_cb(*this, scriptnode->get_value());
+ if (!m_viewlist.empty())
+ {
+ util::xml::data_node const *const scriptnode = mamelayoutnode->get_child("script");
+ if (scriptnode)
+ emulator_info::layout_script_cb(*this, scriptnode->get_value());
+ }
}
catch (layout_syntax_error const &err)
{
diff --git a/src/emu/screen.cpp b/src/emu/screen.cpp
index 88e0dc00e8c..7b84b3d9b6b 100644
--- a/src/emu/screen.cpp
+++ b/src/emu/screen.cpp
@@ -826,8 +826,7 @@ void screen_device::device_start()
m_texture[1]->set_id((u64(m_unique_id) << 57) | 1);
// configure the default cliparea
- render_container::user_settings settings;
- m_container->get_user_settings(settings);
+ render_container::user_settings settings = m_container->get_user_settings();
settings.m_xoffset = m_xoffset;
settings.m_yoffset = m_yoffset;
settings.m_xscale = m_xscale;
diff --git a/src/frontend/mame/luaengine.cpp b/src/frontend/mame/luaengine.cpp
index 488bd2bc571..45e6367bdfc 100644
--- a/src/frontend/mame/luaengine.cpp
+++ b/src/frontend/mame/luaengine.cpp
@@ -79,7 +79,7 @@ int sol_lua_push(sol::types, lua_State *L, buffer *value)
}
template
-struct usertype_container > : lua_engine::immutable_container_helper, T>
+struct usertype_container > : lua_engine::immutable_collection_helper, T>
{
private:
using enumerator = lua_engine::devenum;
@@ -182,7 +182,7 @@ public:
template
-struct usertype_container > : lua_engine::immutable_container_helper, std::vector> const, typename std::vector>::const_iterator>
+struct usertype_container > : lua_engine::immutable_collection_helper, std::vector> const, typename std::vector>::const_iterator>
{
private:
static int next_pairs(lua_State *L)
@@ -1173,6 +1173,7 @@ void lua_engine::initialize()
* machine:popmessage(str) - print str as popup
* machine:popmessage() - clear displayed popup message
* machine:logerror(str) - print str to log
+ *
* machine:system() - get game_driver for running driver
* machine:video() - get video_manager
* machine:sound() - get sound_manager
@@ -1196,7 +1197,7 @@ void lua_engine::initialize()
* machine.images[] - get available image devices table (k=type, v=device_image_interface)
*/
- auto machine_type = sol().registry().new_usertype("machine", "new", sol::no_constructor);
+ auto machine_type = sol().registry().new_usertype("machine", sol::no_constructor);
machine_type["exit"] = &running_machine::schedule_exit;
machine_type["hard_reset"] = &running_machine::schedule_hard_reset;
machine_type["soft_reset"] = &running_machine::schedule_soft_reset;
@@ -1231,6 +1232,9 @@ void lua_engine::initialize()
return false;
}
};
+ machine_type["popmessage"] = sol::overload(
+ [](running_machine &m, const char *str) { m.popmessage("%s", str); },
+ [](running_machine &m) { m.popmessage(); });
machine_type["system"] = &running_machine::system;
machine_type["video"] = &running_machine::video;
machine_type["sound"] = &running_machine::sound;
@@ -1245,7 +1249,7 @@ void lua_engine::initialize()
machine_type["debugger"] =
[this] (running_machine &m) -> sol::object
{
- if(!(m.debug_flags & DEBUG_FLAG_ENABLED))
+ if (!(m.debug_flags & DEBUG_FLAG_ENABLED))
return sol::make_object(sol(), sol::lua_nil);
return sol::make_object(sol(), &m.debugger());
};
@@ -1258,9 +1262,6 @@ void lua_engine::initialize()
machine_type["cassettes"] = sol::property([] (running_machine &m) { return devenum(m.root_device()); });
machine_type["images"] = sol::property([] (running_machine &m) { return devenum(m.root_device()); });
machine_type["slots"] = sol::property([](running_machine &m) { return devenum(m.root_device()); });
- machine_type["popmessage"] = sol::overload(
- [](running_machine &m, const char *str) { m.popmessage("%s", str); },
- [](running_machine &m) { m.popmessage(); });
machine_type["logerror"] = [] (running_machine &m, const char *str) { m.logerror("[luaengine] %s\n", str); };
@@ -1608,6 +1609,7 @@ void lua_engine::initialize()
"screen_dev",
sol::no_constructor,
sol::base_classes, sol::bases());
+ screen_dev_type.set("container", sol::property(&screen_device::container));
screen_dev_type.set("draw_box", [](screen_device &sdev, float x1, float y1, float x2, float y2, uint32_t bgcolor, uint32_t fgcolor) {
int sc_width = sdev.visible_area().width();
int sc_height = sdev.visible_area().height();
diff --git a/src/frontend/mame/luaengine.h b/src/frontend/mame/luaengine.h
index 1157d2083c2..b0bbf2210c3 100644
--- a/src/frontend/mame/luaengine.h
+++ b/src/frontend/mame/luaengine.h
@@ -37,7 +37,8 @@ public:
template struct object_ptr_vector_wrapper;
template struct tag_object_ptr_map;
template using standard_tag_object_ptr_map = tag_object_ptr_map > >;
- template struct immutable_container_helper;
+ template struct immutable_container_helper;
+ template struct immutable_collection_helper;
// construction/destruction
lua_engine();
diff --git a/src/frontend/mame/luaengine.ipp b/src/frontend/mame/luaengine.ipp
index ee4eb5d0030..3c878b68c2a 100644
--- a/src/frontend/mame/luaengine.ipp
+++ b/src/frontend/mame/luaengine.ipp
@@ -96,7 +96,7 @@ template struct usertype_container >;
template
-struct usertype_container > : lua_engine::immutable_container_helper, simple_list const, typename simple_list::auto_iterator>
+struct usertype_container > : lua_engine::immutable_collection_helper, simple_list const, typename simple_list::auto_iterator>
{
private:
static int next_pairs(lua_State *L)
@@ -163,7 +163,7 @@ public:
template
-struct usertype_container > : lua_engine::immutable_container_helper, T const, typename T::const_iterator>
+struct usertype_container > : lua_engine::immutable_collection_helper, T const, typename T::const_iterator>
{
private:
template
@@ -269,12 +269,10 @@ bool sol_lua_check(sol::types, lua_State *L, int index, Handler
int sol_lua_push(sol::types, lua_State *L, map_handler_type &&value);
-template
+template
struct lua_engine::immutable_container_helper
{
protected:
- using iterator = I;
-
static T &get_self(lua_State *L)
{
auto p(sol::stack::unqualified_check_get(L, 1));
@@ -285,22 +283,6 @@ protected:
return **p;
}
- struct indexed_iterator
- {
- indexed_iterator(C &s, iterator i) : src(s), it(i), ix(0U) { }
-
- C &src;
- iterator it;
- std::size_t ix;
-
- indexed_iterator &operator++()
- {
- ++it;
- ++ix;
- return *this;
- }
- };
-
public:
static int set(lua_State *L)
{
@@ -327,6 +309,11 @@ public:
return luaL_error(L, "sol: cannot call 'find' on type '%s': no supported comparison operator for the value type", sol::detail::demangle().c_str());
}
+ static int index_of(lua_State *L)
+ {
+ return luaL_error(L, "sol: cannot call 'index_of' on type '%s': no supported comparison operator for the value type", sol::detail::demangle().c_str());
+ }
+
static int clear(lua_State *L)
{
return luaL_error(L, "sol: cannot call 'clear' on type '%s': container is not modifiable", sol::detail::demangle().c_str());
@@ -339,6 +326,30 @@ public:
};
+template
+struct lua_engine::immutable_collection_helper : immutable_container_helper
+{
+protected:
+ using iterator = I;
+
+ struct indexed_iterator
+ {
+ indexed_iterator(C &s, iterator i) : src(s), it(i), ix(0U) { }
+
+ C &src;
+ iterator it;
+ std::size_t ix;
+
+ indexed_iterator &operator++()
+ {
+ ++it;
+ ++ix;
+ return *this;
+ }
+ };
+};
+
+
struct lua_engine::addr_space
{
addr_space(address_space &s, device_memory_interface &d) : space(s), dev(d) { }
diff --git a/src/frontend/mame/luaengine_input.cpp b/src/frontend/mame/luaengine_input.cpp
index 30a4d34c181..77e002ce848 100644
--- a/src/frontend/mame/luaengine_input.cpp
+++ b/src/frontend/mame/luaengine_input.cpp
@@ -48,19 +48,9 @@ template <> struct is_container : std::true_type { };
template <>
-struct usertype_container
+struct usertype_container : lua_engine::immutable_container_helper
{
private:
- static natkbd_kbd_list &get_self(lua_State *L)
- {
- auto p(sol::stack::unqualified_check_get(L, 1));
- if (!p)
- luaL_error(L, "sol: 'self' is not of type 'natkbd_kbd_list' (pass 'self' as first argument with ':' or call on proper type)");
- if (!*p)
- luaL_error(L, "sol: 'self' argument is nil (pass 'self' as first argument with ':' or call on a 'natkbd_kbd_list' type");
- return **p;
- }
-
template
static int next_pairs(lua_State *L)
{
@@ -127,17 +117,6 @@ public:
return stack::push(L, !self.manager.keyboard_count());
}
- // produce errors for unsupported operations
- static int set(lua_State *L) { return luaL_error(L, "sol: cannot call 'set(key, value)' on type 'natkbd_kbd_list': container is not modifiable"); }
- static int index_set(lua_State *L) { return luaL_error(L, "sol: cannot call 'container[key] = value' on type 'natkbd_kbd_list': container is not modifiable"); }
- static int add(lua_State *L) { return luaL_error(L, "sol: cannot call 'add' on type 'natkbd_kbd_list': container is not modifiable"); }
- static int insert(lua_State *L) { return luaL_error(L, "sol: cannot call 'insert' on type 'natkbd_kbd_list': container is not modifiable"); }
- static int find(lua_State *L) { return luaL_error(L, "sol: cannot call 'find' on type 'natkbd_kbd_list': no supported comparison operator for the value type"); }
- static int index_of(lua_State *L) { return luaL_error(L, "sol: cannot call 'index_of' on type 'natkbd_kbd_list': no supported comparison operator for the value type"); }
- static int clear(lua_State *L) { return luaL_error(L, "sol: cannot call 'clear' on type 'natkbd_kbd_list': container is not modifiable"); }
- static int erase(lua_State *L) { return luaL_error(L, "sol: cannot call 'erase' on type 'natkbd_kbd_list': container is not modifiable"); }
-
- // support for iteration with pairs and ipairs
static int next(lua_State *L) { return stack::push(L, next_pairs); }
static int pairs(lua_State *L) { return start_pairs(L); }
static int ipairs(lua_State *L) { return start_pairs(L); }
diff --git a/src/frontend/mame/luaengine_render.cpp b/src/frontend/mame/luaengine_render.cpp
index 9fff8f4171b..ca472dba675 100644
--- a/src/frontend/mame/luaengine_render.cpp
+++ b/src/frontend/mame/luaengine_render.cpp
@@ -33,6 +33,15 @@ struct layout_view_items
layout_view &view;
};
+
+struct render_target_view_names
+{
+ render_target_view_names(render_target &t) : target(t), count(-1) { }
+
+ render_target ⌖
+ int count;
+};
+
} // anonymous namespace
@@ -40,10 +49,11 @@ namespace sol {
template <> struct is_container : std::true_type { };
template <> struct is_container : std::true_type { };
+template <> struct is_container : std::true_type { };
template <>
-struct usertype_container : lua_engine::immutable_container_helper
+struct usertype_container : lua_engine::immutable_collection_helper
{
private:
using view_list = layout_file::view_list;
@@ -140,7 +150,7 @@ public:
template <>
-struct usertype_container : lua_engine::immutable_container_helper
+struct usertype_container : lua_engine::immutable_collection_helper
{
private:
using item_list = layout_view::item_list;
@@ -231,6 +241,102 @@ public:
}
};
+
+template <>
+struct usertype_container : lua_engine::immutable_container_helper
+{
+private:
+ struct iterator
+ {
+ iterator(render_target &t, unsigned i) : target(t), index(i) { }
+
+ render_target ⌖
+ unsigned index;
+ };
+
+ static int next_pairs(lua_State *L)
+ {
+ iterator &i(stack::unqualified_get >(L, 1));
+ char const *name(i.target.view_name(i.index));
+ if (!name)
+ return stack::push(L, lua_nil);
+ int result = stack::push(L, i.index + 1);
+ result += stack::push(L, name);
+ ++i.index;
+ return result;
+ }
+
+public:
+ static int at(lua_State *L)
+ {
+ render_target_view_names &self(get_self(L));
+ unsigned const index(stack::unqualified_get(L, 2));
+ return stack::push(L, self.target.view_name(index - 1));
+ }
+
+ static int get(lua_State *L)
+ {
+ return at(L);
+ }
+
+ static int index_get(lua_State *L)
+ {
+ return at(L);
+ }
+
+ static int find(lua_State *L)
+ {
+ render_target_view_names &self(get_self(L));
+ char const *const key(stack::unqualified_get(L, 2));
+ for (unsigned i = 0; ; ++i)
+ {
+ char const *const name(self.target.view_name(i));
+ if (!name)
+ return stack::push(L, lua_nil);
+ else if (!std::strcmp(key, name))
+ return stack::push(L, i + 1);
+ }
+ }
+
+ static int index_of(lua_State *L)
+ {
+ return find(L);
+ }
+
+ static int size(lua_State *L)
+ {
+ render_target_view_names &self(get_self(L));
+ if (0 > self.count)
+ for (self.count = 0; self.target.view_name(self.count); ++self.count) { }
+ return stack::push(L, self.count);
+ }
+
+ static int empty(lua_State *L)
+ {
+ render_target_view_names &self(get_self(L));
+ return stack::push(L, !self.target.view_name(0));
+ }
+
+ static int next(lua_State *L)
+ {
+ return stack::push(L, next_pairs);
+ }
+
+ static int pairs(lua_State *L)
+ {
+ render_target_view_names &self(get_self(L));
+ stack::push(L, next_pairs);
+ stack::push >(L, self.target, 0);
+ stack::push(L, lua_nil);
+ return 3;
+ }
+
+ static int ipairs(lua_State *L)
+ {
+ return pairs(L);
+ }
+};
+
} // namespace sol
@@ -241,20 +347,6 @@ public:
void lua_engine::initialize_render(sol::table &emu)
{
-/* render_bounds library
- *
- * bounds:includes(x, y) - returns true if point is within bounds
- * bounds:set_xy(left, top, right, bottom) - set bounds
- * bounds:set_wh(left, top, width, height) - set bounds
- *
- * bounds.x0 - leftmost X coordinate
- * bounds.y0 - topmost Y coordinate
- * bounds.x1 - rightmost X coordinate
- * bounds.y1 - bottommost Y coordinate
- * bounds.width - get/set width
- * bounds.height - get/set height
- * bounds.aspect - read-only aspect ratio width:height
- */
auto bounds_type = emu.new_usertype(
"render_bounds",
sol::call_constructor, sol::initializers(
@@ -272,15 +364,6 @@ void lua_engine::initialize_render(sol::table &emu)
bounds_type["aspect"] = sol::property(&render_bounds::aspect);
-/* render_color library
- *
- * set(a, r, g, b) - set color
- *
- * color.a - alpha channel
- * color.r - red channel
- * color.g - green channel
- * color.b - blue channel
- */
auto color_type = emu.new_usertype(
"render_color",
sol::call_constructor, sol::initializers(
@@ -293,24 +376,6 @@ void lua_engine::initialize_render(sol::table &emu)
color_type["b"] = &render_color::b;
-/* layout_view library
- *
- * manager:machine():render().targets[target_index]:current_view()
- *
- * view:has_screen(screen) - returns whether a given screen is present in the view (including hidden screens)
- * view:set_prepare_items_callback(cb) - set additional tasks before adding items to render target
- * view:set_preload_callback(cb) - set additional tasks after preloading visible items
- * view:set_recomputed_callback(cb) - set additional tasks after recomputing for resize or visibility change
- *
- * view.items - get the items in the view (including hidden items)
- * view.name - display name for the view
- * view.unqualified_name - name of the view as specified in the layout file
- * view.visible_screen_count - number of screens items currently enabled
- * view.effective_aspect - effective aspect ratio in current configuration
- * view.bounds - effective bounds in current configuration
- * view.has_art - true if the view has non-screen items
- */
-
auto layout_view_type = sol().registry().new_usertype("layout_view", sol::no_constructor);
layout_view_type["has_screen"] = &layout_view::has_screen;
layout_view_type["set_prepare_items_callback"] =
@@ -340,25 +405,6 @@ void lua_engine::initialize_render(sol::table &emu)
layout_view_type["has_art"] = sol::property(&layout_view::has_art);
-/* layout_view::item library
- *
- * item:set_state(state) - set state value used in absence of bindings
- * item.set_element_state_callback(cb) - set callback to obtain element state
- * item.set_animation_state_callback(cb) - set callback to obtain animation state
- * item.set_bounds_callback(cb) - set callback to obtain item bounds
- * item.set_color_callback(cb) - set callback to obtain item color
- *
- * item.id - get optional item identifier
- * item.bounds_animated - true if bounds depend on state
- * item.color_animated - true if color depends on state
- * item.bounds - get bounds for current state
- * item.color - get color for current state
- * item.blend_mode - get blend mode or -1
- * item.orientation - get item orientation
- * item.element_state - get effective element state
- * item.animation_state - get effective animation state
- */
-
auto layout_view_item_type = sol().registry().new_usertype("layout_item", sol::no_constructor);
layout_view_item_type["set_state"] = &layout_view::item::set_state;
layout_view_item_type["set_element_state_callback"] =
@@ -449,14 +495,6 @@ void lua_engine::initialize_render(sol::table &emu)
layout_view_item_type["animation_state"] = sol::property(&layout_view::item::animation_state);
-/* layout_file library
- *
- * file:set_resolve_tags_callback(cb) - set additional tasks after resolving tags
- *
- * file.device - get device that caused the file to be loaded
- * file.views[] - get view table (k=name, v=layout_view)
- */
-
auto layout_file_type = sol().registry().new_usertype("layout_file", sol::no_constructor);
layout_file_type["set_resolve_tags_callback"] =
make_simple_callback_setter(
@@ -468,79 +506,85 @@ void lua_engine::initialize_render(sol::table &emu)
layout_file_type["views"] = sol::property([] (layout_file &f) { return layout_file_views(f); });
-/* render_target library
- *
- * manager:machine():render().targets[target_index]
- * manager:machine():render():ui_target()
- *
- * target:current_view() - get current view for target
- * target:width() - get target width
- * target:height() - get target height
- * target:pixel_aspect() - get target aspect
- * target:hidden() - is target hidden
- * target:is_ui_target() - is ui render target
- * target:index() - target index
- * target:view_name([opt] index) - current target layout view name
- *
- * target.max_update_rate -
- * target.view - current target layout view
- * target.orientation - current target orientation
- * target.screen_overlay - enable overlays
- * target.zoom - enable zoom
- */
-
auto target_type = sol().registry().new_usertype("target", sol::no_constructor);
- target_type["current_view"] = &render_target::current_view;
- target_type["width"] = &render_target::width;
- target_type["height"] = &render_target::height;
- target_type["pixel_aspect"] = &render_target::pixel_aspect;
- target_type["hidden"] = &render_target::hidden;
- target_type["is_ui_target"] = &render_target::is_ui_target;
- target_type["index"] = &render_target::index;
- target_type["view_name"] = &render_target::view_name;
+ target_type["index"] = sol::property([] (render_target const &t) { return t.index() + 1; });
+ target_type["width"] = sol::property(&render_target::width);
+ target_type["height"] = sol::property(&render_target::height);
+ target_type["pixel_aspect"] = sol::property(&render_target::pixel_aspect);
+ target_type["hidden"] = sol::property(&render_target::hidden);
+ target_type["is_ui_target"] = sol::property(&render_target::is_ui_target);
target_type["max_update_rate"] = sol::property(&render_target::max_update_rate, &render_target::set_max_update_rate);
- target_type["view"] = sol::property(&render_target::view, &render_target::set_view);
target_type["orientation"] = sol::property(&render_target::orientation, &render_target::set_orientation);
+ target_type["view_names"] = sol::property([] (render_target &t) { return render_target_view_names(t); });
+ target_type["current_view"] = sol::property(&render_target::current_view);
+ target_type["view_index"] = sol::property(
+ [] (render_target const &t) { return t.view() + 1; },
+ [] (render_target &t, unsigned v) { t.set_view(v - 1); });
+ target_type["visibility_mask"] = sol::property(&render_target::visibility_mask);
target_type["screen_overlay"] = sol::property(&render_target::screen_overlay_enabled, &render_target::set_screen_overlay_enabled);
- target_type["zoom"] = sol::property(&render_target::zoom_to_screen, &render_target::set_zoom_to_screen);
+ target_type["zoom_to_screen"] = sol::property(&render_target::zoom_to_screen, &render_target::set_zoom_to_screen);
-/* render_container library
- *
- * manager:machine():render():ui_container()
- *
- * container.orientation
- * container.xscale
- * container.yscale
- * container.xoffset
- * container.yoffset
- * container.is_empty
- */
-
auto render_container_type = sol().registry().new_usertype("render_container", sol::no_constructor);
- render_container_type["orientation"] = sol::property(&render_container::orientation);
- render_container_type["xscale"] = sol::property(&render_container::xscale);
- render_container_type["yscale"] = sol::property(&render_container::yscale);
- render_container_type["xoffset"] = sol::property(&render_container::xoffset);
- render_container_type["yoffset"] = sol::property(&render_container::yoffset);
+ render_container_type["user_settings"] = sol::property(&render_container::get_user_settings, &render_container::set_user_settings);
+ render_container_type["orientation"] = sol::property(
+ &render_container::orientation,
+ [] (render_container &c, int v)
+ {
+ render_container::user_settings s(c.get_user_settings());
+ s.m_orientation = v;
+ c.set_user_settings(s);
+ });
+ render_container_type["xscale"] = sol::property(
+ &render_container::xscale,
+ [] (render_container &c, float v)
+ {
+ render_container::user_settings s(c.get_user_settings());
+ s.m_xscale = v;
+ c.set_user_settings(s);
+ });
+ render_container_type["yscale"] = sol::property(
+ &render_container::yscale,
+ [] (render_container &c, float v)
+ {
+ render_container::user_settings s(c.get_user_settings());
+ s.m_yscale = v;
+ c.set_user_settings(s);
+ });
+ render_container_type["xoffset"] = sol::property(
+ &render_container::xoffset,
+ [] (render_container &c, float v)
+ {
+ render_container::user_settings s(c.get_user_settings());
+ s.m_xoffset = v;
+ c.set_user_settings(s);
+ });
+ render_container_type["yoffset"] = sol::property(
+ &render_container::yoffset,
+ [] (render_container &c, float v)
+ {
+ render_container::user_settings s(c.get_user_settings());
+ s.m_yoffset = v;
+ c.set_user_settings(s);
+ });
render_container_type["is_empty"] = sol::property(&render_container::is_empty);
-/* render_manager library
- *
- * manager:machine():render()
- *
- * render:max_update_rate() -
- * render:ui_target() - render_target for ui drawing
- * render:ui_container() - render_container for ui drawing
- *
- * render.targets[] - render_target table
- */
+ auto user_settings_type = sol().registry().new_usertype("render_container_settings", sol::no_constructor);
+ user_settings_type["orientation"] = &render_container::user_settings::m_orientation;
+ user_settings_type["brightness"] = &render_container::user_settings::m_brightness;
+ user_settings_type["contrast"] = &render_container::user_settings::m_contrast;
+ user_settings_type["gamma"] = &render_container::user_settings::m_gamma;
+ user_settings_type["xscale"] = &render_container::user_settings::m_xscale;
+ user_settings_type["yscale"] = &render_container::user_settings::m_yscale;
+ user_settings_type["xoffset"] = &render_container::user_settings::m_xoffset;
+ user_settings_type["yoffset"] = &render_container::user_settings::m_yoffset;
+
auto render_type = sol().registry().new_usertype("render", sol::no_constructor);
- render_type["max_update_rate"] = &render_manager::max_update_rate;
- render_type["ui_target"] = &render_manager::ui_target;
- render_type["ui_container"] = &render_manager::ui_container;
+ render_type["max_update_rate"] = sol::property(&render_manager::max_update_rate);
+ render_type["ui_target"] = sol::property(&render_manager::ui_target);
+ render_type["ui_container"] = sol::property(&render_manager::ui_container);
render_type["targets"] = sol::property([] (render_manager &m) { return simple_list_wrapper(m.targets()); });
}
diff --git a/src/frontend/mame/ui/ui.cpp b/src/frontend/mame/ui/ui.cpp
index 1400cc19295..5918d0e13d6 100644
--- a/src/frontend/mame/ui/ui.cpp
+++ b/src/frontend/mame/ui/ui.cpp
@@ -1839,9 +1839,8 @@ int32_t mame_ui_manager::slider_refresh(running_machine &machine, void *arg, int
int32_t mame_ui_manager::slider_brightness(running_machine &machine, void *arg, int id, std::string *str, int32_t newval)
{
screen_device *screen = reinterpret_cast(arg);
- render_container::user_settings settings;
- screen->container().get_user_settings(settings);
+ render_container::user_settings settings = screen->container().get_user_settings();
if (newval != SLIDER_NOCHANGE)
{
settings.m_brightness = (float)newval * 0.001f;
@@ -1861,9 +1860,8 @@ int32_t mame_ui_manager::slider_brightness(running_machine &machine, void *arg,
int32_t mame_ui_manager::slider_contrast(running_machine &machine, void *arg, int id, std::string *str, int32_t newval)
{
screen_device *screen = reinterpret_cast(arg);
- render_container::user_settings settings;
- screen->container().get_user_settings(settings);
+ render_container::user_settings settings = screen->container().get_user_settings();
if (newval != SLIDER_NOCHANGE)
{
settings.m_contrast = (float)newval * 0.001f;
@@ -1882,9 +1880,8 @@ int32_t mame_ui_manager::slider_contrast(running_machine &machine, void *arg, in
int32_t mame_ui_manager::slider_gamma(running_machine &machine, void *arg, int id, std::string *str, int32_t newval)
{
screen_device *screen = reinterpret_cast(arg);
- render_container::user_settings settings;
- screen->container().get_user_settings(settings);
+ render_container::user_settings settings = screen->container().get_user_settings();
if (newval != SLIDER_NOCHANGE)
{
settings.m_gamma = (float)newval * 0.001f;
@@ -1904,9 +1901,8 @@ int32_t mame_ui_manager::slider_gamma(running_machine &machine, void *arg, int i
int32_t mame_ui_manager::slider_xscale(running_machine &machine, void *arg, int id, std::string *str, int32_t newval)
{
screen_device *screen = reinterpret_cast(arg);
- render_container::user_settings settings;
- screen->container().get_user_settings(settings);
+ render_container::user_settings settings = screen->container().get_user_settings();
if (newval != SLIDER_NOCHANGE)
{
settings.m_xscale = (float)newval * 0.001f;
@@ -1926,9 +1922,8 @@ int32_t mame_ui_manager::slider_xscale(running_machine &machine, void *arg, int
int32_t mame_ui_manager::slider_yscale(running_machine &machine, void *arg, int id, std::string *str, int32_t newval)
{
screen_device *screen = reinterpret_cast(arg);
- render_container::user_settings settings;
- screen->container().get_user_settings(settings);
+ render_container::user_settings settings = screen->container().get_user_settings();
if (newval != SLIDER_NOCHANGE)
{
settings.m_yscale = (float)newval * 0.001f;
@@ -1948,9 +1943,8 @@ int32_t mame_ui_manager::slider_yscale(running_machine &machine, void *arg, int
int32_t mame_ui_manager::slider_xoffset(running_machine &machine, void *arg, int id, std::string *str, int32_t newval)
{
screen_device *screen = reinterpret_cast(arg);
- render_container::user_settings settings;
- screen->container().get_user_settings(settings);
+ render_container::user_settings settings = screen->container().get_user_settings();
if (newval != SLIDER_NOCHANGE)
{
settings.m_xoffset = (float)newval * 0.001f;
@@ -1970,9 +1964,8 @@ int32_t mame_ui_manager::slider_xoffset(running_machine &machine, void *arg, int
int32_t mame_ui_manager::slider_yoffset(running_machine &machine, void *arg, int id, std::string *str, int32_t newval)
{
screen_device *screen = reinterpret_cast(arg);
- render_container::user_settings settings;
- screen->container().get_user_settings(settings);
+ render_container::user_settings settings = screen->container().get_user_settings();
if (newval != SLIDER_NOCHANGE)
{
settings.m_yoffset = (float)newval * 0.001f;
diff --git a/src/frontend/mame/ui/videoopt.cpp b/src/frontend/mame/ui/videoopt.cpp
index da8a554d550..81b01365764 100644
--- a/src/frontend/mame/ui/videoopt.cpp
+++ b/src/frontend/mame/ui/videoopt.cpp
@@ -152,8 +152,7 @@ void menu_video_options::handle()
m_target.set_orientation(orientation_add(delta, m_target.orientation()));
if (m_target.is_ui_target())
{
- render_container::user_settings settings;
- container().get_user_settings(settings);
+ render_container::user_settings settings = container().get_user_settings();
settings.m_orientation = orientation_add(delta ^ ROT180, settings.m_orientation);
container().set_user_settings(settings);
}
diff --git a/src/mame/drivers/goldnpkr.cpp b/src/mame/drivers/goldnpkr.cpp
index a1f1522eddb..5d62be8fda9 100644
--- a/src/mame/drivers/goldnpkr.cpp
+++ b/src/mame/drivers/goldnpkr.cpp
@@ -959,338 +959,6 @@
************************************************************************************
- DRIVER UPDATES:
-
-
- [2006-09-02]
-
- - Initial release.
-
-
- [2006-09-06]
-
- - Understood the GFX banks:
- - 1 bank (1bpp) for text layer and minor graphics.
- - 1 bank (3bpp) for the undumped cards deck graphics.
-
- - Partially added inputs through 6821 PIAs.
- ("Bitte techniker rufen" error messages. Press 'W' to reset the machine)
-
- - Confirmed the CPU as 6502. (was in doubt due to use of illegal opcodes)
-
-
- [2006-09-15]
-
- - Confirmed the GFX banks (a complete dump appeared!).
- - Improved technical notes and added a PCB layout based on PCB picture.
- - Found and fixed the 3rd bitplane of BigBoy gfx.
- - Renamed Big-Boy to Golden Poker Double Up. (Big-Boy and Mini-Boy are names of cabinet models).
- - Added 'Joker Poker' (Golden Poker version without the 'double-up' feature).
- - Added 'Jack Potten's Poker' (same as Joker Poker, but with 'Aces or better' instead of jacks).
- - Simulated colors for all sets till color PROMs appear.
- - Fixed bit corruption in goldnpkr rom u40_4a.bin.
- - Completed inputs in all sets (except DIP switches).
- - Removed flags MACHINE_WRONG_COLORS and MACHINE_IMPERFECT_GRAPHICS in all sets.
- - Removed flag MACHINE_NOT_WORKING. All sets are now playable. :)
-
-
- [2006-10-09]
-
- - Added service/settings mode to pmpoker.
- - Added PORT_IMPULSE to manage correct timings for most inputs in all games.
- (jokerpkr still trigger more than 1 credit for coin pulse).
-
-
- [2007-02-01]
-
- - Crystal documented via #define.
- - CPU clock derived from #defined crystal value.
- - Replaced simulated colors with proper color prom decode.
- - Renamed "Golden Poker Double Up" to "Golden Poker Double Up (Big Boy)".
- - Added set Golden Poker Double Up (Mini Boy).
- - Cleaned up the driver a bit.
- - Updated technical notes.
-
-
- [2007-05-05]
-
- - Removed all inputs hacks.
- - Connected both PIAs properly.
- - Demuxed all inputs for each game.
- - Documented all outputs.
- - Added lamps support.
- - Created different layout files to cover each game.
- - Add NVRAM support to all games.
- - Corrected the color PROM status for each set.
- - Figured out most of the DIP switches.
- - Added diplocations to goldnpkb.
- - Replaced the remaining IPT_SERVICE with IPT_BUTTON for regular buttons.
- - Updated technical notes.
- - Cleaned up the driver. Now is better organized and documented.
-
-
- [2007-07-07]
-
- - Added set goldnpkc (Golden Poker without the double up feature).
- - Updated technical notes.
-
-
- [2008-10-12] *** REWRITE ***
-
- - Added discrete sound support to Golden Poker hardware games based on schematics.
- - Added discrete sound support to Potten's Poker hardware games based on PCB analysis.
- - Added discrete circuitry diagrams for both hardware types.
- - Adjusted the CPU addressing to 15 bits for pmpoker/goldenpkr hardware.
- - Adjusted the CPU addressing to 14 bits for pottnpkr hardware.
- - Rewrote all the ROM loads based on these changes.
- - Defined MASTER Xtal & CPU clock.
- - Fixed the visible area based on M6845 registers.
- - Improved the lamps layouts to be more realistic.
- - Added Good Luck (potten's poker hybrid running in goldnpkr hardware).
- - Added Buena Suerte (Spanish) x 2 sets.
- - Added set Royale.
- - Added Witch Card and Spanish variants.
- - Added Super Loco 93 (Spanish) x 2 sets.
- - Renamed set goldnpkc to pottnpkr (parent Jack Potten's Poker set).
- - Renamed set jokerpkr to potnpkra, since is another Jack Potten's Poker set.
- - Added other 2 clones of Jack Potten's Poker.
- - Renamed/cleaned all sets based on code/hardware analysis.
- - Added intensity bit to the color system.
- - Implemented the blue killer bit for Witch Card hardware.
- - Implemented the extended graphics addressing bit for Witch Card hardware.
- - Added proper visible area to sloco93.
- - Rewrote the graphics & color decode system based on schematics. No more patched codes.
- - Changed the char gfx bank structure and rom load according to the new routines.
- - Adjusted the amount of color codes and PROM region size accordingly.
- - Updated all notes.
-
-
- [2008-11-29] *** REWRITE (part II) ***
-
- - Changed the driver name to goldnpkr.c (Golden Poker is the most representative hardware).
- - Splitted the PIA interfases to cover witchcrd/pottenpkr connections.
- - Fixed the witchcrd/pottnpkr/sloco93 double up mode.
- - Replaced the pottenpkr layout with goldnpkr one in all Jack Potten's Poker sets.
- - Updated game notes for Witch Card and Super Loco 93 sets.
- - Fixed al inputs & lamps to allow double up mode to the above games.
- - Added Witch Card (Video Klein) but still not working.
- - Added several Buena Suerte! sets.
- - Added new games: Maverik, Brasil 89 & Poker'91.
- - Reworked the sets parent-clone relationship (still in progress).
-
-
- [2008-12-26]
-
- - Correctly setup the MC6845 device for all systems.
- - Added common MC6845 device interface.
- - Merged witchcrd and sloco93 machine drivers.
- - Added/corrected the 50/60 Hz. DIP switches to all games.
- The 50hz mode needs to be corrected. Some games as most bsuerte sets have
- the 50/60 Hz. DIP switch connection patched.
-
-
- [2009-09-05]
-
- - Added 2 new Witch Card sets.
- - Reworked inputs for Witch Card (German set 1).
- - Created new inputs for Witch Card (English, witch game, lamps).
- - Added and connected lamps for both sets.
- - Added minimal bet and 50/60 Hz. switches to both sets.
- - Added DIP switches info for Witch Card (German, set 2).
-
- - Added Genius, running in a modified Golden Poker board.
-
-
- [2010-09-28]
-
- - Added 3 new Witch Card sets.
- - Added 3 new Falcons Wild sets (from 3 different hardwares).
- - Hooked the second CPU (still encrypted) to the Falcon hardware.
- - Partially decrypted the second CPU program from Falcon hardware.
- - Figured out the Falcons Wild (Video Klein) memory map and machine.
- - Defeated the evil Video Klein's Witch Card hardware.
- - Reworked inputs for some sets.
- - Added lamps layouts/connections to the new sets.
- - Figured out the multiplexed data/address from Falcon's boards sound.
- - Added full sound support to Falcon hardware.
- - Reorganized and partially cleaned-up the driver.
- - Added more technical notes.
-
-
- [2010-11-18]
-
- - Added Karateco Super Double (French)
- - Extended ROM space for goldnpkr game to include the 0x2000..0x3fff range
-
-
- [2011-01-20]
-
- - Lots of changes to get working the Video Klein games.
- - Renamed witchcde to witchjol --> Jolly Witch (Export, 6T/12T ver 1.57D).
- - Added Wild Witch (Export, 6T/12T ver 1.74A).
- - New video hardware and machine driver for Video Klein's extended tiles games.
- - Added Dallas DS1210 + battery backed RAM support to the Video Klein CPU boxed games.
- - Improved inputs for Jolli Witch and Wild Witch. Added the game selector switch.
- - Cleaned up some witch card sets.
- - Added technical and game notes.
-
-
- [2011-10-19]
-
- - Mapped the Dallas DS1210 for Video Klein sets that have one.
- - Mapped the 2800-2fff range as RAM for the non-Dallas Video Klein sets.
- - Added Witch Card (Video Klein CPU box, set 2)
- - Added Witch Game (Video Klein, set 2)
- - Some minor fixes.
-
-
- [2012-02-19]
-
- - Added Casino Poker (Ver PM86LO-35-5, German).
- - Inputs from the scratch.
- - Switched manufacturer 'Playman' to PM / Beck Elektronik, since
- it's PM and Beck Elektronik/Computer/etc...
- - Added technical and game notes.
-
-
- [2012-03-12]
-
- - Emulated the Video Klein extended hardware, with Dallas Timekeeper,
- and the insane 16 graphics banks scheme.
- - Added Witch Up & Down (Export, 6T/12T ver 0.99).
- - Added Witch Up & Down (Export, 6T/12T ver 1.02).
- - Switched Wild Witch and Jolli Witch to the extended hardware.
- - Accurate colors.
- - Inputs and lamps from the scratch.
- - Added technical notes.
-
-
- [2012-03-14]
-
- - Fixed and improved the Video Klein extended hardware banking.
- - Added Witch Strike (Export, 6T/12T ver 1.01A).
- - Added Witch Strike (Export, 6T/12T ver 1.01B).
- - Added technical notes.
-
-
- [2012-03-15]
-
- - Found and patched the Witch Strike protection scheme.
- - Proper inputs and lamps support for Witch Strike.
- - Promoted both Witch Strike sets to working state.
- - Added technical notes.
-
-
- [2012-03-17]
-
- - Added Wild Witch (Export, 6T/12T ver 1.57-SP).
- - Added Wild Witch (Export, 6T/12T ver 1.57-TE).
- - Added Wild Witch (Export, 6T/12T ver 1.62A).
- - Added Wild Witch (Export, 6T/12T ver 1.62B).
- - Added Wild Witch (Export, 6T/12T ver 1.62A-F).
- - Added Wild Witch (Export, 6T/12T ver 1.62A alt).
- - Added Wild Witch (Export, 6T/12T ver 1.62B alt).
- - Added Wild Witch (Export, 6T/12T ver 1.65A).
- - Added Wild Witch (Export, 6T/12T ver 1.65A-S).
- - Added Wild Witch (Export, 6T/12T ver 1.65A-S alt).
- - Added Wild Witch (Export, 6T/12T ver 1.65A-N).
- - Added Wild Witch (Export, 6T/12T ver 1.70A beta).
- - Added Wild Witch (Export, 6T/12T ver 1.70A).
- - Added Wild Witch (Export, 6T/12T ver 1.70A alt).
- - Added Wild Witch (Export, 6T/12T ver 1.74A-SP-BELG).
- - Added Wild Witch (Export, 6T/12T ver 1.74A).
- - Added Wild Witch (Export, 6T/12T ver 1.74A alt).
- - Added Wild Witch (Export, 6B/12B ver 1.75A-E English).
- - Added Wild Witch (Export, 6T/12T ver 1.76A).
- - Added Wild Witch (Export, 6T/12T ver 1.77A).
- - Added Wild Witch (Export, 6T/12T ver 1.79A).
- - Added Wild Witch (Export, 6T/12T ver 1.83A).
- - Added Wild Witch (Export, 6T/12T ver 1.84A).
- - Worked each game to temporarily bypass the protection,
- laying in the Dallas Timekeeper RAM.
- - Reworked the parent/clones relationship.
- - Added technical notes.
-
-
- [2012-03-18]
-
- - Added Witch Jackpot (Export, 6T/12T ver 0.25).
- - Added Witch Jack (Export, 6T/12T ver 0.40).
- - Added Witch Jack (Export, 6T/12T ver 0.40T).
- - Added Witch Jack (Export, 6T/12T ver 0.62).
- - Added Witch Jack (Export, 6T/12T ver 0.64).
- - Added Witch Jack (Export, 6T/12T ver 0.65).
- - Added Witch Jack (Export, 6T/12T ver 0.70S).
- - Added Witch Jack (Export, 6T/12T ver 0.70P).
- - Added Witch Jack (Export, 6T/12T ver 0.87).
- - Added Witch Jack (Export, 6T/12T ver 0.87-88).
- - Added Witch Jack (Export, 6T/12T ver 0.87-89).
- - Proper inputs and lamps.
-
-
- [2012-03-19]
-
- - Added Witch Up & Down (Export, 6T/12T ver 0.99, set 2).
- - Added Witch Up & Down (Export, 6T/12T ver 0.99, set 3).
- - Added Witch Up & Down (Export, 6T/12T ver 0.99T).
- - Added Falcons Wild - World Wide Poker (Video Klein, set 2).
- - Fixed a bug in the coinage input.
-
-
- [2013-05-04]
-
- - Added Bonne Chance! (Golden Poker prequel hardware).
- - Inverted the bipolar PROM data to get the proper palette.
- - Added technical notes.
-
- - Added Mundial/Mondial (Italian/French).
- - Implemented the program banking, but set the Italian lang
- as default till we can get some evidence.
- - Added technical notes.
-
-
- [2013-05-18]
-
- - Added 2 Videotron Poker sets...(cards selector and normal controls)
- - Added another Potten's Poker set with Royale cards back graphics.
- - Proper inputs for Videotron Poker selector.
- - Figured out the Royale multiplexer system.
- - Removed the unused Royale driver init.
- - Both Royale sets promoted to working.
- - Added technical notes.
-
-
- [2014-02-23]
-
- - Added a new Videotron set with cards selector.
- - Mundial/Mondial (Italian/French): Implemented the program banking
- properly. Now you can choose the program through a DIP switch.
-
-
- [2015-11-04]
-
- - Added new sets:
- * Genie (ICP-1, set 2).
- * Super 98 (ICP-1).
- * Jack Potten's Poker (set 8, Australian).
-
- - Derived a new machine with improved memory map for this new Genie set.
- - Minor fixes and clean-ups.
- - Added games & technical notes.
-
-
- [2015-11-09]
-
- - Renamed and rearranged the parent/clone relationship
- of Witch Jack sets.
- - Added partial decryption to the ICP1 daughterboard games.
- (currently only pokerduc set). Since it's just partial,
- commented out the code for now....
- - Added port impulse to the Golden Poker's second coin slot.
- This is needed for both royale sets.
- - Some fixes and clean-ups.
-
-
TODO:
- Missing PIA connections.
@@ -6279,7 +5947,7 @@ ROM_END
/* Witch Card (Spanish, set 1)
Unknown argentine manufacturer.
*/
-ROM_START( witchcda )
+ROM_START( witchcrda )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "w_card.256", 0x0000, 0x8000, CRC(63a471f8) SHA1(96a2140e2da0050e7865a6662f707cf024130832) )
@@ -6299,7 +5967,7 @@ ROM_END
/* Witch Card (Spanish, set 2)
Unknown argentine manufacturer.
*/
-ROM_START( witchcdb )
+ROM_START( witchcrdb )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "w_card.128", 0x4000, 0x4000, CRC(11ecac96) SHA1(717709b31f3dfa09be321c14fbf0e95d492ad2f2) )
@@ -6319,7 +5987,7 @@ ROM_END
/* Witch Card (English, no witch game)
Hack?
*/
-ROM_START( witchcdc )
+ROM_START( witchcrdc )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "wc_sbruj.256", 0x0000, 0x8000, CRC(5689ae41) SHA1(c7a624ec881204137489b147ce66cc9a9900650a) )
@@ -6345,7 +6013,7 @@ ROM_END
CASINOVERSION WC3050
***************************************/
-ROM_START( witchcdd )
+ROM_START( witchcrdd )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "12a.bin", 0x0000, 0x8000, CRC(a5c1186a) SHA1(b6c662bf489fbcccc3063ce55c957e630ba96ccb) )
@@ -6366,7 +6034,7 @@ ROM_END
Video Klein original with epoxy block module.
Alt set....
*/
- ROM_START( witchcde )
+ROM_START( witchcrde )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "27128_epoxy.bin", 0x4000, 0x4000, CRC(48186272) SHA1(d211bfa89404a292e6d0f0169ed11e1e74a361d9) ) // epoxy block program ROM
@@ -6396,7 +6064,7 @@ ROM_END
Copyright 1983/84/85
W.BECK ELEKTRONIK
*/
-ROM_START( witchcdf )
+ROM_START( witchcrdf )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "@25.bin", 0x5000, 0x1000, CRC(afd6cb4a) SHA1(4c769e1c724bada5875e028781086c32967953a1) )
ROM_LOAD( "@26.bin", 0x6000, 0x1000, CRC(ad11960c) SHA1(2b562cfe9401e21c9dcd90307165e2c2d1acfc5b) )
@@ -6427,7 +6095,7 @@ ROM_END
AY8910 is present.
*******************************************/
-ROM_START( witchcdg )
+ROM_START( witchcrdg )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "6.b9", 0x5000, 0x1000, CRC(70462a63) SHA1(9dfa18bf7d4e0803f2a68e64661ece392a7983cc) )
ROM_LOAD( "7.b11", 0x6000, 0x1000, CRC(227b3801) SHA1(aebabce01b1abdb42b3e49c38f4fe429e65c1a88) )
@@ -6458,7 +6126,7 @@ ROM_END
CASINOVERSION WC3050
***************************************/
-ROM_START( witchcdh )
+ROM_START( witchcrdh )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "prog3000.a12", 0x0000, 0x8000, CRC(a5c1186a) SHA1(b6c662bf489fbcccc3063ce55c957e630ba96ccb) )
@@ -6507,7 +6175,7 @@ ROM_END
03.a5 [3/4] ce-3-tvg.bin [1/4] 88.378906%
***************************************/
-ROM_START( witchcdi )
+ROM_START( witchcrdi )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "04.a12", 0x0000, 0x8000, CRC(0f662e02) SHA1(71d7344f63c11082beb4fb4eeb20b04780a9b14c) )
@@ -6558,7 +6226,7 @@ ROM_END
Video Klein original with epoxy block module.
Alt set....
*/
- ROM_START( witchcdk )
+ ROM_START( witchgmea )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "wc_epoxy.bin", 0x0000, 0x8000, CRC(33f1acd9) SHA1(2facb3d807b5b2a2978e567d0c1106c0a027621a) ) // epoxy block program ROM
@@ -11346,7 +11014,7 @@ ROM_END
Char ROM is identical to the Witch Card one.
*****************************************************/
-ROM_START( witchcdj )
+ROM_START( witchcrdj )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "c", 0x2000, 0x1000, CRC(b35b4108) SHA1(6504ba55511637334c65e88ee5c60b1503b854b3) )
ROM_LOAD( "d", 0x3000, 0x1000, CRC(c48096ed) SHA1(279ba433369c7dc9cd902a19200e889eea45d115) )
@@ -12254,22 +11922,22 @@ GAMEL( 1990, falcnwlda, falcnwld, wildcard, wildcard, goldnpkr_state, empty_init
GAMEL( 1990, falcnwldb, falcnwld, wildcard, wildcard, goldnpkr_state, empty_init, ROT0, "Video Klein", "Falcons Wild - World Wide Poker (Video Klein, set 2)", 0, layout_goldnpkr )
GAME( 1983, falcnwldc, falcnwld, wildcrdb, wildcard, goldnpkr_state, init_flcnw, ROT0, "Falcon", "Falcons Wild - World Wide Poker (Falcon original)", MACHINE_NOT_WORKING )
-GAME( 1987, super21p, 0, super21p, super21p, goldnpkr_state, empty_init, ROT0, "Public MNG", "Super 21", MACHINE_IMPERFECT_COLORS )
+GAME( 1987, super21p, 0, super21p, super21p, goldnpkr_state, empty_init, ROT0, "Public MNG", "Super 21", MACHINE_IMPERFECT_COLORS )
GAMEL( 1991, witchcrd, 0, witchcrd, witchcrd, goldnpkr_state, init_vkdlsc, ROT0, "Video Klein?", "Witch Card (Video Klein CPU box, set 1)", 0, layout_goldnpkr )
-GAME( 1991, witchcda, witchcrd, witchcrd, witchcda, goldnpkr_state, empty_init, ROT0, "", "Witch Card (Spanish, witch game, set 1)", 0 )
-GAME( 1991, witchcdb, witchcrd, witchcrd, witchcda, goldnpkr_state, empty_init, ROT0, "", "Witch Card (Spanish, witch game, set 2)", 0 )
-GAME( 1991, witchcdc, witchcrd, witchcrd, witchcdc, goldnpkr_state, empty_init, ROT0, "", "Witch Card (English, no witch game)", 0 )
-GAMEL( 1994, witchcdd, witchcrd, witchcrd, witchcdd, goldnpkr_state, empty_init, ROT0, "Proma", "Witch Card (German, WC3050, set 1 )", 0, layout_goldnpkr )
-GAMEL( 1991, witchcde, witchcrd, witchcrd, witchcrd, goldnpkr_state, init_vkdlsc, ROT0, "Video Klein", "Witch Card (Video Klein CPU box, set 2)", 0, layout_goldnpkr )
-GAMEL( 1985, witchcdf, witchcrd, witchcrd, witchcdf, goldnpkr_state, empty_init, ROT0, "PM / Beck Elektronik", "Witch Card (English, witch game, lamps)", 0, layout_goldnpkr )
-GAMEL( 199?, witchcdg, witchcrd, wcfalcon, witchcrd, goldnpkr_state, empty_init, ROT0, "Falcon", "Witch Card (Falcon, enhanced sound)", 0, layout_goldnpkr )
-GAMEL( 1994, witchcdh, witchcrd, witchcrd, witchcdd, goldnpkr_state, empty_init, ROT0, "Proma", "Witch Card (German, WC3050, set 2 )", 0, layout_goldnpkr )
-GAMEL( 1994, witchcdi, witchcrd, witchcrd, witchcdd, goldnpkr_state, empty_init, ROT0, "Proma", "Witch Card (German, WC3050, 27-4-94)", 0, layout_goldnpkr )
-GAME( 199?, witchcdj, witchcrd, witchcdj, witchcrd, goldnpkr_state, init_icp1db, ROT0, "", "Witch Card (ICP-1, encrypted)", 0 )
+GAME( 1991, witchcrda, witchcrd, witchcrd, witchcda, goldnpkr_state, empty_init, ROT0, "", "Witch Card (Spanish, witch game, set 1)", 0 )
+GAME( 1991, witchcrdb, witchcrd, witchcrd, witchcda, goldnpkr_state, empty_init, ROT0, "", "Witch Card (Spanish, witch game, set 2)", 0 )
+GAME( 1991, witchcrdc, witchcrd, witchcrd, witchcdc, goldnpkr_state, empty_init, ROT0, "", "Witch Card (English, no witch game)", 0 )
+GAMEL( 1994, witchcrdd, witchcrd, witchcrd, witchcdd, goldnpkr_state, empty_init, ROT0, "Proma", "Witch Card (German, WC3050, set 1 )", 0, layout_goldnpkr )
+GAMEL( 1991, witchcrde, witchcrd, witchcrd, witchcrd, goldnpkr_state, init_vkdlsc, ROT0, "Video Klein", "Witch Card (Video Klein CPU box, set 2)", 0, layout_goldnpkr )
+GAMEL( 1985, witchcrdf, witchcrd, witchcrd, witchcdf, goldnpkr_state, empty_init, ROT0, "PM / Beck Elektronik", "Witch Card (English, witch game, lamps)", 0, layout_goldnpkr )
+GAMEL( 199?, witchcrdg, witchcrd, wcfalcon, witchcrd, goldnpkr_state, empty_init, ROT0, "Falcon", "Witch Card (Falcon, enhanced sound)", 0, layout_goldnpkr )
+GAMEL( 1994, witchcrdh, witchcrd, witchcrd, witchcdd, goldnpkr_state, empty_init, ROT0, "Proma", "Witch Card (German, WC3050, set 2 )", 0, layout_goldnpkr )
+GAMEL( 1994, witchcrdi, witchcrd, witchcrd, witchcdd, goldnpkr_state, empty_init, ROT0, "Proma", "Witch Card (German, WC3050, 27-4-94)", 0, layout_goldnpkr )
+GAME( 199?, witchcrdj, witchcrd, witchcdj, witchcrd, goldnpkr_state, init_icp1db, ROT0, "", "Witch Card (ICP-1, encrypted)", 0 )
GAMEL( 1991, witchgme, 0, witchcrd, witchcrd, goldnpkr_state, empty_init, ROT0, "Video Klein", "Witch Game (Video Klein, set 1)", 0, layout_goldnpkr )
-GAMEL( 1997, witchcdk, witchgme, witchcrd, witchcrd, goldnpkr_state, empty_init, ROT0, "Video Klein", "Witch Game (Video Klein, set 2)", MACHINE_NOT_WORKING, layout_goldnpkr )
+GAMEL( 1997, witchgmea, witchgme, witchcrd, witchcrd, goldnpkr_state, empty_init, ROT0, "Video Klein", "Witch Game (Video Klein, set 2)", MACHINE_NOT_WORKING, layout_goldnpkr )
GAME( 199?, jokercar, witchcrd, witchcrd, witchcda, goldnpkr_state, empty_init, ROT0, "", "Joker Card (witch game)", 0 )
diff --git a/src/mame/layout/upndown.lay b/src/mame/layout/upndown.lay
index dd975281636..2510eb944e5 100644
--- a/src/mame/layout/upndown.lay
+++ b/src/mame/layout/upndown.lay
@@ -73,32 +73,32 @@ license:CC0
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/src/mame/mame.lst b/src/mame/mame.lst
index 94b69b93ac1..178c67349a7 100644
--- a/src/mame/mame.lst
+++ b/src/mame/mame.lst
@@ -15208,19 +15208,19 @@ superdbl // 198? Karateco
videtrna // Unknown
videtron // Unknown
videtron2 // Unknown
-witchcda // 1991, Unknown
-witchcdb // 1991, Unknown
-witchcdc // 1991, Unknown
-witchcdd // (c) 1994, TV Game Elektronik - Proma
-witchcde // (c) 1991, Video Klein
-witchcdf // (c) 1991, PlayMan
-witchcdg // (c) 199?, Falcon
-witchcdh // (c) 1994, TV Game Elektronik - Proma
-witchcdi // (c) 1994, TV Game Elektronik - Proma
-witchcdj // 199?, Unknown
-witchcdk // (c) 1991, Video Klein
witchcrd // (c) 1991, Video Klein
-witchgme // (c) 1991 Video Klein
+witchcrda // 1991, Unknown
+witchcrdb // 1991, Unknown
+witchcrdc // 1991, Unknown
+witchcrdd // (c) 1994, TV Game Elektronik - Proma
+witchcrde // (c) 1991, Video Klein
+witchcrdf // (c) 1991, PlayMan
+witchcrdg // (c) 199?, Falcon
+witchcrdh // (c) 1994, TV Game Elektronik - Proma
+witchcrdi // (c) 1994, TV Game Elektronik - Proma
+witchcrdj // 199?, Unknown
+witchgme // (c) 1991, Video Klein
+witchgmea // (c) 1991, Video Klein
witchjol // 1994, Unknown
wldwitch // (c) 1992-2001, Video Klein
wldwitcha // (c) 1992-2001, Video Klein
diff --git a/src/mame/tiny.lst b/src/mame/tiny.lst
index 80d6de1e6b0..51014c2aff6 100644
--- a/src/mame/tiny.lst
+++ b/src/mame/tiny.lst
@@ -36,4 +36,38 @@ topgunnr // (c) 1986
looping // (c) 1982 Video Games GMBH
supertnk // (c) 1981 VIDEO GAMES GmbH, W.-GERMANY
+witchgme // (c) 1991 Video Klein
+witchjol // (c) 1994 Video Klein
+wldwitch // (c) 2001 Video Klein
+wldwitcha // (c) 1992 Video Klein
+wldwitchc // (c) 1994 Video Klein
+wldwitchd // (c) 1994 Video Klein
+wldwitchf // (c) 1994 Video Klein
+wldwitchg // (c) 1994 Video Klein
+wldwitchh // (c) 1995 Video Klein
+wldwitchi // (c) 1996 Video Klein
+wldwitchj // (c) 1996 Video Klein
+wldwitchk // (c) 1996 Video Klein
+wldwitchl // (c) 1996 Video Klein
+wldwitchm // (c) 1996 Video Klein
+wldwitchn // (c) 1997 Video Klein
+wldwitcho // (c) 1998 Video Klein
+wldwitchp // (c) 1998 Video Klein
+wldwitchq // (c) 1998 Video Klein
+wldwitchr // (c) 1999 Video Klein
+wldwitchs // (c) 1999 Video Klein
+wldwitcht // (c) 1999 Video Klein
+wldwitchu // (c) 2000 Video Klein
+wldwitchv // (c) 2001 Video Klein
+wupndown // (c) 1998 Video Klein
+wupndowna // (c) 1998 Video Klein
+wupndownb // (c) 1998 Video Klein
+wupndownc // (c) 1998 Video Klein
+wupndownd // (c) 1998 Video Klein
+wstrike // (c) 1992 Video Klein
+wstrikea // (c) 1992 Video Klein
+wtchjack // (c) 1996 Video Klein
+wtchjacka // (c) 1996 Video Klein
+wtchjackb // (c) 1996 Video Klein
+
wrally // (c) 1993 - Ref 930705
diff --git a/src/osd/modules/render/drawogl.cpp b/src/osd/modules/render/drawogl.cpp
index 6d3eae1e8ad..6b495dae3bb 100644
--- a/src/osd/modules/render/drawogl.cpp
+++ b/src/osd/modules/render/drawogl.cpp
@@ -2649,8 +2649,7 @@ void renderer_ogl::texture_shader_update(ogl_texture_info *texture, render_conta
if (container!=nullptr)
{
- render_container::user_settings settings;
- container->get_user_settings(settings);
+ render_container::user_settings settings = container->get_user_settings();
/* FIXME: the code below is in just for illustration issue on
* how to set shader variables. gamma, contrast and brightness are
* handled already by the core