summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/driver.cpp
Commit message (Collapse)AuthorAgeFilesLines
* driver: make flipscreen setters compatible with writeline hap2022-09-021-15/+15
|
* Driver device API cleanups AJR2022-08-091-15/+1
| | | | | | - Remove the confusing driver_init virtual override. The function has been de-virtualized in most drivers that were calling it explicitly, and replaced by alternate overrides in others. - Remove MCFG_VIDEO_RESET_OVERRIDE (not used anymore). - Provide MCFG_MACHINE_START_REMOVE and MCFG_VIDEO_START_REMOVE for consistency.
* Fairly significant overhaul of Lua engine and some cleanup. Vas Crabb2020-11-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
|
* (nw) Cleanup on the way: Vas Crabb2020-03-101-31/+24
| | | | | | | | | | * 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) (#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)
* (nw) misc stuff: Vas Crabb2019-10-091-8/+2
| | | | | | | | | | | | | | | | | | | | | | | * screen: validate crystal values used for set_raw * driver: get rid of sound start/reset overrides in machine configuration * vrender0.cpp, nexus3d.cpp: corrected pixel clock crystal value * mw8080bw.cpp: turned several audio subsystems into devices * bus/sat_ctrl: don't start subdevices in device_start - the machine does it for you * mb14241.cpp: simplify handlers * fgoal.cpp: updated for simplified handlers * devfind, screen: repair some doxy comments that had rotted with refactoring * doxygen: disable warnings for undocumented things - it's most of our codebase * snowbros.cpp: restore an output level setting lost in MCFG removal There's an outstanding validation error from the HP98543 DIO video card not using a valid crystal value. Someone needs to find a picture of the card and confirm or deny the existence of the 39.504MHz crystal. The various start/reset overrides are bugs waiting to happen. It's not immediately obvious that the ones run earlier can end up being called multiple times if subsequent ones throw missing dependencies exceptions. They're a relic of when everything from the old C-style drivers was thrown into classes all jumbled together.
* Remove tilemap.h from emu.h (nw) AJR2019-08-211-0/+1
|
* Eliminate custom_port_read and use ioport finders instead (nw) AJR2018-12-261-18/+0
|
* diexec: Interrupt API changes (nw) AJR2018-05-181-1/+1
| | | | | | - 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.
* Removed DRIVER_INIT-related macros, made driver init entry in GAME/COMP/CONS ↵ MooglyGuy2018-05-131-4/+25
| | | | | | | | | | | | explicit. (#3565) * -Removed DRIVER_INIT macros in favor of explicitly-named member functions, nw * -Removed DRIVER_INIT_related macros. Made init_ prefix on driver initializers explicit. Renamed init_0 to empty_init. Fixed up GAME/COMP/CONS macro spacing. [Ryan Holtz] * Missed some files, nw * Fix compile, (nw)
* Flip screen API cleanup (nw) AJR2018-02-031-17/+0
| | | | | - Make the global flipping functions of driver_device protected so as not to be accessible from within subdevices - Eliminate the flip_screen_set_no_update kludge
* std::function and delegate both require runtime relocations, slowing down ↵ Vas Crabb2018-01-181-3/+2
| | | | startup - just use function pointers; also, most downcast, and get rid of a circular dependency between gamedrv.h and mconfig.h (nw)
* std::function is too inefficient, use a device delegate instead (nw) AJR2018-01-171-1/+2
|
* API Change: Machine configs are now a method of the owner class, and the ↵ Olivier Galibert2018-01-171-1/+1
| | | | | | | | | | prototype is simplified [O. Galibert] Beware, the device context does not follow in MCFG_FRAGMENT_ADD anymore due to the prototype change. So creating a device then configuring through a fragment doesn't work as-is. The simplest solution is just to add a MCFG_DEVICE_MODIFY at the start of the fragment with the correct tag.
* Replace driver_device::generic_pulse_irq_line with ↵ AJR2017-11-141-49/+0
| | | | device_execute_interface::pulse_input_line (nw)
* driver.cpp: Remove irqN_line_pulse interrupt generators (nw) AJR2017-10-281-8/+0
| | | | Vestigial commented-out uses remain in cdi.cpp. This does not affect nmi_line_pulse.
* detect parent/clone loops rather than extending a string forever Vas Crabb2017-07-131-0/+5
|
* let's use Zaccaria as a demo for machine config in members Vas Crabb2017-05-221-6/+8
|
* well, that causes mpu4 to take way too much memory to compile, the changes ↵ Vas Crabb2017-05-221-0/+21
| | | | to device instantiation still apply (nw)
* and ioports, too (nw) Vas Crabb2017-05-221-11/+0
|
* Move static data out of devices into the device types. This is a ↵ Vas Crabb2017-05-141-9/+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.
* Introduce u8/u16/u32/u64/s8/s16/s32/s64 Vas Crabb2016-11-191-5/+5
| | | | | | | | | | | | * 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
* Moved device_memory_interface from driver_device to dummy_space_device. ↵ smf-2016-11-031-43/+0
| | | | Exposed the dummy_space_device as machine().dummy_space(), with a trampoline in driver_device for existing callers. Debugger no longer needs to special case root_device() to avoid showing the dummy address space. [smf]
* NOTICE (TYPE NAME CONSOLIDATION) Miodrag Milanovic2016-10-221-5/+5
| | | | | 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
* Created a tiny_rom_entry structure for the purposes of rom_entry ↵ Nathan Woods2016-08-061-1/+1
| | | | | | | | declarations in code, and a first pass at the required core changes to unpack tiny_rom_entry structures at runtime. WARNING - I've done preliminary testing on a tiny build (pacman works), but nothing more. I know for a fact that a full compile fails
* driver.cpp: removed the old soundlatch methods. (nw) Ivan Vangelista2016-06-121-73/+0
|
* remove legacy calls (nw) Miodrag Milanovic2016-05-011-35/+0
|
* Make watchdog timer a separate device AJR2016-04-301-0/+4
| | | | | - Separate watchdog implementation from running_machine (once again) and driver_device - Old-style methods, now hidden behind #ifdefs, will probably be safe to remove soon
* Iterate over devices C++11 style AJR2016-04-181-3/+2
| | | | | | 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.
* reverting: Miodrag Milanovic2016-01-201-2/+2
| | | | | | | 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-2/+2
| | | | fix start project for custom builds in Visual Studio (nw)
* image_manager modernized and move some things around (nw) Miodrag Milanovic2016-01-111-1/+1
|
* move things around (nw) Miodrag Milanovic2016-01-101-0/+17
|
* clang-modernize part 1 (nw) Miodrag Milanovic2015-12-031-6/+6
|
* Rename *.c -> *.cpp in our source (nw) Miodrag Milanovic2015-11-081-0/+585