Commit Graph

36 Commits

Author SHA1 Message Date
hap
8b530b872d rendlay: remove led8seg_gts1 2022-02-26 18:40:59 +01:00
Vas Crabb
e539b09943 Re-enabled some compiler warnings and cleaned up some Python scripts a little. 2022-02-24 16:35:13 +11:00
Vas Crabb
5afce6cfab emu/render.cpp, emu/rendlay.cpp: Added scroll support for all elements. 2021-11-18 10:34:38 +11:00
Vas Crabb
38082ccbee
Overdue internal UI enhancements (#8674)
* frontend: Added support for message context to localisations.
* frontend: Added string_view versions of the message lookup functions.
* frontend: Added a few more folder options to the internal UI.
* emu/softlist.cpp: Use more appropriate containers.
* Switched to Python 3 by default - this will become a requirement.
* Updated msgfmt.py for message context support.
* frontend: Show all software item info in the internal UI.
* frontend: Search alternate titles in software selection menu.
* 3rdparty/utf8proc: Updated to v2.6.1 (has several fixes).
* frontend: Added software filters for common info fields.
* frontend: Allow UI manager to hold onto persistent session data.
* frontend: Cache software lists for eight machines.
* frontend: Added support for loading localised system names.
* frontend: Add UI for selecting localised system names.
2021-10-09 12:16:17 +11:00
Vas Crabb
ec80428647 Fairly significant overhaul of Lua engine and some cleanup.
The things that were previously called device iterators are not
iterators in the C++ sense of the word.  This is confusing for
newcomers.  These have been renamed to be device enumerators.

Several Lua methods and properties that previously returned tables now
return lightweight wrappers for the underlying objects.  This means
creating them is a lot faster, but you can't modify them, and the
performance characteristics of different operations varies.

The render manager's target list uses 1-based indexing to be more like
idiomatic Lua.

It's now possible to create a device enumerator on any device, and then
get subdevices (or sibling devices) using a relative tag.

Much more render/layout functionality has been exposed to Lua.  Layout
scripts now have access to the layout file and can directly set the
state of an item with no bindings, or register callbacks to obtain
state.  Some things that were previously methods are now read-only
properties.

Layout files are no longer required to supply a "name".  This was
problematic because the same layout file could be loaded for multiple
instances of the same device, and each instance of the layout file
should use the correct inputs (and in the future outputs) for the device
instance it's associated with.

This should also fix video output with MSVC builds by avoiding delegates
that return things that don't fit in a register.
2020-11-25 19:18:26 +11:00
Vas Crabb
740011e4d1 Allow layout files to embed image data.
Also improved symmetry of disk components, fixed positioning of
components when fitting to the pixel grid, and fixed inherited color
when item has no color specified.

Removed the dotmatrix components from complay.py - there are more
flexible ways to achieve the same thing.
2020-10-09 02:52:49 +11:00
Vas Crabb
b90fd35515 Various improvements to image file handling:
Moved MS DIB parser out of ICO file reader and made it available for
artwork and layout images.

Added more efficient I/O and better error checking for JPEG file loading
(MAME will no longer exit immediately on a bad JPEG file).

Made caller responsible for opening files for loading images, to avoid
decompressing images used in ZIP/7z artwork multiple times.

Added support for JPEG and Windows DIB to picture_image_device.

Added support for SVG image files in external artwork.

Added support for using I/O port value for animation state and masking
animation state values.

Made bounds elements more flexible in layouts.

Reworked headers to reduce dependencies.

Updated layout file format documentation.
2020-10-08 02:04:31 +11:00
Vas Crabb
0c8938f584 -emu/rendlay.cpp: Allow item animation.
-cgang.cpp: Make internal artwork more fun.
2020-10-05 00:18:33 +11:00
Vas Crabb
6adc508015 emu/rendlay.cpp: Added parameter animation and state masks.
Components may have multiple bounds and/or color child elements with
state attributes, allowing for piecewise linear position/size/colour
animation.

Components may have a statemask attribute, allowing for things like
using external images to draw a multi-segment LED/VFD display without
requiring dozens of outputs for the individual lines or thousands of
images for all possible states.  (Texture caching still never releases
anything, so MAME can still exceed the maximum number of textures, but
that’s a separate issue.)

Image components with alpha now blend over previously drawn components.

Layouts have been changed to use yes/no for inputraw to match what's
used for flipx/flipy.  External layouts with 1/0 will still work, but
complay.py will complain.
2020-09-16 02:55:04 +10:00
Vas Crabb
b68c48f5f8 Remove last remaining uses of <background> elements in layouts, and print warning messages on encountering deprecated elements. 2020-09-10 05:23:47 +10:00
Vas Crabb
b2158bd6ed -Eliminate remaining <bezel> elements from internal layouts.
These layouts have changes to element stacking order that can't be
avoided without changing the group structure in the layout files.  I
think it's harmless, but it's possible it could have had a detrimental
effect on risc2500 (I tested it and didn't see any changes, but I might
not have known what to look for).

-complay.py: Added basic checks for dupicate collection names.

As with other checks of this kind, it doesn't actually instantiate the
layout so it doesn't check things when variable substitution is
involved.
2020-09-09 21:29:45 +10:00
Vas Crabb
67ec5e5b43 Finished adding new mechanism for allowing parts of views to be hidden.
Changed name of element to "collection" and initial visibility attribute
to "visible", and added them to documentation.  Also added them to
complay.py.

Fixed issue with collection inside group, and improved initial view
selection behaviour.

Updated some internal layouts to demonstrate new features, including
et3400, irrmaze, ltcasino, mekd3/mekd4, seawolf and vgmplay.

Removed all uses of cpanel, marquee and overlay from internal layouts
and removed them from complay.py to actively discourage use.  Also
cleaned up view names in layouts that were using them in place of
spaces, and removed some superfluous name attributes on elements that
won't do anything useful with an output value anyway.

Made vgmplay cycle visualiser modes when visualiser screen is clicked.

Fixed a copy/paste error in bus/rs232/hlemouse.cpp while I'm at it.
2020-09-07 01:40:41 +10:00
Vas Crabb
bdd2a33776 compile in the contents of the COPYING file for the about box - safer than assuming it will be in the working directory. no attempt at compressing it for now (nw) 2020-03-22 00:03:07 +11:00
Vas Crabb
6f4c1f6e5b Spring cleaning:
* Changed emu_fatalerror to use util::string_format semantics
* Fixed some incorrectly marked up stuff in build scripts
* Make internal layout compression type a scoped enum (only zlib is supported still, but at least the values aren't magic numbers now)
* Fixed memory leaks in Xbox USB
* There can only be one "perfect quantum" device - enforce that only the root machine can set it, as allowing subdevices to will cause weird issues with slot cards overiding it
* Allow multiple devices to set maximum quantum and use the most restrictive one (it's maximum quantum, it would be minimum interleave)
* Got rid of device_slot_card_interface as it wasn't providing value
* Added a helper template to reduce certain kinds of boilerplate in slots/buses
* Cleaned up some particularly bad slot code (plenty more of that to do), and made some slots more idiomatic
2019-11-01 00:47:41 +11:00
hap
6a857daed7 complay: allow inputmask=0 when inputraw=1 for canceling input listener section (nw) 2019-08-24 12:19:57 +02:00
Vas Crabb
c38a3395e9 Make layout format more flexible:
* There is no longer a concept of "layers" - there are only screens and elements.
* Elements are now instantiated with <element ref="...">
* Screens and elements can have explicit blending mode specified with blend="..."
* Default blending mode for screens is "add" and default for other elements is "alpha"
* Other supported modes are "none" and "multiply"
* This removes the options to enable/disable layers individually - use views instead
* Legacy layouts can still be loaded, and support won't be removed for at least a year

The current artwork model is over-stretched.  It's based on a Space
Invaders cabinet model, and isn't applicable to a lot of the systems
MAME emulates now.  The fact that MAME has to switch to an "alternate"
mode to deal with games like Golly! Ghost! without requiring pre-matted
bitmaps shows that the Space Invaders model wasn't even adequate for
general arcade use.  It shows in that for a lot of the systems that
heavily depend on artwork, people just seem to randomly choose layers
for elements until they get something that works.  Also, the fact that
MAME will switch to an alternate (Golly! Ghost!) mode depending on the
combination of elements is a trap for people learning to make artwork.

There are cases that the current approach of implying the blending mode
from the layer doesn't work with.  Examples include LEDs behind
diffusers (requires additive blending for layout elements), and mutliple
stacked LCD panels (requires RGB multiplication for screens).

For configurability, it's now a lot easier to make multiple views using
groups.  For example, if you want to make it possible to hide the
control panel section of your layout, you can put the control panel
elements in a group and create views with and without it.

I will gradually migrate the internal artwork to use the new approach.
I have an XSLT stylesheet that helps with this, but I'm not comfortable
adding it because it isn't a complete solution and it still requires
manul steps.

I wanted to get the re-worked pointer handling done sooner so I could
push them both at the same time, but unfortunately various things have
prevented me from progressing as quickly as I wanted to.  Sorry guys,
that stuff's going to have to wait.
2019-07-06 00:23:20 +10:00
Vas Crabb
97b6717027 (nw) Clean up the mess on master
This effectively reverts b380514764 and
c24473ddff, restoring the state at
598cd52272.

Before pushing, please check that what you're about to push is sane.
Check your local commit log and ensure there isn't anything out-of-place
before pushing to mainline.  When things like this happen, it wastes
everyone's time.  I really don't need this in a week when real work™ is
busting my balls and I'm behind where I want to be with preparing for
MAME release.
2019-03-26 11:13:37 +11:00
andreasnaive
b380514764 Revert "conflict resolution (nw)"
This reverts commit c24473ddff, reversing
changes made to 009cba4fb8.
2019-03-25 23:13:40 +01:00
hap
465f5d42aa complay: spaces instead of tabs for indentation? (nw) 2019-03-24 22:48:13 +01:00
hap
5ec1befa63 complay: add inputraw (nw) 2019-03-24 22:43:46 +01:00
Vas Crabb
6ea9ff9042 (nw) Further layout work:
* Allow <orientation> and <color> to work on group references
* Fix some corner cases where group bounds could be miscalculated
* Fix a corner case where MAME could incorrectly refuse to instantiate groups
* Add more checks to complay.py
* Document more of the layout format
2018-08-02 23:11:17 +10:00
Vas Crabb
0ce07a8a1e (nw) more render work:
* Clean up some corner cases in layouts with repeating blocks
* Make complay.py validate many more elements and attributes
* Make complay.py easier to use for just validating a layout
* Remove redundant view from Sega VMU layout
* Make buttons visually respond to input in whousetc.lay
* Add view with LED displays as well as terminal for aim65_40 and use repeats
* Clean up some outdated "game" terminology in clifront.cpp
* Initiaise a couple of members in tap/tun network module
* Start documenting layout format
2018-07-31 04:18:28 +10:00
Vas Crabb
6669489679 allow repeating elements and groups - useful if you need e.g. a lot of numbered labels, but it limits complay.py's ability to check for invalid references as it can't evaluate expressions (nw) 2018-07-22 09:52:50 +10:00
Vas Crabb
dce955c68d rendlay: allow user variables and repetition in layouts, also add a few more predefined variables 2018-07-22 03:22:31 +10:00
Vas Crabb
f18c7cd65f Allow per-device internal layouts and remove some more MCFG_ macros.
Input and screen tags are now resolved relative to a layout's owner
device.

Easy way to demonstrate is with: mame64 intlc440 -tty ie15

Previously you'd only get the IE15 terminal's layout and you'd be unable
to use the INTELLEC 4/40 front panel.  Now you'll get the choice of
layouts from both the system and the terminal device in video options.
2018-07-16 16:26:01 +10:00
Vas Crabb
82c6d7dbc5 Allow layouts to specify screen tags rather than indices - makes order of instantiation irrelevant in Model 1 etc. 2018-07-10 04:26:57 +10:00
Vas Crabb
3a5c5d15c7 Add support for layout item groups, replace simple_list with more
appropriate containers, remove misleading const qualifiers, reduce
repeated XML walking.

(nw) Groups aren't parameterised, so they aren't as useful as they could
be (yes, it's on my TODO list).  However, it's already useful for
putting a common set of elements in multiple views, potentially at
different locations/scales.  See intlc44.lay and intlc440.lay for
examples of the level of copypasta this can eliminate.  Be aware that
groups with explicit bounds don't clip thair content, it's only used for
calucating the transform matrix.
2017-07-29 15:17:14 +10:00
Vas Crabb
3353592d00 remove vestigial exception class (nw) 2017-07-11 03:00:24 +10:00
Vas Crabb
9ed831e0a6 (nw) notes, coverity complaints, INTELLEC 4/MOD 4 layout, detect duplicate bounds/color in layouts 2017-07-09 01:50:54 +10:00
Vas Crabb
1eb3ffe15c work around python version differences (nw) 2017-07-09 00:12:58 +10:00
Vas Crabb
d97c4f9d9f Do substantial validation of internal layouts at build time 2017-07-08 18:30:43 +10:00
Vas Crabb
19621e2156 python why are you incompatible (nw) 2016-11-23 07:53:30 +11:00
Vas Crabb
5eefcfdb68 Rewrite complay.py to parse/minify layout XML
Doesn't make much difference to executable size, but it catches XML errors at build time rather than waiting for you to try the system (nw)
2016-11-20 20:54:10 +11:00
Miodrag Milanovic
ddb290d5f6 NOTICE (TYPE NAME CONSOLIDATION)
Use standard uint64_t, uint32_t, uint16_t or uint8_t instead of UINT64, UINT32, UINT16 or UINT8
also use standard int64_t, int32_t, int16_t or int8_t instead of INT64, INT32, INT16 or INT8
2016-10-22 13:13:17 +02:00
Mike Naberezny
b4408c2906 complay.py: Python 3 compat. (nw) 2016-03-30 21:06:12 -07:00
Miodrag Milanovic
9353a1ccb3 Compressed internal layouts [David Haywood] 2016-03-30 20:40:05 +02:00