| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Trying to replace a non-existent device or trying to add a device with
root or parent references in the path is now fatal. If you find
yourself wanting to do this, your design is probably broken.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
| |
Input and screen tags are now resolved relative to a layout's owner
device.
Easy way to demonstrate is with: mame64 intlc440 -tty ie15
Previously you'd only get the IE15 terminal's layout and you'd be unable
to use the INTELLEC 4/40 front panel. Now you'll get the choice of
layouts from both the system and the terminal device in video options.
|
|
|
|
|
|
|
|
|
|
| |
Current syntax: MCFG_DEVICE_REPLACE(tag_or_finder, TYPE, ...)
Next-generation syntax: TYPE(config.replace(), tag_or_finder, ...)
(nw) Kill off some more low-value macros that aren't needed any more,
and get rid of the token-pasting voodoo and casts in the discrete sound
macros.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Start replacing special device macros with additional constructors,
starting with ISA, INTELLEC 4 and RS-232 buses.
Allow an object finder to take on the target of another object finder.
(For a combination of the previous two things in action, see either the
INTELLEC 4 driver, or the Apple 2 PC Exporter card. Also check out
looping over a device finder array to instantiate devices in some
places. Lots of things no longer need to pass tags around.)
Start supplying default clocks for things that have a standard clock or
have all clocks internal.
Eliminate the separate DEV versions of the DEVCB_ macros. Previously,
the plain versions were a shortcut for DEVICE_SELF as the target. You
can now supply a string tag (relative to current device being
configured), an object finder (takes on the base and relative tag), or
a reference to a device/interface (only do this if you know the device
won't be replaced out from under it, but that's a safe assumption for
your subdevices). In almost all cases, you can get the effect you want
by supplying *this as the target.
Eliminate sound and CPU versions of macros. They serve no useful
purpose, provide no extra checks, make error messages longer, add
indirection, and mislead newbies into thinking there's a difference.
Remove a lot of now-unnecessary ":" prefixes binding things relative to
machine root.
Clean up some miscellaneous rot.
Examples of new functionality in use in (some more subtle than others):
* src/mame/drivers/intellec4.cpp
* src/mame/drivers/tranz330.cpp
* src/mame/drivers/osboren1.cpp
* src/mame/drivers/zorba.cpp
* src/mame/devices/smioc.cpp
* src/devices/bus/a2bus/pc_xporter.cpp
* src/devices/bus/isa/isa.h
* src/devices/bus/isa/isa.h
* src/devices/bus/intellec4/intellec4.h
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Allows defaulted clocks (see subtle example with vboy)
* Allows additional constructors (see RS232 port in tranz330)
* Allows use of device finder in place of tag in MCFG_DEVICE_ADD
* Requires out-of-line destructor for devices using incomplete types
* Requires XTAL or explicit u32 for clocks for devices with private types
Devices must still define the standard constructor. When writing
additional constructors, be aware that the constructor runs before
device_add_mconfig in the context of the existing device, not the new
device. See osborne1, zorba, tranz330, and vboy for examples of this in
use. Compilation is a bit slower, but this is temporary while
refactoring is in progress.
Eliminated the need for MCFG_SOUND_ROUTE_EX.
Removed macros from slot option configuration - they just obfuscated
code and slowed it down with needless dynamic casts, but didn't actually
simplify it.
|
|
|
|
| |
Make machine_config aware of device being configured so owner doesn't need to be passed everywhere.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Concrete device types now have a call operator that instantiates a
device.
This change means you *must* use DECLARE_DEVICE_TYPE to declare the
public interface of your device, even if it's device_t. If you want
to use private implementation classes, use DEFINE_DEVICE_TYPE_PRIVATE
and instantiate the object finders.
|
| |
|
| |
|
|
|
|
|
|
| |
* destaticify initializations (nw)
* fix this->set_screen (nw)
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
card)
|
| |
|
|
|
|
| |
find regions properly, need to work out why
|
| |
|
| |
|
|
|
|
| |
drivers are less special special - they have configuration instantiated in the usual way.
|
|
|
|
|
|
|
|
|
| |
(nw) This is a pretty minimal change. The point where the root device is added has been moved
from the MACHINE_CONFIG_START macro to the constructor of the machine configuration class (made
possible by giving drivers their own device types). This isn't the final change in this area.
The root device is still being handled specially in that its configuration comes from the game
driver structure. This needs to be harmonised with regular devices. But that's a job for
another day.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 536990e77b49ccc50ef275bfbf1018cc29c16154.
Conflicts:
src/frontend/mame/mame.cpp
Sorry, but this change was half-baked. It breaks a lot of existing
functionality and clearly hasn't been tested in more than a tiny subset
of use cases. Please play this work back onto your own branch, and test
it before submitting another PR.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is an overhaul to how MAME handles options to provide a better foundation for what MAME is already doing in practice. Previously, core_options was designed to provide an input/output facility for reading options from the command line and INI files. However, the current needs (image/slot/get_default_card_software calculus and MewUI) go way beyond that.
Broadly, this PR makes the following changes:
* core_options now has an extensibility mechanism, so one can register options that behave dramatically differently
* With that foundation, emu_options now encapsulates all of the funky image/slot/get_default_card_software calculus that were previously handled by static methods in mameopts.cpp. Changes to emu_options should not automatically cascade in such a way so that it stays in a consistent state
* emu_options no longer provides direct access to the slot_options/image_options maps; there are simpler API functions that control these capabilities
* Many core_options functions that expose internal data structures (e.g. - priority) that were only really needed because of previous (now obsolete) techniques have been removed.
* core_options is now exception based (rather than dumping text to an std::string). The burden is on the caller to catch these, and discern between warnings and errors as needed.
Obviously this is a risky change; that's why this is being submitted at the start of the dev cycle.
|
|
|
|
|
|
|
|
| |
This should address outstanding concerns with PR#2231. I'm trying to turn emu_options into a self contained structure that encapsulates behaviors related to options, including the gymnastics pertaining to image/slot loading and interactions with get_default_card_software() and "just works".
When the MAME 0.186 development cycle starts up, I hope to take this further. I want to make core_options::entry an abstract base class so that the entries associated with image options and slot options can derive from it. This will eliminate the current need for emu_options to directly expose maps for image and slot options.
For now, I'm in stabilization mode, and I hope to get things working for a stable 0.185 release.
|
|
|
|
|
|
|
|
|
|
| |
Prior to this change, options for images and slots were stored in the emu_options collection. Anything that might restart the emulation (such as slot changes and images that reset on load) had to manipulate the emu_options structure directly. The dynamic nature of images and slots meant that some elaborate conventions for setting up this collection had to be understood by clients.
After this change, emu_options has two new members (image_options and slot_options) that expose image and slot selections via an std::map. Anything that changes images or slots in a fashion that needs to persist across sessions needs to modify these data structures. Additionally, some of the hairly logic (e.g. - get_default_card_software) now records its data here rather than trying to subvert the core_options system.
This is how MT#6531 was fixed; now when diimage.cpp sees an image that resets on load, it just modifies the image_options structure and forces a reset. This allowed some further cleanups to happen within diimage.
This should be considered a very risky change, and scrutiny/feedback is welcome. In particular, there seems to be functionality surrounding device bioses that I'm not 100% sure how it works; the syntax seems to imply that it only works on slot devices.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
| |
- 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
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
- Remove emu.h's stealth include of emuopts.h through mconfig.h; reduce dependency on emuopts.h in other headers and source files.
- MCFG_CPU_FORCE_NO_DRC is now a CPU configuration parameter rather than a global one; it still works to override the -drc option setting.
|
|
|
|
|
|
|
|
| |
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).
|
|
|
|
|
|
|
| |
SHA-1: 1f90ceab075c4869298e963bf0a14a0aac2f1caa
* tags are now strings (nw)
fix start project for custom builds in Visual Studio (nw)
|
|
|
|
|
|
| |
things are just cleanup (nw)"
This reverts commit 841a55985e60a16f745422fb9aa06c420d8be8ba.
|
|
|
|
| |
just cleanup (nw)
|
|
|
|
| |
fix start project for custom builds in Visual Studio (nw)
|
|
|
|
|
|
| |
- strprintf is unaltered, but strformat now takes one fewer argument
- state_string_export still fills a buffer, but has been made const
- get_default_card_software now takes no arguments but returns a string
|
| |
|
|
|
|
| |
GCC 4.9.0 and up, Clang 3.4.0 and up, and VS2013 and up [Miodrag Milanovic]
|
|
|