summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/video.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add adjust_periodic() to persistent_timer. Update obvious situations where ↵ Aaron Giles2021-09-111-1/+1
| | | | it can be used. Convert a few drivers from timer devices to plain timers to avoid adding adjust_persistent() to the timer device as well.
* Merge branch 'master' into time-experiments2 Aaron Giles2021-09-101-14/+12
|\
| * formats, osd, util: Started refactoring file I/O stuff. (#8456) Vas Crabb2021-08-221-14/+12
| | | | | | | | | | | | | | | | | | 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.
* | Merge branch 'master' into time-experiments2 Aaron Giles2021-06-041-0/+12
|\|
| * options: extended the snapname templates to allow for a timestamp %t option, ↵ etabeta782021-04-291-0/+12
| | | | | | | | so to allow for alternate ways to organize the generated snaps.
* | You know, if I'm nice enough to give you an accessor, please use it. Aaron Giles2021-04-241-1/+1
| |
* | Moved 'seconds_to_run' functionality to core machine. Consolidated logic for ↵ Aaron Giles2021-04-121-14/+15
| | | | | | | | handling hard/soft resets and exits. Added hard_stop() to scheduler to force it to exit ASAP.
* | Merge branch 'master' into time-experiments2 Aaron Giles2021-04-081-15/+3
|\|
| * options: simplified the statename/snapname logic for naming after image ↵ etabeta2021-04-041-14/+2
| | | | | | | | devices (e.g. %d_cart or %d_flop1) while allowing for more general non-alphanumeric separators, so that for instance %d_cart_%i correctly produces a name with the software name, followed by an underscore and an index, rather than failing to be recognized and defaulting back to %g/%i.
| * Addressed Github issue #7843 (mute on unthrottle) (#7875) MooglyGuy2021-03-221-1/+1
| |
* | Templatize the integer parameter for multiply/divide. Normalize return ↵ Aaron Giles2021-04-071-3/+3
| | | | | | | | values across implementations.
* | Subseconds is now signed, +/-2 seconds, to more closely align with expected ↵ Aaron Giles2021-04-031-7/+6
| | | | | | | | usage. Cleaned up several core pieces to leverage this.
* | Switch out attoseconds in favor of more abstract subseconds. Update everyone ↵ Aaron Giles2021-04-021-24/+25
| | | | | | | | to use subseconds abstractly where possible. Builds, and many games work, but some are failing, so there be dragons here.
* | Added stricter checks on allocation of device timers. Fixed several places ↵ Aaron Giles2021-03-271-3/+2
| | | | | | | | that were caught by this. Updated all interfaces and core systems to use new timer classes.
* | Made m_seconds and m_attoseconds private members to allow for future ↵ Aaron Giles2021-03-171-4/+4
|/ | | | abstractions.
* Much more core std::string_view modernization AJR2021-01-201-1/+2
| | | | | | | | | | | | | | | - 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
* More Lua interface cleanup - it's simpler with cleaner underlyng APIs. Vas Crabb2020-12-271-50/+26
| | | | | | | | | | | Made the sound manager mute controls readable, and got rid of system enable since it just controls system mute anyway. This was causing confusion: phantom2 was trying to use both independentlyt casuing the mute bit to be ignored. THe Lua interface changes are mostly changing methods to properties, some renames to make things clearer, and some additional properties for better control over snapshots.
* util/png: Update add_text to take std::string_view for arguments AJR2020-12-211-2/+2
|
* Fix some oversights and emergent behaviour with view selection. Vas Crabb2020-12-201-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Exposed the "native snapview" option on the video manager. Trying to use presence of a single view is a poor proxy that breaks with multi-screen systems. Allow rotation to be changed for native snapshot views, and disable the zoom to screen area control when it has no effect on the selected view. Treat an empty string identically to "auto" for view selectction. Previously this was being used for prefix matching so it would force the first view. (This caused the bad snapshot view selection. It had been relying on "internal" not being a common view name prefix so it fell through to automatic selection, but when changed to an empty string it forced the first view.) Documented "auto" as well as "native" for the -snapview option and changed the default to auto rather than an empty string for consistency with the -viewN options. Added [w]string_view handlers to the stuff that's instantiated in strformat.cpp since we'll be increasingly using them. Cleaned up and updated some documentation.
* More Lua engine clean-up and documentation, resulting in core cleanup. Vas Crabb2020-12-181-15/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | More Lua interface cleanup, additional properties and methods, and documentation migration/expansion. Emulated switch inputs can have "not" codes applied to host input axis directions. It works the same way as host switch inputs - push twice for a "not" prefix. Input polling helpers no longer need to store state in the input device items. There’s less leakage, and less chance of things interfering with each other. Allow snapshot view options to be configured through the internal UI via the video options menu. Made video options menus place initial focus on the currently selected view item. Removed some crud from the menu base class. Fixed the description of the "snapview" option. The value to get raw screen pixels was changed to "native" a long time ago but the description was never updated. Re-arranged the Golden Poker button lamps so that the 6-button layouts for Jolli Witch and Wild Witch make sense. In 6-button mode, the hold buttons double as bonus game and bet buttons, but the lamp outputs don't change. The simplest way to deal with this without requiring the user to switch views or using layout scripting is to place the dedicated buttons directly below the hold buttons that correspond to them. Removed some software list data that was redundantly copied into device_image_interface (m_supported was never even set, so it didn't even work), and made crc() work better (previously it wasn't recalculuated after unloading and loading another image). Made strformat.h and devcb.h play nicer with C++17 and pre-standard C++20. Format precision now correctly limits the length of string views. Confirmed that strformat.{h,cpp} works with pre-standard C++20 support in GCC 9. Removed an auto_alloc from cpu/arm7.
* Fairly significant overhaul of Lua engine and some cleanup. Vas Crabb2020-11-251-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Various improvements to image file handling: Vas Crabb2020-10-081-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* Cleaned up bitmap API. Vas Crabb2020-09-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>.
* -util/xmlfile: Escape attribute and element content. Vas Crabb2020-09-061-1/+1
| | | | | | | | | | | | | | | | | | | | The previous behaviour was unintuitive - parsing an XML file and writing it out immediately would produce invalid XML if the file contained any characters that needed escaping. It makes far more sense to escape on writing rather than expecting the user to escape input. -Add preliminary support for visibility toggles to artwork system. This allows the user to show/hide related elements in a view, with nesting. The view can specify whether elements are shown or hidden by default. Settings are saved per host window/screen per view. There is no way to set the initial visibility state on the command line. Legacy "Space Invaders cabinet model" layers are mapped onto visibility toggles. This is not stable yet. In particular, the XML element/attribute names have not been finalised. The new features have not been added to complay.py to prevent them from being used before they're finalised.
* screen/update_now(): fix overwriting last pixel of previous update, fix ↵ hap2020-08-081-1/+4
| | | | rendering whole scanline when update was called inside hblank
* mmdisplay2: lcd screen was missing 1 line (nw) hap2020-06-141-1/+1
|
* video: show frameskip max value in speed_text (nw) hap2020-06-141-6/+2
|
* video: frameskip setting is now upper frameskip limit when autoframeskip ↵ hap2020-06-141-2/+7
| | | | setting was enabled (nw)
* video: don't do frameskip related calculations at init time (nw) hap2020-06-131-4/+4
|
* srcclean and manual cleanup (nw) Vas Crabb2020-04-261-1/+1
|
* Refactoring of AVI/MNG recording code (#6537) npwoods2020-04-221-363/+66
| | | | | | | | | | | | | | * Initial refactor of AVI/MNG movie recording, consolidation of copy and paste code, hiding of AVI/MNG behind interfaces * Extracted recording specific code out of src/emu/video.cpp and put into src/emu/recording.cpp * Took the opportunity to move slightly more logic out of video.cpp into recording.cpp * Bug fix * Consolidated frame counting logic
* (nw) Cleanup on the way: Vas Crabb2020-03-101-1/+1
| | | | | | | | | | * Add doxygen comments for bit manipulation functions * Add an overload of BIT that works like the AArch64 UBFX instruction * Kill off some of the silly concatenating overloads for emu_file::open * Make searchpath acually useful for devices This is a checkpoint - I'm planning to improve ROM loading behaviour at least a little.
* fixed some clang-tidy warnings (nw) (#6229) Oliver Stöneberg2020-01-291-2/+2
| | | | | | | | | | | | | | | | * fixed some readability-static-accessed-through-instance clang-tidy warnings (nw) * fixed some readability-redundant-string-cstr clang-tidy warnings (nw) * fixed some readability-redundant-control-flow clang-tidy warnings (nw) * fixed some modernize-use-nullptr clang-tidy warnings (nw) * fixed some performance-faster-string-find clang-tidy warnings (nw) * fixed some performance-for-range-copy clang-tidy warnings (nw) * fixed some performance-unnecessary-value-param clang-tidy warnings (nw)
* fixed some clang-tidy warnings (nw) (#6197) Oliver Stöneberg2020-01-221-7/+7
| | | | | | | | | | | | | | * fixed some bugprone-throw-keyword-missing clang-tidy warnings (nw) * fixed some modernize-use-nullptr clang-tidy warnings (nw) * fixed some readability-delete-null-pointer clang-tidy warnings (nw) * fixed some performance-faster-string-find clang-tidy warnings (nw) * fixed some performance-for-range-copy clang-tidy warnings (nw) * fixed some readability-redundant-string-cstr clang-tidy warnings (nw)
* fixed -aviwrite/-mngwrite crash with screenless systems [Oliver Stöne… ↵ Oliver Stöneberg2020-01-071-3/+10
| | | | | | | | | | | | (#6139) * fixed -aviwrite/-mngwrite crash with screenless systems [Oliver Stöneberg, hap] * can record video with noscreens (nw) * need to use default frame rate for screen-less MNG recording as well (nw) Co-authored-by: hap <happppp@users.noreply.github.com>
* Remove up to one frame of input latency. (#5901) antonioginer2019-11-161-1/+9
| | | | | | | | | | * Remove up to one frame of input latency. Makes MAME virtually lagless on VRR monitors. * Use empty parentheses and clean interface member calls * Add new option -instant_blit to make this feature optional * Rename new option to -lowlatency, -ll
* srcclean (nw) Vas Crabb2019-10-261-1/+1
|
* Fix AVI framerate feos2019-10-031-10/+1
| | | | | | MAME was setting up AVI before devices have properly launched, so default 60fps was used, which resulted in skipped frames in the video if machine's framerate is above 60 (btoads), and presumably duplicate frames for machines below 60fps (haven't tested). Now every frame that is generated is also present in the video.
* don't force throttling while paused feos2019-09-141-1/+1
|
* video: additional fix to 33383cdaa727deb627bf65f865515327947a0720 (MAME ↵ hap2019-07-231-3/+4
| | | | slowdown on screenless view) (nw)
* Making video_manager::effective_frameskip() public and exposing via LUA npwoods2019-07-181-1/+1
|
* luaengine: video:size(), video:pixels(), screen:refresh_attoseconds() ↵ cracyc2019-07-141-4/+36
|\ | | | | | | | | | | | | | | | | [vadosnaprimer] (#5334) * luaengine: video:size(), video:pixels(), screen:refresh_attoseconds() pixels() and size() correspond to internal game resolution covering all screens and internal pixel colors. the same values are used for bitmap dumping. similar things available for screen_device lua library take into account final UI resolution and colors, so they can't be used when accurate framebuffer is needed. refresh_attoseconds() allows to calculate precise numerator and denominator for framerate
| * luaengine: video:size(), video:pixels(), screen:refresh_attoseconds() feos2019-07-121-4/+36
| | | | | | | | | | | | pixels() and size() correspond to internal game resolution covering all screens and internal pixel colors. the same values are used for bitmap dumping. similar things available for screen_device lua library take into account final UI resolution and colors, so they can't be used when accurate framebuffer is needed. refresh_attoseconds() allows to calculate precise numerator and denominator for framerate
* | Make layout format more flexible: Vas Crabb2019-07-061-5/+0
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* (nw) Clean up the mess on master Vas Crabb2019-03-261-5/+14
| | | | | | | | | | | | | This effectively reverts b380514764cf857469bae61c11143a19f79a74c5 and c24473ddff715ecec2e258a6eb38960cf8c8e98e, restoring the state at 598cd5227223c3b04ca31f0dbc1981256d9ea3ff. 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.
* Revert "conflict resolution (nw)" andreasnaive2019-03-251-14/+5
| | | | | This reverts commit c24473ddff715ecec2e258a6eb38960cf8c8e98e, reversing changes made to 009cba4fb8102102168ef32870892438327f3705.
* video: don't use iter count (nw) hap2019-02-151-1/+5
|
* video: stop frameskipping constantly on screenless systems with frameskip=0 (nw) hap2019-02-151-2/+3
|
* Video throttling: Additive oversleeping Celelibi2019-02-151-3/+7
| | | | Signed-off-by: Celelibi <celelibi@gmail.com>
* Replace ATTOSECONDS_TO_HZ with as_hz where appropriate (nw) AJR2018-11-051-2/+2
|