summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/diexec.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Better handling of null/missing items. More consistent error handling. ↵save-experiments Aaron Giles2021-04-201-2/+1
| | | | Reduced compression to default to speed up saves. Optimized simple binary saves as well. Device interfaces now have automatic containers. Fixed duplicate entry detection. Added logic to parse an item we're skipping. Added detection of missing/duplicate items from input JSON. Fixed timing for save/load.
* Created new hierarchical save_registrar, which supports self-describing ↵ Aaron Giles2021-04-091-14/+20
| | | | structs and arrays. Converted several core files and structures over to using it. Currently just for testing.
* Eliminate ARRAY_LENGTH template in favor of C++17's std::size AJR2021-02-141-3/+3
| | | | | | | | | | * osdcomm.h: Move definition of EQUIVALENT_ARRAY to coretmpl.h * sharc.cpp, gt64xxx.cpp, ym2413.cpp, gb_lcd.cpp, snes_ppu.cpp: Use STRUCT_MEMBER for save state registration * gio/newport.cpp, megadrive/svp.cpp, nes_ctrl/bcbattle.cpp, arm7.cpp, tms9995.cpp, pckeybrd.cpp, sa1110.cpp, sa1111.cpp, jangou_blitter.cpp, vic4567.cpp: Use std::fill(_n) instead of memset * emucore.h: Remove obsolete typedef
* Fairly significant overhaul of Lua engine and some cleanup. Vas Crabb2020-11-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: correct some file headers (nw) hap2020-06-191-1/+1
|
* Don't clear the input queue on reset. (#6517) Mike2020-04-041-1/+0
| | | | | | | This fixes problems where devices are input line changes are missed because a device was reset. One case is at startup, where one device's output is wire to another's input. During start the first device adds, eg, a RESET assertion to the second. When that device starts, it resets itself and clears the pending RESET assertion.
* diexec: Eliminate pulse_input_line_and_vector (nw) AJR2020-04-021-27/+0
| | | | Not the best way to accomplish this, admittedly, but the most convenient for now.
* diexec.cpp: fixed save state regression (nw) Ivan Vangelista2019-12-121-0/+1
|
* Added wrapper for using STRUCT_MEMBER with an indeterminate length array Vas Crabb2019-12-091-8/+7
| | | | | * Examples in YM2612 family and MultiPCM * Also used STRUCT_MEMBER to reduce clutter in diexec save state registration
* assert aborts on failure - abort is not an exception. conditional noexcept ↵ Vas Crabb2019-11-101-3/+3
| | | | is an antipattern, get rid of it. (nw)
* Make many device_execute_interface functions noexcept, including the ↵ AJR2019-11-091-10/+10
| | | | | | | | "information" overrides. This also covers several time-related functions in attotime, running_machine and emu_timer. (nw) m6805: Calculate min_cycles and max_cycles once at device_start time (Nw) attotime: Add as_khz and as_mhz (nw)
* Make devdelegate more like devcb for configuration. This is a Vas Crabb2019-10-261-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fundamental change to show device delegates are configured. Device delegates are now aware of the current device during configuration and will resolve string tags relative to it. This means that device delegates need a device to be supplied on construction so they can find the machine configuration object. There's a one-dimensional array helper to make it easier to construct arrays of device delegates with the same owner. (I didn't make an n-dimensional one because I didn't hit a use case, but it would be a simple addition.) There's no more bind_relative_to member - just call resolve() like you would for a devcb. There's also no need to cast nullptr when creating a late bind device delegate. The flip side is that for an overloaded or non-capturing lambda you'll need to cast to the desired type. There is one less conditional branch in the hot path for calls for delegates bound to a function pointer of member function pointer. This comes at the cost of one additional unconditional branch in the hot path for calls to delegates bound to functoids (lambdas, functions that don't take an object reference, other callable objects). This applies to all delegates, not just device delegates. Address spaces will now print an error message if a late bind error is encountered while installing a handler. This will give the range and address range, hopefully making it easier to guess which memory map is faulty. For the simple case of allowing a device_delegate member to be configured, use a member like this: template <typename... T> void set_foo(T &&...args) { m_foo_cb.set(std::forward<T>(args)...); } For a case where different delegates need to be used depending on the function signature, see src/emu/screen.h (the screen update function setters). Device delegates now take a target specification and function pointer. The target may be: * Target omitted, implying the current device being configured. This can only be used during configuration. It will work as long as the current device is not removed/replaced. * A tag string relative to the current device being configured. This can only be used during configuration. It will not be callable until .resolve() is called. It will work as long as the current device is not removed/replaced. * A device finder (required_device/optional_device). The delegate will late bind to the current target of the device finder. It will not be callable until .resolve() is called. It will work properly if the target device is replaced, as long as the device finder's base object isn't removed/replaced. * A reference to an object. It will be callable immediately. It will work as long as the target object is not removed/replaced. The target types and restrictions are pretty similar to what you already have on object finders and devcb, so it shouldn't cause any surprises. Note that dereferencing a device finder will changes the effect. To illustrate this: ... required_device<some_device> m_dev; ... m_dev(*this, "dev") ... // will late bind to "dev" relative to *this // will work if "dev" hasn't been created yet or is replaced later // won't work if *this is removed/replaced // won't be callable until resolve() is called cb1.set(m_dev, FUNC(some_device::w)); ... // will bind to current target of m_dev // will not work if m_dev is not resolved // will not work if "dev" is replaced later // will be callable immediately cb2.set(*m_dev, FUNC(some_device::w)); ... The order of the target and name has been reversed for functoids (lambdas and other callable objects). This allows the NAME macro to be used on lambdas and functoids. For example: foo.set_something(NAME([this] (u8 data) { m_something = data; })); I realise the diagnostic messages get ugly if you use NAME on a large lambda. You can still give a literal name, you just have to place it after the lambda rather than before. This is uglier, but it's intentional. I'm trying to drive developers away from a certain style. While it's nice that you can put half the driver code in the memory map, it detracts from readability. It's hard to visualise the memory range mappings if the memory map functions are punctuated by large lambdas. There's also slightly higher overhead for calling a delegate bound to a functoid. If the code is prettier for trivial lambdas but uglier for non-trivial lambdas in address maps, it will hopefully steer people away from putting non-trivial lambdas in memory maps. There were some devices that were converted from using plain delegates without adding bind_relative_to calls. I fixed some of them (e.g. LaserDisc) but I probably missed some. These will likely crash on unresolved delegate calls. There are some devices that reset delegates at configuration complete or start time, preventing them from being set up during configuration (e.g. src/devices/video/ppu2c0x.cpp and src/devices/machine/68307.cpp). This goes against the design principles of how device delegates should be used, but I didn't change them because I don't trust myself to find all the places they're used. I've definitely broken some stuff with this (I know about asterix), so report issues and bear with me until I get it all fixed.
* -keyboard/a1200, changela, goldnpkr, m68705prg, mexico86, pipeline, pitnrun, ↵ mooglyguy2018-12-141-1/+1
| | | | | | | | | | qix, quizpun2, stfight, tigeroad: Removed MACHINE_CONFIG. [Ryan Holtz] -m68705, m68hc05: Removed MCFG. [Ryan Holtz] -qix: First-pass cleanup. [Ryan Holtz] -core: Fixed spelling of "nonexistent". [Ryan Holtz]
* Prevent aggressive incompetence (nw) Olivier Galibert2018-07-271-1/+3
|
* diexec.cpp: Better fix for indentation (nw) AJR2018-06-031-2/+2
|
* diexec.cpp: Fix formatting and validation mistake (nw) AJR2018-06-031-16/+16
|
* Point conceded; it is not, at this point, sensible to make ↵ mooglyguy2018-06-031-9/+16
| | | | m_vblank_interrupt_screen a finder. Indeed, the need for it should be removed from diexec entirely. nw
* No. mooglyguy2018-06-031-15/+8
|
* Back out diexec changes from commit 2cdb153103fa94d13a53dd747985ef56ec723e7a ↵ AJR2018-06-031-8/+15
| | | | (nw)
* fixup, improve validation (nw) Vas Crabb2018-06-011-8/+5
|
* svis_snd cleanups, nw mooglyguy2018-06-011-9/+5
|
* Remove some machine().device usage from the core (nw) AJR2018-05-201-1/+1
|
* diexec: Interrupt API changes (nw) AJR2018-05-181-23/+44
| | | | | | - PULSE_LINE is no longer a value. Existing uses have been changed to pulse_input_line with attotime::zero as the second argument. - Formerly only INPUT_LINE_NMI and INPUT_LINE_RESET were allowed with PULSE_LINE. INPUT_LINE_NMI no longer receives special handling; instead, CPU devices must specify which of their input lines are edge-triggered and thus may be used with zero-width pulses by overriding the execute_input_edge_triggered predicate. INPUT_LINE_RESET is still special-cased, however. - execute_default_irq_vector now allows a different default vector to be specified for each input line. This added flexibility may or may not prove useful.
* diexec: Note flaw in INPUT_LINE_RESET implementation (nw) AJR2018-04-081-0/+1
|
* Reshuffle some stuff: Vas Crabb2018-03-281-111/+36
| | | | | | * Move around the debugger hooks to get a small but measurable performance increase * Remove emucore from external tools * Improve performance of DSP16 interpreter a little by generating six variants of execution loop
* vgmplay: Disable POKEY and QSound devices if not required AJR2018-03-221-4/+4
|
* destaticify initializations (nw) (#3289) wilbertpol2018-03-041-58/+0
| | | | | | * destaticify initializations (nw) * fix this->set_screen (nw)
* rewind implementation fixes and improvements vadosnaprimer2017-12-221-3/+0
| | | | | | | | | | | | | - reset scheduler savestate to what it was for years before rewind -- changing saved variables should be done after thorough testing. right now, adding some vars breaks some machines, adding other vars breaks others - switch to megabyte-wise capacity -- savestate size greatly differs between machines, relying on state count is unstable - switch to internal indexing -- no longer depends on inaccurate machine time - rewind accelerator key in debugger (Ctrl+F11) - report capacity hit (once), with some useful info - make error reports saner - mention rewind and rewind_capacity in the docs
* Revert "Revert "Merge branch 'master' of https://github.com/mamedev/mame"" Firehawke2017-12-131-0/+3
| | | | This reverts commit 54155441e9ba9941e85d80c4834a66376a11e791.
* Revert "Merge branch 'master' of https://github.com/mamedev/mame" Firehawke2017-12-131-3/+0
| | | | | This reverts commit f537428e5a40ba6dde8ca9bf0fe9ae6b1f189ac4, reversing changes made to 0d70d798107d4e4e8fb9f230410aeb1e888d65c5.
* Fix MAME lockup if you step and PlayStation based game twice then rewind ↵ smf-2017-12-071-0/+2
| | | | twice (nw)
* icount was missing from the savestates vadosnaprimer2017-12-061-0/+1
| | | | When you load a state, icount (*icountptr) would remain whatever it was before loading, messing with the remaining cycles and with the amount of code executed per run() call. This introduced non-determinism and badly influenced usage of savestates while debugging. machine().time() would also return wrong values after that, since it adds remaining cycles.
* Replace driver_device::generic_pulse_irq_line with ↵ AJR2017-11-141-0/+42
| | | | device_execute_interface::pulse_input_line (nw)
* Self-registering devices prep: Vas Crabb2017-02-271-0/+1
| | | | | | | | | | | | | | * Make device_creator a variable template and get rid of the ampersands * Remove screen.h and speaker.h from emu.h and add where necessary * Centralise instantiations of screen and speaker finder templates * Add/standardise #include guards in many hearers * Remove many redundant #includes * Order #includesr to help catch headers that can't be #included alone (nw) This changes #include order to be prefix, unit header if applicable then other stuff roughly in order from most dependent to least dependent library. This helps catch headers that don't #include things that they use.
* Introduce u8/u16/u32/u64/s8/s16/s32/s64 Vas Crabb2016-11-191-13/+13
| | | | | | | | | | | | * 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-6/+6
| | | | | | 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-6/+6
| | | | | | 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-13/+13
| | | | | 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
* Iterate over devices C++11 style AJR2016-04-181-2/+1
| | | | | | Replace the old device_iterator and its specialized versions with functionally equivalent classes that use standard operators to yield references to devices/interfaces rather than pointers. With range-based for loops, they no longer have to be stored in named variables, though they can also be reused concurrently since the iteration state is now maintained by a subclass. Add a few more typical getters to device_t::subdevice_list.
* Iterate over core classes C++11 style AJR2016-03-311-1/+1
| | | | | | | | C++11 range-based for loops can now iterate over simple_list, tagged_list, core_options, device_t::subdevice_list, device_t::interface_list, render_primitive_list and all subclasses of the above, and much code has been refactored to use them. Most core classes that have these lists as members now have methods that return the lists themselves, replacing most of the methods that returned the object at an owned list's head. (A few have been retained due to their use in drivers or OSD.) device_t now manages subdevice and interface lists through subclasses, but has given up the work of adding and removing subdevices to machine_config. memory_manager has its tagged lists exposed, though the old rooted tag lookup methods have been removed (they were privatized already).
* TIMER_CALLBACK to TIMER_CALLBACK_MEMBER (nw) Miodrag Milanovic2016-03-071-20/+9
|
* Make octal flag part of address_space/address_space_config, not ↵ AJR2016-02-041-1/+0
| | | | (illogically) device_execute_interface (nw)
* reverting: Miodrag Milanovic2016-01-201-19/+20
| | | | | | | SHA-1: 1f90ceab075c4869298e963bf0a14a0aac2f1caa * tags are now strings (nw) fix start project for custom builds in Visual Studio (nw)
* tags are now strings (nw) Miodrag Milanovic2016-01-161-20/+19
| | | | fix start project for custom builds in Visual Studio (nw)
* clang-modernize part 1 (nw) Miodrag Milanovic2015-12-031-14/+14
|
* Cleanups and version bumpmame0168 Miodrag Milanovic2015-11-251-1/+1
|
* Rename *.c -> *.cpp in our source (nw) Miodrag Milanovic2015-11-081-0/+903