summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/machine.cpp
Commit message (Collapse)AuthorAgeFilesLines
* emu/save.cpp: Made illegal save state registrations always fatal. (#12054) Vas Crabb2024-02-251-4/+0
|
* machine: reword save/loadstate popmessage a bit again hap2024-02-191-11/+12
|
* machine: add filename to save/load state message hap2024-02-181-12/+13
|
* nvram: delete file on save if there's a write error or result file is 0 bytes hap2024-02-101-0/+9
|
* ui/info.cpp: Get decimal separator from C++ locale. Also random cleanup. Vas Crabb2023-08-171-5/+5
| | | | | * emu/machine.cpp, emu/render.cpp: Catch exceptions by const reference. * Various spacing and #include order cleanup.
* machine.cpp: Recognize reset phase in describe_context AJR2023-04-021-1/+4
|
* Various optimisations to code generaton. Vas Crabb2023-03-261-1/+1
| | | | | | | | | | | | | | | util/bitmap.cpp, util/palette.cpp: Marked lots of things constexpr. Bitmaps don't throw exceptions on allocation failure, they just become invalid. Almost nothing in MAME actually checks for this. emu/profiler.cpp: Abort if the profile stack overflows rather than throwing an exception. This is a developer feature and if it overflows, the code is broken. Calling a noreturn noexcept function generates less code than throwing an exception, which adds up. util/strformat.cpp: Traded away some unnecessary flexibility for more compact code. The stream objects must derive from std::basic_ostream now - they can't just be any old objects with the expected operators.
* -Lua engine: run everything in coroutines. (#11019) Vas Crabb2023-03-251-6/+2
| | | | | | | | | * 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.
* Retired the over-stretched "system type" flags. Vas Crabb2023-03-231-23/+22
| | | | | | | | | | | | | | | | Functionally, the only difference between the system definitions is that GAMEL lets you specify an additional internal layout and SYST lets you specify a compatible system. COMP and CONS are just aliases for SYST - the aliases can be phased out. Removed arcade.flt and mess.flt altogether - opinion seems to be split between misinterpreting them as fully supported and considering them unnecessary. They were marginally useful as a performance test for makedep.py, but that isn't important. We still have nl.flt as an example .flt file (although it doesn't use "-" exclude directives). Moved the UI active flag from the machine to the UI manager. Nothing else uses it anyway (it's still accessible to scripts).
* -luaengine.cpp: Expose UI controls toggle state. Vas Crabb2023-03-231-1/+1
| | | | -ui/ui.cpp: Honour UI enable for machines without keyboards.
* osd: Cleaner way of dealing with input updates. Vas Crabb2023-02-231-2/+3
|
* 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.
* dinvram: Separate backup-enable parameter (which prevents both loading and ↵ AJR2022-08-091-1/+1
| | | | saving) from nvram_can_save
* Don't load any NVRAM other than the default for devices whose configurations ↵ AJR2022-07-241-1/+1
| | | | inhibit NVRAM saving
* Use ioprocs classes instead of emu_file for device_nvram_interface's load ↵ AJR2022-02-271-4/+4
| | | | and save methods, and have these return false on I/O errors
* Miscellaneous cleanup: Vas Crabb2022-02-201-8/+10
| | | | | | | | * emu/machine.cpp: Organised #included headers by module. * formats/jvc_dsk.cpp: Don't hide diagnostics behind compile-time switch. * util/ioprocsfilter.h: Added doxygen comments so one doesn't need to read the source to work semantics.
* machine.cpp: Attempt to appease gcc's stricter handling of incomplete types AJR2022-02-111-0/+11
|
* Remove fileio.h from emu.h AJR2022-02-111-4/+7
|
* Remove void *ptr parameter from emu_timer, timer_device and all related ↵ AJR2022-01-261-1/+1
| | | | callbacks
* Remove http related header pollution (#9201) Miodrag Milanović2022-01-261-0/+1
| | | | | | | | | * Remove http related header polution * remove now invalid message * fixed issued detected by clang * Fixed CR at EOF
* -frontend: Give heading items in menus a bit of horizontal space. Vas Crabb2021-12-051-62/+6
| | | | | | | | | -emu/machine.cpp: Got rid of an outdated and hence misleading comment. -Got rid of a few more uses of UNUSED_FUNCTION. -Tidied up more slot machine layouts, and fixed VFDs in debug views that had inadvertently been broken.
* Remove a few outdated references to MESS Dirk Best2021-12-021-1/+1
|
* util/delegate.h: Try to catch issues earlier, and some cleanup. Vas Crabb2021-09-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Optimised generation of late bind helper functions. The late bind helper function doesn't depend on the delegate signature - only on the late bind base class and function target class. Having it inside the delegate base class means it needs to be instantiated for every combination of late bind base class, function target class and delegate signature. In a typical driver file, there is only one late bind base class (delegate_late_bind), and there will be delegates with multiple signatures bound to function members of the same class (e.g. read and write handlers, possibly of different widths, bound to members of the driver state class). By moving the late bind helper out of the delegate base class, the number of required instantiations can be reduced. By moving the body out of the enclosing class declaration, the compiler can be encouraged to coalese instantiations across translation units. While this won't give a further reduction in compile time, it should at least reduce the output binary size by reducing duplication for devices that frequently have handlers installed in memory maps. Added an additional template parameter to delegates allowing the late bind base class to be changed if desired. Moved the MSVC implementation "this" pointer optimisation out-of-line and added logging. Also cleaned up the Itanium "this" pointer adjustment and code pointer resolution implementation to reduce duplication and conditional compilation. Made binding_type_exception give a more meaningful what() message than "std::exception". Added extensive validity tests for delegate functionality. Pointers to member functions are tested, including multiple inheritance, virtual and non-virtual member functions, and checking for generational loss across copying/assigning delegates. This should properly exercise "this" pointer adjustment for the Itanium and MSVC implementations, and vtable lookup for the Itanium implementation. So-called late binding functionality is tested, including exceptions on failure. Functoids are tested, although given the encapsulation it's not possible to check that an apator isn't generated when it shouldn't be.
* formats, osd, util: Started refactoring file I/O stuff. (#8456) Vas Crabb2021-08-221-8/+8
| | | | | | | | | 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.
* emu/machine.cpp: Get rid of the dummy space device. Vas Crabb2021-05-051-60/+7
|
* Allow breaking into main menu before the machine fully starts (i.e. just ↵ AJR2021-04-091-2/+2
| | | | | | before the initial soft reset) by using the normal "Config Menu" UI input Note that the minor code shuffling in machine.cpp is necessary to prevent emulation from getting confused if "Select New Game" happens to be selected.
* options: simplified the statename/snapname logic for naming after image ↵ etabeta2021-04-041-13/+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.
* Much more core std::string_view modernization AJR2021-01-201-0/+1
| | | | | | | | | | | | | | | - 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
* natkeyboard: Remove from ioport_manager AJR2020-12-261-0/+4
|
* More Lua interface cleanup - it's simpler with cleaner underlyng APIs. Vas Crabb2020-12-271-0/+4
| | | | | | | | | | | 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.
* Fairly significant overhaul of Lua engine and some cleanup. Vas Crabb2020-11-251-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* emu/machine.cpp: Get rid of remaining make_unique_clear on 'manager' objects. Vas Crabb2020-09-301-3/+3
|
* emu: correct some file headers (nw) hap2020-06-191-1/+1
|
* recording: fix frame sync regression (nw) hap2020-06-191-1/+1
|
* finally retired the READ8/16/32/64 and WRITE8/16/32/64 macros (nw) Ivan Vangelista2020-06-181-2/+2
|
* dinvram: rename pre write/save to can write/save (nw) hap2020-06-111-1/+1
|
* nvram: don't save 0byte file (nw) hap2020-06-091-4/+7
|
* Debugger - add `-debuglog` option to log debug console output to file Stephen Oberholtzer2020-05-071-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | When this option is specified, all console output is echoed to a log file. Some caveats/limitations: - The file-open process was copied from -log, so it has the same limits - Filename is hard-coded (debug.log) - File is overwritten if it exists - File is opened during emulation initialization - Thus, the file is cleared if you invoke the "Hard Reset" debugger command - Probably some other details I don't know about - Logging works as such: When a string is appended to the scrollback buffer, it is also written to the log file. Some commands forcibly wrap their output (e.g. `help` to 80 columns.) Because this wrapping is done inside the scrollback buffer, the text written to the file is not wrapped. This can be seen with `help execution`.
* Refactoring of AVI/MNG recording code (#6537) npwoods2020-04-221-2/+2
| | | | | | | | | | | | | | * 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
* fixed some clang-tidy warnings (nw) (#6236) Oliver Stöneberg2020-01-301-1/+1
| | | | | | | | | | | | | | | | * fixed some modernize-redundant-void-arg clang-tidy warnings (nw) * fixed some modernize-use-bool-literals clang-tidy warnings (nw) * fixed some modernize-use-emplace clang-tidy warnings (nw) * fixed some performance-move-const-arg clang-tidy warnings (nw) * fixed some readability-redundant-control-flow clang-tidy warnings (nw) * fixed some readability-redundant-string-cstr clang-tidy warnings (nw) * fixed some performance-unnecessary-value-param clang-tidy warnings (nw)
* 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)
* Merge pull request #6195 from firewave/includes R. Belmont2020-01-221-1/+1
|\ | | | | use C++ library includes (nw)
| * use C++ library includes (nw) firewave2020-01-221-1/+1
| |
* | fixed some clang-tidy warnings (nw) (#6197) Oliver Stöneberg2020-01-221-2/+2
|/ | | | | | | | | | | | | | * 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)
* Save states should not be break when changing output. Also get rid of a few ↵ Vas Crabb2019-12-131-2/+2
| | | | | | dozen output().set_value(...) calls in favour of output finders. (nw) This has the detrimental effect that outputs used in layouts will get the default value from the last element in the last view that uses them _after_ devices are started. If drivers/devices set initial output values on start rather than reset this could cause a problem.
* save/restore otuput values in save states Vas Crabb2019-12-131-0/+5
|
* Spring cleaning: Vas Crabb2019-11-011-1/+1
| | | | | | | | | | | | * 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
* Fix AVI framerate feos2019-10-031-0/+9
| | | | | | 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.
* (nw) get rid of the rest of assert_always - it's better to be explicit about ↵ Vas Crabb2019-09-201-5/+8
| | | | what this thing is supposed to do
* Remove tilemap.h from emu.h (nw) AJR2019-08-211-0/+1
|