summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/video.cpp
Commit message (Collapse)AuthorAgeFilesLines
* schedule/timer: be more consistent with s32 param hap2023-12-111-1/+1
|
* -Lua engine: run everything in coroutines. (#11019) Vas Crabb2023-03-251-7/+6
| | | | | | | | | * This lets you use emu.wait(...) directly without mucking around creating coroutines. * Allow emu.wait to accept an attotime argument. * Added a couple more wait helper functions. -emu/profiler.h: Actually use scope-based profiling helpers. * This makes the comment at the top of emu/profile.h less dishonest, and makes it easier to write exception-safe code. * Got rid of some do { ... } while (0) loops that only existed so break could be used like a goto.
* Update accumulating relative inputs exactly once per frame. Vas Crabb2023-02-241-5/+5
| | | | | | | | | | | | | This fixes "amplification" effects that would happen if the frame rate rose above 100 Hz (whether by unthrottling or otherwise). Synchronise with wall clock any time inputs are read. Not doing this has weird effects on relative inputs with frame skipping and contributes to unresponsiveness of menus. Reduce visual latency for mouse movement on menus when paused or skipping frames. The rest of the code changes to menus won't provide benefits until draw can happen after event handling.
* osd: Cleaner way of dealing with input updates. Vas Crabb2023-02-231-0/+1
|
* osd: Don't pump events when reading inputs. Vas Crabb2023-02-231-4/+2
| | | | | | This was a drain on performance. If anything is trying to poll inputs in a loop, it needs to call input_update() to ensure it gets up-to-date state.
* Various input and OSD refactoring: Vas Crabb2023-01-291-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* corefile.h: Move filename utilities to path.h AJR2022-09-251-0/+1
|
* -midway/seattle.cpp: Added San Francisco Rush Boot Code Version L1.12 as a ↵ Vas Crabb2022-09-071-1/+1
| | | | | | | | | | | | | | | | | BIOS option. [neSneSgB] -gameboy.xml, gbcolor.xml: Mark HuC-1 cartridges as using non-volatile RAM, and demoted to partially supported for lack of IR transceiver emulation. -Various cleanups: * midway/seattle.cpp: Turned San Francisco Rush Boot Code Version L1.06A into a BIOS option rather than a clone - the game version is the same. * misc/highvideo.cpp: Use a more obvious pixel loop with fewer tests, and cleaned up spacing. * tvgames/micom_mahjong.cpp: Use active low logic for active low key matrix rather than inverting stuff everywhere. * pacific/thief.cpp: Cleaned up indentation gone wild.
* emu/video.cpp: Added a space before %FPS in speed text. (#10305) 0kmg2022-09-051-1/+1
|
* emu: Fixed issues with memory views and snapshot naming. Vas Crabb2022-07-011-27/+67
| | | | | | | | | | | | | | | | Include device tag in memory view save item registration names. Without this, instantiating two of the same device (or two devices with identically named memory views) causes a fatal error on start. Fixed -aviwrite/-mngwrite with -snapview native more than two screens. Previously it would attempt to use the same file name for all screens but the first. Improved naming of snapshots, especially when using -snapview native with -aviwrite/-mngwrite (see GitHub #10005). The automatically included screen number should come before the extension if supplied. Also, assume that users actually know what they’re doing if they include a dot in a snapshot filename pattern.
* screen: draw until current hpos (not inclusive) when doing an update_now hap2022-04-031-1/+1
|
* Remove fileio.h from emu.h AJR2022-02-111-1/+2
|
* Remove void *ptr parameter from emu_timer, timer_device and all related ↵ AJR2022-01-261-2/+2
| | | | callbacks
* video.cpp: Revise 77834407f23ad3418ed90168179ca895080dfa8d to only reset ↵ AJR2022-01-221-6/+1
| | | | "last time" measurements when loading a state
* video.cpp: Restart time counters after loading a save state AJR2022-01-221-1/+11
|
* Render-related cleanup AJR2021-12-301-0/+1
| | | | | | | - Undo inclusion of screen.h within render.h and update many source files that were stealth-including the former - Move texture_format enum to rendertypes.h - rendlay.h: Make a few methods static - ui/info.cpp: Use C++11-style iteration for render targets
* expand buffer size from 15 to 16 for %t time in video_manager::open_next (#9039) goldnchild2021-12-251-1/+1
|
* plugins: Moved the timecode recording functionality to a plugin. Vas Crabb2021-11-021-44/+0
|
* Fix various usability issues: Vas Crabb2021-11-021-15/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | frontend: Made it so you can press UI On Screen Display to hide the Analog Controls menu and see the response to your inputs without the risk of changing settings, and see more axes at once and scroll them for systems with very large number of axes. Also ensure the axis being configured is visible when the menu is visible, and made the menu behave a bit more like the system input assignments menu (including previous/next group navigation). frontend: Allow Lua to draw to the UI container - this addresses the main complaint in #7475. Note that drawing to the UI container will draw over any UI elements, including menus. Plugins can check menu_active to avoid drawing over menus. Also removed some unnecessary use of sol::overload. frontend: Improved info/image box navigation on the system/softwre selection menus, and cleaned up some leftover code that came from the copy/pasted event handling functions. frontend: Fixed sliders menu not handling Alt+Shift as intended (thanks Coverity). Fixed a couple of harmless Coverity errors, too. emu/inpttype.ipp: Made the default assignment for Save State recognise right shift. plugins: Added next/previous group navigation to input macro edit menu. docs: Added basic description of the system and software selection menus, and corrected a couple of errors in the Lua reference.
* util: Further API cleanups: (#8661) Vas Crabb2021-10-051-3/+3
| | | | | * 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.
* emu/video.cpp: Set file names via -snapname when exiting in -seconds_… (#8633) 0kmg2021-09-301-1/+1
|
* 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.
* 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.
* 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
|
* 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)