summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/netlist.cpp
Commit message (Collapse)AuthorAgeFilesLines
* netlist_sound: Fix sound_assert in debug builds AJR2021-06-071-1/+2
|
* netlist: missed some files for license change hap2021-03-111-1/+1
|
* 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.
* netlist: Remove "extended validation mode" couriersud2020-09-281-1/+0
| | | | * No longer added value.
* Revert "sound: Improved view interfaces to match usage patterns" Aaron Giles2020-09-171-4/+4
| | | | This reverts commit dc0ede3c90717ed25de0695c555b861f06344f18.
* sound: Improved view interfaces to match usage patterns Aaron Giles2020-09-171-4/+4
| | | | | | | | | | * read/write_stream_views now have an internal index * get/put/add/fill/copy now implicitly use and advance this index * new method reset() can (re)set the internal index * new method done() checks if index is past the end * new method remaining() indicates how many samples remain * get_indexed/put_indexed/etc available for random access * updated all consumers to new interfaces
* Significant internal changes to sound streams (#7169) Aaron Giles2020-09-131-35/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Significant internal changes to sound streams: Abstracted buffers of sound data into an internal stream_buffer class, with helper classes read_stream_view and write_stream_view which offer readable/writable "views" into the buffers Internal sound calculations are all done using stream_buffer::sample_t, which is a 32-bit float; existing callbacks are supported through an adapter that converts to/from signed 32-bit integers Improved behavior of dynamic stream sample rate changes to resample a short runway of data to preserve continuity across transitions Created a new stream update callback which passes a std::vector of read_stream_views for inputs, and a std::vector of write_stream_views for outputs Updated core mixer and speaker devices to the new stream update callback Updated the following sound cores to the new stream update callback: ay8910, dac, k054539, msm5205, namco, netlist, okim6295, pokey, samples, sn76496, sp0250, tms5220, tms57002, upd7759, vgm_visualizer, volt_reg Changed existing stream update callback to make inputs explicitly const and the output pointers const as well, since they are re-used across calls; fixed several engines that violated this rule Sound_manager::stream_alloc can no longer automatically connect to a device's sound_stream_update callback; instead, the stream_alloc() on the sound_device_interface should be called; updated many violators of this rule Streams can be created with SAMPLE_RATE_OUTPUT_ADAPTIVE, which dynamically tracks the sample rate of its first downstream output, or with SAMPLE_RATE_INPUT_ADAPTIVE, which tracks the sample rate of its first input Changed resampling to be a separate sound_stream that is invoked as needed, opening the path for selectable resampling implementations Added a flags parameter to the new stream allocation method that allows you to specify a that input streams should not be resampled Exposed stream_input and stream_output classes directly, simplifying access to user gains and stream names Added a simple dynamic compressor to sound_manager to provide nicer results when overdriven sound happens; compression does not affect speaker_report results Improved verbose speaker_report to print a graph of peaks over time More aggressive debugging enabled for now even in release builds (should be disabled prior to next release) via SOUND_DEBUG define in sound.h; report any assertions for fixing
* netlist: code maintenance and performance optimizations. Couriersud2020-09-051-111/+79
| | | | | | | | | | | * rename some misleading type names * remove callback_t and replace by better scalable approach * hide implementations details * move sources classes from putil.h to psources.h * reduce code complexity * improve parsing performance, parsing netlists now is twice as fast. * fix issues around multi-byte string support * moved psplit into pstrutil.h
* device_state_interface overhaul AJR2020-08-311-32/+2
| | | | | | | | | | | - device_state_entry::value and device_state_entry::set_value now do everything except the register lookup, allowing them to be made public. The debugger expression engine now uses these. - device_state_entry::dvalue and device_state_entry::set_dvalue have also been made public, theoretically permitting outside code layers to inspect and modify floating-point registers. - The double specialization of device_pseudo_state_register (now renamed device_functional_state_register) has been added to the core. - state_add now has an additional specialization that takes both a reference and a write function, using the former for reads only. - state_max_length has been eliminated in favor of obtaining the relevant info through device_state_entry::max_length. - The debugger state view no longer adds "flags" as "???" if none have been registered. - set_state_string has been removed. It was never properly implemented, and it is difficult to see how it could have been done in a useful and consistent way. - state_find_entry and its typical callers state_int and set_state_int have been inlined for some hopeful efficiency gains.
* netlist: Fix various issues around include directories. couriersud2020-08-251-1/+0
| | | | | | | | | * removed include directory src/lib/netlist from various genie files to avoid potential issues. * Code using netlist should use #include "netlist/*". * Updated includes. * Fixed standalone makefile depend target to properly deal with relative paths.
* Sound and other improvements to Sega G-80 games. (#7103) Aaron Giles2020-08-191-2/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | Sound and other improvements to Sega G-80 games: [Aaron Giles, couriersud] * Added netlist-based sound to Eliminator, Zektor, Space Fury, and Astro Blaster. * Split the Sega Universal Sound Board and Speech Boards into their own separate files. * Improved Universal Sound Board implementation for better accuracy in Star Trek and Tac/Scan. * Wrote netlist-based backend for Universal Sound Board; currently disabled due to limitations in the system. * Wrote netlist-based backend for Speech Board; currently disabled pending future sound system changes. * Implemented wait states and the vector DRAW flag to help improve timing. SP0250 Improvements: [Aaron Giles] * Matched clock divider to real chip measurements. * Fixed behavior when not fed enough data; addresses "gapping" in speech in Sega games. * Implemented accurate LFR noise generator according to real chip measurements. * Added pulse-width modulation DAC output mode for future consumption by netlist. Netlist additions: [Aaron Giles] * Added compile-time option to record nltool-compatible CSV files. * Improved CD4020 implementation. * Fixed CD4053 behavior. * Added 74139 device. * Added TL082 device. 8253 PIT changes: [Aaron Giles] * Added explicit synchronization to all writes. * Cleaned up some timing calculations to avoid double<->attotime conversions.
* netlist: Fix compile - sorry. couriersud2020-08-161-6/+0
|
* netlist: buffered_param_setter refactoring couriersud2020-08-161-28/+27
| | | | | | | | | | * Each parameter to set now has a dedicated buffered_param_setter device. * This allows different sample times per device * Updated netlist.cpp for new approach * buffered_param_setter is a template. The template parameter is a class which is expected to support the [] operator. The value passed to [] operator is the requested sample number.
* netlist: machine.time() rules. couriersud2020-08-151-11/+8
| | | | * avoid overshooting sound devices, i.e. advancing past machine.time(). * removed 2us adjustment in sound_stream_update.
* netlist: untangle sound and cpu devices. couriersud2020-08-151-63/+64
| | | | * member variables are now where they belong. * Avoid over/underclocking of netlist sound devices.
* -netlist: Typo Ryan Holtz2020-08-061-1/+1
|
* -fireone: Netlist sound now works other than the Alert trigger. [Ryan Holtz, ↵ Ryan Holtz2020-08-061-1/+1
| | | | Colin Howell, couriersud]
* -starfire: Added left/right mixer and left/right boom, but the booms don't ↵ Ryan Holtz2020-08-061-3/+2
| | | | trigger for some reason.
* netlist: Refactored pokenizer. couriersud2020-08-061-3/+3
| | | | | | | | | * Separated tokenizing and reading of tokens. * This enables caching of parsing results on the token level. * Implemented caching of token stream. * Overall this significantly improves parsing performance (~10x) * Next step towards a bare-bone nltool which does not depend on macro devices.
* netlist: source stream refactoring couriersud2020-07-281-9/+13
| | | | | * This is an infrastructure change to enable better error reporting including file/source and line numbers in the future
* netlist.cpp: Fix a crash if an exception happened during validation. couriersud2020-07-281-1/+2
|
* speaker.cpp: Add new option -speaker_report <n> to help devs tune volume (#6995) Aaron Giles2020-07-271-4/+6
| | | * Add new option speaker_report to report clipping and other statistics after each session. This replaces the previous compile-time define and offers more detail.
* netlist: remove soft reset support. couriersud2020-07-051-4/+18
| | | | | | | | * Electronic circuits and base components like resistors or capacitors do not have a reset line. You can use them to create reset circuits. There is thus no point to support soft reset, the equivalent to pressing the reset button. * Fixed some bugs around reset and start up logic. * This also fixes the "scramble F3" crash.
* various devices and drivers: removed superfluous semicolons (nw) Ivan Vangelista2020-06-291-1/+1
|
* netlist: include file refactoring. couriersud2020-06-281-7/+10
| | | | | | | | The purpose of this ongoing exercise is to remove unnecessary dependencies in header files. netlist implementations should only have access to what they need. The same applies to device implementations. Core stuff will be moved to the core subdirectory going forward.
* Fix vs2019 build Frank Palazzolo2020-06-261-1/+1
|
* srcclean and cleanup (nw) Vas Crabb2020-06-211-3/+3
|
* netlist: Fix copy elusion bug on OSX and clang < 8 [AJR, Couriersud] couriersud2020-06-141-14/+6
| | | Solution discussed with AJR in chat.
* netlist: Performance improvement and refactoring. [Couriersud] couriersud2020-06-131-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | Kidniki now achieves up to 910% when run with static solvers and with nltool. That is significant better than the 860% we have seen previously. This increase is driven by using a global memory pool in the solver code. In addition the following refactoring and code maintenance work is included. Please excuse the large commit, some of this took interfered with other work and the detail development steps were ugly. - gsl support: This commit adds pgsl.h which implements a very limited number of the functionality of the gsl header described in the c++ core guidelines. - clang-tidy fixes - A significant refactoring of palloc.h. Aligned hints were removed, they added complexity without a significant performance gain. Vector operations should better be done on special spans/views. The code has been tested on linux with g++-7, g++-9, clang-11. On Windows mingw-10 and VS2019, OSX clang-11.
* netlist: fix win32 compile (nw) couriersud2020-06-101-4/+6
| | | ... and all targets without INT128 support.
* netlist: code maintenance. (nw) couriersud2020-06-081-19/+18
| | | | | | - more c++14, use enable_if_t instead of enable_if - cleaned up the use of memory allocation arenas - reduce MACRO usage, use std::conditional where possible
* netlist: remove more macro usage, fix win float exceptions. (nw) couriersud2020-06-061-6/+2
|
* netlist: Reduce macro usage and make use of pstring utf8. (nw) couriersud2020-06-061-0/+10
|
* netlist: move multiparameter streaming into nl_interface.h (nw) couriersud2020-06-011-246/+136
|
* netlist: device factory enhancements. (nw) couriersud2020-06-011-143/+71
| | | | | | | | | Factory elements can now pass additional parameters to device constructors. This makes the design of interface objects like analog callbacks easier. The change also allowed to remove some "deep" calls into the core from the MAME interface in netlist.h
* netlist: debugger - use callbacks to access terminals. (nw) couriersud2020-06-011-2/+41
|
* netlist: small memory system cleanup. (nw) couriersud2020-05-251-5/+5
|
* netlist: move configuration entries into netlist namespace. (nw) couriersud2020-05-251-4/+4
|
* netlist: Better integretation of INT128. (nw) couriersud2020-05-241-6/+6
| | | | Also some minor optimisations bringing pong and breakout to previous performance.
* netlist: Fix OSX compile. (nw) couriersud2020-05-221-3/+3
|
* netlist: simplify factory call structure. (nw) couriersud2020-05-201-3/+6
| | | | | This change will make it a lot easier to add enhanced functionality to the factory infrastructure. Using integral constants also improves linking stability.
* netlist: improve timing accuracy for sound devices. [Couriersud] couriersud2020-05-201-38/+117
| | | Better alignment between netlist_time and attotime
* netlist: improve typesafety for source locations. (nw) couriersud2020-05-171-3/+3
| | | | | | During object creation netlist tracks the source files which provide object creation. This is later used e.g. by nltool to create documentation from source.
* netlist: code cleanup and development stage tristate [Couriersud] couriersud2020-05-151-20/+16
| | | | | | | | | | Code cleanup to better separate the following stages: - parsing - setup - run In addition preliminary native tristate support was added. Not yet production ready, please don't use it.
* netlist: Extended functionality and code cleanup. [Couriersud] couriersud2020-05-121-42/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - working macro level parameters - simplified code significantly - fixed a number of hidden issue - dead code removal It is now possible to define netlist level parameters using: static NETLIST_START(chip) DEFPARAM(parameter, 123) RES(R1, $(@.parameter)) .... NETLIST_END() NETLIST_START(main) chip(X1) PARAM(X1.parameter, 1000) ... NETLIST_END() This will pass on 1000 to R1 as a parameter. "@." will resolve to the current namespace. In this case it is X1, thus "X1.parameter. This is during parsing. During evalution, i.e. device creation, $(X1.parameter) is evaluated to 1000. This also means, that global parameters are possible and accessible ... DEFPARAM(P, 234) ... RES(R1, $(P)) or going forward RES(R1, 1000) CAP(C1, 1.0 / $(R1.R)) This opens up the path to more possibilities ... static NETLIST_START(DM9456_DIP) DEFPARAM(MODEL, "74XX") DM9456_GATE(X1) DM9456_GATE(X2) PARAM(X1.MODEL, $(@.MODEL)) PARAM(X2.MODEL, $(@.MODEL)) ... NETLIST_END() NETLIST_START(main) DM9456_DIP(X1) PARAM(X1.MODEL, "LS74XX") ... NETLIST_END() The code also has been prepared to allow something along the lines of LIBENTRY_MODEL(DM74LS00_DIP, DM7400_DIP, "LS74XX") to define a LS version on top of an DM7400_DIP bare TTL implementation. This however will need more efforts to existing devices to honour some timing adjustment in the model definition. It will already honour different output specifications between LS series and bare TTL if connected to analog components.
* appease vs2019_clang with llvm 10.0 smf-2020-04-251-3/+3
|
* netlist: rename some camel case names. (nw) couriersud2020-04-191-4/+4
|
* netlist: nltool usage and static compile changes. [Couriersud] couriersud2020-04-181-0/+8
| | | | | | | | | | | | | | | | | | | | | This commit simplifies the creation of static solvers. For this to happen the following changes were made: - nltool does no longer support the "-f netlist_file.cpp" option. All parts of netlist which used the option now expect the file to be specified after all other options. Before: nltool -t 10 -f somenetlist.cpp Now : nltool -t 10 somenetlist.cpp - The static compile command now supports an "--output" option to specify the file to be created and accepts multiple input files. To be create the static solver file for MAME use the script provided or: ./nltool --cmd static --output=src/lib/netlist/generated/static_solvers.cpp src/mame/audio/nl_*.cpp src/mame/machine/nl_*.cpp - Updated documentation and examples provided by nltool --help
* netlist: improve performance up to 65% on audio netlists. [Couriersud] couriersud2020-04-131-3/+5
| | | | | | | | | | | | | | | | | | | This commit introduces precompiled static solver code. Due to additional optimizations the compiler can use because the detail calculation steps for the solution are known e.g. the kidniki netlist sees a 100% speed increase. In all environments (windows/*nix/osx) the source for the static solver code can be created using bash src/lib/netlist/nl_create_mame_solvers.sh This will create src/lib/netlist/generated/static_solvers.cpp which is compiled into the mame binary. The script is just a temporary workaround. The intention is that nltool whill be able to create this file with one call. There are other improvements in this commit speeding up the processing of timestep and dynamic calculations.
* netlist: Reduce memory allocation calls in non-core code. (nw) couriersud2020-04-101-5/+5
|