summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/video.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* better handling for arbitrary numbers of screens (nw) Vas Crabb2018-03-121-97/+111
|
* Remove all uses of first_screen() from core files, nw Ryan Holtz2018-03-111-178/+373
|
* png: make it not leak memory by default, and look a but more like C++ Vas Crabb2017-08-131-11/+7
|
* more const, get rid of forced sleep (nw) Vas Crabb2017-08-021-16/+7
|
* general cleanup: Vas Crabb2017-05-231-3/+3
| | | | | | | | | | | * move rarely-used output and pty interfaces out of emu.h * consolidate and de-duplicate forward declarations, also remove some obsolete ones * clean up more #include guard macros * scope down a few more things (nw) Everyone, please keep forward declarations for src/emu in src/emu/emufwd.h - this will make it far easier to keep them in sync with declarations than having them scattered through all the other files.
* Remove the minimum constraint for sleep, thus avoid choosing a seemingly 057a3dd61f99517a3afea0051a49cb27994f94d2017-05-201-8/+4
| | | | arbitrary constant.
* Relax the threshold to consider an oversleep as a system time change, 057a3dd61f99517a3afea0051a49cb27994f94d2017-05-181-1/+1
| | | | in case of running on a heavily loaded system, as suggested by cuavas.
* Fix video_manager::throttle_until_ticks (#2309) 057a3dd61f99517a3afea0051a49cb27994f94d2017-05-171-1/+6
| | | | Do not update m_average_oversleep if we overslept too much. This is still a partial fix, more investigation is needed when the system time jumps backward.
* Move static data out of devices into the device types. This is a ↵ Vas Crabb2017-05-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | significant change, so please pay attention. The core changes are: * Short name, full name and source file are no longer members of device_t, they are part of the device type * MACHINE_COFIG_START no longer needs a driver class * MACHINE_CONFIG_DERIVED_CLASS is no longer necessary * Specify the state class you want in the GAME/COMP/CONS line * The compiler will work out the base class where the driver init member is declared * There is one static device type object per driver rather than one per machine configuration Use DECLARE_DEVICE_TYPE or DECLARE_DEVICE_TYPE_NS to declare device type. * DECLARE_DEVICE_TYPE forward-declares teh device type and class, and declares extern object finders. * DECLARE_DEVICE_TYPE_NS is for devices classes in namespaces - it doesn't forward-declare the device type. Use DEFINE_DEVICE_TYPE or DEFINE_DEVICE_TYPE_NS to define device types. * These macros declare storage for the static data, and instantiate the device type and device finder templates. The rest of the changes are mostly just moving stuff out of headers that shouldn't be there, renaming stuff for consistency, and scoping stuff down where appropriate. Things I've actually messed with substantially: * More descriptive names for a lot of devices * Untangled the fantasy sound from the driver state, which necessitates breaking up sound/flip writes * Changed DECO BSMT2000 ready callback into a device delegate * Untangled Microprose 3D noise from driver state * Used object finders for CoCo multipak, KC85 D002, and Irem sound subdevices * Started to get TI-99 stuff out of the TI-990 directory and arrange bus devices properly * Started to break out common parts of Samsung ARM SoC devices * Turned some of FM, SID, SCSP DSP, EPIC12 and Voodoo cores into something resmbling C++ * Tried to make Z180 table allocation/setup a bit safer * Converted generic keyboard/terminal to not use WRITE8 - space/offset aren't relevant * Dynamically allocate generic terminal buffer so derived devices (e.g. teleprinter) can specify size * Imporved encapsulation of Z80DART channels * Refactored the SPC7110 bit table generator loop to make it more readable * Added wrappers for SNES PPU operations so members can be made protected * Factored out some boilerplate for YM chips with PSG * toaplan2 gfx * stic/intv resolution * Video System video * Out Run/Y-board sprite alignment * GIC video hookup * Amstrad CPC ROM box members * IQ151 ROM cart region * MSX cart IRQ callback resolution time * SMS passthrough control devices starting subslots I've smoke-tested several drivers, but I've probably missed something. Things I've missed will likely blow up spectacularly with failure to bind errors and the like. Let me know if there's more subtle breakage (could have happened in FM or Voodoo). And can everyone please, please try to keep stuff clean. In particular, please stop polluting the global namespace. Keep things out of headers that don't need to be there, and use things that can be scoped down rather than macros. It feels like an uphill battle trying to get this stuff under control while more of it's added.
* Fix debug build by removing vestiges of -dummywrite (nw) AJR2017-03-021-6/+1
|
* Introduce u8/u16/u32/u64/s8/s16/s32/s64 Vas Crabb2016-11-191-22/+22
| | | | | | | | | | | | * New abbreviated types are in osd and util namespaces, and also in global namespace for things that #include "emu.h" * Get rid of import of cstdint types to global namespace (C99 does this anyway) * Remove the cstdint types from everything in emu * Get rid of U64/S64 macros * Fix a bug in dps16 caused by incorrect use of macro * Fix debugcon not checking for "do " prefix case-insensitively * Fix a lot of messed up tabulation * More constexpr * Fix up many __names
* Revert "Added IS_ENABLED, so we have compiler check for non used part, it is ↵ Miodrag Milanovic2016-11-121-1/+1
| | | | | | checked but not compiled in (nw)" This reverts commit c0407f073bf7afe26407c4add5cfeaf7104913c9.
* Added IS_ENABLED, so we have compiler check for non used part, it is checked ↵ Miodrag Milanovic2016-11-111-1/+1
| | | | | | but not compiled in (nw) false and true now used instead of integer where used as bool
* Do not use FUNC in delegate where applicable (nw) Miodrag Milanovic2016-11-061-1/+1
|
* NOTICE (TYPE NAME CONSOLIDATION) Miodrag Milanovic2016-10-221-10/+10
| | | | | 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
* some bool <-> int not needed conversions, also cleaned drivenum.* was using ↵ Miodrag Milanovic2016-10-211-13/+13
| | | | memset for clearing vector (nw)
* std::min and std:max instead of MIN and MAX, also some more macros converted ↵ Miodrag Milanovic2016-07-311-3/+3
| | | | to inline functions (nw)
* Fix -nodebug crash (nw) therealmogminer@gmail.com2016-06-081-8/+10
|
* Major refactoring of debugger core [Ryan Holtz] therealmogminer@gmail.com2016-06-081-1/+1
| | | | | | | | * Eliminate globals/file statics * Remove lots of stuff from global scope * Use std::function for custom command registration * Eliminate some trampolines * Build fixes from Vas Crabb and balr0g
* Revert "Allow for output to verify that a machine's emulation has ended ↵ Scott Stone2016-05-161-9/+3
| | | | | | properly specifically in instances where less than 2 seconds has elapsed. (nw)" This reverts commit fc4ab036fc4822ed9927c3f379f002e16aa3ffeb.
* Allow for output to verify that a machine's emulation has ended properly ↵ Scott Stone2016-05-161-3/+9
| | | | specifically in instances where less than 2 seconds has elapsed. (nw)