summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/rendlay.cpp
Commit message (Collapse)AuthorAgeFilesLines
* rendlay: fix accumulated rounding error when drawing text hap2023-02-271-10/+10
|
* Various input and OSD refactoring: Vas Crabb2023-01-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | osd: Supply OSD object to modules on initialisation. Encapsulated some event handling in the OSD objects rather than leaving it in free functions. Put various stuff in namespaces. osd/modules/input: Enabled dinput, xinput and winhybrid modules for Windows SDL builds, and enabled background input for dinput and xinput (and by extension winhybrid) modules. Also fixed some COM and X11 resource leaks. osd/modules/input/input_sdl.cpp: Flipped SDL mouse button order to match Windows, and exposed vertical and horizontal scroll as Z and rZ axes. Moved SDL UI event handling out of input devices into OSD object. osd/modules/input_rawinput.cpp: Changed lightgun Z axis token so it's correctly identified as a relative axis (it maps to the scroll wheel equivalent). osd: Added an option to choose the network provider module. Mostly useful if you build with both TUN/TAP and pcap support included, or if you want to disable emulated networking completely. emu/input.cpp: Use a better strategy for assembling input code names that uses fewer temporary strings and doesn't require use of the non-Unicode-aware space trimming function (fixes MT08552). osd/modules/input_dinput.cpp: Improved polling logic. osd: Made various parts of the input code less dependent on concrete emu objects, and reduced inappropriately passing around the machine object. Made input modules less dependent on OSD implementation. Encapsulated some stuff and got rid of some vestigial newui and SDL1 support code. Cleaned up some interfaces. Moved OSD options classes to their own files. Prepare to remove main.h from emu.h - it's mostly used to get the application name, which the vast majority of emulated devices don't need to do.
* emu/rendlay.cpp: Fixed locale-sensitive number handling (fixes MT08521). Vas Crabb2022-11-291-2/+8
|
* Clean up whitespace with srcclean Vas Crabb2022-07-241-2/+2
|
* current mpu4 work + sorting (including progress to make m4andybt display ↵ David Haywood2022-07-041-2/+5
| | | | | | | | | correctly with existing layout) (#10015) * current mpu4 work + sorting (including progress to make m4andybt display correctly with existing layout) * do the invert in the layout instead for 7segs * fixes led extender strobes, allows output to be inverted
* bus/nubus: More Mac video card improvements. Vas Crabb2022-06-241-0/+3
| | | | | | | | | | | | | | | | Started implementing the Macintosh Display Card CRTC. It gives correct resolutions, although refresh rates are incorrect. Added machine configuration settings allowing several monitors to be selected. Implemented the Macintosh Display Card's packed RGB mode. The base/stride in RGB mode make more sense with this implemented. Cleaned up the code for the SuperMac Spectrum cards, and fixed the garbage at the bottom of the screen on the Spectrum/8. Put a layout with views for common monitor aspect ratios in a place where cards can use it. This is especially useful for the NuBus cards that can support portrait monitors.
* rendlay: fix possible color overflow on disk element hap2022-02-281-7/+7
|
* rendlay: remove led8seg_gts1 hap2022-02-261-69/+0
|
* Revert "rendlay: add optional alpha attribute to digit elements" hap2022-02-261-41/+11
| | | | This reverts commit d196d072ff54277a7c3ad0c5048f8fdc6b7e18c8.
* rendlay: add optional alpha attribute to digit elements hap2022-02-251-11/+41
|
* Remove fileio.h from emu.h AJR2022-02-111-0/+1
|
* A little more refactoring, and Coverity fixes: Vas Crabb2021-11-251-56/+2
| | | | | | | | | | * emu/ioport.h: Marked PORT_RESET deprecated. * emu/rendlay.cpp: Removed old dot matrix components. * emu/rendlay.cpp: Added warning message for reel components. * Changed a few more fruit machines to eliminate reel components; also made the reel lamps simpler and more efficient in these layouts. * emu, frontend: Fixed various errors reported by Coverity, one of which actaully breaks stuff.
* emu/render.cpp, emu/rendlay.cpp: Added scroll support for all elements. Vas Crabb2021-11-181-136/+411
|
* util: Further API cleanups: (#8661) Vas Crabb2021-10-051-6/+13
| | | | | * Turned `core_file` into an implementation of `random_read_write`. * Turned PNG errors into a standard error category. * Added a helper for generating what look like derived classes on-the-fly.
* -delegates: Fixed structure return with MSVC C++ ABI. Vas Crabb2021-09-211-4/+4
| | | | | | | | | | | | * Automatically use delegate_mfp_compatible to generate an adaptor for member functions that return non-scalar, non-reference types (partially addresses #8597). * Enabled the MSVC delegate implemenation for MSVC on AArch64. * Switched back to neater delegate types for layout item bounds and colour. -docs: Updated the example layout links to point to 0.235 - this means there's now an example of embedded SVG.
* formats, osd, util: Started refactoring file I/O stuff. (#8456) Vas Crabb2021-08-221-22/+19
| | | | | | | | | Added more modern generic I/O interfaces with implementation backed by stdio, osd_file and core_file, replacing io_generic. Also replaced core_file's build-in zlib compression with a filter. unzip.cpp, un7z.cpp: Added option to supply abstract I/O interface rather than filename. Converted osd_file, core_file, archive_file, chd_file and device_image_interface to use std::error_condition rather than their own error enums. Allow mounting TI-99 RPK from inside archives.
* API cleanups and miscellaneous fixes. Vas Crabb2021-07-151-1/+1
| | | | | | | | | | | | | | | | emu/ioport.cpp: Allow controller files to override input sequences for inputs that don't use defaults, and to override the toggle setting for digital inputs. emu/config.cpp: Expose configuration level (mostly matters for controller files), improved verbose diagnostic messages, and moved a few things out of the global and preprocessor namespaces. docs: Added documentation for some controller configuration file features. The device mapping feature documentation will be merged in at some point. util/unicode.cpp, emu/input.cpp: API cleanups.
* rendlay.cpp: Fix assertion failure with -D_GLIBCXX_ASSERTIONS AJR2021-06-131-1/+3
|
* rendlay.cpp: Increased precision of ellipse calculations. Vas Crabb2021-02-171-128/+162
| | | | | Also optimised drawing fully covered ellipse pixels and added a few comments.
* Much more core std::string_view modernization AJR2021-01-201-2/+12
| | | | | | | | | | | | | | | - Remove corestr.h from emu.h; update a few source files to not use it at all - Change strtrimspace, strtrimrightspace and core_filename_extract_* to be pure functions taking a std::string_view by value and returning the same type - Change strmakeupper and strmakelower to be pure functions taking a std::string_view and constructing a std::string - Remove the string-modifying version of zippath_parent - Change tag-based lookup functions in device_t to take std::string_view instead of const std::string & or const char * - Remove the subdevice tag cache from device_t (since device finders are now recommended) and replace it with a map covering directly owned subdevices only - Move the working directory setup method out of device_image_interface (only the UI seems to actually use the full version of this) - Change output_manager to use std::string_view for output name arguments - Change core_options to accept std::string_view for most name and value arguments (return values are still C strings for now) - Change miscellaneous other functions to accept std::string_view arguments - Remove a few string accessor macros from romload.h - Remove many unnecessary c_str() calls from logging/error messages
* render.h, rendlay.h: Dependency refactoring AJR2021-01-041-2/+4
| | | | | - render.h: Split out layout class declarations into rendlay.h, with some adjustments for the resulting incomplete types (std::reference_wrapper unfortunately does not allow these by C++17 rules) - rendlay.h: Move old header contents to layout/generic.h
* Low-level #include overhaul AJR2021-01-021-7/+7
| | | | | | | - vecstream.h: Revert changes made in aa29519528cb3dbdbfac56819bea670ed8c56c5d. The std::string_view conversion has been made a non-member function (util::buf_to_string_view) and moved to coretmpl.h. - strformat.h: Remove the using declaration importing util::string_format into the global namespace. It has been moved to emucore.h and a few tool sources; other references have been qualified. - osdcore.h: Split out file, directory and path classes and methods to a new header (osdfile.h), Doxygenizing the documentation comments. - Disaggregate many #includes that were including other standard or custom headers. emu.h now includes basically the same things that it did, but other headers have been streamlined; for instance, emucore.h no longer stealth-includes osdcore.h several ways.
* Further additions of std::string_view AJR2021-01-011-162/+145
| | | | | | | - corefile.cpp, fileio.cpp: Change puts to take a std::string_view parameter - rendlay.cpp: Use std::string_view instead of bare pointers in various functions - vecstream.h: Add std::string_view conversion operator to obtain output buffer without needing to make it a C string with explicit null termination - xmlfile.cpp: Add get_attribute_string_ptr method that distinguishes between empty strings and absent attributes without falling back to C strings
* unicode.h: Updates AJR2020-12-151-3/+4
| | | | | - Remove from emu.h (except for UTF8_xxx macros, which have been transplanted to emucore.h since a lot of drivers use them) and osdepend.h - Add std::string_view overrides for uchar_from_utf8 and normalize_unicode
* -luaengine.cpp: Clean up render classes and expose screen image adjustments. Vas Crabb2020-12-131-3/+6
| | | | | | | | | | | | | | | | | | | | | * Started moving Lua class reference to docs. Expecting people to find the class reference material in the source isn’t going to help make it approachable. The docs allow longer explanations, better formatting, and cross reference links. * Added another layout scripting example to the docs. -goldnpkr.cpp: Minor clean-up. * Improved the short names for Witch Card and Witch Game clone sets. * Made Witch Up & Down artwork clickable. * Added working Video Klein sets where the parent is a working Video Klein set to the tiny subtarget. * Removed history from the header comment - we have version control for a readon.
* C++17 string handling updates (without charconv so as not to break GCC 7) AJR2020-12-081-30/+19
| | | | | | - render.cpp, rendlay.cpp, ui/ui.cpp, ui/menu.cpp: Change argument types for text processing functions from const char * to std::string_view - ui/menu.cpp: Add overloads of item_append omitting the frequently empty subtext argument - cheat.cpp: Remove some c_str() calls that became unnecessary a while ago
* Expose enough of the layout system to Lua to allow position and colour to be ↵ Vas Crabb2020-12-051-0/+41
| | | | animated.
* Fairly significant overhaul of Lua engine and some cleanup. Vas Crabb2020-11-251-70/+222
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Remove some deprecated instantiations of static constexpr members (MSVC ↵ Vas Crabb2020-11-151-3/+4
| | | | complains about them now)
* -Switch to building MAME as C++17. Vas Crabb2020-11-151-3/+3
| | | | | | | * Updated sol2 to 3.2.2 * Updated pugixml to 1.10 * Increased minimum clang version to 6 * Cleaned up some stuff that can use new features
* rendlay.cpp: Set initial value for bounds callback, it can be called before ↵ Vas Crabb2020-11-131-0/+4
| | | | tags are resolved.
* -emu/devfind: More cleanup/consistency changes. Vas Crabb2020-11-131-70/+124
| | | | | | | | | | | * Removed .mask(), as it’s not reliable in the general case. * Added asserts to things that assume power-of-two sizes. * Got rid of virtual qualifier on pointer-to-member operator. * Made helpers a bit more assertive about logging warnings. -emu/rendlay.cpp: Use delegates to avoid hot conditional branches. -docs: Finished off description of object finders and output finders.
* emu/rendlay.cpp: Fixed one more place where disk drawing had error ↵ Vas Crabb2020-10-191-5/+6
| | | | accumulation issues.
* -emu/rendlay.cpp: Avoid another issue with floating point error accumulation ↵ Vas Crabb2020-10-191-21/+26
| | | | | | when drawing disk components. -fidel_dames.cpp: Draw buttons as single elements - improves appearance at small sizes.
* -3rdparty/expat: Update to 2.2.10." Vas Crabb2020-10-151-1/+1
| | | | -Fixed tiny build (missing s11c_bg_device) and unused lambda capture in emu/rendlay.cpp.
* emu/rendlay.cpp: Work around error accumulation issue that could cause hang ↵ Vas Crabb2020-10-141-5/+5
| | | | with x87 floating-point.
* -render.cpp: Fixed issue causing elements to be clipped on bottom/right. Vas Crabb2020-10-141-79/+64
| | | | | | -rendlay.cpp: Tidied up and optimised ellipse drawing code a little. -Reduced space between LEDs on several systems with matrix displays.
* emu/rendlay.cpp: Got rid of an unused capture that upsets clang. Vas Crabb2020-10-141-1/+1
|
* emu/rendlay.cpp: Fix accumulation error causing black pixels on certain ↵ Vas Crabb2020-10-141-14/+16
| | | | transparent colours.
* emu/rendlay.cpp: Draw disk components with area-based anti-aliasing. Vas Crabb2020-10-141-70/+312
| | | | | Also fixed alpha blending within an element for rect and disk components.
* -emu/render.cpp: Load from all external artwork paths. Vas Crabb2020-10-131-169/+170
| | | | | | -emu/rendlay.cpp: Made real component drawing code a bit less gross. -emu/debugcon.cpp: Less screaming now that things aren't macros.
* Allow layout files to embed image data. Vas Crabb2020-10-091-54/+145
| | | | | | | | | 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.
* Various improvements to image file handling: Vas Crabb2020-10-081-102/+346
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* -emu/rendlay.cpp: Allow item animation. Vas Crabb2020-10-051-172/+302
| | | | -cgang.cpp: Make internal artwork more fun.
* emu/rendlay.cpp: Pre-load image components when changing video options. Vas Crabb2020-10-031-24/+85
|
* emu/render.cpp: Consider that screens can be hidden when choosing a default ↵ Vas Crabb2020-10-031-1/+12
| | | | view.
* Got rid of global_alloc/global_free. Vas Crabb2020-10-031-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | The global_alloc/global_free functions have outlived their usefulness. They don't allow consistently overriding the default memory allocation behaviour because they aren't used consistently, and we don't have standard library allocator wrappers for them that we'd need to use them consistently with all the standard library containers we're using. If you need to change the default allocator behaviour, you can override the new/delete operators, and there are ways to get more fine-grained control that way. We're already doing that to pre-fill memory in debug builds. Code was already starting to depend on global_alloc/global_free wrapping new/delete. For example some parts of the code (including the UI and Windows debugger) was putting the result of global_alloc in a std::unique_ptr wrappers without custom deleters, and the SPU sound device was assuming it could use global_free to release memory allocated with operator new. There was also code misunderstanding the behaviour of global_alloc, for example the GROM port cartridge code was checking for nullptr when a failure will actually throw std::bad_alloc. As well as substituting new/delete, I've made several things use smart pointers to reduce the chance of leaks, and fixed a couple of leaks, too.
* Cleaned up bitmap API. Vas Crabb2020-09-271-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Made const-qualified pixel accessors (pix, pixt, raw_pixptr) return const-qualified references/pointers to pixesl, and added non-const versions. This makes bitmap more like standard library containers where const protects the content as well as the dimensions. Made the templated pixt accessor protected - having it public makes it too easy to inadvertently get a pointer to the wrong location. Removed the pix(8|16|32|64) accessors from the specific bitmaps. You could only use the "correct" one anyway, and having the "incorrect" ones available prevented explicit instantiations of the class template because the static assertions would fail. You can still see the pixel type in the bitmap class names, and you can't assign the result of &pix(y, x) to the wrong kind of pointer without a cast. Added fill member functions to the specific bitmap template, and added a explicit instantiations. This allows the bitmap size check to be skipped on most bitmap fills, although the clipping check is still there. Also fixed a couple of places that were trying to fill an indexed 16-bit bitmap with rgb_t::black() exposed by this (replaced with zero to get the same net effect). The explicit template instantiations in the .cpp file mean the compiler can inline the function if necessary, but don't need to generate a local out-of-line body if it chooses not to. Extended the size of the fill value parameter in the base bitmap class to 64 bits so it works correctly for 64-bit bitmaps. Fixed places where IE15 and VGM visualiser weren't accounting for row bytes potentially being larger than width. Fixed an off-by-one in an HP-DIO card where it was treating the Topcat cursor right edge as exclusive. Updated everything to work with the API changes, reduced the scope of many variables, added more const, and replaced a few fill/copy loops with stuff from <algorithm>.
* rendlay.cpp: Correct output alpha for rect and disk components. Vas Crabb2020-09-201-50/+61
| | | | | | This corrects alpha for cases when both the rect/disk and whatever it's drawing over are translucent, and also optimises for fully opaque and fully transparent pixels.
* -emu/rendlay.cpp: Small optimisation for opaque pixels in image component. Vas Crabb2020-09-191-1/+5
| | | | | | -machine/pc1512kb.cpp: Put \| and #~ on the right keys by default. -docs: Re-organised default keys, added P2-4 defaults, added mahjong panel diagram.